
/* std::wistream::readsome(wchar_t*, long) */

undefined8 __thiscall std::wistream::readsome(wistream *this,wchar_t *param_1,long param_2)

{
  long *plVar1;
  long lVar2;
  undefined8 uVar3;
  sentry local_19;
  
  *(undefined8 *)(this + 8) = 0;
  sentry::sentry(&local_19,this,true);
  if (local_19 != (sentry)0x0) {
    plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);
    if (plVar1[2] == plVar1[3]) {
                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */
      lVar2 = (**(code **)(*plVar1 + 0x38))();
    }
    else {
      lVar2 = plVar1[3] - plVar1[2] >> 2;
    }
    if (0 < lVar2) {
      if (lVar2 <= param_2) {
        param_2 = lVar2;
      }
                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */
      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))
                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)
      ;
      *(undefined8 *)(this + 8) = uVar3;
      return uVar3;
    }
    if (lVar2 == -1) {
      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),
                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |
                  _S_eofbit);
    }
  }
  return *(undefined8 *)(this + 8);
}



long FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)

{
  long *plVar1;
  long lVar2;
  char local_19;
  
  param_1[1] = 0;
  FUN_002fdd20(&local_19,param_1,1);
  if (local_19 != '\0') {
    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);
    if (plVar1[2] == plVar1[3]) {
                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */
      lVar2 = (**(code **)(*plVar1 + 0x38))();
    }
    else {
      lVar2 = plVar1[3] - plVar1[2] >> 2;
    }
    if (0 < lVar2) {
      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);
      if (lVar2 <= param_3) {
        param_3 = lVar2;
      }
                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */
      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);
      param_1[1] = lVar2;
      return lVar2;
    }
    if (lVar2 == -1) {
      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;
      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);
    }
  }
  return param_1[1];
}


