
/* std::wofstream::wofstream(char const*, std::_Ios_Openmode) */

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

{
  int iVar1;
  wios *this_00;
  _Ios_Openmode in_a3;
  wfilebuf *this_01;
  
  iVar1 = *(int *)(param_1 + 4);
  this_01 = (wfilebuf *)(this + 4);
  *(int *)this = iVar1;
  iVar1 = *(int *)(iVar1 + -0xc);
  *(undefined4 *)(this + iVar1) = *(undefined4 *)(param_1 + 8);
  wios::init((wios *)(this + iVar1),(wstreambuf *)0x0);
  iVar1 = *(int *)param_1;
  *(int *)this = iVar1;
                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */
  *(undefined4 *)(this + *(int *)(iVar1 + -0xc)) = *(undefined4 *)(param_1 + 0xc);
  wfilebuf::wfilebuf(this_01);
                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */
  wios::init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01);
  iVar1 = wfilebuf::open(this_01,(char *)param_2,in_a3 | _S_out);
  this_00 = (wios *)(this + *(int *)(*(int *)this + -0xc));
  if (iVar1 != 0) {
    wios::clear(this_00,_S_goodbit);
    return;
  }
  wios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);
  return;
}



void FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)

{
  int iVar1;
  wios *pwVar2;
  wfilebuf *this;
  
  iVar1 = param_2[1];
  this = (wfilebuf *)(param_1 + 1);
  *param_1 = iVar1;
  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));
  *(int *)pwVar2 = param_2[2];
  std::wios::init(pwVar2,(wstreambuf *)0x0);
  iVar1 = *param_2;
  *param_1 = iVar1;
                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */
  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];
  std::wfilebuf::wfilebuf(this);
                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */
  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);
  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);
  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));
  if (iVar1 != 0) {
    std::wios::clear(pwVar2,0);
    return;
  }
  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);
  return;
}


