
/* std::ofstream::open(char const*, std::_Ios_Openmode) */

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

{
  long lVar1;
  
  lVar1 = filebuf::open((filebuf *)(this + 8),param_1,param_2 | _S_out);
  if (lVar1 != 0) {
    ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);
    return;
  }
  ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),
             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit
            );
  return;
}



void FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)

{
  long lVar1;
  
  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);
  if (lVar1 != 0) {
    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);
    return;
  }
  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);
  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);
  return;
}


PUSH RBX
OR EDX,0x10
MOV RBX,RDI
ADD RDI,0x8
CALL 0x003077a0
TEST RAX,RAX
MOV RAX,qword ptr [RBX]
JZ 0x00307a10
ADD RBX,qword ptr [RAX + -0x18]
XOR ESI,ESI
MOV RDI,RBX
POP RBX
JMP 0x00300870
ADD RBX,qword ptr [RAX + -0x18]
MOV ESI,dword ptr [RBX + 0x20]
MOV RDI,RBX
POP RBX
OR ESI,0x4
JMP 0x00300870
(translation_unit "void FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}\n\n" (function_definition "void FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)" identifier (parameter_list "(long *param_1,undefined8 param_2,uint param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);" (assignment_expression "lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10)" identifier = (call_expression "FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10)" identifier (argument_list "(param_1 + 1,param_2,param_3 | 0x10)" ( (binary_expression "param_1 + 1" identifier + number_literal) , identifier , (binary_expression "param_3 | 0x10" identifier | number_literal) )))) ;) (if_statement "if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }" if (parenthesized_expression "(lVar1 != 0)" ( (binary_expression "lVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }" { (expression_statement "FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);" (call_expression "FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0)" identifier (argument_list "((long)param_1 + *(long *)(*param_1 + -0x18),0)" ( (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 ))) ;) (return_statement "return;" return ;) })) (expression_statement "lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);" (assignment_expression "lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18)" identifier = (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) )))))) ;) (expression_statement "FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);" (call_expression "FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4)" identifier (argument_list "(lVar1,*(uint *)(lVar1 + 0x20) | 4)" ( identifier , (binary_expression "*(uint *)(lVar1 + 0x20) | 4" (pointer_expression "*(uint *)(lVar1 + 0x20)" * (cast_expression "(uint *)(lVar1 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + 0x20)" ( (binary_expression "lVar1 + 0x20" identifier + number_literal) )))) | number_literal) ))) ;) (return_statement "return;" return ;) })))
(translation_unit "/* std::ofstream::open(char const*, std::_Ios_Openmode) */\n\nvoid __thiscall std::ofstream::open(ofstream *this,char *param_1,_Ios_Openmode param_2)\n\n{\n  long lVar1;\n  \n  lVar1 = filebuf::open((filebuf *)(this + 8),param_1,param_2 | _S_out);\n  if (lVar1 != 0) {\n    ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);\n    return;\n  }\n  ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            );\n  return;\n}\n\n" comment (function_definition "void __thiscall std::ofstream::open(ofstream *this,char *param_1,_Ios_Openmode param_2)\n\n{\n  long lVar1;\n  \n  lVar1 = filebuf::open((filebuf *)(this + 8),param_1,param_2 | _S_out);\n  if (lVar1 != 0) {\n    ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);\n    return;\n  }\n  ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            );\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::ofstream::" identifier : : identifier : :) (function_declarator "open(ofstream *this,char *param_1,_Ios_Openmode param_2)" identifier (parameter_list "(ofstream *this,char *param_1,_Ios_Openmode param_2)" ( (parameter_declaration "ofstream *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "_Ios_Openmode param_2" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = filebuf::open((filebuf *)(this + 8),param_1,param_2 | _S_out);\n  if (lVar1 != 0) {\n    ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);\n    return;\n  }\n  ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            );\n  return;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (ERROR "lVar1 = filebuf::" (assignment_expression "lVar1 = filebuf" identifier = identifier) : :) (expression_statement "open((filebuf *)(this + 8),param_1,param_2 | _S_out);" (call_expression "open((filebuf *)(this + 8),param_1,param_2 | _S_out)" identifier (argument_list "((filebuf *)(this + 8),param_1,param_2 | _S_out)" ( (cast_expression "(filebuf *)(this + 8)" ( (type_descriptor "filebuf *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))) , identifier , (binary_expression "param_2 | _S_out" identifier | identifier) ))) ;) (if_statement "if (lVar1 != 0) {\n    ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);\n    return;\n  }" if (parenthesized_expression "(lVar1 != 0)" ( (binary_expression "lVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);\n    return;\n  }" { (labeled_statement "ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);" statement_identifier : (ERROR ":" :) (expression_statement "clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit);" (call_expression "clear((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit)" identifier (argument_list "((ios *)(this + *(long *)(*(long *)this + -0x18)),_S_goodbit)" ( (cast_expression "(ios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "ios *" 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) ))))) ))) , identifier ))) ;)) (return_statement "return;" return ;) })) (labeled_statement "ios::clear((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            );" statement_identifier : (ERROR ":" :) (expression_statement "clear((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            );" (call_expression "clear((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            )" identifier (argument_list "((ios *)(this + *(long *)(*(long *)this + -0x18)),\n             *(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit\n            )" ( (cast_expression "(ios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "ios *" 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 *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) | _S_failbit" (pointer_expression "*(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" * (cast_expression "(_Ios_Iostate *)((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" ( (type_descriptor "_Ios_Iostate *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" ( (binary_expression "(ios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20" (cast_expression "(ios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "ios *" 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;" return ;) })))
(translation_unit "void FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}\n\n" (function_definition "void FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}" primitive_type (function_declarator "FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)" identifier (parameter_list "(long *param_1,undefined8 param_2,uint param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "uint param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (expression_statement "lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);" (assignment_expression "lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10)" identifier = (call_expression "FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10)" identifier (argument_list "(param_1 + 1,param_2,param_3 | 0x10)" ( (binary_expression "param_1 + 1" identifier + number_literal) , identifier , (binary_expression "param_3 | 0x10" identifier | number_literal) )))) ;) (if_statement "if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }" if (parenthesized_expression "(lVar1 != 0)" ( (binary_expression "lVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }" { (expression_statement "FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);" (call_expression "FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0)" identifier (argument_list "((long)param_1 + *(long *)(*param_1 + -0x18),0)" ( (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 ))) ;) (return_statement "return;" return ;) })) (expression_statement "lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);" (assignment_expression "lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18)" identifier = (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) )))))) ;) (expression_statement "FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);" (call_expression "FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4)" identifier (argument_list "(lVar1,*(uint *)(lVar1 + 0x20) | 4)" ( identifier , (binary_expression "*(uint *)(lVar1 + 0x20) | 4" (pointer_expression "*(uint *)(lVar1 + 0x20)" * (cast_expression "(uint *)(lVar1 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar1 + 0x20)" ( (binary_expression "lVar1 + 0x20" identifier + number_literal) )))) | number_literal) ))) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT , (binary_expression IDENT | LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (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 ))) ;) (return_statement return ;) })) (expression_statement (assignment_expression IDENT = (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) )))))) ;) (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_003079e0(long *param_1,undefined8 param_2,uint param_3)\n\n{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}" (primitive_type "void") (function_declarator "FUN_003079e0(long *param_1,undefined8 param_2,uint param_3)" (identifier "FUN_003079e0") (parameter_list "(long *param_1,undefined8 param_2,uint param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) () ")"))) (compound_statement "{\n  long lVar1;\n  \n  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);\n  if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }\n  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);\n  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);\n  return;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (expression_statement "lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);" (assignment_expression "lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10)" (identifier "lVar1") (= "=") (call_expression "FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10)" (identifier "FUN_003077a0") (argument_list "(param_1 + 1,param_2,param_3 | 0x10)" (( "(") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1")) (, ",") (identifier "param_2") (, ",") (binary_expression "param_3 | 0x10" (identifier "param_3") (| "|") (number_literal "0x10")) () ")")))) (; ";")) (if_statement "if (lVar1 != 0) {\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }" (if "if") (parenthesized_expression "(lVar1 != 0)" (( "(") (binary_expression "lVar1 != 0" (identifier "lVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);\n    return;\n  }" ({ "{") (expression_statement "FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);" (call_expression "FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0)" (identifier "FUN_00300870") (argument_list "((long)param_1 + *(long *)(*param_1 + -0x18),0)" (( "(") (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 "0") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);" (assignment_expression "lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18)" (identifier "lVar1") (= "=") (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")) () ")")))))) (; ";")) (expression_statement "FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);" (call_expression "FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4)" (identifier "FUN_00300870") (argument_list "(lVar1,*(uint *)(lVar1 + 0x20) | 4)" (( "(") (identifier "lVar1") (, ",") (binary_expression "*(uint *)(lVar1 + 0x20) | 4" (pointer_expression "*(uint *)(lVar1 + 0x20)" (* "*") (cast_expression "(uint *)(lVar1 + 0x20)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar1 + 0x20)" (( "(") (binary_expression "lVar1 + 0x20" (identifier "lVar1") (+ "+") (number_literal "0x20")) () ")")))) (| "|") (number_literal "4")) () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::ofstream::open(char const*, std::_Ios_Openmode) */

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

{
  long var_4;
  
  var_4 = type_3::function_1((type_3 *)(var_1 + 8),param_1,var_2 | var_3);
  if (var_4 != 0) {
    ios::var_5((type_4 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)),_S_goodbit);
    return;
  }
  ios::var_5((type_4 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)),
             *(type_5 *)((type_4 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)) + 0x20) | var_6
            );
  return;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)) (identifier) (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (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)))))) (number_literal)))) (return_statement))) (expression_statement (assignment_expression left: (identifier) right: (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)))))))) (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(long *param_1,undefined8 param_2,uint param_3)

{
  long lVar1;
  
  lVar1 = FUN_003077a0(param_1 + 1,param_2,param_3 | 0x10);
  if (lVar1 != 0) {
    FUN_00300870((long)param_1 + *(long *)(*param_1 + -0x18),0);
    return;
  }
  lVar1 = (long)param_1 + *(long *)(*param_1 + -0x18);
  FUN_00300870(lVar1,*(uint *)(lVar1 + 0x20) | 4);
  return;
}

