
/* std::__basic_file<char>::xsgetn(char*, int) */

int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)

{
  int *piVar1;
  undefined4 uVar2;
  int iVar3;
  
  do {
    uVar2 = fd(this);
    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);
    if (iVar3 != -1) {
      return iVar3;
    }
    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();
  } while (*piVar1 == 4);
  return -1;
}



/* std::__basic_file<char>::xsgetn(char*, int) */

int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)

{
  int *piVar1;
  undefined4 uVar2;
  int iVar3;
  
  do {
    uVar2 = fd(this);
    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);
    if (iVar3 != -1) {
      return iVar3;
    }
    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();
  } while (*piVar1 == 4);
  return -1;
}


lui gp,0x18
addiu gp,gp,0x38a0
addu gp,gp,t9
addiu sp,sp,-0x38
sw gp,0x10(sp)
sw s5,0x30(sp)
li s5,0x4
sw s4,0x2c(sp)
li s4,-0x1
sw s3,0x28(sp)
or s3,a0,zero
sw s2,0x24(sp)
or s2,a1,zero
sw s1,0x20(sp)
or s1,a2,zero
sw ra,0x34(sp)
b 0x002b698c
_sw s0,0x1c(sp)
jalr t9
_nop
lw v0,0x0(v0)
bne v0,s5,0x002b69c0
_lw gp,0x10(sp)
lw t9,-0x445c(gp)
bal 0x002b686c
_or a0,s3,zero
or a2,s1,zero
lw gp,0x10(sp)
or a1,s2,zero
lw t9,-0x39b0(gp)
jalr t9
_or a0,v0,zero
lw gp,0x10(sp)
or s0,v0,zero
beq v0,s4,0x002b6978
_lw t9,-0x38cc(gp)
lw ra,0x34(sp)
or v0,s0,zero
lw s5,0x30(sp)
lw s4,0x2c(sp)
lw s3,0x28(sp)
lw s2,0x24(sp)
lw s1,0x20(sp)
lw s0,0x1c(sp)
jr ra
_addiu sp,sp,0x38
(translation_unit "/* std::__basic_file<char>::xsgetn(char*, int) */\n\nint __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}\n\n" comment (function_definition "int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::__basic_file<char>::" identifier : : identifier < primitive_type > : :) (function_declarator "xsgetn(__basic_file<char> *this,char *param_1,int param_2)" identifier (parameter_list "(__basic_file<char> *this,char *param_1,int param_2)" ( (parameter_declaration "__basic_file<char> *this" type_identifier (ERROR "<char>" < primitive_type >) (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (do_statement "do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);" do (compound_statement "{\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  }" { (expression_statement "uVar2 = fd(this);" (assignment_expression "uVar2 = fd(this)" identifier = (call_expression "fd(this)" identifier (argument_list "(this)" ( identifier )))) ;) (expression_statement "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);" (assignment_expression "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" identifier = (call_expression "(*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" (parenthesized_expression "(*(code *)PTR_read_00436820)" ( (pointer_expression "*(code *)PTR_read_00436820" * (cast_expression "(code *)PTR_read_00436820" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar2,param_1,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar3 != -1) {\n      return iVar3;\n    }" if (parenthesized_expression "(iVar3 != -1)" ( (binary_expression "iVar3 != -1" identifier != number_literal) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();" (assignment_expression "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00436904)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00436904)()" (parenthesized_expression "(*(code *)PTR___errno_location_00436904)" ( (pointer_expression "*(code *)PTR___errno_location_00436904" * (cast_expression "(code *)PTR___errno_location_00436904" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) }) while (parenthesized_expression "(*piVar1 == 4)" ( (binary_expression "*piVar1 == 4" (pointer_expression "*piVar1" * identifier) == number_literal) )) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "/* std::__basic_file<char>::xsgetn(char*, int) */\n\nint __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}\n\n" comment (function_definition "int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::__basic_file<char>::" identifier : : identifier < primitive_type > : :) (function_declarator "xsgetn(__basic_file<char> *this,char *param_1,int param_2)" identifier (parameter_list "(__basic_file<char> *this,char *param_1,int param_2)" ( (parameter_declaration "__basic_file<char> *this" type_identifier (ERROR "<char>" < primitive_type >) (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (do_statement "do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);" do (compound_statement "{\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  }" { (expression_statement "uVar2 = fd(this);" (assignment_expression "uVar2 = fd(this)" identifier = (call_expression "fd(this)" identifier (argument_list "(this)" ( identifier )))) ;) (expression_statement "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);" (assignment_expression "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" identifier = (call_expression "(*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" (parenthesized_expression "(*(code *)PTR_read_00436820)" ( (pointer_expression "*(code *)PTR_read_00436820" * (cast_expression "(code *)PTR_read_00436820" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar2,param_1,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar3 != -1) {\n      return iVar3;\n    }" if (parenthesized_expression "(iVar3 != -1)" ( (binary_expression "iVar3 != -1" identifier != number_literal) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();" (assignment_expression "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00436904)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00436904)()" (parenthesized_expression "(*(code *)PTR___errno_location_00436904)" ( (pointer_expression "*(code *)PTR___errno_location_00436904" * (cast_expression "(code *)PTR___errno_location_00436904" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) }) while (parenthesized_expression "(*piVar1 == 4)" ( (binary_expression "*piVar1 == 4" (pointer_expression "*piVar1" * identifier) == number_literal) )) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit "int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}\n\n" (function_definition "int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::__basic_file<char>::" identifier : : identifier < primitive_type > : :) (function_declarator "xsgetn(__basic_file<char> *this,char *param_1,int param_2)" identifier (parameter_list "(__basic_file<char> *this,char *param_1,int param_2)" ( (parameter_declaration "__basic_file<char> *this" type_identifier (ERROR "<char>" < primitive_type >) (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (do_statement "do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);" do (compound_statement "{\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  }" { (expression_statement "uVar2 = fd(this);" (assignment_expression "uVar2 = fd(this)" identifier = (call_expression "fd(this)" identifier (argument_list "(this)" ( identifier )))) ;) (expression_statement "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);" (assignment_expression "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" identifier = (call_expression "(*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" (parenthesized_expression "(*(code *)PTR_read_00436820)" ( (pointer_expression "*(code *)PTR_read_00436820" * (cast_expression "(code *)PTR_read_00436820" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(uVar2,param_1,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if (iVar3 != -1) {\n      return iVar3;\n    }" if (parenthesized_expression "(iVar3 != -1)" ( (binary_expression "iVar3 != -1" identifier != number_literal) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();" (assignment_expression "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)()" identifier = (cast_expression "(int *)(*(code *)PTR___errno_location_00436904)()" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR___errno_location_00436904)()" (parenthesized_expression "(*(code *)PTR___errno_location_00436904)" ( (pointer_expression "*(code *)PTR___errno_location_00436904" * (cast_expression "(code *)PTR___errno_location_00436904" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))))) ;) }) while (parenthesized_expression "(*piVar1 == 4)" ( (binary_expression "*piVar1 == 4" (pointer_expression "*piVar1" * identifier) == number_literal) )) ;) (return_statement "return -1;" return number_literal ;) })))
(translation_unit (function_definition TYPE (ms_call_modifier __thiscall) (ERROR IDENT : : IDENT < TYPE > : :) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (ERROR < 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 IDENT ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))))) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) ;) (return_statement return LIT ;) })))
(function_definition "int __thiscall std::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" (primitive_type "int") (ms_call_modifier "__thiscall" (__thiscall "__thiscall")) (ERROR "std::__basic_file<char>::" (identifier "std") (: ":") (: ":") (identifier "__basic_file") (< "<") (primitive_type "char") (> ">") (: ":") (: ":")) (function_declarator "xsgetn(__basic_file<char> *this,char *param_1,int param_2)" (identifier "xsgetn") (parameter_list "(__basic_file<char> *this,char *param_1,int param_2)" (( "(") (parameter_declaration "__basic_file<char> *this" (type_identifier "__basic_file") (ERROR "<char>" (< "<") (primitive_type "char") (> ">")) (pointer_declarator "*this" (* "*") (identifier "this"))) (, ",") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int *piVar1;\n  undefined4 uVar2;\n  int iVar3;\n  \n  do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);\n  return -1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (do_statement "do {\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  } while (*piVar1 == 4);" (do "do") (compound_statement "{\n    uVar2 = fd(this);\n    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);\n    if (iVar3 != -1) {\n      return iVar3;\n    }\n    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();\n  }" ({ "{") (expression_statement "uVar2 = fd(this);" (assignment_expression "uVar2 = fd(this)" (identifier "uVar2") (= "=") (call_expression "fd(this)" (identifier "fd") (argument_list "(this)" (( "(") (identifier "this") () ")")))) (; ";")) (expression_statement "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);" (assignment_expression "iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" (identifier "iVar3") (= "=") (call_expression "(*(code *)PTR_read_00436820)(uVar2,param_1,param_2)" (parenthesized_expression "(*(code *)PTR_read_00436820)" (( "(") (pointer_expression "*(code *)PTR_read_00436820" (* "*") (cast_expression "(code *)PTR_read_00436820" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_read_00436820"))) () ")")) (argument_list "(uVar2,param_1,param_2)" (( "(") (identifier "uVar2") (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar3 != -1) {\n      return iVar3;\n    }" (if "if") (parenthesized_expression "(iVar3 != -1)" (( "(") (binary_expression "iVar3 != -1" (identifier "iVar3") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n      return iVar3;\n    }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (expression_statement "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();" (assignment_expression "piVar1 = (int *)(*(code *)PTR___errno_location_00436904)()" (identifier "piVar1") (= "=") (cast_expression "(int *)(*(code *)PTR___errno_location_00436904)()" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR___errno_location_00436904)()" (parenthesized_expression "(*(code *)PTR___errno_location_00436904)" (( "(") (pointer_expression "*(code *)PTR___errno_location_00436904" (* "*") (cast_expression "(code *)PTR___errno_location_00436904" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___errno_location_00436904"))) () ")")) (argument_list "()" (( "(") () ")"))))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(*piVar1 == 4)" (( "(") (binary_expression "*piVar1 == 4" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (== "==") (number_literal "4")) () ")")) (; ";")) (return_statement "return -1;" (return "return") (number_literal "-1") (; ";")) (} "}")))

/* std::__basic_file<char>::xsgetn(char*, int) */

int __thiscall std::type_1<char>::function_1(type_1<char> *this,char *param_1,int param_2)

{
  int *piVar1;
  type_2 uVar2;
  int var_2;
  
  do {
    uVar2 = var_1(this);
    var_2 = (*(type_3 *)PTR_read_00436820)(uVar2,param_1,param_2);
    if (var_2 != -1) {
      return var_2;
    }
    piVar1 = (int *)(*(type_3 *)PTR___errno_location_00436904)();
  } while (*piVar1 == 4);
  return -1;
}


(translation_unit (function_definition type: (primitive_type) (ms_call_modifier) (ERROR (identifier) (identifier) (primitive_type)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) (ERROR (primitive_type)) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list (identifier) (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (identifier)))) arguments: (argument_list)))))) condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))) (return_statement (number_literal)))))

/* std::__basic_file<char>::MASKED(char*, int) */

int __thiscall std::__basic_file<char>::MASKED(__basic_file<char> *this,char *param_1,int param_2)

{
  int *piVar1;
  undefined4 uVar2;
  int iVar3;
  
  do {
    uVar2 = fd(this);
    iVar3 = (*(code *)PTR_read_00436820)(uVar2,param_1,param_2);
    if (iVar3 != -1) {
      return iVar3;
    }
    piVar1 = (int *)(*(code *)PTR___errno_location_00436904)();
  } while (*piVar1 == 4);
  return -1;
}

