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

void __regparm3 do_piping(int pipe_in,int pipe_out)

{
  int iVar1;
  
  if (pipe_in != -1) {
    iVar1 = dup2(pipe_in,0);
    if (iVar1 < 0) {
      dup_error(pipe_in,0);
    }
    if (0 < pipe_in) {
      close(pipe_in);
    }
  }
  if (pipe_out != -1) {
    if (pipe_out == -2) {
      iVar1 = dup2(1,2);
      if (iVar1 < 0) {
        dup_error(1,2);
        return;
      }
    }
    else {
      iVar1 = dup2(pipe_out,1);
      if (iVar1 < 0) {
        dup_error(pipe_out,1);
      }
      if ((pipe_out == 0) || (1 < pipe_out)) {
        close(pipe_out);
        return;
      }
    }
  }
  return;
}



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

void __regparm3 FUN_000478d0(int param_1,int param_2)

{
  int iVar1;
  
  if (param_1 != -1) {
    iVar1 = dup2(param_1,0);
    if (iVar1 < 0) {
      FUN_00046e30();
    }
    if (0 < param_1) {
      close(param_1);
    }
  }
  if (param_2 != -1) {
    if (param_2 == -2) {
      iVar1 = dup2(1,2);
      if (iVar1 < 0) {
        FUN_00046e30();
        return;
      }
    }
    else {
      iVar1 = dup2(param_2,1);
      if (iVar1 < 0) {
        FUN_00046e30();
      }
      if ((param_2 == 0) || (1 < param_2)) {
        close(param_2);
        return;
      }
    }
  }
  return;
}


