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

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

{
  wchar_t *__s2;
  code *pcVar1;
  int iVar2;
  wchar_t wVar3;
  size_t __n;
  size_t sVar4;
  int iVar5;
  
  iVar5 = 0;
  if (param_2 < 1) {
    return 0;
  }
  do {
    __s2 = *(wchar_t **)(this + 8);
    if (*(wchar_t **)(this + 0xc) != __s2) {
      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;
      __n = param_2 - iVar5;
      if ((int)sVar4 <= param_2 - iVar5) {
        __n = sVar4;
      }
      wmemcpy(param_1,__s2,__n);
      iVar5 = iVar5 + __n;
      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;
      if (param_2 <= iVar5) {
        return iVar5;
      }
      param_1 = param_1 + __n;
    }
    pcVar1 = *(code **)(*(int *)this + 0x28);
    if (pcVar1 == uflow) {
      pcVar1 = *(code **)(*(int *)this + 0x24);
      if (pcVar1 == underflow) {
        return iVar5;
      }
      iVar2 = (*pcVar1)(this);
      if (iVar2 == -1) {
        return iVar5;
      }
      wVar3 = **(wchar_t **)(this + 8);
      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;
    }
    else {
      wVar3 = (*pcVar1)(this);
    }
    if (wVar3 == L'\xffffffff') {
      return iVar5;
    }
    iVar5 = iVar5 + 1;
    *param_1 = wVar3;
    param_1 = param_1 + 1;
  } while (iVar5 < param_2);
  return iVar5;
}



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

int FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)

{
  wchar_t *__s2;
  code *pcVar1;
  int iVar2;
  wchar_t wVar3;
  size_t __n;
  size_t sVar4;
  int iVar5;
  
  iVar5 = 0;
  if (param_3 < 1) {
    return 0;
  }
  do {
    __s2 = (wchar_t *)param_1[2];
    if ((wchar_t *)param_1[3] != __s2) {
      sVar4 = param_1[3] - (int)__s2 >> 2;
      __n = param_3 - iVar5;
      if ((int)sVar4 <= param_3 - iVar5) {
        __n = sVar4;
      }
      wmemcpy(param_2,__s2,__n);
      iVar5 = iVar5 + __n;
      param_1[2] = param_1[2] + __n * 4;
      if (param_3 <= iVar5) {
        return iVar5;
      }
      param_2 = param_2 + __n;
    }
    pcVar1 = *(code **)(*param_1 + 0x28);
    if (pcVar1 == FUN_001f1f20) {
      pcVar1 = *(code **)(*param_1 + 0x24);
      if (pcVar1 == FUN_001f1c80) {
        return iVar5;
      }
      iVar2 = (*pcVar1)(param_1);
      if (iVar2 == -1) {
        return iVar5;
      }
      wVar3 = *(wchar_t *)param_1[2];
      param_1[2] = (int)((wchar_t *)param_1[2] + 1);
    }
    else {
      wVar3 = (*pcVar1)(param_1);
    }
    if (wVar3 == L'\xffffffff') {
      return iVar5;
    }
    iVar5 = iVar5 + 1;
    *param_2 = wVar3;
    param_2 = param_2 + 1;
  } while (iVar5 < param_3);
  return iVar5;
}


