
/* std::wofstream::open(std::string const&, std::_Ios_Openmode) */

void __thiscall std::wofstream::open(wofstream *this,string *param_1,_Ios_Openmode param_2)

{
  int iVar1;
  
  iVar1 = wfilebuf::open((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out);
  if (iVar1 != 0) {
    wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);
    return;
  }
  wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),
              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)
  ;
  return;
}



void FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)

{
  int iVar1;
  wios *pwVar2;
  
  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);
  if (iVar1 != 0) {
    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);
    return;
  }
  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));
  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);
  return;
}


lui gp,0x15
addiu gp,gp,0x6664
addu gp,gp,t9
addiu sp,sp,-0x20
lw t9,-0x3d70(gp)
ori a2,a2,0x10
sw gp,0x10(sp)
sw s0,0x18(sp)
or s0,a0,zero
sw ra,0x1c(sp)
addiu a0,a0,0x4
bal 0x0036f5cc
_lw a1,0x0(a1)
beq v0,zero,0x00372c3c
_lw gp,0x10(sp)
lw v0,0x0(s0)
or a1,zero,zero
lw ra,0x1c(sp)
lw t9,-0x40c0(gp)
lw a0,-0xc(v0)
addu a0,s0,a0
lw s0,0x18(sp)
b 0x003667f4
_addiu sp,sp,0x20
lw v0,0x0(s0)
lw ra,0x1c(sp)
lw t9,-0x40c0(gp)
lw v0,-0xc(v0)
addu s0,s0,v0
or a0,s0,zero
lw a1,0x14(s0)
lw s0,0x18(sp)
addiu sp,sp,0x20
b 0x003667f4
_ori a1,a1,0x4
(translation_unit "void FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}\n\n" (function_definition "void FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)" identifier (parameter_list "(int *param_1,undefined4 *param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wios *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (ERROR "iVar1 = std::" (assignment_expression "iVar1 = std" identifier = identifier) : :) (labeled_statement "wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);" statement_identifier : (ERROR ":" :) (expression_statement "open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);" (call_expression "open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10)" identifier (argument_list "((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10)" ( (cast_expression "(wfilebuf *)(param_1 + 1)" ( (type_descriptor "wfilebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) ))) , (pointer_expression "*param_2" * identifier) , (binary_expression "param_3 | 0x10" identifier | number_literal) ))) ;)) (if_statement "if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }" { (labeled_statement "std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" statement_identifier : (ERROR ":" :) (expression_statement "clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" (call_expression "clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0)" identifier (argument_list "((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0)" ( (cast_expression "(wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ))) , number_literal ))) ;))) (return_statement "return;" return ;) })) (expression_statement "pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" identifier = (cast_expression "(wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )))) ;) (labeled_statement "std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (expression_statement "clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" (call_expression "clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4)" identifier (argument_list "(pwVar2,*(uint *)(pwVar2 + 0x14) | 4)" ( identifier , (binary_expression "*(uint *)(pwVar2 + 0x14) | 4" (pointer_expression "*(uint *)(pwVar2 + 0x14)" * (cast_expression "(uint *)(pwVar2 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + 0x14)" ( (binary_expression "pwVar2 + 0x14" identifier + number_literal) )))) | number_literal) ))) ;))) (return_statement "return;" return ;) })))
(translation_unit "/* std::wofstream::open(std::string const&, std::_Ios_Openmode) */\n\nvoid __thiscall std::wofstream::open(wofstream *this,string *param_1,_Ios_Openmode param_2)\n\n{\n  int iVar1;\n  \n  iVar1 = wfilebuf::open((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out);\n  if (iVar1 != 0) {\n    wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);\n    return;\n  }\n  wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)\n  ;\n  return;\n}\n\n" comment (function_definition "void __thiscall std::wofstream::open(wofstream *this,string *param_1,_Ios_Openmode param_2)\n\n{\n  int iVar1;\n  \n  iVar1 = wfilebuf::open((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out);\n  if (iVar1 != 0) {\n    wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);\n    return;\n  }\n  wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)\n  ;\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wofstream::" identifier : : identifier : :) (function_declarator "open(wofstream *this,string *param_1,_Ios_Openmode param_2)" identifier (parameter_list "(wofstream *this,string *param_1,_Ios_Openmode param_2)" ( (parameter_declaration "wofstream *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "string *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "_Ios_Openmode param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  iVar1 = wfilebuf::open((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out);\n  if (iVar1 != 0) {\n    wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);\n    return;\n  }\n  wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)\n  ;\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (ERROR "iVar1 = wfilebuf::" (assignment_expression "iVar1 = wfilebuf" identifier = identifier) : :) (expression_statement "open((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out);" (call_expression "open((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out)" identifier (argument_list "((wfilebuf *)(this + 4),*(char **)param_1,param_2 | _S_out)" ( (cast_expression "(wfilebuf *)(this + 4)" ( (type_descriptor "wfilebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))) , (pointer_expression "*(char **)param_1" * (cast_expression "(char **)param_1" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) , (binary_expression "param_2 | _S_out" identifier | identifier) ))) ;) (if_statement "if (iVar1 != 0) {\n    wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);\n    return;\n  }" { (labeled_statement "wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);" statement_identifier : (ERROR ":" :) (expression_statement "clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit);" (call_expression "clear((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit)" identifier (argument_list "((wios *)(this + *(int *)(*(int *)this + -0xc)),_S_goodbit)" ( (cast_expression "(wios *)(this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc))" ( (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) , identifier ))) ;)) (return_statement "return;" return ;) })) (labeled_statement "wios::clear((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)\n  ;" statement_identifier : (ERROR ":" :) (expression_statement "clear((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)\n  ;" (call_expression "clear((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)" identifier (argument_list "((wios *)(this + *(int *)(*(int *)this + -0xc)),\n              *(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit)" ( (cast_expression "(wios *)(this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc))" ( (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) , (binary_expression "*(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_failbit" (pointer_expression "*(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14)" * (cast_expression "(_Ios_Iostate *)((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14)" ( (type_descriptor "_Ios_Iostate *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14)" ( (binary_expression "(wios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14" (cast_expression "(wios *)(this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc))" ( (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) + number_literal) )))) | identifier) ))) ;)) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}\n\n" (function_definition "void FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)" identifier (parameter_list "(int *param_1,undefined4 *param_2,uint param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wios *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (ERROR "iVar1 = std::" (assignment_expression "iVar1 = std" identifier = identifier) : :) (labeled_statement "wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);" statement_identifier : (ERROR ":" :) (expression_statement "open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);" (call_expression "open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10)" identifier (argument_list "((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10)" ( (cast_expression "(wfilebuf *)(param_1 + 1)" ( (type_descriptor "wfilebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 1)" ( (binary_expression "param_1 + 1" identifier + number_literal) ))) , (pointer_expression "*param_2" * identifier) , (binary_expression "param_3 | 0x10" identifier | number_literal) ))) ;)) (if_statement "if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }" { (labeled_statement "std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" statement_identifier : (ERROR ":" :) (expression_statement "clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" (call_expression "clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0)" identifier (argument_list "((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0)" ( (cast_expression "(wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ))) , number_literal ))) ;))) (return_statement "return;" return ;) })) (expression_statement "pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" identifier = (cast_expression "(wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )))) ;) (labeled_statement "std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (expression_statement "clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" (call_expression "clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4)" identifier (argument_list "(pwVar2,*(uint *)(pwVar2 + 0x14) | 4)" ( identifier , (binary_expression "*(uint *)(pwVar2 + 0x14) | 4" (pointer_expression "*(uint *)(pwVar2 + 0x14)" * (cast_expression "(uint *)(pwVar2 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar2 + 0x14)" ( (binary_expression "pwVar2 + 0x14" identifier + number_literal) )))) | number_literal) ))) ;))) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (ERROR (assignment_expression IDENT = IDENT) : :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) , (pointer_expression * IDENT) , (binary_expression IDENT | LIT) ))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (labeled_statement statement_identifier : (ERROR :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ))) , LIT ))) ;))) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )))) ;) (labeled_statement statement_identifier : (ERROR :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) | LIT) ))) ;))) (return_statement return ;) })))
(function_definition "void FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00372bdc(int *param_1,undefined4 *param_2,uint param_3)" (identifier "FUN_00372bdc") (parameter_list "(int *param_1,undefined4 *param_2,uint param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  wios *pwVar2;\n  \n  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);\n  if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "wios *pwVar2;" (type_identifier "wios") (pointer_declarator "*pwVar2" (* "*") (identifier "pwVar2")) (; ";")) (ERROR "iVar1 = std::" (assignment_expression "iVar1 = std" (identifier "iVar1") (= "=") (identifier "std")) (: ":") (: ":")) (labeled_statement "wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);" (statement_identifier "wfilebuf") (: ":") (ERROR ":" (: ":")) (expression_statement "open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);" (call_expression "open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10)" (identifier "open") (argument_list "((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10)" (( "(") (cast_expression "(wfilebuf *)(param_1 + 1)" (( "(") (type_descriptor "wfilebuf *" (type_identifier "wfilebuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 1)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) () ")"))) (, ",") (pointer_expression "*param_2" (* "*") (identifier "param_2")) (, ",") (binary_expression "param_3 | 0x10" (identifier "param_3") (| "|") (number_literal "0x10")) () ")"))) (; ";"))) (if_statement "if (iVar1 != 0) {\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);\n    return;\n  }" ({ "{") (labeled_statement "std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" (statement_identifier "wios") (: ":") (ERROR ":" (: ":")) (expression_statement "clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);" (call_expression "clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0)" (identifier "clear") (argument_list "((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0)" (( "(") (cast_expression "(wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" (( "(") (type_descriptor "wios *" (type_identifier "wios") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc))" (( "(") (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) () ")"))) (, ",") (number_literal "0") () ")"))) (; ";")))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" (identifier "pwVar2") (= "=") (cast_expression "(wios *)((int)param_1 + *(int *)(*param_1 + -0xc))" (( "(") (type_descriptor "wios *" (type_identifier "wios") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc))" (( "(") (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) () ")")))) (; ";")) (labeled_statement "std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" (statement_identifier "wios") (: ":") (ERROR ":" (: ":")) (expression_statement "clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);" (call_expression "clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4)" (identifier "clear") (argument_list "(pwVar2,*(uint *)(pwVar2 + 0x14) | 4)" (( "(") (identifier "pwVar2") (, ",") (binary_expression "*(uint *)(pwVar2 + 0x14) | 4" (pointer_expression "*(uint *)(pwVar2 + 0x14)" (* "*") (cast_expression "(uint *)(pwVar2 + 0x14)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(pwVar2 + 0x14)" (( "(") (binary_expression "pwVar2 + 0x14" (identifier "pwVar2") (+ "+") (number_literal "0x14")) () ")")))) (| "|") (number_literal "4")) () ")"))) (; ";")))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::wofstream::open(std::string const&, std::_Ios_Openmode) */

void __thiscall std::type_1::function_1(type_1 *var_1,type_2 *param_1,type_3 var_2)

{
  int var_4;
  
  var_4 = type_4::function_1((type_4 *)(var_1 + 4),*(char **)param_1,var_2 | var_3);
  if (var_4 != 0) {
    wios::var_5((type_5 *)(var_1 + *(int *)(*(int *)var_1 + -0xc)),_S_goodbit);
    return;
  }
  wios::var_5((type_5 *)(var_1 + *(int *)(*(int *)var_1 + -0xc)),
              *(type_6 *)((type_5 *)(var_1 + *(int *)(*(int *)var_1 + -0xc)) + 0x14) | var_6)
  ;
  return;
}


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

void MASKED(int *param_1,undefined4 *param_2,uint param_3)

{
  int iVar1;
  wios *pwVar2;
  
  iVar1 = std::wfilebuf::open((wfilebuf *)(param_1 + 1),*param_2,param_3 | 0x10);
  if (iVar1 != 0) {
    std::wios::clear((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),0);
    return;
  }
  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));
  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);
  return;
}

