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

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

{
  size_t sVar1;
  int iVar2;
  size_t __n;
  int iVar3;
  
  if (param_2 < 1) {
    return 0;
  }
  iVar3 = 0;
  while( true ) {
    sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);
    if (sVar1 != 0) {
      __n = param_2 - iVar3;
      if ((int)sVar1 < param_2 - iVar3) {
        __n = sVar1;
      }
      memcpy(*(void **)(this + 0x14),param_1,__n);
      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;
      iVar3 = iVar3 + __n;
      if (param_2 <= iVar3) {
        return iVar3;
      }
      param_1 = param_1 + __n;
    }
    if (*(code **)(*(int *)this + 0x34) == overflow) {
      return iVar3;
    }
    iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);
    if (iVar2 == -1) break;
    iVar3 = iVar3 + 1;
    param_1 = param_1 + 1;
    if (param_2 <= iVar3) {
      return iVar3;
    }
  }
  return iVar3;
}



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

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

{
  size_t sVar1;
  int iVar2;
  size_t __n;
  int iVar3;
  
  if (param_3 < 1) {
    return 0;
  }
  iVar3 = 0;
  while( true ) {
    sVar1 = param_1[6] - param_1[5];
    if (sVar1 != 0) {
      __n = param_3 - iVar3;
      if ((int)sVar1 < param_3 - iVar3) {
        __n = sVar1;
      }
      memcpy((void *)param_1[5],param_2,__n);
      param_1[5] = param_1[5] + __n;
      iVar3 = iVar3 + __n;
      if (param_3 <= iVar3) {
        return iVar3;
      }
      param_2 = param_2 + __n;
    }
    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {
      return iVar3;
    }
    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);
    if (iVar2 == -1) break;
    iVar3 = iVar3 + 1;
    param_2 = param_2 + 1;
    if (param_3 <= iVar3) {
      return iVar3;
    }
  }
  return iVar3;
}