PUSH R12
MOV R12,RDX
MOV EDX,0x1
PUSH RBP
MOV RBP,RSI
PUSH RBX
MOV RBX,RDI
MOV RSI,RBX
SUB RSP,0x10
MOV qword ptr [RDI + 0x8],0x0
LEA RDI,[RSP + 0xf]
CALL 0x002fdd20
CMP byte ptr [RSP + 0xf],0x0
JZ 0x002fee81
MOV RAX,qword ptr [RBX]
MOV RAX,qword ptr [RAX + -0x18]
MOV RDI,qword ptr [RBX + RAX*0x1 + 0xe8]
MOV RAX,qword ptr [RDI + 0x18]
MOV RDX,qword ptr [RDI + 0x10]
CMP RDX,RAX
JZ 0x002feeb0
SUB RAX,RDX
SAR RAX,0x2
TEST RAX,RAX
JLE 0x002fee90
MOV RDX,qword ptr [RBX]
CMP RAX,R12
MOV RSI,RBP
MOV RDX,qword ptr [RDX + -0x18]
MOV RDI,qword ptr [RBX + RDX*0x1 + 0xe8]
MOV RDX,R12
CMOVLE RDX,RAX
MOV RAX,qword ptr [RDI]
CALL qword ptr [RAX + 0x40]
MOV qword ptr [RBX + 0x8],RAX
ADD RSP,0x10
POP RBX
POP RBP
POP R12
RET
MOV RAX,qword ptr [RBX + 0x8]
ADD RSP,0x10
POP RBX
POP RBP
POP R12
RET
CMP RAX,-0x1
JNZ 0x002fee81
MOV RAX,qword ptr [RBX]
MOV RDI,qword ptr [RAX + -0x18]
ADD RDI,RBX
MOV ESI,dword ptr [RDI + 0x20]
OR ESI,0x2
CALL 0x00301270
JMP 0x002fee81
MOV RAX,qword ptr [RDI]
CALL qword ptr [RAX + 0x38]
JMP 0x002fee29
(translation_unit "long FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)\n\n{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}\n\n" (function_definition "long FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)\n\n{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}" (sized_type_specifier "long" long) (function_declarator "FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)" identifier (parameter_list "(long *param_1,undefined8 param_2,long 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 "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "char local_19;" primitive_type identifier ;) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_002fdd20(&local_19,param_1,1);" (call_expression "FUN_002fdd20(&local_19,param_1,1)" identifier (argument_list "(&local_19,param_1,1)" ( (pointer_expression "&local_19" & identifier) , identifier , number_literal ))) ;) (if_statement "if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }" if (parenthesized_expression "(local_19 != '\0')" ( (binary_expression "local_19 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }" { (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" * (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (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) ))))) ;) (if_statement "if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" if (parenthesized_expression "(plVar1[2] == plVar1[3])" ( (binary_expression "plVar1[2] == plVar1[3]" (subscript_expression "plVar1[2]" identifier [ number_literal ]) == (subscript_expression "plVar1[3]" identifier [ number_literal ])) )) (compound_statement "{\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }" { comment (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x38))();" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x38))()" identifier = (call_expression "(**(code **)(*plVar1 + 0x38))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x38))" ( (pointer_expression "**(code **)(*plVar1 + 0x38)" * (pointer_expression "*(code **)(*plVar1 + 0x38)" * (cast_expression "(code **)(*plVar1 + 0x38)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x38)" ( (binary_expression "*plVar1 + 0x38" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "()" ( )))) ;) }) (else_clause "else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" else (compound_statement "{\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" { (expression_statement "lVar2 = plVar1[3] - plVar1[2] >> 2;" (assignment_expression "lVar2 = plVar1[3] - plVar1[2] >> 2" identifier = (binary_expression "plVar1[3] - plVar1[2] >> 2" (binary_expression "plVar1[3] - plVar1[2]" (subscript_expression "plVar1[3]" identifier [ number_literal ]) - (subscript_expression "plVar1[2]" identifier [ number_literal ])) >> number_literal)) ;) }))) (if_statement "if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }" if (parenthesized_expression "(0 < lVar2)" ( (binary_expression "0 < lVar2" number_literal < identifier) )) (compound_statement "{\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }" { (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" * (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (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) ))))) ;) (if_statement "if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }" if (parenthesized_expression "(lVar2 <= param_3)" ( (binary_expression "lVar2 <= param_3" identifier <= identifier) )) (compound_statement "{\n        param_3 = lVar2;\n      }" { (expression_statement "param_3 = lVar2;" (assignment_expression "param_3 = lVar2" identifier = identifier) ;) })) comment (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3)" identifier = (call_expression "(**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3)" (parenthesized_expression "(**(code **)(*plVar1 + 0x40))" ( (pointer_expression "**(code **)(*plVar1 + 0x40)" * (pointer_expression "*(code **)(*plVar1 + 0x40)" * (cast_expression "(code **)(*plVar1 + 0x40)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x40)" ( (binary_expression "*plVar1 + 0x40" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "(plVar1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (expression_statement "param_1[1] = lVar2;" (assignment_expression "param_1[1] = lVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return lVar2;" return identifier ;) })) (if_statement "if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }" if (parenthesized_expression "(lVar2 == -1)" ( (binary_expression "lVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }" { (expression_statement "lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;" (assignment_expression "lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1" identifier = (binary_expression "*(long *)(*param_1 + -0x18) + (long)param_1" (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) )))) + (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);" (call_expression "FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2)" identifier (argument_list "(lVar2,*(uint *)(lVar2 + 0x20) | 2)" ( identifier , (binary_expression "*(uint *)(lVar2 + 0x20) | 2" (pointer_expression "*(uint *)(lVar2 + 0x20)" * (cast_expression "(uint *)(lVar2 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + 0x20)" ( (binary_expression "lVar2 + 0x20" identifier + number_literal) )))) | number_literal) ))) ;) })) })) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })))
(translation_unit "/* std::wistream::readsome(wchar_t*, long) */\n\nundefined8 __thiscall std::wistream::readsome(wistream *this,wchar_t *param_1,long param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  undefined8 uVar3;\n  sentry local_19;\n  \n  *(undefined8 *)(this + 8) = 0;\n  sentry::sentry(&local_19,this,true);\n  if (local_19 != (sentry)0x0) {\n    plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }\n    if (lVar2 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }\n  }\n  return *(undefined8 *)(this + 8);\n}\n\n" comment (function_definition "undefined8 __thiscall std::wistream::readsome(wistream *this,wchar_t *param_1,long param_2)\n\n{\n  long *plVar1;\n  long lVar2;\n  undefined8 uVar3;\n  sentry local_19;\n  \n  *(undefined8 *)(this + 8) = 0;\n  sentry::sentry(&local_19,this,true);\n  if (local_19 != (sentry)0x0) {\n    plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }\n    if (lVar2 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }\n  }\n  return *(undefined8 *)(this + 8);\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wistream::" identifier : : identifier : :) (function_declarator "readsome(wistream *this,wchar_t *param_1,long param_2)" identifier (parameter_list "(wistream *this,wchar_t *param_1,long param_2)" ( (parameter_declaration "wistream *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "long param_2" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  undefined8 uVar3;\n  sentry local_19;\n  \n  *(undefined8 *)(this + 8) = 0;\n  sentry::sentry(&local_19,this,true);\n  if (local_19 != (sentry)0x0) {\n    plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }\n    if (lVar2 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }\n  }\n  return *(undefined8 *)(this + 8);\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 uVar3;" type_identifier identifier ;) (declaration "sentry local_19;" type_identifier identifier ;) (expression_statement "*(undefined8 *)(this + 8) = 0;" (assignment_expression "*(undefined8 *)(this + 8) = 0" (pointer_expression "*(undefined8 *)(this + 8)" * (cast_expression "(undefined8 *)(this + 8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = number_literal) ;) (labeled_statement "sentry::sentry(&local_19,this,true);" statement_identifier : (ERROR ":" :) (expression_statement "sentry(&local_19,this,true);" (call_expression "sentry(&local_19,this,true)" identifier (argument_list "(&local_19,this,true)" ( (pointer_expression "&local_19" & identifier) , identifier , true ))) ;)) (if_statement "if (local_19 != (sentry)0x0) {\n    plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }\n    if (lVar2 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }\n  }" if (parenthesized_expression "(local_19 != (sentry)0x0)" ( (binary_expression "local_19 != (sentry)0x0" identifier != (cast_expression "(sentry)0x0" ( (type_descriptor "sentry" type_identifier) ) number_literal)) )) (compound_statement "{\n    plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }\n    if (lVar2 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }\n  }" { (expression_statement "plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (cast_expression "(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (binary_expression "this + *(long *)(*(long *)this + -0x18) + 0xe8" (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) ))))) ;) (if_statement "if (plVar1[2] == plVar1[3]) {\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" if (parenthesized_expression "(plVar1[2] == plVar1[3])" ( (binary_expression "plVar1[2] == plVar1[3]" (subscript_expression "plVar1[2]" identifier [ number_literal ]) == (subscript_expression "plVar1[3]" identifier [ number_literal ])) )) (compound_statement "{\n                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */\n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }" { comment (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x38))();" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x38))()" identifier = (call_expression "(**(code **)(*plVar1 + 0x38))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x38))" ( (pointer_expression "**(code **)(*plVar1 + 0x38)" * (pointer_expression "*(code **)(*plVar1 + 0x38)" * (cast_expression "(code **)(*plVar1 + 0x38)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x38)" ( (binary_expression "*plVar1 + 0x38" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "()" ( )))) ;) }) (else_clause "else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" else (compound_statement "{\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" { (expression_statement "lVar2 = plVar1[3] - plVar1[2] >> 2;" (assignment_expression "lVar2 = plVar1[3] - plVar1[2] >> 2" identifier = (binary_expression "plVar1[3] - plVar1[2] >> 2" (binary_expression "plVar1[3] - plVar1[2]" (subscript_expression "plVar1[3]" identifier [ number_literal ]) - (subscript_expression "plVar1[2]" identifier [ number_literal ])) >> number_literal)) ;) }))) (if_statement "if (0 < lVar2) {\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }" if (parenthesized_expression "(0 < lVar2)" ( (binary_expression "0 < lVar2" number_literal < identifier) )) (compound_statement "{\n      if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }\n                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */\n      uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;\n      *(undefined8 *)(this + 8) = uVar3;\n      return uVar3;\n    }" { (if_statement "if (lVar2 <= param_2) {\n        param_2 = lVar2;\n      }" if (parenthesized_expression "(lVar2 <= param_2)" ( (binary_expression "lVar2 <= param_2" identifier <= identifier) )) (compound_statement "{\n        param_2 = lVar2;\n      }" { (expression_statement "param_2 = lVar2;" (assignment_expression "param_2 = lVar2" identifier = identifier) ;) })) comment (expression_statement "uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)\n      ;" (assignment_expression "uVar3 = (**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)" identifier = (call_expression "(**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))\n                        (*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)" (parenthesized_expression "(**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40))" ( (pointer_expression "**(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40)" * (pointer_expression "*(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40)" * (cast_expression "(code **)(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40)" ( (binary_expression "**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8) + 0x40" (pointer_expression "**(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (pointer_expression "*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (cast_expression "(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (binary_expression "this + *(long *)(*(long *)this + -0x18) + 0xe8" (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) ))))) + number_literal) ))))) )) (argument_list "(*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8),param_1,param_2)" ( (pointer_expression "*(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" * (cast_expression "(long **)(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(long *)(*(long *)this + -0x18) + 0xe8)" ( (binary_expression "this + *(long *)(*(long *)this + -0x18) + 0xe8" (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 , identifier )))) ;) (expression_statement "*(undefined8 *)(this + 8) = uVar3;" (assignment_expression "*(undefined8 *)(this + 8) = uVar3" (pointer_expression "*(undefined8 *)(this + 8)" * (cast_expression "(undefined8 *)(this + 8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = identifier) ;) (return_statement "return uVar3;" return identifier ;) })) (if_statement "if (lVar2 == -1) {\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }" if (parenthesized_expression "(lVar2 == -1)" ( (binary_expression "lVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);\n    }" { (labeled_statement "wios::clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);" statement_identifier : (ERROR ":" :) (expression_statement "clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit);" (call_expression "clear((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit)" identifier (argument_list "((wios *)(this + *(long *)(*(long *)this + -0x18)),\n                  *(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit)" ( (cast_expression "(wios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "wios *" 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 *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20) |\n                  _S_eofbit" (pointer_expression "*(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" * (cast_expression "(_Ios_Iostate *)((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" ( (type_descriptor "_Ios_Iostate *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20)" ( (binary_expression "(wios *)(this + *(long *)(*(long *)this + -0x18)) + 0x20" (cast_expression "(wios *)(this + *(long *)(*(long *)this + -0x18))" ( (type_descriptor "wios *" 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 *(undefined8 *)(this + 8);" return (pointer_expression "*(undefined8 *)(this + 8)" * (cast_expression "(undefined8 *)(this + 8)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) ;) })))
(translation_unit "long FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)\n\n{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}\n\n" (function_definition "long FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)\n\n{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}" (sized_type_specifier "long" long) (function_declarator "FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)" identifier (parameter_list "(long *param_1,undefined8 param_2,long 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 "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}" { (declaration "long *plVar1;" (sized_type_specifier "long" long) (pointer_declarator "*plVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "char local_19;" primitive_type identifier ;) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "FUN_002fdd20(&local_19,param_1,1);" (call_expression "FUN_002fdd20(&local_19,param_1,1)" identifier (argument_list "(&local_19,param_1,1)" ( (pointer_expression "&local_19" & identifier) , identifier , number_literal ))) ;) (if_statement "if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }" if (parenthesized_expression "(local_19 != '\0')" ( (binary_expression "local_19 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }" { (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" * (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (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) ))))) ;) (if_statement "if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" if (parenthesized_expression "(plVar1[2] == plVar1[3])" ( (binary_expression "plVar1[2] == plVar1[3]" (subscript_expression "plVar1[2]" identifier [ number_literal ]) == (subscript_expression "plVar1[3]" identifier [ number_literal ])) )) (compound_statement "{\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }" { (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x38))();" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x38))()" identifier = (call_expression "(**(code **)(*plVar1 + 0x38))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x38))" ( (pointer_expression "**(code **)(*plVar1 + 0x38)" * (pointer_expression "*(code **)(*plVar1 + 0x38)" * (cast_expression "(code **)(*plVar1 + 0x38)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x38)" ( (binary_expression "*plVar1 + 0x38" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "()" ( )))) ;) }) (else_clause "else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" else (compound_statement "{\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" { (expression_statement "lVar2 = plVar1[3] - plVar1[2] >> 2;" (assignment_expression "lVar2 = plVar1[3] - plVar1[2] >> 2" identifier = (binary_expression "plVar1[3] - plVar1[2] >> 2" (binary_expression "plVar1[3] - plVar1[2]" (subscript_expression "plVar1[3]" identifier [ number_literal ]) - (subscript_expression "plVar1[2]" identifier [ number_literal ])) >> number_literal)) ;) }))) (if_statement "if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }" if (parenthesized_expression "(0 < lVar2)" ( (binary_expression "0 < lVar2" number_literal < identifier) )) (compound_statement "{\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }" { (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" identifier = (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" * (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" ( (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (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) ))))) ;) (if_statement "if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }" if (parenthesized_expression "(lVar2 <= param_3)" ( (binary_expression "lVar2 <= param_3" identifier <= identifier) )) (compound_statement "{\n        param_3 = lVar2;\n      }" { (expression_statement "param_3 = lVar2;" (assignment_expression "param_3 = lVar2" identifier = identifier) ;) })) (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3)" identifier = (call_expression "(**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3)" (parenthesized_expression "(**(code **)(*plVar1 + 0x40))" ( (pointer_expression "**(code **)(*plVar1 + 0x40)" * (pointer_expression "*(code **)(*plVar1 + 0x40)" * (cast_expression "(code **)(*plVar1 + 0x40)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*plVar1 + 0x40)" ( (binary_expression "*plVar1 + 0x40" (pointer_expression "*plVar1" * identifier) + number_literal) ))))) )) (argument_list "(plVar1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (expression_statement "param_1[1] = lVar2;" (assignment_expression "param_1[1] = lVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return lVar2;" return identifier ;) })) (if_statement "if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }" if (parenthesized_expression "(lVar2 == -1)" ( (binary_expression "lVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }" { (expression_statement "lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;" (assignment_expression "lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1" identifier = (binary_expression "*(long *)(*param_1 + -0x18) + (long)param_1" (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) )))) + (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);" (call_expression "FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2)" identifier (argument_list "(lVar2,*(uint *)(lVar2 + 0x20) | 2)" ( identifier , (binary_expression "*(uint *)(lVar2 + 0x20) | 2" (pointer_expression "*(uint *)(lVar2 + 0x20)" * (cast_expression "(uint *)(lVar2 + 0x20)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar2 + 0x20)" ( (binary_expression "lVar2 + 0x20" identifier + number_literal) )))) | number_literal) ))) ;) })) })) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT , LIT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (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) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == (subscript_expression IDENT [ LIT ])) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ])) >> LIT)) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (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) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT , IDENT , IDENT )))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (return_statement return IDENT ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) ;) (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 (subscript_expression IDENT [ LIT ]) ;) })))
(function_definition "long FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)\n\n{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_002fedd0(long *param_1,undefined8 param_2,long param_3)" (identifier "FUN_002fedd0") (parameter_list "(long *param_1,undefined8 param_2,long 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 "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) () ")"))) (compound_statement "{\n  long *plVar1;\n  long lVar2;\n  char local_19;\n  \n  param_1[1] = 0;\n  FUN_002fdd20(&local_19,param_1,1);\n  if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }\n  return param_1[1];\n}" ({ "{") (declaration "long *plVar1;" (sized_type_specifier "long" (long "long")) (pointer_declarator "*plVar1" (* "*") (identifier "plVar1")) (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "char local_19;" (primitive_type "char") (identifier "local_19") (; ";")) (expression_statement "param_1[1] = 0;" (assignment_expression "param_1[1] = 0" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "FUN_002fdd20(&local_19,param_1,1);" (call_expression "FUN_002fdd20(&local_19,param_1,1)" (identifier "FUN_002fdd20") (argument_list "(&local_19,param_1,1)" (( "(") (pointer_expression "&local_19" (& "&") (identifier "local_19")) (, ",") (identifier "param_1") (, ",") (number_literal "1") () ")"))) (; ";")) (if_statement "if (local_19 != '\0') {\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }" (if "if") (parenthesized_expression "(local_19 != '\0')" (( "(") (binary_expression "local_19 != '\0'" (identifier "local_19") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n    if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }\n    if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }\n    if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }\n  }" ({ "{") (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (identifier "plVar1") (= "=") (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (* "*") (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (( "(") (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (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 "0xe8")) () ")"))))) (; ";")) (if_statement "if (plVar1[2] == plVar1[3]) {\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }\n    else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" (if "if") (parenthesized_expression "(plVar1[2] == plVar1[3])" (( "(") (binary_expression "plVar1[2] == plVar1[3]" (subscript_expression "plVar1[2]" (identifier "plVar1") ([ "[") (number_literal "2") (] "]")) (== "==") (subscript_expression "plVar1[3]" (identifier "plVar1") ([ "[") (number_literal "3") (] "]"))) () ")")) (compound_statement "{\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x38))();\n    }" ({ "{") (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x38))();" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x38))()" (identifier "lVar2") (= "=") (call_expression "(**(code **)(*plVar1 + 0x38))()" (parenthesized_expression "(**(code **)(*plVar1 + 0x38))" (( "(") (pointer_expression "**(code **)(*plVar1 + 0x38)" (* "*") (pointer_expression "*(code **)(*plVar1 + 0x38)" (* "*") (cast_expression "(code **)(*plVar1 + 0x38)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*plVar1 + 0x38)" (( "(") (binary_expression "*plVar1 + 0x38" (pointer_expression "*plVar1" (* "*") (identifier "plVar1")) (+ "+") (number_literal "0x38")) () ")"))))) () ")")) (argument_list "()" (( "(") () ")")))) (; ";")) (} "}")) (else_clause "else {\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" (else "else") (compound_statement "{\n      lVar2 = plVar1[3] - plVar1[2] >> 2;\n    }" ({ "{") (expression_statement "lVar2 = plVar1[3] - plVar1[2] >> 2;" (assignment_expression "lVar2 = plVar1[3] - plVar1[2] >> 2" (identifier "lVar2") (= "=") (binary_expression "plVar1[3] - plVar1[2] >> 2" (binary_expression "plVar1[3] - plVar1[2]" (subscript_expression "plVar1[3]" (identifier "plVar1") ([ "[") (number_literal "3") (] "]")) (- "-") (subscript_expression "plVar1[2]" (identifier "plVar1") ([ "[") (number_literal "2") (] "]"))) (>> ">>") (number_literal "2"))) (; ";")) (} "}")))) (if_statement "if (0 < lVar2) {\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }" (if "if") (parenthesized_expression "(0 < lVar2)" (( "(") (binary_expression "0 < lVar2" (number_literal "0") (< "<") (identifier "lVar2")) () ")")) (compound_statement "{\n      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);\n      if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }\n                    \n      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);\n      param_1[1] = lVar2;\n      return lVar2;\n    }" ({ "{") (expression_statement "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);" (assignment_expression "plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (identifier "plVar1") (= "=") (pointer_expression "*(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (* "*") (cast_expression "(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8)" (( "(") (binary_expression "(long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8" (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 "0xe8")) () ")"))))) (; ";")) (if_statement "if (lVar2 <= param_3) {\n        param_3 = lVar2;\n      }" (if "if") (parenthesized_expression "(lVar2 <= param_3)" (( "(") (binary_expression "lVar2 <= param_3" (identifier "lVar2") (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n        param_3 = lVar2;\n      }" ({ "{") (expression_statement "param_3 = lVar2;" (assignment_expression "param_3 = lVar2" (identifier "param_3") (= "=") (identifier "lVar2")) (; ";")) (} "}"))) (expression_statement "lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);" (assignment_expression "lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3)" (identifier "lVar2") (= "=") (call_expression "(**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3)" (parenthesized_expression "(**(code **)(*plVar1 + 0x40))" (( "(") (pointer_expression "**(code **)(*plVar1 + 0x40)" (* "*") (pointer_expression "*(code **)(*plVar1 + 0x40)" (* "*") (cast_expression "(code **)(*plVar1 + 0x40)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*plVar1 + 0x40)" (( "(") (binary_expression "*plVar1 + 0x40" (pointer_expression "*plVar1" (* "*") (identifier "plVar1")) (+ "+") (number_literal "0x40")) () ")"))))) () ")")) (argument_list "(plVar1,param_2,param_3)" (( "(") (identifier "plVar1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (expression_statement "param_1[1] = lVar2;" (assignment_expression "param_1[1] = lVar2" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "lVar2")) (; ";")) (return_statement "return lVar2;" (return "return") (identifier "lVar2") (; ";")) (} "}"))) (if_statement "if (lVar2 == -1) {\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }" (if "if") (parenthesized_expression "(lVar2 == -1)" (( "(") (binary_expression "lVar2 == -1" (identifier "lVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;\n      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);\n    }" ({ "{") (expression_statement "lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;" (assignment_expression "lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1" (identifier "lVar2") (= "=") (binary_expression "*(long *)(*param_1 + -0x18) + (long)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")) () ")")))) (+ "+") (cast_expression "(long)param_1" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_1")))) (; ";")) (expression_statement "FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);" (call_expression "FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2)" (identifier "FUN_00301270") (argument_list "(lVar2,*(uint *)(lVar2 + 0x20) | 2)" (( "(") (identifier "lVar2") (, ",") (binary_expression "*(uint *)(lVar2 + 0x20) | 2" (pointer_expression "*(uint *)(lVar2 + 0x20)" (* "*") (cast_expression "(uint *)(lVar2 + 0x20)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar2 + 0x20)" (( "(") (binary_expression "lVar2 + 0x20" (identifier "lVar2") (+ "+") (number_literal "0x20")) () ")")))) (| "|") (number_literal "2")) () ")"))) (; ";")) (} "}"))) (} "}"))) (return_statement "return param_1[1];" (return "return") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (; ";")) (} "}")))

