
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::__basic_file<char>::sys_open(int, std::_Ios_Openmode) */

__basic_file<char> * __thiscall
std::__basic_file<char>::sys_open(__basic_file<char> *this,int param_1,_Ios_Openmode param_2)

{
  char cVar1;
  char *__modes;
  FILE *__stream;
  
  __modes = (char *)::(anonymous_namespace)::fopen_mode(param_2);
  if ((__modes != (char *)0x0) && (cVar1 = is_open(this), cVar1 == '\0')) {
    __stream = fdopen(param_1,__modes);
    *(FILE **)this = __stream;
    if (__stream != (FILE *)0x0) {
      this[4] = (__basic_file<char>)0x1;
      if (param_1 != 0) {
        return this;
      }
      setvbuf(__stream,(char *)0x0,2,0);
      return this;
    }
  }
  return (__basic_file<char> *)0x0;
}



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

undefined4 * FUN_001acb30(undefined4 *param_1,int param_2)

{
  char cVar1;
  char *__modes;
  FILE *__stream;
  
  __modes = (char *)FUN_001ac930();
  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {
    __stream = fdopen(param_2,__modes);
    *param_1 = __stream;
    if (__stream != (FILE *)0x0) {
      *(undefined1 *)(param_1 + 1) = 1;
      if (param_2 != 0) {
        return param_1;
      }
      setvbuf(__stream,(char *)0x0,2,0);
      return param_1;
    }
  }
  return (undefined4 *)0x0;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV EAX,dword ptr [ESP + 0x18]
CALL 0x00035680
ADD EBX,0x1924c4
MOV ESI,dword ptr [ESP + 0x10]
CALL 0x001ac930
TEST EAX,EAX
JZ 0x001acba0
SUB ESP,0xc
MOV EDI,EAX
PUSH ESI
CALL 0x001acaa0
ADD ESP,0x10
TEST AL,AL
JNZ 0x001acba0
SUB ESP,0x8
PUSH EDI
PUSH dword ptr [ESP + 0x20]
CALL 0x00028410
ADD ESP,0x10
MOV dword ptr [ESI],EAX
TEST EAX,EAX
JZ 0x001acba0
MOV EDX,dword ptr [ESP + 0x14]
MOV byte ptr [ESI + 0x4],0x1
TEST EDX,EDX
JNZ 0x001acba2
PUSH 0x0
PUSH 0x2
PUSH 0x0
PUSH EAX
CALL 0x00028770
ADD ESP,0x10
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
XOR ESI,ESI
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * FUN_001acb30(undefined4 *param_1,int param_2)\n\n{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}\n\n" comment (function_definition "undefined4 * FUN_001acb30(undefined4 *param_1,int param_2)\n\n{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}" type_identifier (pointer_declarator "* FUN_001acb30(undefined4 *param_1,int param_2)" * (function_declarator "FUN_001acb30(undefined4 *param_1,int param_2)" identifier (parameter_list "(undefined4 *param_1,int param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) )))) (compound_statement "{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *__modes;" primitive_type (pointer_declarator "*__modes" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (expression_statement "__modes = (char *)FUN_001ac930();" (assignment_expression "__modes = (char *)FUN_001ac930()" identifier = (cast_expression "(char *)FUN_001ac930()" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_001ac930()" identifier (argument_list "()" ( ))))) ;) (if_statement "if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }" if (parenthesized_expression "((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0'))" ( (binary_expression "(__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')" (parenthesized_expression "(__modes != (char *)0x0)" ( (binary_expression "__modes != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')" ( (comma_expression "cVar1 = FUN_001acaa0(param_1), cVar1 == '\0'" (assignment_expression "cVar1 = FUN_001acaa0(param_1)" identifier = (call_expression "FUN_001acaa0(param_1)" identifier (argument_list "(param_1)" ( identifier )))) , (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence '))) ))) )) (compound_statement "{\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }" { (expression_statement "__stream = fdopen(param_2,__modes);" (assignment_expression "__stream = fdopen(param_2,__modes)" identifier = (call_expression "fdopen(param_2,__modes)" identifier (argument_list "(param_2,__modes)" ( identifier , identifier )))) ;) (expression_statement "*param_1 = __stream;" (assignment_expression "*param_1 = __stream" (pointer_expression "*param_1" * identifier) = identifier) ;) (if_statement "if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\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      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }" { (expression_statement "*(undefined1 *)(param_1 + 1) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 1) = 1" (pointer_expression "*(undefined1 *)(param_1 + 1)" * (cast_expression "(undefined1 *)(param_1 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = number_literal) ;) (if_statement "if (param_2 != 0) {\n        return param_1;\n      }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n        return param_1;\n      }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "setvbuf(__stream,(char *)0x0,2,0);" (call_expression "setvbuf(__stream,(char *)0x0,2,0)" identifier (argument_list "(__stream,(char *)0x0,2,0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal ))) ;) (return_statement "return param_1;" return identifier ;) })) })) (return_statement "return (undefined4 *)0x0;" return (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::__basic_file<char>::sys_open(int, std::_Ios_Openmode) */\n\n__basic_file<char> * __thiscall\nstd::__basic_file<char>::sys_open(__basic_file<char> *this,int param_1,_Ios_Openmode param_2)\n\n{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)::(anonymous_namespace)::fopen_mode(param_2);\n  if ((__modes != (char *)0x0) && (cVar1 = is_open(this), cVar1 == '\0')) {\n    __stream = fdopen(param_1,__modes);\n    *(FILE **)this = __stream;\n    if (__stream != (FILE *)0x0) {\n      this[4] = (__basic_file<char>)0x1;\n      if (param_1 != 0) {\n        return this;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return this;\n    }\n  }\n  return (__basic_file<char> *)0x0;\n}\n\n" comment comment (ERROR "__basic_file<char> * __thiscall\nstd::__basic_file<char>::sys_open(__basic_file<char> *this,int param_1,_Ios_Openmode param_2)" (binary_expression "__basic_file<char> * __thiscall\nstd::__basic_file<char>::sys_open(__basic_file<char> *this,int param_1,_Ios_Openmode param_2)" (binary_expression "__basic_file<char> * __thiscall\nstd::__basic_file<char" (binary_expression "__basic_file<char> * __thiscall" (binary_expression "__basic_file<char" identifier < identifier) > (pointer_expression "* __thiscall" * identifier)) (ERROR "std::__basic_file" identifier : : identifier) < identifier) > (ERROR "::" : :) (call_expression "sys_open(__basic_file<char> *this,int param_1,_Ios_Openmode param_2)" identifier (argument_list "(__basic_file<char> *this,int param_1,_Ios_Openmode param_2)" ( (binary_expression "__basic_file<char> *this" (binary_expression "__basic_file<char" identifier < identifier) > (pointer_expression "*this" * identifier)) , (ERROR "int" identifier) identifier , identifier (ERROR "param_2" identifier) ))))) (compound_statement "{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)::(anonymous_namespace)::fopen_mode(param_2);\n  if ((__modes != (char *)0x0) && (cVar1 = is_open(this), cVar1 == '\0')) {\n    __stream = fdopen(param_1,__modes);\n    *(FILE **)this = __stream;\n    if (__stream != (FILE *)0x0) {\n      this[4] = (__basic_file<char>)0x1;\n      if (param_1 != 0) {\n        return this;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return this;\n    }\n  }\n  return (__basic_file<char> *)0x0;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *__modes;" primitive_type (pointer_declarator "*__modes" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (labeled_statement "__modes = (char *)::(anonymous_namespace)::fopen_mode(param_2);" statement_identifier (ERROR "= (char *)::(anonymous_namespace):" = ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) : : (parenthesized_expression "(anonymous_namespace)" ( identifier )) :) : (expression_statement "fopen_mode(param_2);" (call_expression "fopen_mode(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;)) (if_statement "if ((__modes != (char *)0x0) && (cVar1 = is_open(this), cVar1 == '\0')) {\n    __stream = fdopen(param_1,__modes);\n    *(FILE **)this = __stream;\n    if (__stream != (FILE *)0x0) {\n      this[4] = (__basic_file<char>)0x1;\n      if (param_1 != 0) {\n        return this;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return this;\n    }\n  }" if (parenthesized_expression "((__modes != (char *)0x0) && (cVar1 = is_open(this), cVar1 == '\0'))" ( (binary_expression "(__modes != (char *)0x0) && (cVar1 = is_open(this), cVar1 == '\0')" (parenthesized_expression "(__modes != (char *)0x0)" ( (binary_expression "__modes != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(cVar1 = is_open(this), cVar1 == '\0')" ( (comma_expression "cVar1 = is_open(this), cVar1 == '\0'" (assignment_expression "cVar1 = is_open(this)" identifier = (call_expression "is_open(this)" identifier (argument_list "(this)" ( identifier )))) , (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence '))) ))) )) (compound_statement "{\n    __stream = fdopen(param_1,__modes);\n    *(FILE **)this = __stream;\n    if (__stream != (FILE *)0x0) {\n      this[4] = (__basic_file<char>)0x1;\n      if (param_1 != 0) {\n        return this;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return this;\n    }\n  }" { (expression_statement "__stream = fdopen(param_1,__modes);" (assignment_expression "__stream = fdopen(param_1,__modes)" identifier = (call_expression "fdopen(param_1,__modes)" identifier (argument_list "(param_1,__modes)" ( identifier , identifier )))) ;) (expression_statement "*(FILE **)this = __stream;" (assignment_expression "*(FILE **)this = __stream" (pointer_expression "*(FILE **)this" * (cast_expression "(FILE **)this" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) (if_statement "if (__stream != (FILE *)0x0) {\n      this[4] = (__basic_file<char>)0x1;\n      if (param_1 != 0) {\n        return this;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return this;\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      this[4] = (__basic_file<char>)0x1;\n      if (param_1 != 0) {\n        return this;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return this;\n    }" { (expression_statement "this[4] = (__basic_file<char>)0x1;" (assignment_expression "this[4] = (__basic_file<char>)0x1" (subscript_expression "this[4]" identifier [ number_literal ]) = (parenthesized_expression "(__basic_file<char>)0x1" ( (binary_expression "__basic_file<char>)0x1" (binary_expression "__basic_file<char" identifier < identifier) > (ERROR ")" )) number_literal) ))) ;) (if_statement "if (param_1 != 0) {\n        return this;\n      }" if (parenthesized_expression "(param_1 != 0)" ( (binary_expression "param_1 != 0" identifier != number_literal) )) (compound_statement "{\n        return this;\n      }" { (return_statement "return this;" return identifier ;) })) (expression_statement "setvbuf(__stream,(char *)0x0,2,0);" (call_expression "setvbuf(__stream,(char *)0x0,2,0)" identifier (argument_list "(__stream,(char *)0x0,2,0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal ))) ;) (return_statement "return this;" return identifier ;) })) })) (return_statement "return (__basic_file<char> *)0x0;" return (parenthesized_expression "(__basic_file<char> *)0x0" ( (binary_expression "__basic_file<char> *)0x0" (binary_expression "__basic_file<char" identifier < identifier) > (pointer_expression "*)0x0" * (ERROR ")" )) number_literal)) )) ;) }))
(translation_unit "undefined4 * FUN_001acb30(undefined4 *param_1,int param_2)\n\n{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}\n\n" (function_definition "undefined4 * FUN_001acb30(undefined4 *param_1,int param_2)\n\n{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}" type_identifier (pointer_declarator "* FUN_001acb30(undefined4 *param_1,int param_2)" * (function_declarator "FUN_001acb30(undefined4 *param_1,int param_2)" identifier (parameter_list "(undefined4 *param_1,int param_2)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) )))) (compound_statement "{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *__modes;" primitive_type (pointer_declarator "*__modes" * identifier) ;) (declaration "FILE *__stream;" type_identifier (pointer_declarator "*__stream" * identifier) ;) (expression_statement "__modes = (char *)FUN_001ac930();" (assignment_expression "__modes = (char *)FUN_001ac930()" identifier = (cast_expression "(char *)FUN_001ac930()" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_001ac930()" identifier (argument_list "()" ( ))))) ;) (if_statement "if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }" if (parenthesized_expression "((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0'))" ( (binary_expression "(__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')" (parenthesized_expression "(__modes != (char *)0x0)" ( (binary_expression "__modes != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')" ( (comma_expression "cVar1 = FUN_001acaa0(param_1), cVar1 == '\0'" (assignment_expression "cVar1 = FUN_001acaa0(param_1)" identifier = (call_expression "FUN_001acaa0(param_1)" identifier (argument_list "(param_1)" ( identifier )))) , (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence '))) ))) )) (compound_statement "{\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }" { (expression_statement "__stream = fdopen(param_2,__modes);" (assignment_expression "__stream = fdopen(param_2,__modes)" identifier = (call_expression "fdopen(param_2,__modes)" identifier (argument_list "(param_2,__modes)" ( identifier , identifier )))) ;) (expression_statement "*param_1 = __stream;" (assignment_expression "*param_1 = __stream" (pointer_expression "*param_1" * identifier) = identifier) ;) (if_statement "if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\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      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }" { (expression_statement "*(undefined1 *)(param_1 + 1) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 1) = 1" (pointer_expression "*(undefined1 *)(param_1 + 1)" * (cast_expression "(undefined1 *)(param_1 + 1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) )))) = number_literal) ;) (if_statement "if (param_2 != 0) {\n        return param_1;\n      }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n        return param_1;\n      }" { (return_statement "return param_1;" return identifier ;) })) (expression_statement "setvbuf(__stream,(char *)0x0,2,0);" (call_expression "setvbuf(__stream,(char *)0x0,2,0)" identifier (argument_list "(__stream,(char *)0x0,2,0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , number_literal , number_literal ))) ;) (return_statement "return param_1;" return identifier ;) })) })) (return_statement "return (undefined4 *)0x0;" return (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE 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 ( ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) , (binary_expression IDENT == (char_literal ' escape_sequence '))) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression (pointer_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 (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , LIT , LIT ))) ;) (return_statement return IDENT ;) })) })) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })))
(function_definition "undefined4 * FUN_001acb30(undefined4 *param_1,int param_2)\n\n{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}" (type_identifier "undefined4") (pointer_declarator "* FUN_001acb30(undefined4 *param_1,int param_2)" (* "*") (function_declarator "FUN_001acb30(undefined4 *param_1,int param_2)" (identifier "FUN_001acb30") (parameter_list "(undefined4 *param_1,int param_2)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")")))) (compound_statement "{\n  char cVar1;\n  char *__modes;\n  FILE *__stream;\n  \n  __modes = (char *)FUN_001ac930();\n  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }\n  return (undefined4 *)0x0;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "char *__modes;" (primitive_type "char") (pointer_declarator "*__modes" (* "*") (identifier "__modes")) (; ";")) (declaration "FILE *__stream;" (type_identifier "FILE") (pointer_declarator "*__stream" (* "*") (identifier "__stream")) (; ";")) (expression_statement "__modes = (char *)FUN_001ac930();" (assignment_expression "__modes = (char *)FUN_001ac930()" (identifier "__modes") (= "=") (cast_expression "(char *)FUN_001ac930()" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_001ac930()" (identifier "FUN_001ac930") (argument_list "()" (( "(") () ")"))))) (; ";")) (if_statement "if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }" (if "if") (parenthesized_expression "((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0'))" (( "(") (binary_expression "(__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')" (parenthesized_expression "(__modes != (char *)0x0)" (( "(") (binary_expression "__modes != (char *)0x0" (identifier "__modes") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (&& "&&") (parenthesized_expression "(cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')" (( "(") (comma_expression "cVar1 = FUN_001acaa0(param_1), cVar1 == '\0'" (assignment_expression "cVar1 = FUN_001acaa0(param_1)" (identifier "cVar1") (= "=") (call_expression "FUN_001acaa0(param_1)" (identifier "FUN_001acaa0") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (, ",") (binary_expression "cVar1 == '\0'" (identifier "cVar1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'")))) () ")"))) () ")")) (compound_statement "{\n    __stream = fdopen(param_2,__modes);\n    *param_1 = __stream;\n    if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }\n  }" ({ "{") (expression_statement "__stream = fdopen(param_2,__modes);" (assignment_expression "__stream = fdopen(param_2,__modes)" (identifier "__stream") (= "=") (call_expression "fdopen(param_2,__modes)" (identifier "fdopen") (argument_list "(param_2,__modes)" (( "(") (identifier "param_2") (, ",") (identifier "__modes") () ")")))) (; ";")) (expression_statement "*param_1 = __stream;" (assignment_expression "*param_1 = __stream" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "__stream")) (; ";")) (if_statement "if (__stream != (FILE *)0x0) {\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }" (if "if") (parenthesized_expression "(__stream != (FILE *)0x0)" (( "(") (binary_expression "__stream != (FILE *)0x0" (identifier "__stream") (!= "!=") (cast_expression "(FILE *)0x0" (( "(") (type_descriptor "FILE *" (type_identifier "FILE") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *(undefined1 *)(param_1 + 1) = 1;\n      if (param_2 != 0) {\n        return param_1;\n      }\n      setvbuf(__stream,(char *)0x0,2,0);\n      return param_1;\n    }" ({ "{") (expression_statement "*(undefined1 *)(param_1 + 1) = 1;" (assignment_expression "*(undefined1 *)(param_1 + 1) = 1" (pointer_expression "*(undefined1 *)(param_1 + 1)" (* "*") (cast_expression "(undefined1 *)(param_1 + 1)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")")))) (= "=") (number_literal "1")) (; ";")) (if_statement "if (param_2 != 0) {\n        return param_1;\n      }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        return param_1;\n      }" ({ "{") (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (expression_statement "setvbuf(__stream,(char *)0x0,2,0);" (call_expression "setvbuf(__stream,(char *)0x0,2,0)" (identifier "setvbuf") (argument_list "(__stream,(char *)0x0,2,0)" (( "(") (identifier "__stream") (, ",") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (number_literal "2") (, ",") (number_literal "0") () ")"))) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (} "}"))) (return_statement "return (undefined4 *)0x0;" (return "return") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::__basic_file<char>::sys_open(int, std::_Ios_Openmode) */

var_7<var_8> * __thiscall
std::var_7<var_8>::sys_open(var_7<var_8> *this,int var_9,_Ios_Openmode param_2)

{
  char var_4;
  char *var_2;
  type_1 *var_6;
  
  __modes = (char *)::(anonymous_namespace)::var_1(param_2);
  if ((var_2 != (char *)0x0) && (var_4 = var_3(this), var_4 == '\0')) {
    var_6 = var_5(var_9,var_2);
    *(type_1 **)this = var_6;
    if (var_6 != (type_1 *)0x0) {
      this[4] = (var_7<var_8>)0x1;
      if (var_9 != 0) {
        return this;
      }
      var_10(var_6,(char *)0x0,2,0);
      return this;
    }
  }
  return (var_7<var_8> *)0x0;
}


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

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

undefined4 * MASKED(undefined4 *param_1,int param_2)

{
  char cVar1;
  char *__modes;
  FILE *__stream;
  
  __modes = (char *)FUN_001ac930();
  if ((__modes != (char *)0x0) && (cVar1 = FUN_001acaa0(param_1), cVar1 == '\0')) {
    __stream = fdopen(param_2,__modes);
    *param_1 = __stream;
    if (__stream != (FILE *)0x0) {
      *(undefined1 *)(param_1 + 1) = 1;
      if (param_2 != 0) {
        return param_1;
      }
      setvbuf(__stream,(char *)0x0,2,0);
      return param_1;
    }
  }
  return (undefined4 *)0x0;
}