PUSH EDI
PUSH ESI
MOV ESI,EDX
PUSH EBX
CALL 0x00031ed0
ADD EBX,0x102726
CMP EAX,-0x1
JNZ 0x00047938
CMP ESI,-0x1
JZ 0x0004790a
CMP ESI,-0x2
JZ 0x00047910
SUB ESP,0x8
PUSH 0x1
PUSH ESI
CALL 0x0002f070
ADD ESP,0x10
TEST EAX,EAX
JS 0x00047980
TEST ESI,ESI
JZ 0x00047960
CMP ESI,0x1
JG 0x00047960
POP EBX
POP ESI
POP EDI
RET
SUB ESP,0x8
PUSH 0x2
PUSH 0x1
CALL 0x0002f070
ADD ESP,0x10
TEST EAX,EAX
JNS 0x0004790a
POP EBX
MOV EDX,0x2
POP ESI
MOV EAX,0x1
POP EDI
JMP 0x00046e30
SUB ESP,0x8
MOV EDI,EAX
PUSH 0x0
PUSH EAX
CALL 0x0002f070
ADD ESP,0x10
TEST EAX,EAX
JS 0x00047970
TEST EDI,EDI
JLE 0x000478e5
SUB ESP,0xc
PUSH EDI
CALL 0x0002fdd0
ADD ESP,0x10
JMP 0x000478e5
SUB ESP,0xc
PUSH ESI
CALL 0x0002fdd0
ADD ESP,0x10
POP EBX
POP ESI
POP EDI
RET
XOR EDX,EDX
MOV EAX,EDI
CALL 0x00046e30
JMP 0x0004794c
MOV EDX,0x1
MOV EAX,ESI
CALL 0x00046e30
JMP 0x00047901
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_000478d0(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3 FUN_000478d0(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_000478d0(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }" if (parenthesized_expression "(param_1 != -1)" ( (binary_expression "param_1 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }" { (expression_statement "iVar1 = dup2(param_1,0);" (assignment_expression "iVar1 = dup2(param_1,0)" identifier = (call_expression "dup2(param_1,0)" identifier (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n      FUN_00046e30();\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      FUN_00046e30();\n    }" { (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if (0 < param_1) {\n      close(param_1);\n    }" if (parenthesized_expression "(0 < param_1)" ( (binary_expression "0 < param_1" number_literal < identifier) )) (compound_statement "{\n      close(param_1);\n    }" { (expression_statement "close(param_1);" (call_expression "close(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) })) })) (if_statement "if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }" if (parenthesized_expression "(param_2 != -1)" ( (binary_expression "param_2 != -1" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }" { (if_statement "if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" if (parenthesized_expression "(param_2 == -2)" ( (binary_expression "param_2 == -2" identifier == number_literal) )) (compound_statement "{\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }" { (expression_statement "iVar1 = dup2(1,2);" (assignment_expression "iVar1 = dup2(1,2)" identifier = (call_expression "dup2(1,2)" identifier (argument_list "(1,2)" ( number_literal , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n        FUN_00046e30();\n        return;\n      }" { (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" else (compound_statement "{\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" { (expression_statement "iVar1 = dup2(param_2,1);" (assignment_expression "iVar1 = dup2(param_2,1)" identifier = (call_expression "dup2(param_2,1)" identifier (argument_list "(param_2,1)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n        FUN_00046e30();\n      }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n        FUN_00046e30();\n      }" { (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }" if (parenthesized_expression "((param_2 == 0) || (1 < param_2))" ( (binary_expression "(param_2 == 0) || (1 < param_2)" (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) || (parenthesized_expression "(1 < param_2)" ( (binary_expression "1 < param_2" number_literal < identifier) ))) )) (compound_statement "{\n        close(param_2);\n        return;\n      }" { (expression_statement "close(param_2);" (call_expression "close(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (return_statement "return;" return ;) })) }))) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 do_piping(int pipe_in,int pipe_out)\n\n{\n  int iVar1;\n  \n  if (pipe_in != -1) {\n    iVar1 = dup2(pipe_in,0);\n    if (iVar1 < 0) {\n      dup_error(pipe_in,0);\n    }\n    if (0 < pipe_in) {\n      close(pipe_in);\n    }\n  }\n  if (pipe_out != -1) {\n    if (pipe_out == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3 do_piping(int pipe_in,int pipe_out)\n\n{\n  int iVar1;\n  \n  if (pipe_in != -1) {\n    iVar1 = dup2(pipe_in,0);\n    if (iVar1 < 0) {\n      dup_error(pipe_in,0);\n    }\n    if (0 < pipe_in) {\n      close(pipe_in);\n    }\n  }\n  if (pipe_out != -1) {\n    if (pipe_out == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "do_piping(int pipe_in,int pipe_out)" identifier (parameter_list "(int pipe_in,int pipe_out)" ( (parameter_declaration "int pipe_in" primitive_type identifier) , (parameter_declaration "int pipe_out" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (pipe_in != -1) {\n    iVar1 = dup2(pipe_in,0);\n    if (iVar1 < 0) {\n      dup_error(pipe_in,0);\n    }\n    if (0 < pipe_in) {\n      close(pipe_in);\n    }\n  }\n  if (pipe_out != -1) {\n    if (pipe_out == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (pipe_in != -1) {\n    iVar1 = dup2(pipe_in,0);\n    if (iVar1 < 0) {\n      dup_error(pipe_in,0);\n    }\n    if (0 < pipe_in) {\n      close(pipe_in);\n    }\n  }" if (parenthesized_expression "(pipe_in != -1)" ( (binary_expression "pipe_in != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = dup2(pipe_in,0);\n    if (iVar1 < 0) {\n      dup_error(pipe_in,0);\n    }\n    if (0 < pipe_in) {\n      close(pipe_in);\n    }\n  }" { (expression_statement "iVar1 = dup2(pipe_in,0);" (assignment_expression "iVar1 = dup2(pipe_in,0)" identifier = (call_expression "dup2(pipe_in,0)" identifier (argument_list "(pipe_in,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n      dup_error(pipe_in,0);\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      dup_error(pipe_in,0);\n    }" { (expression_statement "dup_error(pipe_in,0);" (call_expression "dup_error(pipe_in,0)" identifier (argument_list "(pipe_in,0)" ( identifier , number_literal ))) ;) })) (if_statement "if (0 < pipe_in) {\n      close(pipe_in);\n    }" if (parenthesized_expression "(0 < pipe_in)" ( (binary_expression "0 < pipe_in" number_literal < identifier) )) (compound_statement "{\n      close(pipe_in);\n    }" { (expression_statement "close(pipe_in);" (call_expression "close(pipe_in)" identifier (argument_list "(pipe_in)" ( identifier ))) ;) })) })) (if_statement "if (pipe_out != -1) {\n    if (pipe_out == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }\n  }" if (parenthesized_expression "(pipe_out != -1)" ( (binary_expression "pipe_out != -1" identifier != number_literal) )) (compound_statement "{\n    if (pipe_out == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }\n  }" { (if_statement "if (pipe_out == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }" if (parenthesized_expression "(pipe_out == -2)" ( (binary_expression "pipe_out == -2" identifier == number_literal) )) (compound_statement "{\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }\n    }" { (expression_statement "iVar1 = dup2(1,2);" (assignment_expression "iVar1 = dup2(1,2)" identifier = (call_expression "dup2(1,2)" identifier (argument_list "(1,2)" ( number_literal , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n        dup_error(1,2);\n        return;\n      }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n        dup_error(1,2);\n        return;\n      }" { (expression_statement "dup_error(1,2);" (call_expression "dup_error(1,2)" identifier (argument_list "(1,2)" ( number_literal , number_literal ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else {\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }" else (compound_statement "{\n      iVar1 = dup2(pipe_out,1);\n      if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }\n      if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }\n    }" { (expression_statement "iVar1 = dup2(pipe_out,1);" (assignment_expression "iVar1 = dup2(pipe_out,1)" identifier = (call_expression "dup2(pipe_out,1)" identifier (argument_list "(pipe_out,1)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n        dup_error(pipe_out,1);\n      }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n        dup_error(pipe_out,1);\n      }" { (expression_statement "dup_error(pipe_out,1);" (call_expression "dup_error(pipe_out,1)" identifier (argument_list "(pipe_out,1)" ( identifier , number_literal ))) ;) })) (if_statement "if ((pipe_out == 0) || (1 < pipe_out)) {\n        close(pipe_out);\n        return;\n      }" if (parenthesized_expression "((pipe_out == 0) || (1 < pipe_out))" ( (binary_expression "(pipe_out == 0) || (1 < pipe_out)" (parenthesized_expression "(pipe_out == 0)" ( (binary_expression "pipe_out == 0" identifier == number_literal) )) || (parenthesized_expression "(1 < pipe_out)" ( (binary_expression "1 < pipe_out" number_literal < identifier) ))) )) (compound_statement "{\n        close(pipe_out);\n        return;\n      }" { (expression_statement "close(pipe_out);" (call_expression "close(pipe_out)" identifier (argument_list "(pipe_out)" ( identifier ))) ;) (return_statement "return;" return ;) })) }))) })) (return_statement "return;" return ;) })))
(translation_unit "void __regparm3 FUN_000478d0(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}\n\n" (function_definition "void __regparm3 FUN_000478d0(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_000478d0(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }" if (parenthesized_expression "(param_1 != -1)" ( (binary_expression "param_1 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }" { (expression_statement "iVar1 = dup2(param_1,0);" (assignment_expression "iVar1 = dup2(param_1,0)" identifier = (call_expression "dup2(param_1,0)" identifier (argument_list "(param_1,0)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n      FUN_00046e30();\n    }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n      FUN_00046e30();\n    }" { (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if (0 < param_1) {\n      close(param_1);\n    }" if (parenthesized_expression "(0 < param_1)" ( (binary_expression "0 < param_1" number_literal < identifier) )) (compound_statement "{\n      close(param_1);\n    }" { (expression_statement "close(param_1);" (call_expression "close(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) })) })) (if_statement "if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }" if (parenthesized_expression "(param_2 != -1)" ( (binary_expression "param_2 != -1" identifier != number_literal) )) (compound_statement "{\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }" { (if_statement "if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" if (parenthesized_expression "(param_2 == -2)" ( (binary_expression "param_2 == -2" identifier == number_literal) )) (compound_statement "{\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }" { (expression_statement "iVar1 = dup2(1,2);" (assignment_expression "iVar1 = dup2(1,2)" identifier = (call_expression "dup2(1,2)" identifier (argument_list "(1,2)" ( number_literal , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n        FUN_00046e30();\n        return;\n      }" { (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" identifier (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) }) (else_clause "else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" else (compound_statement "{\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" { (expression_statement "iVar1 = dup2(param_2,1);" (assignment_expression "iVar1 = dup2(param_2,1)" identifier = (call_expression "dup2(param_2,1)" identifier (argument_list "(param_2,1)" ( identifier , number_literal )))) ;) (if_statement "if (iVar1 < 0) {\n        FUN_00046e30();\n      }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n        FUN_00046e30();\n      }" { (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" identifier (argument_list "()" ( ))) ;) })) (if_statement "if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }" if (parenthesized_expression "((param_2 == 0) || (1 < param_2))" ( (binary_expression "(param_2 == 0) || (1 < param_2)" (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) || (parenthesized_expression "(1 < param_2)" ( (binary_expression "1 < param_2" number_literal < identifier) ))) )) (compound_statement "{\n        close(param_2);\n        return;\n      }" { (expression_statement "close(param_2);" (call_expression "close(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (return_statement "return;" return ;) })) }))) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (return_statement return ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression LIT < IDENT) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return ;) })) }))) })) (return_statement return ;) })))
(function_definition "void __regparm3 FUN_000478d0(int param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_000478d0(int param_1,int param_2)" (identifier "FUN_000478d0") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }\n  if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if (param_1 != -1) {\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }" (if "if") (parenthesized_expression "(param_1 != -1)" (( "(") (binary_expression "param_1 != -1" (identifier "param_1") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    iVar1 = dup2(param_1,0);\n    if (iVar1 < 0) {\n      FUN_00046e30();\n    }\n    if (0 < param_1) {\n      close(param_1);\n    }\n  }" ({ "{") (expression_statement "iVar1 = dup2(param_1,0);" (assignment_expression "iVar1 = dup2(param_1,0)" (identifier "iVar1") (= "=") (call_expression "dup2(param_1,0)" (identifier "dup2") (argument_list "(param_1,0)" (( "(") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n      FUN_00046e30();\n    }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_00046e30();\n    }" ({ "{") (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" (identifier "FUN_00046e30") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (if_statement "if (0 < param_1) {\n      close(param_1);\n    }" (if "if") (parenthesized_expression "(0 < param_1)" (( "(") (binary_expression "0 < param_1" (number_literal "0") (< "<") (identifier "param_1")) () ")")) (compound_statement "{\n      close(param_1);\n    }" ({ "{") (expression_statement "close(param_1);" (call_expression "close(param_1)" (identifier "close") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (} "}"))) (} "}"))) (if_statement "if (param_2 != -1) {\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }" (if "if") (parenthesized_expression "(param_2 != -1)" (( "(") (binary_expression "param_2 != -1" (identifier "param_2") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }\n  }" ({ "{") (if_statement "if (param_2 == -2) {\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }\n    else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" (if "if") (parenthesized_expression "(param_2 == -2)" (( "(") (binary_expression "param_2 == -2" (identifier "param_2") (== "==") (number_literal "-2")) () ")")) (compound_statement "{\n      iVar1 = dup2(1,2);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }\n    }" ({ "{") (expression_statement "iVar1 = dup2(1,2);" (assignment_expression "iVar1 = dup2(1,2)" (identifier "iVar1") (= "=") (call_expression "dup2(1,2)" (identifier "dup2") (argument_list "(1,2)" (( "(") (number_literal "1") (, ",") (number_literal "2") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n        FUN_00046e30();\n        return;\n      }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n        FUN_00046e30();\n        return;\n      }" ({ "{") (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" (identifier "FUN_00046e30") (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" (else "else") (compound_statement "{\n      iVar1 = dup2(param_2,1);\n      if (iVar1 < 0) {\n        FUN_00046e30();\n      }\n      if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }\n    }" ({ "{") (expression_statement "iVar1 = dup2(param_2,1);" (assignment_expression "iVar1 = dup2(param_2,1)" (identifier "iVar1") (= "=") (call_expression "dup2(param_2,1)" (identifier "dup2") (argument_list "(param_2,1)" (( "(") (identifier "param_2") (, ",") (number_literal "1") () ")")))) (; ";")) (if_statement "if (iVar1 < 0) {\n        FUN_00046e30();\n      }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n        FUN_00046e30();\n      }" ({ "{") (expression_statement "FUN_00046e30();" (call_expression "FUN_00046e30()" (identifier "FUN_00046e30") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (if_statement "if ((param_2 == 0) || (1 < param_2)) {\n        close(param_2);\n        return;\n      }" (if "if") (parenthesized_expression "((param_2 == 0) || (1 < param_2))" (( "(") (binary_expression "(param_2 == 0) || (1 < param_2)" (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(1 < param_2)" (( "(") (binary_expression "1 < param_2" (number_literal "1") (< "<") (identifier "param_2")) () ")"))) () ")")) (compound_statement "{\n        close(param_2);\n        return;\n      }" ({ "{") (expression_statement "close(param_2);" (call_expression "close(param_2)" (identifier "close") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (} "}")))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

void __regparm3 function_1(int var_1,int var_6)

{
  int var_3;
  
  if (var_1 != -1) {
    var_3 = var_2(var_1,0);
    if (var_3 < 0) {
      var_4(var_1,0);
    }
    if (0 < var_1) {
      var_5(var_1);
    }
  }
  if (var_6 != -1) {
    if (var_6 == -2) {
      var_3 = var_2(1,2);
      if (var_3 < 0) {
        var_4(1,2);
        return;
      }
    }
    else {
      var_3 = var_2(var_6,1);
      if (var_3 < 0) {
        var_4(var_6,1);
      }
      if ((var_6 == 0) || (1 < var_6)) {
        var_5(var_6);
        return;
      }
    }
  }
  return;
}


(translation_unit (function_definition type: (primitive_type) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (return_statement)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement)))))))) (return_statement))))

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

void __regparm3 MASKED(int param_1,int param_2)

{
  int iVar1;
  
  if (param_1 != -1) {
    iVar1 = dup2(param_1,0);
    if (iVar1 < 0) {
      FUN_00046e30();
    }
    if (0 < param_1) {
      close(param_1);
    }
  }
  if (param_2 != -1) {
    if (param_2 == -2) {
      iVar1 = dup2(1,2);
      if (iVar1 < 0) {
        FUN_00046e30();
        return;
      }
    }
    else {
      iVar1 = dup2(param_2,1);
      if (iVar1 < 0) {
        FUN_00046e30();
      }
      if ((param_2 == 0) || (1 < param_2)) {
        close(param_2);
        return;
      }
    }
  }
  return;
}