/* std::wistream::readsome(wchar_t*, long) */

type_1 __thiscall std::type_2::function_1(type_2 *var_1,type_3 *param_1,long var_4)

{
  long *plVar1;
  long var_3;
  type_1 uVar3;
  type_4 var_2;
  
  *(type_1 *)(var_1 + 8) = 0;
  sentry::type_4(&var_2,var_1,true);
  if (var_2 != (type_4)0x0) {
    plVar1 = *(long **)(var_1 + *(long *)(*(long *)var_1 + -0x18) + 0xe8);
    if (plVar1[2] == plVar1[3]) {
                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */
      var_3 = (**(type_5 **)(*plVar1 + 0x38))();
    }
    else {
      var_3 = plVar1[3] - plVar1[2] >> 2;
    }
    if (0 < var_3) {
      if (var_3 <= var_4) {
        var_4 = var_3;
      }
                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */
      uVar3 = (**(type_5 **)(**(long **)(var_1 + *(long *)(*(long *)var_1 + -0x18) + 0xe8) + 0x40))
                        (*(long **)(var_1 + *(long *)(*(long *)var_1 + -0x18) + 0xe8),param_1,var_4)
      ;
      *(type_1 *)(var_1 + 8) = uVar3;
      return uVar3;
    }
    if (var_3 == -1) {
      wios::var_5((type_6 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)),
                  *(type_7 *)((type_6 *)(var_1 + *(long *)(*(long *)var_1 + -0x18)) + 0x20) |
                  var_6);
    }
  }
  return *(type_1 *)(var_1 + 8);
}


