
/* std::fstream::fstream(std::string const&, std::_Ios_Openmode) */

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

{
  undefined *puVar1;
  int iVar2;
  undefined *puVar3;
  ios *this_00;
  ios_base *this_01;
  filebuf *this_02;
  
  this_01 = (ios_base *)(this + 0x94);
  ios_base::ios_base(this_01);
  *(undefined4 *)(this + 0x104) = 0;
  *(undefined2 *)(this + 0x108) = 0;
  *(undefined4 *)(this + 0x10c) = 0;
  puVar1 = PTR_construction_vtable_004c5484;
  *(undefined4 *)(this + 0x110) = 0;
  *(undefined4 *)(this + 0x114) = 0;
  *(undefined4 *)(this + 0x118) = 0;
  *(undefined **)this = puVar1 + 0xc;
  *(undefined **)(this + 0x94) = puVar1 + 0x20;
                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */
  *(undefined4 *)(this + 4) = 0;
  ios::init((ios *)this_01,(streambuf *)0x0);
  puVar1 = PTR_construction_vtable_004c5480 + 0x20;
  *(undefined **)(this + 8) = PTR_construction_vtable_004c5480 + 0xc;
                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */
  *(undefined **)(this + 0x94) = puVar1;
  ios::init((ios *)this_01,(streambuf *)0x0);
  this_02 = (filebuf *)(this + 0xc);
  puVar3 = PTR_vtable_004c547c + 0x34;
  puVar1 = PTR_vtable_004c547c + 0x20;
  *(undefined **)this = PTR_vtable_004c547c + 0xc;
  *(undefined **)(this + 0x94) = puVar3;
                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */
  *(undefined **)(this + 8) = puVar1;
  filebuf::filebuf(this_02);
                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */
  ios::init((ios *)this_01,(streambuf *)this_02);
  iVar2 = filebuf::open(this_02,*(char **)param_1,param_2);
  this_00 = (ios *)(this + *(int *)(*(int *)this + -0xc));
  if (iVar2 != 0) {
    ios::clear(this_00,_S_goodbit);
    return;
  }
  ios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);
  return;
}



void FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  undefined *puVar3;
  ios *piVar4;
  ios_base *this;
  filebuf *this_00;
  
  this = (ios_base *)(param_1 + 0x25);
  std::ios_base::ios_base(this);
  param_1[0x41] = 0;
  *(undefined2 *)(param_1 + 0x42) = 0;
  param_1[0x43] = 0;
  puVar1 = PTR_DAT_004c5484;
  param_1[0x44] = 0;
  param_1[0x45] = 0;
  param_1[0x46] = 0;
  *param_1 = (int)(puVar1 + 0xc);
  param_1[0x25] = (int)(puVar1 + 0x20);
                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */
  param_1[1] = 0;
  std::ios::init((ios *)this,(streambuf *)0x0);
  puVar1 = PTR_DAT_004c5480 + 0x20;
  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);
                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */
  param_1[0x25] = (int)puVar1;
  std::ios::init((ios *)this,(streambuf *)0x0);
  this_00 = (filebuf *)(param_1 + 3);
  puVar3 = PTR_vtable_004c547c + 0x34;
  puVar1 = PTR_vtable_004c547c + 0x20;
  *param_1 = (int)(PTR_vtable_004c547c + 0xc);
  param_1[0x25] = (int)puVar3;
                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */
  param_1[2] = (int)puVar1;
  std::filebuf::filebuf(this_00);
                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */
  std::ios::init((ios *)this,(streambuf *)this_00);
  iVar2 = std::filebuf::open(this_00,*param_2,param_3);
  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));
  if (iVar2 != 0) {
    std::ios::clear(piVar4,0);
    return;
  }
  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);
  return;
}


