
/* std::istream::readsome(char*, int) */

undefined4 __thiscall std::istream::readsome(istream *this,char *param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  sentry local_1d [13];
  
  __x86_get_pc_thunk_di();
  *(undefined4 *)(this + 4) = 0;
  sentry::sentry(local_1d,this,true);
  if (local_1d[0] != (sentry)0x0) {
    piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);
    iVar2 = piVar1[3] - piVar1[2];
    if (iVar2 == 0) {
                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */
      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);
    }
    if (0 < iVar2) {
      if (param_2 < iVar2) {
        iVar2 = param_2;
      }
                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */
      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))
                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);
      *(undefined4 *)(this + 4) = uVar3;
      return uVar3;
    }
    if (iVar2 == -1) {
      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),
                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit
                );
      return *(undefined4 *)(this + 4);
    }
  }
  return *(undefined4 *)(this + 4);
}



int FUN_0020b860(int *param_1,undefined4 param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  char local_1d [13];
  
  FUN_000559ee();
  param_1[1] = 0;
  FUN_0020a6a0(local_1d,param_1,1);
  if (local_1d[0] != '\0') {
    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);
    iVar2 = piVar1[3] - piVar1[2];
    if (iVar2 == 0) {
                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */
      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);
    }
    if (0 < iVar2) {
      if (param_3 < iVar2) {
        iVar2 = param_3;
      }
      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);
                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */
      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);
      param_1[1] = iVar2;
      return iVar2;
    }
    if (iVar2 == -1) {
      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;
      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);
      return param_1[1];
    }
  }
  return param_1[1];
}