(translation_unit (function_definition type: (sized_type_specifier) 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: (sized_type_specifier) declarator: (identifier)))) body: (compound_statement (declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)) (identifier) (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (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)))))) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (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: (pointer_expression argument: (identifier)) right: (number_literal))))))) arguments: (argument_list))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (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)))))) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (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: (pointer_expression argument: (identifier)) right: (number_literal))))))) arguments: (argument_list (identifier) (identifier) (identifier))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (return_statement (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (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))))) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))) (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 (subscript_expression argument: (identifier) index: (number_literal))))))

long MASKED(long *param_1,undefined8 param_2,long param_3)

{
  long *plVar1;
  long lVar2;
  char local_19;
  
  param_1[1] = 0;
  FUN_002fdd20(&local_19,param_1,1);
  if (local_19 != '\0') {
    plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);
    if (plVar1[2] == plVar1[3]) {
                    /* try { // try from 002feeb3 to 002feeb5 has its CatchHandler @ 002feebb */
      lVar2 = (**(code **)(*plVar1 + 0x38))();
    }
    else {
      lVar2 = plVar1[3] - plVar1[2] >> 2;
    }
    if (0 < lVar2) {
      plVar1 = *(long **)((long)param_1 + *(long *)(*param_1 + -0x18) + 0xe8);
      if (lVar2 <= param_3) {
        param_3 = lVar2;
      }
                    /* try { // try from 002fee4d to 002fee4f has its CatchHandler @ 002feebb */
      lVar2 = (**(code **)(*plVar1 + 0x40))(plVar1,param_2,param_3);
      param_1[1] = lVar2;
      return lVar2;
    }
    if (lVar2 == -1) {
      lVar2 = *(long *)(*param_1 + -0x18) + (long)param_1;
      FUN_00301270(lVar2,*(uint *)(lVar2 + 0x20) | 2);
    }
  }
  return param_1[1];
}

