
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::__basic_file<char>::xsgetn(char*, int) */

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

{
  int *piVar1;
  int __fd;
  ssize_t sVar2;
  
  do {
    __fd = fd(this);
    sVar2 = read(__fd,param_1,param_2);
    if (sVar2 != -1) {
      return sVar2;
    }
    piVar1 = __errno_location();
  } while (*piVar1 == 4);
  return -1;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

ssize_t FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)

{
  int *piVar1;
  int __fd;
  ssize_t sVar2;
  
  do {
    __fd = FUN_001e7550(param_1);
    sVar2 = read(__fd,param_2,param_3);
    if (sVar2 != -1) {
      return sVar2;
    }
    piVar1 = __errno_location();
  } while (*piVar1 == 4);
  return -1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x1a79e7
SUB ESP,0xc
MOV EBP,dword ptr [ESP + 0x20]
MOV EDI,dword ptr [ESP + 0x24]
JMP 0x001e763a
CALL 0x00029090
CMP dword ptr [EAX],0x4
JNZ 0x001e765b
SUB ESP,0xc
PUSH EBP
CALL 0x001e7550
ADD ESP,0xc
PUSH dword ptr [ESP + 0x2c]
PUSH EDI
PUSH EAX
CALL 0x000293a0
ADD ESP,0x10
MOV ESI,EAX
CMP EAX,-0x1
JZ 0x001e7630
ADD ESP,0xc
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nssize_t FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}\n\n" comment (function_definition "ssize_t FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" primitive_type (function_declarator "FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)" identifier (parameter_list "(undefined4 param_1,void *param_2,size_t param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int __fd;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (do_statement "do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);" do (compound_statement "{\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  }" { (expression_statement "__fd = FUN_001e7550(param_1);" (assignment_expression "__fd = FUN_001e7550(param_1)" identifier = (call_expression "FUN_001e7550(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "sVar2 = read(__fd,param_2,param_3);" (assignment_expression "sVar2 = read(__fd,param_2,param_3)" identifier = (call_expression "read(__fd,param_2,param_3)" identifier (argument_list "(__fd,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (sVar2 != -1) {\n      return sVar2;\n    }" if (parenthesized_expression "(sVar2 != -1)" ( (binary_expression "sVar2 != -1" identifier != number_literal) )) (compound_statement "{\n      return sVar2;\n    }" { (return_statement "return sVar2;" return identifier ;) })) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" identifier = (call_expression "__errno_location()" 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 "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::__basic_file<char>::xsgetn(char*, int) */\n\nssize_t __thiscall\nstd::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = fd(this);\n    sVar2 = read(__fd,param_1,param_2);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}\n\n" comment comment (function_definition "ssize_t __thiscall\nstd::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = fd(this);\n    sVar2 = read(__fd,param_1,param_2);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\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  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = fd(this);\n    sVar2 = read(__fd,param_1,param_2);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int __fd;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (do_statement "do {\n    __fd = fd(this);\n    sVar2 = read(__fd,param_1,param_2);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);" do (compound_statement "{\n    __fd = fd(this);\n    sVar2 = read(__fd,param_1,param_2);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  }" { (expression_statement "__fd = fd(this);" (assignment_expression "__fd = fd(this)" identifier = (call_expression "fd(this)" identifier (argument_list "(this)" ( identifier )))) ;) (expression_statement "sVar2 = read(__fd,param_1,param_2);" (assignment_expression "sVar2 = read(__fd,param_1,param_2)" identifier = (call_expression "read(__fd,param_1,param_2)" identifier (argument_list "(__fd,param_1,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if (sVar2 != -1) {\n      return sVar2;\n    }" if (parenthesized_expression "(sVar2 != -1)" ( (binary_expression "sVar2 != -1" identifier != number_literal) )) (compound_statement "{\n      return sVar2;\n    }" { (return_statement "return sVar2;" return identifier ;) })) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" identifier = (call_expression "__errno_location()" 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 "ssize_t FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}\n\n" (function_definition "ssize_t FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" primitive_type (function_declarator "FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)" identifier (parameter_list "(undefined4 param_1,void *param_2,size_t param_3)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "void *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int __fd;" primitive_type identifier ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (do_statement "do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);" do (compound_statement "{\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  }" { (expression_statement "__fd = FUN_001e7550(param_1);" (assignment_expression "__fd = FUN_001e7550(param_1)" identifier = (call_expression "FUN_001e7550(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "sVar2 = read(__fd,param_2,param_3);" (assignment_expression "sVar2 = read(__fd,param_2,param_3)" identifier = (call_expression "read(__fd,param_2,param_3)" identifier (argument_list "(__fd,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (sVar2 != -1) {\n      return sVar2;\n    }" if (parenthesized_expression "(sVar2 != -1)" ( (binary_expression "sVar2 != -1" identifier != number_literal) )) (compound_statement "{\n      return sVar2;\n    }" { (return_statement "return sVar2;" return identifier ;) })) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" identifier = (call_expression "__errno_location()" 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 (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE 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 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 = (call_expression IDENT (argument_list ( )))) ;) }) while (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == LIT) )) ;) (return_statement return LIT ;) })))
(function_definition "ssize_t FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)\n\n{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" (primitive_type "ssize_t") (function_declarator "FUN_001e7610(undefined4 param_1,void *param_2,size_t param_3)" (identifier "FUN_001e7610") (parameter_list "(undefined4 param_1,void *param_2,size_t param_3)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "void *param_2" (primitive_type "void") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) () ")"))) (compound_statement "{\n  int *piVar1;\n  int __fd;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);\n  return -1;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int __fd;" (primitive_type "int") (identifier "__fd") (; ";")) (declaration "ssize_t sVar2;" (primitive_type "ssize_t") (identifier "sVar2") (; ";")) (do_statement "do {\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  } while (*piVar1 == 4);" (do "do") (compound_statement "{\n    __fd = FUN_001e7550(param_1);\n    sVar2 = read(__fd,param_2,param_3);\n    if (sVar2 != -1) {\n      return sVar2;\n    }\n    piVar1 = __errno_location();\n  }" ({ "{") (expression_statement "__fd = FUN_001e7550(param_1);" (assignment_expression "__fd = FUN_001e7550(param_1)" (identifier "__fd") (= "=") (call_expression "FUN_001e7550(param_1)" (identifier "FUN_001e7550") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "sVar2 = read(__fd,param_2,param_3);" (assignment_expression "sVar2 = read(__fd,param_2,param_3)" (identifier "sVar2") (= "=") (call_expression "read(__fd,param_2,param_3)" (identifier "read") (argument_list "(__fd,param_2,param_3)" (( "(") (identifier "__fd") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (sVar2 != -1) {\n      return sVar2;\n    }" (if "if") (parenthesized_expression "(sVar2 != -1)" (( "(") (binary_expression "sVar2 != -1" (identifier "sVar2") (!= "!=") (number_literal "-1")) () ")")) (compound_statement "{\n      return sVar2;\n    }" ({ "{") (return_statement "return sVar2;" (return "return") (identifier "sVar2") (; ";")) (} "}"))) (expression_statement "piVar1 = __errno_location();" (assignment_expression "piVar1 = __errno_location()" (identifier "piVar1") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (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") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::__basic_file<char>::xsgetn(char*, int) */

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

{
  int *piVar1;
  int __fd;
  ssize_t var_3;
  
  do {
    __fd = var_1(this);
    var_3 = var_2(__fd,param_1,param_2);
    if (var_3 != -1) {
      return var_3;
    }
    piVar1 = var_4();
  } while (*piVar1 == 4);
  return -1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) 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: (primitive_type) 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: (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: (call_expression function: (identifier) arguments: (argument_list))))) condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))) (return_statement (number_literal)))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

ssize_t MASKED(undefined4 param_1,void *param_2,size_t param_3)

{
  int *piVar1;
  int __fd;
  ssize_t sVar2;
  
  do {
    __fd = FUN_001e7550(param_1);
    sVar2 = read(__fd,param_2,param_3);
    if (sVar2 != -1) {
      return sVar2;
    }
    piVar1 = __errno_location();
  } while (*piVar1 == 4);
  return -1;
}

