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

int __thiscall std::wstreambuf::xsputn(wstreambuf *this,wchar_t *param_1,int param_2)

{
  wchar_t *__s1;
  size_t sVar1;
  int iVar2;
  size_t __n;
  int iVar3;
  
  iVar3 = 0;
  if (param_2 < 1) {
    return 0;
  }
  while( true ) {
    __s1 = *(wchar_t **)(this + 0x14);
    if (*(wchar_t **)(this + 0x18) != __s1) {
      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;
      __n = param_2 - iVar3;
      if ((int)sVar1 <= param_2 - iVar3) {
        __n = sVar1;
      }
      wmemcpy(__s1,param_1,__n);
      iVar3 = iVar3 + __n;
      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;
      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_001f1e50(int *param_1,wchar_t *param_2,int param_3)

{
  wchar_t *__s1;
  size_t sVar1;
  int iVar2;
  size_t __n;
  int iVar3;
  
  iVar3 = 0;
  if (param_3 < 1) {
    return 0;
  }
  while( true ) {
    __s1 = (wchar_t *)param_1[5];
    if ((wchar_t *)param_1[6] != __s1) {
      sVar1 = param_1[6] - (int)__s1 >> 2;
      __n = param_3 - iVar3;
      if ((int)sVar1 <= param_3 - iVar3) {
        __n = sVar1;
      }
      wmemcpy(__s1,param_2,__n);
      iVar3 = iVar3 + __n;
      param_1[5] = param_1[5] + __n * 4;
      if (param_3 <= iVar3) {
        return iVar3;
      }
      param_2 = param_2 + __n;
    }
    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {
      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,0x19d1ab
PUSH EBP
PUSH EDI
XOR EDI,EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV ECX,dword ptr [ESP + 0x38]
MOV EBP,dword ptr [ESP + 0x30]
MOV dword ptr [ESP + 0x8],EAX
MOV EDX,dword ptr [ESP + 0x34]
TEST ECX,ECX
JLE 0x001f1ece
LEA EAX,[EAX + 0xffe62ca0]
MOV ESI,EDX
MOV dword ptr [ESP + 0xc],EAX
LEA ESI,[ESI]
NOP
MOV EAX,dword ptr [EBP + 0x18]
MOV EBX,dword ptr [EBP + 0x14]
CMP EAX,EBX
JZ 0x001f1ee0
SUB EAX,EBX
MOV EDX,ECX
MOV dword ptr [ESP + 0x38],ECX
SAR EAX,0x2
SUB EDX,EDI
CMP EAX,EDX
CMOVLE EDX,EAX
SUB ESP,0x4
PUSH EDX
MOV dword ptr [ESP + 0xc],EDX
PUSH ESI
PUSH EBX
MOV EBX,dword ptr [ESP + 0x18]
CALL 0x00029370
MOV EDX,dword ptr [ESP + 0x14]
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x38]
ADD EDI,EDX
SHL EDX,0x2
ADD dword ptr [EBP + 0x14],EDX
CMP ECX,EDI
JG 0x001f1ed8
ADD ESP,0x1c
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
ADD ESI,EDX
LEA ESI,[ESI]
MOV EAX,dword ptr [EBP]
MOV EAX,dword ptr [EAX + 0x34]
CMP EAX,dword ptr [ESP + 0xc]
JZ 0x001f1ece
MOV dword ptr [ESP + 0x38],ECX
SUB ESP,0x8
PUSH dword ptr [ESI]
PUSH EBP
CALL EAX
ADD ESP,0x10
CMP EAX,-0x1
JZ 0x001f1ece
MOV ECX,dword ptr [ESP + 0x38]
ADD EDI,0x1
ADD ESI,0x4
CMP ECX,EDI
JG 0x001f1e88
JMP 0x001f1ece
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nint FUN_001f1e50(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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_001f1e50(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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_001f1e50(int *param_1,wchar_t *param_2,int param_3)" identifier (parameter_list "(int *param_1,wchar_t *param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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 "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (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 ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (while_statement "while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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 "__s1 = (wchar_t *)param_1[5];" (assignment_expression "__s1 = (wchar_t *)param_1[5]" identifier = (cast_expression "(wchar_t *)param_1[5]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ]))) ;) (if_statement "if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "((wchar_t *)param_1[6] != __s1)" ( (binary_expression "(wchar_t *)param_1[6] != __s1" (cast_expression "(wchar_t *)param_1[6]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[6]" identifier [ number_literal ])) != identifier) )) (compound_statement "{\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "sVar1 = param_1[6] - (int)__s1 >> 2;" (assignment_expression "sVar1 = param_1[6] - (int)__s1 >> 2" identifier = (binary_expression "param_1[6] - (int)__s1 >> 2" (binary_expression "param_1[6] - (int)__s1" (subscript_expression "param_1[6]" identifier [ number_literal ]) - (cast_expression "(int)__s1" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (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 "wmemcpy(__s1,param_2,__n);" (call_expression "wmemcpy(__s1,param_2,__n)" identifier (argument_list "(__s1,param_2,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "param_1[5] = param_1[5] + __n * 4;" (assignment_expression "param_1[5] = param_1[5] + __n * 4" (subscript_expression "param_1[5]" identifier [ number_literal ]) = (binary_expression "param_1[5] + __n * 4" (subscript_expression "param_1[5]" identifier [ number_literal ]) + (binary_expression "__n * 4" 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 ;) })) (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_001f1ca0) {\n      return iVar3;\n    }" if (parenthesized_expression "(*(code **)(*param_1 + 0x34) == FUN_001f1ca0)" ( (binary_expression "*(code **)(*param_1 + 0x34) == FUN_001f1ca0" (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::wstreambuf::xsputn(wchar_t const*, int) */\n\nint __thiscall std::wstreambuf::xsputn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = *(wchar_t **)(this + 0x14);\n    if (*(wchar_t **)(this + 0x18) != __s1) {\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\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::wstreambuf::xsputn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = *(wchar_t **)(this + 0x14);\n    if (*(wchar_t **)(this + 0x18) != __s1) {\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\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::wstreambuf::" identifier : : identifier : :) (function_declarator "xsputn(wstreambuf *this,wchar_t *param_1,int param_2)" identifier (parameter_list "(wstreambuf *this,wchar_t *param_1,int param_2)" ( (parameter_declaration "wstreambuf *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = *(wchar_t **)(this + 0x14);\n    if (*(wchar_t **)(this + 0x18) != __s1) {\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\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 "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (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 ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (while_statement "while( true ) {\n    __s1 = *(wchar_t **)(this + 0x14);\n    if (*(wchar_t **)(this + 0x18) != __s1) {\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\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    __s1 = *(wchar_t **)(this + 0x14);\n    if (*(wchar_t **)(this + 0x18) != __s1) {\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\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 "__s1 = *(wchar_t **)(this + 0x14);" (assignment_expression "__s1 = *(wchar_t **)(this + 0x14)" identifier = (pointer_expression "*(wchar_t **)(this + 0x14)" * (cast_expression "(wchar_t **)(this + 0x14)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x14)" ( (binary_expression "this + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (*(wchar_t **)(this + 0x18) != __s1) {\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }" if (parenthesized_expression "(*(wchar_t **)(this + 0x18) != __s1)" ( (binary_expression "*(wchar_t **)(this + 0x18) != __s1" (pointer_expression "*(wchar_t **)(this + 0x18)" * (cast_expression "(wchar_t **)(this + 0x18)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) )))) != identifier) )) (compound_statement "{\n      sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;\n      __n = param_2 - iVar3;\n      if ((int)sVar1 <= param_2 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_1,__n);\n      iVar3 = iVar3 + __n;\n      *(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;\n      if (param_2 <= iVar3) {\n        return iVar3;\n      }\n      param_1 = param_1 + __n;\n    }" { (expression_statement "sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2;" (assignment_expression "sVar1 = (int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2" identifier = (binary_expression "(int)*(wchar_t **)(this + 0x18) - (int)__s1 >> 2" (binary_expression "(int)*(wchar_t **)(this + 0x18) - (int)__s1" (cast_expression "(int)*(wchar_t **)(this + 0x18)" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*(wchar_t **)(this + 0x18)" * (cast_expression "(wchar_t **)(this + 0x18)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) ))))) - (cast_expression "(int)__s1" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (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 "wmemcpy(__s1,param_1,__n);" (call_expression "wmemcpy(__s1,param_1,__n)" identifier (argument_list "(__s1,param_1,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "*(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4;" (assignment_expression "*(size_t *)(this + 0x14) = *(int *)(this + 0x14) + __n * 4" (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 * 4" (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) )))) + (binary_expression "__n * 4" 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 ;) })) (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_001f1e50(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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_001f1e50(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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_001f1e50(int *param_1,wchar_t *param_2,int param_3)" identifier (parameter_list "(int *param_1,wchar_t *param_2,int param_3)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar_t *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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 "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (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 ;) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" identifier = number_literal) ;) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (while_statement "while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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 "__s1 = (wchar_t *)param_1[5];" (assignment_expression "__s1 = (wchar_t *)param_1[5]" identifier = (cast_expression "(wchar_t *)param_1[5]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[5]" identifier [ number_literal ]))) ;) (if_statement "if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "((wchar_t *)param_1[6] != __s1)" ( (binary_expression "(wchar_t *)param_1[6] != __s1" (cast_expression "(wchar_t *)param_1[6]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[6]" identifier [ number_literal ])) != identifier) )) (compound_statement "{\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "sVar1 = param_1[6] - (int)__s1 >> 2;" (assignment_expression "sVar1 = param_1[6] - (int)__s1 >> 2" identifier = (binary_expression "param_1[6] - (int)__s1 >> 2" (binary_expression "param_1[6] - (int)__s1" (subscript_expression "param_1[6]" identifier [ number_literal ]) - (cast_expression "(int)__s1" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (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 "wmemcpy(__s1,param_2,__n);" (call_expression "wmemcpy(__s1,param_2,__n)" identifier (argument_list "(__s1,param_2,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" identifier = (binary_expression "iVar3 + __n" identifier + identifier)) ;) (expression_statement "param_1[5] = param_1[5] + __n * 4;" (assignment_expression "param_1[5] = param_1[5] + __n * 4" (subscript_expression "param_1[5]" identifier [ number_literal ]) = (binary_expression "param_1[5] + __n * 4" (subscript_expression "param_1[5]" identifier [ number_literal ]) + (binary_expression "__n * 4" 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 ;) })) (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_001f1ca0) {\n      return iVar3;\n    }" if (parenthesized_expression "(*(code **)(*param_1 + 0x34) == FUN_001f1ca0)" ( (binary_expression "*(code **)(*param_1 + 0x34) == FUN_001f1ca0" (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 (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) != IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) >> LIT)) ;) (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 ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) + (binary_expression IDENT * LIT))) ;) (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_001f1e50(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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_001f1e50(int *param_1,wchar_t *param_2,int param_3)" (identifier "FUN_001f1e50") (parameter_list "(int *param_1,wchar_t *param_2,int param_3)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "wchar_t *param_2" (type_identifier "wchar_t") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  wchar_t *__s1;\n  size_t sVar1;\n  int iVar2;\n  size_t __n;\n  int iVar3;\n  \n  iVar3 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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 "wchar_t *__s1;" (type_identifier "wchar_t") (pointer_declarator "*__s1" (* "*") (identifier "__s1")) (; ";")) (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") (; ";")) (expression_statement "iVar3 = 0;" (assignment_expression "iVar3 = 0" (identifier "iVar3") (= "=") (number_literal "0")) (; ";")) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_3 < 1)" (( "(") (binary_expression "param_3 < 1" (identifier "param_3") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (while_statement "while( true ) {\n    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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    __s1 = (wchar_t *)param_1[5];\n    if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }\n    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {\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 "__s1 = (wchar_t *)param_1[5];" (assignment_expression "__s1 = (wchar_t *)param_1[5]" (identifier "__s1") (= "=") (cast_expression "(wchar_t *)param_1[5]" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")))) (; ";")) (if_statement "if ((wchar_t *)param_1[6] != __s1) {\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" (if "if") (parenthesized_expression "((wchar_t *)param_1[6] != __s1)" (( "(") (binary_expression "(wchar_t *)param_1[6] != __s1" (cast_expression "(wchar_t *)param_1[6]" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]"))) (!= "!=") (identifier "__s1")) () ")")) (compound_statement "{\n      sVar1 = param_1[6] - (int)__s1 >> 2;\n      __n = param_3 - iVar3;\n      if ((int)sVar1 <= param_3 - iVar3) {\n        __n = sVar1;\n      }\n      wmemcpy(__s1,param_2,__n);\n      iVar3 = iVar3 + __n;\n      param_1[5] = param_1[5] + __n * 4;\n      if (param_3 <= iVar3) {\n        return iVar3;\n      }\n      param_2 = param_2 + __n;\n    }" ({ "{") (expression_statement "sVar1 = param_1[6] - (int)__s1 >> 2;" (assignment_expression "sVar1 = param_1[6] - (int)__s1 >> 2" (identifier "sVar1") (= "=") (binary_expression "param_1[6] - (int)__s1 >> 2" (binary_expression "param_1[6] - (int)__s1" (subscript_expression "param_1[6]" (identifier "param_1") ([ "[") (number_literal "6") (] "]")) (- "-") (cast_expression "(int)__s1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__s1"))) (>> ">>") (number_literal "2"))) (; ";")) (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 "wmemcpy(__s1,param_2,__n);" (call_expression "wmemcpy(__s1,param_2,__n)" (identifier "wmemcpy") (argument_list "(__s1,param_2,__n)" (( "(") (identifier "__s1") (, ",") (identifier "param_2") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "iVar3 = iVar3 + __n;" (assignment_expression "iVar3 = iVar3 + __n" (identifier "iVar3") (= "=") (binary_expression "iVar3 + __n" (identifier "iVar3") (+ "+") (identifier "__n"))) (; ";")) (expression_statement "param_1[5] = param_1[5] + __n * 4;" (assignment_expression "param_1[5] = param_1[5] + __n * 4" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (= "=") (binary_expression "param_1[5] + __n * 4" (subscript_expression "param_1[5]" (identifier "param_1") ([ "[") (number_literal "5") (] "]")) (+ "+") (binary_expression "__n * 4" (identifier "__n") (* "*") (number_literal "4")))) (; ";")) (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_001f1ca0) {\n      return iVar3;\n    }" (if "if") (parenthesized_expression "(*(code **)(*param_1 + 0x34) == FUN_001f1ca0)" (( "(") (binary_expression "*(code **)(*param_1 + 0x34) == FUN_001f1ca0" (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_001f1ca0")) () ")")) (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::wstreambuf::xsputn(wchar_t const*, int) */

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

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

{
  wchar_t *__s1;
  size_t sVar1;
  int iVar2;
  size_t __n;
  int iVar3;
  
  iVar3 = 0;
  if (param_3 < 1) {
    return 0;
  }
  while( true ) {
    __s1 = (wchar_t *)param_1[5];
    if ((wchar_t *)param_1[6] != __s1) {
      sVar1 = param_1[6] - (int)__s1 >> 2;
      __n = param_3 - iVar3;
      if ((int)sVar1 <= param_3 - iVar3) {
        __n = sVar1;
      }
      wmemcpy(__s1,param_2,__n);
      iVar3 = iVar3 + __n;
      param_1[5] = param_1[5] + __n * 4;
      if (param_3 <= iVar3) {
        return iVar3;
      }
      param_2 = param_2 + __n;
    }
    if (*(code **)(*param_1 + 0x34) == FUN_001f1ca0) {
      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;
}