CALL 0x000559e6
ADD EAX,0x19d26b
PUSH EBP
PUSH EDI
PUSH ESI
XOR ESI,ESI
PUSH EBX
SUB ESP,0x1c
MOV EDX,dword ptr [ESP + 0x38]
MOV EDI,dword ptr [ESP + 0x30]
MOV dword ptr [ESP + 0x8],EAX
MOV EBP,dword ptr [ESP + 0x34]
TEST EDX,EDX
JLE 0x001f1e06
LEA EAX,[EAX + 0xffe62bd0]
MOV dword ptr [ESP + 0xc],EAX
LEA ESI,[ESI]
MOV EBX,dword ptr [EDI + 0x14]
MOV EAX,dword ptr [EDI + 0x18]
SUB EAX,EBX
JZ 0x001f1e18
MOV ECX,EDX
MOV dword ptr [ESP + 0x38],EDX
SUB ECX,ESI
CMP ECX,EAX
CMOVG ECX,EAX
SUB ESP,0x4
PUSH ECX
MOV dword ptr [ESP + 0xc],ECX
PUSH EBP
PUSH EBX
MOV EBX,dword ptr [ESP + 0x18]
CALL 0x000295c0
MOV ECX,dword ptr [ESP + 0x14]
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x38]
ADD dword ptr [EDI + 0x14],ECX
ADD ESI,ECX
CMP EDX,ESI
JG 0x001f1e10
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
ADD EBP,ECX
LEA ESI,[ESI]
MOV EAX,dword ptr [EDI]
MOV EAX,dword ptr [EAX + 0x34]
CMP EAX,dword ptr [ESP + 0xc]
JZ 0x001f1e06
MOVZX ECX,byte ptr [EBP]
MOV dword ptr [ESP + 0x38],EDX
SUB ESP,0x8
PUSH ECX
PUSH EDI
CALL EAX
ADD ESP,0x10
CMP EAX,-0x1
JZ 0x001f1e06
MOV EDX,dword ptr [ESP + 0x38]
ADD ESI,0x1
ADD EBP,0x1
CMP EDX,ESI
JG 0x001f1dc8
JMP 0x001f1e06
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nint FUN_001f1d90(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}\n\n" comment (function_definition "int FUN_001f1d90(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_001f1d90(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  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (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 ;) })) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }" { (expression_statement "sVar1 = param_1[6] - param_1[5];" (assignment_expression "sVar1 = param_1[6] - param_1[5]" identifier = (binary_expression "param_1[6] - param_1[5]" (subscript_expression "param_1[6]" identifier [ number_literal ]) - (subscript_expression "param_1[5]" identifier [ number_literal ]))) ;) (if_statement "if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "__n = param_3 - iVar3;" (assignment_expression "__n = param_3 - iVar3" identifier = (binary_expression "param_3 - iVar3" identifier - identifier)) ;) (if_statement "if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }" if (parenthesized_expression "((int)sVar1 < param_3 - iVar3)" ( (binary_expression "(int)sVar1 < param_3 - iVar3" (cast_expression "(int)sVar1" ( (type_descriptor "int" primitive_type) ) identifier) < (binary_expression "param_3 - iVar3" identifier - identifier)) )) (compound_statement "{\n        __n = sVar1;\n      }" { (expression_statement "__n = sVar1;" (assignment_expression "__n = sVar1" identifier = identifier) ;) })) (expression_statement "memcpy((void *)param_1[5],param_2,__n);" (call_expression "memcpy((void *)param_1[5],param_2,__n)" identifier (argument_list "((void *)param_1[5],param_2,__n)" ( (cast_expression "(void *)param_1[5]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ])) , identifier , identifier ))) ;) (expression_statement "param_1[5] = param_1[5] + __n;" (assignment_expression "param_1[5] = param_1[5] + __n" (subscript_expression "param_1[5]" identifier [ number_literal ]) = (binary_expression "param_1[5] + __n" (subscript_expression "param_1[5]" identifier [ number_literal ]) + identifier)) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (if_statement "if (param_3 <= iVar3) {\n        return iVar3;\n      }" if (parenthesized_expression "(param_3 <= iVar3)" ( (binary_expression "param_3 <= iVar3" identifier <= identifier) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "param_2 = param_2 + __n;" (assignment_expression "param_2 = param_2 + __n" identifier = (binary_expression "param_2 + __n" identifier + identifier)) ;) })) (if_statement "if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }" if (parenthesized_expression "(*(code **)(*param_1 + 0x34) == FUN_001f1bd0)" ( (binary_expression "*(code **)(*param_1 + 0x34) == FUN_001f1bd0" (pointer_expression "*(code **)(*param_1 + 0x34)" * (cast_expression "(code **)(*param_1 + 0x34)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x34)" ( (binary_expression "*param_1 + 0x34" (pointer_expression "*param_1" * identifier) + number_literal) )))) == identifier) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2)" identifier = (call_expression "(**(code **)(*param_1 + 0x34))(param_1,*param_2)" (parenthesized_expression "(**(code **)(*param_1 + 0x34))" ( (pointer_expression "**(code **)(*param_1 + 0x34)" * (pointer_expression "*(code **)(*param_1 + 0x34)" * (cast_expression "(code **)(*param_1 + 0x34)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x34)" ( (binary_expression "*param_1 + 0x34" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,*param_2)" ( identifier , (pointer_expression "*param_2" * identifier) )))) ;) (if_statement "if (iVar2 == -1) break;" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (if_statement "if (param_3 <= iVar3) {\n      return iVar3;\n    }" if (parenthesized_expression "(param_3 <= iVar3)" ( (binary_expression "param_3 <= iVar3" identifier <= identifier) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n/* std::streambuf::xsputn(char const*, int) */\n\nint __thiscall std::streambuf::xsputn(streambuf *this,char *param_1,int param_2)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);\n    if (sVar1 != 0) {\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(int *)this + 0x34) == overflow) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}\n\n" comment comment (function_definition "int __thiscall std::streambuf::xsputn(streambuf *this,char *param_1,int param_2)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);\n    if (sVar1 != 0) {\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(int *)this + 0x34) == overflow) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::streambuf::" identifier : : identifier : :) (function_declarator "xsputn(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  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_2 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);\n    if (sVar1 != 0) {\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(int *)this + 0x34) == overflow) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (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 ;) })) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);\n    if (sVar1 != 0) {\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(int *)this + 0x34) == overflow) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= iVar3) {\n      return iVar3;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);\n    if (sVar1 != 0) {\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(int *)this + 0x34) == overflow) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= iVar3) {\n      return iVar3;\n    }\n  }" { (expression_statement "sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14);" (assignment_expression "sVar1 = *(int *)(this + 0x18) - (int)*(void **)(this + 0x14)" identifier = (binary_expression "*(int *)(this + 0x18) - (int)*(void **)(this + 0x14)" (pointer_expression "*(int *)(this + 0x18)" * (cast_expression "(int *)(this + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) )))) - (cast_expression "(int)*(void **)(this + 0x14)" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*(void **)(this + 0x14)" * (cast_expression "(void **)(this + 0x14)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x14)" ( (binary_expression "this + 0x14" identifier + number_literal) ))))))) ;) (if_statement "if (sVar1 != 0) {\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_2 - iVar3;\n      if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy(*(void **)(this + 0x14),param_1,__n);\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;\n      iVar3 = iVar3 + __n;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }" { (expression_statement "__n = param_2 - iVar3;" (assignment_expression "__n = param_2 - iVar3" identifier = (binary_expression "param_2 - iVar3" identifier - identifier)) ;) (if_statement "if ((int)sVar1 < param_2 - iVar3) {\n        __n = sVar1;\n      }" if (parenthesized_expression "((int)sVar1 < param_2 - iVar3)" ( (binary_expression "(int)sVar1 < param_2 - iVar3" (cast_expression "(int)sVar1" ( (type_descriptor "int" primitive_type) ) identifier) < (binary_expression "param_2 - iVar3" identifier - identifier)) )) (compound_statement "{\n        __n = sVar1;\n      }" { (expression_statement "__n = sVar1;" (assignment_expression "__n = sVar1" identifier = identifier) ;) })) (expression_statement "memcpy(*(void **)(this + 0x14),param_1,__n);" (call_expression "memcpy(*(void **)(this + 0x14),param_1,__n)" identifier (argument_list "(*(void **)(this + 0x14),param_1,__n)" ( (pointer_expression "*(void **)(this + 0x14)" * (cast_expression "(void **)(this + 0x14)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x14)" ( (binary_expression "this + 0x14" identifier + number_literal) )))) , identifier , identifier ))) ;) (expression_statement "*(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n;" (assignment_expression "*(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n" (pointer_expression "*(size_t *)(this + 0x14)" * (cast_expression "(size_t *)(this + 0x14)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x14)" ( (binary_expression "this + 0x14" identifier + number_literal) )))) = (binary_expression "*(int *)(this + 0x14) + __n" (pointer_expression "*(int *)(this + 0x14)" * (cast_expression "(int *)(this + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x14)" ( (binary_expression "this + 0x14" identifier + number_literal) )))) + identifier)) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (if_statement "if (param_2 <= iVar3) {\n        return iVar3;\n      }" if (parenthesized_expression "(param_2 <= iVar3)" ( (binary_expression "param_2 <= iVar3" identifier <= identifier) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "param_1 = param_1 + __n;" (assignment_expression "param_1 = param_1 + __n" identifier = (binary_expression "param_1 + __n" identifier + identifier)) ;) })) (if_statement "if (*(code **)(*(int *)this + 0x34) == overflow) {\n      return iVar3;\n    }" if (parenthesized_expression "(*(code **)(*(int *)this + 0x34) == overflow)" ( (binary_expression "*(code **)(*(int *)this + 0x34) == overflow" (pointer_expression "*(code **)(*(int *)this + 0x34)" * (cast_expression "(code **)(*(int *)this + 0x34)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x34)" ( (binary_expression "*(int *)this + 0x34" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) )))) == identifier) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1);" (assignment_expression "iVar2 = (**(code **)(*(int *)this + 0x34))(this,*param_1)" identifier = (call_expression "(**(code **)(*(int *)this + 0x34))(this,*param_1)" (parenthesized_expression "(**(code **)(*(int *)this + 0x34))" ( (pointer_expression "**(code **)(*(int *)this + 0x34)" * (pointer_expression "*(code **)(*(int *)this + 0x34)" * (cast_expression "(code **)(*(int *)this + 0x34)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x34)" ( (binary_expression "*(int *)this + 0x34" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) )) (argument_list "(this,*param_1)" ( identifier , (pointer_expression "*param_1" * identifier) )))) ;) (if_statement "if (iVar2 == -1) break;" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (if_statement "if (param_2 <= iVar3) {\n      return iVar3;\n    }" if (parenthesized_expression "(param_2 <= iVar3)" ( (binary_expression "param_2 <= iVar3" identifier <= identifier) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(translation_unit "int FUN_001f1d90(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}\n\n" (function_definition "int FUN_001f1d90(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" primitive_type (function_declarator "FUN_001f1d90(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  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (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 ;) })) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }" { (expression_statement "sVar1 = param_1[6] - param_1[5];" (assignment_expression "sVar1 = param_1[6] - param_1[5]" identifier = (binary_expression "param_1[6] - param_1[5]" (subscript_expression "param_1[6]" identifier [ number_literal ]) - (subscript_expression "param_1[5]" identifier [ number_literal ]))) ;) (if_statement "if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "(sVar1 != 0)" ( (binary_expression "sVar1 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "__n = param_3 - iVar3;" (assignment_expression "__n = param_3 - iVar3" identifier = (binary_expression "param_3 - iVar3" identifier - identifier)) ;) (if_statement "if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }" if (parenthesized_expression "((int)sVar1 < param_3 - iVar3)" ( (binary_expression "(int)sVar1 < param_3 - iVar3" (cast_expression "(int)sVar1" ( (type_descriptor "int" primitive_type) ) identifier) < (binary_expression "param_3 - iVar3" identifier - identifier)) )) (compound_statement "{\n        __n = sVar1;\n      }" { (expression_statement "__n = sVar1;" (assignment_expression "__n = sVar1" identifier = identifier) ;) })) (expression_statement "memcpy((void *)param_1[5],param_2,__n);" (call_expression "memcpy((void *)param_1[5],param_2,__n)" identifier (argument_list "((void *)param_1[5],param_2,__n)" ( (cast_expression "(void *)param_1[5]" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ])) , identifier , identifier ))) ;) (expression_statement "param_1[5] = param_1[5] + __n;" (assignment_expression "param_1[5] = param_1[5] + __n" (subscript_expression "param_1[5]" identifier [ number_literal ]) = (binary_expression "param_1[5] + __n" (subscript_expression "param_1[5]" identifier [ number_literal ]) + identifier)) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (if_statement "if (param_3 <= iVar3) {\n        return iVar3;\n      }" if (parenthesized_expression "(param_3 <= iVar3)" ( (binary_expression "param_3 <= iVar3" identifier <= identifier) )) (compound_statement "{\n        return iVar3;\n      }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "param_2 = param_2 + __n;" (assignment_expression "param_2 = param_2 + __n" identifier = (binary_expression "param_2 + __n" identifier + identifier)) ;) })) (if_statement "if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }" if (parenthesized_expression "(*(code **)(*param_1 + 0x34) == FUN_001f1bd0)" ( (binary_expression "*(code **)(*param_1 + 0x34) == FUN_001f1bd0" (pointer_expression "*(code **)(*param_1 + 0x34)" * (cast_expression "(code **)(*param_1 + 0x34)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x34)" ( (binary_expression "*param_1 + 0x34" (pointer_expression "*param_1" * identifier) + number_literal) )))) == identifier) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) (expression_statement "iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2)" identifier = (call_expression "(**(code **)(*param_1 + 0x34))(param_1,*param_2)" (parenthesized_expression "(**(code **)(*param_1 + 0x34))" ( (pointer_expression "**(code **)(*param_1 + 0x34)" * (pointer_expression "*(code **)(*param_1 + 0x34)" * (cast_expression "(code **)(*param_1 + 0x34)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x34)" ( (binary_expression "*param_1 + 0x34" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,*param_2)" ( identifier , (pointer_expression "*param_2" * identifier) )))) ;) (if_statement "if (iVar2 == -1) break;" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" identifier = (binary_expression "iVar3 + 1" identifier + number_literal)) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (if_statement "if (param_3 <= iVar3) {\n      return iVar3;\n    }" if (parenthesized_expression "(param_3 <= iVar3)" ( (binary_expression "param_3 <= iVar3" identifier <= identifier) )) (compound_statement "{\n      return iVar3;\n    }" { (return_statement "return iVar3;" return identifier ;) })) })) (return_statement "return iVar3;" return identifier ;) })))
(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 IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (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 = (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 (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + 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)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) )))) == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) )) (argument_list ( IDENT , (pointer_expression * IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (compound_statement { (return_statement return IDENT ;) })) })) (return_statement return IDENT ;) })))
(function_definition "int FUN_001f1d90(int *param_1,undefined1 *param_2,int param_3)\n\n{\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" (primitive_type "int") (function_declarator "FUN_001f1d90(int *param_1,undefined1 *param_2,int param_3)" (identifier "FUN_001f1d90") (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  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  iVar3 = 0;\n  while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }\n  return iVar3;\n}" ({ "{") (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (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") (; ";")) (} "}"))) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (while_statement "while( true ) {\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    sVar1 = param_1[6] - param_1[5];\n    if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }\n    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);\n    if (iVar2 == -1) break;\n    iVar3 = iVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= iVar3) {\n      return iVar3;\n    }\n  }" ({ "{") (expression_statement "sVar1 = param_1[6] - param_1[5];" (assignment_expression "sVar1 = param_1[6] - param_1[5]" (identifier "sVar1") (= "=") (binary_expression "param_1[6] - param_1[5]" (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) (- "-") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")))) (; ";")) (if_statement "if (sVar1 != 0) {\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" (if "if") (parenthesized_expression "(sVar1 != 0)" (( "(") (binary_expression "sVar1 != 0" (identifier "sVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      __n = param_3 - iVar3;\n      if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      iVar3 = iVar3 + __n;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" ({ "{") (expression_statement "__n = param_3 - iVar3;" (assignment_expression "__n = param_3 - iVar3" (identifier "__n") (= "=") (binary_expression "param_3 - iVar3" (identifier "param_3") (- "-") (identifier "iVar3"))) (; ";")) (if_statement "if ((int)sVar1 < param_3 - iVar3) {\n        __n = sVar1;\n      }" (if "if") (parenthesized_expression "((int)sVar1 < param_3 - iVar3)" (( "(") (binary_expression "(int)sVar1 < param_3 - iVar3" (cast_expression "(int)sVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar1")) (< "<") (binary_expression "param_3 - iVar3" (identifier "param_3") (- "-") (identifier "iVar3"))) () ")")) (compound_statement "{\n        __n = sVar1;\n      }" ({ "{") (expression_statement "__n = sVar1;" (assignment_expression "__n = sVar1" (identifier "__n") (= "=") (identifier "sVar1")) (; ";")) (} "}"))) (expression_statement "memcpy((void *)param_1[5],param_2,__n);" (call_expression "memcpy((void *)param_1[5],param_2,__n)" (identifier "memcpy") (argument_list "((void *)param_1[5],param_2,__n)" (( "(") (cast_expression "(void *)param_1[5]" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]"))) (, ",") (identifier "param_2") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "param_1[5] = param_1[5] + __n;" (assignment_expression "param_1[5] = param_1[5] + __n" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (= "=") (binary_expression "param_1[5] + __n" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (+ "+") (identifier "__n"))) (; ";")) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" (identifier "iVar3") (= "=") (binary_expression "iVar3 + __n" (identifier "iVar3") (+ "+") (identifier "__n"))) (; ";")) (if_statement "if (param_3 <= iVar3) {\n        return iVar3;\n      }" (if "if") (parenthesized_expression "(param_3 <= iVar3)" (( "(") (binary_expression "param_3 <= iVar3" (identifier "param_3") (<= "<=") (identifier "iVar3")) () ")")) (compound_statement "{\n        return iVar3;\n      }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (expression_statement "param_2 = param_2 + __n;" (assignment_expression "param_2 = param_2 + __n" (identifier "param_2") (= "=") (binary_expression "param_2 + __n" (identifier "param_2") (+ "+") (identifier "__n"))) (; ";")) (} "}"))) (if_statement "if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {\n      return iVar3;\n    }" (if "if") (parenthesized_expression "(*(code **)(*param_1 + 0x34) == FUN_001f1bd0)" (( "(") (binary_expression "*(code **)(*param_1 + 0x34) == FUN_001f1bd0" (pointer_expression "*(code **)(*param_1 + 0x34)" (* "*") (cast_expression "(code **)(*param_1 + 0x34)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x34)" (( "(") (binary_expression "*param_1 + 0x34" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x34")) () ")")))) (== "==") (identifier "FUN_001f1bd0")) () ")")) (compound_statement "{\n      return iVar3;\n    }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (expression_statement "iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);" (assignment_expression "iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2)" (identifier "iVar2") (= "=") (call_expression "(**(code **)(*param_1 + 0x34))(param_1,*param_2)" (parenthesized_expression "(**(code **)(*param_1 + 0x34))" (( "(") (pointer_expression "**(code **)(*param_1 + 0x34)" (* "*") (pointer_expression "*(code **)(*param_1 + 0x34)" (* "*") (cast_expression "(code **)(*param_1 + 0x34)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x34)" (( "(") (binary_expression "*param_1 + 0x34" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x34")) () ")"))))) () ")")) (argument_list "(param_1,*param_2)" (( "(") (identifier "param_1") (, ",") (pointer_expression "*param_2" (* "*") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if (iVar2 == -1) break;" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "iVar3 = iVar3 + 1;" (assignment_expression "iVar3 = iVar3 + 1" (identifier "iVar3") (= "=") (binary_expression "iVar3 + 1" (identifier "iVar3") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (param_3 <= iVar3) {\n      return iVar3;\n    }" (if "if") (parenthesized_expression "(param_3 <= iVar3)" (( "(") (binary_expression "param_3 <= iVar3" (identifier "param_3") (<= "<=") (identifier "iVar3")) () ")")) (compound_statement "{\n      return iVar3;\n    }" ({ "{") (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}"))) (} "}"))) (return_statement "return iVar3;" (return "return") (identifier "iVar3") (; ";")) (} "}")))

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

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

{
  size_t var_3;
  int var_9;
  size_t var_6;
  int var_4;
  
  if (var_1 < 1) {
    return 0;
  }
  var_4 = 0;
  while( true ) {
    var_3 = *(int *)(var_2 + 0x18) - (int)*(void **)(var_2 + 0x14);
    if (var_3 != 0) {
      var_6 = var_1 - var_4;
      if ((int)var_3 < var_1 - var_4) {
        var_6 = var_3;
      }
      var_5(*(void **)(var_2 + 0x14),var_7,var_6);
      *(size_t *)(var_2 + 0x14) = *(int *)(var_2 + 0x14) + var_6;
      var_4 = var_4 + var_6;
      if (var_1 <= var_4) {
        return var_4;
      }
      var_7 = var_7 + var_6;
    }
    if (*(type_2 **)(*(int *)var_2 + 0x34) == var_8) {
      return var_4;
    }
    var_9 = (**(type_2 **)(*(int *)var_2 + 0x34))(var_2,*var_7);
    if (var_9 == -1) break;
    var_4 = var_4 + 1;
    var_7 = var_7 + 1;
    if (var_1 <= var_4) {
      return var_4;
    }
  }
  return var_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: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (while_statement condition: (parenthesized_expression (true)) 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))))) (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 (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))) (identifier) (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)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) 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)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (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))))) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) arguments: (argument_list (identifier) (pointer_expression argument: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (break_statement)) (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)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))))) (return_statement (identifier)))))

/* 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)

{
  size_t sVar1;
  int iVar2;
  size_t __n;
  int iVar3;
  
  if (param_3 < 1) {
    return 0;
  }
  iVar3 = 0;
  while( true ) {
    sVar1 = param_1[6] - param_1[5];
    if (sVar1 != 0) {
      __n = param_3 - iVar3;
      if ((int)sVar1 < param_3 - iVar3) {
        __n = sVar1;
      }
      memcpy((void *)param_1[5],param_2,__n);
      param_1[5] = param_1[5] + __n;
      iVar3 = iVar3 + __n;
      if (param_3 <= iVar3) {
        return iVar3;
      }
      param_2 = param_2 + __n;
    }
    if (*(code **)(*param_1 + 0x34) == FUN_001f1bd0) {
      return iVar3;
    }
    iVar2 = (**(code **)(*param_1 + 0x34))(param_1,*param_2);
    if (iVar2 == -1) break;
    iVar3 = iVar3 + 1;
    param_2 = param_2 + 1;
    if (param_3 <= iVar3) {
      return iVar3;
    }
  }
  return iVar3;
}