PUSH EBP
MOV EBP,ESP
PUSH EDI
CALL 0x000559ee
ADD EDI,0x183797
PUSH ESI
LEA EAX,[EBP + -0x19]
PUSH EBX
SUB ESP,0x20
MOV ESI,dword ptr [EBP + 0x8]
MOV dword ptr [ESI + 0x4],0x0
MOV EBX,EDI
PUSH 0x1
PUSH ESI
PUSH EAX
CALL 0x0020a6a0
ADD ESP,0x10
CMP byte ptr [EBP + -0x19],0x0
JZ 0x0020b900
MOV EAX,dword ptr [ESI]
MOV EAX,dword ptr [EAX + -0xc]
MOV EDX,dword ptr [ESI + EAX*0x1 + 0x78]
MOV EAX,dword ptr [EDX + 0xc]
SUB EAX,dword ptr [EDX + 0x8]
JZ 0x0020b910
TEST EAX,EAX
JLE 0x0020b920
MOV EDX,dword ptr [ESI]
SUB ESP,0x4
CMP EAX,dword ptr [EBP + 0x10]
CMOVG EAX,dword ptr [EBP + 0x10]
MOV EDX,dword ptr [EDX + -0xc]
MOV EDX,dword ptr [ESI + EDX*0x1 + 0x78]
MOV ECX,dword ptr [EDX]
PUSH EAX
PUSH dword ptr [EBP + 0xc]
PUSH EDX
CALL dword ptr [ECX + 0x20]
MOV dword ptr [ESI + 0x4],EAX
ADD ESP,0x10
LEA ESP,[EBP + -0xc]
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [ESI + 0x4]
LEA ESP,[EBP + -0xc]
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,dword ptr [EDX]
SUB ESP,0xc
PUSH EDX
CALL dword ptr [EAX + 0x1c]
ADD ESP,0x10
TEST EAX,EAX
JG 0x0020b8aa
CMP EAX,-0x1
JNZ 0x0020b900
MOV EAX,dword ptr [ESI]
SUB ESP,0x8
MOV EBX,EDI
MOV EDX,dword ptr [EAX + -0xc]
ADD EDX,ESI
MOV EAX,dword ptr [EDX + 0x14]
OR EAX,0x2
PUSH EAX
PUSH EDX
CALL 0x00210c00
MOV EAX,dword ptr [ESI + 0x4]
ADD ESP,0x10
JMP 0x0020b903
(translation_unit "int FUN_0020b860(int *param_1,undefined4 param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}\n\n" (function_definition "int FUN_0020b860(int *param_1,undefined4 param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}" primitive_type (function_declarator "FUN_0020b860(int *param_1,undefined4 param_2,int param_3)" identifier (parameter_list "(int *param_1,undefined4 param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char local_1d [13];" primitive_type (array_declarator "local_1d [13]" identifier [ number_literal ]) ;) (expression_statement "FUN_000559ee();" (call_expression "FUN_000559ee()" identifier (argument_list "()" ( ))) ;) (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_0020a6a0(local_1d,param_1,1);" (call_expression "FUN_0020a6a0(local_1d,param_1,1)" identifier (argument_list "(local_1d,param_1,1)" ( identifier , identifier , number_literal ))) ;) (if_statement "if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }" if (parenthesized_expression "(local_1d[0] != '\0')" ( (binary_expression "local_1d[0] != '\0'" (subscript_expression "local_1d[0]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }" { (expression_statement "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" identifier = (pointer_expression "*(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" * (cast_expression "(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc) + 0x78" (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) + number_literal) ))))) ;) (expression_statement "iVar2 = piVar1[3] - piVar1[2];" (assignment_expression "iVar2 = piVar1[3] - piVar1[2]" identifier = (binary_expression "piVar1[3] - piVar1[2]" (subscript_expression "piVar1[3]" identifier [ number_literal ]) - (subscript_expression "piVar1[2]" identifier [ number_literal ]))) ;) (if_statement "if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" { comment (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1)" identifier = (call_expression "(**(code **)(*piVar1 + 0x1c))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 0x1c))" ( (pointer_expression "**(code **)(*piVar1 + 0x1c)" * (pointer_expression "*(code **)(*piVar1 + 0x1c)" * (cast_expression "(code **)(*piVar1 + 0x1c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 0x1c)" ( (binary_expression "*piVar1 + 0x1c" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1)" ( identifier )))) ;) })) (if_statement "if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }" { (if_statement "if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }" if (parenthesized_expression "(param_3 < iVar2)" ( (binary_expression "param_3 < iVar2" identifier < identifier) )) (compound_statement "{\n        iVar2 = param_3;\n      }" { (expression_statement "iVar2 = param_3;" (assignment_expression "iVar2 = param_3" identifier = identifier) ;) })) (expression_statement "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" identifier = (pointer_expression "*(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" * (cast_expression "(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc) + 0x78" (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) + number_literal) ))))) ;) comment (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2)" identifier = (call_expression "(**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2)" (parenthesized_expression "(**(code **)(*piVar1 + 0x20))" ( (pointer_expression "**(code **)(*piVar1 + 0x20)" * (pointer_expression "*(code **)(*piVar1 + 0x20)" * (cast_expression "(code **)(*piVar1 + 0x20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 0x20)" ( (binary_expression "*piVar1 + 0x20" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1,param_2,iVar2)" ( identifier , identifier , identifier )))) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return iVar2;" return identifier ;) })) (if_statement "if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }" { (expression_statement "iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;" (assignment_expression "iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1" identifier = (binary_expression "*(int *)(*param_1 + -0xc) + (int)param_1" (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) )))) + (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);" (call_expression "FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2)" identifier (argument_list "(iVar2,*(uint *)(iVar2 + 0x14) | 2)" ( identifier , (binary_expression "*(uint *)(iVar2 + 0x14) | 2" (pointer_expression "*(uint *)(iVar2 + 0x14)" * (cast_expression "(uint *)(iVar2 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0x14)" ( (binary_expression "iVar2 + 0x14" identifier + number_literal) )))) | number_literal) ))) ;) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })) })) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })))
(translation_unit "/* std::istream::readsome(char*, int) */\n\nundefined4 __thiscall std::istream::readsome(istream *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  sentry local_1d [13];\n  \n  __x86_get_pc_thunk_di();\n  *(undefined4 *)(this + 4) = 0;\n  sentry::sentry(local_1d,this,true);\n  if (local_1d[0] != (sentry)0x0) {\n    piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }\n    if (iVar2 == -1) {\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }\n  }\n  return *(undefined4 *)(this + 4);\n}\n\n" comment (function_definition "undefined4 __thiscall std::istream::readsome(istream *this,char *param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  sentry local_1d [13];\n  \n  __x86_get_pc_thunk_di();\n  *(undefined4 *)(this + 4) = 0;\n  sentry::sentry(local_1d,this,true);\n  if (local_1d[0] != (sentry)0x0) {\n    piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }\n    if (iVar2 == -1) {\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }\n  }\n  return *(undefined4 *)(this + 4);\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::istream::" identifier : : identifier : :) (function_declarator "readsome(istream *this,char *param_1,int param_2)" identifier (parameter_list "(istream *this,char *param_1,int param_2)" ( (parameter_declaration "istream *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  undefined4 uVar3;\n  sentry local_1d [13];\n  \n  __x86_get_pc_thunk_di();\n  *(undefined4 *)(this + 4) = 0;\n  sentry::sentry(local_1d,this,true);\n  if (local_1d[0] != (sentry)0x0) {\n    piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }\n    if (iVar2 == -1) {\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }\n  }\n  return *(undefined4 *)(this + 4);\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "undefined4 uVar3;" type_identifier identifier ;) (declaration "sentry local_1d [13];" type_identifier (array_declarator "local_1d [13]" identifier [ number_literal ]) ;) (expression_statement "__x86_get_pc_thunk_di();" (call_expression "__x86_get_pc_thunk_di()" identifier (argument_list "()" ( ))) ;) (expression_statement "*(undefined4 *)(this + 4) = 0;" (assignment_expression "*(undefined4 *)(this + 4) = 0" (pointer_expression "*(undefined4 *)(this + 4)" * (cast_expression "(undefined4 *)(this + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = number_literal) ;) (labeled_statement "sentry::sentry(local_1d,this,true);" statement_identifier : (ERROR ":" :) (expression_statement "sentry(local_1d,this,true);" (call_expression "sentry(local_1d,this,true)" identifier (argument_list "(local_1d,this,true)" ( identifier , identifier , true ))) ;)) (if_statement "if (local_1d[0] != (sentry)0x0) {\n    piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }\n    if (iVar2 == -1) {\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }\n  }" if (parenthesized_expression "(local_1d[0] != (sentry)0x0)" ( (binary_expression "local_1d[0] != (sentry)0x0" (subscript_expression "local_1d[0]" identifier [ number_literal ]) != (cast_expression "(sentry)0x0" ( (type_descriptor "sentry" type_identifier) ) number_literal)) )) (compound_statement "{\n    piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }\n    if (iVar2 == -1) {\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }\n  }" { (expression_statement "piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" identifier = (pointer_expression "*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" * (cast_expression "(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc) + 0x78)" ( (binary_expression "this + *(int *)(*(int *)this + -0xc) + 0x78" (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) + number_literal) ))))) ;) (expression_statement "iVar2 = piVar1[3] - piVar1[2];" (assignment_expression "iVar2 = piVar1[3] - piVar1[2]" identifier = (binary_expression "piVar1[3] - piVar1[2]" (subscript_expression "piVar1[3]" identifier [ number_literal ]) - (subscript_expression "piVar1[2]" identifier [ number_literal ]))) ;) (if_statement "if (iVar2 == 0) {\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */\n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" { comment (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1)" identifier = (call_expression "(**(code **)(*piVar1 + 0x1c))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 0x1c))" ( (pointer_expression "**(code **)(*piVar1 + 0x1c)" * (pointer_expression "*(code **)(*piVar1 + 0x1c)" * (cast_expression "(code **)(*piVar1 + 0x1c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 0x1c)" ( (binary_expression "*piVar1 + 0x1c" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1)" ( identifier )))) ;) })) (if_statement "if (0 < iVar2) {\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n      if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }\n                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */\n      uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);\n      *(undefined4 *)(this + 4) = uVar3;\n      return uVar3;\n    }" { (if_statement "if (param_2 < iVar2) {\n        iVar2 = param_2;\n      }" if (parenthesized_expression "(param_2 < iVar2)" ( (binary_expression "param_2 < iVar2" identifier < identifier) )) (compound_statement "{\n        iVar2 = param_2;\n      }" { (expression_statement "iVar2 = param_2;" (assignment_expression "iVar2 = param_2" identifier = identifier) ;) })) comment (expression_statement "uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2);" (assignment_expression "uVar3 = (**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2)" identifier = (call_expression "(**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))\n                        (*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2)" (parenthesized_expression "(**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20))" ( (pointer_expression "**(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20)" * (pointer_expression "*(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20)" * (cast_expression "(code **)(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20)" ( (binary_expression "**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78) + 0x20" (pointer_expression "**(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" * (pointer_expression "*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" * (cast_expression "(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc) + 0x78)" ( (binary_expression "this + *(int *)(*(int *)this + -0xc) + 0x78" (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78),param_1,iVar2)" ( (pointer_expression "*(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" * (cast_expression "(int **)(this + *(int *)(*(int *)this + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc) + 0x78)" ( (binary_expression "this + *(int *)(*(int *)this + -0xc) + 0x78" (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) + number_literal) )))) , identifier , identifier )))) ;) (expression_statement "*(undefined4 *)(this + 4) = uVar3;" (assignment_expression "*(undefined4 *)(this + 4) = uVar3" (pointer_expression "*(undefined4 *)(this + 4)" * (cast_expression "(undefined4 *)(this + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = identifier) ;) (return_statement "return uVar3;" return identifier ;) })) (if_statement "if (iVar2 == -1) {\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );\n      return *(undefined4 *)(this + 4);\n    }" { (labeled_statement "ios::clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );" statement_identifier : (ERROR ":" :) (expression_statement "clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                );" (call_expression "clear((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                )" identifier (argument_list "((ios *)(this + *(int *)(*(int *)this + -0xc)),\n                 *(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit\n                )" ( (cast_expression "(ios *)(this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc))" ( (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) , (binary_expression "*(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14) | _S_eofbit" (pointer_expression "*(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14)" * (cast_expression "(_Ios_Iostate *)((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14)" ( (type_descriptor "_Ios_Iostate *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14)" ( (binary_expression "(ios *)(this + *(int *)(*(int *)this + -0xc)) + 0x14" (cast_expression "(ios *)(this + *(int *)(*(int *)this + -0xc))" ( (type_descriptor "ios *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + *(int *)(*(int *)this + -0xc))" ( (binary_expression "this + *(int *)(*(int *)this + -0xc)" identifier + (pointer_expression "*(int *)(*(int *)this + -0xc)" * (cast_expression "(int *)(*(int *)this + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + -0xc)" ( (binary_expression "*(int *)this + -0xc" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ))) + number_literal) )))) | identifier) ))) ;)) (return_statement "return *(undefined4 *)(this + 4);" return (pointer_expression "*(undefined4 *)(this + 4)" * (cast_expression "(undefined4 *)(this + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) ;) })) })) (return_statement "return *(undefined4 *)(this + 4);" return (pointer_expression "*(undefined4 *)(this + 4)" * (cast_expression "(undefined4 *)(this + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) ;) })))
(translation_unit "int FUN_0020b860(int *param_1,undefined4 param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}\n\n" (function_definition "int FUN_0020b860(int *param_1,undefined4 param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}" primitive_type (function_declarator "FUN_0020b860(int *param_1,undefined4 param_2,int param_3)" identifier (parameter_list "(int *param_1,undefined4 param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "char local_1d [13];" primitive_type (array_declarator "local_1d [13]" identifier [ number_literal ]) ;) (expression_statement "FUN_000559ee();" (call_expression "FUN_000559ee()" identifier (argument_list "()" ( ))) ;) (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_0020a6a0(local_1d,param_1,1);" (call_expression "FUN_0020a6a0(local_1d,param_1,1)" identifier (argument_list "(local_1d,param_1,1)" ( identifier , identifier , number_literal ))) ;) (if_statement "if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }" if (parenthesized_expression "(local_1d[0] != '\0')" ( (binary_expression "local_1d[0] != '\0'" (subscript_expression "local_1d[0]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }" { (expression_statement "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" identifier = (pointer_expression "*(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" * (cast_expression "(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc) + 0x78" (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) + number_literal) ))))) ;) (expression_statement "iVar2 = piVar1[3] - piVar1[2];" (assignment_expression "iVar2 = piVar1[3] - piVar1[2]" identifier = (binary_expression "piVar1[3] - piVar1[2]" (subscript_expression "piVar1[3]" identifier [ number_literal ]) - (subscript_expression "piVar1[2]" identifier [ number_literal ]))) ;) (if_statement "if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" { (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1)" identifier = (call_expression "(**(code **)(*piVar1 + 0x1c))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 0x1c))" ( (pointer_expression "**(code **)(*piVar1 + 0x1c)" * (pointer_expression "*(code **)(*piVar1 + 0x1c)" * (cast_expression "(code **)(*piVar1 + 0x1c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 0x1c)" ( (binary_expression "*piVar1 + 0x1c" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1)" ( identifier )))) ;) })) (if_statement "if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }" if (parenthesized_expression "(0 < iVar2)" ( (binary_expression "0 < iVar2" number_literal < identifier) )) (compound_statement "{\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }" { (if_statement "if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }" if (parenthesized_expression "(param_3 < iVar2)" ( (binary_expression "param_3 < iVar2" identifier < identifier) )) (compound_statement "{\n        iVar2 = param_3;\n      }" { (expression_statement "iVar2 = param_3;" (assignment_expression "iVar2 = param_3" identifier = identifier) ;) })) (expression_statement "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" identifier = (pointer_expression "*(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" * (cast_expression "(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" ( (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc) + 0x78" (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier) + (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) ))))) + number_literal) ))))) ;) (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2)" identifier = (call_expression "(**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2)" (parenthesized_expression "(**(code **)(*piVar1 + 0x20))" ( (pointer_expression "**(code **)(*piVar1 + 0x20)" * (pointer_expression "*(code **)(*piVar1 + 0x20)" * (cast_expression "(code **)(*piVar1 + 0x20)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*piVar1 + 0x20)" ( (binary_expression "*piVar1 + 0x20" (pointer_expression "*piVar1" * identifier) + number_literal) ))))) )) (argument_list "(piVar1,param_2,iVar2)" ( identifier , identifier , identifier )))) ;) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;) (return_statement "return iVar2;" return identifier ;) })) (if_statement "if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }" { (expression_statement "iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;" (assignment_expression "iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1" identifier = (binary_expression "*(int *)(*param_1 + -0xc) + (int)param_1" (pointer_expression "*(int *)(*param_1 + -0xc)" * (cast_expression "(int *)(*param_1 + -0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0xc)" ( (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" * identifier) + number_literal) )))) + (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);" (call_expression "FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2)" identifier (argument_list "(iVar2,*(uint *)(iVar2 + 0x14) | 2)" ( identifier , (binary_expression "*(uint *)(iVar2 + 0x14) | 2" (pointer_expression "*(uint *)(iVar2 + 0x14)" * (cast_expression "(uint *)(iVar2 + 0x14)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar2 + 0x14)" ( (binary_expression "iVar2 + 0x14" identifier + number_literal) )))) | number_literal) ))) ;) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })) })) (return_statement "return param_1[1];" return (subscript_expression "param_1[1]" identifier [ number_literal ]) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , LIT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) != (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_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 ( IDENT )))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) + LIT) ))))) ;) (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 TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) + (cast_expression ( (type_descriptor TYPE) ) 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 ]) ;) })) })) (return_statement return (subscript_expression IDENT [ LIT ]) ;) })))
(function_definition "int FUN_0020b860(int *param_1,undefined4 param_2,int param_3)\n\n{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}" (primitive_type "int") (function_declarator "FUN_0020b860(int *param_1,undefined4 param_2,int param_3)" (identifier "FUN_0020b860") (parameter_list "(int *param_1,undefined4 param_2,int param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  char local_1d [13];\n  \n  FUN_000559ee();\n  param_1[1] = 0;\n  FUN_0020a6a0(local_1d,param_1,1);\n  if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }\n  return param_1[1];\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "char local_1d [13];" (primitive_type "char") (array_declarator "local_1d [13]" (identifier "local_1d") ([ "[") (number_literal "13") (] "]")) (; ";")) (expression_statement "FUN_000559ee();" (call_expression "FUN_000559ee()" (identifier "FUN_000559ee") (argument_list "()" (( "(") () ")"))) (; ";")) (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_0020a6a0(local_1d,param_1,1);" (call_expression "FUN_0020a6a0(local_1d,param_1,1)" (identifier "FUN_0020a6a0") (argument_list "(local_1d,param_1,1)" (( "(") (identifier "local_1d") (, ",") (identifier "param_1") (, ",") (number_literal "1") () ")"))) (; ";")) (if_statement "if (local_1d[0] != '\0') {\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }" (if "if") (parenthesized_expression "(local_1d[0] != '\0')" (( "(") (binary_expression "local_1d[0] != '\0'" (subscript_expression "local_1d[0]" (identifier "local_1d") ([ "[") (number_literal "0") (] "]")) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n    iVar2 = piVar1[3] - piVar1[2];\n    if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }\n    if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }\n    if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }\n  }" ({ "{") (expression_statement "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (identifier "piVar1") (= "=") (pointer_expression "*(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (* "*") (cast_expression "(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (( "(") (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc) + 0x78" (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) (+ "+") (number_literal "0x78")) () ")"))))) (; ";")) (expression_statement "iVar2 = piVar1[3] - piVar1[2];" (assignment_expression "iVar2 = piVar1[3] - piVar1[2]" (identifier "iVar2") (= "=") (binary_expression "piVar1[3] - piVar1[2]" (subscript_expression "piVar1[3]" (identifier "piVar1") ([ "[") (number_literal "3") (] "]")) (- "-") (subscript_expression "piVar1[2]" (identifier "piVar1") ([ "[") (number_literal "2") (] "]")))) (; ";")) (if_statement "if (iVar2 == 0) {\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" (if "if") (parenthesized_expression "(iVar2 == 0)" (( "(") (binary_expression "iVar2 == 0" (identifier "iVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);\n    }" ({ "{") (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*piVar1 + 0x1c))(piVar1)" (parenthesized_expression "(**(code **)(*piVar1 + 0x1c))" (( "(") (pointer_expression "**(code **)(*piVar1 + 0x1c)" (* "*") (pointer_expression "*(code **)(*piVar1 + 0x1c)" (* "*") (cast_expression "(code **)(*piVar1 + 0x1c)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*piVar1 + 0x1c)" (( "(") (binary_expression "*piVar1 + 0x1c" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (+ "+") (number_literal "0x1c")) () ")"))))) () ")")) (argument_list "(piVar1)" (( "(") (identifier "piVar1") () ")")))) (; ";")) (} "}"))) (if_statement "if (0 < iVar2) {\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }" (if "if") (parenthesized_expression "(0 < iVar2)" (( "(") (binary_expression "0 < iVar2" (number_literal "0") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n      if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }\n      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);\n                    \n      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);\n      param_1[1] = iVar2;\n      return iVar2;\n    }" ({ "{") (if_statement "if (param_3 < iVar2) {\n        iVar2 = param_3;\n      }" (if "if") (parenthesized_expression "(param_3 < iVar2)" (( "(") (binary_expression "param_3 < iVar2" (identifier "param_3") (< "<") (identifier "iVar2")) () ")")) (compound_statement "{\n        iVar2 = param_3;\n      }" ({ "{") (expression_statement "iVar2 = param_3;" (assignment_expression "iVar2 = param_3" (identifier "iVar2") (= "=") (identifier "param_3")) (; ";")) (} "}"))) (expression_statement "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);" (assignment_expression "piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (identifier "piVar1") (= "=") (pointer_expression "*(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (* "*") (cast_expression "(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78)" (( "(") (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc) + 0x78" (binary_expression "(int)param_1 + *(int *)(*param_1 + -0xc)" (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")) (+ "+") (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")"))))) (+ "+") (number_literal "0x78")) () ")"))))) (; ";")) (expression_statement "iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);" (assignment_expression "iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2)" (parenthesized_expression "(**(code **)(*piVar1 + 0x20))" (( "(") (pointer_expression "**(code **)(*piVar1 + 0x20)" (* "*") (pointer_expression "*(code **)(*piVar1 + 0x20)" (* "*") (cast_expression "(code **)(*piVar1 + 0x20)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*piVar1 + 0x20)" (( "(") (binary_expression "*piVar1 + 0x20" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (+ "+") (number_literal "0x20")) () ")"))))) () ")")) (argument_list "(piVar1,param_2,iVar2)" (( "(") (identifier "piVar1") (, ",") (identifier "param_2") (, ",") (identifier "iVar2") () ")")))) (; ";")) (expression_statement "param_1[1] = iVar2;" (assignment_expression "param_1[1] = iVar2" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "iVar2")) (; ";")) (return_statement "return iVar2;" (return "return") (identifier "iVar2") (; ";")) (} "}"))) (if_statement "if (iVar2 == -1) {\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;\n      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);\n      return param_1[1];\n    }" ({ "{") (expression_statement "iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;" (assignment_expression "iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1" (identifier "iVar2") (= "=") (binary_expression "*(int *)(*param_1 + -0xc) + (int)param_1" (pointer_expression "*(int *)(*param_1 + -0xc)" (* "*") (cast_expression "(int *)(*param_1 + -0xc)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0xc)" (( "(") (binary_expression "*param_1 + -0xc" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0xc")) () ")")))) (+ "+") (cast_expression "(int)param_1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_1")))) (; ";")) (expression_statement "FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);" (call_expression "FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2)" (identifier "FUN_00210c00") (argument_list "(iVar2,*(uint *)(iVar2 + 0x14) | 2)" (( "(") (identifier "iVar2") (, ",") (binary_expression "*(uint *)(iVar2 + 0x14) | 2" (pointer_expression "*(uint *)(iVar2 + 0x14)" (* "*") (cast_expression "(uint *)(iVar2 + 0x14)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar2 + 0x14)" (( "(") (binary_expression "iVar2 + 0x14" (identifier "iVar2") (+ "+") (number_literal "0x14")) () ")")))) (| "|") (number_literal "2")) () ")"))) (; ";")) (return_statement "return param_1[1];" (return "return") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (; ";")) (} "}"))) (} "}"))) (return_statement "return param_1[1];" (return "return") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (; ";")) (} "}")))