lui gp,0x15
addiu gp,gp,0x7288
addu gp,gp,t9
addiu sp,sp,-0x30
lw v0,0x4(a1)
lw t9,-0x4030(gp)
sw gp,0x10(sp)
sw s4,0x28(sp)
or s4,a3,zero
sw s3,0x24(sp)
or s3,a2,zero
sw s2,0x20(sp)
addiu s2,a0,0x4
sw s1,0x1c(sp)
or s1,a1,zero
sw s0,0x18(sp)
or a1,zero,zero
sw ra,0x2c(sp)
or s0,a0,zero
sw v0,0x0(a0)
lw v0,-0xc(v0)
lw v1,0x8(s1)
addu v0,a0,v0
or a0,v0,zero
bal 0x00367010
_sw v1,0x0(v0)
or a0,s2,zero
lw v0,0x0(s1)
lw gp,0x10(sp)
sw v0,0x0(s0)
lw v0,-0xc(v0)
lw v1,0xc(s1)
lw t9,-0x3d44(gp)
addu v0,s0,v0
bal 0x0036e740
_sw v1,0x0(v0)
lw v0,0x0(s0)
or a1,s2,zero
lw gp,0x10(sp)
lw a0,-0xc(v0)
lw t9,-0x4030(gp)
bal 0x00367010
_addu a0,s0,a0
lw gp,0x10(sp)
ori a2,s4,0x10
or a1,s3,zero
lw t9,-0x3d70(gp)
bal 0x0036f5cc
_or a0,s2,zero
lw v1,0x0(s0)
lw gp,0x10(sp)
lw a0,-0xc(v1)
beq v0,zero,0x003720bc
_addu a0,s0,a0
lw t9,-0x40c0(gp)
bal 0x003667f4
_or a1,zero,zero
lw ra,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x30
lw a1,0x14(a0)
lw t9,-0x40c0(gp)
bal 0x003667f4
_ori a1,a1,0x4
lw ra,0x2c(sp)
lw s4,0x28(sp)
lw s3,0x24(sp)
lw s2,0x20(sp)
lw s1,0x1c(sp)
lw s0,0x18(sp)
jr ra
_addiu sp,sp,0x30
(translation_unit "void FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */\n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */\n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}\n\n" (function_definition "void FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */\n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */\n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)" identifier (parameter_list "(int *param_1,int *param_2,undefined4 param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */\n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */\n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\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) ;) (declaration "wfilebuf *this;" type_identifier (pointer_declarator "*this" * identifier) ;) (expression_statement "iVar1 = param_2[1];" (assignment_expression "iVar1 = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (expression_statement "this = (wfilebuf *)(param_1 + 1);" (assignment_expression "this = (wfilebuf *)(param_1 + 1)" identifier = (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) )))) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));" (assignment_expression "pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc))" identifier = (cast_expression "(wios *)((int)param_1 + *(int *)(iVar1 + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(iVar1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(iVar1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))))) )))) ;) (expression_statement "*(int *)pwVar2 = param_2[2];" (assignment_expression "*(int *)pwVar2 = param_2[2]" (pointer_expression "*(int *)pwVar2" * (cast_expression "(int *)pwVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = (subscript_expression "param_2[2]" identifier [ number_literal ])) ;) (labeled_statement "std::wios::init(pwVar2,(wstreambuf *)0x0);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::init(pwVar2,(wstreambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init(pwVar2,(wstreambuf *)0x0);" (call_expression "init(pwVar2,(wstreambuf *)0x0)" identifier (argument_list "(pwVar2,(wstreambuf *)0x0)" ( identifier , (cast_expression "(wstreambuf *)0x0" ( (type_descriptor "wstreambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;))) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) comment (expression_statement "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];" (assignment_expression "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3]" (pointer_expression "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc))" * (cast_expression "(int *)((int)param_1 + *(int *)(iVar1 + -0xc))" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(iVar1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(iVar1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))))) )))) = (subscript_expression "param_2[3]" identifier [ number_literal ])) ;) (labeled_statement "std::wfilebuf::wfilebuf(this);" statement_identifier : (ERROR ":" :) (labeled_statement "wfilebuf::wfilebuf(this);" statement_identifier : (ERROR ":" :) (expression_statement "wfilebuf(this);" (call_expression "wfilebuf(this)" identifier (argument_list "(this)" ( identifier ))) ;))) comment (labeled_statement "std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" statement_identifier : (ERROR ":" :) (expression_statement "init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" (call_expression "init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this)" identifier (argument_list "((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this)" ( (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) ))))) ))) , (cast_expression "(wstreambuf *)this" ( (type_descriptor "wstreambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;))) (ERROR "iVar1 = std::" (assignment_expression "iVar1 = std" identifier = identifier) : :) (labeled_statement "wfilebuf::open(this,param_3,param_4 | 0x10);" statement_identifier : (ERROR ":" :) (expression_statement "open(this,param_3,param_4 | 0x10);" (call_expression "open(this,param_3,param_4 | 0x10)" identifier (argument_list "(this,param_3,param_4 | 0x10)" ( identifier , identifier , (binary_expression "param_4 | 0x10" identifier | number_literal) ))) ;)) (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) ))))) )))) ;) (if_statement "if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    std::wios::clear(pwVar2,0);\n    return;\n  }" { (labeled_statement "std::wios::clear(pwVar2,0);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::clear(pwVar2,0);" statement_identifier : (ERROR ":" :) (expression_statement "clear(pwVar2,0);" (call_expression "clear(pwVar2,0)" identifier (argument_list "(pwVar2,0)" ( identifier , number_literal ))) ;))) (return_statement "return;" return ;) })) (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::wofstream(char const*, std::_Ios_Openmode) */\n\nvoid __thiscall std::wofstream::wofstream(wofstream *this,char *param_1,_Ios_Openmode param_2)\n\n{\n  int iVar1;\n  wios *this_00;\n  _Ios_Openmode in_a3;\n  wfilebuf *this_01;\n  \n  iVar1 = *(int *)(param_1 + 4);\n  this_01 = (wfilebuf *)(this + 4);\n  *(int *)this = iVar1;\n  iVar1 = *(int *)(iVar1 + -0xc);\n  *(undefined4 *)(this + iVar1) = *(undefined4 *)(param_1 + 8);\n  wios::init((wios *)(this + iVar1),(wstreambuf *)0x0);\n  iVar1 = *(int *)param_1;\n  *(int *)this = iVar1;\n                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */\n  *(undefined4 *)(this + *(int *)(iVar1 + -0xc)) = *(undefined4 *)(param_1 + 0xc);\n  wfilebuf::wfilebuf(this_01);\n                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */\n  wios::init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01);\n  iVar1 = wfilebuf::open(this_01,(char *)param_2,in_a3 | _S_out);\n  this_00 = (wios *)(this + *(int *)(*(int *)this + -0xc));\n  if (iVar1 != 0) {\n    wios::clear(this_00,_S_goodbit);\n    return;\n  }\n  wios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);\n  return;\n}\n\n" comment (function_definition "void __thiscall std::wofstream::wofstream(wofstream *this,char *param_1,_Ios_Openmode param_2)\n\n{\n  int iVar1;\n  wios *this_00;\n  _Ios_Openmode in_a3;\n  wfilebuf *this_01;\n  \n  iVar1 = *(int *)(param_1 + 4);\n  this_01 = (wfilebuf *)(this + 4);\n  *(int *)this = iVar1;\n  iVar1 = *(int *)(iVar1 + -0xc);\n  *(undefined4 *)(this + iVar1) = *(undefined4 *)(param_1 + 8);\n  wios::init((wios *)(this + iVar1),(wstreambuf *)0x0);\n  iVar1 = *(int *)param_1;\n  *(int *)this = iVar1;\n                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */\n  *(undefined4 *)(this + *(int *)(iVar1 + -0xc)) = *(undefined4 *)(param_1 + 0xc);\n  wfilebuf::wfilebuf(this_01);\n                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */\n  wios::init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01);\n  iVar1 = wfilebuf::open(this_01,(char *)param_2,in_a3 | _S_out);\n  this_00 = (wios *)(this + *(int *)(*(int *)this + -0xc));\n  if (iVar1 != 0) {\n    wios::clear(this_00,_S_goodbit);\n    return;\n  }\n  wios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wofstream::" identifier : : identifier : :) (function_declarator "wofstream(wofstream *this,char *param_1,_Ios_Openmode param_2)" identifier (parameter_list "(wofstream *this,char *param_1,_Ios_Openmode param_2)" ( (parameter_declaration "wofstream *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "_Ios_Openmode param_2" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wios *this_00;\n  _Ios_Openmode in_a3;\n  wfilebuf *this_01;\n  \n  iVar1 = *(int *)(param_1 + 4);\n  this_01 = (wfilebuf *)(this + 4);\n  *(int *)this = iVar1;\n  iVar1 = *(int *)(iVar1 + -0xc);\n  *(undefined4 *)(this + iVar1) = *(undefined4 *)(param_1 + 8);\n  wios::init((wios *)(this + iVar1),(wstreambuf *)0x0);\n  iVar1 = *(int *)param_1;\n  *(int *)this = iVar1;\n                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */\n  *(undefined4 *)(this + *(int *)(iVar1 + -0xc)) = *(undefined4 *)(param_1 + 0xc);\n  wfilebuf::wfilebuf(this_01);\n                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */\n  wios::init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01);\n  iVar1 = wfilebuf::open(this_01,(char *)param_2,in_a3 | _S_out);\n  this_00 = (wios *)(this + *(int *)(*(int *)this + -0xc));\n  if (iVar1 != 0) {\n    wios::clear(this_00,_S_goodbit);\n    return;\n  }\n  wios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);\n  return;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wios *this_00;" type_identifier (pointer_declarator "*this_00" * identifier) ;) (declaration "_Ios_Openmode in_a3;" type_identifier identifier ;) (declaration "wfilebuf *this_01;" type_identifier (pointer_declarator "*this_01" * identifier) ;) (expression_statement "iVar1 = *(int *)(param_1 + 4);" (assignment_expression "iVar1 = *(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 "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) ))))) ;) (expression_statement "this_01 = (wfilebuf *)(this + 4);" (assignment_expression "this_01 = (wfilebuf *)(this + 4)" identifier = (cast_expression "(wfilebuf *)(this + 4)" ( (type_descriptor "wfilebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) ;) (expression_statement "*(int *)this = iVar1;" (assignment_expression "*(int *)this = iVar1" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) (expression_statement "iVar1 = *(int *)(iVar1 + -0xc);" (assignment_expression "iVar1 = *(int *)(iVar1 + -0xc)" identifier = (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))))) ;) (expression_statement "*(undefined4 *)(this + iVar1) = *(undefined4 *)(param_1 + 8);" (assignment_expression "*(undefined4 *)(this + iVar1) = *(undefined4 *)(param_1 + 8)" (pointer_expression "*(undefined4 *)(this + iVar1)" * (cast_expression "(undefined4 *)(this + iVar1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + iVar1)" ( (binary_expression "this + iVar1" identifier + identifier) )))) = (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (labeled_statement "wios::init((wios *)(this + iVar1),(wstreambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((wios *)(this + iVar1),(wstreambuf *)0x0);" (call_expression "init((wios *)(this + iVar1),(wstreambuf *)0x0)" identifier (argument_list "((wios *)(this + iVar1),(wstreambuf *)0x0)" ( (cast_expression "(wios *)(this + iVar1)" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + iVar1)" ( (binary_expression "this + iVar1" identifier + identifier) ))) , (cast_expression "(wstreambuf *)0x0" ( (type_descriptor "wstreambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;)) (expression_statement "iVar1 = *(int *)param_1;" (assignment_expression "iVar1 = *(int *)param_1" identifier = (pointer_expression "*(int *)param_1" * (cast_expression "(int *)param_1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "*(int *)this = iVar1;" (assignment_expression "*(int *)this = iVar1" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = identifier) ;) comment (expression_statement "*(undefined4 *)(this + *(int *)(iVar1 + -0xc)) = *(undefined4 *)(param_1 + 0xc);" (assignment_expression "*(undefined4 *)(this + *(int *)(iVar1 + -0xc)) = *(undefined4 *)(param_1 + 0xc)" (pointer_expression "*(undefined4 *)(this + *(int *)(iVar1 + -0xc))" * (cast_expression "(undefined4 *)(this + *(int *)(iVar1 + -0xc))" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(int *)(iVar1 + -0xc))" ( (binary_expression "this + *(int *)(iVar1 + -0xc)" identifier + (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))))) )))) = (pointer_expression "*(undefined4 *)(param_1 + 0xc)" * (cast_expression "(undefined4 *)(param_1 + 0xc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) ;) (labeled_statement "wfilebuf::wfilebuf(this_01);" statement_identifier : (ERROR ":" :) (expression_statement "wfilebuf(this_01);" (call_expression "wfilebuf(this_01)" identifier (argument_list "(this_01)" ( identifier ))) ;)) comment (labeled_statement "wios::init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01);" statement_identifier : (ERROR ":" :) (expression_statement "init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01);" (call_expression "init((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01)" identifier (argument_list "((wios *)(this + *(int *)(*(int *)this + -0xc)),(wstreambuf *)this_01)" ( (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) ))))) ))) , (cast_expression "(wstreambuf *)this_01" ( (type_descriptor "wstreambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;)) (ERROR "iVar1 = wfilebuf::" (assignment_expression "iVar1 = wfilebuf" identifier = identifier) : :) (expression_statement "open(this_01,(char *)param_2,in_a3 | _S_out);" (call_expression "open(this_01,(char *)param_2,in_a3 | _S_out)" identifier (argument_list "(this_01,(char *)param_2,in_a3 | _S_out)" ( identifier , (cast_expression "(char *)param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , (binary_expression "in_a3 | _S_out" identifier | identifier) ))) ;) (expression_statement "this_00 = (wios *)(this + *(int *)(*(int *)this + -0xc));" (assignment_expression "this_00 = (wios *)(this + *(int *)(*(int *)this + -0xc))" identifier = (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) ))))) )))) ;) (if_statement "if (iVar1 != 0) {\n    wios::clear(this_00,_S_goodbit);\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    wios::clear(this_00,_S_goodbit);\n    return;\n  }" { (labeled_statement "wios::clear(this_00,_S_goodbit);" statement_identifier : (ERROR ":" :) (expression_statement "clear(this_00,_S_goodbit);" (call_expression "clear(this_00,_S_goodbit)" identifier (argument_list "(this_00,_S_goodbit)" ( identifier , identifier ))) ;)) (return_statement "return;" return ;) })) (labeled_statement "wios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);" statement_identifier : (ERROR ":" :) (expression_statement "clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);" (call_expression "clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit)" identifier (argument_list "(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit)" ( identifier , (binary_expression "*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit" (pointer_expression "*(_Ios_Iostate *)(this_00 + 0x14)" * (cast_expression "(_Ios_Iostate *)(this_00 + 0x14)" ( (type_descriptor "_Ios_Iostate *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this_00 + 0x14)" ( (binary_expression "this_00 + 0x14" identifier + number_literal) )))) | identifier) ))) ;)) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    \n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    \n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}\n\n" (function_definition "void FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    \n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    \n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)" identifier (parameter_list "(int *param_1,int *param_2,undefined4 param_3,uint param_4)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "uint param_4" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    \n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    \n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\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) ;) (declaration "wfilebuf *this;" type_identifier (pointer_declarator "*this" * identifier) ;) (expression_statement "iVar1 = param_2[1];" (assignment_expression "iVar1 = param_2[1]" identifier = (subscript_expression "param_2[1]" identifier [ number_literal ])) ;) (expression_statement "this = (wfilebuf *)(param_1 + 1);" (assignment_expression "this = (wfilebuf *)(param_1 + 1)" identifier = (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) )))) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));" (assignment_expression "pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc))" identifier = (cast_expression "(wios *)((int)param_1 + *(int *)(iVar1 + -0xc))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(iVar1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(iVar1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))))) )))) ;) (expression_statement "*(int *)pwVar2 = param_2[2];" (assignment_expression "*(int *)pwVar2 = param_2[2]" (pointer_expression "*(int *)pwVar2" * (cast_expression "(int *)pwVar2" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) = (subscript_expression "param_2[2]" identifier [ number_literal ])) ;) (labeled_statement "std::wios::init(pwVar2,(wstreambuf *)0x0);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::init(pwVar2,(wstreambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init(pwVar2,(wstreambuf *)0x0);" (call_expression "init(pwVar2,(wstreambuf *)0x0)" identifier (argument_list "(pwVar2,(wstreambuf *)0x0)" ( identifier , (cast_expression "(wstreambuf *)0x0" ( (type_descriptor "wstreambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;))) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];" (assignment_expression "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3]" (pointer_expression "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc))" * (cast_expression "(int *)((int)param_1 + *(int *)(iVar1 + -0xc))" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)param_1 + *(int *)(iVar1 + -0xc))" ( (binary_expression "(int)param_1 + *(int *)(iVar1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(iVar1 + -0xc)" * (cast_expression "(int *)(iVar1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar1 + -0xc)" ( (binary_expression "iVar1 + -0xc" identifier + number_literal) ))))) )))) = (subscript_expression "param_2[3]" identifier [ number_literal ])) ;) (labeled_statement "std::wfilebuf::wfilebuf(this);" statement_identifier : (ERROR ":" :) (labeled_statement "wfilebuf::wfilebuf(this);" statement_identifier : (ERROR ":" :) (expression_statement "wfilebuf(this);" (call_expression "wfilebuf(this)" identifier (argument_list "(this)" ( identifier ))) ;))) (labeled_statement "std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" statement_identifier : (ERROR ":" :) (expression_statement "init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" (call_expression "init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this)" identifier (argument_list "((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this)" ( (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) ))))) ))) , (cast_expression "(wstreambuf *)this" ( (type_descriptor "wstreambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;))) (ERROR "iVar1 = std::" (assignment_expression "iVar1 = std" identifier = identifier) : :) (labeled_statement "wfilebuf::open(this,param_3,param_4 | 0x10);" statement_identifier : (ERROR ":" :) (expression_statement "open(this,param_3,param_4 | 0x10);" (call_expression "open(this,param_3,param_4 | 0x10)" identifier (argument_list "(this,param_3,param_4 | 0x10)" ( identifier , identifier , (binary_expression "param_4 | 0x10" identifier | number_literal) ))) ;)) (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) ))))) )))) ;) (if_statement "if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    std::wios::clear(pwVar2,0);\n    return;\n  }" { (labeled_statement "std::wios::clear(pwVar2,0);" statement_identifier : (ERROR ":" :) (labeled_statement "wios::clear(pwVar2,0);" statement_identifier : (ERROR ":" :) (expression_statement "clear(pwVar2,0);" (call_expression "clear(pwVar2,0)" identifier (argument_list "(pwVar2,0)" ( identifier , number_literal ))) ;))) (return_statement "return;" return ;) })) (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) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (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 IDENT + LIT) ))))) )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) = (subscript_expression IDENT [ LIT ])) ;) (labeled_statement statement_identifier : (ERROR :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ))) ;))) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (pointer_expression * (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 IDENT + LIT) ))))) )))) = (subscript_expression IDENT [ LIT ])) ;) (labeled_statement statement_identifier : (ERROR :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;))) (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) ))))) ))) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT) ))) ;))) (ERROR (assignment_expression IDENT = IDENT) : :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression IDENT | LIT) ))) ;)) (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) ))))) )))) ;) (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 ( IDENT , LIT ))) ;))) (return_statement return ;) })) (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_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)\n\n{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    \n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    \n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\n  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00371fb8(int *param_1,int *param_2,undefined4 param_3,uint param_4)" (identifier "FUN_00371fb8") (parameter_list "(int *param_1,int *param_2,undefined4 param_3,uint param_4)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "uint param_4" (type_identifier "uint") (identifier "param_4")) () ")"))) (compound_statement "{\n  int iVar1;\n  wios *pwVar2;\n  wfilebuf *this;\n  \n  iVar1 = param_2[1];\n  this = (wfilebuf *)(param_1 + 1);\n  *param_1 = iVar1;\n  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));\n  *(int *)pwVar2 = param_2[2];\n  std::wios::init(pwVar2,(wstreambuf *)0x0);\n  iVar1 = *param_2;\n  *param_1 = iVar1;\n                    \n  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];\n  std::wfilebuf::wfilebuf(this);\n                    \n  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);\n  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);\n  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar1 != 0) {\n    std::wios::clear(pwVar2,0);\n    return;\n  }\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")) (; ";")) (declaration "wfilebuf *this;" (type_identifier "wfilebuf") (pointer_declarator "*this" (* "*") (identifier "this")) (; ";")) (expression_statement "iVar1 = param_2[1];" (assignment_expression "iVar1 = param_2[1]" (identifier "iVar1") (= "=") (subscript_expression "param_2[1]" (identifier "param_2") ([ "[") (number_literal "1") (] "]"))) (; ";")) (expression_statement "this = (wfilebuf *)(param_1 + 1);" (assignment_expression "this = (wfilebuf *)(param_1 + 1)" (identifier "this") (= "=") (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")) () ")")))) (; ";")) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));" (assignment_expression "pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc))" (identifier "pwVar2") (= "=") (cast_expression "(wios *)((int)param_1 + *(int *)(iVar1 + -0xc))" (( "(") (type_descriptor "wios *" (type_identifier "wios") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + *(int *)(iVar1 + -0xc))" (( "(") (binary_expression "(int)param_1 + *(int *)(iVar1 + -0xc)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(iVar1 + -0xc)" (* "*") (cast_expression "(int *)(iVar1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")"))))) () ")")))) (; ";")) (expression_statement "*(int *)pwVar2 = param_2[2];" (assignment_expression "*(int *)pwVar2 = param_2[2]" (pointer_expression "*(int *)pwVar2" (* "*") (cast_expression "(int *)pwVar2" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "pwVar2"))) (= "=") (subscript_expression "param_2[2]" (identifier "param_2") ([ "[") (number_literal "2") (] "]"))) (; ";")) (labeled_statement "std::wios::init(pwVar2,(wstreambuf *)0x0);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "wios::init(pwVar2,(wstreambuf *)0x0);" (statement_identifier "wios") (: ":") (ERROR ":" (: ":")) (expression_statement "init(pwVar2,(wstreambuf *)0x0);" (call_expression "init(pwVar2,(wstreambuf *)0x0)" (identifier "init") (argument_list "(pwVar2,(wstreambuf *)0x0)" (( "(") (identifier "pwVar2") (, ",") (cast_expression "(wstreambuf *)0x0" (( "(") (type_descriptor "wstreambuf *" (type_identifier "wstreambuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")"))) (; ";")))) (expression_statement "iVar1 = *param_2;" (assignment_expression "iVar1 = *param_2" (identifier "iVar1") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (; ";")) (expression_statement "*param_1 = iVar1;" (assignment_expression "*param_1 = iVar1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "iVar1")) (; ";")) (expression_statement "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];" (assignment_expression "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3]" (pointer_expression "*(int *)((int)param_1 + *(int *)(iVar1 + -0xc))" (* "*") (cast_expression "(int *)((int)param_1 + *(int *)(iVar1 + -0xc))" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)param_1 + *(int *)(iVar1 + -0xc))" (( "(") (binary_expression "(int)param_1 + *(int *)(iVar1 + -0xc)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(iVar1 + -0xc)" (* "*") (cast_expression "(int *)(iVar1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar1 + -0xc)" (( "(") (binary_expression "iVar1 + -0xc" (identifier "iVar1") (+ "+") (number_literal "-0xc")) () ")"))))) () ")")))) (= "=") (subscript_expression "param_2[3]" (identifier "param_2") ([ "[") (number_literal "3") (] "]"))) (; ";")) (labeled_statement "std::wfilebuf::wfilebuf(this);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "wfilebuf::wfilebuf(this);" (statement_identifier "wfilebuf") (: ":") (ERROR ":" (: ":")) (expression_statement "wfilebuf(this);" (call_expression "wfilebuf(this)" (identifier "wfilebuf") (argument_list "(this)" (( "(") (identifier "this") () ")"))) (; ";")))) (labeled_statement "std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" (statement_identifier "wios") (: ":") (ERROR ":" (: ":")) (expression_statement "init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);" (call_expression "init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this)" (identifier "init") (argument_list "((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this)" (( "(") (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")) () ")"))))) () ")"))) (, ",") (cast_expression "(wstreambuf *)this" (( "(") (type_descriptor "wstreambuf *" (type_identifier "wstreambuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")) () ")"))) (; ";")))) (ERROR "iVar1 = std::" (assignment_expression "iVar1 = std" (identifier "iVar1") (= "=") (identifier "std")) (: ":") (: ":")) (labeled_statement "wfilebuf::open(this,param_3,param_4 | 0x10);" (statement_identifier "wfilebuf") (: ":") (ERROR ":" (: ":")) (expression_statement "open(this,param_3,param_4 | 0x10);" (call_expression "open(this,param_3,param_4 | 0x10)" (identifier "open") (argument_list "(this,param_3,param_4 | 0x10)" (( "(") (identifier "this") (, ",") (identifier "param_3") (, ",") (binary_expression "param_4 | 0x10" (identifier "param_4") (| "|") (number_literal "0x10")) () ")"))) (; ";"))) (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")) () ")"))))) () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    std::wios::clear(pwVar2,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(pwVar2,0);\n    return;\n  }" ({ "{") (labeled_statement "std::wios::clear(pwVar2,0);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "wios::clear(pwVar2,0);" (statement_identifier "wios") (: ":") (ERROR ":" (: ":")) (expression_statement "clear(pwVar2,0);" (call_expression "clear(pwVar2,0)" (identifier "clear") (argument_list "(pwVar2,0)" (( "(") (identifier "pwVar2") (, ",") (number_literal "0") () ")"))) (; ";")))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (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::wofstream(char const*, std::_Ios_Openmode) */

void __thiscall std::function_1::function_1(function_1 *var_2,char *var_1,type_1 param_2)

{
  int var_3;
  type_2 *var_9;
  type_1 var_6;
  type_3 *this_01;
  
  var_3 = *(int *)(var_1 + 4);
  this_01 = (type_3 *)(var_2 + 4);
  *(int *)var_2 = var_3;
  var_3 = *(int *)(var_3 + -0xc);
  *(type_4 *)(var_2 + var_3) = *(type_4 *)(var_1 + 8);
  wios::var_4((type_2 *)(var_2 + var_3),(type_5 *)0x0);
  var_3 = *(int *)var_1;
  *(int *)var_2 = var_3;
                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */
  *(type_4 *)(var_2 + *(int *)(var_3 + -0xc)) = *(type_4 *)(var_1 + 0xc);
  wfilebuf::type_3(this_01);
                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */
  wios::var_4((type_2 *)(var_2 + *(int *)(*(int *)var_2 + -0xc)),(type_5 *)this_01);
  var_3 = type_3::var_5(this_01,(char *)param_2,var_6 | var_7);
  var_9 = (type_2 *)(var_2 + *(int *)(*(int *)var_2 + -0xc));
  if (var_3 != 0) {
    wios::var_8(var_9,_S_goodbit);
    return;
  }
  wios::var_8(var_9,*(type_6 *)(var_9 + 0x14) | var_10);
  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: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) 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))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (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: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (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: (identifier) right: (number_literal)))))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))) right: (subscript_expression argument: (identifier) index: (number_literal)))) (labeled_statement label: (statement_identifier) (ERROR) (labeled_statement label: (statement_identifier) (ERROR) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) 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: (identifier) right: (number_literal))))))))) right: (subscript_expression argument: (identifier) index: (number_literal)))) (labeled_statement label: (statement_identifier) (ERROR) (labeled_statement label: (statement_identifier) (ERROR) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (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)))))))) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier))))))) (ERROR (assignment_expression left: (identifier) right: (identifier))) (labeled_statement label: (statement_identifier) (ERROR) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (number_literal)))))) (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)))))))))) (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 (identifier) (number_literal)))))) (return_statement))) (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,int *param_2,undefined4 param_3,uint param_4)

