
/* std::streambuf::xsputn(char const*, long) */

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

{
  int iVar1;
  size_t sVar2;
  long lVar3;
  size_t __n;
  
  if (param_2 < 1) {
    return 0;
  }
  lVar3 = 0;
  while( true ) {
    sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);
    if (sVar2 != 0) {
      __n = param_2 - lVar3;
      if ((long)sVar2 < param_2 - lVar3) {
        __n = sVar2;
      }
      lVar3 = lVar3 + __n;
      memcpy(*(void **)(this + 0x28),param_1,__n);
      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;
      if (param_2 <= lVar3) {
        return lVar3;
      }
      param_1 = param_1 + __n;
    }
    if (*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {
      return lVar3;
    }
    iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);
    if (iVar1 == -1) break;
    lVar3 = lVar3 + 1;
    param_1 = param_1 + 1;
    if (param_2 <= lVar3) {
      return lVar3;
    }
  }
  return lVar3;
}



long FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)

{
  int iVar1;
  size_t sVar2;
  long lVar3;
  size_t __n;
  
  if (param_3 < 1) {
    return 0;
  }
  lVar3 = 0;
  while( true ) {
    sVar2 = param_1[6] - param_1[5];
    if (sVar2 != 0) {
      __n = param_3 - lVar3;
      if ((long)sVar2 < param_3 - lVar3) {
        __n = sVar2;
      }
      lVar3 = lVar3 + __n;
      memcpy((void *)param_1[5],param_2,__n);
      param_1[5] = param_1[5] + __n;
      if (param_3 <= lVar3) {
        return lVar3;
      }
      param_2 = param_2 + __n;
    }
    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {
      return lVar3;
    }
    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);
    if (iVar1 == -1) break;
    lVar3 = lVar3 + 1;
    param_2 = param_2 + 1;
    if (param_3 <= lVar3) {
      return lVar3;
    }
  }
  return lVar3;
}


PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
TEST RDX,RDX
JLE 0x002e42a0
MOV RBP,RDI
MOV R13,RSI
MOV R14,RDX
XOR EBX,EBX
NOP dword ptr [RAX]
MOV RDI,qword ptr [RBP + 0x28]
MOV RAX,qword ptr [RBP + 0x30]
SUB RAX,RDI
JZ 0x002e4270
MOV R12,R14
MOV RSI,R13
SUB R12,RBX
CMP R12,RAX
CMOVG R12,RAX
MOV RDX,R12
ADD RBX,R12
CALL 0x00147aa0
ADD qword ptr [RBP + 0x28],R12
CMP R14,RBX
JG 0x002e426d
MOV RAX,RBX
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
ADD R13,R12
MOV RAX,qword ptr [RBP]
MOV RAX,qword ptr [RAX + 0x68]
CMP RAX,qword ptr [0x0043df90]
JZ 0x002e4261
MOVZX ESI,byte ptr [R13]
MOV RDI,RBP
CALL RAX
CMP EAX,-0x1
JZ 0x002e4261
ADD RBX,0x1
ADD R13,0x1
CMP R14,RBX
JG 0x002e4230
JMP 0x002e4261
XOR EBX,EBX
JMP 0x002e4261
(translation_unit "long FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)" identifier (parameter_list "(long *param_1,undefined1 *param_2,long param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "size_t __n;" 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 "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }" { (expression_statement "sVar2 = param_1[6] - param_1[5];" (assignment_expression "sVar2 = 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 (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "__n = param_3 - lVar3;" (assignment_expression "__n = param_3 - lVar3" identifier = (binary_expression "param_3 - lVar3" identifier - identifier)) ;) (if_statement "if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }" if (parenthesized_expression "((long)sVar2 < param_3 - lVar3)" ( (binary_expression "(long)sVar2 < param_3 - lVar3" (cast_expression "(long)sVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < (binary_expression "param_3 - lVar3" identifier - identifier)) )) (compound_statement "{\n        __n = sVar2;\n      }" { (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" identifier = identifier) ;) })) (expression_statement "lVar3 = lVar3 + __n;" (assignment_expression "lVar3 = lVar3 + __n" identifier = (binary_expression "lVar3 + __n" 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)) ;) (if_statement "if (param_3 <= lVar3) {\n        return lVar3;\n      }" if (parenthesized_expression "(param_3 <= lVar3)" ( (binary_expression "param_3 <= lVar3" identifier <= identifier) )) (compound_statement "{\n        return lVar3;\n      }" { (return_statement "return lVar3;" 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 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }" if (parenthesized_expression "(*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90)" ( (binary_expression "*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90" (pointer_expression "*(code **)(*param_1 + 0x68)" * (cast_expression "(code **)(*param_1 + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x68)" ( (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" * identifier) + number_literal) )))) == (cast_expression "(code *)PTR_FUN_0043df90" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      return lVar3;\n    }" { (return_statement "return lVar3;" return identifier ;) })) (expression_statement "iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);" (assignment_expression "iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2)" identifier = (call_expression "(**(code **)(*param_1 + 0x68))(param_1,*param_2)" (parenthesized_expression "(**(code **)(*param_1 + 0x68))" ( (pointer_expression "**(code **)(*param_1 + 0x68)" * (pointer_expression "*(code **)(*param_1 + 0x68)" * (cast_expression "(code **)(*param_1 + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x68)" ( (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,*param_2)" ( identifier , (pointer_expression "*param_2" * identifier) )))) ;) (if_statement "if (iVar1 == -1) break;" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 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 <= lVar3) {\n      return lVar3;\n    }" if (parenthesized_expression "(param_3 <= lVar3)" ( (binary_expression "param_3 <= lVar3" identifier <= identifier) )) (compound_statement "{\n      return lVar3;\n    }" { (return_statement "return lVar3;" return identifier ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "/* std::streambuf::xsputn(char const*, long) */\n\nlong __thiscall std::streambuf::xsputn(streambuf *this,char *param_1,long param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_2 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);\n    if (sVar2 != 0) {\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}\n\n" comment (function_definition "long __thiscall std::streambuf::xsputn(streambuf *this,char *param_1,long param_2)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_2 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);\n    if (sVar2 != 0) {\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::streambuf::" identifier : : identifier : :) (function_declarator "xsputn(streambuf *this,char *param_1,long param_2)" identifier (parameter_list "(streambuf *this,char *param_1,long 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 "long param_2" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_2 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);\n    if (sVar2 != 0) {\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "size_t __n;" 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 "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);\n    if (sVar2 != 0) {\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= lVar3) {\n      return lVar3;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);\n    if (sVar2 != 0) {\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }\n    if (*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_1 = param_1 + 1;\n    if (param_2 <= lVar3) {\n      return lVar3;\n    }\n  }" { (expression_statement "sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28);" (assignment_expression "sVar2 = *(long *)(this + 0x30) - (long)*(void **)(this + 0x28)" identifier = (binary_expression "*(long *)(this + 0x30) - (long)*(void **)(this + 0x28)" (pointer_expression "*(long *)(this + 0x30)" * (cast_expression "(long *)(this + 0x30)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x30)" ( (binary_expression "this + 0x30" identifier + number_literal) )))) - (cast_expression "(long)*(void **)(this + 0x28)" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) (pointer_expression "*(void **)(this + 0x28)" * (cast_expression "(void **)(this + 0x28)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x28)" ( (binary_expression "this + 0x28" identifier + number_literal) ))))))) ;) (if_statement "if (sVar2 != 0) {\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_2 - lVar3;\n      if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy(*(void **)(this + 0x28),param_1,__n);\n      *(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;\n      if (param_2 <= lVar3) {\n        return lVar3;\n      }\n      param_1 = param_1 + __n;\n    }" { (expression_statement "__n = param_2 - lVar3;" (assignment_expression "__n = param_2 - lVar3" identifier = (binary_expression "param_2 - lVar3" identifier - identifier)) ;) (if_statement "if ((long)sVar2 < param_2 - lVar3) {\n        __n = sVar2;\n      }" if (parenthesized_expression "((long)sVar2 < param_2 - lVar3)" ( (binary_expression "(long)sVar2 < param_2 - lVar3" (cast_expression "(long)sVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < (binary_expression "param_2 - lVar3" identifier - identifier)) )) (compound_statement "{\n        __n = sVar2;\n      }" { (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" identifier = identifier) ;) })) (expression_statement "lVar3 = lVar3 + __n;" (assignment_expression "lVar3 = lVar3 + __n" identifier = (binary_expression "lVar3 + __n" identifier + identifier)) ;) (expression_statement "memcpy(*(void **)(this + 0x28),param_1,__n);" (call_expression "memcpy(*(void **)(this + 0x28),param_1,__n)" identifier (argument_list "(*(void **)(this + 0x28),param_1,__n)" ( (pointer_expression "*(void **)(this + 0x28)" * (cast_expression "(void **)(this + 0x28)" ( (type_descriptor "void **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x28)" ( (binary_expression "this + 0x28" identifier + number_literal) )))) , identifier , identifier ))) ;) (expression_statement "*(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n;" (assignment_expression "*(size_t *)(this + 0x28) = *(long *)(this + 0x28) + __n" (pointer_expression "*(size_t *)(this + 0x28)" * (cast_expression "(size_t *)(this + 0x28)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x28)" ( (binary_expression "this + 0x28" identifier + number_literal) )))) = (binary_expression "*(long *)(this + 0x28) + __n" (pointer_expression "*(long *)(this + 0x28)" * (cast_expression "(long *)(this + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x28)" ( (binary_expression "this + 0x28" identifier + number_literal) )))) + identifier)) ;) (if_statement "if (param_2 <= lVar3) {\n        return lVar3;\n      }" if (parenthesized_expression "(param_2 <= lVar3)" ( (binary_expression "param_2 <= lVar3" identifier <= identifier) )) (compound_statement "{\n        return lVar3;\n      }" { (return_statement "return lVar3;" 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 **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90) {\n      return lVar3;\n    }" if (parenthesized_expression "(*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90)" ( (binary_expression "*(code **)(*(long *)this + 0x68) == (code *)PTR_overflow_0043df90" (pointer_expression "*(code **)(*(long *)this + 0x68)" * (cast_expression "(code **)(*(long *)this + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(long *)this + 0x68)" ( (binary_expression "*(long *)this + 0x68" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) )))) == (cast_expression "(code *)PTR_overflow_0043df90" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      return lVar3;\n    }" { (return_statement "return lVar3;" return identifier ;) })) (expression_statement "iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1);" (assignment_expression "iVar1 = (**(code **)(*(long *)this + 0x68))(this,*param_1)" identifier = (call_expression "(**(code **)(*(long *)this + 0x68))(this,*param_1)" (parenthesized_expression "(**(code **)(*(long *)this + 0x68))" ( (pointer_expression "**(code **)(*(long *)this + 0x68)" * (pointer_expression "*(code **)(*(long *)this + 0x68)" * (cast_expression "(code **)(*(long *)this + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(long *)this + 0x68)" ( (binary_expression "*(long *)this + 0x68" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) )) (argument_list "(this,*param_1)" ( identifier , (pointer_expression "*param_1" * identifier) )))) ;) (if_statement "if (iVar1 == -1) break;" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 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 <= lVar3) {\n      return lVar3;\n    }" if (parenthesized_expression "(param_2 <= lVar3)" ( (binary_expression "param_2 <= lVar3" identifier <= identifier) )) (compound_statement "{\n      return lVar3;\n    }" { (return_statement "return lVar3;" return identifier ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit "long FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}\n\n" (function_definition "long FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" long) (function_declarator "FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)" identifier (parameter_list "(long *param_1,undefined1 *param_2,long param_3)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined1 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "size_t __n;" 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 "lVar3 = 0;" (assignment_expression "lVar3 = 0" identifier = number_literal) ;) (while_statement "while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }" { (expression_statement "sVar2 = param_1[6] - param_1[5];" (assignment_expression "sVar2 = 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 (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "__n = param_3 - lVar3;" (assignment_expression "__n = param_3 - lVar3" identifier = (binary_expression "param_3 - lVar3" identifier - identifier)) ;) (if_statement "if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }" if (parenthesized_expression "((long)sVar2 < param_3 - lVar3)" ( (binary_expression "(long)sVar2 < param_3 - lVar3" (cast_expression "(long)sVar2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) < (binary_expression "param_3 - lVar3" identifier - identifier)) )) (compound_statement "{\n        __n = sVar2;\n      }" { (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" identifier = identifier) ;) })) (expression_statement "lVar3 = lVar3 + __n;" (assignment_expression "lVar3 = lVar3 + __n" identifier = (binary_expression "lVar3 + __n" 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)) ;) (if_statement "if (param_3 <= lVar3) {\n        return lVar3;\n      }" if (parenthesized_expression "(param_3 <= lVar3)" ( (binary_expression "param_3 <= lVar3" identifier <= identifier) )) (compound_statement "{\n        return lVar3;\n      }" { (return_statement "return lVar3;" 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 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }" if (parenthesized_expression "(*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90)" ( (binary_expression "*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90" (pointer_expression "*(code **)(*param_1 + 0x68)" * (cast_expression "(code **)(*param_1 + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x68)" ( (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" * identifier) + number_literal) )))) == (cast_expression "(code *)PTR_FUN_0043df90" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (compound_statement "{\n      return lVar3;\n    }" { (return_statement "return lVar3;" return identifier ;) })) (expression_statement "iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);" (assignment_expression "iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2)" identifier = (call_expression "(**(code **)(*param_1 + 0x68))(param_1,*param_2)" (parenthesized_expression "(**(code **)(*param_1 + 0x68))" ( (pointer_expression "**(code **)(*param_1 + 0x68)" * (pointer_expression "*(code **)(*param_1 + 0x68)" * (cast_expression "(code **)(*param_1 + 0x68)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x68)" ( (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" * identifier) + number_literal) ))))) )) (argument_list "(param_1,*param_2)" ( identifier , (pointer_expression "*param_2" * identifier) )))) ;) (if_statement "if (iVar1 == -1) break;" if (parenthesized_expression "(iVar1 == -1)" ( (binary_expression "iVar1 == -1" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" identifier = (binary_expression "lVar3 + 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 <= lVar3) {\n      return lVar3;\n    }" if (parenthesized_expression "(param_3 <= lVar3)" ( (binary_expression "param_3 <= lVar3" identifier <= identifier) )) (compound_statement "{\n      return lVar3;\n    }" { (return_statement "return lVar3;" return identifier ;) })) })) (return_statement "return lVar3;" return identifier ;) })))
(translation_unit (function_definition (sized_type_specifier long) (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) 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 (sized_type_specifier long)) ) 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 ( (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)) ;) (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) )))) == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) 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 "long FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)\n\n{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" (sized_type_specifier "long" (long "long")) (function_declarator "FUN_002e4210(long *param_1,undefined1 *param_2,long param_3)" (identifier "FUN_002e4210") (parameter_list "(long *param_1,undefined1 *param_2,long param_3)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined1 *param_2" (type_identifier "undefined1") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) () ")"))) (compound_statement "{\n  int iVar1;\n  size_t sVar2;\n  long lVar3;\n  size_t __n;\n  \n  if (param_3 < 1) {\n    return 0;\n  }\n  lVar3 = 0;\n  while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }\n  return lVar3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "long lVar3;" (sized_type_specifier "long" (long "long")) (identifier "lVar3") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (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 "lVar3 = 0;" (assignment_expression "lVar3 = 0" (identifier "lVar3") (= "=") (number_literal "0")) (; ";")) (while_statement "while( true ) {\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    sVar2 = param_1[6] - param_1[5];\n    if (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }\n    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);\n    if (iVar1 == -1) break;\n    lVar3 = lVar3 + 1;\n    param_2 = param_2 + 1;\n    if (param_3 <= lVar3) {\n      return lVar3;\n    }\n  }" ({ "{") (expression_statement "sVar2 = param_1[6] - param_1[5];" (assignment_expression "sVar2 = param_1[6] - param_1[5]" (identifier "sVar2") (= "=") (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 (sVar2 != 0) {\n      __n = param_3 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = 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 - lVar3;\n      if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }\n      lVar3 = lVar3 + __n;\n      memcpy((void *)param_1[5],param_2,__n);\n      param_1[5] = param_1[5] + __n;\n      if (param_3 <= lVar3) {\n        return lVar3;\n      }\n      param_2 = param_2 + __n;\n    }" ({ "{") (expression_statement "__n = param_3 - lVar3;" (assignment_expression "__n = param_3 - lVar3" (identifier "__n") (= "=") (binary_expression "param_3 - lVar3" (identifier "param_3") (- "-") (identifier "lVar3"))) (; ";")) (if_statement "if ((long)sVar2 < param_3 - lVar3) {\n        __n = sVar2;\n      }" (if "if") (parenthesized_expression "((long)sVar2 < param_3 - lVar3)" (( "(") (binary_expression "(long)sVar2 < param_3 - lVar3" (cast_expression "(long)sVar2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "sVar2")) (< "<") (binary_expression "param_3 - lVar3" (identifier "param_3") (- "-") (identifier "lVar3"))) () ")")) (compound_statement "{\n        __n = sVar2;\n      }" ({ "{") (expression_statement "__n = sVar2;" (assignment_expression "__n = sVar2" (identifier "__n") (= "=") (identifier "sVar2")) (; ";")) (} "}"))) (expression_statement "lVar3 = lVar3 + __n;" (assignment_expression "lVar3 = lVar3 + __n" (identifier "lVar3") (= "=") (binary_expression "lVar3 + __n" (identifier "lVar3") (+ "+") (identifier "__n"))) (; ";")) (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"))) (; ";")) (if_statement "if (param_3 <= lVar3) {\n        return lVar3;\n      }" (if "if") (parenthesized_expression "(param_3 <= lVar3)" (( "(") (binary_expression "param_3 <= lVar3" (identifier "param_3") (<= "<=") (identifier "lVar3")) () ")")) (compound_statement "{\n        return lVar3;\n      }" ({ "{") (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}"))) (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 + 0x68) == (code *)PTR_FUN_0043df90) {\n      return lVar3;\n    }" (if "if") (parenthesized_expression "(*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90)" (( "(") (binary_expression "*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90" (pointer_expression "*(code **)(*param_1 + 0x68)" (* "*") (cast_expression "(code **)(*param_1 + 0x68)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x68)" (( "(") (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x68")) () ")")))) (== "==") (cast_expression "(code *)PTR_FUN_0043df90" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_FUN_0043df90"))) () ")")) (compound_statement "{\n      return lVar3;\n    }" ({ "{") (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}"))) (expression_statement "iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);" (assignment_expression "iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2)" (identifier "iVar1") (= "=") (call_expression "(**(code **)(*param_1 + 0x68))(param_1,*param_2)" (parenthesized_expression "(**(code **)(*param_1 + 0x68))" (( "(") (pointer_expression "**(code **)(*param_1 + 0x68)" (* "*") (pointer_expression "*(code **)(*param_1 + 0x68)" (* "*") (cast_expression "(code **)(*param_1 + 0x68)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x68)" (( "(") (binary_expression "*param_1 + 0x68" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x68")) () ")"))))) () ")")) (argument_list "(param_1,*param_2)" (( "(") (identifier "param_1") (, ",") (pointer_expression "*param_2" (* "*") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if (iVar1 == -1) break;" (if "if") (parenthesized_expression "(iVar1 == -1)" (( "(") (binary_expression "iVar1 == -1" (identifier "iVar1") (== "==") (number_literal "-1")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "lVar3 = lVar3 + 1;" (assignment_expression "lVar3 = lVar3 + 1" (identifier "lVar3") (= "=") (binary_expression "lVar3 + 1" (identifier "lVar3") (+ "+") (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 <= lVar3) {\n      return lVar3;\n    }" (if "if") (parenthesized_expression "(param_3 <= lVar3)" (( "(") (binary_expression "param_3 <= lVar3" (identifier "param_3") (<= "<=") (identifier "lVar3")) () ")")) (compound_statement "{\n      return lVar3;\n    }" ({ "{") (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}"))) (} "}"))) (return_statement "return lVar3;" (return "return") (identifier "lVar3") (; ";")) (} "}")))

/* std::streambuf::xsputn(char const*, long) */

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

{
  int var_8;
  size_t var_3;
  long var_4;
  size_t var_5;
  
  if (var_1 < 1) {
    return 0;
  }
  var_4 = 0;
  while( true ) {
    var_3 = *(long *)(var_2 + 0x30) - (long)*(void **)(var_2 + 0x28);
    if (var_3 != 0) {
      var_5 = var_1 - var_4;
      if ((long)var_3 < var_1 - var_4) {
        var_5 = var_3;
      }
      var_4 = var_4 + var_5;
      var_6(*(void **)(var_2 + 0x28),var_7,var_5);
      *(size_t *)(var_2 + 0x28) = *(long *)(var_2 + 0x28) + var_5;
      if (var_1 <= var_4) {
        return var_4;
      }
      var_7 = var_7 + var_5;
    }
    if (*(type_2 **)(*(long *)var_2 + 0x68) == (type_2 *)PTR_overflow_0043df90) {
      return var_4;
    }
    var_8 = (**(type_2 **)(*(long *)var_2 + 0x68))(var_2,*var_7);
    if (var_8 == -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: (sized_type_specifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (sized_type_specifier) 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: (sized_type_specifier)) 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 (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)))) (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: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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)))))

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

{
  int iVar1;
  size_t sVar2;
  long lVar3;
  size_t __n;
  
  if (param_3 < 1) {
    return 0;
  }
  lVar3 = 0;
  while( true ) {
    sVar2 = param_1[6] - param_1[5];
    if (sVar2 != 0) {
      __n = param_3 - lVar3;
      if ((long)sVar2 < param_3 - lVar3) {
        __n = sVar2;
      }
      lVar3 = lVar3 + __n;
      memcpy((void *)param_1[5],param_2,__n);
      param_1[5] = param_1[5] + __n;
      if (param_3 <= lVar3) {
        return lVar3;
      }
      param_2 = param_2 + __n;
    }
    if (*(code **)(*param_1 + 0x68) == (code *)PTR_FUN_0043df90) {
      return lVar3;
    }
    iVar1 = (**(code **)(*param_1 + 0x68))(param_1,*param_2);
    if (iVar1 == -1) break;
    lVar3 = lVar3 + 1;
    param_2 = param_2 + 1;
    if (param_3 <= lVar3) {
      return lVar3;
    }
  }
  return lVar3;
}

