
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

REDIRECT * copy_redirect(REDIRECT *redirect)

{
  WORD_DESC *pWVar1;
  REDIRECT *pRVar2;
  uint uVar3;
  size_t sVar4;
  char *__dest;
  char *__s;
  WORD_DESC *pWVar5;
  
  pRVar2 = (REDIRECT *)xmalloc(0x1c);
  pRVar2->next = redirect->next;
  pRVar2->redirector = redirect->redirector;
  pRVar2->rflags = redirect->rflags;
  pRVar2->flags = redirect->flags;
  pRVar2->instruction = redirect->instruction;
  pRVar2->redirectee = redirect->redirectee;
  pRVar2->here_doc_eof = redirect->here_doc_eof;
  if ((redirect->rflags & 1) != 0) {
    pWVar1 = (redirect->redirector).filename;
    pWVar5 = make_bare_word(pWVar1->word);
    pWVar5->flags = pWVar1->flags;
    (pRVar2->redirector).filename = pWVar5;
  }
  if (redirect->instruction < (r_move_output|r_reading_until)) {
    uVar3 = 1 << ((byte)redirect->instruction & 0x1f);
    if ((uVar3 & 0xe7c2f) == 0) {
      if ((uVar3 & 0x110) == 0) {
        return pRVar2;
      }
      __s = redirect->here_doc_eof;
      if (__s != (char *)0x0) {
        sVar4 = strlen(__s);
        __dest = (char *)xmalloc(sVar4 + 1);
        __s = strcpy(__dest,__s);
      }
      pRVar2->here_doc_eof = __s;
    }
    pWVar1 = (redirect->redirectee).filename;
    pWVar5 = make_bare_word(pWVar1->word);
    pWVar5->flags = pWVar1->flags;
    (pRVar2->redirectee).filename = pWVar5;
  }
  return pRVar2;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 * copy_redirect(undefined4 *param_1)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  uint uVar3;
  size_t sVar4;
  char *__dest;
  char *__s;
  int iVar5;
  
  puVar2 = (undefined4 *)xmalloc(0x1c);
  *puVar2 = *param_1;
  puVar2[1] = param_1[1];
  puVar2[2] = param_1[2];
  puVar2[3] = param_1[3];
  puVar2[4] = param_1[4];
  puVar2[5] = param_1[5];
  puVar2[6] = param_1[6];
  if ((*(byte *)(param_1 + 2) & 1) != 0) {
    puVar1 = (undefined4 *)param_1[1];
    iVar5 = make_bare_word(*puVar1);
    *(undefined4 *)(iVar5 + 4) = puVar1[1];
    puVar2[1] = iVar5;
  }
  if ((uint)param_1[4] < 0x14) {
    uVar3 = 1 << ((byte)param_1[4] & 0x1f);
    if ((uVar3 & 0xe7c2f) == 0) {
      if ((uVar3 & 0x110) == 0) {
        return puVar2;
      }
      __s = (char *)param_1[6];
      if (__s != (char *)0x0) {
        sVar4 = strlen(__s);
        __dest = (char *)xmalloc(sVar4 + 1);
        __s = strcpy(__dest,__s);
      }
      puVar2[6] = __s;
    }
    puVar1 = (undefined4 *)param_1[5];
    iVar5 = make_bare_word(*puVar1);
    *(undefined4 *)(iVar5 + 4) = puVar1[1];
    puVar2[5] = iVar5;
  }
  return puVar2;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00031ed0
ADD EBX,0xf11c7
SUB ESP,0x18
MOV ESI,dword ptr [ESP + 0x2c]
PUSH 0x1c
CALL 0x00099200
ADD ESP,0x10
MOV EDI,EAX
MOV EAX,dword ptr [ESI]
MOV dword ptr [EDI],EAX
MOV EAX,dword ptr [ESI + 0x4]
MOV dword ptr [EDI + 0x4],EAX
MOV EAX,dword ptr [ESI + 0x8]
MOV dword ptr [EDI + 0x8],EAX
MOV EAX,dword ptr [ESI + 0xc]
MOV dword ptr [EDI + 0xc],EAX
MOV EAX,dword ptr [ESI + 0x10]
MOV dword ptr [EDI + 0x10],EAX
MOV EAX,dword ptr [ESI + 0x14]
MOV dword ptr [EDI + 0x14],EAX
MOV EAX,dword ptr [ESI + 0x18]
MOV dword ptr [EDI + 0x18],EAX
TEST byte ptr [ESI + 0x8],0x1
JNZ 0x00058ef0
MOV ECX,dword ptr [ESI + 0x10]
CMP ECX,0x13
JA 0x00058ee2
MOV EAX,0x1
SHL EAX,CL
TEST EAX,0xe7c2f
JNZ 0x00058ec9
TEST EAX,0x110
JZ 0x00058ee2
MOV EBP,dword ptr [ESI + 0x18]
TEST EBP,EBP
JZ 0x00058ec6
SUB ESP,0xc
PUSH EBP
CALL 0x0002f760
ADD EAX,0x1
MOV dword ptr [ESP],EAX
CALL 0x00099200
POP EDX
POP ECX
PUSH EBP
PUSH EAX
CALL 0x0002f580
ADD ESP,0x10
MOV EBP,EAX
MOV dword ptr [EDI + 0x18],EBP
MOV ESI,dword ptr [ESI + 0x14]
SUB ESP,0xc
PUSH dword ptr [ESI]
CALL 0x00042a50
MOV EDX,dword ptr [ESI + 0x4]
ADD ESP,0x10
MOV dword ptr [EAX + 0x4],EDX
MOV dword ptr [EDI + 0x14],EAX
ADD ESP,0xc
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EBP,dword ptr [ESI + 0x4]
SUB ESP,0xc
PUSH dword ptr [EBP]
CALL 0x00042a50
MOV EDX,dword ptr [EBP + 0x4]
ADD ESP,0x10
MOV dword ptr [EAX + 0x4],EDX
MOV dword ptr [EDI + 0x4],EAX
JMP 0x00058e80
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * copy_redirect(undefined4 *param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}\n\n" comment (function_definition "undefined4 * copy_redirect(undefined4 *param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}" type_identifier (pointer_declarator "* copy_redirect(undefined4 *param_1)" * (function_declarator "copy_redirect(undefined4 *param_1)" identifier (parameter_list "(undefined4 *param_1)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "puVar2 = (undefined4 *)xmalloc(0x1c);" (assignment_expression "puVar2 = (undefined4 *)xmalloc(0x1c)" identifier = (cast_expression "(undefined4 *)xmalloc(0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x1c)" identifier (argument_list "(0x1c)" ( number_literal ))))) ;) (expression_statement "*puVar2 = *param_1;" (assignment_expression "*puVar2 = *param_1" (pointer_expression "*puVar2" * identifier) = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "puVar2[1] = param_1[1];" (assignment_expression "puVar2[1] = param_1[1]" (subscript_expression "puVar2[1]" identifier [ number_literal ]) = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "puVar2[2] = param_1[2];" (assignment_expression "puVar2[2] = param_1[2]" (subscript_expression "puVar2[2]" identifier [ number_literal ]) = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "puVar2[3] = param_1[3];" (assignment_expression "puVar2[3] = param_1[3]" (subscript_expression "puVar2[3]" identifier [ number_literal ]) = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "puVar2[4] = param_1[4];" (assignment_expression "puVar2[4] = param_1[4]" (subscript_expression "puVar2[4]" identifier [ number_literal ]) = (subscript_expression "param_1[4]" identifier [ number_literal ])) ;) (expression_statement "puVar2[5] = param_1[5];" (assignment_expression "puVar2[5] = param_1[5]" (subscript_expression "puVar2[5]" identifier [ number_literal ]) = (subscript_expression "param_1[5]" identifier [ number_literal ])) ;) (expression_statement "puVar2[6] = param_1[6];" (assignment_expression "puVar2[6] = param_1[6]" (subscript_expression "puVar2[6]" identifier [ number_literal ]) = (subscript_expression "param_1[6]" identifier [ number_literal ])) ;) (if_statement "if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }" if (parenthesized_expression "((*(byte *)(param_1 + 2) & 1) != 0)" ( (binary_expression "(*(byte *)(param_1 + 2) & 1) != 0" (parenthesized_expression "(*(byte *)(param_1 + 2) & 1)" ( (binary_expression "*(byte *)(param_1 + 2) & 1" (pointer_expression "*(byte *)(param_1 + 2)" * (cast_expression "(byte *)(param_1 + 2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }" { (expression_statement "puVar1 = (undefined4 *)param_1[1];" (assignment_expression "puVar1 = (undefined4 *)param_1[1]" identifier = (cast_expression "(undefined4 *)param_1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (expression_statement "iVar5 = make_bare_word(*puVar1);" (assignment_expression "iVar5 = make_bare_word(*puVar1)" identifier = (call_expression "make_bare_word(*puVar1)" identifier (argument_list "(*puVar1)" ( (pointer_expression "*puVar1" * identifier) )))) ;) (expression_statement "*(undefined4 *)(iVar5 + 4) = puVar1[1];" (assignment_expression "*(undefined4 *)(iVar5 + 4) = puVar1[1]" (pointer_expression "*(undefined4 *)(iVar5 + 4)" * (cast_expression "(undefined4 *)(iVar5 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + 4)" ( (binary_expression "iVar5 + 4" identifier + number_literal) )))) = (subscript_expression "puVar1[1]" identifier [ number_literal ])) ;) (expression_statement "puVar2[1] = iVar5;" (assignment_expression "puVar2[1] = iVar5" (subscript_expression "puVar2[1]" identifier [ number_literal ]) = identifier) ;) })) (if_statement "if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }" if (parenthesized_expression "((uint)param_1[4] < 0x14)" ( (binary_expression "(uint)param_1[4] < 0x14" (cast_expression "(uint)param_1[4]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[4]" identifier [ number_literal ])) < number_literal) )) (compound_statement "{\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }" { (expression_statement "uVar3 = 1 << ((byte)param_1[4] & 0x1f);" (assignment_expression "uVar3 = 1 << ((byte)param_1[4] & 0x1f)" identifier = (binary_expression "1 << ((byte)param_1[4] & 0x1f)" number_literal << (parenthesized_expression "((byte)param_1[4] & 0x1f)" ( (binary_expression "(byte)param_1[4] & 0x1f" (cast_expression "(byte)param_1[4]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "param_1[4]" identifier [ number_literal ])) & number_literal) )))) ;) (if_statement "if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }" if (parenthesized_expression "((uVar3 & 0xe7c2f) == 0)" ( (binary_expression "(uVar3 & 0xe7c2f) == 0" (parenthesized_expression "(uVar3 & 0xe7c2f)" ( (binary_expression "uVar3 & 0xe7c2f" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }" { (if_statement "if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }" if (parenthesized_expression "((uVar3 & 0x110) == 0)" ( (binary_expression "(uVar3 & 0x110) == 0" (parenthesized_expression "(uVar3 & 0x110)" ( (binary_expression "uVar3 & 0x110" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n        return puVar2;\n      }" { (return_statement "return puVar2;" return identifier ;) })) (expression_statement "__s = (char *)param_1[6];" (assignment_expression "__s = (char *)param_1[6]" identifier = (cast_expression "(char *)param_1[6]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[6]" identifier [ number_literal ]))) ;) (if_statement "if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" if (parenthesized_expression "(__s != (char *)0x0)" ( (binary_expression "__s != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" { (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "__dest = (char *)xmalloc(sVar4 + 1);" (assignment_expression "__dest = (char *)xmalloc(sVar4 + 1)" identifier = (cast_expression "(char *)xmalloc(sVar4 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar4 + 1)" identifier (argument_list "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) ))))) ;) (expression_statement "__s = strcpy(__dest,__s);" (assignment_expression "__s = strcpy(__dest,__s)" identifier = (call_expression "strcpy(__dest,__s)" identifier (argument_list "(__dest,__s)" ( identifier , identifier )))) ;) })) (expression_statement "puVar2[6] = __s;" (assignment_expression "puVar2[6] = __s" (subscript_expression "puVar2[6]" identifier [ number_literal ]) = identifier) ;) })) (expression_statement "puVar1 = (undefined4 *)param_1[5];" (assignment_expression "puVar1 = (undefined4 *)param_1[5]" identifier = (cast_expression "(undefined4 *)param_1[5]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ]))) ;) (expression_statement "iVar5 = make_bare_word(*puVar1);" (assignment_expression "iVar5 = make_bare_word(*puVar1)" identifier = (call_expression "make_bare_word(*puVar1)" identifier (argument_list "(*puVar1)" ( (pointer_expression "*puVar1" * identifier) )))) ;) (expression_statement "*(undefined4 *)(iVar5 + 4) = puVar1[1];" (assignment_expression "*(undefined4 *)(iVar5 + 4) = puVar1[1]" (pointer_expression "*(undefined4 *)(iVar5 + 4)" * (cast_expression "(undefined4 *)(iVar5 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + 4)" ( (binary_expression "iVar5 + 4" identifier + number_literal) )))) = (subscript_expression "puVar1[1]" identifier [ number_literal ])) ;) (expression_statement "puVar2[5] = iVar5;" (assignment_expression "puVar2[5] = iVar5" (subscript_expression "puVar2[5]" identifier [ number_literal ]) = identifier) ;) })) (return_statement "return puVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nREDIRECT * copy_redirect(REDIRECT *redirect)\n\n{\n  WORD_DESC *pWVar1;\n  REDIRECT *pRVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  WORD_DESC *pWVar5;\n  \n  pRVar2 = (REDIRECT *)xmalloc(0x1c);\n  pRVar2->next = redirect->next;\n  pRVar2->redirector = redirect->redirector;\n  pRVar2->rflags = redirect->rflags;\n  pRVar2->flags = redirect->flags;\n  pRVar2->instruction = redirect->instruction;\n  pRVar2->redirectee = redirect->redirectee;\n  pRVar2->here_doc_eof = redirect->here_doc_eof;\n  if ((redirect->rflags & 1) != 0) {\n    pWVar1 = (redirect->redirector).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirector).filename = pWVar5;\n  }\n  if (redirect->instruction < (r_move_output|r_reading_until)) {\n    uVar3 = 1 << ((byte)redirect->instruction & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }\n    pWVar1 = (redirect->redirectee).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirectee).filename = pWVar5;\n  }\n  return pRVar2;\n}\n\n" comment comment (function_definition "REDIRECT * copy_redirect(REDIRECT *redirect)\n\n{\n  WORD_DESC *pWVar1;\n  REDIRECT *pRVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  WORD_DESC *pWVar5;\n  \n  pRVar2 = (REDIRECT *)xmalloc(0x1c);\n  pRVar2->next = redirect->next;\n  pRVar2->redirector = redirect->redirector;\n  pRVar2->rflags = redirect->rflags;\n  pRVar2->flags = redirect->flags;\n  pRVar2->instruction = redirect->instruction;\n  pRVar2->redirectee = redirect->redirectee;\n  pRVar2->here_doc_eof = redirect->here_doc_eof;\n  if ((redirect->rflags & 1) != 0) {\n    pWVar1 = (redirect->redirector).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirector).filename = pWVar5;\n  }\n  if (redirect->instruction < (r_move_output|r_reading_until)) {\n    uVar3 = 1 << ((byte)redirect->instruction & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }\n    pWVar1 = (redirect->redirectee).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirectee).filename = pWVar5;\n  }\n  return pRVar2;\n}" type_identifier (pointer_declarator "* copy_redirect(REDIRECT *redirect)" * (function_declarator "copy_redirect(REDIRECT *redirect)" identifier (parameter_list "(REDIRECT *redirect)" ( (parameter_declaration "REDIRECT *redirect" type_identifier (pointer_declarator "*redirect" * identifier)) )))) (compound_statement "{\n  WORD_DESC *pWVar1;\n  REDIRECT *pRVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  WORD_DESC *pWVar5;\n  \n  pRVar2 = (REDIRECT *)xmalloc(0x1c);\n  pRVar2->next = redirect->next;\n  pRVar2->redirector = redirect->redirector;\n  pRVar2->rflags = redirect->rflags;\n  pRVar2->flags = redirect->flags;\n  pRVar2->instruction = redirect->instruction;\n  pRVar2->redirectee = redirect->redirectee;\n  pRVar2->here_doc_eof = redirect->here_doc_eof;\n  if ((redirect->rflags & 1) != 0) {\n    pWVar1 = (redirect->redirector).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirector).filename = pWVar5;\n  }\n  if (redirect->instruction < (r_move_output|r_reading_until)) {\n    uVar3 = 1 << ((byte)redirect->instruction & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }\n    pWVar1 = (redirect->redirectee).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirectee).filename = pWVar5;\n  }\n  return pRVar2;\n}" { (declaration "WORD_DESC *pWVar1;" type_identifier (pointer_declarator "*pWVar1" * identifier) ;) (declaration "REDIRECT *pRVar2;" type_identifier (pointer_declarator "*pRVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "WORD_DESC *pWVar5;" type_identifier (pointer_declarator "*pWVar5" * identifier) ;) (expression_statement "pRVar2 = (REDIRECT *)xmalloc(0x1c);" (assignment_expression "pRVar2 = (REDIRECT *)xmalloc(0x1c)" identifier = (cast_expression "(REDIRECT *)xmalloc(0x1c)" ( (type_descriptor "REDIRECT *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x1c)" identifier (argument_list "(0x1c)" ( number_literal ))))) ;) (expression_statement "pRVar2->next = redirect->next;" (assignment_expression "pRVar2->next = redirect->next" (field_expression "pRVar2->next" identifier -> field_identifier) = (field_expression "redirect->next" identifier -> field_identifier)) ;) (expression_statement "pRVar2->redirector = redirect->redirector;" (assignment_expression "pRVar2->redirector = redirect->redirector" (field_expression "pRVar2->redirector" identifier -> field_identifier) = (field_expression "redirect->redirector" identifier -> field_identifier)) ;) (expression_statement "pRVar2->rflags = redirect->rflags;" (assignment_expression "pRVar2->rflags = redirect->rflags" (field_expression "pRVar2->rflags" identifier -> field_identifier) = (field_expression "redirect->rflags" identifier -> field_identifier)) ;) (expression_statement "pRVar2->flags = redirect->flags;" (assignment_expression "pRVar2->flags = redirect->flags" (field_expression "pRVar2->flags" identifier -> field_identifier) = (field_expression "redirect->flags" identifier -> field_identifier)) ;) (expression_statement "pRVar2->instruction = redirect->instruction;" (assignment_expression "pRVar2->instruction = redirect->instruction" (field_expression "pRVar2->instruction" identifier -> field_identifier) = (field_expression "redirect->instruction" identifier -> field_identifier)) ;) (expression_statement "pRVar2->redirectee = redirect->redirectee;" (assignment_expression "pRVar2->redirectee = redirect->redirectee" (field_expression "pRVar2->redirectee" identifier -> field_identifier) = (field_expression "redirect->redirectee" identifier -> field_identifier)) ;) (expression_statement "pRVar2->here_doc_eof = redirect->here_doc_eof;" (assignment_expression "pRVar2->here_doc_eof = redirect->here_doc_eof" (field_expression "pRVar2->here_doc_eof" identifier -> field_identifier) = (field_expression "redirect->here_doc_eof" identifier -> field_identifier)) ;) (if_statement "if ((redirect->rflags & 1) != 0) {\n    pWVar1 = (redirect->redirector).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirector).filename = pWVar5;\n  }" if (parenthesized_expression "((redirect->rflags & 1) != 0)" ( (binary_expression "(redirect->rflags & 1) != 0" (parenthesized_expression "(redirect->rflags & 1)" ( (binary_expression "redirect->rflags & 1" (field_expression "redirect->rflags" identifier -> field_identifier) & number_literal) )) != number_literal) )) (compound_statement "{\n    pWVar1 = (redirect->redirector).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirector).filename = pWVar5;\n  }" { (expression_statement "pWVar1 = (redirect->redirector).filename;" (assignment_expression "pWVar1 = (redirect->redirector).filename" identifier = (field_expression "(redirect->redirector).filename" (parenthesized_expression "(redirect->redirector)" ( (field_expression "redirect->redirector" identifier -> field_identifier) )) . field_identifier)) ;) (expression_statement "pWVar5 = make_bare_word(pWVar1->word);" (assignment_expression "pWVar5 = make_bare_word(pWVar1->word)" identifier = (call_expression "make_bare_word(pWVar1->word)" identifier (argument_list "(pWVar1->word)" ( (field_expression "pWVar1->word" identifier -> field_identifier) )))) ;) (expression_statement "pWVar5->flags = pWVar1->flags;" (assignment_expression "pWVar5->flags = pWVar1->flags" (field_expression "pWVar5->flags" identifier -> field_identifier) = (field_expression "pWVar1->flags" identifier -> field_identifier)) ;) (expression_statement "(pRVar2->redirector).filename = pWVar5;" (assignment_expression "(pRVar2->redirector).filename = pWVar5" (field_expression "(pRVar2->redirector).filename" (parenthesized_expression "(pRVar2->redirector)" ( (field_expression "pRVar2->redirector" identifier -> field_identifier) )) . field_identifier) = identifier) ;) })) (if_statement "if (redirect->instruction < (r_move_output|r_reading_until)) {\n    uVar3 = 1 << ((byte)redirect->instruction & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }\n    pWVar1 = (redirect->redirectee).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirectee).filename = pWVar5;\n  }" if (parenthesized_expression "(redirect->instruction < (r_move_output|r_reading_until))" ( (binary_expression "redirect->instruction < (r_move_output|r_reading_until)" (field_expression "redirect->instruction" identifier -> field_identifier) < (parenthesized_expression "(r_move_output|r_reading_until)" ( (binary_expression "r_move_output|r_reading_until" identifier | identifier) ))) )) (compound_statement "{\n    uVar3 = 1 << ((byte)redirect->instruction & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }\n    pWVar1 = (redirect->redirectee).filename;\n    pWVar5 = make_bare_word(pWVar1->word);\n    pWVar5->flags = pWVar1->flags;\n    (pRVar2->redirectee).filename = pWVar5;\n  }" { (expression_statement "uVar3 = 1 << ((byte)redirect->instruction & 0x1f);" (assignment_expression "uVar3 = 1 << ((byte)redirect->instruction & 0x1f)" identifier = (binary_expression "1 << ((byte)redirect->instruction & 0x1f)" number_literal << (parenthesized_expression "((byte)redirect->instruction & 0x1f)" ( (binary_expression "(byte)redirect->instruction & 0x1f" (cast_expression "(byte)redirect->instruction" ( (type_descriptor "byte" type_identifier) ) (field_expression "redirect->instruction" identifier -> field_identifier)) & number_literal) )))) ;) (if_statement "if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }" if (parenthesized_expression "((uVar3 & 0xe7c2f) == 0)" ( (binary_expression "(uVar3 & 0xe7c2f) == 0" (parenthesized_expression "(uVar3 & 0xe7c2f)" ( (binary_expression "uVar3 & 0xe7c2f" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }\n      __s = redirect->here_doc_eof;\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      pRVar2->here_doc_eof = __s;\n    }" { (if_statement "if ((uVar3 & 0x110) == 0) {\n        return pRVar2;\n      }" if (parenthesized_expression "((uVar3 & 0x110) == 0)" ( (binary_expression "(uVar3 & 0x110) == 0" (parenthesized_expression "(uVar3 & 0x110)" ( (binary_expression "uVar3 & 0x110" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n        return pRVar2;\n      }" { (return_statement "return pRVar2;" return identifier ;) })) (expression_statement "__s = redirect->here_doc_eof;" (assignment_expression "__s = redirect->here_doc_eof" identifier = (field_expression "redirect->here_doc_eof" identifier -> field_identifier)) ;) (if_statement "if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" if (parenthesized_expression "(__s != (char *)0x0)" ( (binary_expression "__s != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" { (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "__dest = (char *)xmalloc(sVar4 + 1);" (assignment_expression "__dest = (char *)xmalloc(sVar4 + 1)" identifier = (cast_expression "(char *)xmalloc(sVar4 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar4 + 1)" identifier (argument_list "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) ))))) ;) (expression_statement "__s = strcpy(__dest,__s);" (assignment_expression "__s = strcpy(__dest,__s)" identifier = (call_expression "strcpy(__dest,__s)" identifier (argument_list "(__dest,__s)" ( identifier , identifier )))) ;) })) (expression_statement "pRVar2->here_doc_eof = __s;" (assignment_expression "pRVar2->here_doc_eof = __s" (field_expression "pRVar2->here_doc_eof" identifier -> field_identifier) = identifier) ;) })) (expression_statement "pWVar1 = (redirect->redirectee).filename;" (assignment_expression "pWVar1 = (redirect->redirectee).filename" identifier = (field_expression "(redirect->redirectee).filename" (parenthesized_expression "(redirect->redirectee)" ( (field_expression "redirect->redirectee" identifier -> field_identifier) )) . field_identifier)) ;) (expression_statement "pWVar5 = make_bare_word(pWVar1->word);" (assignment_expression "pWVar5 = make_bare_word(pWVar1->word)" identifier = (call_expression "make_bare_word(pWVar1->word)" identifier (argument_list "(pWVar1->word)" ( (field_expression "pWVar1->word" identifier -> field_identifier) )))) ;) (expression_statement "pWVar5->flags = pWVar1->flags;" (assignment_expression "pWVar5->flags = pWVar1->flags" (field_expression "pWVar5->flags" identifier -> field_identifier) = (field_expression "pWVar1->flags" identifier -> field_identifier)) ;) (expression_statement "(pRVar2->redirectee).filename = pWVar5;" (assignment_expression "(pRVar2->redirectee).filename = pWVar5" (field_expression "(pRVar2->redirectee).filename" (parenthesized_expression "(pRVar2->redirectee)" ( (field_expression "pRVar2->redirectee" identifier -> field_identifier) )) . field_identifier) = identifier) ;) })) (return_statement "return pRVar2;" return identifier ;) })))
(translation_unit "undefined4 * copy_redirect(undefined4 *param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}\n\n" (function_definition "undefined4 * copy_redirect(undefined4 *param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}" type_identifier (pointer_declarator "* copy_redirect(undefined4 *param_1)" * (function_declarator "copy_redirect(undefined4 *param_1)" identifier (parameter_list "(undefined4 *param_1)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "char *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "puVar2 = (undefined4 *)xmalloc(0x1c);" (assignment_expression "puVar2 = (undefined4 *)xmalloc(0x1c)" identifier = (cast_expression "(undefined4 *)xmalloc(0x1c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x1c)" identifier (argument_list "(0x1c)" ( number_literal ))))) ;) (expression_statement "*puVar2 = *param_1;" (assignment_expression "*puVar2 = *param_1" (pointer_expression "*puVar2" * identifier) = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "puVar2[1] = param_1[1];" (assignment_expression "puVar2[1] = param_1[1]" (subscript_expression "puVar2[1]" identifier [ number_literal ]) = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (expression_statement "puVar2[2] = param_1[2];" (assignment_expression "puVar2[2] = param_1[2]" (subscript_expression "puVar2[2]" identifier [ number_literal ]) = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (expression_statement "puVar2[3] = param_1[3];" (assignment_expression "puVar2[3] = param_1[3]" (subscript_expression "puVar2[3]" identifier [ number_literal ]) = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "puVar2[4] = param_1[4];" (assignment_expression "puVar2[4] = param_1[4]" (subscript_expression "puVar2[4]" identifier [ number_literal ]) = (subscript_expression "param_1[4]" identifier [ number_literal ])) ;) (expression_statement "puVar2[5] = param_1[5];" (assignment_expression "puVar2[5] = param_1[5]" (subscript_expression "puVar2[5]" identifier [ number_literal ]) = (subscript_expression "param_1[5]" identifier [ number_literal ])) ;) (expression_statement "puVar2[6] = param_1[6];" (assignment_expression "puVar2[6] = param_1[6]" (subscript_expression "puVar2[6]" identifier [ number_literal ]) = (subscript_expression "param_1[6]" identifier [ number_literal ])) ;) (if_statement "if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }" if (parenthesized_expression "((*(byte *)(param_1 + 2) & 1) != 0)" ( (binary_expression "(*(byte *)(param_1 + 2) & 1) != 0" (parenthesized_expression "(*(byte *)(param_1 + 2) & 1)" ( (binary_expression "*(byte *)(param_1 + 2) & 1" (pointer_expression "*(byte *)(param_1 + 2)" * (cast_expression "(byte *)(param_1 + 2)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) & number_literal) )) != number_literal) )) (compound_statement "{\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }" { (expression_statement "puVar1 = (undefined4 *)param_1[1];" (assignment_expression "puVar1 = (undefined4 *)param_1[1]" identifier = (cast_expression "(undefined4 *)param_1[1]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) ;) (expression_statement "iVar5 = make_bare_word(*puVar1);" (assignment_expression "iVar5 = make_bare_word(*puVar1)" identifier = (call_expression "make_bare_word(*puVar1)" identifier (argument_list "(*puVar1)" ( (pointer_expression "*puVar1" * identifier) )))) ;) (expression_statement "*(undefined4 *)(iVar5 + 4) = puVar1[1];" (assignment_expression "*(undefined4 *)(iVar5 + 4) = puVar1[1]" (pointer_expression "*(undefined4 *)(iVar5 + 4)" * (cast_expression "(undefined4 *)(iVar5 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + 4)" ( (binary_expression "iVar5 + 4" identifier + number_literal) )))) = (subscript_expression "puVar1[1]" identifier [ number_literal ])) ;) (expression_statement "puVar2[1] = iVar5;" (assignment_expression "puVar2[1] = iVar5" (subscript_expression "puVar2[1]" identifier [ number_literal ]) = identifier) ;) })) (if_statement "if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }" if (parenthesized_expression "((uint)param_1[4] < 0x14)" ( (binary_expression "(uint)param_1[4] < 0x14" (cast_expression "(uint)param_1[4]" ( (type_descriptor "uint" type_identifier) ) (subscript_expression "param_1[4]" identifier [ number_literal ])) < number_literal) )) (compound_statement "{\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }" { (expression_statement "uVar3 = 1 << ((byte)param_1[4] & 0x1f);" (assignment_expression "uVar3 = 1 << ((byte)param_1[4] & 0x1f)" identifier = (binary_expression "1 << ((byte)param_1[4] & 0x1f)" number_literal << (parenthesized_expression "((byte)param_1[4] & 0x1f)" ( (binary_expression "(byte)param_1[4] & 0x1f" (cast_expression "(byte)param_1[4]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "param_1[4]" identifier [ number_literal ])) & number_literal) )))) ;) (if_statement "if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }" if (parenthesized_expression "((uVar3 & 0xe7c2f) == 0)" ( (binary_expression "(uVar3 & 0xe7c2f) == 0" (parenthesized_expression "(uVar3 & 0xe7c2f)" ( (binary_expression "uVar3 & 0xe7c2f" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }" { (if_statement "if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }" if (parenthesized_expression "((uVar3 & 0x110) == 0)" ( (binary_expression "(uVar3 & 0x110) == 0" (parenthesized_expression "(uVar3 & 0x110)" ( (binary_expression "uVar3 & 0x110" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n        return puVar2;\n      }" { (return_statement "return puVar2;" return identifier ;) })) (expression_statement "__s = (char *)param_1[6];" (assignment_expression "__s = (char *)param_1[6]" identifier = (cast_expression "(char *)param_1[6]" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[6]" identifier [ number_literal ]))) ;) (if_statement "if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" if (parenthesized_expression "(__s != (char *)0x0)" ( (binary_expression "__s != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" { (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (expression_statement "__dest = (char *)xmalloc(sVar4 + 1);" (assignment_expression "__dest = (char *)xmalloc(sVar4 + 1)" identifier = (cast_expression "(char *)xmalloc(sVar4 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(sVar4 + 1)" identifier (argument_list "(sVar4 + 1)" ( (binary_expression "sVar4 + 1" identifier + number_literal) ))))) ;) (expression_statement "__s = strcpy(__dest,__s);" (assignment_expression "__s = strcpy(__dest,__s)" identifier = (call_expression "strcpy(__dest,__s)" identifier (argument_list "(__dest,__s)" ( identifier , identifier )))) ;) })) (expression_statement "puVar2[6] = __s;" (assignment_expression "puVar2[6] = __s" (subscript_expression "puVar2[6]" identifier [ number_literal ]) = identifier) ;) })) (expression_statement "puVar1 = (undefined4 *)param_1[5];" (assignment_expression "puVar1 = (undefined4 *)param_1[5]" identifier = (cast_expression "(undefined4 *)param_1[5]" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ]))) ;) (expression_statement "iVar5 = make_bare_word(*puVar1);" (assignment_expression "iVar5 = make_bare_word(*puVar1)" identifier = (call_expression "make_bare_word(*puVar1)" identifier (argument_list "(*puVar1)" ( (pointer_expression "*puVar1" * identifier) )))) ;) (expression_statement "*(undefined4 *)(iVar5 + 4) = puVar1[1];" (assignment_expression "*(undefined4 *)(iVar5 + 4) = puVar1[1]" (pointer_expression "*(undefined4 *)(iVar5 + 4)" * (cast_expression "(undefined4 *)(iVar5 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + 4)" ( (binary_expression "iVar5 + 4" identifier + number_literal) )))) = (subscript_expression "puVar1[1]" identifier [ number_literal ])) ;) (expression_statement "puVar2[5] = iVar5;" (assignment_expression "puVar2[5] = iVar5" (subscript_expression "puVar2[5]" identifier [ number_literal ]) = identifier) ;) })) (return_statement "return puVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression LIT << (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) & LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) })) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 * copy_redirect(undefined4 *param_1)\n\n{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}" (type_identifier "undefined4") (pointer_declarator "* copy_redirect(undefined4 *param_1)" (* "*") (function_declarator "copy_redirect(undefined4 *param_1)" (identifier "copy_redirect") (parameter_list "(undefined4 *param_1)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")")))) (compound_statement "{\n  undefined4 *puVar1;\n  undefined4 *puVar2;\n  uint uVar3;\n  size_t sVar4;\n  char *__dest;\n  char *__s;\n  int iVar5;\n  \n  puVar2 = (undefined4 *)xmalloc(0x1c);\n  *puVar2 = *param_1;\n  puVar2[1] = param_1[1];\n  puVar2[2] = param_1[2];\n  puVar2[3] = param_1[3];\n  puVar2[4] = param_1[4];\n  puVar2[5] = param_1[5];\n  puVar2[6] = param_1[6];\n  if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }\n  if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }\n  return puVar2;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "char *__dest;" (primitive_type "char") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (expression_statement "puVar2 = (undefined4 *)xmalloc(0x1c);" (assignment_expression "puVar2 = (undefined4 *)xmalloc(0x1c)" (identifier "puVar2") (= "=") (cast_expression "(undefined4 *)xmalloc(0x1c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(0x1c)" (identifier "xmalloc") (argument_list "(0x1c)" (( "(") (number_literal "0x1c") () ")"))))) (; ";")) (expression_statement "*puVar2 = *param_1;" (assignment_expression "*puVar2 = *param_1" (pointer_expression "*puVar2" (* "*") (identifier "puVar2")) (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "puVar2[1] = param_1[1];" (assignment_expression "puVar2[1] = param_1[1]" (subscript_expression "puVar2[1]" (identifier "puVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "puVar2[2] = param_1[2];" (assignment_expression "puVar2[2] = param_1[2]" (subscript_expression "puVar2[2]" (identifier "puVar2") ([ "[") (number_literal "2") (] "]")) (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (expression_statement "puVar2[3] = param_1[3];" (assignment_expression "puVar2[3] = param_1[3]" (subscript_expression "puVar2[3]" (identifier "puVar2") ([ "[") (number_literal "3") (] "]")) (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (expression_statement "puVar2[4] = param_1[4];" (assignment_expression "puVar2[4] = param_1[4]" (subscript_expression "puVar2[4]" (identifier "puVar2") ([ "[") (number_literal "4") (] "]")) (= "=") (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]"))) (; ";")) (expression_statement "puVar2[5] = param_1[5];" (assignment_expression "puVar2[5] = param_1[5]" (subscript_expression "puVar2[5]" (identifier "puVar2") ([ "[") (number_literal "5") (] "]")) (= "=") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]"))) (; ";")) (expression_statement "puVar2[6] = param_1[6];" (assignment_expression "puVar2[6] = param_1[6]" (subscript_expression "puVar2[6]" (identifier "puVar2") ([ "[") (number_literal "6") (] "]")) (= "=") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]"))) (; ";")) (if_statement "if ((*(byte *)(param_1 + 2) & 1) != 0) {\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }" (if "if") (parenthesized_expression "((*(byte *)(param_1 + 2) & 1) != 0)" (( "(") (binary_expression "(*(byte *)(param_1 + 2) & 1) != 0" (parenthesized_expression "(*(byte *)(param_1 + 2) & 1)" (( "(") (binary_expression "*(byte *)(param_1 + 2) & 1" (pointer_expression "*(byte *)(param_1 + 2)" (* "*") (cast_expression "(byte *)(param_1 + 2)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) (& "&") (number_literal "1")) () ")")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    puVar1 = (undefined4 *)param_1[1];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[1] = iVar5;\n  }" ({ "{") (expression_statement "puVar1 = (undefined4 *)param_1[1];" (assignment_expression "puVar1 = (undefined4 *)param_1[1]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)param_1[1]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) (; ";")) (expression_statement "iVar5 = make_bare_word(*puVar1);" (assignment_expression "iVar5 = make_bare_word(*puVar1)" (identifier "iVar5") (= "=") (call_expression "make_bare_word(*puVar1)" (identifier "make_bare_word") (argument_list "(*puVar1)" (( "(") (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) () ")")))) (; ";")) (expression_statement "*(undefined4 *)(iVar5 + 4) = puVar1[1];" (assignment_expression "*(undefined4 *)(iVar5 + 4) = puVar1[1]" (pointer_expression "*(undefined4 *)(iVar5 + 4)" (* "*") (cast_expression "(undefined4 *)(iVar5 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + 4)" (( "(") (binary_expression "iVar5 + 4" (identifier "iVar5") (+ "+") (number_literal "4")) () ")")))) (= "=") (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "puVar2[1] = iVar5;" (assignment_expression "puVar2[1] = iVar5" (subscript_expression "puVar2[1]" (identifier "puVar2") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar5")) (; ";")) (} "}"))) (if_statement "if ((uint)param_1[4] < 0x14) {\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }" (if "if") (parenthesized_expression "((uint)param_1[4] < 0x14)" (( "(") (binary_expression "(uint)param_1[4] < 0x14" (cast_expression "(uint)param_1[4]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]"))) (< "<") (number_literal "0x14")) () ")")) (compound_statement "{\n    uVar3 = 1 << ((byte)param_1[4] & 0x1f);\n    if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }\n    puVar1 = (undefined4 *)param_1[5];\n    iVar5 = make_bare_word(*puVar1);\n    *(undefined4 *)(iVar5 + 4) = puVar1[1];\n    puVar2[5] = iVar5;\n  }" ({ "{") (expression_statement "uVar3 = 1 << ((byte)param_1[4] & 0x1f);" (assignment_expression "uVar3 = 1 << ((byte)param_1[4] & 0x1f)" (identifier "uVar3") (= "=") (binary_expression "1 << ((byte)param_1[4] & 0x1f)" (number_literal "1") (<< "<<") (parenthesized_expression "((byte)param_1[4] & 0x1f)" (( "(") (binary_expression "(byte)param_1[4] & 0x1f" (cast_expression "(byte)param_1[4]" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]"))) (& "&") (number_literal "0x1f")) () ")")))) (; ";")) (if_statement "if ((uVar3 & 0xe7c2f) == 0) {\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }" (if "if") (parenthesized_expression "((uVar3 & 0xe7c2f) == 0)" (( "(") (binary_expression "(uVar3 & 0xe7c2f) == 0" (parenthesized_expression "(uVar3 & 0xe7c2f)" (( "(") (binary_expression "uVar3 & 0xe7c2f" (identifier "uVar3") (& "&") (number_literal "0xe7c2f")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }\n      __s = (char *)param_1[6];\n      if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }\n      puVar2[6] = __s;\n    }" ({ "{") (if_statement "if ((uVar3 & 0x110) == 0) {\n        return puVar2;\n      }" (if "if") (parenthesized_expression "((uVar3 & 0x110) == 0)" (( "(") (binary_expression "(uVar3 & 0x110) == 0" (parenthesized_expression "(uVar3 & 0x110)" (( "(") (binary_expression "uVar3 & 0x110" (identifier "uVar3") (& "&") (number_literal "0x110")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        return puVar2;\n      }" ({ "{") (return_statement "return puVar2;" (return "return") (identifier "puVar2") (; ";")) (} "}"))) (expression_statement "__s = (char *)param_1[6];" (assignment_expression "__s = (char *)param_1[6]" (identifier "__s") (= "=") (cast_expression "(char *)param_1[6]" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")))) (; ";")) (if_statement "if (__s != (char *)0x0) {\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" (if "if") (parenthesized_expression "(__s != (char *)0x0)" (( "(") (binary_expression "__s != (char *)0x0" (identifier "__s") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        sVar4 = strlen(__s);\n        __dest = (char *)xmalloc(sVar4 + 1);\n        __s = strcpy(__dest,__s);\n      }" ({ "{") (expression_statement "sVar4 = strlen(__s);" (assignment_expression "sVar4 = strlen(__s)" (identifier "sVar4") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (expression_statement "__dest = (char *)xmalloc(sVar4 + 1);" (assignment_expression "__dest = (char *)xmalloc(sVar4 + 1)" (identifier "__dest") (= "=") (cast_expression "(char *)xmalloc(sVar4 + 1)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(sVar4 + 1)" (identifier "xmalloc") (argument_list "(sVar4 + 1)" (( "(") (binary_expression "sVar4 + 1" (identifier "sVar4") (+ "+") (number_literal "1")) () ")"))))) (; ";")) (expression_statement "__s = strcpy(__dest,__s);" (assignment_expression "__s = strcpy(__dest,__s)" (identifier "__s") (= "=") (call_expression "strcpy(__dest,__s)" (identifier "strcpy") (argument_list "(__dest,__s)" (( "(") (identifier "__dest") (, ",") (identifier "__s") () ")")))) (; ";")) (} "}"))) (expression_statement "puVar2[6] = __s;" (assignment_expression "puVar2[6] = __s" (subscript_expression "puVar2[6]" (identifier "puVar2") ([ "[") (number_literal "6") (] "]")) (= "=") (identifier "__s")) (; ";")) (} "}"))) (expression_statement "puVar1 = (undefined4 *)param_1[5];" (assignment_expression "puVar1 = (undefined4 *)param_1[5]" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)param_1[5]" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")))) (; ";")) (expression_statement "iVar5 = make_bare_word(*puVar1);" (assignment_expression "iVar5 = make_bare_word(*puVar1)" (identifier "iVar5") (= "=") (call_expression "make_bare_word(*puVar1)" (identifier "make_bare_word") (argument_list "(*puVar1)" (( "(") (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) () ")")))) (; ";")) (expression_statement "*(undefined4 *)(iVar5 + 4) = puVar1[1];" (assignment_expression "*(undefined4 *)(iVar5 + 4) = puVar1[1]" (pointer_expression "*(undefined4 *)(iVar5 + 4)" (* "*") (cast_expression "(undefined4 *)(iVar5 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + 4)" (( "(") (binary_expression "iVar5 + 4" (identifier "iVar5") (+ "+") (number_literal "4")) () ")")))) (= "=") (subscript_expression "puVar1[1]" (identifier "puVar1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "puVar2[5] = iVar5;" (assignment_expression "puVar2[5] = iVar5" (subscript_expression "puVar2[5]" (identifier "puVar2") ([ "[") (number_literal "5") (] "]")) (= "=") (identifier "iVar5")) (; ";")) (} "}"))) (return_statement "return puVar2;" (return "return") (identifier "puVar2") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

type_1 * function_1(type_1 *redirect)

{
  type_2 *pWVar1;
  type_1 *pRVar2;
  type_3 var_5;
  size_t var_8;
  char *__dest;
  char *var_6;
  type_2 *pWVar5;
  
  pRVar2 = (type_1 *)var_1(0x1c);
  pRVar2->next = redirect->next;
  pRVar2->redirector = redirect->redirector;
  pRVar2->rflags = redirect->rflags;
  pRVar2->flags = redirect->flags;
  pRVar2->instruction = redirect->instruction;
  pRVar2->redirectee = redirect->redirectee;
  pRVar2->here_doc_eof = redirect->here_doc_eof;
  if ((redirect->rflags & 1) != 0) {
    pWVar1 = (redirect->redirector).filename;
    pWVar5 = var_2(pWVar1->word);
    pWVar5->flags = pWVar1->flags;
    (pRVar2->redirector).filename = pWVar5;
  }
  if (redirect->instruction < (var_3|var_4)) {
    var_5 = 1 << ((type_4)redirect->instruction & 0x1f);
    if ((var_5 & 0xe7c2f) == 0) {
      if ((var_5 & 0x110) == 0) {
        return pRVar2;
      }
      var_6 = redirect->here_doc_eof;
      if (var_6 != (char *)0x0) {
        var_8 = var_7(var_6);
        __dest = (char *)var_1(var_8 + 1);
        var_6 = var_9(__dest,var_6);
      }
      pRVar2->here_doc_eof = var_6;
    }
    pWVar1 = (redirect->redirectee).filename;
    pWVar5 = var_2(pWVar1->word);
    pWVar5->flags = pWVar1->flags;
    (pRVar2->redirectee).filename = pWVar5;
  }
  return pRVar2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (number_literal) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))))) (return_statement (identifier)))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 * MASKED(undefined4 *param_1)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  uint uVar3;
  size_t sVar4;
  char *__dest;
  char *__s;
  int iVar5;
  
  puVar2 = (undefined4 *)xmalloc(0x1c);
  *puVar2 = *param_1;
  puVar2[1] = param_1[1];
  puVar2[2] = param_1[2];
  puVar2[3] = param_1[3];
  puVar2[4] = param_1[4];
  puVar2[5] = param_1[5];
  puVar2[6] = param_1[6];
  if ((*(byte *)(param_1 + 2) & 1) != 0) {
    puVar1 = (undefined4 *)param_1[1];
    iVar5 = make_bare_word(*puVar1);
    *(undefined4 *)(iVar5 + 4) = puVar1[1];
    puVar2[1] = iVar5;
  }
  if ((uint)param_1[4] < 0x14) {
    uVar3 = 1 << ((byte)param_1[4] & 0x1f);
    if ((uVar3 & 0xe7c2f) == 0) {
      if ((uVar3 & 0x110) == 0) {
        return puVar2;
      }
      __s = (char *)param_1[6];
      if (__s != (char *)0x0) {
        sVar4 = strlen(__s);
        __dest = (char *)xmalloc(sVar4 + 1);
        __s = strcpy(__dest,__s);
      }
      puVar2[6] = __s;
    }
    puVar1 = (undefined4 *)param_1[5];
    iVar5 = make_bare_word(*puVar1);
    *(undefined4 *)(iVar5 + 4) = puVar1[1];
    puVar2[5] = iVar5;
  }
  return puVar2;
}

