
/* stdio_sync_filebuf<char, std::char_traits<char> >::overflow(int) */

int __thiscall
stdio_sync_filebuf<char,std::char_traits<char>>::overflow
          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)

{
  int iVar1;
  
  if (param_1 != -1) {
    iVar1 = putc(param_1,*(FILE **)(this + 0x40));
    return iVar1;
  }
  iVar1 = fflush(*(FILE **)(this + 0x40));
  return -(uint)(iVar1 != 0);
}



int FUN_002a7f20(long param_1,int param_2)

{
  int iVar1;
  
  if (param_2 != -1) {
    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));
    return iVar1;
  }
  iVar1 = fflush(*(FILE **)(param_1 + 0x40));
  return -(uint)(iVar1 != 0);
}


MOV EAX,ESI
MOV RSI,qword ptr [RDI + 0x40]
CMP EAX,-0x1
JZ 0x002a7f38
MOV EDI,EAX
JMP 0x0013e6b0
SUB RSP,0x8
MOV RDI,RSI
CALL 0x0013eb00
TEST EAX,EAX
SETNZ AL
ADD RSP,0x8
MOVZX EAX,AL
NEG EAX
RET
(translation_unit "int FUN_002a7f20(long param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}\n\n" (function_definition "int FUN_002a7f20(long param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}" primitive_type (function_declarator "FUN_002a7f20(long param_1,int param_2)" identifier (parameter_list "(long param_1,int param_2)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }" if (parenthesized_expression "(param_2 != -1)" ( (binary_expression "param_2 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }" { (expression_statement "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));" (assignment_expression "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40))" identifier = (call_expression "putc(param_2,*(FILE **)(param_1 + 0x40))" identifier (argument_list "(param_2,*(FILE **)(param_1 + 0x40))" ( identifier , (pointer_expression "*(FILE **)(param_1 + 0x40)" * (cast_expression "(FILE **)(param_1 + 0x40)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = fflush(*(FILE **)(param_1 + 0x40));" (assignment_expression "iVar1 = fflush(*(FILE **)(param_1 + 0x40))" identifier = (call_expression "fflush(*(FILE **)(param_1 + 0x40))" identifier (argument_list "(*(FILE **)(param_1 + 0x40))" ( (pointer_expression "*(FILE **)(param_1 + 0x40)" * (cast_expression "(FILE **)(param_1 + 0x40)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) )))) ;) (return_statement "return -(uint)(iVar1 != 0);" return (unary_expression "-(uint)(iVar1 != 0)" - (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )))) ;) })))
(translation_unit "/* stdio_sync_filebuf<char, std::char_traits<char> >::overflow(int) */\n\nint __thiscall\nstdio_sync_filebuf<char,std::char_traits<char>>::overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)\n\n{\n  int iVar1;\n  \n  if (param_1 != -1) {\n    iVar1 = putc(param_1,*(FILE **)(this + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(this + 0x40));\n  return -(uint)(iVar1 != 0);\n}\n\n" comment (declaration "int __thiscall\nstdio_sync_filebuf<char,std::char_traits<char>>::overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)\n\n{\n  int iVar1;" primitive_type (ms_call_modifier "__thiscall" __thiscall) identifier (ERROR "<char" < primitive_type) , (ERROR "std::char_traits<char>>::overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)\n\n{\n  int" identifier : : identifier < primitive_type >> : : (function_declarator "overflow\n          (stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)" identifier (parameter_list "(stdio_sync_filebuf<char,std::char_traits<char>> *this,int param_1)" ( (parameter_declaration "stdio_sync_filebuf" type_identifier) (ERROR "<char" < primitive_type) , (parameter_declaration "std::char_traits<char>> *this" type_identifier (ERROR "::char_traits<char>>" : : identifier < primitive_type >>) (pointer_declarator "*this" * identifier)) , (parameter_declaration "int param_1" primitive_type identifier) ))) { primitive_type) identifier ;) (if_statement "if (param_1 != -1) {\n    iVar1 = putc(param_1,*(FILE **)(this + 0x40));\n    return iVar1;\n  }" if (parenthesized_expression "(param_1 != -1)" ( (binary_expression "param_1 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = putc(param_1,*(FILE **)(this + 0x40));\n    return iVar1;\n  }" { (expression_statement "iVar1 = putc(param_1,*(FILE **)(this + 0x40));" (assignment_expression "iVar1 = putc(param_1,*(FILE **)(this + 0x40))" identifier = (call_expression "putc(param_1,*(FILE **)(this + 0x40))" identifier (argument_list "(param_1,*(FILE **)(this + 0x40))" ( identifier , (pointer_expression "*(FILE **)(this + 0x40)" * (cast_expression "(FILE **)(this + 0x40)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x40)" ( (binary_expression "this + 0x40" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = fflush(*(FILE **)(this + 0x40));" (assignment_expression "iVar1 = fflush(*(FILE **)(this + 0x40))" identifier = (call_expression "fflush(*(FILE **)(this + 0x40))" identifier (argument_list "(*(FILE **)(this + 0x40))" ( (pointer_expression "*(FILE **)(this + 0x40)" * (cast_expression "(FILE **)(this + 0x40)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x40)" ( (binary_expression "this + 0x40" identifier + number_literal) )))) )))) ;) (return_statement "return -(uint)(iVar1 != 0);" return (unary_expression "-(uint)(iVar1 != 0)" - (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )))) ;) (ERROR "}" }))
(translation_unit "int FUN_002a7f20(long param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}\n\n" (function_definition "int FUN_002a7f20(long param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}" primitive_type (function_declarator "FUN_002a7f20(long param_1,int param_2)" identifier (parameter_list "(long param_1,int param_2)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }" if (parenthesized_expression "(param_2 != -1)" ( (binary_expression "param_2 != -1" identifier != number_literal) )) (compound_statement "{\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }" { (expression_statement "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));" (assignment_expression "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40))" identifier = (call_expression "putc(param_2,*(FILE **)(param_1 + 0x40))" identifier (argument_list "(param_2,*(FILE **)(param_1 + 0x40))" ( identifier , (pointer_expression "*(FILE **)(param_1 + 0x40)" * (cast_expression "(FILE **)(param_1 + 0x40)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) )))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = fflush(*(FILE **)(param_1 + 0x40));" (assignment_expression "iVar1 = fflush(*(FILE **)(param_1 + 0x40))" identifier = (call_expression "fflush(*(FILE **)(param_1 + 0x40))" identifier (argument_list "(*(FILE **)(param_1 + 0x40))" ( (pointer_expression "*(FILE **)(param_1 + 0x40)" * (cast_expression "(FILE **)(param_1 + 0x40)" ( (type_descriptor "FILE **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x40)" ( (binary_expression "param_1 + 0x40" identifier + number_literal) )))) )))) ;) (return_statement "return -(uint)(iVar1 != 0);" return (unary_expression "-(uint)(iVar1 != 0)" - (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (return_statement return (unary_expression - (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT != LIT) )))) ;) })))
(function_definition "int FUN_002a7f20(long param_1,int param_2)\n\n{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}" (primitive_type "int") (function_declarator "FUN_002a7f20(long param_1,int param_2)" (identifier "FUN_002a7f20") (parameter_list "(long param_1,int param_2)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int iVar1;\n  \n  if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }\n  iVar1 = fflush(*(FILE **)(param_1 + 0x40));\n  return -(uint)(iVar1 != 0);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (if_statement "if (param_2 != -1) {\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }" (if "if") (parenthesized_expression "(param_2 != -1)" (( "(") (binary_expression "param_2 != -1" (identifier "param_2") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));\n    return iVar1;\n  }" ({ "{") (expression_statement "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));" (assignment_expression "iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40))" (identifier "iVar1") (= "=") (call_expression "putc(param_2,*(FILE **)(param_1 + 0x40))" (identifier "putc") (argument_list "(param_2,*(FILE **)(param_1 + 0x40))" (( "(") (identifier "param_2") (, ",") (pointer_expression "*(FILE **)(param_1 + 0x40)" (* "*") (cast_expression "(FILE **)(param_1 + 0x40)" (( "(") (type_descriptor "FILE **" (type_identifier "FILE") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x40)" (( "(") (binary_expression "param_1 + 0x40" (identifier "param_1") (+ "+") (number_literal "0x40")) () ")")))) () ")")))) (; ";")) (return_statement "return iVar1;" (return "return") (identifier "iVar1") (; ";")) (} "}"))) (expression_statement "iVar1 = fflush(*(FILE **)(param_1 + 0x40));" (assignment_expression "iVar1 = fflush(*(FILE **)(param_1 + 0x40))" (identifier "iVar1") (= "=") (call_expression "fflush(*(FILE **)(param_1 + 0x40))" (identifier "fflush") (argument_list "(*(FILE **)(param_1 + 0x40))" (( "(") (pointer_expression "*(FILE **)(param_1 + 0x40)" (* "*") (cast_expression "(FILE **)(param_1 + 0x40)" (( "(") (type_descriptor "FILE **" (type_identifier "FILE") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x40)" (( "(") (binary_expression "param_1 + 0x40" (identifier "param_1") (+ "+") (number_literal "0x40")) () ")")))) () ")")))) (; ";")) (return_statement "return -(uint)(iVar1 != 0);" (return "return") (unary_expression "-(uint)(iVar1 != 0)" (- "-") (call_expression "(uint)(iVar1 != 0)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")))) (; ";")) (} "}")))

/* stdio_sync_filebuf<char, std::char_traits<char> >::overflow(int) */

int __thiscall
stdio_sync_filebuf<char,std::char_traits<char>>::overflow
          (stdio_sync_filebuf<char,std::char_traits<char>> *var_3,int var_1)

{
  int var_5;
  
  if (var_1 != -1) {
    var_5 = var_2(var_1,*(type_1 **)(var_3 + 0x40));
    return var_5;
  }
  var_5 = var_4(*(type_1 **)(var_3 + 0x40));
  return -(uint)(var_5 != 0);
}


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

int MASKED(long param_1,int param_2)

{
  int iVar1;
  
  if (param_2 != -1) {
    iVar1 = putc(param_2,*(FILE **)(param_1 + 0x40));
    return iVar1;
  }
  iVar1 = fflush(*(FILE **)(param_1 + 0x40));
  return -(uint)(iVar1 != 0);
}