CALL 0x000559e6
ADD EAX,0x19cf3b
PUSH EBP
PUSH EDI
XOR EDI,EDI
PUSH ESI
PUSH EBX
SUB ESP,0x1c
MOV EDX,dword ptr [ESP + 0x38]
MOV EBP,dword ptr [ESP + 0x30]
MOV dword ptr [ESP + 0x4],EAX
MOV ECX,dword ptr [ESP + 0x34]
TEST EDX,EDX
JLE 0x001f2146
LEA ESI,[EAX + 0xffe62f20]
LEA EAX,[EAX + 0xffe62c80]
MOV dword ptr [ESP + 0xc],EAX
MOV dword ptr [ESP + 0x8],ESI
MOV ESI,ECX
LEA ESI,[ESI]
MOV EBX,dword ptr [EBP + 0xc]
MOV EAX,dword ptr [EBP + 0x8]
CMP EBX,EAX
JZ 0x001f2150
SUB EBX,EAX
MOV ECX,EDX
MOV dword ptr [ESP + 0x38],EDX
SAR EBX,0x2
SUB ECX,EDI
CMP EBX,ECX
CMOVLE ECX,EBX
SUB ESP,0x4
PUSH ECX
MOV dword ptr [ESP + 0x8],ECX
PUSH EAX
PUSH ESI
MOV EBX,dword ptr [ESP + 0x14]
CALL 0x00029370
MOV ECX,dword ptr [ESP + 0x10]
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x38]
ADD EDI,ECX
SHL ECX,0x2
ADD dword ptr [EBP + 0x8],ECX
CMP EDX,EDI
JG 0x001f21b3
ADD ESP,0x1c
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EBX,ESI
MOV EAX,dword ptr [EBP]
MOV ECX,dword ptr [EAX + 0x28]
CMP ECX,dword ptr [ESP + 0x8]
JNZ 0x001f21a0
MOV EAX,dword ptr [EAX + 0x24]
CMP EAX,dword ptr [ESP + 0xc]
JZ 0x001f2146
MOV dword ptr [ESP + 0x38],EDX
SUB ESP,0xc
PUSH EBP
CALL EAX
ADD ESP,0x10
CMP EAX,-0x1
JZ 0x001f2146
MOV ECX,dword ptr [EBP + 0x8]
MOV EDX,dword ptr [ESP + 0x38]
MOV EAX,dword ptr [ECX]
ADD ECX,0x4
MOV dword ptr [EBP + 0x8],ECX
CMP EAX,-0x1
JZ 0x001f2146
ADD EDI,0x1
LEA ESI,[EBX + 0x4]
MOV dword ptr [EBX],EAX
CMP EDX,EDI
JG 0x001f2100
JMP 0x001f2146
MOV dword ptr [ESP + 0x38],EDX
SUB ESP,0xc
PUSH EBP
CALL ECX
MOV EDX,dword ptr [ESP + 0x48]
ADD ESP,0x10
JMP 0x001f2188
LEA EBX,[ESI + ECX*0x1]
JMP 0x001f2152
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nint FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}\n\n" comment (function_definition "int FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}" primitive_type (function_declarator "FUN_001f20c0(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 *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}" { (declaration "wchar_t *__s2;" type_identifier (pointer_declarator "*__s2" * identifier) ;) (declaration "code *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wchar_t wVar3;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);" do (compound_statement "{\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  }" { (expression_statement "__s2 = (wchar_t *)param_1[2];" (assignment_expression "__s2 = (wchar_t *)param_1[2]" identifier = (cast_expression "(wchar_t *)param_1[2]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (if_statement "if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "((wchar_t *)param_1[3] != __s2)" ( (binary_expression "(wchar_t *)param_1[3] != __s2" (cast_expression "(wchar_t *)param_1[3]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[3]" identifier [ number_literal ])) != identifier) )) (compound_statement "{\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "sVar4 = param_1[3] - (int)__s2 >> 2;" (assignment_expression "sVar4 = param_1[3] - (int)__s2 >> 2" identifier = (binary_expression "param_1[3] - (int)__s2 >> 2" (binary_expression "param_1[3] - (int)__s2" (subscript_expression "param_1[3]" identifier [ number_literal ]) - (cast_expression "(int)__s2" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (expression_statement "__n = param_3 - iVar5;" (assignment_expression "__n = param_3 - iVar5" identifier = (binary_expression "param_3 - iVar5" identifier - identifier)) ;) (if_statement "if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }" if (parenthesized_expression "((int)sVar4 <= param_3 - iVar5)" ( (binary_expression "(int)sVar4 <= param_3 - iVar5" (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier) <= (binary_expression "param_3 - iVar5" identifier - identifier)) )) (compound_statement "{\n        __n = sVar4;\n      }" { (expression_statement "__n = sVar4;" (assignment_expression "__n = sVar4" identifier = identifier) ;) })) (expression_statement "wmemcpy(param_2,__s2,__n);" (call_expression "wmemcpy(param_2,__s2,__n)" identifier (argument_list "(param_2,__s2,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar5 = iVar5 + __n;" (assignment_expression "iVar5 = iVar5 + __n" identifier = (binary_expression "iVar5 + __n" identifier + identifier)) ;) (expression_statement "param_1[2] = param_1[2] + __n * 4;" (assignment_expression "param_1[2] = param_1[2] + __n * 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "param_1[2] + __n * 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) + (binary_expression "__n * 4" identifier * number_literal))) ;) (if_statement "if (param_3 <= iVar5) {\n        return iVar5;\n      }" if (parenthesized_expression "(param_3 <= iVar5)" ( (binary_expression "param_3 <= iVar5" identifier <= identifier) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "param_2 = param_2 + __n;" (assignment_expression "param_2 = param_2 + __n" identifier = (binary_expression "param_2 + __n" identifier + identifier)) ;) })) (expression_statement "pcVar1 = *(code **)(*param_1 + 0x28);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x28)" identifier = (pointer_expression "*(code **)(*param_1 + 0x28)" * (cast_expression "(code **)(*param_1 + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x28)" ( (binary_expression "*param_1 + 0x28" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }" if (parenthesized_expression "(pcVar1 == FUN_001f1f20)" ( (binary_expression "pcVar1 == FUN_001f1f20" identifier == identifier) )) (compound_statement "{\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }" { (expression_statement "pcVar1 = *(code **)(*param_1 + 0x24);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x24)" identifier = (pointer_expression "*(code **)(*param_1 + 0x24)" * (cast_expression "(code **)(*param_1 + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x24)" ( (binary_expression "*param_1 + 0x24" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }" if (parenthesized_expression "(pcVar1 == FUN_001f1c80)" ( (binary_expression "pcVar1 == FUN_001f1c80" identifier == identifier) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "iVar2 = (*pcVar1)(param_1);" (assignment_expression "iVar2 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar2 == -1) {\n        return iVar5;\n      }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "wVar3 = *(wchar_t *)param_1[2];" (assignment_expression "wVar3 = *(wchar_t *)param_1[2]" identifier = (pointer_expression "*(wchar_t *)param_1[2]" * (cast_expression "(wchar_t *)param_1[2]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])))) ;) (expression_statement "param_1[2] = (int)((wchar_t *)param_1[2] + 1);" (assignment_expression "param_1[2] = (int)((wchar_t *)param_1[2] + 1)" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)((wchar_t *)param_1[2] + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((wchar_t *)param_1[2] + 1)" ( (binary_expression "(wchar_t *)param_1[2] + 1" (cast_expression "(wchar_t *)param_1[2]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) + number_literal) )))) ;) }) (else_clause "else {\n      wVar3 = (*pcVar1)(param_1);\n    }" else (compound_statement "{\n      wVar3 = (*pcVar1)(param_1);\n    }" { (expression_statement "wVar3 = (*pcVar1)(param_1);" (assignment_expression "wVar3 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) }))) (if_statement "if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }" if (parenthesized_expression "(wVar3 == L'\xffffffff')" ( (binary_expression "wVar3 == L'\xffffffff'" identifier == (char_literal "L'\xffffffff'" L' escape_sequence character character character character ')) )) (compound_statement "{\n      return iVar5;\n    }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "iVar5 = iVar5 + 1;" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) ;) (expression_statement "*param_2 = wVar3;" (assignment_expression "*param_2 = wVar3" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar5 < param_3)" ( (binary_expression "iVar5 < param_3" identifier < identifier) )) ;) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n/* std::wstreambuf::xsgetn(wchar_t*, int) */\n\nint __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = *(wchar_t **)(this + 8);\n    if (*(wchar_t **)(this + 0xc) != __s2) {\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }\n    else {\n      wVar3 = (*pcVar1)(this);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_1 = wVar3;\n    param_1 = param_1 + 1;\n  } while (iVar5 < param_2);\n  return iVar5;\n}\n\n" comment comment (function_definition "int __thiscall std::wstreambuf::xsgetn(wstreambuf *this,wchar_t *param_1,int param_2)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = *(wchar_t **)(this + 8);\n    if (*(wchar_t **)(this + 0xc) != __s2) {\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }\n    else {\n      wVar3 = (*pcVar1)(this);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_1 = wVar3;\n    param_1 = param_1 + 1;\n  } while (iVar5 < param_2);\n  return iVar5;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstreambuf::" identifier : : identifier : :) (function_declarator "xsgetn(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 *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_2 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = *(wchar_t **)(this + 8);\n    if (*(wchar_t **)(this + 0xc) != __s2) {\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }\n    else {\n      wVar3 = (*pcVar1)(this);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_1 = wVar3;\n    param_1 = param_1 + 1;\n  } while (iVar5 < param_2);\n  return iVar5;\n}" { (declaration "wchar_t *__s2;" type_identifier (pointer_declarator "*__s2" * identifier) ;) (declaration "code *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wchar_t wVar3;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (if_statement "if (param_2 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_2 < 1)" ( (binary_expression "param_2 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    __s2 = *(wchar_t **)(this + 8);\n    if (*(wchar_t **)(this + 0xc) != __s2) {\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }\n    else {\n      wVar3 = (*pcVar1)(this);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_1 = wVar3;\n    param_1 = param_1 + 1;\n  } while (iVar5 < param_2);" do (compound_statement "{\n    __s2 = *(wchar_t **)(this + 8);\n    if (*(wchar_t **)(this + 0xc) != __s2) {\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }\n    pcVar1 = *(code **)(*(int *)this + 0x28);\n    if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }\n    else {\n      wVar3 = (*pcVar1)(this);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_1 = wVar3;\n    param_1 = param_1 + 1;\n  }" { (expression_statement "__s2 = *(wchar_t **)(this + 8);" (assignment_expression "__s2 = *(wchar_t **)(this + 8)" identifier = (pointer_expression "*(wchar_t **)(this + 8)" * (cast_expression "(wchar_t **)(this + 8)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) (if_statement "if (*(wchar_t **)(this + 0xc) != __s2) {\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }" if (parenthesized_expression "(*(wchar_t **)(this + 0xc) != __s2)" ( (binary_expression "*(wchar_t **)(this + 0xc) != __s2" (pointer_expression "*(wchar_t **)(this + 0xc)" * (cast_expression "(wchar_t **)(this + 0xc)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) )))) != identifier) )) (compound_statement "{\n      sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;\n      __n = param_2 - iVar5;\n      if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_1,__s2,__n);\n      iVar5 = iVar5 + __n;\n      *(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;\n      if (param_2 <= iVar5) {\n        return iVar5;\n      }\n      param_1 = param_1 + __n;\n    }" { (expression_statement "sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2;" (assignment_expression "sVar4 = (int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2" identifier = (binary_expression "(int)*(wchar_t **)(this + 0xc) - (int)__s2 >> 2" (binary_expression "(int)*(wchar_t **)(this + 0xc) - (int)__s2" (cast_expression "(int)*(wchar_t **)(this + 0xc)" ( (type_descriptor "int" primitive_type) ) (pointer_expression "*(wchar_t **)(this + 0xc)" * (cast_expression "(wchar_t **)(this + 0xc)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 0xc)" ( (binary_expression "this + 0xc" identifier + number_literal) ))))) - (cast_expression "(int)__s2" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (expression_statement "__n = param_2 - iVar5;" (assignment_expression "__n = param_2 - iVar5" identifier = (binary_expression "param_2 - iVar5" identifier - identifier)) ;) (if_statement "if ((int)sVar4 <= param_2 - iVar5) {\n        __n = sVar4;\n      }" if (parenthesized_expression "((int)sVar4 <= param_2 - iVar5)" ( (binary_expression "(int)sVar4 <= param_2 - iVar5" (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier) <= (binary_expression "param_2 - iVar5" identifier - identifier)) )) (compound_statement "{\n        __n = sVar4;\n      }" { (expression_statement "__n = sVar4;" (assignment_expression "__n = sVar4" identifier = identifier) ;) })) (expression_statement "wmemcpy(param_1,__s2,__n);" (call_expression "wmemcpy(param_1,__s2,__n)" identifier (argument_list "(param_1,__s2,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar5 = iVar5 + __n;" (assignment_expression "iVar5 = iVar5 + __n" identifier = (binary_expression "iVar5 + __n" identifier + identifier)) ;) (expression_statement "*(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4;" (assignment_expression "*(size_t *)(this + 8) = *(int *)(this + 8) + __n * 4" (pointer_expression "*(size_t *)(this + 8)" * (cast_expression "(size_t *)(this + 8)" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(int *)(this + 8) + __n * 4" (pointer_expression "*(int *)(this + 8)" * (cast_expression "(int *)(this + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + (binary_expression "__n * 4" identifier * number_literal))) ;) (if_statement "if (param_2 <= iVar5) {\n        return iVar5;\n      }" if (parenthesized_expression "(param_2 <= iVar5)" ( (binary_expression "param_2 <= iVar5" identifier <= identifier) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "param_1 = param_1 + __n;" (assignment_expression "param_1 = param_1 + __n" identifier = (binary_expression "param_1 + __n" identifier + identifier)) ;) })) (expression_statement "pcVar1 = *(code **)(*(int *)this + 0x28);" (assignment_expression "pcVar1 = *(code **)(*(int *)this + 0x28)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x28)" * (cast_expression "(code **)(*(int *)this + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x28)" ( (binary_expression "*(int *)this + 0x28" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar1 == uflow) {\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }\n    else {\n      wVar3 = (*pcVar1)(this);\n    }" if (parenthesized_expression "(pcVar1 == uflow)" ( (binary_expression "pcVar1 == uflow" identifier == identifier) )) (compound_statement "{\n      pcVar1 = *(code **)(*(int *)this + 0x24);\n      if (pcVar1 == underflow) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(this);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = **(wchar_t **)(this + 8);\n      *(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;\n    }" { (expression_statement "pcVar1 = *(code **)(*(int *)this + 0x24);" (assignment_expression "pcVar1 = *(code **)(*(int *)this + 0x24)" identifier = (pointer_expression "*(code **)(*(int *)this + 0x24)" * (cast_expression "(code **)(*(int *)this + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*(int *)this + 0x24)" ( (binary_expression "*(int *)this + 0x24" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (if_statement "if (pcVar1 == underflow) {\n        return iVar5;\n      }" if (parenthesized_expression "(pcVar1 == underflow)" ( (binary_expression "pcVar1 == underflow" identifier == identifier) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "iVar2 = (*pcVar1)(this);" (assignment_expression "iVar2 = (*pcVar1)(this)" identifier = (call_expression "(*pcVar1)(this)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(this)" ( identifier )))) ;) (if_statement "if (iVar2 == -1) {\n        return iVar5;\n      }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "wVar3 = **(wchar_t **)(this + 8);" (assignment_expression "wVar3 = **(wchar_t **)(this + 8)" identifier = (pointer_expression "**(wchar_t **)(this + 8)" * (pointer_expression "*(wchar_t **)(this + 8)" * (cast_expression "(wchar_t **)(this + 8)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))))) ;) (expression_statement "*(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1;" (assignment_expression "*(wchar_t **)(this + 8) = *(wchar_t **)(this + 8) + 1" (pointer_expression "*(wchar_t **)(this + 8)" * (cast_expression "(wchar_t **)(this + 8)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) = (binary_expression "*(wchar_t **)(this + 8) + 1" (pointer_expression "*(wchar_t **)(this + 8)" * (cast_expression "(wchar_t **)(this + 8)" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) + number_literal)) ;) }) (else_clause "else {\n      wVar3 = (*pcVar1)(this);\n    }" else (compound_statement "{\n      wVar3 = (*pcVar1)(this);\n    }" { (expression_statement "wVar3 = (*pcVar1)(this);" (assignment_expression "wVar3 = (*pcVar1)(this)" identifier = (call_expression "(*pcVar1)(this)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(this)" ( identifier )))) ;) }))) (if_statement "if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }" if (parenthesized_expression "(wVar3 == L'\xffffffff')" ( (binary_expression "wVar3 == L'\xffffffff'" identifier == (char_literal "L'\xffffffff'" L' escape_sequence character character character character ')) )) (compound_statement "{\n      return iVar5;\n    }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "iVar5 = iVar5 + 1;" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) ;) (expression_statement "*param_1 = wVar3;" (assignment_expression "*param_1 = wVar3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar5 < param_2)" ( (binary_expression "iVar5 < param_2" identifier < identifier) )) ;) (return_statement "return iVar5;" return identifier ;) })))
(translation_unit "int FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}\n\n" (function_definition "int FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}" primitive_type (function_declarator "FUN_001f20c0(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 *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}" { (declaration "wchar_t *__s2;" type_identifier (pointer_declarator "*__s2" * identifier) ;) (declaration "code *pcVar1;" type_identifier (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wchar_t wVar3;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" if (parenthesized_expression "(param_3 < 1)" ( (binary_expression "param_3 < 1" identifier < number_literal) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (do_statement "do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);" do (compound_statement "{\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  }" { (expression_statement "__s2 = (wchar_t *)param_1[2];" (assignment_expression "__s2 = (wchar_t *)param_1[2]" identifier = (cast_expression "(wchar_t *)param_1[2]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ]))) ;) (if_statement "if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }" if (parenthesized_expression "((wchar_t *)param_1[3] != __s2)" ( (binary_expression "(wchar_t *)param_1[3] != __s2" (cast_expression "(wchar_t *)param_1[3]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[3]" identifier [ number_literal ])) != identifier) )) (compound_statement "{\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }" { (expression_statement "sVar4 = param_1[3] - (int)__s2 >> 2;" (assignment_expression "sVar4 = param_1[3] - (int)__s2 >> 2" identifier = (binary_expression "param_1[3] - (int)__s2 >> 2" (binary_expression "param_1[3] - (int)__s2" (subscript_expression "param_1[3]" identifier [ number_literal ]) - (cast_expression "(int)__s2" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (expression_statement "__n = param_3 - iVar5;" (assignment_expression "__n = param_3 - iVar5" identifier = (binary_expression "param_3 - iVar5" identifier - identifier)) ;) (if_statement "if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }" if (parenthesized_expression "((int)sVar4 <= param_3 - iVar5)" ( (binary_expression "(int)sVar4 <= param_3 - iVar5" (cast_expression "(int)sVar4" ( (type_descriptor "int" primitive_type) ) identifier) <= (binary_expression "param_3 - iVar5" identifier - identifier)) )) (compound_statement "{\n        __n = sVar4;\n      }" { (expression_statement "__n = sVar4;" (assignment_expression "__n = sVar4" identifier = identifier) ;) })) (expression_statement "wmemcpy(param_2,__s2,__n);" (call_expression "wmemcpy(param_2,__s2,__n)" identifier (argument_list "(param_2,__s2,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "iVar5 = iVar5 + __n;" (assignment_expression "iVar5 = iVar5 + __n" identifier = (binary_expression "iVar5 + __n" identifier + identifier)) ;) (expression_statement "param_1[2] = param_1[2] + __n * 4;" (assignment_expression "param_1[2] = param_1[2] + __n * 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (binary_expression "param_1[2] + __n * 4" (subscript_expression "param_1[2]" identifier [ number_literal ]) + (binary_expression "__n * 4" identifier * number_literal))) ;) (if_statement "if (param_3 <= iVar5) {\n        return iVar5;\n      }" if (parenthesized_expression "(param_3 <= iVar5)" ( (binary_expression "param_3 <= iVar5" identifier <= identifier) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "param_2 = param_2 + __n;" (assignment_expression "param_2 = param_2 + __n" identifier = (binary_expression "param_2 + __n" identifier + identifier)) ;) })) (expression_statement "pcVar1 = *(code **)(*param_1 + 0x28);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x28)" identifier = (pointer_expression "*(code **)(*param_1 + 0x28)" * (cast_expression "(code **)(*param_1 + 0x28)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x28)" ( (binary_expression "*param_1 + 0x28" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }" if (parenthesized_expression "(pcVar1 == FUN_001f1f20)" ( (binary_expression "pcVar1 == FUN_001f1f20" identifier == identifier) )) (compound_statement "{\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }" { (expression_statement "pcVar1 = *(code **)(*param_1 + 0x24);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x24)" identifier = (pointer_expression "*(code **)(*param_1 + 0x24)" * (cast_expression "(code **)(*param_1 + 0x24)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(*param_1 + 0x24)" ( (binary_expression "*param_1 + 0x24" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (if_statement "if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }" if (parenthesized_expression "(pcVar1 == FUN_001f1c80)" ( (binary_expression "pcVar1 == FUN_001f1c80" identifier == identifier) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "iVar2 = (*pcVar1)(param_1);" (assignment_expression "iVar2 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (iVar2 == -1) {\n        return iVar5;\n      }" if (parenthesized_expression "(iVar2 == -1)" ( (binary_expression "iVar2 == -1" identifier == number_literal) )) (compound_statement "{\n        return iVar5;\n      }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "wVar3 = *(wchar_t *)param_1[2];" (assignment_expression "wVar3 = *(wchar_t *)param_1[2]" identifier = (pointer_expression "*(wchar_t *)param_1[2]" * (cast_expression "(wchar_t *)param_1[2]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])))) ;) (expression_statement "param_1[2] = (int)((wchar_t *)param_1[2] + 1);" (assignment_expression "param_1[2] = (int)((wchar_t *)param_1[2] + 1)" (subscript_expression "param_1[2]" identifier [ number_literal ]) = (cast_expression "(int)((wchar_t *)param_1[2] + 1)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "((wchar_t *)param_1[2] + 1)" ( (binary_expression "(wchar_t *)param_1[2] + 1" (cast_expression "(wchar_t *)param_1[2]" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[2]" identifier [ number_literal ])) + number_literal) )))) ;) }) (else_clause "else {\n      wVar3 = (*pcVar1)(param_1);\n    }" else (compound_statement "{\n      wVar3 = (*pcVar1)(param_1);\n    }" { (expression_statement "wVar3 = (*pcVar1)(param_1);" (assignment_expression "wVar3 = (*pcVar1)(param_1)" identifier = (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" ( (pointer_expression "*pcVar1" * identifier) )) (argument_list "(param_1)" ( identifier )))) ;) }))) (if_statement "if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }" if (parenthesized_expression "(wVar3 == L'\xffffffff')" ( (binary_expression "wVar3 == L'\xffffffff'" identifier == (char_literal "L'\xffffffff'" L' escape_sequence character character character character ')) )) (compound_statement "{\n      return iVar5;\n    }" { (return_statement "return iVar5;" return identifier ;) })) (expression_statement "iVar5 = iVar5 + 1;" (assignment_expression "iVar5 = iVar5 + 1" identifier = (binary_expression "iVar5 + 1" identifier + number_literal)) ;) (expression_statement "*param_2 = wVar3;" (assignment_expression "*param_2 = wVar3" (pointer_expression "*param_2" * identifier) = identifier) ;) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar5 < param_3)" ( (binary_expression "iVar5 < param_3" identifier < identifier) )) ;) (return_statement "return iVar5;" 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 (pointer_declarator * IDENT) ;) (declaration TYPE 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 ;) })) (do_statement do (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)) ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) + LIT) )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * IDENT) )) (argument_list ( IDENT )))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal L' escape_sequence character character character character ')) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT < IDENT) )) ;) (return_statement return IDENT ;) })))
(function_definition "int FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)\n\n{\n  wchar_t *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}" (primitive_type "int") (function_declarator "FUN_001f20c0(int *param_1,wchar_t *param_2,int param_3)" (identifier "FUN_001f20c0") (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 *__s2;\n  code *pcVar1;\n  int iVar2;\n  wchar_t wVar3;\n  size_t __n;\n  size_t sVar4;\n  int iVar5;\n  \n  iVar5 = 0;\n  if (param_3 < 1) {\n    return 0;\n  }\n  do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);\n  return iVar5;\n}" ({ "{") (declaration "wchar_t *__s2;" (type_identifier "wchar_t") (pointer_declarator "*__s2" (* "*") (identifier "__s2")) (; ";")) (declaration "code *pcVar1;" (type_identifier "code") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "wchar_t wVar3;" (type_identifier "wchar_t") (identifier "wVar3") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" (identifier "iVar5") (= "=") (number_literal "0")) (; ";")) (if_statement "if (param_3 < 1) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(param_3 < 1)" (( "(") (binary_expression "param_3 < 1" (identifier "param_3") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (do_statement "do {\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  } while (iVar5 < param_3);" (do "do") (compound_statement "{\n    __s2 = (wchar_t *)param_1[2];\n    if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }\n    pcVar1 = *(code **)(*param_1 + 0x28);\n    if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }\n    if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }\n    iVar5 = iVar5 + 1;\n    *param_2 = wVar3;\n    param_2 = param_2 + 1;\n  }" ({ "{") (expression_statement "__s2 = (wchar_t *)param_1[2];" (assignment_expression "__s2 = (wchar_t *)param_1[2]" (identifier "__s2") (= "=") (cast_expression "(wchar_t *)param_1[2]" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")))) (; ";")) (if_statement "if ((wchar_t *)param_1[3] != __s2) {\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }" (if "if") (parenthesized_expression "((wchar_t *)param_1[3] != __s2)" (( "(") (binary_expression "(wchar_t *)param_1[3] != __s2" (cast_expression "(wchar_t *)param_1[3]" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (!= "!=") (identifier "__s2")) () ")")) (compound_statement "{\n      sVar4 = param_1[3] - (int)__s2 >> 2;\n      __n = param_3 - iVar5;\n      if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }\n      wmemcpy(param_2,__s2,__n);\n      iVar5 = iVar5 + __n;\n      param_1[2] = param_1[2] + __n * 4;\n      if (param_3 <= iVar5) {\n        return iVar5;\n      }\n      param_2 = param_2 + __n;\n    }" ({ "{") (expression_statement "sVar4 = param_1[3] - (int)__s2 >> 2;" (assignment_expression "sVar4 = param_1[3] - (int)__s2 >> 2" (identifier "sVar4") (= "=") (binary_expression "param_1[3] - (int)__s2 >> 2" (binary_expression "param_1[3] - (int)__s2" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (- "-") (cast_expression "(int)__s2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__s2"))) (>> ">>") (number_literal "2"))) (; ";")) (expression_statement "__n = param_3 - iVar5;" (assignment_expression "__n = param_3 - iVar5" (identifier "__n") (= "=") (binary_expression "param_3 - iVar5" (identifier "param_3") (- "-") (identifier "iVar5"))) (; ";")) (if_statement "if ((int)sVar4 <= param_3 - iVar5) {\n        __n = sVar4;\n      }" (if "if") (parenthesized_expression "((int)sVar4 <= param_3 - iVar5)" (( "(") (binary_expression "(int)sVar4 <= param_3 - iVar5" (cast_expression "(int)sVar4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar4")) (<= "<=") (binary_expression "param_3 - iVar5" (identifier "param_3") (- "-") (identifier "iVar5"))) () ")")) (compound_statement "{\n        __n = sVar4;\n      }" ({ "{") (expression_statement "__n = sVar4;" (assignment_expression "__n = sVar4" (identifier "__n") (= "=") (identifier "sVar4")) (; ";")) (} "}"))) (expression_statement "wmemcpy(param_2,__s2,__n);" (call_expression "wmemcpy(param_2,__s2,__n)" (identifier "wmemcpy") (argument_list "(param_2,__s2,__n)" (( "(") (identifier "param_2") (, ",") (identifier "__s2") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "iVar5 = iVar5 + __n;" (assignment_expression "iVar5 = iVar5 + __n" (identifier "iVar5") (= "=") (binary_expression "iVar5 + __n" (identifier "iVar5") (+ "+") (identifier "__n"))) (; ";")) (expression_statement "param_1[2] = param_1[2] + __n * 4;" (assignment_expression "param_1[2] = param_1[2] + __n * 4" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (binary_expression "param_1[2] + __n * 4" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (+ "+") (binary_expression "__n * 4" (identifier "__n") (* "*") (number_literal "4")))) (; ";")) (if_statement "if (param_3 <= iVar5) {\n        return iVar5;\n      }" (if "if") (parenthesized_expression "(param_3 <= iVar5)" (( "(") (binary_expression "param_3 <= iVar5" (identifier "param_3") (<= "<=") (identifier "iVar5")) () ")")) (compound_statement "{\n        return iVar5;\n      }" ({ "{") (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}"))) (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"))) (; ";")) (} "}"))) (expression_statement "pcVar1 = *(code **)(*param_1 + 0x28);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x28)" (identifier "pcVar1") (= "=") (pointer_expression "*(code **)(*param_1 + 0x28)" (* "*") (cast_expression "(code **)(*param_1 + 0x28)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x28)" (( "(") (binary_expression "*param_1 + 0x28" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (pcVar1 == FUN_001f1f20) {\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }\n    else {\n      wVar3 = (*pcVar1)(param_1);\n    }" (if "if") (parenthesized_expression "(pcVar1 == FUN_001f1f20)" (( "(") (binary_expression "pcVar1 == FUN_001f1f20" (identifier "pcVar1") (== "==") (identifier "FUN_001f1f20")) () ")")) (compound_statement "{\n      pcVar1 = *(code **)(*param_1 + 0x24);\n      if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }\n      iVar2 = (*pcVar1)(param_1);\n      if (iVar2 == -1) {\n        return iVar5;\n      }\n      wVar3 = *(wchar_t *)param_1[2];\n      param_1[2] = (int)((wchar_t *)param_1[2] + 1);\n    }" ({ "{") (expression_statement "pcVar1 = *(code **)(*param_1 + 0x24);" (assignment_expression "pcVar1 = *(code **)(*param_1 + 0x24)" (identifier "pcVar1") (= "=") (pointer_expression "*(code **)(*param_1 + 0x24)" (* "*") (cast_expression "(code **)(*param_1 + 0x24)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(*param_1 + 0x24)" (( "(") (binary_expression "*param_1 + 0x24" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "0x24")) () ")"))))) (; ";")) (if_statement "if (pcVar1 == FUN_001f1c80) {\n        return iVar5;\n      }" (if "if") (parenthesized_expression "(pcVar1 == FUN_001f1c80)" (( "(") (binary_expression "pcVar1 == FUN_001f1c80" (identifier "pcVar1") (== "==") (identifier "FUN_001f1c80")) () ")")) (compound_statement "{\n        return iVar5;\n      }" ({ "{") (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}"))) (expression_statement "iVar2 = (*pcVar1)(param_1);" (assignment_expression "iVar2 = (*pcVar1)(param_1)" (identifier "iVar2") (= "=") (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" (( "(") (pointer_expression "*pcVar1" (* "*") (identifier "pcVar1")) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (iVar2 == -1) {\n        return iVar5;\n      }" (if "if") (parenthesized_expression "(iVar2 == -1)" (( "(") (binary_expression "iVar2 == -1" (identifier "iVar2") (== "==") (number_literal "-1")) () ")")) (compound_statement "{\n        return iVar5;\n      }" ({ "{") (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}"))) (expression_statement "wVar3 = *(wchar_t *)param_1[2];" (assignment_expression "wVar3 = *(wchar_t *)param_1[2]" (identifier "wVar3") (= "=") (pointer_expression "*(wchar_t *)param_1[2]" (* "*") (cast_expression "(wchar_t *)param_1[2]" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))))) (; ";")) (expression_statement "param_1[2] = (int)((wchar_t *)param_1[2] + 1);" (assignment_expression "param_1[2] = (int)((wchar_t *)param_1[2] + 1)" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (= "=") (cast_expression "(int)((wchar_t *)param_1[2] + 1)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "((wchar_t *)param_1[2] + 1)" (( "(") (binary_expression "(wchar_t *)param_1[2] + 1" (cast_expression "(wchar_t *)param_1[2]" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (+ "+") (number_literal "1")) () ")")))) (; ";")) (} "}")) (else_clause "else {\n      wVar3 = (*pcVar1)(param_1);\n    }" (else "else") (compound_statement "{\n      wVar3 = (*pcVar1)(param_1);\n    }" ({ "{") (expression_statement "wVar3 = (*pcVar1)(param_1);" (assignment_expression "wVar3 = (*pcVar1)(param_1)" (identifier "wVar3") (= "=") (call_expression "(*pcVar1)(param_1)" (parenthesized_expression "(*pcVar1)" (( "(") (pointer_expression "*pcVar1" (* "*") (identifier "pcVar1")) () ")")) (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (} "}")))) (if_statement "if (wVar3 == L'\xffffffff') {\n      return iVar5;\n    }" (if "if") (parenthesized_expression "(wVar3 == L'\xffffffff')" (( "(") (binary_expression "wVar3 == L'\xffffffff'" (identifier "wVar3") (== "==") (char_literal "L'\xffffffff'" (L' "L'") (escape_sequence "\xffff") (character "f") (character "f") (character "f") (character "f") (' "'"))) () ")")) (compound_statement "{\n      return iVar5;\n    }" ({ "{") (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}"))) (expression_statement "iVar5 = iVar5 + 1;" (assignment_expression "iVar5 = iVar5 + 1" (identifier "iVar5") (= "=") (binary_expression "iVar5 + 1" (identifier "iVar5") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*param_2 = wVar3;" (assignment_expression "*param_2 = wVar3" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "wVar3")) (; ";")) (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"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar5 < param_3)" (( "(") (binary_expression "iVar5 < param_3" (identifier "iVar5") (< "<") (identifier "param_3")) () ")")) (; ";")) (return_statement "return iVar5;" (return "return") (identifier "iVar5") (; ";")) (} "}")))

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

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

{
  type_2 *var_3;
  type_3 *var_8;
  int var_11;
  type_2 var_12;
  size_t var_6;
  size_t sVar4;
  int var_4;
  
  var_4 = 0;
  if (var_1 < 1) {
    return 0;
  }
  do {
    var_3 = *(type_2 **)(var_2 + 8);
    if (*(type_2 **)(var_2 + 0xc) != var_3) {
      sVar4 = (int)*(type_2 **)(var_2 + 0xc) - (int)var_3 >> 2;
      var_6 = var_1 - var_4;
      if ((int)sVar4 <= var_1 - var_4) {
        var_6 = sVar4;
      }
      var_5(var_7,var_3,var_6);
      var_4 = var_4 + var_6;
      *(size_t *)(var_2 + 8) = *(int *)(var_2 + 8) + var_6 * 4;
      if (var_1 <= var_4) {
        return var_4;
      }
      var_7 = var_7 + var_6;
    }
    var_8 = *(type_3 **)(*(int *)var_2 + 0x28);
    if (var_8 == var_9) {
      var_8 = *(type_3 **)(*(int *)var_2 + 0x24);
      if (var_8 == var_10) {
        return var_4;
      }
      var_11 = (*var_8)(var_2);
      if (var_11 == -1) {
        return var_4;
      }
      var_12 = **(type_2 **)(var_2 + 8);
      *(type_2 **)(var_2 + 8) = *(type_2 **)(var_2 + 8) + 1;
    }
    else {
      var_12 = (*var_8)(var_2);
    }
    if (var_12 == L'\xffffffff') {
      return var_4;
    }
    var_4 = var_4 + 1;
    *var_7 = var_12;
    var_7 = var_7 + 1;
  } while (var_4 < var_1);
  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: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) 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)))) (do_statement 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)))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (identifier))) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal)))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (number_literal))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (identifier))) arguments: (argument_list (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence) (character) (character) (character) (character)))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (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 *__s2;
  code *pcVar1;
  int iVar2;
  wchar_t wVar3;
  size_t __n;
  size_t sVar4;
  int iVar5;
  
  iVar5 = 0;
  if (param_3 < 1) {
    return 0;
  }
  do {
    __s2 = (wchar_t *)param_1[2];
    if ((wchar_t *)param_1[3] != __s2) {
      sVar4 = param_1[3] - (int)__s2 >> 2;
      __n = param_3 - iVar5;
      if ((int)sVar4 <= param_3 - iVar5) {
        __n = sVar4;
      }
      wmemcpy(param_2,__s2,__n);
      iVar5 = iVar5 + __n;
      param_1[2] = param_1[2] + __n * 4;
      if (param_3 <= iVar5) {
        return iVar5;
      }
      param_2 = param_2 + __n;
    }
    pcVar1 = *(code **)(*param_1 + 0x28);
    if (pcVar1 == FUN_001f1f20) {
      pcVar1 = *(code **)(*param_1 + 0x24);
      if (pcVar1 == FUN_001f1c80) {
        return iVar5;
      }
      iVar2 = (*pcVar1)(param_1);
      if (iVar2 == -1) {
        return iVar5;
      }
      wVar3 = *(wchar_t *)param_1[2];
      param_1[2] = (int)((wchar_t *)param_1[2] + 1);
    }
    else {
      wVar3 = (*pcVar1)(param_1);
    }
    if (wVar3 == L'\xffffffff') {
      return iVar5;
    }
    iVar5 = iVar5 + 1;
    *param_2 = wVar3;
    param_2 = param_2 + 1;
  } while (iVar5 < param_3);
  return iVar5;
}

