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

printer_job * printer_start_job(char *printer)

{
  printer_job *ptr;
  FILE *pFVar1;
  printer_job *ppVar2;
  
  ptr = (printer_job *)safemalloc(1,4);
  pFVar1 = popen(printer,"w");
  ptr->fp = (FILE *)pFVar1;
  ppVar2 = ptr;
  if (pFVar1 == (FILE *)0x0) {
    ppVar2 = (printer_job *)0x0;
    safefree(ptr);
  }
  return ppVar2;
}



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

undefined4 * FUN_0009ca80(char *param_1)

{
  undefined4 *puVar1;
  FILE *pFVar2;
  undefined4 *puVar3;
  
  puVar1 = (undefined4 *)FUN_0002e780(1,4);
  pFVar2 = popen(param_1,"w");
  *puVar1 = pFVar2;
  puVar3 = puVar1;
  if (pFVar2 == (FILE *)0x0) {
    puVar3 = (undefined4 *)0x0;
    FUN_0002f010(puVar1);
  }
  return puVar3;
}


PUSH ESI
PUSH EBX
CALL 0x0001c4f0
ADD EBX,0x73cc9
SUB ESP,0xc
PUSH 0x4
PUSH 0x1
CALL 0x0002e780
MOV ESI,EAX
POP EAX
LEA EAX,[EBX + 0xfffbc5a6]
POP EDX
PUSH EAX
PUSH dword ptr [ESP + 0x1c]
CALL 0x0001b600
ADD ESP,0x10
MOV dword ptr [ESI],EAX
TEST EAX,EAX
JZ 0x0009cac0
ADD ESP,0x4
MOV EAX,ESI
POP EBX
POP ESI
RET
SUB ESP,0xc
PUSH ESI
XOR ESI,ESI
CALL 0x0002f010
ADD ESP,0x10
JMP 0x0009cab6
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * FUN_0009ca80(char *param_1)\n\n{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}\n\n" comment (function_definition "undefined4 * FUN_0009ca80(char *param_1)\n\n{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}" type_identifier (pointer_declarator "* FUN_0009ca80(char *param_1)" * (function_declarator "FUN_0009ca80(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "puVar1 = (undefined4 *)FUN_0002e780(1,4);" (assignment_expression "puVar1 = (undefined4 *)FUN_0002e780(1,4)" identifier = (cast_expression "(undefined4 *)FUN_0002e780(1,4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0002e780(1,4)" identifier (argument_list "(1,4)" ( number_literal , number_literal ))))) ;) (expression_statement "pFVar2 = popen(param_1,"w");" (assignment_expression "pFVar2 = popen(param_1,"w")" identifier = (call_expression "popen(param_1,"w")" identifier (argument_list "(param_1,"w")" ( identifier , (string_literal ""w"" " string_content ") )))) ;) (expression_statement "*puVar1 = pFVar2;" (assignment_expression "*puVar1 = pFVar2" (pointer_expression "*puVar1" * identifier) = identifier) ;) (expression_statement "puVar3 = puVar1;" (assignment_expression "puVar3 = puVar1" identifier = identifier) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }" if (parenthesized_expression "(pFVar2 == (FILE *)0x0)" ( (binary_expression "pFVar2 == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }" { (expression_statement "puVar3 = (undefined4 *)0x0;" (assignment_expression "puVar3 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "FUN_0002f010(puVar1);" (call_expression "FUN_0002f010(puVar1)" identifier (argument_list "(puVar1)" ( identifier ))) ;) })) (return_statement "return puVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nprinter_job * printer_start_job(char *printer)\n\n{\n  printer_job *ptr;\n  FILE *pFVar1;\n  printer_job *ppVar2;\n  \n  ptr = (printer_job *)safemalloc(1,4);\n  pFVar1 = popen(printer,"w");\n  ptr->fp = (FILE *)pFVar1;\n  ppVar2 = ptr;\n  if (pFVar1 == (FILE *)0x0) {\n    ppVar2 = (printer_job *)0x0;\n    safefree(ptr);\n  }\n  return ppVar2;\n}\n\n" comment comment (function_definition "printer_job * printer_start_job(char *printer)\n\n{\n  printer_job *ptr;\n  FILE *pFVar1;\n  printer_job *ppVar2;\n  \n  ptr = (printer_job *)safemalloc(1,4);\n  pFVar1 = popen(printer,"w");\n  ptr->fp = (FILE *)pFVar1;\n  ppVar2 = ptr;\n  if (pFVar1 == (FILE *)0x0) {\n    ppVar2 = (printer_job *)0x0;\n    safefree(ptr);\n  }\n  return ppVar2;\n}" type_identifier (pointer_declarator "* printer_start_job(char *printer)" * (function_declarator "printer_start_job(char *printer)" identifier (parameter_list "(char *printer)" ( (parameter_declaration "char *printer" primitive_type (pointer_declarator "*printer" * identifier)) )))) (compound_statement "{\n  printer_job *ptr;\n  FILE *pFVar1;\n  printer_job *ppVar2;\n  \n  ptr = (printer_job *)safemalloc(1,4);\n  pFVar1 = popen(printer,"w");\n  ptr->fp = (FILE *)pFVar1;\n  ppVar2 = ptr;\n  if (pFVar1 == (FILE *)0x0) {\n    ppVar2 = (printer_job *)0x0;\n    safefree(ptr);\n  }\n  return ppVar2;\n}" { (declaration "printer_job *ptr;" type_identifier (pointer_declarator "*ptr" * identifier) ;) (declaration "FILE *pFVar1;" type_identifier (pointer_declarator "*pFVar1" * identifier) ;) (declaration "printer_job *ppVar2;" type_identifier (pointer_declarator "*ppVar2" * identifier) ;) (expression_statement "ptr = (printer_job *)safemalloc(1,4);" (assignment_expression "ptr = (printer_job *)safemalloc(1,4)" identifier = (cast_expression "(printer_job *)safemalloc(1,4)" ( (type_descriptor "printer_job *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,4)" identifier (argument_list "(1,4)" ( number_literal , number_literal ))))) ;) (expression_statement "pFVar1 = popen(printer,"w");" (assignment_expression "pFVar1 = popen(printer,"w")" identifier = (call_expression "popen(printer,"w")" identifier (argument_list "(printer,"w")" ( identifier , (string_literal ""w"" " string_content ") )))) ;) (expression_statement "ptr->fp = (FILE *)pFVar1;" (assignment_expression "ptr->fp = (FILE *)pFVar1" (field_expression "ptr->fp" identifier -> field_identifier) = (cast_expression "(FILE *)pFVar1" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (expression_statement "ppVar2 = ptr;" (assignment_expression "ppVar2 = ptr" identifier = identifier) ;) (if_statement "if (pFVar1 == (FILE *)0x0) {\n    ppVar2 = (printer_job *)0x0;\n    safefree(ptr);\n  }" if (parenthesized_expression "(pFVar1 == (FILE *)0x0)" ( (binary_expression "pFVar1 == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    ppVar2 = (printer_job *)0x0;\n    safefree(ptr);\n  }" { (expression_statement "ppVar2 = (printer_job *)0x0;" (assignment_expression "ppVar2 = (printer_job *)0x0" identifier = (cast_expression "(printer_job *)0x0" ( (type_descriptor "printer_job *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "safefree(ptr);" (call_expression "safefree(ptr)" identifier (argument_list "(ptr)" ( identifier ))) ;) })) (return_statement "return ppVar2;" return identifier ;) })))
(translation_unit "undefined4 * FUN_0009ca80(char *param_1)\n\n{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}\n\n" (function_definition "undefined4 * FUN_0009ca80(char *param_1)\n\n{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}" type_identifier (pointer_declarator "* FUN_0009ca80(char *param_1)" * (function_declarator "FUN_0009ca80(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}" { (declaration "undefined4 *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "FILE *pFVar2;" type_identifier (pointer_declarator "*pFVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (expression_statement "puVar1 = (undefined4 *)FUN_0002e780(1,4);" (assignment_expression "puVar1 = (undefined4 *)FUN_0002e780(1,4)" identifier = (cast_expression "(undefined4 *)FUN_0002e780(1,4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0002e780(1,4)" identifier (argument_list "(1,4)" ( number_literal , number_literal ))))) ;) (expression_statement "pFVar2 = popen(param_1,"w");" (assignment_expression "pFVar2 = popen(param_1,"w")" identifier = (call_expression "popen(param_1,"w")" identifier (argument_list "(param_1,"w")" ( identifier , (string_literal ""w"" " string_content ") )))) ;) (expression_statement "*puVar1 = pFVar2;" (assignment_expression "*puVar1 = pFVar2" (pointer_expression "*puVar1" * identifier) = identifier) ;) (expression_statement "puVar3 = puVar1;" (assignment_expression "puVar3 = puVar1" identifier = identifier) ;) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }" if (parenthesized_expression "(pFVar2 == (FILE *)0x0)" ( (binary_expression "pFVar2 == (FILE *)0x0" identifier == (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }" { (expression_statement "puVar3 = (undefined4 *)0x0;" (assignment_expression "puVar3 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "FUN_0002f010(puVar1);" (call_expression "FUN_0002f010(puVar1)" identifier (argument_list "(puVar1)" ( identifier ))) ;) })) (return_statement "return puVar3;" 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 (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (string_literal " string_content ") )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 * FUN_0009ca80(char *param_1)\n\n{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}" (type_identifier "undefined4") (pointer_declarator "* FUN_0009ca80(char *param_1)" (* "*") (function_declarator "FUN_0009ca80(char *param_1)" (identifier "FUN_0009ca80") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")")))) (compound_statement "{\n  undefined4 *puVar1;\n  FILE *pFVar2;\n  undefined4 *puVar3;\n  \n  puVar1 = (undefined4 *)FUN_0002e780(1,4);\n  pFVar2 = popen(param_1,"w");\n  *puVar1 = pFVar2;\n  puVar3 = puVar1;\n  if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }\n  return puVar3;\n}" ({ "{") (declaration "undefined4 *puVar1;" (type_identifier "undefined4") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "FILE *pFVar2;" (type_identifier "FILE") (pointer_declarator "*pFVar2" (* "*") (identifier "pFVar2")) (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (expression_statement "puVar1 = (undefined4 *)FUN_0002e780(1,4);" (assignment_expression "puVar1 = (undefined4 *)FUN_0002e780(1,4)" (identifier "puVar1") (= "=") (cast_expression "(undefined4 *)FUN_0002e780(1,4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0002e780(1,4)" (identifier "FUN_0002e780") (argument_list "(1,4)" (( "(") (number_literal "1") (, ",") (number_literal "4") () ")"))))) (; ";")) (expression_statement "pFVar2 = popen(param_1,"w");" (assignment_expression "pFVar2 = popen(param_1,"w")" (identifier "pFVar2") (= "=") (call_expression "popen(param_1,"w")" (identifier "popen") (argument_list "(param_1,"w")" (( "(") (identifier "param_1") (, ",") (string_literal ""w"" (" """) (string_content "w") (" """)) () ")")))) (; ";")) (expression_statement "*puVar1 = pFVar2;" (assignment_expression "*puVar1 = pFVar2" (pointer_expression "*puVar1" (* "*") (identifier "puVar1")) (= "=") (identifier "pFVar2")) (; ";")) (expression_statement "puVar3 = puVar1;" (assignment_expression "puVar3 = puVar1" (identifier "puVar3") (= "=") (identifier "puVar1")) (; ";")) (if_statement "if (pFVar2 == (FILE *)0x0) {\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }" (if "if") (parenthesized_expression "(pFVar2 == (FILE *)0x0)" (( "(") (binary_expression "pFVar2 == (FILE *)0x0" (identifier "pFVar2") (== "==") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    puVar3 = (undefined4 *)0x0;\n    FUN_0002f010(puVar1);\n  }" ({ "{") (expression_statement "puVar3 = (undefined4 *)0x0;" (assignment_expression "puVar3 = (undefined4 *)0x0" (identifier "puVar3") (= "=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "FUN_0002f010(puVar1);" (call_expression "FUN_0002f010(puVar1)" (identifier "FUN_0002f010") (argument_list "(puVar1)" (( "(") (identifier "puVar1") () ")"))) (; ";")) (} "}"))) (return_statement "return puVar3;" (return "return") (identifier "puVar3") (; ";")) (} "}")))

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

type_1 * function_1(char *printer)

{
  type_1 *ptr;
  type_2 *var_3;
  type_1 *ppVar2;
  
  ptr = (type_1 *)var_1(1,4);
  var_3 = var_2(printer,"w");
  ptr->fp = (type_2 *)var_3;
  ppVar2 = ptr;
  if (var_3 == (type_2 *)0x0) {
    ppVar2 = (type_1 *)0x0;
    var_4(ptr);
  }
  return ppVar2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) 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: (pointer_declarator 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) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (string_literal (string_content)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (return_statement (identifier)))))

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

undefined4 * MASKED(char *param_1)

{
  undefined4 *puVar1;
  FILE *pFVar2;
  undefined4 *puVar3;
  
  puVar1 = (undefined4 *)FUN_0002e780(1,4);
  pFVar2 = popen(param_1,"w");
  *puVar1 = pFVar2;
  puVar3 = puVar1;
  if (pFVar2 == (FILE *)0x0) {
    puVar3 = (undefined4 *)0x0;
    FUN_0002f010(puVar1);
  }
  return puVar3;
}