/* std::istream::readsome(char*, int) */

type_1 __thiscall std::type_2::function_1(type_2 *var_2,char *param_1,int var_4)

{
  int *piVar1;
  int var_3;
  type_1 uVar3;
  type_3 local_1d [13];
  
  var_1();
  *(type_1 *)(var_2 + 4) = 0;
  sentry::type_3(local_1d,var_2,true);
  if (local_1d[0] != (type_3)0x0) {
    piVar1 = *(int **)(var_2 + *(int *)(*(int *)var_2 + -0xc) + 0x78);
    var_3 = piVar1[3] - piVar1[2];
    if (var_3 == 0) {
                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */
      var_3 = (**(type_4 **)(*piVar1 + 0x1c))(piVar1);
    }
    if (0 < var_3) {
      if (var_4 < var_3) {
        var_3 = var_4;
      }
                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */
      uVar3 = (**(type_4 **)(**(int **)(var_2 + *(int *)(*(int *)var_2 + -0xc) + 0x78) + 0x20))
                        (*(int **)(var_2 + *(int *)(*(int *)var_2 + -0xc) + 0x78),param_1,var_3);
      *(type_1 *)(var_2 + 4) = uVar3;
      return uVar3;
    }
    if (var_3 == -1) {
      ios::var_5((type_5 *)(var_2 + *(int *)(*(int *)var_2 + -0xc)),
                 *(type_6 *)((type_5 *)(var_2 + *(int *)(*(int *)var_2 + -0xc)) + 0x14) | var_6
                );
      return *(type_1 *)(var_2 + 4);
    }
  }
  return *(type_1 *)(var_2 + 4);
}


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

int MASKED(int *param_1,undefined4 param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  char local_1d [13];
  
  FUN_000559ee();
  param_1[1] = 0;
  FUN_0020a6a0(local_1d,param_1,1);
  if (local_1d[0] != '\0') {
    piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);
    iVar2 = piVar1[3] - piVar1[2];
    if (iVar2 == 0) {
                    /* try { // try from 0020b916 to 0020b918 has its CatchHandler @ 0020b946 */
      iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1);
    }
    if (0 < iVar2) {
      if (param_3 < iVar2) {
        iVar2 = param_3;
      }
      piVar1 = *(int **)((int)param_1 + *(int *)(*param_1 + -0xc) + 0x78);
                    /* try { // try from 0020b8c4 to 0020b8c6 has its CatchHandler @ 0020b946 */
      iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_2,iVar2);
      param_1[1] = iVar2;
      return iVar2;
    }
    if (iVar2 == -1) {
      iVar2 = *(int *)(*param_1 + -0xc) + (int)param_1;
      FUN_00210c00(iVar2,*(uint *)(iVar2 + 0x14) | 2);
      return param_1[1];
    }
  }
  return param_1[1];
}

