
/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */
/* std::streambuf::xsgetn(char*, int) */

int __thiscall std::streambuf::xsgetn(streambuf *this,char *param_1,int param_2)

{
  code *pcVar1;
  size_t sVar2;
  int iVar3;
  uint uVar4;
  size_t __n;
  char *pcVar5;
  int iVar6;
  
  iVar6 = 0;
  if (param_2 < 1) {
    return 0;
  }
  do {
    sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);
    pcVar5 = param_1;
    if (sVar2 != 0) {
      __n = param_2 - iVar6;
      if ((int)sVar2 < param_2 - iVar6) {
        __n = sVar2;
      }
      iVar6 = iVar6 + __n;
      memcpy(param_1,*(void **)(this + 8),__n);
      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;
      if (param_2 <= iVar6) {
        return iVar6;
      }
      pcVar5 = param_1 + __n;
    }
    pcVar1 = *(code **)(*(int *)this + 0x28);
    if (pcVar1 == uflow) {
      pcVar1 = *(code **)(*(int *)this + 0x24);
      if (pcVar1 == underflow) {
        return iVar6;
      }
      iVar3 = (*pcVar1)(this);
      if (iVar3 == -1) {
        return iVar6;
      }
      uVar4 = (uint)**(byte **)(this + 8);
      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;
    }
    else {
      uVar4 = (*pcVar1)(this);
      if (uVar4 == 0xffffffff) {
        return iVar6;
      }
    }
    iVar6 = iVar6 + 1;
    param_1 = pcVar5 + 1;
    *pcVar5 = (char)uVar4;
    if (param_2 <= iVar6) {
      return iVar6;
    }
  } while( true );
}



/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */

int FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)

{
  code *pcVar1;
  size_t sVar2;
  int iVar3;
  uint uVar4;
  size_t __n;
  undefined1 *puVar5;
  int iVar6;
  
  iVar6 = 0;
  if (param_3 < 1) {
    return 0;
  }
  do {
    sVar2 = param_1[3] - param_1[2];
    puVar5 = param_2;
    if (sVar2 != 0) {
      __n = param_3 - iVar6;
      if ((int)sVar2 < param_3 - iVar6) {
        __n = sVar2;
      }
      iVar6 = iVar6 + __n;
      memcpy(param_2,(void *)param_1[2],__n);
      param_1[2] = param_1[2] + __n;
      if (param_3 <= iVar6) {
        return iVar6;
      }
      puVar5 = param_2 + __n;
    }
    pcVar1 = *(code **)(*param_1 + 0x28);
    if (pcVar1 == FUN_001f1f70) {
      pcVar1 = *(code **)(*param_1 + 0x24);
      if (pcVar1 == FUN_001f1bb0) {
        return iVar6;
      }
      iVar3 = (*pcVar1)(param_1);
      if (iVar3 == -1) {
        return iVar6;
      }
      uVar4 = (uint)*(byte *)param_1[2];
      param_1[2] = (int)((byte *)param_1[2] + 1);
    }
    else {
      uVar4 = (*pcVar1)(param_1);
      if (uVar4 == 0xffffffff) {
        return iVar6;
      }
    }
    iVar6 = iVar6 + 1;
    param_2 = puVar5 + 1;
    *puVar5 = (char)uVar4;
    if (param_3 <= iVar6) {
      return iVar6;
    }
  } while( true );
}