lui gp,0x16
addiu gp,gp,-0x4a90
addu gp,gp,t9
addiu sp,sp,-0x38
lw t9,-0x6fa0(gp)
sw s1,0x1c(sp)
addiu s1,a0,0x94
sw gp,0x10(sp)
sw s5,0x2c(sp)
or s5,a1,zero
sw s4,0x28(sp)
or s4,a2,zero
sw s2,0x20(sp)
sw s0,0x18(sp)
or s0,a0,zero
sw ra,0x34(sp)
or a0,s1,zero
sw s6,0x30(sp)
bal 0x00388920
_sw s3,0x24(sp)
or a1,zero,zero
lw gp,0x10(sp)
or a0,s1,zero
sw zero,0x104(s0)
sh zero,0x108(s0)
sw zero,0x10c(s0)
lw v0,-0x3dbc(gp)
lw t9,-0x6f98(gp)
sw zero,0x110(s0)
addiu s2,v0,0xc
sw zero,0x114(s0)
addiu v0,v0,0x20
sw zero,0x118(s0)
sw s2,0x0(s0)
sw v0,0x94(s0)
bal 0x00366530
_sw zero,0x4(s0)
lw gp,0x10(sp)
or a1,zero,zero
or a0,s1,zero
lw v0,-0x3dc0(gp)
lw t9,-0x6f98(gp)
addiu s3,v0,0xc
addiu v0,v0,0x20
sw s3,0x8(s0)
bal 0x00366530
_sw v0,0x94(s0)
lw gp,0x10(sp)
addiu s6,s0,0xc
or a0,s6,zero
lw v0,-0x3dc4(gp)
lw t9,-0x6f90(gp)
addiu a1,v0,0xc
addiu v1,v0,0x34
addiu v0,v0,0x20
sw a1,0x0(s0)
sw v1,0x94(s0)
bal 0x00368de8
_sw v0,0x8(s0)
lw gp,0x10(sp)
or a1,s6,zero
lw t9,-0x6f98(gp)
bal 0x00366530
_or a0,s1,zero
lw gp,0x10(sp)
or a2,s4,zero
lw a1,0x0(s5)
lw t9,-0x6f8c(gp)
bal 0x00369c48
_or a0,s6,zero
lw v1,0x0(s0)
lw gp,0x10(sp)
lw a0,-0xc(v1)
beq v0,zero,0x0036de30
_addu a0,s0,a0
lw t9,-0x6f88(gp)
bal 0x00365b38
_or a1,zero,zero
lw ra,0x34(sp)
lw s6,0x30(sp)
lw s5,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,0x38
lw a1,0x14(a0)
lw t9,-0x6f88(gp)
bal 0x00365b38
_ori a1,a1,0x4
lw ra,0x34(sp)
lw s6,0x30(sp)
lw s5,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,0x38
(translation_unit "void FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */\n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */\n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */\n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */\n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}\n\n" (function_definition "void FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */\n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */\n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */\n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */\n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)" identifier (parameter_list "(int *param_1,undefined4 *param_2,undefined4 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 "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */\n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */\n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */\n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */\n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "ios *piVar4;" type_identifier (pointer_declarator "*piVar4" * identifier) ;) (declaration "ios_base *this;" type_identifier (pointer_declarator "*this" * identifier) ;) (declaration "filebuf *this_00;" type_identifier (pointer_declarator "*this_00" * identifier) ;) (expression_statement "this = (ios_base *)(param_1 + 0x25);" (assignment_expression "this = (ios_base *)(param_1 + 0x25)" identifier = (cast_expression "(ios_base *)(param_1 + 0x25)" ( (type_descriptor "ios_base *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x25)" ( (binary_expression "param_1 + 0x25" identifier + number_literal) )))) ;) (labeled_statement "std::ios_base::ios_base(this);" statement_identifier : (ERROR ":" :) (labeled_statement "ios_base::ios_base(this);" statement_identifier : (ERROR ":" :) (expression_statement "ios_base(this);" (call_expression "ios_base(this)" identifier (argument_list "(this)" ( identifier ))) ;))) (expression_statement "param_1[0x41] = 0;" (assignment_expression "param_1[0x41] = 0" (subscript_expression "param_1[0x41]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*(undefined2 *)(param_1 + 0x42) = 0;" (assignment_expression "*(undefined2 *)(param_1 + 0x42) = 0" (pointer_expression "*(undefined2 *)(param_1 + 0x42)" * (cast_expression "(undefined2 *)(param_1 + 0x42)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x42)" ( (binary_expression "param_1 + 0x42" identifier + number_literal) )))) = number_literal) ;) (expression_statement "param_1[0x43] = 0;" (assignment_expression "param_1[0x43] = 0" (subscript_expression "param_1[0x43]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "puVar1 = PTR_DAT_004c5484;" (assignment_expression "puVar1 = PTR_DAT_004c5484" identifier = identifier) ;) (expression_statement "param_1[0x44] = 0;" (assignment_expression "param_1[0x44] = 0" (subscript_expression "param_1[0x44]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[0x45] = 0;" (assignment_expression "param_1[0x45] = 0" (subscript_expression "param_1[0x45]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[0x46] = 0;" (assignment_expression "param_1[0x46] = 0" (subscript_expression "param_1[0x46]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_1 = (int)(puVar1 + 0xc);" (assignment_expression "*param_1 = (int)(puVar1 + 0xc)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(puVar1 + 0xc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar1 + 0xc)" ( (binary_expression "puVar1 + 0xc" identifier + number_literal) )))) ;) (expression_statement "param_1[0x25] = (int)(puVar1 + 0x20);" (assignment_expression "param_1[0x25] = (int)(puVar1 + 0x20)" (subscript_expression "param_1[0x25]" identifier [ number_literal ]) = (cast_expression "(int)(puVar1 + 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar1 + 0x20)" ( (binary_expression "puVar1 + 0x20" identifier + number_literal) )))) ;) comment (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (labeled_statement "std::ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this,(streambuf *)0x0);" (call_expression "init((ios *)this,(streambuf *)0x0)" identifier (argument_list "((ios *)this,(streambuf *)0x0)" ( (cast_expression "(ios *)this" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)0x0" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;))) (expression_statement "puVar1 = PTR_DAT_004c5480 + 0x20;" (assignment_expression "puVar1 = PTR_DAT_004c5480 + 0x20" identifier = (binary_expression "PTR_DAT_004c5480 + 0x20" identifier + number_literal)) ;) (expression_statement "param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);" (assignment_expression "param_1[2] = (int)(PTR_DAT_004c5480 + 0xc)" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)(PTR_DAT_004c5480 + 0xc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(PTR_DAT_004c5480 + 0xc)" ( (binary_expression "PTR_DAT_004c5480 + 0xc" identifier + number_literal) )))) ;) comment (expression_statement "param_1[0x25] = (int)puVar1;" (assignment_expression "param_1[0x25] = (int)puVar1" (subscript_expression "param_1[0x25]" identifier [ number_literal ]) = (cast_expression "(int)puVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (labeled_statement "std::ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this,(streambuf *)0x0);" (call_expression "init((ios *)this,(streambuf *)0x0)" identifier (argument_list "((ios *)this,(streambuf *)0x0)" ( (cast_expression "(ios *)this" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)0x0" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;))) (expression_statement "this_00 = (filebuf *)(param_1 + 3);" (assignment_expression "this_00 = (filebuf *)(param_1 + 3)" identifier = (cast_expression "(filebuf *)(param_1 + 3)" ( (type_descriptor "filebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 3)" ( (binary_expression "param_1 + 3" identifier + number_literal) )))) ;) (expression_statement "puVar3 = PTR_vtable_004c547c + 0x34;" (assignment_expression "puVar3 = PTR_vtable_004c547c + 0x34" identifier = (binary_expression "PTR_vtable_004c547c + 0x34" identifier + number_literal)) ;) (expression_statement "puVar1 = PTR_vtable_004c547c + 0x20;" (assignment_expression "puVar1 = PTR_vtable_004c547c + 0x20" identifier = (binary_expression "PTR_vtable_004c547c + 0x20" identifier + number_literal)) ;) (expression_statement "*param_1 = (int)(PTR_vtable_004c547c + 0xc);" (assignment_expression "*param_1 = (int)(PTR_vtable_004c547c + 0xc)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(PTR_vtable_004c547c + 0xc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(PTR_vtable_004c547c + 0xc)" ( (binary_expression "PTR_vtable_004c547c + 0xc" identifier + number_literal) )))) ;) (expression_statement "param_1[0x25] = (int)puVar3;" (assignment_expression "param_1[0x25] = (int)puVar3" (subscript_expression "param_1[0x25]" identifier [ number_literal ]) = (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier)) ;) comment (expression_statement "param_1[2] = (int)puVar1;" (assignment_expression "param_1[2] = (int)puVar1" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)puVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (labeled_statement "std::filebuf::filebuf(this_00);" statement_identifier : (ERROR ":" :) (labeled_statement "filebuf::filebuf(this_00);" statement_identifier : (ERROR ":" :) (expression_statement "filebuf(this_00);" (call_expression "filebuf(this_00)" identifier (argument_list "(this_00)" ( identifier ))) ;))) comment (labeled_statement "std::ios::init((ios *)this,(streambuf *)this_00);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::init((ios *)this,(streambuf *)this_00);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this,(streambuf *)this_00);" (call_expression "init((ios *)this,(streambuf *)this_00)" identifier (argument_list "((ios *)this,(streambuf *)this_00)" ( (cast_expression "(ios *)this" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)this_00" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;))) (ERROR "iVar2 = std::" (assignment_expression "iVar2 = std" identifier = identifier) : :) (labeled_statement "filebuf::open(this_00,*param_2,param_3);" statement_identifier : (ERROR ":" :) (expression_statement "open(this_00,*param_2,param_3);" (call_expression "open(this_00,*param_2,param_3)" identifier (argument_list "(this_00,*param_2,param_3)" ( identifier , (pointer_expression "*param_2" * identifier) , identifier ))) ;)) (expression_statement "piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc))" identifier = (cast_expression "(ios *)((int)param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "ios *" 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 (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    std::ios::clear(piVar4,0);\n    return;\n  }" { (labeled_statement "std::ios::clear(piVar4,0);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::clear(piVar4,0);" statement_identifier : (ERROR ":" :) (expression_statement "clear(piVar4,0);" (call_expression "clear(piVar4,0)" identifier (argument_list "(piVar4,0)" ( identifier , number_literal ))) ;))) (return_statement "return;" return ;) })) (labeled_statement "std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (expression_statement "clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" (call_expression "clear(piVar4,*(uint *)(piVar4 + 0x14) | 4)" identifier (argument_list "(piVar4,*(uint *)(piVar4 + 0x14) | 4)" ( identifier , (binary_expression "*(uint *)(piVar4 + 0x14) | 4" (pointer_expression "*(uint *)(piVar4 + 0x14)" * (cast_expression "(uint *)(piVar4 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(piVar4 + 0x14)" ( (binary_expression "piVar4 + 0x14" identifier + number_literal) )))) | number_literal) ))) ;))) (return_statement "return;" return ;) })))
(translation_unit "/* std::fstream::fstream(std::string const&, std::_Ios_Openmode) */\n\nvoid __thiscall std::fstream::fstream(fstream *this,string *param_1,_Ios_Openmode param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *this_00;\n  ios_base *this_01;\n  filebuf *this_02;\n  \n  this_01 = (ios_base *)(this + 0x94);\n  ios_base::ios_base(this_01);\n  *(undefined4 *)(this + 0x104) = 0;\n  *(undefined2 *)(this + 0x108) = 0;\n  *(undefined4 *)(this + 0x10c) = 0;\n  puVar1 = PTR_construction_vtable_004c5484;\n  *(undefined4 *)(this + 0x110) = 0;\n  *(undefined4 *)(this + 0x114) = 0;\n  *(undefined4 *)(this + 0x118) = 0;\n  *(undefined **)this = puVar1 + 0xc;\n  *(undefined **)(this + 0x94) = puVar1 + 0x20;\n                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */\n  *(undefined4 *)(this + 4) = 0;\n  ios::init((ios *)this_01,(streambuf *)0x0);\n  puVar1 = PTR_construction_vtable_004c5480 + 0x20;\n  *(undefined **)(this + 8) = PTR_construction_vtable_004c5480 + 0xc;\n                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */\n  *(undefined **)(this + 0x94) = puVar1;\n  ios::init((ios *)this_01,(streambuf *)0x0);\n  this_02 = (filebuf *)(this + 0xc);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *(undefined **)this = PTR_vtable_004c547c + 0xc;\n  *(undefined **)(this + 0x94) = puVar3;\n                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */\n  *(undefined **)(this + 8) = puVar1;\n  filebuf::filebuf(this_02);\n                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */\n  ios::init((ios *)this_01,(streambuf *)this_02);\n  iVar2 = filebuf::open(this_02,*(char **)param_1,param_2);\n  this_00 = (ios *)(this + *(int *)(*(int *)this + -0xc));\n  if (iVar2 != 0) {\n    ios::clear(this_00,_S_goodbit);\n    return;\n  }\n  ios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);\n  return;\n}\n\n" comment (function_definition "void __thiscall std::fstream::fstream(fstream *this,string *param_1,_Ios_Openmode param_2)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *this_00;\n  ios_base *this_01;\n  filebuf *this_02;\n  \n  this_01 = (ios_base *)(this + 0x94);\n  ios_base::ios_base(this_01);\n  *(undefined4 *)(this + 0x104) = 0;\n  *(undefined2 *)(this + 0x108) = 0;\n  *(undefined4 *)(this + 0x10c) = 0;\n  puVar1 = PTR_construction_vtable_004c5484;\n  *(undefined4 *)(this + 0x110) = 0;\n  *(undefined4 *)(this + 0x114) = 0;\n  *(undefined4 *)(this + 0x118) = 0;\n  *(undefined **)this = puVar1 + 0xc;\n  *(undefined **)(this + 0x94) = puVar1 + 0x20;\n                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */\n  *(undefined4 *)(this + 4) = 0;\n  ios::init((ios *)this_01,(streambuf *)0x0);\n  puVar1 = PTR_construction_vtable_004c5480 + 0x20;\n  *(undefined **)(this + 8) = PTR_construction_vtable_004c5480 + 0xc;\n                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */\n  *(undefined **)(this + 0x94) = puVar1;\n  ios::init((ios *)this_01,(streambuf *)0x0);\n  this_02 = (filebuf *)(this + 0xc);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *(undefined **)this = PTR_vtable_004c547c + 0xc;\n  *(undefined **)(this + 0x94) = puVar3;\n                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */\n  *(undefined **)(this + 8) = puVar1;\n  filebuf::filebuf(this_02);\n                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */\n  ios::init((ios *)this_01,(streambuf *)this_02);\n  iVar2 = filebuf::open(this_02,*(char **)param_1,param_2);\n  this_00 = (ios *)(this + *(int *)(*(int *)this + -0xc));\n  if (iVar2 != 0) {\n    ios::clear(this_00,_S_goodbit);\n    return;\n  }\n  ios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::fstream::" identifier : : identifier : :) (function_declarator "fstream(fstream *this,string *param_1,_Ios_Openmode param_2)" identifier (parameter_list "(fstream *this,string *param_1,_Ios_Openmode param_2)" ( (parameter_declaration "fstream *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  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *this_00;\n  ios_base *this_01;\n  filebuf *this_02;\n  \n  this_01 = (ios_base *)(this + 0x94);\n  ios_base::ios_base(this_01);\n  *(undefined4 *)(this + 0x104) = 0;\n  *(undefined2 *)(this + 0x108) = 0;\n  *(undefined4 *)(this + 0x10c) = 0;\n  puVar1 = PTR_construction_vtable_004c5484;\n  *(undefined4 *)(this + 0x110) = 0;\n  *(undefined4 *)(this + 0x114) = 0;\n  *(undefined4 *)(this + 0x118) = 0;\n  *(undefined **)this = puVar1 + 0xc;\n  *(undefined **)(this + 0x94) = puVar1 + 0x20;\n                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */\n  *(undefined4 *)(this + 4) = 0;\n  ios::init((ios *)this_01,(streambuf *)0x0);\n  puVar1 = PTR_construction_vtable_004c5480 + 0x20;\n  *(undefined **)(this + 8) = PTR_construction_vtable_004c5480 + 0xc;\n                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */\n  *(undefined **)(this + 0x94) = puVar1;\n  ios::init((ios *)this_01,(streambuf *)0x0);\n  this_02 = (filebuf *)(this + 0xc);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *(undefined **)this = PTR_vtable_004c547c + 0xc;\n  *(undefined **)(this + 0x94) = puVar3;\n                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */\n  *(undefined **)(this + 8) = puVar1;\n  filebuf::filebuf(this_02);\n                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */\n  ios::init((ios *)this_01,(streambuf *)this_02);\n  iVar2 = filebuf::open(this_02,*(char **)param_1,param_2);\n  this_00 = (ios *)(this + *(int *)(*(int *)this + -0xc));\n  if (iVar2 != 0) {\n    ios::clear(this_00,_S_goodbit);\n    return;\n  }\n  ios::clear(this_00,*(_Ios_Iostate *)(this_00 + 0x14) | _S_failbit);\n  return;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "ios *this_00;" type_identifier (pointer_declarator "*this_00" * identifier) ;) (declaration "ios_base *this_01;" type_identifier (pointer_declarator "*this_01" * identifier) ;) (declaration "filebuf *this_02;" type_identifier (pointer_declarator "*this_02" * identifier) ;) (expression_statement "this_01 = (ios_base *)(this + 0x94);" (assignment_expression "this_01 = (ios_base *)(this + 0x94)" identifier = (cast_expression "(ios_base *)(this + 0x94)" ( (type_descriptor "ios_base *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x94)" ( (binary_expression "this + 0x94" identifier + number_literal) )))) ;) (labeled_statement "ios_base::ios_base(this_01);" statement_identifier : (ERROR ":" :) (expression_statement "ios_base(this_01);" (call_expression "ios_base(this_01)" identifier (argument_list "(this_01)" ( identifier ))) ;)) (expression_statement "*(undefined4 *)(this + 0x104) = 0;" (assignment_expression "*(undefined4 *)(this + 0x104) = 0" (pointer_expression "*(undefined4 *)(this + 0x104)" * (cast_expression "(undefined4 *)(this + 0x104)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x104)" ( (binary_expression "this + 0x104" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined2 *)(this + 0x108) = 0;" (assignment_expression "*(undefined2 *)(this + 0x108) = 0" (pointer_expression "*(undefined2 *)(this + 0x108)" * (cast_expression "(undefined2 *)(this + 0x108)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x108)" ( (binary_expression "this + 0x108" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(this + 0x10c) = 0;" (assignment_expression "*(undefined4 *)(this + 0x10c) = 0" (pointer_expression "*(undefined4 *)(this + 0x10c)" * (cast_expression "(undefined4 *)(this + 0x10c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10c)" ( (binary_expression "this + 0x10c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "puVar1 = PTR_construction_vtable_004c5484;" (assignment_expression "puVar1 = PTR_construction_vtable_004c5484" identifier = identifier) ;) (expression_statement "*(undefined4 *)(this + 0x110) = 0;" (assignment_expression "*(undefined4 *)(this + 0x110) = 0" (pointer_expression "*(undefined4 *)(this + 0x110)" * (cast_expression "(undefined4 *)(this + 0x110)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x110)" ( (binary_expression "this + 0x110" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(this + 0x114) = 0;" (assignment_expression "*(undefined4 *)(this + 0x114) = 0" (pointer_expression "*(undefined4 *)(this + 0x114)" * (cast_expression "(undefined4 *)(this + 0x114)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x114)" ( (binary_expression "this + 0x114" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(this + 0x118) = 0;" (assignment_expression "*(undefined4 *)(this + 0x118) = 0" (pointer_expression "*(undefined4 *)(this + 0x118)" * (cast_expression "(undefined4 *)(this + 0x118)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x118)" ( (binary_expression "this + 0x118" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined **)this = puVar1 + 0xc;" (assignment_expression "*(undefined **)this = puVar1 + 0xc" (pointer_expression "*(undefined **)this" * (cast_expression "(undefined **)this" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = (binary_expression "puVar1 + 0xc" identifier + number_literal)) ;) (expression_statement "*(undefined **)(this + 0x94) = puVar1 + 0x20;" (assignment_expression "*(undefined **)(this + 0x94) = puVar1 + 0x20" (pointer_expression "*(undefined **)(this + 0x94)" * (cast_expression "(undefined **)(this + 0x94)" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x94)" ( (binary_expression "this + 0x94" identifier + number_literal) )))) = (binary_expression "puVar1 + 0x20" identifier + number_literal)) ;) comment (expression_statement "*(undefined4 *)(this + 4) = 0;" (assignment_expression "*(undefined4 *)(this + 4) = 0" (pointer_expression "*(undefined4 *)(this + 4)" * (cast_expression "(undefined4 *)(this + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = number_literal) ;) (labeled_statement "ios::init((ios *)this_01,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this_01,(streambuf *)0x0);" (call_expression "init((ios *)this_01,(streambuf *)0x0)" identifier (argument_list "((ios *)this_01,(streambuf *)0x0)" ( (cast_expression "(ios *)this_01" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)0x0" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;)) (expression_statement "puVar1 = PTR_construction_vtable_004c5480 + 0x20;" (assignment_expression "puVar1 = PTR_construction_vtable_004c5480 + 0x20" identifier = (binary_expression "PTR_construction_vtable_004c5480 + 0x20" identifier + number_literal)) ;) (expression_statement "*(undefined **)(this + 8) = PTR_construction_vtable_004c5480 + 0xc;" (assignment_expression "*(undefined **)(this + 8) = PTR_construction_vtable_004c5480 + 0xc" (pointer_expression "*(undefined **)(this + 8)" * (cast_expression "(undefined **)(this + 8)" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "PTR_construction_vtable_004c5480 + 0xc" identifier + number_literal)) ;) comment (expression_statement "*(undefined **)(this + 0x94) = puVar1;" (assignment_expression "*(undefined **)(this + 0x94) = puVar1" (pointer_expression "*(undefined **)(this + 0x94)" * (cast_expression "(undefined **)(this + 0x94)" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x94)" ( (binary_expression "this + 0x94" identifier + number_literal) )))) = identifier) ;) (labeled_statement "ios::init((ios *)this_01,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this_01,(streambuf *)0x0);" (call_expression "init((ios *)this_01,(streambuf *)0x0)" identifier (argument_list "((ios *)this_01,(streambuf *)0x0)" ( (cast_expression "(ios *)this_01" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)0x0" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;)) (expression_statement "this_02 = (filebuf *)(this + 0xc);" (assignment_expression "this_02 = (filebuf *)(this + 0xc)" identifier = (cast_expression "(filebuf *)(this + 0xc)" ( (type_descriptor "filebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) ;) (expression_statement "puVar3 = PTR_vtable_004c547c + 0x34;" (assignment_expression "puVar3 = PTR_vtable_004c547c + 0x34" identifier = (binary_expression "PTR_vtable_004c547c + 0x34" identifier + number_literal)) ;) (expression_statement "puVar1 = PTR_vtable_004c547c + 0x20;" (assignment_expression "puVar1 = PTR_vtable_004c547c + 0x20" identifier = (binary_expression "PTR_vtable_004c547c + 0x20" identifier + number_literal)) ;) (expression_statement "*(undefined **)this = PTR_vtable_004c547c + 0xc;" (assignment_expression "*(undefined **)this = PTR_vtable_004c547c + 0xc" (pointer_expression "*(undefined **)this" * (cast_expression "(undefined **)this" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = (binary_expression "PTR_vtable_004c547c + 0xc" identifier + number_literal)) ;) (expression_statement "*(undefined **)(this + 0x94) = puVar3;" (assignment_expression "*(undefined **)(this + 0x94) = puVar3" (pointer_expression "*(undefined **)(this + 0x94)" * (cast_expression "(undefined **)(this + 0x94)" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x94)" ( (binary_expression "this + 0x94" identifier + number_literal) )))) = identifier) ;) comment (expression_statement "*(undefined **)(this + 8) = puVar1;" (assignment_expression "*(undefined **)(this + 8) = puVar1" (pointer_expression "*(undefined **)(this + 8)" * (cast_expression "(undefined **)(this + 8)" ( (type_descriptor "undefined **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (labeled_statement "filebuf::filebuf(this_02);" statement_identifier : (ERROR ":" :) (expression_statement "filebuf(this_02);" (call_expression "filebuf(this_02)" identifier (argument_list "(this_02)" ( identifier ))) ;)) comment (labeled_statement "ios::init((ios *)this_01,(streambuf *)this_02);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this_01,(streambuf *)this_02);" (call_expression "init((ios *)this_01,(streambuf *)this_02)" identifier (argument_list "((ios *)this_01,(streambuf *)this_02)" ( (cast_expression "(ios *)this_01" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)this_02" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;)) (ERROR "iVar2 = filebuf::" (assignment_expression "iVar2 = filebuf" identifier = identifier) : :) (expression_statement "open(this_02,*(char **)param_1,param_2);" (call_expression "open(this_02,*(char **)param_1,param_2)" identifier (argument_list "(this_02,*(char **)param_1,param_2)" ( identifier , (pointer_expression "*(char **)param_1" * (cast_expression "(char **)param_1" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) , identifier ))) ;) (expression_statement "this_00 = (ios *)(this + *(int *)(*(int *)this + -0xc));" (assignment_expression "this_00 = (ios *)(this + *(int *)(*(int *)this + -0xc))" identifier = (cast_expression "(ios *)(this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "ios *" 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 (iVar2 != 0) {\n    ios::clear(this_00,_S_goodbit);\n    return;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    ios::clear(this_00,_S_goodbit);\n    return;\n  }" { (labeled_statement "ios::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 "ios::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_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    \n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    \n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    \n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    \n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}\n\n" (function_definition "void FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    \n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    \n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    \n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    \n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)" identifier (parameter_list "(int *param_1,undefined4 *param_2,undefined4 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 "undefined4 param_3" type_identifier identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    \n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    \n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    \n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    \n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "ios *piVar4;" type_identifier (pointer_declarator "*piVar4" * identifier) ;) (declaration "ios_base *this;" type_identifier (pointer_declarator "*this" * identifier) ;) (declaration "filebuf *this_00;" type_identifier (pointer_declarator "*this_00" * identifier) ;) (expression_statement "this = (ios_base *)(param_1 + 0x25);" (assignment_expression "this = (ios_base *)(param_1 + 0x25)" identifier = (cast_expression "(ios_base *)(param_1 + 0x25)" ( (type_descriptor "ios_base *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x25)" ( (binary_expression "param_1 + 0x25" identifier + number_literal) )))) ;) (labeled_statement "std::ios_base::ios_base(this);" statement_identifier : (ERROR ":" :) (labeled_statement "ios_base::ios_base(this);" statement_identifier : (ERROR ":" :) (expression_statement "ios_base(this);" (call_expression "ios_base(this)" identifier (argument_list "(this)" ( identifier ))) ;))) (expression_statement "param_1[0x41] = 0;" (assignment_expression "param_1[0x41] = 0" (subscript_expression "param_1[0x41]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*(undefined2 *)(param_1 + 0x42) = 0;" (assignment_expression "*(undefined2 *)(param_1 + 0x42) = 0" (pointer_expression "*(undefined2 *)(param_1 + 0x42)" * (cast_expression "(undefined2 *)(param_1 + 0x42)" ( (type_descriptor "undefined2 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x42)" ( (binary_expression "param_1 + 0x42" identifier + number_literal) )))) = number_literal) ;) (expression_statement "param_1[0x43] = 0;" (assignment_expression "param_1[0x43] = 0" (subscript_expression "param_1[0x43]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "puVar1 = PTR_DAT_004c5484;" (assignment_expression "puVar1 = PTR_DAT_004c5484" identifier = identifier) ;) (expression_statement "param_1[0x44] = 0;" (assignment_expression "param_1[0x44] = 0" (subscript_expression "param_1[0x44]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[0x45] = 0;" (assignment_expression "param_1[0x45] = 0" (subscript_expression "param_1[0x45]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_1[0x46] = 0;" (assignment_expression "param_1[0x46] = 0" (subscript_expression "param_1[0x46]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "*param_1 = (int)(puVar1 + 0xc);" (assignment_expression "*param_1 = (int)(puVar1 + 0xc)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(puVar1 + 0xc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar1 + 0xc)" ( (binary_expression "puVar1 + 0xc" identifier + number_literal) )))) ;) (expression_statement "param_1[0x25] = (int)(puVar1 + 0x20);" (assignment_expression "param_1[0x25] = (int)(puVar1 + 0x20)" (subscript_expression "param_1[0x25]" identifier [ number_literal ]) = (cast_expression "(int)(puVar1 + 0x20)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(puVar1 + 0x20)" ( (binary_expression "puVar1 + 0x20" identifier + number_literal) )))) ;) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (labeled_statement "std::ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this,(streambuf *)0x0);" (call_expression "init((ios *)this,(streambuf *)0x0)" identifier (argument_list "((ios *)this,(streambuf *)0x0)" ( (cast_expression "(ios *)this" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)0x0" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;))) (expression_statement "puVar1 = PTR_DAT_004c5480 + 0x20;" (assignment_expression "puVar1 = PTR_DAT_004c5480 + 0x20" identifier = (binary_expression "PTR_DAT_004c5480 + 0x20" identifier + number_literal)) ;) (expression_statement "param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);" (assignment_expression "param_1[2] = (int)(PTR_DAT_004c5480 + 0xc)" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)(PTR_DAT_004c5480 + 0xc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(PTR_DAT_004c5480 + 0xc)" ( (binary_expression "PTR_DAT_004c5480 + 0xc" identifier + number_literal) )))) ;) (expression_statement "param_1[0x25] = (int)puVar1;" (assignment_expression "param_1[0x25] = (int)puVar1" (subscript_expression "param_1[0x25]" identifier [ number_literal ]) = (cast_expression "(int)puVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (labeled_statement "std::ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::init((ios *)this,(streambuf *)0x0);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this,(streambuf *)0x0);" (call_expression "init((ios *)this,(streambuf *)0x0)" identifier (argument_list "((ios *)this,(streambuf *)0x0)" ( (cast_expression "(ios *)this" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)0x0" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) ))) ;))) (expression_statement "this_00 = (filebuf *)(param_1 + 3);" (assignment_expression "this_00 = (filebuf *)(param_1 + 3)" identifier = (cast_expression "(filebuf *)(param_1 + 3)" ( (type_descriptor "filebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 3)" ( (binary_expression "param_1 + 3" identifier + number_literal) )))) ;) (expression_statement "puVar3 = PTR_vtable_004c547c + 0x34;" (assignment_expression "puVar3 = PTR_vtable_004c547c + 0x34" identifier = (binary_expression "PTR_vtable_004c547c + 0x34" identifier + number_literal)) ;) (expression_statement "puVar1 = PTR_vtable_004c547c + 0x20;" (assignment_expression "puVar1 = PTR_vtable_004c547c + 0x20" identifier = (binary_expression "PTR_vtable_004c547c + 0x20" identifier + number_literal)) ;) (expression_statement "*param_1 = (int)(PTR_vtable_004c547c + 0xc);" (assignment_expression "*param_1 = (int)(PTR_vtable_004c547c + 0xc)" (pointer_expression "*param_1" * identifier) = (cast_expression "(int)(PTR_vtable_004c547c + 0xc)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(PTR_vtable_004c547c + 0xc)" ( (binary_expression "PTR_vtable_004c547c + 0xc" identifier + number_literal) )))) ;) (expression_statement "param_1[0x25] = (int)puVar3;" (assignment_expression "param_1[0x25] = (int)puVar3" (subscript_expression "param_1[0x25]" identifier [ number_literal ]) = (cast_expression "(int)puVar3" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (expression_statement "param_1[2] = (int)puVar1;" (assignment_expression "param_1[2] = (int)puVar1" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)puVar1" ( (type_descriptor "int" primitive_type) ) identifier)) ;) (labeled_statement "std::filebuf::filebuf(this_00);" statement_identifier : (ERROR ":" :) (labeled_statement "filebuf::filebuf(this_00);" statement_identifier : (ERROR ":" :) (expression_statement "filebuf(this_00);" (call_expression "filebuf(this_00)" identifier (argument_list "(this_00)" ( identifier ))) ;))) (labeled_statement "std::ios::init((ios *)this,(streambuf *)this_00);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::init((ios *)this,(streambuf *)this_00);" statement_identifier : (ERROR ":" :) (expression_statement "init((ios *)this,(streambuf *)this_00);" (call_expression "init((ios *)this,(streambuf *)this_00)" identifier (argument_list "((ios *)this,(streambuf *)this_00)" ( (cast_expression "(ios *)this" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (cast_expression "(streambuf *)this_00" ( (type_descriptor "streambuf *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;))) (ERROR "iVar2 = std::" (assignment_expression "iVar2 = std" identifier = identifier) : :) (labeled_statement "filebuf::open(this_00,*param_2,param_3);" statement_identifier : (ERROR ":" :) (expression_statement "open(this_00,*param_2,param_3);" (call_expression "open(this_00,*param_2,param_3)" identifier (argument_list "(this_00,*param_2,param_3)" ( identifier , (pointer_expression "*param_2" * identifier) , identifier ))) ;)) (expression_statement "piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc))" identifier = (cast_expression "(ios *)((int)param_1 + *(int *)(*param_1 + -0xc))" ( (type_descriptor "ios *" 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 (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }" if (parenthesized_expression "(iVar2 != 0)" ( (binary_expression "iVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    std::ios::clear(piVar4,0);\n    return;\n  }" { (labeled_statement "std::ios::clear(piVar4,0);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::clear(piVar4,0);" statement_identifier : (ERROR ":" :) (expression_statement "clear(piVar4,0);" (call_expression "clear(piVar4,0)" identifier (argument_list "(piVar4,0)" ( identifier , number_literal ))) ;))) (return_statement "return;" return ;) })) (labeled_statement "std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (labeled_statement "ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" statement_identifier : (ERROR ":" :) (expression_statement "clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" (call_expression "clear(piVar4,*(uint *)(piVar4 + 0x14) | 4)" identifier (argument_list "(piVar4,*(uint *)(piVar4 + 0x14) | 4)" ( identifier , (binary_expression "*(uint *)(piVar4 + 0x14) | 4" (pointer_expression "*(uint *)(piVar4 + 0x14)" * (cast_expression "(uint *)(piVar4 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(piVar4 + 0x14)" ( (binary_expression "piVar4 + 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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (labeled_statement statement_identifier : (ERROR :) (labeled_statement statement_identifier : (ERROR :) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;))) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (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 *)) ) IDENT) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ))) ;))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) 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 *)) ) IDENT) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ))) ;))) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (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 *)) ) IDENT) , (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 , (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 (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_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)\n\n{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    \n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    \n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    \n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    \n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0036dcd0(int *param_1,undefined4 *param_2,undefined4 param_3)" (identifier "FUN_0036dcd0") (parameter_list "(int *param_1,undefined4 *param_2,undefined4 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 "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  int iVar2;\n  undefined *puVar3;\n  ios *piVar4;\n  ios_base *this;\n  filebuf *this_00;\n  \n  this = (ios_base *)(param_1 + 0x25);\n  std::ios_base::ios_base(this);\n  param_1[0x41] = 0;\n  *(undefined2 *)(param_1 + 0x42) = 0;\n  param_1[0x43] = 0;\n  puVar1 = PTR_DAT_004c5484;\n  param_1[0x44] = 0;\n  param_1[0x45] = 0;\n  param_1[0x46] = 0;\n  *param_1 = (int)(puVar1 + 0xc);\n  param_1[0x25] = (int)(puVar1 + 0x20);\n                    \n  param_1[1] = 0;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  puVar1 = PTR_DAT_004c5480 + 0x20;\n  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);\n                    \n  param_1[0x25] = (int)puVar1;\n  std::ios::init((ios *)this,(streambuf *)0x0);\n  this_00 = (filebuf *)(param_1 + 3);\n  puVar3 = PTR_vtable_004c547c + 0x34;\n  puVar1 = PTR_vtable_004c547c + 0x20;\n  *param_1 = (int)(PTR_vtable_004c547c + 0xc);\n  param_1[0x25] = (int)puVar3;\n                    \n  param_1[2] = (int)puVar1;\n  std::filebuf::filebuf(this_00);\n                    \n  std::ios::init((ios *)this,(streambuf *)this_00);\n  iVar2 = std::filebuf::open(this_00,*param_2,param_3);\n  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));\n  if (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }\n  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);\n  return;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "undefined *puVar3;" (type_identifier "undefined") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "ios *piVar4;" (type_identifier "ios") (pointer_declarator "*piVar4" (* "*") (identifier "piVar4")) (; ";")) (declaration "ios_base *this;" (type_identifier "ios_base") (pointer_declarator "*this" (* "*") (identifier "this")) (; ";")) (declaration "filebuf *this_00;" (type_identifier "filebuf") (pointer_declarator "*this_00" (* "*") (identifier "this_00")) (; ";")) (expression_statement "this = (ios_base *)(param_1 + 0x25);" (assignment_expression "this = (ios_base *)(param_1 + 0x25)" (identifier "this") (= "=") (cast_expression "(ios_base *)(param_1 + 0x25)" (( "(") (type_descriptor "ios_base *" (type_identifier "ios_base") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x25)" (( "(") (binary_expression "param_1 + 0x25" (identifier "param_1") (+ "+") (number_literal "0x25")) () ")")))) (; ";")) (labeled_statement "std::ios_base::ios_base(this);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "ios_base::ios_base(this);" (statement_identifier "ios_base") (: ":") (ERROR ":" (: ":")) (expression_statement "ios_base(this);" (call_expression "ios_base(this)" (identifier "ios_base") (argument_list "(this)" (( "(") (identifier "this") () ")"))) (; ";")))) (expression_statement "param_1[0x41] = 0;" (assignment_expression "param_1[0x41] = 0" (subscript_expression "param_1[0x41]" (identifier "param_1") ([ "[") (number_literal "0x41") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined2 *)(param_1 + 0x42) = 0;" (assignment_expression "*(undefined2 *)(param_1 + 0x42) = 0" (pointer_expression "*(undefined2 *)(param_1 + 0x42)" (* "*") (cast_expression "(undefined2 *)(param_1 + 0x42)" (( "(") (type_descriptor "undefined2 *" (type_identifier "undefined2") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x42)" (( "(") (binary_expression "param_1 + 0x42" (identifier "param_1") (+ "+") (number_literal "0x42")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_1[0x43] = 0;" (assignment_expression "param_1[0x43] = 0" (subscript_expression "param_1[0x43]" (identifier "param_1") ([ "[") (number_literal "0x43") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "puVar1 = PTR_DAT_004c5484;" (assignment_expression "puVar1 = PTR_DAT_004c5484" (identifier "puVar1") (= "=") (identifier "PTR_DAT_004c5484")) (; ";")) (expression_statement "param_1[0x44] = 0;" (assignment_expression "param_1[0x44] = 0" (subscript_expression "param_1[0x44]" (identifier "param_1") ([ "[") (number_literal "0x44") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_1[0x45] = 0;" (assignment_expression "param_1[0x45] = 0" (subscript_expression "param_1[0x45]" (identifier "param_1") ([ "[") (number_literal "0x45") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_1[0x46] = 0;" (assignment_expression "param_1[0x46] = 0" (subscript_expression "param_1[0x46]" (identifier "param_1") ([ "[") (number_literal "0x46") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "*param_1 = (int)(puVar1 + 0xc);" (assignment_expression "*param_1 = (int)(puVar1 + 0xc)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)(puVar1 + 0xc)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(puVar1 + 0xc)" (( "(") (binary_expression "puVar1 + 0xc" (identifier "puVar1") (+ "+") (number_literal "0xc")) () ")")))) (; ";")) (expression_statement "param_1[0x25] = (int)(puVar1 + 0x20);" (assignment_expression "param_1[0x25] = (int)(puVar1 + 0x20)" (subscript_expression "param_1[0x25]" (identifier "param_1") ([ "[") (number_literal "0x25") (] "]")) (= "=") (cast_expression "(int)(puVar1 + 0x20)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(puVar1 + 0x20)" (( "(") (binary_expression "puVar1 + 0x20" (identifier "puVar1") (+ "+") (number_literal "0x20")) () ")")))) (; ";")) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (labeled_statement "std::ios::init((ios *)this,(streambuf *)0x0);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "ios::init((ios *)this,(streambuf *)0x0);" (statement_identifier "ios") (: ":") (ERROR ":" (: ":")) (expression_statement "init((ios *)this,(streambuf *)0x0);" (call_expression "init((ios *)this,(streambuf *)0x0)" (identifier "init") (argument_list "((ios *)this,(streambuf *)0x0)" (( "(") (cast_expression "(ios *)this" (( "(") (type_descriptor "ios *" (type_identifier "ios") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")) (, ",") (cast_expression "(streambuf *)0x0" (( "(") (type_descriptor "streambuf *" (type_identifier "streambuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")"))) (; ";")))) (expression_statement "puVar1 = PTR_DAT_004c5480 + 0x20;" (assignment_expression "puVar1 = PTR_DAT_004c5480 + 0x20" (identifier "puVar1") (= "=") (binary_expression "PTR_DAT_004c5480 + 0x20" (identifier "PTR_DAT_004c5480") (+ "+") (number_literal "0x20"))) (; ";")) (expression_statement "param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);" (assignment_expression "param_1[2] = (int)(PTR_DAT_004c5480 + 0xc)" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (cast_expression "(int)(PTR_DAT_004c5480 + 0xc)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(PTR_DAT_004c5480 + 0xc)" (( "(") (binary_expression "PTR_DAT_004c5480 + 0xc" (identifier "PTR_DAT_004c5480") (+ "+") (number_literal "0xc")) () ")")))) (; ";")) (expression_statement "param_1[0x25] = (int)puVar1;" (assignment_expression "param_1[0x25] = (int)puVar1" (subscript_expression "param_1[0x25]" (identifier "param_1") ([ "[") (number_literal "0x25") (] "]")) (= "=") (cast_expression "(int)puVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar1"))) (; ";")) (labeled_statement "std::ios::init((ios *)this,(streambuf *)0x0);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "ios::init((ios *)this,(streambuf *)0x0);" (statement_identifier "ios") (: ":") (ERROR ":" (: ":")) (expression_statement "init((ios *)this,(streambuf *)0x0);" (call_expression "init((ios *)this,(streambuf *)0x0)" (identifier "init") (argument_list "((ios *)this,(streambuf *)0x0)" (( "(") (cast_expression "(ios *)this" (( "(") (type_descriptor "ios *" (type_identifier "ios") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")) (, ",") (cast_expression "(streambuf *)0x0" (( "(") (type_descriptor "streambuf *" (type_identifier "streambuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")"))) (; ";")))) (expression_statement "this_00 = (filebuf *)(param_1 + 3);" (assignment_expression "this_00 = (filebuf *)(param_1 + 3)" (identifier "this_00") (= "=") (cast_expression "(filebuf *)(param_1 + 3)" (( "(") (type_descriptor "filebuf *" (type_identifier "filebuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 3)" (( "(") (binary_expression "param_1 + 3" (identifier "param_1") (+ "+") (number_literal "3")) () ")")))) (; ";")) (expression_statement "puVar3 = PTR_vtable_004c547c + 0x34;" (assignment_expression "puVar3 = PTR_vtable_004c547c + 0x34" (identifier "puVar3") (= "=") (binary_expression "PTR_vtable_004c547c + 0x34" (identifier "PTR_vtable_004c547c") (+ "+") (number_literal "0x34"))) (; ";")) (expression_statement "puVar1 = PTR_vtable_004c547c + 0x20;" (assignment_expression "puVar1 = PTR_vtable_004c547c + 0x20" (identifier "puVar1") (= "=") (binary_expression "PTR_vtable_004c547c + 0x20" (identifier "PTR_vtable_004c547c") (+ "+") (number_literal "0x20"))) (; ";")) (expression_statement "*param_1 = (int)(PTR_vtable_004c547c + 0xc);" (assignment_expression "*param_1 = (int)(PTR_vtable_004c547c + 0xc)" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(int)(PTR_vtable_004c547c + 0xc)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(PTR_vtable_004c547c + 0xc)" (( "(") (binary_expression "PTR_vtable_004c547c + 0xc" (identifier "PTR_vtable_004c547c") (+ "+") (number_literal "0xc")) () ")")))) (; ";")) (expression_statement "param_1[0x25] = (int)puVar3;" (assignment_expression "param_1[0x25] = (int)puVar3" (subscript_expression "param_1[0x25]" (identifier "param_1") ([ "[") (number_literal "0x25") (] "]")) (= "=") (cast_expression "(int)puVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar3"))) (; ";")) (expression_statement "param_1[2] = (int)puVar1;" (assignment_expression "param_1[2] = (int)puVar1" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (cast_expression "(int)puVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "puVar1"))) (; ";")) (labeled_statement "std::filebuf::filebuf(this_00);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "filebuf::filebuf(this_00);" (statement_identifier "filebuf") (: ":") (ERROR ":" (: ":")) (expression_statement "filebuf(this_00);" (call_expression "filebuf(this_00)" (identifier "filebuf") (argument_list "(this_00)" (( "(") (identifier "this_00") () ")"))) (; ";")))) (labeled_statement "std::ios::init((ios *)this,(streambuf *)this_00);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "ios::init((ios *)this,(streambuf *)this_00);" (statement_identifier "ios") (: ":") (ERROR ":" (: ":")) (expression_statement "init((ios *)this,(streambuf *)this_00);" (call_expression "init((ios *)this,(streambuf *)this_00)" (identifier "init") (argument_list "((ios *)this,(streambuf *)this_00)" (( "(") (cast_expression "(ios *)this" (( "(") (type_descriptor "ios *" (type_identifier "ios") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this")) (, ",") (cast_expression "(streambuf *)this_00" (( "(") (type_descriptor "streambuf *" (type_identifier "streambuf") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "this_00")) () ")"))) (; ";")))) (ERROR "iVar2 = std::" (assignment_expression "iVar2 = std" (identifier "iVar2") (= "=") (identifier "std")) (: ":") (: ":")) (labeled_statement "filebuf::open(this_00,*param_2,param_3);" (statement_identifier "filebuf") (: ":") (ERROR ":" (: ":")) (expression_statement "open(this_00,*param_2,param_3);" (call_expression "open(this_00,*param_2,param_3)" (identifier "open") (argument_list "(this_00,*param_2,param_3)" (( "(") (identifier "this_00") (, ",") (pointer_expression "*param_2" (* "*") (identifier "param_2")) (, ",") (identifier "param_3") () ")"))) (; ";"))) (expression_statement "piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));" (assignment_expression "piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc))" (identifier "piVar4") (= "=") (cast_expression "(ios *)((int)param_1 + *(int *)(*param_1 + -0xc))" (( "(") (type_descriptor "ios *" (type_identifier "ios") (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 (iVar2 != 0) {\n    std::ios::clear(piVar4,0);\n    return;\n  }" (if "if") (parenthesized_expression "(iVar2 != 0)" (( "(") (binary_expression "iVar2 != 0" (identifier "iVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    std::ios::clear(piVar4,0);\n    return;\n  }" ({ "{") (labeled_statement "std::ios::clear(piVar4,0);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "ios::clear(piVar4,0);" (statement_identifier "ios") (: ":") (ERROR ":" (: ":")) (expression_statement "clear(piVar4,0);" (call_expression "clear(piVar4,0)" (identifier "clear") (argument_list "(piVar4,0)" (( "(") (identifier "piVar4") (, ",") (number_literal "0") () ")"))) (; ";")))) (return_statement "return;" (return "return") (; ";")) (} "}"))) (labeled_statement "std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" (statement_identifier "std") (: ":") (ERROR ":" (: ":")) (labeled_statement "ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" (statement_identifier "ios") (: ":") (ERROR ":" (: ":")) (expression_statement "clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);" (call_expression "clear(piVar4,*(uint *)(piVar4 + 0x14) | 4)" (identifier "clear") (argument_list "(piVar4,*(uint *)(piVar4 + 0x14) | 4)" (( "(") (identifier "piVar4") (, ",") (binary_expression "*(uint *)(piVar4 + 0x14) | 4" (pointer_expression "*(uint *)(piVar4 + 0x14)" (* "*") (cast_expression "(uint *)(piVar4 + 0x14)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(piVar4 + 0x14)" (( "(") (binary_expression "piVar4 + 0x14" (identifier "piVar4") (+ "+") (number_literal "0x14")) () ")")))) (| "|") (number_literal "4")) () ")"))) (; ";")))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::fstream::fstream(std::string const&, std::_Ios_Openmode) */

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

{
  type_3 *var_2;
  int var_7;
  type_3 *puVar3;
  type_4 *var_9;
  type_5 *this_01;
  type_6 *this_02;
  
  this_01 = (type_5 *)(var_1 + 0x94);
  ios_base::type_5(this_01);
  *(type_7 *)(var_1 + 0x104) = 0;
  *(type_8 *)(var_1 + 0x108) = 0;
  *(type_7 *)(var_1 + 0x10c) = 0;
  var_2 = PTR_construction_vtable_004c5484;
  *(type_7 *)(var_1 + 0x110) = 0;
  *(type_7 *)(var_1 + 0x114) = 0;
  *(type_7 *)(var_1 + 0x118) = 0;
  *(type_3 **)var_1 = var_2 + 0xc;
  *(type_3 **)(var_1 + 0x94) = var_2 + 0x20;
                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */
  *(type_7 *)(var_1 + 4) = 0;
  ios::var_3((type_4 *)this_01,(type_9 *)0x0);
  var_2 = var_4 + 0x20;
  *(type_3 **)(var_1 + 8) = var_4 + 0xc;
                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */
  *(type_3 **)(var_1 + 0x94) = var_2;
  ios::var_3((type_4 *)this_01,(type_9 *)0x0);
  this_02 = (type_6 *)(var_1 + 0xc);
  puVar3 = var_5 + 0x34;
  var_2 = var_5 + 0x20;
  *(type_3 **)var_1 = var_5 + 0xc;
  *(type_3 **)(var_1 + 0x94) = puVar3;
                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */
  *(type_3 **)(var_1 + 8) = var_2;
  filebuf::type_6(this_02);
                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */
  ios::var_3((type_4 *)this_01,(type_9 *)this_02);
  var_7 = type_6::var_6(this_02,*(char **)param_1,param_2);
  var_9 = (type_4 *)(var_1 + *(int *)(*(int *)var_1 + -0xc));
  if (var_7 != 0) {
    ios::var_8(var_9,_S_goodbit);
    return;
  }
  ios::var_8(var_9,*(type_10 *)(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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator 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: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (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)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (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: (identifier)) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (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: (identifier)) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) (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: (identifier)) (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) (pointer_expression argument: (identifier)) (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: (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,undefined4 *param_2,undefined4 param_3)

{
  undefined *puVar1;
  int iVar2;
  undefined *puVar3;
  ios *piVar4;
  ios_base *this;
  filebuf *this_00;
  
  this = (ios_base *)(param_1 + 0x25);
  std::ios_base::ios_base(this);
  param_1[0x41] = 0;
  *(undefined2 *)(param_1 + 0x42) = 0;
  param_1[0x43] = 0;
  puVar1 = PTR_DAT_004c5484;
  param_1[0x44] = 0;
  param_1[0x45] = 0;
  param_1[0x46] = 0;
  *param_1 = (int)(puVar1 + 0xc);
  param_1[0x25] = (int)(puVar1 + 0x20);
                    /* try { // try from 0036dd5c to 0036dd63 has its CatchHandler @ 0036ded8 */
  param_1[1] = 0;
  std::ios::init((ios *)this,(streambuf *)0x0);
  puVar1 = PTR_DAT_004c5480 + 0x20;
  param_1[2] = (int)(PTR_DAT_004c5480 + 0xc);
                    /* try { // try from 0036dd84 to 0036dd8b has its CatchHandler @ 0036dec4 */
  param_1[0x25] = (int)puVar1;
  std::ios::init((ios *)this,(streambuf *)0x0);
  this_00 = (filebuf *)(param_1 + 3);
  puVar3 = PTR_vtable_004c547c + 0x34;
  puVar1 = PTR_vtable_004c547c + 0x20;
  *param_1 = (int)(PTR_vtable_004c547c + 0xc);
  param_1[0x25] = (int)puVar3;
                    /* try { // try from 0036ddb4 to 0036ddbb has its CatchHandler @ 0036debc */
  param_1[2] = (int)puVar1;
  std::filebuf::filebuf(this_00);
                    /* try { // try from 0036ddc8 to 0036de3f has its CatchHandler @ 0036de68 */
  std::ios::init((ios *)this,(streambuf *)this_00);
  iVar2 = std::filebuf::open(this_00,*param_2,param_3);
  piVar4 = (ios *)((int)param_1 + *(int *)(*param_1 + -0xc));
  if (iVar2 != 0) {
    std::ios::clear(piVar4,0);
    return;
  }
  std::ios::clear(piVar4,*(uint *)(piVar4 + 0x14) | 4);
  return;
}

