
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void __regparm3 raw_check_close(Raw raw)

{
  Socket ppsVar1;
  
  ppsVar1 = raw->s;
  if (ppsVar1 != (Socket)0x0) {
    (*(*ppsVar1)->close)(ppsVar1);
    raw->s = (Socket)0x0;
    notify_remote_exit(raw->frontend);
  }
  return;
}



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

void __regparm3 FUN_00031a70(int param_1)

{
  int *piVar1;
  
  piVar1 = *(int **)(param_1 + 4);
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 4))(piVar1);
    *(undefined4 *)(param_1 + 4) = 0;
    FUN_00059460(*(undefined4 *)(param_1 + 0x10));
  }
  return;
}


PUSH ESI
PUSH EBX
CALL 0x0001b410
ADD EBX,0x7ed2d
SUB ESP,0x4
MOV EDX,dword ptr [EAX + 0x4]
TEST EDX,EDX
JZ 0x00031aa5
MOV ESI,EAX
MOV EAX,dword ptr [EDX]
SUB ESP,0xc
PUSH EDX
CALL dword ptr [EAX + 0x4]
MOV dword ptr [ESI + 0x4],0x0
POP EAX
PUSH dword ptr [ESI + 0x10]
CALL 0x00059460
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_00031a70(int param_1)\n\n{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3 FUN_00031a70(int param_1)\n\n{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00031a70(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (expression_statement "piVar1 = *(int **)(param_1 + 4);" (assignment_expression "piVar1 = *(int **)(param_1 + 4)" identifier = (pointer_expression "*(int **)(param_1 + 4)" * (cast_expression "(int **)(param_1 + 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (if_statement "if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }" if (parenthesized_expression "(piVar1 != (int *)0x0)" ( (binary_expression "piVar1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }" { (expression_statement "(**(code **)(*piVar1 + 4))(piVar1);" (call_expression "(**(code **)(*piVar1 + 4))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 4))" ( (pointer_expression "**(code **)(*piVar1 + 4)" * (pointer_expression "*(code **)(*piVar1 + 4)" * (cast_expression "(code **)(*piVar1 + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 4)" ( (binary_expression "*piVar1 + 4" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 4)" * (cast_expression "(undefined4 *)(param_1 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "FUN_00059460(*(undefined4 *)(param_1 + 0x10));" (call_expression "FUN_00059460(*(undefined4 *)(param_1 + 0x10))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x10))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nvoid __regparm3 raw_check_close(Raw raw)\n\n{\n  Socket ppsVar1;\n  \n  ppsVar1 = raw->s;\n  if (ppsVar1 != (Socket)0x0) {\n    (*(*ppsVar1)->close)(ppsVar1);\n    raw->s = (Socket)0x0;\n    notify_remote_exit(raw->frontend);\n  }\n  return;\n}\n\n" comment comment (function_definition "void __regparm3 raw_check_close(Raw raw)\n\n{\n  Socket ppsVar1;\n  \n  ppsVar1 = raw->s;\n  if (ppsVar1 != (Socket)0x0) {\n    (*(*ppsVar1)->close)(ppsVar1);\n    raw->s = (Socket)0x0;\n    notify_remote_exit(raw->frontend);\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "raw_check_close(Raw raw)" identifier (parameter_list "(Raw raw)" ( (parameter_declaration "Raw raw" type_identifier identifier) ))) (compound_statement "{\n  Socket ppsVar1;\n  \n  ppsVar1 = raw->s;\n  if (ppsVar1 != (Socket)0x0) {\n    (*(*ppsVar1)->close)(ppsVar1);\n    raw->s = (Socket)0x0;\n    notify_remote_exit(raw->frontend);\n  }\n  return;\n}" { (declaration "Socket ppsVar1;" type_identifier identifier ;) (expression_statement "ppsVar1 = raw->s;" (assignment_expression "ppsVar1 = raw->s" identifier = (field_expression "raw->s" identifier -> field_identifier)) ;) (if_statement "if (ppsVar1 != (Socket)0x0) {\n    (*(*ppsVar1)->close)(ppsVar1);\n    raw->s = (Socket)0x0;\n    notify_remote_exit(raw->frontend);\n  }" if (parenthesized_expression "(ppsVar1 != (Socket)0x0)" ( (binary_expression "ppsVar1 != (Socket)0x0" identifier != (cast_expression "(Socket)0x0" ( (type_descriptor "Socket" type_identifier) ) number_literal)) )) (compound_statement "{\n    (*(*ppsVar1)->close)(ppsVar1);\n    raw->s = (Socket)0x0;\n    notify_remote_exit(raw->frontend);\n  }" { (expression_statement "(*(*ppsVar1)->close)(ppsVar1);" (call_expression "(*(*ppsVar1)->close)(ppsVar1)" (parenthesized_expression "(*(*ppsVar1)->close)" ( (pointer_expression "*(*ppsVar1)->close" * (field_expression "(*ppsVar1)->close" (parenthesized_expression "(*ppsVar1)" ( (pointer_expression "*ppsVar1" * identifier) )) -> field_identifier)) )) (argument_list "(ppsVar1)" ( identifier ))) ;) (expression_statement "raw->s = (Socket)0x0;" (assignment_expression "raw->s = (Socket)0x0" (field_expression "raw->s" identifier -> field_identifier) = (cast_expression "(Socket)0x0" ( (type_descriptor "Socket" type_identifier) ) number_literal)) ;) (expression_statement "notify_remote_exit(raw->frontend);" (call_expression "notify_remote_exit(raw->frontend)" identifier (argument_list "(raw->frontend)" ( (field_expression "raw->frontend" identifier -> field_identifier) ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "void __regparm3 FUN_00031a70(int param_1)\n\n{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}\n\n" (function_definition "void __regparm3 FUN_00031a70(int param_1)\n\n{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00031a70(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (expression_statement "piVar1 = *(int **)(param_1 + 4);" (assignment_expression "piVar1 = *(int **)(param_1 + 4)" identifier = (pointer_expression "*(int **)(param_1 + 4)" * (cast_expression "(int **)(param_1 + 4)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (if_statement "if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }" if (parenthesized_expression "(piVar1 != (int *)0x0)" ( (binary_expression "piVar1 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }" { (expression_statement "(**(code **)(*piVar1 + 4))(piVar1);" (call_expression "(**(code **)(*piVar1 + 4))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 4))" ( (pointer_expression "**(code **)(*piVar1 + 4)" * (pointer_expression "*(code **)(*piVar1 + 4)" * (cast_expression "(code **)(*piVar1 + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 4)" ( (binary_expression "*piVar1 + 4" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1)" ( identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 4)" * (cast_expression "(undefined4 *)(param_1 + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "FUN_00059460(*(undefined4 *)(param_1 + 0x10));" (call_expression "FUN_00059460(*(undefined4 *)(param_1 + 0x10))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x10))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x10)" * (cast_expression "(undefined4 *)(param_1 + 0x10)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) })) (return_statement return ;) })))
(function_definition "void __regparm3 FUN_00031a70(int param_1)\n\n{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00031a70(int param_1)" (identifier "FUN_00031a70") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  int *piVar1;\n  \n  piVar1 = *(int **)(param_1 + 4);\n  if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }\n  return;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (expression_statement "piVar1 = *(int **)(param_1 + 4);" (assignment_expression "piVar1 = *(int **)(param_1 + 4)" (identifier "piVar1") (= "=") (pointer_expression "*(int **)(param_1 + 4)" (* "*") (cast_expression "(int **)(param_1 + 4)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")"))))) (; ";")) (if_statement "if (piVar1 != (int *)0x0) {\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }" (if "if") (parenthesized_expression "(piVar1 != (int *)0x0)" (( "(") (binary_expression "piVar1 != (int *)0x0" (identifier "piVar1") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    (**(code **)(*piVar1 + 4))(piVar1);\n    *(undefined4 *)(param_1 + 4) = 0;\n    FUN_00059460(*(undefined4 *)(param_1 + 0x10));\n  }" ({ "{") (expression_statement "(**(code **)(*piVar1 + 4))(piVar1);" (call_expression "(**(code **)(*piVar1 + 4))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 4))" (( "(") (pointer_expression "**(code **)(*piVar1 + 4)" (* "*") (pointer_expression "*(code **)(*piVar1 + 4)" (* "*") (cast_expression "(code **)(*piVar1 + 4)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*piVar1 + 4)" (( "(") (binary_expression "*piVar1 + 4" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (+ "+") (number_literal "4")) () ")"))))) () ")")) (argument_list "(piVar1)" (( "(") (identifier "piVar1") () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 4)" (* "*") (cast_expression "(undefined4 *)(param_1 + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "FUN_00059460(*(undefined4 *)(param_1 + 0x10));" (call_expression "FUN_00059460(*(undefined4 *)(param_1 + 0x10))" (identifier "FUN_00059460") (argument_list "(*(undefined4 *)(param_1 + 0x10))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x10)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x10)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) () ")"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

void __regparm3 function_1(type_1 raw)

{
  type_2 var_1;
  
  var_1 = raw->s;
  if (var_1 != (type_2)0x0) {
    (*(*var_1)->close)(var_1);
    raw->s = (type_2)0x0;
    var_2(raw->frontend);
  }
  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)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (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 (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) arguments: (argument_list (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: (number_literal))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (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)))))))))) (return_statement))))

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

void __regparm3 MASKED(int param_1)

{
  int *piVar1;
  
  piVar1 = *(int **)(param_1 + 4);
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 4))(piVar1);
    *(undefined4 *)(param_1 + 4) = 0;
    FUN_00059460(*(undefined4 *)(param_1 + 0x10));
  }
  return;
}