CALL 0x000559e6
ADD EAX,0x19d03b
PUSH EBP
PUSH EDI
XOR EDI,EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV EDX,dword ptr [ESP + 0x38]
MOV EBP,dword ptr [ESP + 0x30]
MOV dword ptr [ESP + 0x4],EAX
MOV ECX,dword ptr [ESP + 0x34]
TEST EDX,EDX
JLE 0x001f203e
LEA EBX,[EAX + 0xffe62f70]
LEA EAX,[EAX + 0xffe62bb0]
MOV dword ptr [ESP + 0x8],EBX
MOV dword ptr [ESP + 0xc],EAX
LEA ESI,[ESI]
NOP
MOV EBX,dword ptr [EBP + 0x8]
MOV EAX,dword ptr [EBP + 0xc]
SUB EAX,EBX
JZ 0x001f2050
MOV ESI,EDX
MOV dword ptr [ESP + 0x38],EDX
SUB ESI,EDI
CMP ESI,EAX
CMOVG ESI,EAX
SUB ESP,0x4
PUSH ESI
ADD EDI,ESI
PUSH EBX
PUSH ECX
MOV EBX,dword ptr [ESP + 0x14]
MOV dword ptr [ESP + 0x44],ECX
CALL 0x000295c0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x38]
ADD dword ptr [EBP + 0x8],ESI
MOV ECX,dword ptr [ESP + 0x34]
CMP EDX,EDI
JG 0x001f20b8
ADD ESP,0x1c
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV ESI,ECX
MOV EAX,dword ptr [EBP]
MOV ECX,dword ptr [EAX + 0x28]
CMP ECX,dword ptr [ESP + 0x8]
JNZ 0x001f20a0
MOV EAX,dword ptr [EAX + 0x24]
CMP EAX,dword ptr [ESP + 0xc]
JZ 0x001f203e
MOV dword ptr [ESP + 0x38],EDX
SUB ESP,0xc
PUSH EBP
CALL EAX
ADD ESP,0x10
CMP EAX,-0x1
JZ 0x001f203e
MOV ECX,dword ptr [EBP + 0x8]
MOV EDX,dword ptr [ESP + 0x38]
MOVZX EAX,byte ptr [ECX]
ADD ECX,0x1
MOV dword ptr [EBP + 0x8],ECX
ADD EDI,0x1
LEA ECX,[ESI + 0x1]
MOV byte ptr [ESI],AL
CMP EDX,EDI
JG 0x001f2000
JMP 0x001f203e
MOV dword ptr [ESP + 0x38],EDX
SUB ESP,0xc
PUSH EBP
CALL ECX
ADD ESP,0x10
CMP EAX,-0x1
JZ 0x001f203e
MOV EDX,dword ptr [ESP + 0x38]
JMP 0x001f2089
ADD ESI,ECX
JMP 0x001f2052
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nint FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}\n\n" comment (function_definition "int FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" primitive_type (function_declarator "FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)" identifier (parameter_list "(int *param_1,undefined1 *param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" { (declaration "code *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );" do (compound_statement "{\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  }" { (expression_statement "sVar2 = param_1[3] - param_1[2];" (assignment_expression "sVar2 = param_1[3] - param_1[2]" identifier = (binary_expression "param_1[3] - param_1[2]" (subscript_expression "param_1[3]" identifier [ number_literal ]) - (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (expression_statement "puVar5 = param_2;" (assignment_expression "puVar5 = param_2" identifier = identifier) ;) (if_statement "if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }" { (expression_statement "__n = param_3 - iVar6;" (assignment_expression "__n = param_3 - iVar6" identifier = (binary_expression "param_3 - iVar6" identifier - identifier)) ;) (if_statement "if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }" if (parenthesized_expression "((int)sVar2 < param_3 - iVar6)" ( (binary_expression "(int)sVar2 < param_3 - iVar6" (cast_expression "(int)sVar2" ( (type_descriptor "int" primitive_type) ) identifier) < (binary_expression "param_3 - iVar6" identifier - identifier)) )) (compound_statement "{\n        __n = sVar2;\n      }" { (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" identifier = identifier) ;) })) (expression_statement "iVar6 = iVar6 + __n;" (assignment_expression "iVar6 = iVar6 + __n" identifier = (binary_expression "iVar6 + __n" identifier + identifier)) ;) (expression_statement "memcpy(param_2,(void *)param_1[2],__n);" (call_expression "memcpy(param_2,(void *)param_1[2],__n)" identifier (argument_list "(param_2,(void *)param_1[2],__n)" ( identifier , (cast_expression "(void *)param_1[2]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) , identifier ))) ;) (expression_statement "param_1[2] = param_1[2] + __n;" (assignment_expression "param_1[2] = param_1[2] + __n" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "param_1[2] + __n" (subscript_expression "param_1[2]" identifier [ number_literal ]) + identifier)) ;) (if_statement "if (param_3 <= iVar6) {\n        return iVar6;\n      }" if (parenthesized_expression "(param_3 <= iVar6)" ( (binary_expression "param_3 <= iVar6" identifier <= identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "puVar5 = param_2 + __n;" (assignment_expression "puVar5 = param_2 + __n" identifier = (binary_expression "param_2 + __n" identifier + identifier)) ;) })) (expression_statement "pcVar1 = *(code **)(*param_1 + 0x28);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x28)" identifier = (pointer_expression "*(code **)(*param_1 + 0x28)" * (cast_expression "(code **)(*param_1 + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x28)" ( (binary_expression "*param_1 + 0x28" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" if (parenthesized_expression "(pcVar1 == FUN_001f1f70)" ( (binary_expression "pcVar1 == FUN_001f1f70" identifier == identifier) )) (compound_statement "{\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }" { (expression_statement "pcVar1 = *(code **)(*param_1 + 0x24);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x24)" identifier = (pointer_expression "*(code **)(*param_1 + 0x24)" * (cast_expression "(code **)(*param_1 + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x24)" ( (binary_expression "*param_1 + 0x24" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }" if (parenthesized_expression "(pcVar1 == FUN_001f1bb0)" ( (binary_expression "pcVar1 == FUN_001f1bb0" identifier == identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar3 = (*pcVar1)(param_1);" (assignment_expression "iVar3 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar3 == -1) {\n        return iVar6;\n      }" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "uVar4 = (uint)*(byte *)param_1[2];" (assignment_expression "uVar4 = (uint)*(byte *)param_1[2]" identifier = (binary_expression "(uint)*(byte *)param_1[2]" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)param_1[2]" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])))) ;) (expression_statement "param_1[2] = (int)((byte *)param_1[2] + 1);" (assignment_expression "param_1[2] = (int)((byte *)param_1[2] + 1)" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)((byte *)param_1[2] + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((byte *)param_1[2] + 1)" ( (binary_expression "(byte *)param_1[2] + 1" (cast_expression "(byte *)param_1[2]" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) + number_literal) )))) ;) }) (else_clause "else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" else (compound_statement "{\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" { (expression_statement "uVar4 = (*pcVar1)(param_1);" (assignment_expression "uVar4 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) }))) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "param_2 = puVar5 + 1;" (assignment_expression "param_2 = puVar5 + 1" identifier = (binary_expression "puVar5 + 1" identifier + number_literal)) ;) (expression_statement "*puVar5 = (char)uVar4;" (assignment_expression "*puVar5 = (char)uVar4" (pointer_expression "*puVar5" * identifier) = (cast_expression "(char)uVar4" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (if_statement "if (param_3 <= iVar6) {\n      return iVar6;\n    }" if (parenthesized_expression "(param_3 <= iVar6)" ( (binary_expression "param_3 <= iVar6" identifier <= identifier) )) (compound_statement "{\n      return iVar6;\n    }" { (return_statement "return iVar6;" return identifier ;) })) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n/* std::streambuf::xsgetn(char*, int) */\n\nint __thiscall std::streambuf::xsgetn(streambuf *this,char *param_1,int param_2)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  char *pcVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);\n    pcVar5 = param_1;\n    if (sVar2 != 0) {\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }\n    else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_1 = pcVar5 + 1;\n    *pcVar5 = (char)uVar4;\n    if (param_2 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}\n\n" comment comment (function_definition "int __thiscall std::streambuf::xsgetn(streambuf *this,char *param_1,int param_2)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  char *pcVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);\n    pcVar5 = param_1;\n    if (sVar2 != 0) {\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }\n    else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_1 = pcVar5 + 1;\n    *pcVar5 = (char)uVar4;\n    if (param_2 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::streambuf::" identifier : : identifier : :) (function_declarator "xsgetn(streambuf *this,char *param_1,int param_2)" identifier (parameter_list "(streambuf *this,char *param_1,int param_2)" ( (parameter_declaration "streambuf *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  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  char *pcVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);\n    pcVar5 = param_1;\n    if (sVar2 != 0) {\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }\n    else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_1 = pcVar5 + 1;\n    *pcVar5 = (char)uVar4;\n    if (param_2 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" { (declaration "code *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "char *pcVar5;" primitive_type (pointer_declarator "*pcVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);\n    pcVar5 = param_1;\n    if (sVar2 != 0) {\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }\n    else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_1 = pcVar5 + 1;\n    *pcVar5 = (char)uVar4;\n    if (param_2 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );" do (compound_statement "{\n    sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);\n    pcVar5 = param_1;\n    if (sVar2 != 0) {\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }\n    else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_1 = pcVar5 + 1;\n    *pcVar5 = (char)uVar4;\n    if (param_2 <= iVar6) {\n      return iVar6;\n    }\n  }" { (expression_statement "sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8);" (assignment_expression "sVar2 = *(int *)(this + 0xc) - (int)*(void **)(this + 8)" identifier = (binary_expression "*(int *)(this + 0xc) - (int)*(void **)(this + 8)" (pointer_expression "*(int *)(this + 0xc)" * (cast_expression "(int *)(this + 0xc)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) - (cast_expression "(int)*(void **)(this + 8)" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*(void **)(this + 8)" * (cast_expression "(void **)(this + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))))) ;) (expression_statement "pcVar5 = param_1;" (assignment_expression "pcVar5 = param_1" identifier = identifier) ;) (if_statement "if (sVar2 != 0) {\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_2 - iVar6;\n      if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_1,*(void **)(this + 8),__n);\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n;\n      if (param_2 <= iVar6) {\n        return iVar6;\n      }\n      pcVar5 = param_1 + __n;\n    }" { (expression_statement "__n = param_2 - iVar6;" (assignment_expression "__n = param_2 - iVar6" identifier = (binary_expression "param_2 - iVar6" identifier - identifier)) ;) (if_statement "if ((int)sVar2 < param_2 - iVar6) {\n        __n = sVar2;\n      }" if (parenthesized_expression "((int)sVar2 < param_2 - iVar6)" ( (binary_expression "(int)sVar2 < param_2 - iVar6" (cast_expression "(int)sVar2" ( (type_descriptor "int" primitive_type) ) identifier) < (binary_expression "param_2 - iVar6" identifier - identifier)) )) (compound_statement "{\n        __n = sVar2;\n      }" { (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" identifier = identifier) ;) })) (expression_statement "iVar6 = iVar6 + __n;" (assignment_expression "iVar6 = iVar6 + __n" identifier = (binary_expression "iVar6 + __n" identifier + identifier)) ;) (expression_statement "memcpy(param_1,*(void **)(this + 8),__n);" (call_expression "memcpy(param_1,*(void **)(this + 8),__n)" identifier (argument_list "(param_1,*(void **)(this + 8),__n)" ( identifier , (pointer_expression "*(void **)(this + 8)" * (cast_expression "(void **)(this + 8)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) , identifier ))) ;) (expression_statement "*(size_t *)(this + 8) = *(int *)(this + 8) + __n;" (assignment_expression "*(size_t *)(this + 8) = *(int *)(this + 8) + __n" (pointer_expression "*(size_t *)(this + 8)" * (cast_expression "(size_t *)(this + 8)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(this + 8) + __n" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + identifier)) ;) (if_statement "if (param_2 <= iVar6) {\n        return iVar6;\n      }" if (parenthesized_expression "(param_2 <= iVar6)" ( (binary_expression "param_2 <= iVar6" identifier <= identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "pcVar5 = param_1 + __n;" (assignment_expression "pcVar5 = param_1 + __n" identifier = (binary_expression "param_1 + __n" identifier + identifier)) ;) })) (expression_statement "pcVar1 = *(code **)(*(int *)this + 0x28);" (assignment_expression "pcVar1 = *(code **)(*(int *)this + 0x28)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x28)" * (cast_expression "(code **)(*(int *)this + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x28)" ( (binary_expression "*(int *)this + 0x28" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }\n    else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" if (parenthesized_expression "(pcVar1 == uflow)" ( (binary_expression "pcVar1 == uflow" identifier == identifier) )) (compound_statement "{\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(this);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)**(byte **)(this + 8);\n      *(byte **)(this + 8) = *(byte **)(this + 8) + 1;\n    }" { (expression_statement "pcVar1 = *(code **)(*(int *)this + 0x24);" (assignment_expression "pcVar1 = *(code **)(*(int *)this + 0x24)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x24)" * (cast_expression "(code **)(*(int *)this + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x24)" ( (binary_expression "*(int *)this + 0x24" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar1 == underflow) {\n        return iVar6;\n      }" if (parenthesized_expression "(pcVar1 == underflow)" ( (binary_expression "pcVar1 == underflow" identifier == identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar3 = (*pcVar1)(this);" (assignment_expression "iVar3 = (*pcVar1)(this)" identifier = (call_expression "(*pcVar1)(this)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (iVar3 == -1) {\n        return iVar6;\n      }" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "uVar4 = (uint)**(byte **)(this + 8);" (assignment_expression "uVar4 = (uint)**(byte **)(this + 8)" identifier = (binary_expression "(uint)**(byte **)(this + 8)" (parenthesized_expression "(uint)" ( identifier )) * (pointer_expression "*(byte **)(this + 8)" * (cast_expression "(byte **)(this + 8)" ( (type_descriptor "byte **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))))) ;) (expression_statement "*(byte **)(this + 8) = *(byte **)(this + 8) + 1;" (assignment_expression "*(byte **)(this + 8) = *(byte **)(this + 8) + 1" (pointer_expression "*(byte **)(this + 8)" * (cast_expression "(byte **)(this + 8)" ( (type_descriptor "byte **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(byte **)(this + 8) + 1" (pointer_expression "*(byte **)(this + 8)" * (cast_expression "(byte **)(this + 8)" ( (type_descriptor "byte **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + number_literal)) ;) }) (else_clause "else {\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" else (compound_statement "{\n      uVar4 = (*pcVar1)(this);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" { (expression_statement "uVar4 = (*pcVar1)(this);" (assignment_expression "uVar4 = (*pcVar1)(this)" identifier = (call_expression "(*pcVar1)(this)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) }))) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "param_1 = pcVar5 + 1;" (assignment_expression "param_1 = pcVar5 + 1" identifier = (binary_expression "pcVar5 + 1" identifier + number_literal)) ;) (expression_statement "*pcVar5 = (char)uVar4;" (assignment_expression "*pcVar5 = (char)uVar4" (pointer_expression "*pcVar5" * identifier) = (cast_expression "(char)uVar4" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (if_statement "if (param_2 <= iVar6) {\n      return iVar6;\n    }" if (parenthesized_expression "(param_2 <= iVar6)" ( (binary_expression "param_2 <= iVar6" identifier <= identifier) )) (compound_statement "{\n      return iVar6;\n    }" { (return_statement "return iVar6;" return identifier ;) })) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit "int FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}\n\n" (function_definition "int FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" primitive_type (function_declarator "FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)" identifier (parameter_list "(int *param_1,undefined1 *param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" { (declaration "code *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );" do (compound_statement "{\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  }" { (expression_statement "sVar2 = param_1[3] - param_1[2];" (assignment_expression "sVar2 = param_1[3] - param_1[2]" identifier = (binary_expression "param_1[3] - param_1[2]" (subscript_expression "param_1[3]" identifier [ number_literal ]) - (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (expression_statement "puVar5 = param_2;" (assignment_expression "puVar5 = param_2" identifier = identifier) ;) (if_statement "if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }" { (expression_statement "__n = param_3 - iVar6;" (assignment_expression "__n = param_3 - iVar6" identifier = (binary_expression "param_3 - iVar6" identifier - identifier)) ;) (if_statement "if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }" if (parenthesized_expression "((int)sVar2 < param_3 - iVar6)" ( (binary_expression "(int)sVar2 < param_3 - iVar6" (cast_expression "(int)sVar2" ( (type_descriptor "int" primitive_type) ) identifier) < (binary_expression "param_3 - iVar6" identifier - identifier)) )) (compound_statement "{\n        __n = sVar2;\n      }" { (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" identifier = identifier) ;) })) (expression_statement "iVar6 = iVar6 + __n;" (assignment_expression "iVar6 = iVar6 + __n" identifier = (binary_expression "iVar6 + __n" identifier + identifier)) ;) (expression_statement "memcpy(param_2,(void *)param_1[2],__n);" (call_expression "memcpy(param_2,(void *)param_1[2],__n)" identifier (argument_list "(param_2,(void *)param_1[2],__n)" ( identifier , (cast_expression "(void *)param_1[2]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) , identifier ))) ;) (expression_statement "param_1[2] = param_1[2] + __n;" (assignment_expression "param_1[2] = param_1[2] + __n" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "param_1[2] + __n" (subscript_expression "param_1[2]" identifier [ number_literal ]) + identifier)) ;) (if_statement "if (param_3 <= iVar6) {\n        return iVar6;\n      }" if (parenthesized_expression "(param_3 <= iVar6)" ( (binary_expression "param_3 <= iVar6" identifier <= identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "puVar5 = param_2 + __n;" (assignment_expression "puVar5 = param_2 + __n" identifier = (binary_expression "param_2 + __n" identifier + identifier)) ;) })) (expression_statement "pcVar1 = *(code **)(*param_1 + 0x28);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x28)" identifier = (pointer_expression "*(code **)(*param_1 + 0x28)" * (cast_expression "(code **)(*param_1 + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x28)" ( (binary_expression "*param_1 + 0x28" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" if (parenthesized_expression "(pcVar1 == FUN_001f1f70)" ( (binary_expression "pcVar1 == FUN_001f1f70" identifier == identifier) )) (compound_statement "{\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }" { (expression_statement "pcVar1 = *(code **)(*param_1 + 0x24);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x24)" identifier = (pointer_expression "*(code **)(*param_1 + 0x24)" * (cast_expression "(code **)(*param_1 + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x24)" ( (binary_expression "*param_1 + 0x24" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }" if (parenthesized_expression "(pcVar1 == FUN_001f1bb0)" ( (binary_expression "pcVar1 == FUN_001f1bb0" identifier == identifier) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "iVar3 = (*pcVar1)(param_1);" (assignment_expression "iVar3 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar3 == -1) {\n        return iVar6;\n      }" if (parenthesized_expression "(iVar3 == -1)" ( (binary_expression "iVar3 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) (expression_statement "uVar4 = (uint)*(byte *)param_1[2];" (assignment_expression "uVar4 = (uint)*(byte *)param_1[2]" identifier = (binary_expression "(uint)*(byte *)param_1[2]" (parenthesized_expression "(uint)" ( identifier )) * (cast_expression "(byte *)param_1[2]" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])))) ;) (expression_statement "param_1[2] = (int)((byte *)param_1[2] + 1);" (assignment_expression "param_1[2] = (int)((byte *)param_1[2] + 1)" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)((byte *)param_1[2] + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((byte *)param_1[2] + 1)" ( (binary_expression "(byte *)param_1[2] + 1" (cast_expression "(byte *)param_1[2]" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) + number_literal) )))) ;) }) (else_clause "else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" else (compound_statement "{\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" { (expression_statement "uVar4 = (*pcVar1)(param_1);" (assignment_expression "uVar4 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }" if (parenthesized_expression "(uVar4 == 0xffffffff)" ( (binary_expression "uVar4 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        return iVar6;\n      }" { (return_statement "return iVar6;" return identifier ;) })) }))) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) (expression_statement "param_2 = puVar5 + 1;" (assignment_expression "param_2 = puVar5 + 1" identifier = (binary_expression "puVar5 + 1" identifier + number_literal)) ;) (expression_statement "*puVar5 = (char)uVar4;" (assignment_expression "*puVar5 = (char)uVar4" (pointer_expression "*puVar5" * identifier) = (cast_expression "(char)uVar4" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (if_statement "if (param_3 <= iVar6) {\n      return iVar6;\n    }" if (parenthesized_expression "(param_3 <= iVar6)" ( (binary_expression "param_3 <= iVar6" identifier <= identifier) )) (compound_statement "{\n      return iVar6;\n    }" { (return_statement "return iVar6;" return identifier ;) })) }) while (parenthesized_expression "( true )" ( true )) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (subscript_expression IDENT [ LIT ]))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < (binary_expression IDENT - IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) , IDENT ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_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 (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( IDENT )) * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) + LIT) )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return IDENT ;) })) }) while (parenthesized_expression ( BOOL )) ;) })))
(function_definition "int FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" (primitive_type "int") (function_declarator "FUN_001f1fc0(int *param_1,undefined1 *param_2,int param_3)" (identifier "FUN_001f1fc0") (parameter_list "(int *param_1,undefined1 *param_2,int param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined1 *param_2" (type_identifier "undefined1") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  code *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  uint uVar4;\n  size_t __n;\n  undefined1 *puVar5;\n  int iVar6;\n  \n  iVar6 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );\n}" ({ "{") (declaration "code *pcVar1;" (type_identifier "code") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "undefined1 *puVar5;" (type_identifier "undefined1") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" (identifier "iVar6") (= "=") (number_literal "0")) (; ";")) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_3 < 1)" (( "(") (binary_expression "param_3 < 1" (identifier "param_3") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (do_statement "do {\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  } while( true );" (do "do") (compound_statement "{\n    sVar2 = param_1[3] - param_1[2];\n    puVar5 = param_2;\n    if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }\n    iVar6 = iVar6 + 1;\n    param_2 = puVar5 + 1;\n    *puVar5 = (char)uVar4;\n    if (param_3 <= iVar6) {\n      return iVar6;\n    }\n  }" ({ "{") (expression_statement "sVar2 = param_1[3] - param_1[2];" (assignment_expression "sVar2 = param_1[3] - param_1[2]" (identifier "sVar2") (= "=") (binary_expression "param_1[3] - param_1[2]" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (- "-") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")))) (; ";")) (expression_statement "puVar5 = param_2;" (assignment_expression "puVar5 = param_2" (identifier "puVar5") (= "=") (identifier "param_2")) (; ";")) (if_statement "if (sVar2 != 0) {\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }" (if "if") (parenthesized_expression "(sVar2 != 0)" (( "(") (binary_expression "sVar2 != 0" (identifier "sVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      __n = param_3 - iVar6;\n      if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }\n      iVar6 = iVar6 + __n;\n      memcpy(param_2,(void *)param_1[2],__n);\n      param_1[2] = param_1[2] + __n;\n      if (param_3 <= iVar6) {\n        return iVar6;\n      }\n      puVar5 = param_2 + __n;\n    }" ({ "{") (expression_statement "__n = param_3 - iVar6;" (assignment_expression "__n = param_3 - iVar6" (identifier "__n") (= "=") (binary_expression "param_3 - iVar6" (identifier "param_3") (- "-") (identifier "iVar6"))) (; ";")) (if_statement "if ((int)sVar2 < param_3 - iVar6) {\n        __n = sVar2;\n      }" (if "if") (parenthesized_expression "((int)sVar2 < param_3 - iVar6)" (( "(") (binary_expression "(int)sVar2 < param_3 - iVar6" (cast_expression "(int)sVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar2")) (< "<") (binary_expression "param_3 - iVar6" (identifier "param_3") (- "-") (identifier "iVar6"))) () ")")) (compound_statement "{\n        __n = sVar2;\n      }" ({ "{") (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" (identifier "__n") (= "=") (identifier "sVar2")) (; ";")) (} "}"))) (expression_statement "iVar6 = iVar6 + __n;" (assignment_expression "iVar6 = iVar6 + __n" (identifier "iVar6") (= "=") (binary_expression "iVar6 + __n" (identifier "iVar6") (+ "+") (identifier "__n"))) (; ";")) (expression_statement "memcpy(param_2,(void *)param_1[2],__n);" (call_expression "memcpy(param_2,(void *)param_1[2],__n)" (identifier "memcpy") (argument_list "(param_2,(void *)param_1[2],__n)" (( "(") (identifier "param_2") (, ",") (cast_expression "(void *)param_1[2]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "param_1[2] = param_1[2] + __n;" (assignment_expression "param_1[2] = param_1[2] + __n" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "param_1[2] + __n" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (+ "+") (identifier "__n"))) (; ";")) (if_statement "if (param_3 <= iVar6) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(param_3 <= iVar6)" (( "(") (binary_expression "param_3 <= iVar6" (identifier "param_3") (<= "<=") (identifier "iVar6")) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "puVar5 = param_2 + __n;" (assignment_expression "puVar5 = param_2 + __n" (identifier "puVar5") (= "=") (binary_expression "param_2 + __n" (identifier "param_2") (+ "+") (identifier "__n"))) (; ";")) (} "}"))) (expression_statement "pcVar1 = *(code **)(*param_1 + 0x28);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x28)" (identifier "pcVar1") (= "=") (pointer_expression "*(code **)(*param_1 + 0x28)" (* "*") (cast_expression "(code **)(*param_1 + 0x28)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x28)" (( "(") (binary_expression "*param_1 + 0x28" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (pcVar1 == FUN_001f1f70) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }\n    else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" (if "if") (parenthesized_expression "(pcVar1 == FUN_001f1f70)" (( "(") (binary_expression "pcVar1 == FUN_001f1f70" (identifier "pcVar1") (== "==") (identifier "FUN_001f1f70")) () ")")) (compound_statement "{\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }\n      iVar3 = (*pcVar1)(param_1);\n      if (iVar3 == -1) {\n        return iVar6;\n      }\n      uVar4 = (uint)*(byte *)param_1[2];\n      param_1[2] = (int)((byte *)param_1[2] + 1);\n    }" ({ "{") (expression_statement "pcVar1 = *(code **)(*param_1 + 0x24);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x24)" (identifier "pcVar1") (= "=") (pointer_expression "*(code **)(*param_1 + 0x24)" (* "*") (cast_expression "(code **)(*param_1 + 0x24)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x24)" (( "(") (binary_expression "*param_1 + 0x24" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x24")) () ")"))))) (; ";")) (if_statement "if (pcVar1 == FUN_001f1bb0) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(pcVar1 == FUN_001f1bb0)" (( "(") (binary_expression "pcVar1 == FUN_001f1bb0" (identifier "pcVar1") (== "==") (identifier "FUN_001f1bb0")) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "iVar3 = (*pcVar1)(param_1);" (assignment_expression "iVar3 = (*pcVar1)(param_1)" (identifier "iVar3") (= "=") (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" (( "(") (pointer_expression "*pcVar1" (* "*") (identifier "pcVar1")) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar3 == -1) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(iVar3 == -1)" (( "(") (binary_expression "iVar3 == -1" (identifier "iVar3") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (expression_statement "uVar4 = (uint)*(byte *)param_1[2];" (assignment_expression "uVar4 = (uint)*(byte *)param_1[2]" (identifier "uVar4") (= "=") (binary_expression "(uint)*(byte *)param_1[2]" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (cast_expression "(byte *)param_1[2]" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))))) (; ";")) (expression_statement "param_1[2] = (int)((byte *)param_1[2] + 1);" (assignment_expression "param_1[2] = (int)((byte *)param_1[2] + 1)" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (cast_expression "(int)((byte *)param_1[2] + 1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "((byte *)param_1[2] + 1)" (( "(") (binary_expression "(byte *)param_1[2] + 1" (cast_expression "(byte *)param_1[2]" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (+ "+") (number_literal "1")) () ")")))) (; ";")) (} "}")) (else_clause "else {\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" (else "else") (compound_statement "{\n      uVar4 = (*pcVar1)(param_1);\n      if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }\n    }" ({ "{") (expression_statement "uVar4 = (*pcVar1)(param_1);" (assignment_expression "uVar4 = (*pcVar1)(param_1)" (identifier "uVar4") (= "=") (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" (( "(") (pointer_expression "*pcVar1" (* "*") (identifier "pcVar1")) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (uVar4 == 0xffffffff) {\n        return iVar6;\n      }" (if "if") (parenthesized_expression "(uVar4 == 0xffffffff)" (( "(") (binary_expression "uVar4 == 0xffffffff" (identifier "uVar4") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n        return iVar6;\n      }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (} "}")))) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" (identifier "iVar6") (= "=") (binary_expression "iVar6 + 1" (identifier "iVar6") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "param_2 = puVar5 + 1;" (assignment_expression "param_2 = puVar5 + 1" (identifier "param_2") (= "=") (binary_expression "puVar5 + 1" (identifier "puVar5") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*puVar5 = (char)uVar4;" (assignment_expression "*puVar5 = (char)uVar4" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (cast_expression "(char)uVar4" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "uVar4"))) (; ";")) (if_statement "if (param_3 <= iVar6) {\n      return iVar6;\n    }" (if "if") (parenthesized_expression "(param_3 <= iVar6)" (( "(") (binary_expression "param_3 <= iVar6" (identifier "param_3") (<= "<=") (identifier "iVar6")) () ")")) (compound_statement "{\n      return iVar6;\n    }" ({ "{") (return_statement "return iVar6;" (return "return") (identifier "iVar6") (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */
/* std::streambuf::xsgetn(char*, int) */

int __thiscall std::type_1::function_1(type_1 *var_2,char *var_7,int var_1)

{
  type_2 *var_8;
  size_t var_3;
  int var_11;
  type_3 var_12;
  size_t var_5;
  char *var_13;
  int var_4;
  
  var_4 = 0;
  if (var_1 < 1) {
    return 0;
  }
  do {
    var_3 = *(int *)(var_2 + 0xc) - (int)*(void **)(var_2 + 8);
    var_13 = var_7;
    if (var_3 != 0) {
      var_5 = var_1 - var_4;
      if ((int)var_3 < var_1 - var_4) {
        var_5 = var_3;
      }
      var_4 = var_4 + var_5;
      var_6(var_7,*(void **)(var_2 + 8),var_5);
      *(size_t *)(var_2 + 8) = *(int *)(var_2 + 8) + var_5;
      if (var_1 <= var_4) {
        return var_4;
      }
      var_13 = var_7 + var_5;
    }
    var_8 = *(type_2 **)(*(int *)var_2 + 0x28);
    if (var_8 == var_9) {
      var_8 = *(type_2 **)(*(int *)var_2 + 0x24);
      if (var_8 == var_10) {
        return var_4;
      }
      var_11 = (*var_8)(var_2);
      if (var_11 == -1) {
        return var_4;
      }
      var_12 = (type_3)**(type_4 **)(var_2 + 8);
      *(type_4 **)(var_2 + 8) = *(type_4 **)(var_2 + 8) + 1;
    }
    else {
      var_12 = (*var_8)(var_2);
      if (var_12 == 0xffffffff) {
        return var_4;
      }
    }
    var_4 = var_4 + 1;
    var_7 = var_13 + 1;
    *var_13 = (char)var_12;
    if (var_1 <= var_4) {
      return var_4;
    }
  } while( true );
}


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

/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */

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

{
  code *pcVar1;
  size_t sVar2;
  int iVar3;
  uint uVar4;
  size_t __n;
  undefined1 *puVar5;
  int iVar6;
  
  iVar6 = 0;
  if (param_3 < 1) {
    return 0;
  }
  do {
    sVar2 = param_1[3] - param_1[2];
    puVar5 = param_2;
    if (sVar2 != 0) {
      __n = param_3 - iVar6;
      if ((int)sVar2 < param_3 - iVar6) {
        __n = sVar2;
      }
      iVar6 = iVar6 + __n;
      memcpy(param_2,(void *)param_1[2],__n);
      param_1[2] = param_1[2] + __n;
      if (param_3 <= iVar6) {
        return iVar6;
      }
      puVar5 = param_2 + __n;
    }
    pcVar1 = *(code **)(*param_1 + 0x28);
    if (pcVar1 == FUN_001f1f70) {
      pcVar1 = *(code **)(*param_1 + 0x24);
      if (pcVar1 == FUN_001f1bb0) {
        return iVar6;
      }
      iVar3 = (*pcVar1)(param_1);
      if (iVar3 == -1) {
        return iVar6;
      }
      uVar4 = (uint)*(byte *)param_1[2];
      param_1[2] = (int)((byte *)param_1[2] + 1);
    }
    else {
      uVar4 = (*pcVar1)(param_1);
      if (uVar4 == 0xffffffff) {
        return iVar6;
      }
    }
    iVar6 = iVar6 + 1;
    param_2 = puVar5 + 1;
    *puVar5 = (char)uVar4;
    if (param_3 <= iVar6) {
      return iVar6;
    }
  } while( true );
}