{
  int iVar1;
  wios *pwVar2;
  wfilebuf *this;
  
  iVar1 = param_2[1];
  this = (wfilebuf *)(param_1 + 1);
  *param_1 = iVar1;
  pwVar2 = (wios *)((int)param_1 + *(int *)(iVar1 + -0xc));
  *(int *)pwVar2 = param_2[2];
  std::wios::init(pwVar2,(wstreambuf *)0x0);
  iVar1 = *param_2;
  *param_1 = iVar1;
                    /* try { // try from 00372040 to 00372047 has its CatchHandler @ 00372128 */
  *(int *)((int)param_1 + *(int *)(iVar1 + -0xc)) = param_2[3];
  std::wfilebuf::wfilebuf(this);
                    /* try { // try from 0037205c to 003720cb has its CatchHandler @ 003720ec */
  std::wios::init((wios *)((int)param_1 + *(int *)(*param_1 + -0xc)),(wstreambuf *)this);
  iVar1 = std::wfilebuf::open(this,param_3,param_4 | 0x10);
  pwVar2 = (wios *)((int)param_1 + *(int *)(*param_1 + -0xc));
  if (iVar1 != 0) {
    std::wios::clear(pwVar2,0);
    return;
  }
  std::wios::clear(pwVar2,*(uint *)(pwVar2 + 0x14) | 4);
  return;
}

