
/* std::wostream::flush() */

wostream * __thiscall std::wostream::flush(wostream *this)

{
  int iVar1;
  
  if (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) != (long *)0x0) {
                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */
    iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))();
    if (iVar1 == -1) {
      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),
                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |
                  _S_badbit);
      return this;
    }
  }
  return this;
}



long * FUN_002e7900(long *param_1)

{
  long *plVar1;
  int iVar2;
  long lVar3;
  
  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);
  if (plVar1 != (long *)0x0) {
                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */
    iVar2 = (**(code **)(*plVar1 + 0x30))();
    if (iVar2 == -1) {
      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;
      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);
      return param_1;
    }
  }
  return param_1;
}


PUSH RBX
MOV RAX,qword ptr [RDI]
MOV RBX,RDI
MOV RAX,qword ptr [RAX + -0x18]
MOV RDI,qword ptr [RDI + RAX*0x1 + 0xe8]
TEST RDI,RDI
JZ 0x002e7923
MOV RAX,qword ptr [RDI]
CALL qword ptr [RAX + 0x30]
CMP EAX,-0x1
JZ 0x002e7930
MOV RAX,RBX
POP RBX
RET
MOV RAX,qword ptr [RBX]
MOV RDI,qword ptr [RAX + -0x18]
ADD RDI,RBX
MOV ESI,dword ptr [RDI + 0x20]
OR ESI,0x1
CALL 0x00301260
MOV RAX,RBX
POP RBX
RET
(translation_unit "long * FUN_002e7900(long *param_1)\n\n{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}\n\n" (function_definition "long * FUN_002e7900(long *param_1)\n\n{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}" (sized_type_specifier "long" long) (pointer_declarator "* FUN_002e7900(long *param_1)" * (function_declarator "FUN_002e7900(long *param_1)" identifier (parameter_list "(long *param_1)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" * (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18)" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (pointer_expression "*(long *)(*param_1 + -0x18)" * (cast_expression "(long *)(*param_1 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0x18)" ( (binary_expression "*param_1 + -0x18" (pointer_expression "*param_1" * identifier) + number_literal) ))))) + number_literal) ))))) ;) (if_statement "if (plVar1 != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }" if (parenthesized_expression "(plVar1 != (long *)0x0)" ( (binary_expression "plVar1 != (long *)0x0" identifier != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }" { comment (expression_statement "iVar2 = (**(code **)(*plVar1 + 0x30))();" (assignment_expression "iVar2 = (**(code **)(*plVar1 + 0x30))()" identifier = (call_expression "(**(code **)(*plVar1 + 0x30))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x30))" ( (pointer_expression "**(code **)(*plVar1 + 0x30)" * (pointer_expression "*(code **)(*plVar1 + 0x30)" * (cast_expression "(code **)(*plVar1 + 0x30)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x30)" ( (binary_expression "*plVar1 + 0x30" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }" { (expression_statement "lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;" (assignment_expression "lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1" identifier = (binary_expression "*(long *)(*param_1 + -0x18) + (long)param_1" (pointer_expression "*(long *)(*param_1 + -0x18)" * (cast_expression "(long *)(*param_1 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0x18)" ( (binary_expression "*param_1 + -0x18" (pointer_expression "*param_1" * identifier) + number_literal) )))) + (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);" (call_expression "FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1)" identifier (argument_list "(lVar3,*(uint *)(lVar3 + 0x20) | 1)" ( identifier , (binary_expression "*(uint *)(lVar3 + 0x20) | 1" (pointer_expression "*(uint *)(lVar3 + 0x20)" * (cast_expression "(uint *)(lVar3 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar3 + 0x20)" ( (binary_expression "lVar3 + 0x20" identifier + number_literal) )))) | number_literal) ))) ;) (return_statement "return param_1;" return identifier ;) })) })) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* std::wostream::flush() */\n\nwostream * __thiscall std::wostream::flush(wostream *this)\n\n{\n  int iVar1;\n  \n  if (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))();\n    if (iVar1 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);\n      return this;\n    }\n  }\n  return this;\n}\n\n" comment (ERROR "wostream * __thiscall std::wostream::flush(wostream *this)" (binary_expression "wostream * __thiscall std::wostream::flush(wostream *this" (binary_expression "wostream * __thiscall" identifier * identifier) (ERROR "std::wostream::flush(wostream" identifier : : identifier : : identifier ( identifier) * identifier) )) (compound_statement "{\n  int iVar1;\n  \n  if (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))();\n    if (iVar1 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);\n      return this;\n    }\n  }\n  return this;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) != (long *)0x0) {\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))();\n    if (iVar1 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);\n      return this;\n    }\n  }" if (parenthesized_expression "(*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) != (long *)0x0)" ( (binary_expression "*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) != (long *)0x0" (pointer_expression "*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (cast_expression "(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (binary_expression "this + *(long *)(*(long *)this + -0x18) + 0xe8" (binary_expression "this + *(long *)(*(long *)this + -0x18)" identifier + (pointer_expression "*(long *)(*(long *)this + -0x18)" * (cast_expression "(long *)(*(long *)this + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + -0x18)" ( (binary_expression "*(long *)this + -0x18" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) + number_literal) )))) != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */\n    iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))();\n    if (iVar1 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);\n      return this;\n    }\n  }" { comment (expression_statement "iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))();" (assignment_expression "iVar1 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))()" identifier = (call_expression "(**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))()" (parenthesized_expression "(**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30))" ( (pointer_expression "**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30)" * (pointer_expression "*(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30)" * (cast_expression "(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30)" ( (binary_expression "**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x30" (pointer_expression "**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (pointer_expression "*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (cast_expression "(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (binary_expression "this + *(long *)(*(long *)this + -0x18) + 0xe8" (binary_expression "this + *(long *)(*(long *)this + -0x18)" identifier + (pointer_expression "*(long *)(*(long *)this + -0x18)" * (cast_expression "(long *)(*(long *)this + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + -0x18)" ( (binary_expression "*(long *)this + -0x18" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) + number_literal) ))))) + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar1 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);\n      return this;\n    }" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (compound_statement "{\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);\n      return this;\n    }" { (labeled_statement "wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);" statement_identifier : (ERROR ":" :) (expression_statement "clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit);" (call_expression "clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit)" identifier (argument_list "((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit)" ( (cast_expression "(wios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18))" ( (binary_expression "this + *(long *)(*(long *)this + -0x18)" identifier + (pointer_expression "*(long *)(*(long *)this + -0x18)" * (cast_expression "(long *)(*(long *)this + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + -0x18)" ( (binary_expression "*(long *)this + -0x18" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) , (binary_expression "*(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_badbit" (pointer_expression "*(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" * (cast_expression "(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" ( (type_descriptor "_Ios_Iostate *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" ( (binary_expression "(wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20" (cast_expression "(wios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "wios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18))" ( (binary_expression "this + *(long *)(*(long *)this + -0x18)" identifier + (pointer_expression "*(long *)(*(long *)this + -0x18)" * (cast_expression "(long *)(*(long *)this + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + -0x18)" ( (binary_expression "*(long *)this + -0x18" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) + number_literal) )))) | identifier) ))) ;)) (return_statement "return this;" return identifier ;) })) })) (return_statement "return this;" return identifier ;) }))
(translation_unit "long * FUN_002e7900(long *param_1)\n\n{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}\n\n" (function_definition "long * FUN_002e7900(long *param_1)\n\n{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}" (sized_type_specifier "long" long) (pointer_declarator "* FUN_002e7900(long *param_1)" * (function_declarator "FUN_002e7900(long *param_1)" identifier (parameter_list "(long *param_1)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) )))) (compound_statement "{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" * (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18)" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (pointer_expression "*(long *)(*param_1 + -0x18)" * (cast_expression "(long *)(*param_1 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0x18)" ( (binary_expression "*param_1 + -0x18" (pointer_expression "*param_1" * identifier) + number_literal) ))))) + number_literal) ))))) ;) (if_statement "if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }" if (parenthesized_expression "(plVar1 != (long *)0x0)" ( (binary_expression "plVar1 != (long *)0x0" identifier != (cast_expression "(long *)0x0" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }" { (expression_statement "iVar2 = (**(code **)(*plVar1 + 0x30))();" (assignment_expression "iVar2 = (**(code **)(*plVar1 + 0x30))()" identifier = (call_expression "(**(code **)(*plVar1 + 0x30))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x30))" ( (pointer_expression "**(code **)(*plVar1 + 0x30)" * (pointer_expression "*(code **)(*plVar1 + 0x30)" * (cast_expression "(code **)(*plVar1 + 0x30)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x30)" ( (binary_expression "*plVar1 + 0x30" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "()" ( )))) ;) (if_statement "if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }" { (expression_statement "lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;" (assignment_expression "lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1" identifier = (binary_expression "*(long *)(*param_1 + -0x18) + (long)param_1" (pointer_expression "*(long *)(*param_1 + -0x18)" * (cast_expression "(long *)(*param_1 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0x18)" ( (binary_expression "*param_1 + -0x18" (pointer_expression "*param_1" * identifier) + number_literal) )))) + (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);" (call_expression "FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1)" identifier (argument_list "(lVar3,*(uint *)(lVar3 + 0x20) | 1)" ( identifier , (binary_expression "*(uint *)(lVar3 + 0x20) | 1" (pointer_expression "*(uint *)(lVar3 + 0x20)" * (cast_expression "(uint *)(lVar3 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar3 + 0x20)" ( (binary_expression "lVar3 + 0x20" identifier + number_literal) )))) | number_literal) ))) ;) (return_statement "return param_1;" return identifier ;) })) })) (return_statement "return param_1;" return identifier ;) })))
(translation_unit (function_definition (sized_type_specifier long) (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) )))) (compound_statement { (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) ;) (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 IDENT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "long * FUN_002e7900(long *param_1)\n\n{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}" (sized_type_specifier "long" (long "long")) (pointer_declarator "* FUN_002e7900(long *param_1)" (* "*") (function_declarator "FUN_002e7900(long *param_1)" (identifier "FUN_002e7900") (parameter_list "(long *param_1)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")")))) (compound_statement "{\n  long *plVar1;\n  int iVar2;\n  long lVar3;\n  \n  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n  if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }\n  return param_1;\n}" ({ "{") (declaration "long *plVar1;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar1" (* "*") (identifier "plVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (identifier "plVar1") (= "=") (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (* "*") (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (( "(") (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18)" (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(long *)(*param_1 + -0x18)" (* "*") (cast_expression "(long *)(*param_1 + -0x18)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0x18)" (( "(") (binary_expression "*param_1 + -0x18" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0x18")) () ")"))))) (+ "+") (number_literal "0xe8")) () ")"))))) (; ";")) (if_statement "if (plVar1 != (long *)0x0) {\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }" (if "if") (parenthesized_expression "(plVar1 != (long *)0x0)" (( "(") (binary_expression "plVar1 != (long *)0x0" (identifier "plVar1") (!= "!=") (cast_expression "(long *)0x0" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n                    \n    iVar2 = (**(code **)(*plVar1 + 0x30))();\n    if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }\n  }" ({ "{") (expression_statement "iVar2 = (**(code **)(*plVar1 + 0x30))();" (assignment_expression "iVar2 = (**(code **)(*plVar1 + 0x30))()" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*plVar1 + 0x30))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x30))" (( "(") (pointer_expression "**(code **)(*plVar1 + 0x30)" (* "*") (pointer_expression "*(code **)(*plVar1 + 0x30)" (* "*") (cast_expression "(code **)(*plVar1 + 0x30)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*plVar1 + 0x30)" (( "(") (binary_expression "*plVar1 + 0x30" (pointer_expression "*plVar1" (* "*") (identifier "plVar1")) (+ "+") (number_literal "0x30")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar2 == -1) {\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);\n      return param_1;\n    }" ({ "{") (expression_statement "lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;" (assignment_expression "lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1" (identifier "lVar3") (= "=") (binary_expression "*(long *)(*param_1 + -0x18) + (long)param_1" (pointer_expression "*(long *)(*param_1 + -0x18)" (* "*") (cast_expression "(long *)(*param_1 + -0x18)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0x18)" (( "(") (binary_expression "*param_1 + -0x18" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0x18")) () ")")))) (+ "+") (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")))) (; ";")) (expression_statement "FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);" (call_expression "FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1)" (identifier "FUN_00301260") (argument_list "(lVar3,*(uint *)(lVar3 + 0x20) | 1)" (( "(") (identifier "lVar3") (, ",") (binary_expression "*(uint *)(lVar3 + 0x20) | 1" (pointer_expression "*(uint *)(lVar3 + 0x20)" (* "*") (cast_expression "(uint *)(lVar3 + 0x20)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar3 + 0x20)" (( "(") (binary_expression "lVar3 + 0x20" (identifier "lVar3") (+ "+") (number_literal "0x20")) () ")")))) (| "|") (number_literal "1")) () ")"))) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}"))) (} "}"))) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

/* std::wostream::flush() */

wostream * __thiscall std::wostream::flush(wostream *var_1)

{
  int var_2;
  
  if (*(long **)(var_1 + *(long *)(*(long *)var_1 + -0x18) + 0xe8) != (long *)0x0) {
                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */
    var_2 = (**(type_1 **)(**(long **)(var_1 + *(long *)(*(long *)var_1 + -0x18) + 0xe8) + 0x30))();
    if (var_2 == -1) {
      wios::var_3((type_2 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)),
                  *(type_3 *)((type_2 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)) + 0x20) |
                  var_4);
      return var_1;
    }
  }
  return var_1;
}


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

long * MASKED(long *param_1)

{
  long *plVar1;
  int iVar2;
  long lVar3;
  
  plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);
  if (plVar1 != (long *)0x0) {
                    /* try { // try from 002e791b to 002e791d has its CatchHandler @ 002e794a */
    iVar2 = (**(code **)(*plVar1 + 0x30))();
    if (iVar2 == -1) {
      lVar3 = *(long *)(*param_1 + -0x18) + (long)param_1;
      FUN_00301260(lVar3,*(uint *)(lVar3 + 0x20) | 1);
      return param_1;
    }
  }
  return param_1;
}

