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

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

{
  int __fd;
  int *piVar1;
  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;
}



ssize_t FUN_002db330(undefined8 param_1,void *param_2,size_t param_3)

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


PUSH R13
MOV R13,RDI
PUSH R12
MOV R12,RSI
PUSH RBP
MOV RBP,RDX
PUSH RBX
SUB RSP,0x8
JMP 0x002db352
CALL 0x00147770
CMP dword ptr [RAX],0x4
JNZ 0x002db370
MOV RDI,R13
CALL 0x002db2b0
MOV RDX,RBP
MOV RSI,R12
MOV EDI,EAX
CALL 0x001472e0
MOV RBX,RAX
CMP RAX,-0x1
JZ 0x002db348
ADD RSP,0x8
MOV RAX,RBX
POP RBX
POP RBP
POP R12
POP R13
RET
(translation_unit "ssize_t FUN_002db330(undefined8 param_1,void *param_2,size_t param_3)\n\n{\n  int __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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_002db330(undefined8 param_1,void *param_2,size_t param_3)\n\n{\n  int __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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_002db330(undefined8 param_1,void *param_2,size_t param_3)" identifier (parameter_list "(undefined8 param_1,void *param_2,size_t param_3)" ( (parameter_declaration "undefined8 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 __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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 __fd;" primitive_type identifier ;) (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (do_statement "do {\n    __fd = FUN_002db2b0(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_002db2b0(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_002db2b0(param_1);" (assignment_expression "__fd = FUN_002db2b0(param_1)" identifier = (call_expression "FUN_002db2b0(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 "/* std::__basic_file<char>::xsgetn(char*, long) */\n\nssize_t __thiscall\nstd::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,long param_2)\n\n{\n  int __fd;\n  int *piVar1;\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 (function_definition "ssize_t __thiscall\nstd::__basic_file<char>::xsgetn(__basic_file<char> *this,char *param_1,long param_2)\n\n{\n  int __fd;\n  int *piVar1;\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,long param_2)" identifier (parameter_list "(__basic_file<char> *this,char *param_1,long 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 "long param_2" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int __fd;\n  int *piVar1;\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 __fd;" primitive_type identifier ;) (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * 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_002db330(undefined8 param_1,void *param_2,size_t param_3)\n\n{\n  int __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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_002db330(undefined8 param_1,void *param_2,size_t param_3)\n\n{\n  int __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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_002db330(undefined8 param_1,void *param_2,size_t param_3)" identifier (parameter_list "(undefined8 param_1,void *param_2,size_t param_3)" ( (parameter_declaration "undefined8 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 __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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 __fd;" primitive_type identifier ;) (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "ssize_t sVar2;" primitive_type identifier ;) (do_statement "do {\n    __fd = FUN_002db2b0(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_002db2b0(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_002db2b0(param_1);" (assignment_expression "__fd = FUN_002db2b0(param_1)" identifier = (call_expression "FUN_002db2b0(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 IDENT ;) (declaration TYPE (pointer_declarator * 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_002db330(undefined8 param_1,void *param_2,size_t param_3)\n\n{\n  int __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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_002db330(undefined8 param_1,void *param_2,size_t param_3)" (identifier "FUN_002db330") (parameter_list "(undefined8 param_1,void *param_2,size_t param_3)" (( "(") (parameter_declaration "undefined8 param_1" (type_identifier "undefined8") (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 __fd;\n  int *piVar1;\n  ssize_t sVar2;\n  \n  do {\n    __fd = FUN_002db2b0(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 __fd;" (primitive_type "int") (identifier "__fd") (; ";")) (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "ssize_t sVar2;" (primitive_type "ssize_t") (identifier "sVar2") (; ";")) (do_statement "do {\n    __fd = FUN_002db2b0(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_002db2b0(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_002db2b0(param_1);" (assignment_expression "__fd = FUN_002db2b0(param_1)" (identifier "__fd") (= "=") (call_expression "FUN_002db2b0(param_1)" (identifier "FUN_002db2b0") (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") (; ";")) (} "}")))

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

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

{
  int __fd;
  int *piVar1;
  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: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator 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)))))

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

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

