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

int rpl_fflush(FILE *stream)

{
  int iVar1;
  
  if (stream != (FILE *)0x0) {
    iVar1 = __freading(stream);
    if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {
      rpl_fseeko(stream,0,1);
    }
  }
  iVar1 = fflush((FILE *)stream);
  return iVar1;
}



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

void FUN_000144e0(FILE *param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  uVar2 = 0x144e7;
  if (param_1 != (FILE *)0x0) {
    iVar1 = __freading(param_1);
    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {
      FUN_00014540(param_1,0,0,1,uVar2);
    }
  }
  fflush(param_1);
  return;
}


PUSH ESI
PUSH EBX
CALL 0x00011420
ADD EBX,0x4b19
SUB ESP,0x4
MOV ESI,dword ptr [ESP + 0x10]
TEST ESI,ESI
JZ 0x00014510
SUB ESP,0xc
PUSH ESI
CALL 0x00011190
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00014510
TEST dword ptr [ESI],0x100
JNZ 0x00014528
SUB ESP,0xc
PUSH ESI
CALL 0x00011050
ADD ESP,0x10
ADD ESP,0x4
POP EBX
POP ESI
RET
PUSH 0x1
PUSH 0x0
PUSH 0x0
PUSH ESI
CALL 0x00014540
ADD ESP,0x10
JMP 0x00014510
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_000144e0(FILE *param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}\n\n" comment (function_definition "void FUN_000144e0(FILE *param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}" primitive_type (function_declarator "FUN_000144e0(FILE *param_1)" identifier (parameter_list "(FILE *param_1)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0x144e7;" (assignment_expression "uVar2 = 0x144e7" identifier = number_literal) ;) (if_statement "if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }" if (parenthesized_expression "(param_1 != (FILE *)0x0)" ( (binary_expression "param_1 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }" { (expression_statement "iVar1 = __freading(param_1);" (assignment_expression "iVar1 = __freading(param_1)" identifier = (call_expression "__freading(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }" if (parenthesized_expression "((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0))" ( (binary_expression "(iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "((param_1->_flags & 0x100U) != 0)" ( (binary_expression "(param_1->_flags & 0x100U) != 0" (parenthesized_expression "(param_1->_flags & 0x100U)" ( (binary_expression "param_1->_flags & 0x100U" (field_expression "param_1->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }" { (expression_statement "FUN_00014540(param_1,0,0,1,uVar2);" (call_expression "FUN_00014540(param_1,0,0,1,uVar2)" identifier (argument_list "(param_1,0,0,1,uVar2)" ( identifier , number_literal , number_literal , number_literal , identifier ))) ;) })) })) (expression_statement "fflush(param_1);" (call_expression "fflush(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint rpl_fflush(FILE *stream)\n\n{\n  int iVar1;\n  \n  if (stream != (FILE *)0x0) {\n    iVar1 = __freading(stream);\n    if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {\n      rpl_fseeko(stream,0,1);\n    }\n  }\n  iVar1 = fflush((FILE *)stream);\n  return iVar1;\n}\n\n" comment comment (function_definition "int rpl_fflush(FILE *stream)\n\n{\n  int iVar1;\n  \n  if (stream != (FILE *)0x0) {\n    iVar1 = __freading(stream);\n    if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {\n      rpl_fseeko(stream,0,1);\n    }\n  }\n  iVar1 = fflush((FILE *)stream);\n  return iVar1;\n}" primitive_type (function_declarator "rpl_fflush(FILE *stream)" identifier (parameter_list "(FILE *stream)" ( (parameter_declaration "FILE *stream" type_identifier (pointer_declarator "*stream" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  \n  if (stream != (FILE *)0x0) {\n    iVar1 = __freading(stream);\n    if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {\n      rpl_fseeko(stream,0,1);\n    }\n  }\n  iVar1 = fflush((FILE *)stream);\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (stream != (FILE *)0x0) {\n    iVar1 = __freading(stream);\n    if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {\n      rpl_fseeko(stream,0,1);\n    }\n  }" if (parenthesized_expression "(stream != (FILE *)0x0)" ( (binary_expression "stream != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = __freading(stream);\n    if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {\n      rpl_fseeko(stream,0,1);\n    }\n  }" { (expression_statement "iVar1 = __freading(stream);" (assignment_expression "iVar1 = __freading(stream)" identifier = (call_expression "__freading(stream)" identifier (argument_list "(stream)" ( identifier )))) ;) (if_statement "if ((iVar1 != 0) && ((stream->_flags & 0x100U) != 0)) {\n      rpl_fseeko(stream,0,1);\n    }" if (parenthesized_expression "((iVar1 != 0) && ((stream->_flags & 0x100U) != 0))" ( (binary_expression "(iVar1 != 0) && ((stream->_flags & 0x100U) != 0)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "((stream->_flags & 0x100U) != 0)" ( (binary_expression "(stream->_flags & 0x100U) != 0" (parenthesized_expression "(stream->_flags & 0x100U)" ( (binary_expression "stream->_flags & 0x100U" (field_expression "stream->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      rpl_fseeko(stream,0,1);\n    }" { (expression_statement "rpl_fseeko(stream,0,1);" (call_expression "rpl_fseeko(stream,0,1)" identifier (argument_list "(stream,0,1)" ( identifier , number_literal , number_literal ))) ;) })) })) (expression_statement "iVar1 = fflush((FILE *)stream);" (assignment_expression "iVar1 = fflush((FILE *)stream)" identifier = (call_expression "fflush((FILE *)stream)" identifier (argument_list "((FILE *)stream)" ( (cast_expression "(FILE *)stream" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "void FUN_000144e0(FILE *param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}\n\n" (function_definition "void FUN_000144e0(FILE *param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}" primitive_type (function_declarator "FUN_000144e0(FILE *param_1)" identifier (parameter_list "(FILE *param_1)" ( (parameter_declaration "FILE *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (expression_statement "uVar2 = 0x144e7;" (assignment_expression "uVar2 = 0x144e7" identifier = number_literal) ;) (if_statement "if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }" if (parenthesized_expression "(param_1 != (FILE *)0x0)" ( (binary_expression "param_1 != (FILE *)0x0" identifier != (cast_expression "(FILE *)0x0" ( (type_descriptor "FILE *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }" { (expression_statement "iVar1 = __freading(param_1);" (assignment_expression "iVar1 = __freading(param_1)" identifier = (call_expression "__freading(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }" if (parenthesized_expression "((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0))" ( (binary_expression "(iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) && (parenthesized_expression "((param_1->_flags & 0x100U) != 0)" ( (binary_expression "(param_1->_flags & 0x100U) != 0" (parenthesized_expression "(param_1->_flags & 0x100U)" ( (binary_expression "param_1->_flags & 0x100U" (field_expression "param_1->_flags" identifier -> field_identifier) & number_literal) )) != number_literal) ))) )) (compound_statement "{\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }" { (expression_statement "FUN_00014540(param_1,0,0,1,uVar2);" (call_expression "FUN_00014540(param_1,0,0,1,uVar2)" identifier (argument_list "(param_1,0,0,1,uVar2)" ( identifier , number_literal , number_literal , number_literal , identifier ))) ;) })) })) (expression_statement "fflush(param_1);" (call_expression "fflush(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_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 )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (field_expression IDENT -> field_identifier) & LIT) )) != LIT) ))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT , LIT , LIT , IDENT ))) ;) })) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return ;) })))
(function_definition "void FUN_000144e0(FILE *param_1)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_000144e0(FILE *param_1)" (identifier "FUN_000144e0") (parameter_list "(FILE *param_1)" (( "(") (parameter_declaration "FILE *param_1" (type_identifier "FILE") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  \n  uVar2 = 0x144e7;\n  if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }\n  fflush(param_1);\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (expression_statement "uVar2 = 0x144e7;" (assignment_expression "uVar2 = 0x144e7" (identifier "uVar2") (= "=") (number_literal "0x144e7")) (; ";")) (if_statement "if (param_1 != (FILE *)0x0) {\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }" (if "if") (parenthesized_expression "(param_1 != (FILE *)0x0)" (( "(") (binary_expression "param_1 != (FILE *)0x0" (identifier "param_1") (!= "!=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar1 = __freading(param_1);\n    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }\n  }" ({ "{") (expression_statement "iVar1 = __freading(param_1);" (assignment_expression "iVar1 = __freading(param_1)" (identifier "iVar1") (= "=") (call_expression "__freading(param_1)" (identifier "__freading") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }" (if "if") (parenthesized_expression "((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0))" (( "(") (binary_expression "(iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)" (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "((param_1->_flags & 0x100U) != 0)" (( "(") (binary_expression "(param_1->_flags & 0x100U) != 0" (parenthesized_expression "(param_1->_flags & 0x100U)" (( "(") (binary_expression "param_1->_flags & 0x100U" (field_expression "param_1->_flags" (identifier "param_1") (-> "->") (field_identifier "_flags")) (& "&") (number_literal "0x100U")) () ")")) (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n      FUN_00014540(param_1,0,0,1,uVar2);\n    }" ({ "{") (expression_statement "FUN_00014540(param_1,0,0,1,uVar2);" (call_expression "FUN_00014540(param_1,0,0,1,uVar2)" (identifier "FUN_00014540") (argument_list "(param_1,0,0,1,uVar2)" (( "(") (identifier "param_1") (, ",") (number_literal "0") (, ",") (number_literal "0") (, ",") (number_literal "1") (, ",") (identifier "uVar2") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "fflush(param_1);" (call_expression "fflush(param_1)" (identifier "fflush") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

int function_1(type_1 *var_1)

{
  int var_3;
  
  if (var_1 != (type_1 *)0x0) {
    var_3 = var_2(var_1);
    if ((var_3 != 0) && ((var_1->_flags & 0x100U) != 0)) {
      var_4(var_1,0,1);
    }
  }
  var_3 = var_5((type_1 *)var_1);
  return var_3;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (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: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (number_literal))) right: (number_literal))))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (number_literal) (number_literal) (identifier)))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement))))

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

void MASKED(FILE *param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  uVar2 = 0x144e7;
  if (param_1 != (FILE *)0x0) {
    iVar1 = __freading(param_1);
    if ((iVar1 != 0) && ((param_1->_flags & 0x100U) != 0)) {
      FUN_00014540(param_1,0,0,1,uVar2);
    }
  }
  fflush(param_1);
  return;
}

