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

wstring * __thiscall
std::wstring::_M_replace(wstring *this,uint param_1,uint param_2,wchar_t *param_3,uint param_4)

{
  uint uVar1;
  wstring *__s1;
  int iVar2;
  wstring *pwVar3;
  size_t sVar4;
  uint uVar5;
  bool bVar6;
  bool bVar7;
  
  iVar2 = *(int *)(this + 4);
  if ((param_2 + 0x1fffffff) - iVar2 < param_4) {
                    /* WARNING: Subroutine does not return */
    __throw_length_error("basic_string::_M_replace");
  }
  uVar1 = iVar2 + (param_4 - param_2);
  pwVar3 = *(wstring **)this;
  if (pwVar3 == this + 8) {
    uVar5 = 3;
  }
  else {
    uVar5 = *(uint *)(this + 8);
  }
  if (uVar5 < uVar1) {
    _M_mutate(this,param_1,param_2,param_3,param_4);
    goto LAB_001ec0f9;
  }
  __s1 = pwVar3 + param_1 * 4;
  sVar4 = iVar2 - (param_1 + param_2);
  bVar6 = sVar4 != 0;
  bVar7 = param_2 != param_4;
  if ((param_3 < pwVar3) || (pwVar3 + iVar2 * 4 < param_3)) {
    if (bVar6 && bVar7) {
      if (sVar4 == 1) {
        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);
      }
      else {
        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);
      }
    }
    if (param_4 == 0) goto LAB_001ec0f9;
    if (param_4 != 1) {
      wmemcpy((wchar_t *)__s1,param_3,param_4);
      goto LAB_001ec0f9;
    }
  }
  else {
    if ((param_4 == 0) || (param_2 < param_4)) {
LAB_001ec254:
      if (bVar6 && bVar7) goto LAB_001ec160;
    }
    else {
      if (param_4 == 1) {
        *(wchar_t *)__s1 = *param_3;
        goto LAB_001ec254;
      }
      wmemmove((wchar_t *)__s1,param_3,param_4);
      if (!bVar6 || !bVar7) goto LAB_001ec0f9;
LAB_001ec160:
      if (sVar4 == 1) {
        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);
      }
      else {
        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);
      }
    }
    if (param_4 <= param_2) goto LAB_001ec0f9;
    pwVar3 = __s1 + param_2 * 4;
    if (pwVar3 < (wstring *)(param_3 + param_4)) {
      if (param_3 < pwVar3) {
        sVar4 = (int)pwVar3 - (int)param_3 >> 2;
        if (sVar4 == 1) {
          *(wchar_t *)__s1 = *param_3;
        }
        else if (sVar4 != 0) {
          wmemmove((wchar_t *)__s1,param_3,sVar4);
        }
        sVar4 = param_4 - sVar4;
        if (sVar4 == 1) {
          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);
        }
        else if (sVar4 != 0) {
          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),
                  sVar4);
        }
      }
      else if (param_4 == 1) {
        *(wchar_t *)__s1 = param_3[param_4 - param_2];
      }
      else {
        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);
      }
      goto LAB_001ec0f9;
    }
    if (param_4 != 1) {
      wmemmove((wchar_t *)__s1,param_3,param_4);
      goto LAB_001ec0f9;
    }
  }
  *(wchar_t *)__s1 = *param_3;
LAB_001ec0f9:
  *(uint *)(this + 4) = uVar1;
  *(undefined4 *)(*(int *)this + uVar1 * 4) = 0;
  return this;
}



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

uint * FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)

{
  uint uVar1;
  wchar_t *__s1;
  uint uVar2;
  wchar_t *pwVar3;
  size_t sVar4;
  uint uVar5;
  bool bVar6;
  bool bVar7;
  
  uVar2 = param_1[1];
  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c7a0("basic_string::_M_replace");
  }
  uVar1 = uVar2 + (param_5 - param_3);
  pwVar3 = (wchar_t *)*param_1;
  if (pwVar3 == (wchar_t *)(param_1 + 2)) {
    uVar5 = 3;
  }
  else {
    uVar5 = param_1[2];
  }
  if (uVar5 < uVar1) {
    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);
    goto LAB_001ec0f9;
  }
  __s1 = pwVar3 + param_2;
  sVar4 = uVar2 - (param_2 + param_3);
  bVar6 = sVar4 != 0;
  bVar7 = param_3 != param_5;
  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {
    if (bVar6 && bVar7) {
      if (sVar4 == 1) {
        __s1[param_5] = __s1[param_3];
      }
      else {
        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);
      }
    }
    if (param_5 == 0) goto LAB_001ec0f9;
    if (param_5 != 1) {
      wmemcpy(__s1,param_4,param_5);
      goto LAB_001ec0f9;
    }
  }
  else {
    if ((param_5 == 0) || (param_3 < param_5)) {
LAB_001ec254:
      if (bVar6 && bVar7) goto LAB_001ec160;
    }
    else {
      if (param_5 == 1) {
        *__s1 = *param_4;
        goto LAB_001ec254;
      }
      wmemmove(__s1,param_4,param_5);
      if (!bVar6 || !bVar7) goto LAB_001ec0f9;
LAB_001ec160:
      if (sVar4 == 1) {
        __s1[param_5] = __s1[param_3];
      }
      else {
        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);
      }
    }
    if (param_5 <= param_3) goto LAB_001ec0f9;
    pwVar3 = __s1 + param_3;
    if (pwVar3 < param_4 + param_5) {
      if (param_4 < pwVar3) {
        sVar4 = (int)pwVar3 - (int)param_4 >> 2;
        if (sVar4 == 1) {
          *__s1 = *param_4;
        }
        else if (sVar4 != 0) {
          wmemmove(__s1,param_4,sVar4);
        }
        sVar4 = param_5 - sVar4;
        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));
        if (sVar4 == 1) {
          *pwVar3 = __s1[param_5];
        }
        else if (sVar4 != 0) {
          wmemcpy(pwVar3,__s1 + param_5,sVar4);
        }
      }
      else if (param_5 == 1) {
        *__s1 = param_4[param_5 - param_3];
      }
      else {
        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);
      }
      goto LAB_001ec0f9;
    }
    if (param_5 != 1) {
      wmemmove(__s1,param_4,param_5);
      goto LAB_001ec0f9;
    }
  }
  *__s1 = *param_4;
LAB_001ec0f9:
  param_1[1] = uVar1;
  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;
  return param_1;
}


CALL 0x000559e6
ADD EAX,0x1a2fdb
PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
SUB ESP,0x2c
MOV ESI,dword ptr [ESP + 0x40]
MOV EBX,dword ptr [ESP + 0x48]
MOV dword ptr [ESP + 0xc],EAX
MOV EDI,dword ptr [ESP + 0x50]
MOV EAX,dword ptr [ESP + 0x44]
MOV EDX,dword ptr [ESI + 0x4]
LEA ECX,[EBX + 0x1fffffff]
SUB ECX,EDX
CMP EDI,ECX
JA 0x001ec332
MOV EBX,EDI
SUB EBX,dword ptr [ESP + 0x48]
LEA ECX,[ESI + 0x8]
MOV dword ptr [ESP + 0x18],EBX
LEA EBP,[EDX + EBX*0x1]
MOV EBX,dword ptr [ESI]
CMP EBX,ECX
JZ 0x001ec238
MOV ECX,dword ptr [ESI + 0x8]
CMP ECX,EBP
JC 0x001ec1f0
LEA ECX,[EBX + EAX*0x4]
ADD EAX,dword ptr [ESP + 0x48]
MOV dword ptr [ESP + 0x10],ECX
MOV ECX,EDX
SUB ECX,EAX
MOV dword ptr [ESP + 0x14],ECX
SETNZ CL
CMP dword ptr [ESP + 0x48],EDI
SETNZ AL
AND ECX,EAX
CMP EBX,dword ptr [ESP + 0x4c]
JBE 0x001ec110
TEST CL,CL
JZ 0x001ec0d4
MOV EAX,dword ptr [ESP + 0x10]
MOV EDX,dword ptr [ESP + 0x48]
CMP dword ptr [ESP + 0x14],0x1
LEA EDX,[EAX + EDX*0x4]
LEA EAX,[EAX + EDI*0x4]
JZ 0x001ec228
SUB ESP,0x4
PUSH dword ptr [ESP + 0x18]
PUSH EDX
PUSH EAX
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029260
ADD ESP,0x10
TEST EDI,EDI
JZ 0x001ec0f9
CMP EDI,0x1
JZ 0x001ec210
SUB ESP,0x4
PUSH EDI
PUSH dword ptr [ESP + 0x54]
PUSH dword ptr [ESP + 0x1c]
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029370
ADD ESP,0x10
MOV EAX,dword ptr [ESI]
MOV dword ptr [ESI + 0x4],EBP
MOV dword ptr [EAX + EBP*0x4],0x0
ADD ESP,0x2c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
LEA EAX,[EBX + EDX*0x4]
CMP dword ptr [ESP + 0x4c],EAX
JA 0x001ec0a2
TEST EDI,EDI
JZ 0x001ec254
CMP dword ptr [ESP + 0x48],EDI
JC 0x001ec254
CMP EDI,0x1
JZ 0x001ec248
MOV byte ptr [ESP + 0x1c],CL
SUB ESP,0x4
PUSH EDI
PUSH dword ptr [ESP + 0x54]
PUSH dword ptr [ESP + 0x1c]
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029260
ADD ESP,0x10
MOVZX ECX,byte ptr [ESP + 0x1c]
TEST CL,CL
JZ 0x001ec0f9
LEA ESI,[ESI]
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x48]
CMP dword ptr [ESP + 0x14],0x1
LEA EAX,[EDX + EAX*0x4]
LEA EDX,[EDX + EDI*0x4]
JZ 0x001ec290
SUB ESP,0x4
PUSH dword ptr [ESP + 0x18]
PUSH EAX
PUSH EDX
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029260
ADD ESP,0x10
CMP dword ptr [ESP + 0x48],EDI
JNC 0x001ec0f9
MOV EDX,dword ptr [ESP + 0x48]
MOV EAX,dword ptr [ESP + 0x10]
LEA ECX,[EDI*0x4 + 0x0]
LEA EAX,[EAX + EDX*0x4]
MOV EDX,dword ptr [ESP + 0x4c]
ADD EDX,ECX
CMP EAX,EDX
JNC 0x001ec268
CMP EAX,dword ptr [ESP + 0x4c]
JA 0x001ec2a0
MOV EAX,dword ptr [ESP + 0x4c]
MOV EDX,dword ptr [ESP + 0x18]
LEA EAX,[EAX + EDX*0x4]
CMP EDI,0x1
JZ 0x001ec325
SUB ESP,0x4
PUSH EDI
PUSH EAX
PUSH dword ptr [ESP + 0x1c]
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029370
ADD ESP,0x10
JMP 0x001ec0f9
SUB ESP,0xc
PUSH EDI
PUSH dword ptr [ESP + 0x5c]
PUSH dword ptr [ESP + 0x5c]
PUSH EAX
PUSH ESI
MOV EBX,dword ptr [ESP + 0x2c]
CALL 0x001eb0a0
ADD ESP,0x20
JMP 0x001ec0f9
MOV EAX,dword ptr [ESP + 0x4c]
MOV EDI,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [EAX]
MOV dword ptr [EDI],EAX
JMP 0x001ec0f9
MOV EDX,dword ptr [EDX]
MOV dword ptr [EAX],EDX
JMP 0x001ec0d4
MOV ECX,0x3
JMP 0x001ec075
MOV EAX,dword ptr [ESP + 0x4c]
MOV EDX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [EAX]
MOV dword ptr [EDX],EAX
TEST CL,CL
JZ 0x001ec18e
JMP 0x001ec160
CMP EDI,0x1
JZ 0x001ec210
SUB ESP,0x4
PUSH EDI
PUSH dword ptr [ESP + 0x54]
PUSH dword ptr [ESP + 0x1c]
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029260
ADD ESP,0x10
JMP 0x001ec0f9
MOV EAX,dword ptr [EAX]
MOV dword ptr [EDX],EAX
JMP 0x001ec18e
SUB EAX,dword ptr [ESP + 0x4c]
MOV EDX,EAX
MOV dword ptr [ESP + 0x14],EAX
SAR EDX,0x2
CMP EDX,0x1
JZ 0x001ec30e
TEST EDX,EDX
JZ 0x001ec2de
MOV dword ptr [ESP + 0x1c],ECX
SUB ESP,0x4
PUSH EDX
MOV dword ptr [ESP + 0x20],EDX
PUSH dword ptr [ESP + 0x54]
PUSH dword ptr [ESP + 0x1c]
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029260
ADD ESP,0x10
MOV ECX,dword ptr [ESP + 0x1c]
MOV EDX,dword ptr [ESP + 0x18]
MOV EAX,dword ptr [ESP + 0x10]
SUB EDI,EDX
ADD ECX,EAX
ADD EAX,dword ptr [ESP + 0x14]
CMP EDI,0x1
JZ 0x001ec31c
TEST EDI,EDI
JZ 0x001ec0f9
SUB ESP,0x4
PUSH EDI
PUSH ECX
PUSH EAX
MOV EBX,dword ptr [ESP + 0x1c]
CALL 0x00029370
ADD ESP,0x10
JMP 0x001ec0f9
MOV EAX,dword ptr [ESP + 0x4c]
MOV EBX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [EAX]
MOV dword ptr [EBX],EAX
JMP 0x001ec2de
MOV EDX,dword ptr [ECX]
MOV dword ptr [EAX],EDX
JMP 0x001ec0f9
MOV EAX,dword ptr [EAX]
MOV EDI,dword ptr [ESP + 0x10]
MOV dword ptr [EDI],EAX
JMP 0x001ec0f9
SUB ESP,0xc
MOV EBX,dword ptr [ESP + 0x18]
LEA EAX,[EBX + 0xfff14d68]
PUSH EAX
CALL 0x0022c7a0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n\nuint * FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)\n\n{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}\n\n" comment (function_definition "uint * FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)\n\n{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}" type_identifier (pointer_declarator "* FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" * (function_declarator "FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" identifier (parameter_list "(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "wchar_t *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "uint param_5" type_identifier identifier) )))) (compound_statement "{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "wchar_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "bool bVar6;" primitive_type identifier ;) (declaration "bool bVar7;" primitive_type identifier ;) (expression_statement "uVar2 = param_1[1];" (assignment_expression "uVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::_M_replace");\n  }" if (parenthesized_expression "((param_3 + 0x1fffffff) - uVar2 < param_5)" ( (binary_expression "(param_3 + 0x1fffffff) - uVar2 < param_5" (binary_expression "(param_3 + 0x1fffffff) - uVar2" (parenthesized_expression "(param_3 + 0x1fffffff)" ( (binary_expression "param_3 + 0x1fffffff" identifier + number_literal) )) - identifier) < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_0022c7a0("basic_string::_M_replace");\n  }" { comment (expression_statement "FUN_0022c7a0("basic_string::_M_replace");" (call_expression "FUN_0022c7a0("basic_string::_M_replace")" identifier (argument_list "("basic_string::_M_replace")" ( (string_literal ""basic_string::_M_replace"" " string_content ") ))) ;) })) (expression_statement "uVar1 = uVar2 + (param_5 - param_3);" (assignment_expression "uVar1 = uVar2 + (param_5 - param_3)" identifier = (binary_expression "uVar2 + (param_5 - param_3)" identifier + (parenthesized_expression "(param_5 - param_3)" ( (binary_expression "param_5 - param_3" identifier - identifier) )))) ;) (expression_statement "pwVar3 = (wchar_t *)*param_1;" (assignment_expression "pwVar3 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }" if (parenthesized_expression "(pwVar3 == (wchar_t *)(param_1 + 2))" ( (binary_expression "pwVar3 == (wchar_t *)(param_1 + 2)" identifier == (cast_expression "(wchar_t *)(param_1 + 2)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) )) (compound_statement "{\n    uVar5 = 3;\n  }" { (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar5 = param_1[2];\n  }" else (compound_statement "{\n    uVar5 = param_1[2];\n  }" { (expression_statement "uVar5 = param_1[2];" (assignment_expression "uVar5 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }" if (parenthesized_expression "(uVar5 < uVar1)" ( (binary_expression "uVar5 < uVar1" identifier < identifier) )) (compound_statement "{\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }" { (expression_statement "FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);" (call_expression "FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5)" identifier (argument_list "(param_1,param_2,param_3,param_4,param_5)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) (expression_statement "__s1 = pwVar3 + param_2;" (assignment_expression "__s1 = pwVar3 + param_2" identifier = (binary_expression "pwVar3 + param_2" identifier + identifier)) ;) (expression_statement "sVar4 = uVar2 - (param_2 + param_3);" (assignment_expression "sVar4 = uVar2 - (param_2 + param_3)" identifier = (binary_expression "uVar2 - (param_2 + param_3)" identifier - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (expression_statement "bVar6 = sVar4 != 0;" (assignment_expression "bVar6 = sVar4 != 0" identifier = (binary_expression "sVar4 != 0" identifier != number_literal)) ;) (expression_statement "bVar7 = param_3 != param_5;" (assignment_expression "bVar7 = param_3 != param_5" identifier = (binary_expression "param_3 != param_5" identifier != identifier)) ;) (if_statement "if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" if (parenthesized_expression "((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4))" ( (binary_expression "(param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)" (parenthesized_expression "(param_4 < pwVar3)" ( (binary_expression "param_4 < pwVar3" identifier < identifier) )) || (parenthesized_expression "(pwVar3 + uVar2 < param_4)" ( (binary_expression "pwVar3 + uVar2 < param_4" (binary_expression "pwVar3 + uVar2" identifier + identifier) < identifier) ))) )) (compound_statement "{\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" { (if_statement "if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" if (parenthesized_expression "(bVar6 && bVar7)" ( (binary_expression "bVar6 && bVar7" identifier && identifier) )) (compound_statement "{\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" { (if_statement "if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n        __s1[param_5] = __s1[param_3];\n      }" { (expression_statement "__s1[param_5] = __s1[param_3];" (assignment_expression "__s1[param_5] = __s1[param_3]" (subscript_expression "__s1[param_5]" identifier [ identifier ]) = (subscript_expression "__s1[param_3]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" else (compound_statement "{\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" { (expression_statement "wmemmove(__s1 + param_5,__s1 + param_3,sVar4);" (call_expression "wmemmove(__s1 + param_5,__s1 + param_3,sVar4)" identifier (argument_list "(__s1 + param_5,__s1 + param_3,sVar4)" ( (binary_expression "__s1 + param_5" identifier + identifier) , (binary_expression "__s1 + param_3" identifier + identifier) , identifier ))) ;) }))) })) (if_statement "if (param_5 == 0) goto LAB_001ec0f9;" if (parenthesized_expression "(param_5 == 0)" ( (binary_expression "param_5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (if_statement "if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(param_5 != 1)" ( (binary_expression "param_5 != 1" identifier != number_literal) )) (compound_statement "{\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" { (expression_statement "wmemcpy(__s1,param_4,param_5);" (call_expression "wmemcpy(__s1,param_4,param_5)" identifier (argument_list "(__s1,param_4,param_5)" ( identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) }) (else_clause "else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" else (compound_statement "{\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" { (if_statement "if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" if (parenthesized_expression "((param_5 == 0) || (param_3 < param_5))" ( (binary_expression "(param_5 == 0) || (param_3 < param_5)" (parenthesized_expression "(param_5 == 0)" ( (binary_expression "param_5 == 0" identifier == number_literal) )) || (parenthesized_expression "(param_3 < param_5)" ( (binary_expression "param_3 < param_5" identifier < identifier) ))) )) (compound_statement "{\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }" { (labeled_statement "LAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;" statement_identifier : (if_statement "if (bVar6 && bVar7) goto LAB_001ec160;" if (parenthesized_expression "(bVar6 && bVar7)" ( (binary_expression "bVar6 && bVar7" identifier && identifier) )) (goto_statement "goto LAB_001ec160;" goto statement_identifier ;))) }) (else_clause "else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" else (compound_statement "{\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" { (if_statement "if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }" if (parenthesized_expression "(param_5 == 1)" ( (binary_expression "param_5 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }" { (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" * identifier) = (pointer_expression "*param_4" * identifier)) ;) (goto_statement "goto LAB_001ec254;" goto statement_identifier ;) })) (expression_statement "wmemmove(__s1,param_4,param_5);" (call_expression "wmemmove(__s1,param_4,param_5)" identifier (argument_list "(__s1,param_4,param_5)" ( identifier , identifier , identifier ))) ;) (if_statement "if (!bVar6 || !bVar7) goto LAB_001ec0f9;" if (parenthesized_expression "(!bVar6 || !bVar7)" ( (binary_expression "!bVar6 || !bVar7" (unary_expression "!bVar6" ! identifier) || (unary_expression "!bVar7" ! identifier)) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (labeled_statement "LAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" statement_identifier : (if_statement "if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n        __s1[param_5] = __s1[param_3];\n      }" { (expression_statement "__s1[param_5] = __s1[param_3];" (assignment_expression "__s1[param_5] = __s1[param_3]" (subscript_expression "__s1[param_5]" identifier [ identifier ]) = (subscript_expression "__s1[param_3]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" else (compound_statement "{\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" { (expression_statement "wmemmove(__s1 + param_5,__s1 + param_3,sVar4);" (call_expression "wmemmove(__s1 + param_5,__s1 + param_3,sVar4)" identifier (argument_list "(__s1 + param_5,__s1 + param_3,sVar4)" ( (binary_expression "__s1 + param_5" identifier + identifier) , (binary_expression "__s1 + param_3" identifier + identifier) , identifier ))) ;) })))) }))) (if_statement "if (param_5 <= param_3) goto LAB_001ec0f9;" if (parenthesized_expression "(param_5 <= param_3)" ( (binary_expression "param_5 <= param_3" identifier <= identifier) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (expression_statement "pwVar3 = __s1 + param_3;" (assignment_expression "pwVar3 = __s1 + param_3" identifier = (binary_expression "__s1 + param_3" identifier + identifier)) ;) (if_statement "if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(pwVar3 < param_4 + param_5)" ( (binary_expression "pwVar3 < param_4 + param_5" identifier < (binary_expression "param_4 + param_5" identifier + identifier)) )) (compound_statement "{\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }" { (if_statement "if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" if (parenthesized_expression "(param_4 < pwVar3)" ( (binary_expression "param_4 < pwVar3" identifier < identifier) )) (compound_statement "{\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }" { (expression_statement "sVar4 = (int)pwVar3 - (int)param_4 >> 2;" (assignment_expression "sVar4 = (int)pwVar3 - (int)param_4 >> 2" identifier = (binary_expression "(int)pwVar3 - (int)param_4 >> 2" (binary_expression "(int)pwVar3 - (int)param_4" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (if_statement "if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *param_4;\n        }" { (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" * identifier) = (pointer_expression "*param_4" * identifier)) ;) }) (else_clause "else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" else (if_statement "if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemmove(__s1,param_4,sVar4);\n        }" { (expression_statement "wmemmove(__s1,param_4,sVar4);" (call_expression "wmemmove(__s1,param_4,sVar4)" identifier (argument_list "(__s1,param_4,sVar4)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "sVar4 = param_5 - sVar4;" (assignment_expression "sVar4 = param_5 - sVar4" identifier = (binary_expression "param_5 - sVar4" identifier - identifier)) ;) (expression_statement "pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));" (assignment_expression "pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4))" identifier = (cast_expression "(wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__s1 + ((int)pwVar3 - (int)param_4))" ( (binary_expression "(int)__s1 + ((int)pwVar3 - (int)param_4)" (cast_expression "(int)__s1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "((int)pwVar3 - (int)param_4)" ( (binary_expression "(int)pwVar3 - (int)param_4" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )))) ;) (if_statement "if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n          *pwVar3 = __s1[param_5];\n        }" { (expression_statement "*pwVar3 = __s1[param_5];" (assignment_expression "*pwVar3 = __s1[param_5]" (pointer_expression "*pwVar3" * identifier) = (subscript_expression "__s1[param_5]" identifier [ identifier ])) ;) }) (else_clause "else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" else (if_statement "if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" { (expression_statement "wmemcpy(pwVar3,__s1 + param_5,sVar4);" (call_expression "wmemcpy(pwVar3,__s1 + param_5,sVar4)" identifier (argument_list "(pwVar3,__s1 + param_5,sVar4)" ( identifier , (binary_expression "__s1 + param_5" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" else (if_statement "if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" if (parenthesized_expression "(param_5 == 1)" ( (binary_expression "param_5 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = param_4[param_5 - param_3];\n      }" { (expression_statement "*__s1 = param_4[param_5 - param_3];" (assignment_expression "*__s1 = param_4[param_5 - param_3]" (pointer_expression "*__s1" * identifier) = (subscript_expression "param_4[param_5 - param_3]" identifier [ (binary_expression "param_5 - param_3" identifier - identifier) ])) ;) }) (else_clause "else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" else (compound_statement "{\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" { (expression_statement "wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);" (call_expression "wmemcpy(__s1,param_4 + (param_5 - param_3),param_5)" identifier (argument_list "(__s1,param_4 + (param_5 - param_3),param_5)" ( identifier , (binary_expression "param_4 + (param_5 - param_3)" identifier + (parenthesized_expression "(param_5 - param_3)" ( (binary_expression "param_5 - param_3" identifier - identifier) ))) , identifier ))) ;) }))))) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) (if_statement "if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(param_5 != 1)" ( (binary_expression "param_5 != 1" identifier != number_literal) )) (compound_statement "{\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" { (expression_statement "wmemmove(__s1,param_4,param_5);" (call_expression "wmemmove(__s1,param_4,param_5)" identifier (argument_list "(__s1,param_4,param_5)" ( identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) }))) (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" * identifier) = (pointer_expression "*param_4" * identifier)) ;) (labeled_statement "LAB_001ec0f9:\n  param_1[1] = uVar1;" statement_identifier : (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;)) (expression_statement "*(undefined4 *)(*param_1 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)(*param_1 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)(*param_1 + uVar1 * 4)" * (cast_expression "(undefined4 *)(*param_1 + uVar1 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + uVar1 * 4)" ( (binary_expression "*param_1 + uVar1 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.ax replaced with injection: get_pc_thunk_ax */\n/* std::wstring::_M_replace(unsigned int, unsigned int, wchar_t const*, unsigned int) */\n\nwstring * __thiscall\nstd::wstring::_M_replace(wstring *this,uint param_1,uint param_2,wchar_t *param_3,uint param_4)\n\n{\n  uint uVar1;\n  wstring *__s1;\n  int iVar2;\n  wstring *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  iVar2 = *(int *)(this + 4);\n  if ((param_2 + 0x1fffffff) - iVar2 < param_4) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::_M_replace");\n  }\n  uVar1 = iVar2 + (param_4 - param_2);\n  pwVar3 = *(wstring **)this;\n  if (pwVar3 == this + 8) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = *(uint *)(this + 8);\n  }\n  if (uVar5 < uVar1) {\n    _M_mutate(this,param_1,param_2,param_3,param_4);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_1 * 4;\n  sVar4 = iVar2 - (param_1 + param_2);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_2 != param_4;\n  if ((param_3 < pwVar3) || (pwVar3 + iVar2 * 4 < param_3)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 == 0) goto LAB_001ec0f9;\n    if (param_4 != 1) {\n      wmemcpy((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_4 == 0) || (param_2 < param_4)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 <= param_2) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_2 * 4;\n    if (pwVar3 < (wstring *)(param_3 + param_4)) {\n      if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_4 != 1) {\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }\n  *(wchar_t *)__s1 = *param_3;\nLAB_001ec0f9:\n  *(uint *)(this + 4) = uVar1;\n  *(undefined4 *)(*(int *)this + uVar1 * 4) = 0;\n  return this;\n}\n\n" comment comment (ERROR "wstring * __thiscall\nstd::wstring::_M_replace(wstring *this," (binary_expression "wstring * __thiscall\nstd::wstring::_M_replace(wstring *this" (binary_expression "wstring * __thiscall" identifier * identifier) (ERROR "std::wstring::_M_replace(wstring" identifier : : identifier : : identifier ( identifier) * identifier) ,) (declaration "uint param_1,uint param_2,wchar_t *param_3,uint param_4)\n\n{\n  uint uVar1;" type_identifier identifier , (ERROR "uint" identifier) identifier , (ERROR "wchar_t" identifier) (pointer_declarator "*param_3" * identifier) , (ERROR "uint param_4)\n\n{\n  uint" identifier identifier ) { identifier) identifier ;) (declaration "wstring *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "wstring *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "bool bVar6;" primitive_type identifier ;) (declaration "bool bVar7;" primitive_type identifier ;) (expression_statement "iVar2 = *(int *)(this + 4);" (assignment_expression "iVar2 = *(int *)(this + 4)" identifier = (pointer_expression "*(int *)(this + 4)" * (cast_expression "(int *)(this + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) ))))) ;) (if_statement "if ((param_2 + 0x1fffffff) - iVar2 < param_4) {\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::_M_replace");\n  }" if (parenthesized_expression "((param_2 + 0x1fffffff) - iVar2 < param_4)" ( (binary_expression "(param_2 + 0x1fffffff) - iVar2 < param_4" (binary_expression "(param_2 + 0x1fffffff) - iVar2" (parenthesized_expression "(param_2 + 0x1fffffff)" ( (binary_expression "param_2 + 0x1fffffff" identifier + number_literal) )) - identifier) < identifier) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __throw_length_error("basic_string::_M_replace");\n  }" { comment (expression_statement "__throw_length_error("basic_string::_M_replace");" (call_expression "__throw_length_error("basic_string::_M_replace")" identifier (argument_list "("basic_string::_M_replace")" ( (string_literal ""basic_string::_M_replace"" " string_content ") ))) ;) })) (expression_statement "uVar1 = iVar2 + (param_4 - param_2);" (assignment_expression "uVar1 = iVar2 + (param_4 - param_2)" identifier = (binary_expression "iVar2 + (param_4 - param_2)" identifier + (parenthesized_expression "(param_4 - param_2)" ( (binary_expression "param_4 - param_2" identifier - identifier) )))) ;) (expression_statement "pwVar3 = *(wstring **)this;" (assignment_expression "pwVar3 = *(wstring **)this" identifier = (pointer_expression "*(wstring **)this" * (cast_expression "(wstring **)this" ( (type_descriptor "wstring **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (pwVar3 == this + 8) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = *(uint *)(this + 8);\n  }" if (parenthesized_expression "(pwVar3 == this + 8)" ( (binary_expression "pwVar3 == this + 8" identifier == (binary_expression "this + 8" identifier + number_literal)) )) (compound_statement "{\n    uVar5 = 3;\n  }" { (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar5 = *(uint *)(this + 8);\n  }" else (compound_statement "{\n    uVar5 = *(uint *)(this + 8);\n  }" { (expression_statement "uVar5 = *(uint *)(this + 8);" (assignment_expression "uVar5 = *(uint *)(this + 8)" identifier = (pointer_expression "*(uint *)(this + 8)" * (cast_expression "(uint *)(this + 8)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) ))))) ;) }))) (if_statement "if (uVar5 < uVar1) {\n    _M_mutate(this,param_1,param_2,param_3,param_4);\n    goto LAB_001ec0f9;\n  }" if (parenthesized_expression "(uVar5 < uVar1)" ( (binary_expression "uVar5 < uVar1" identifier < identifier) )) (compound_statement "{\n    _M_mutate(this,param_1,param_2,param_3,param_4);\n    goto LAB_001ec0f9;\n  }" { (expression_statement "_M_mutate(this,param_1,param_2,param_3,param_4);" (call_expression "_M_mutate(this,param_1,param_2,param_3,param_4)" identifier (argument_list "(this,param_1,param_2,param_3,param_4)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) (expression_statement "__s1 = pwVar3 + param_1 * 4;" (assignment_expression "__s1 = pwVar3 + param_1 * 4" identifier = (binary_expression "pwVar3 + param_1 * 4" identifier + (binary_expression "param_1 * 4" identifier * number_literal))) ;) (expression_statement "sVar4 = iVar2 - (param_1 + param_2);" (assignment_expression "sVar4 = iVar2 - (param_1 + param_2)" identifier = (binary_expression "iVar2 - (param_1 + param_2)" identifier - (parenthesized_expression "(param_1 + param_2)" ( (binary_expression "param_1 + param_2" identifier + identifier) )))) ;) (expression_statement "bVar6 = sVar4 != 0;" (assignment_expression "bVar6 = sVar4 != 0" identifier = (binary_expression "sVar4 != 0" identifier != number_literal)) ;) (expression_statement "bVar7 = param_2 != param_4;" (assignment_expression "bVar7 = param_2 != param_4" identifier = (binary_expression "param_2 != param_4" identifier != identifier)) ;) (if_statement "if ((param_3 < pwVar3) || (pwVar3 + iVar2 * 4 < param_3)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 == 0) goto LAB_001ec0f9;\n    if (param_4 != 1) {\n      wmemcpy((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_4 == 0) || (param_2 < param_4)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 <= param_2) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_2 * 4;\n    if (pwVar3 < (wstring *)(param_3 + param_4)) {\n      if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_4 != 1) {\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }" if (parenthesized_expression "((param_3 < pwVar3) || (pwVar3 + iVar2 * 4 < param_3))" ( (binary_expression "(param_3 < pwVar3) || (pwVar3 + iVar2 * 4 < param_3)" (parenthesized_expression "(param_3 < pwVar3)" ( (binary_expression "param_3 < pwVar3" identifier < identifier) )) || (parenthesized_expression "(pwVar3 + iVar2 * 4 < param_3)" ( (binary_expression "pwVar3 + iVar2 * 4 < param_3" (binary_expression "pwVar3 + iVar2 * 4" identifier + (binary_expression "iVar2 * 4" identifier * number_literal)) < identifier) ))) )) (compound_statement "{\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 == 0) goto LAB_001ec0f9;\n    if (param_4 != 1) {\n      wmemcpy((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }" { (if_statement "if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }" if (parenthesized_expression "(bVar6 && bVar7)" ( (binary_expression "bVar6 && bVar7" identifier && identifier) )) (compound_statement "{\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }" { (if_statement "if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }" { (expression_statement "*(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);" (assignment_expression "*(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4)" (pointer_expression "*(wchar_t *)(__s1 + param_4 * 4)" * (cast_expression "(wchar_t *)(__s1 + param_4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_4 * 4)" ( (binary_expression "__s1 + param_4 * 4" identifier + (binary_expression "param_4 * 4" identifier * number_literal)) )))) = (pointer_expression "*(wchar_t *)(__s1 + param_2 * 4)" * (cast_expression "(wchar_t *)(__s1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_2 * 4)" ( (binary_expression "__s1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) ))))) ;) }) (else_clause "else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" else (compound_statement "{\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" { (expression_statement "wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);" (call_expression "wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4)" identifier (argument_list "((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4)" ( (cast_expression "(wchar_t *)(__s1 + param_4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_4 * 4)" ( (binary_expression "__s1 + param_4 * 4" identifier + (binary_expression "param_4 * 4" identifier * number_literal)) ))) , (cast_expression "(wchar_t *)(__s1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_2 * 4)" ( (binary_expression "__s1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) ))) , identifier ))) ;) }))) })) (if_statement "if (param_4 == 0) goto LAB_001ec0f9;" if (parenthesized_expression "(param_4 == 0)" ( (binary_expression "param_4 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (if_statement "if (param_4 != 1) {\n      wmemcpy((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(param_4 != 1)" ( (binary_expression "param_4 != 1" identifier != number_literal) )) (compound_statement "{\n      wmemcpy((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }" { (expression_statement "wmemcpy((wchar_t *)__s1,param_3,param_4);" (call_expression "wmemcpy((wchar_t *)__s1,param_3,param_4)" identifier (argument_list "((wchar_t *)__s1,param_3,param_4)" ( (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) }) (else_clause "else {\n    if ((param_4 == 0) || (param_2 < param_4)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 <= param_2) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_2 * 4;\n    if (pwVar3 < (wstring *)(param_3 + param_4)) {\n      if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_4 != 1) {\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }" else (compound_statement "{\n    if ((param_4 == 0) || (param_2 < param_4)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }\n    if (param_4 <= param_2) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_2 * 4;\n    if (pwVar3 < (wstring *)(param_3 + param_4)) {\n      if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_4 != 1) {\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }\n  }" { (if_statement "if ((param_4 == 0) || (param_2 < param_4)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }" if (parenthesized_expression "((param_4 == 0) || (param_2 < param_4))" ( (binary_expression "(param_4 == 0) || (param_2 < param_4)" (parenthesized_expression "(param_4 == 0)" ( (binary_expression "param_4 == 0" identifier == number_literal) )) || (parenthesized_expression "(param_2 < param_4)" ( (binary_expression "param_2 < param_4" identifier < identifier) ))) )) (compound_statement "{\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }" { (labeled_statement "LAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;" statement_identifier : (if_statement "if (bVar6 && bVar7) goto LAB_001ec160;" if (parenthesized_expression "(bVar6 && bVar7)" ( (binary_expression "bVar6 && bVar7" identifier && identifier) )) (goto_statement "goto LAB_001ec160;" goto statement_identifier ;))) }) (else_clause "else {\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }" else (compound_statement "{\n      if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }\n    }" { (if_statement "if (param_4 == 1) {\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)__s1 = *param_3;\n        goto LAB_001ec254;\n      }" { (expression_statement "*(wchar_t *)__s1 = *param_3;" (assignment_expression "*(wchar_t *)__s1 = *param_3" (pointer_expression "*(wchar_t *)__s1" * (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = (pointer_expression "*param_3" * identifier)) ;) (goto_statement "goto LAB_001ec254;" goto statement_identifier ;) })) (expression_statement "wmemmove((wchar_t *)__s1,param_3,param_4);" (call_expression "wmemmove((wchar_t *)__s1,param_3,param_4)" identifier (argument_list "((wchar_t *)__s1,param_3,param_4)" ( (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier ))) ;) (if_statement "if (!bVar6 || !bVar7) goto LAB_001ec0f9;" if (parenthesized_expression "(!bVar6 || !bVar7)" ( (binary_expression "!bVar6 || !bVar7" (unary_expression "!bVar6" ! identifier) || (unary_expression "!bVar7" ! identifier)) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (labeled_statement "LAB_001ec160:\n      if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" statement_identifier : (if_statement "if (sVar4 == 1) {\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }\n      else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);\n      }" { (expression_statement "*(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4);" (assignment_expression "*(wchar_t *)(__s1 + param_4 * 4) = *(wchar_t *)(__s1 + param_2 * 4)" (pointer_expression "*(wchar_t *)(__s1 + param_4 * 4)" * (cast_expression "(wchar_t *)(__s1 + param_4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_4 * 4)" ( (binary_expression "__s1 + param_4 * 4" identifier + (binary_expression "param_4 * 4" identifier * number_literal)) )))) = (pointer_expression "*(wchar_t *)(__s1 + param_2 * 4)" * (cast_expression "(wchar_t *)(__s1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_2 * 4)" ( (binary_expression "__s1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) ))))) ;) }) (else_clause "else {\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" else (compound_statement "{\n        wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);\n      }" { (expression_statement "wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4);" (call_expression "wmemmove((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4)" identifier (argument_list "((wchar_t *)(__s1 + param_4 * 4),(wchar_t *)(__s1 + param_2 * 4),sVar4)" ( (cast_expression "(wchar_t *)(__s1 + param_4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_4 * 4)" ( (binary_expression "__s1 + param_4 * 4" identifier + (binary_expression "param_4 * 4" identifier * number_literal)) ))) , (cast_expression "(wchar_t *)(__s1 + param_2 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_2 * 4)" ( (binary_expression "__s1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal)) ))) , identifier ))) ;) })))) }))) (if_statement "if (param_4 <= param_2) goto LAB_001ec0f9;" if (parenthesized_expression "(param_4 <= param_2)" ( (binary_expression "param_4 <= param_2" identifier <= identifier) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (expression_statement "pwVar3 = __s1 + param_2 * 4;" (assignment_expression "pwVar3 = __s1 + param_2 * 4" identifier = (binary_expression "__s1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal))) ;) (if_statement "if (pwVar3 < (wstring *)(param_3 + param_4)) {\n      if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(pwVar3 < (wstring *)(param_3 + param_4))" ( (binary_expression "pwVar3 < (wstring *)(param_3 + param_4)" identifier < (cast_expression "(wstring *)(param_3 + param_4)" ( (type_descriptor "wstring *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_3 + param_4)" ( (binary_expression "param_3 + param_4" identifier + identifier) )))) )) (compound_statement "{\n      if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }\n      goto LAB_001ec0f9;\n    }" { (if_statement "if (param_3 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }\n      else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }" if (parenthesized_expression "(param_3 < pwVar3)" ( (binary_expression "param_3 < pwVar3" identifier < identifier) )) (compound_statement "{\n        sVar4 = (int)pwVar3 - (int)param_3 >> 2;\n        if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }\n        sVar4 = param_4 - sVar4;\n        if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }\n      }" { (expression_statement "sVar4 = (int)pwVar3 - (int)param_3 >> 2;" (assignment_expression "sVar4 = (int)pwVar3 - (int)param_3 >> 2" identifier = (binary_expression "(int)pwVar3 - (int)param_3 >> 2" (binary_expression "(int)pwVar3 - (int)param_3" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (if_statement "if (sVar4 == 1) {\n          *(wchar_t *)__s1 = *param_3;\n        }\n        else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n          *(wchar_t *)__s1 = *param_3;\n        }" { (expression_statement "*(wchar_t *)__s1 = *param_3;" (assignment_expression "*(wchar_t *)__s1 = *param_3" (pointer_expression "*(wchar_t *)__s1" * (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = (pointer_expression "*param_3" * identifier)) ;) }) (else_clause "else if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }" else (if_statement "if (sVar4 != 0) {\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemmove((wchar_t *)__s1,param_3,sVar4);\n        }" { (expression_statement "wmemmove((wchar_t *)__s1,param_3,sVar4);" (call_expression "wmemmove((wchar_t *)__s1,param_3,sVar4)" identifier (argument_list "((wchar_t *)__s1,param_3,sVar4)" ( (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier ))) ;) })))) (expression_statement "sVar4 = param_4 - sVar4;" (assignment_expression "sVar4 = param_4 - sVar4" identifier = (binary_expression "param_4 - sVar4" identifier - identifier)) ;) (if_statement "if (sVar4 == 1) {\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }\n        else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n          *(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);\n        }" { (expression_statement "*(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4);" (assignment_expression "*(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)) = *(wchar_t *)(__s1 + param_4 * 4)" (pointer_expression "*(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3))" * (cast_expression "(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + ((int)pwVar3 - (int)param_3))" ( (binary_expression "__s1 + ((int)pwVar3 - (int)param_3)" identifier + (parenthesized_expression "((int)pwVar3 - (int)param_3)" ( (binary_expression "(int)pwVar3 - (int)param_3" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )))) = (pointer_expression "*(wchar_t *)(__s1 + param_4 * 4)" * (cast_expression "(wchar_t *)(__s1 + param_4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_4 * 4)" ( (binary_expression "__s1 + param_4 * 4" identifier + (binary_expression "param_4 * 4" identifier * number_literal)) ))))) ;) }) (else_clause "else if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }" else (if_statement "if (sVar4 != 0) {\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);\n        }" { (expression_statement "wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4);" (call_expression "wmemcpy((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4)" identifier (argument_list "((wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3)),(wchar_t *)(__s1 + param_4 * 4),\n                  sVar4)" ( (cast_expression "(wchar_t *)(__s1 + ((int)pwVar3 - (int)param_3))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + ((int)pwVar3 - (int)param_3))" ( (binary_expression "__s1 + ((int)pwVar3 - (int)param_3)" identifier + (parenthesized_expression "((int)pwVar3 - (int)param_3)" ( (binary_expression "(int)pwVar3 - (int)param_3" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier)) ))) ))) , (cast_expression "(wchar_t *)(__s1 + param_4 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__s1 + param_4 * 4)" ( (binary_expression "__s1 + param_4 * 4" identifier + (binary_expression "param_4 * 4" identifier * number_literal)) ))) , identifier ))) ;) })))) }) (else_clause "else if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }" else (if_statement "if (param_4 == 1) {\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }\n      else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)__s1 = param_3[param_4 - param_2];\n      }" { (expression_statement "*(wchar_t *)__s1 = param_3[param_4 - param_2];" (assignment_expression "*(wchar_t *)__s1 = param_3[param_4 - param_2]" (pointer_expression "*(wchar_t *)__s1" * (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = (subscript_expression "param_3[param_4 - param_2]" identifier [ (binary_expression "param_4 - param_2" identifier - identifier) ])) ;) }) (else_clause "else {\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }" else (compound_statement "{\n        wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);\n      }" { (expression_statement "wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4);" (call_expression "wmemcpy((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4)" identifier (argument_list "((wchar_t *)__s1,param_3 + (param_4 - param_2),param_4)" ( (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , (binary_expression "param_3 + (param_4 - param_2)" identifier + (parenthesized_expression "(param_4 - param_2)" ( (binary_expression "param_4 - param_2" identifier - identifier) ))) , identifier ))) ;) }))))) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) (if_statement "if (param_4 != 1) {\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(param_4 != 1)" ( (binary_expression "param_4 != 1" identifier != number_literal) )) (compound_statement "{\n      wmemmove((wchar_t *)__s1,param_3,param_4);\n      goto LAB_001ec0f9;\n    }" { (expression_statement "wmemmove((wchar_t *)__s1,param_3,param_4);" (call_expression "wmemmove((wchar_t *)__s1,param_3,param_4)" identifier (argument_list "((wchar_t *)__s1,param_3,param_4)" ( (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) }))) (expression_statement "*(wchar_t *)__s1 = *param_3;" (assignment_expression "*(wchar_t *)__s1 = *param_3" (pointer_expression "*(wchar_t *)__s1" * (cast_expression "(wchar_t *)__s1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) = (pointer_expression "*param_3" * identifier)) ;) (labeled_statement "LAB_001ec0f9:\n  *(uint *)(this + 4) = uVar1;" statement_identifier : (expression_statement "*(uint *)(this + 4) = uVar1;" (assignment_expression "*(uint *)(this + 4) = uVar1" (pointer_expression "*(uint *)(this + 4)" * (cast_expression "(uint *)(this + 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 4)" ( (binary_expression "this + 4" identifier + number_literal) )))) = identifier) ;)) (expression_statement "*(undefined4 *)(*(int *)this + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)(*(int *)this + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)(*(int *)this + uVar1 * 4)" * (cast_expression "(undefined4 *)(*(int *)this + uVar1 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(int *)this + uVar1 * 4)" ( (binary_expression "*(int *)this + uVar1 * 4" (pointer_expression "*(int *)this" * (cast_expression "(int *)this" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return this;" return identifier ;) (ERROR "}" }))
(translation_unit "uint * FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)\n\n{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}\n\n" (function_definition "uint * FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)\n\n{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}" type_identifier (pointer_declarator "* FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" * (function_declarator "FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" identifier (parameter_list "(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "uint param_3" type_identifier identifier) , (parameter_declaration "wchar_t *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "uint param_5" type_identifier identifier) )))) (compound_statement "{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}" { (declaration "uint uVar1;" type_identifier identifier ;) (declaration "wchar_t *__s1;" type_identifier (pointer_declarator "*__s1" * identifier) ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "wchar_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (declaration "size_t sVar4;" primitive_type identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "bool bVar6;" primitive_type identifier ;) (declaration "bool bVar7;" primitive_type identifier ;) (expression_statement "uVar2 = param_1[1];" (assignment_expression "uVar2 = param_1[1]" identifier = (subscript_expression "param_1[1]" identifier [ number_literal ])) ;) (if_statement "if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }" if (parenthesized_expression "((param_3 + 0x1fffffff) - uVar2 < param_5)" ( (binary_expression "(param_3 + 0x1fffffff) - uVar2 < param_5" (binary_expression "(param_3 + 0x1fffffff) - uVar2" (parenthesized_expression "(param_3 + 0x1fffffff)" ( (binary_expression "param_3 + 0x1fffffff" identifier + number_literal) )) - identifier) < identifier) )) (compound_statement "{\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }" { (expression_statement "FUN_0022c7a0("basic_string::_M_replace");" (call_expression "FUN_0022c7a0("basic_string::_M_replace")" identifier (argument_list "("basic_string::_M_replace")" ( (string_literal ""basic_string::_M_replace"" " string_content ") ))) ;) })) (expression_statement "uVar1 = uVar2 + (param_5 - param_3);" (assignment_expression "uVar1 = uVar2 + (param_5 - param_3)" identifier = (binary_expression "uVar2 + (param_5 - param_3)" identifier + (parenthesized_expression "(param_5 - param_3)" ( (binary_expression "param_5 - param_3" identifier - identifier) )))) ;) (expression_statement "pwVar3 = (wchar_t *)*param_1;" (assignment_expression "pwVar3 = (wchar_t *)*param_1" identifier = (cast_expression "(wchar_t *)*param_1" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }" if (parenthesized_expression "(pwVar3 == (wchar_t *)(param_1 + 2))" ( (binary_expression "pwVar3 == (wchar_t *)(param_1 + 2)" identifier == (cast_expression "(wchar_t *)(param_1 + 2)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 2)" ( (binary_expression "param_1 + 2" identifier + number_literal) )))) )) (compound_statement "{\n    uVar5 = 3;\n  }" { (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" identifier = number_literal) ;) }) (else_clause "else {\n    uVar5 = param_1[2];\n  }" else (compound_statement "{\n    uVar5 = param_1[2];\n  }" { (expression_statement "uVar5 = param_1[2];" (assignment_expression "uVar5 = param_1[2]" identifier = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) }))) (if_statement "if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }" if (parenthesized_expression "(uVar5 < uVar1)" ( (binary_expression "uVar5 < uVar1" identifier < identifier) )) (compound_statement "{\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }" { (expression_statement "FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);" (call_expression "FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5)" identifier (argument_list "(param_1,param_2,param_3,param_4,param_5)" ( identifier , identifier , identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) (expression_statement "__s1 = pwVar3 + param_2;" (assignment_expression "__s1 = pwVar3 + param_2" identifier = (binary_expression "pwVar3 + param_2" identifier + identifier)) ;) (expression_statement "sVar4 = uVar2 - (param_2 + param_3);" (assignment_expression "sVar4 = uVar2 - (param_2 + param_3)" identifier = (binary_expression "uVar2 - (param_2 + param_3)" identifier - (parenthesized_expression "(param_2 + param_3)" ( (binary_expression "param_2 + param_3" identifier + identifier) )))) ;) (expression_statement "bVar6 = sVar4 != 0;" (assignment_expression "bVar6 = sVar4 != 0" identifier = (binary_expression "sVar4 != 0" identifier != number_literal)) ;) (expression_statement "bVar7 = param_3 != param_5;" (assignment_expression "bVar7 = param_3 != param_5" identifier = (binary_expression "param_3 != param_5" identifier != identifier)) ;) (if_statement "if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" if (parenthesized_expression "((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4))" ( (binary_expression "(param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)" (parenthesized_expression "(param_4 < pwVar3)" ( (binary_expression "param_4 < pwVar3" identifier < identifier) )) || (parenthesized_expression "(pwVar3 + uVar2 < param_4)" ( (binary_expression "pwVar3 + uVar2 < param_4" (binary_expression "pwVar3 + uVar2" identifier + identifier) < identifier) ))) )) (compound_statement "{\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" { (if_statement "if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" if (parenthesized_expression "(bVar6 && bVar7)" ( (binary_expression "bVar6 && bVar7" identifier && identifier) )) (compound_statement "{\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" { (if_statement "if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n        __s1[param_5] = __s1[param_3];\n      }" { (expression_statement "__s1[param_5] = __s1[param_3];" (assignment_expression "__s1[param_5] = __s1[param_3]" (subscript_expression "__s1[param_5]" identifier [ identifier ]) = (subscript_expression "__s1[param_3]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" else (compound_statement "{\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" { (expression_statement "wmemmove(__s1 + param_5,__s1 + param_3,sVar4);" (call_expression "wmemmove(__s1 + param_5,__s1 + param_3,sVar4)" identifier (argument_list "(__s1 + param_5,__s1 + param_3,sVar4)" ( (binary_expression "__s1 + param_5" identifier + identifier) , (binary_expression "__s1 + param_3" identifier + identifier) , identifier ))) ;) }))) })) (if_statement "if (param_5 == 0) goto LAB_001ec0f9;" if (parenthesized_expression "(param_5 == 0)" ( (binary_expression "param_5 == 0" identifier == number_literal) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (if_statement "if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(param_5 != 1)" ( (binary_expression "param_5 != 1" identifier != number_literal) )) (compound_statement "{\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" { (expression_statement "wmemcpy(__s1,param_4,param_5);" (call_expression "wmemcpy(__s1,param_4,param_5)" identifier (argument_list "(__s1,param_4,param_5)" ( identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) }) (else_clause "else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" else (compound_statement "{\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" { (if_statement "if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" if (parenthesized_expression "((param_5 == 0) || (param_3 < param_5))" ( (binary_expression "(param_5 == 0) || (param_3 < param_5)" (parenthesized_expression "(param_5 == 0)" ( (binary_expression "param_5 == 0" identifier == number_literal) )) || (parenthesized_expression "(param_3 < param_5)" ( (binary_expression "param_3 < param_5" identifier < identifier) ))) )) (compound_statement "{\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }" { (labeled_statement "LAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;" statement_identifier : (if_statement "if (bVar6 && bVar7) goto LAB_001ec160;" if (parenthesized_expression "(bVar6 && bVar7)" ( (binary_expression "bVar6 && bVar7" identifier && identifier) )) (goto_statement "goto LAB_001ec160;" goto statement_identifier ;))) }) (else_clause "else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" else (compound_statement "{\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" { (if_statement "if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }" if (parenthesized_expression "(param_5 == 1)" ( (binary_expression "param_5 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }" { (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" * identifier) = (pointer_expression "*param_4" * identifier)) ;) (goto_statement "goto LAB_001ec254;" goto statement_identifier ;) })) (expression_statement "wmemmove(__s1,param_4,param_5);" (call_expression "wmemmove(__s1,param_4,param_5)" identifier (argument_list "(__s1,param_4,param_5)" ( identifier , identifier , identifier ))) ;) (if_statement "if (!bVar6 || !bVar7) goto LAB_001ec0f9;" if (parenthesized_expression "(!bVar6 || !bVar7)" ( (binary_expression "!bVar6 || !bVar7" (unary_expression "!bVar6" ! identifier) || (unary_expression "!bVar7" ! identifier)) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (labeled_statement "LAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" statement_identifier : (if_statement "if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n        __s1[param_5] = __s1[param_3];\n      }" { (expression_statement "__s1[param_5] = __s1[param_3];" (assignment_expression "__s1[param_5] = __s1[param_3]" (subscript_expression "__s1[param_5]" identifier [ identifier ]) = (subscript_expression "__s1[param_3]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" else (compound_statement "{\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" { (expression_statement "wmemmove(__s1 + param_5,__s1 + param_3,sVar4);" (call_expression "wmemmove(__s1 + param_5,__s1 + param_3,sVar4)" identifier (argument_list "(__s1 + param_5,__s1 + param_3,sVar4)" ( (binary_expression "__s1 + param_5" identifier + identifier) , (binary_expression "__s1 + param_3" identifier + identifier) , identifier ))) ;) })))) }))) (if_statement "if (param_5 <= param_3) goto LAB_001ec0f9;" if (parenthesized_expression "(param_5 <= param_3)" ( (binary_expression "param_5 <= param_3" identifier <= identifier) )) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;)) (expression_statement "pwVar3 = __s1 + param_3;" (assignment_expression "pwVar3 = __s1 + param_3" identifier = (binary_expression "__s1 + param_3" identifier + identifier)) ;) (if_statement "if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(pwVar3 < param_4 + param_5)" ( (binary_expression "pwVar3 < param_4 + param_5" identifier < (binary_expression "param_4 + param_5" identifier + identifier)) )) (compound_statement "{\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }" { (if_statement "if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" if (parenthesized_expression "(param_4 < pwVar3)" ( (binary_expression "param_4 < pwVar3" identifier < identifier) )) (compound_statement "{\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }" { (expression_statement "sVar4 = (int)pwVar3 - (int)param_4 >> 2;" (assignment_expression "sVar4 = (int)pwVar3 - (int)param_4 >> 2" identifier = (binary_expression "(int)pwVar3 - (int)param_4 >> 2" (binary_expression "(int)pwVar3 - (int)param_4" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier)) >> number_literal)) ;) (if_statement "if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n          *__s1 = *param_4;\n        }" { (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" * identifier) = (pointer_expression "*param_4" * identifier)) ;) }) (else_clause "else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" else (if_statement "if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemmove(__s1,param_4,sVar4);\n        }" { (expression_statement "wmemmove(__s1,param_4,sVar4);" (call_expression "wmemmove(__s1,param_4,sVar4)" identifier (argument_list "(__s1,param_4,sVar4)" ( identifier , identifier , identifier ))) ;) })))) (expression_statement "sVar4 = param_5 - sVar4;" (assignment_expression "sVar4 = param_5 - sVar4" identifier = (binary_expression "param_5 - sVar4" identifier - identifier)) ;) (expression_statement "pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));" (assignment_expression "pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4))" identifier = (cast_expression "(wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4))" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__s1 + ((int)pwVar3 - (int)param_4))" ( (binary_expression "(int)__s1 + ((int)pwVar3 - (int)param_4)" (cast_expression "(int)__s1" ( (type_descriptor "int" primitive_type) ) identifier) + (parenthesized_expression "((int)pwVar3 - (int)param_4)" ( (binary_expression "(int)pwVar3 - (int)param_4" (cast_expression "(int)pwVar3" ( (type_descriptor "int" primitive_type) ) identifier) - (cast_expression "(int)param_4" ( (type_descriptor "int" primitive_type) ) identifier)) ))) )))) ;) (if_statement "if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" if (parenthesized_expression "(sVar4 == 1)" ( (binary_expression "sVar4 == 1" identifier == number_literal) )) (compound_statement "{\n          *pwVar3 = __s1[param_5];\n        }" { (expression_statement "*pwVar3 = __s1[param_5];" (assignment_expression "*pwVar3 = __s1[param_5]" (pointer_expression "*pwVar3" * identifier) = (subscript_expression "__s1[param_5]" identifier [ identifier ])) ;) }) (else_clause "else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" else (if_statement "if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" if (parenthesized_expression "(sVar4 != 0)" ( (binary_expression "sVar4 != 0" identifier != number_literal) )) (compound_statement "{\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" { (expression_statement "wmemcpy(pwVar3,__s1 + param_5,sVar4);" (call_expression "wmemcpy(pwVar3,__s1 + param_5,sVar4)" identifier (argument_list "(pwVar3,__s1 + param_5,sVar4)" ( identifier , (binary_expression "__s1 + param_5" identifier + identifier) , identifier ))) ;) })))) }) (else_clause "else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" else (if_statement "if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" if (parenthesized_expression "(param_5 == 1)" ( (binary_expression "param_5 == 1" identifier == number_literal) )) (compound_statement "{\n        *__s1 = param_4[param_5 - param_3];\n      }" { (expression_statement "*__s1 = param_4[param_5 - param_3];" (assignment_expression "*__s1 = param_4[param_5 - param_3]" (pointer_expression "*__s1" * identifier) = (subscript_expression "param_4[param_5 - param_3]" identifier [ (binary_expression "param_5 - param_3" identifier - identifier) ])) ;) }) (else_clause "else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" else (compound_statement "{\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" { (expression_statement "wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);" (call_expression "wmemcpy(__s1,param_4 + (param_5 - param_3),param_5)" identifier (argument_list "(__s1,param_4 + (param_5 - param_3),param_5)" ( identifier , (binary_expression "param_4 + (param_5 - param_3)" identifier + (parenthesized_expression "(param_5 - param_3)" ( (binary_expression "param_5 - param_3" identifier - identifier) ))) , identifier ))) ;) }))))) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) (if_statement "if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" if (parenthesized_expression "(param_5 != 1)" ( (binary_expression "param_5 != 1" identifier != number_literal) )) (compound_statement "{\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" { (expression_statement "wmemmove(__s1,param_4,param_5);" (call_expression "wmemmove(__s1,param_4,param_5)" identifier (argument_list "(__s1,param_4,param_5)" ( identifier , identifier , identifier ))) ;) (goto_statement "goto LAB_001ec0f9;" goto statement_identifier ;) })) }))) (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" * identifier) = (pointer_expression "*param_4" * identifier)) ;) (labeled_statement "LAB_001ec0f9:\n  param_1[1] = uVar1;" statement_identifier : (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" identifier [ number_literal ]) = identifier) ;)) (expression_statement "*(undefined4 *)(*param_1 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)(*param_1 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)(*param_1 + uVar1 * 4)" * (cast_expression "(undefined4 *)(*param_1 + uVar1 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + uVar1 * 4)" ( (binary_expression "*param_1 + uVar1 * 4" (pointer_expression "*param_1" * identifier) + (binary_expression "uVar1 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return param_1;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression (parenthesized_expression ( (binary_expression IDENT + LIT) )) - IDENT) < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (parenthesized_expression ( (binary_expression IDENT - IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT , IDENT ))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT != LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT != IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < IDENT) )) || (parenthesized_expression ( (binary_expression (binary_expression IDENT + IDENT) < IDENT) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT && IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (subscript_expression IDENT [ IDENT ])) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , (binary_expression IDENT + IDENT) , IDENT ))) ;) }))) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (goto_statement goto statement_identifier ;) })) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == LIT) )) || (parenthesized_expression ( (binary_expression IDENT < IDENT) ))) )) (compound_statement { (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT && IDENT) )) (goto_statement goto statement_identifier ;))) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (unary_expression ! IDENT) || (unary_expression ! IDENT)) )) (goto_statement goto statement_identifier ;)) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ IDENT ]) = (subscript_expression IDENT [ IDENT ])) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + IDENT) , (binary_expression IDENT + IDENT) , IDENT ))) ;) })))) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT <= IDENT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (binary_expression IDENT + IDENT)) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) >> LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) })))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) - (cast_expression ( (type_descriptor TYPE) ) IDENT)) ))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (subscript_expression IDENT [ IDENT ])) ;) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + IDENT) , IDENT ))) ;) })))) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (subscript_expression IDENT [ (binary_expression IDENT - IDENT) ])) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + (parenthesized_expression ( (binary_expression IDENT - IDENT) ))) , IDENT ))) ;) }))))) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (goto_statement goto statement_identifier ;) })) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;)) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + (binary_expression IDENT * LIT)) )))) = LIT) ;) (return_statement return IDENT ;) })))
(function_definition "uint * FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)\n\n{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}" (type_identifier "uint") (pointer_declarator "* FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" (* "*") (function_declarator "FUN_001ec020(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" (identifier "FUN_001ec020") (parameter_list "(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "uint param_3" (type_identifier "uint") (identifier "param_3")) (, ",") (parameter_declaration "wchar_t *param_4" (type_identifier "wchar_t") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) (, ",") (parameter_declaration "uint param_5" (type_identifier "uint") (identifier "param_5")) () ")")))) (compound_statement "{\n  uint uVar1;\n  wchar_t *__s1;\n  uint uVar2;\n  wchar_t *pwVar3;\n  size_t sVar4;\n  uint uVar5;\n  bool bVar6;\n  bool bVar7;\n  \n  uVar2 = param_1[1];\n  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }\n  uVar1 = uVar2 + (param_5 - param_3);\n  pwVar3 = (wchar_t *)*param_1;\n  if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }\n  if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }\n  __s1 = pwVar3 + param_2;\n  sVar4 = uVar2 - (param_2 + param_3);\n  bVar6 = sVar4 != 0;\n  bVar7 = param_3 != param_5;\n  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  *__s1 = *param_4;\nLAB_001ec0f9:\n  param_1[1] = uVar1;\n  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;\n  return param_1;\n}" ({ "{") (declaration "uint uVar1;" (type_identifier "uint") (identifier "uVar1") (; ";")) (declaration "wchar_t *__s1;" (type_identifier "wchar_t") (pointer_declarator "*__s1" (* "*") (identifier "__s1")) (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "wchar_t *pwVar3;" (type_identifier "wchar_t") (pointer_declarator "*pwVar3" (* "*") (identifier "pwVar3")) (; ";")) (declaration "size_t sVar4;" (primitive_type "size_t") (identifier "sVar4") (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (declaration "bool bVar6;" (primitive_type "bool") (identifier "bVar6") (; ";")) (declaration "bool bVar7;" (primitive_type "bool") (identifier "bVar7") (; ";")) (expression_statement "uVar2 = param_1[1];" (assignment_expression "uVar2 = param_1[1]" (identifier "uVar2") (= "=") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if ((param_3 + 0x1fffffff) - uVar2 < param_5) {\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }" (if "if") (parenthesized_expression "((param_3 + 0x1fffffff) - uVar2 < param_5)" (( "(") (binary_expression "(param_3 + 0x1fffffff) - uVar2 < param_5" (binary_expression "(param_3 + 0x1fffffff) - uVar2" (parenthesized_expression "(param_3 + 0x1fffffff)" (( "(") (binary_expression "param_3 + 0x1fffffff" (identifier "param_3") (+ "+") (number_literal "0x1fffffff")) () ")")) (- "-") (identifier "uVar2")) (< "<") (identifier "param_5")) () ")")) (compound_statement "{\n                    \n    FUN_0022c7a0("basic_string::_M_replace");\n  }" ({ "{") (expression_statement "FUN_0022c7a0("basic_string::_M_replace");" (call_expression "FUN_0022c7a0("basic_string::_M_replace")" (identifier "FUN_0022c7a0") (argument_list "("basic_string::_M_replace")" (( "(") (string_literal ""basic_string::_M_replace"" (" """) (string_content "basic_string::_M_replace") (" """)) () ")"))) (; ";")) (} "}"))) (expression_statement "uVar1 = uVar2 + (param_5 - param_3);" (assignment_expression "uVar1 = uVar2 + (param_5 - param_3)" (identifier "uVar1") (= "=") (binary_expression "uVar2 + (param_5 - param_3)" (identifier "uVar2") (+ "+") (parenthesized_expression "(param_5 - param_3)" (( "(") (binary_expression "param_5 - param_3" (identifier "param_5") (- "-") (identifier "param_3")) () ")")))) (; ";")) (expression_statement "pwVar3 = (wchar_t *)*param_1;" (assignment_expression "pwVar3 = (wchar_t *)*param_1" (identifier "pwVar3") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if (pwVar3 == (wchar_t *)(param_1 + 2)) {\n    uVar5 = 3;\n  }\n  else {\n    uVar5 = param_1[2];\n  }" (if "if") (parenthesized_expression "(pwVar3 == (wchar_t *)(param_1 + 2))" (( "(") (binary_expression "pwVar3 == (wchar_t *)(param_1 + 2)" (identifier "pwVar3") (== "==") (cast_expression "(wchar_t *)(param_1 + 2)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 2)" (( "(") (binary_expression "param_1 + 2" (identifier "param_1") (+ "+") (number_literal "2")) () ")")))) () ")")) (compound_statement "{\n    uVar5 = 3;\n  }" ({ "{") (expression_statement "uVar5 = 3;" (assignment_expression "uVar5 = 3" (identifier "uVar5") (= "=") (number_literal "3")) (; ";")) (} "}")) (else_clause "else {\n    uVar5 = param_1[2];\n  }" (else "else") (compound_statement "{\n    uVar5 = param_1[2];\n  }" ({ "{") (expression_statement "uVar5 = param_1[2];" (assignment_expression "uVar5 = param_1[2]" (identifier "uVar5") (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (} "}")))) (if_statement "if (uVar5 < uVar1) {\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }" (if "if") (parenthesized_expression "(uVar5 < uVar1)" (( "(") (binary_expression "uVar5 < uVar1" (identifier "uVar5") (< "<") (identifier "uVar1")) () ")")) (compound_statement "{\n    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);\n    goto LAB_001ec0f9;\n  }" ({ "{") (expression_statement "FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);" (call_expression "FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5)" (identifier "FUN_001eb0a0") (argument_list "(param_1,param_2,param_3,param_4,param_5)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") (, ",") (identifier "param_5") () ")"))) (; ";")) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";")) (} "}"))) (expression_statement "__s1 = pwVar3 + param_2;" (assignment_expression "__s1 = pwVar3 + param_2" (identifier "__s1") (= "=") (binary_expression "pwVar3 + param_2" (identifier "pwVar3") (+ "+") (identifier "param_2"))) (; ";")) (expression_statement "sVar4 = uVar2 - (param_2 + param_3);" (assignment_expression "sVar4 = uVar2 - (param_2 + param_3)" (identifier "sVar4") (= "=") (binary_expression "uVar2 - (param_2 + param_3)" (identifier "uVar2") (- "-") (parenthesized_expression "(param_2 + param_3)" (( "(") (binary_expression "param_2 + param_3" (identifier "param_2") (+ "+") (identifier "param_3")) () ")")))) (; ";")) (expression_statement "bVar6 = sVar4 != 0;" (assignment_expression "bVar6 = sVar4 != 0" (identifier "bVar6") (= "=") (binary_expression "sVar4 != 0" (identifier "sVar4") (!= "!=") (number_literal "0"))) (; ";")) (expression_statement "bVar7 = param_3 != param_5;" (assignment_expression "bVar7 = param_3 != param_5" (identifier "bVar7") (= "=") (binary_expression "param_3 != param_5" (identifier "param_3") (!= "!=") (identifier "param_5"))) (; ";")) (if_statement "if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }\n  else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" (if "if") (parenthesized_expression "((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4))" (( "(") (binary_expression "(param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)" (parenthesized_expression "(param_4 < pwVar3)" (( "(") (binary_expression "param_4 < pwVar3" (identifier "param_4") (< "<") (identifier "pwVar3")) () ")")) (|| "||") (parenthesized_expression "(pwVar3 + uVar2 < param_4)" (( "(") (binary_expression "pwVar3 + uVar2 < param_4" (binary_expression "pwVar3 + uVar2" (identifier "pwVar3") (+ "+") (identifier "uVar2")) (< "<") (identifier "param_4")) () ")"))) () ")")) (compound_statement "{\n    if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 == 0) goto LAB_001ec0f9;\n    if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" ({ "{") (if_statement "if (bVar6 && bVar7) {\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" (if "if") (parenthesized_expression "(bVar6 && bVar7)" (( "(") (binary_expression "bVar6 && bVar7" (identifier "bVar6") (&& "&&") (identifier "bVar7")) () ")")) (compound_statement "{\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" ({ "{") (if_statement "if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" (if "if") (parenthesized_expression "(sVar4 == 1)" (( "(") (binary_expression "sVar4 == 1" (identifier "sVar4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        __s1[param_5] = __s1[param_3];\n      }" ({ "{") (expression_statement "__s1[param_5] = __s1[param_3];" (assignment_expression "__s1[param_5] = __s1[param_3]" (subscript_expression "__s1[param_5]" (identifier "__s1") ([ "[") (identifier "param_5") (] "]")) (= "=") (subscript_expression "__s1[param_3]" (identifier "__s1") ([ "[") (identifier "param_3") (] "]"))) (; ";")) (} "}")) (else_clause "else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" (else "else") (compound_statement "{\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" ({ "{") (expression_statement "wmemmove(__s1 + param_5,__s1 + param_3,sVar4);" (call_expression "wmemmove(__s1 + param_5,__s1 + param_3,sVar4)" (identifier "wmemmove") (argument_list "(__s1 + param_5,__s1 + param_3,sVar4)" (( "(") (binary_expression "__s1 + param_5" (identifier "__s1") (+ "+") (identifier "param_5")) (, ",") (binary_expression "__s1 + param_3" (identifier "__s1") (+ "+") (identifier "param_3")) (, ",") (identifier "sVar4") () ")"))) (; ";")) (} "}")))) (} "}"))) (if_statement "if (param_5 == 0) goto LAB_001ec0f9;" (if "if") (parenthesized_expression "(param_5 == 0)" (( "(") (binary_expression "param_5 == 0" (identifier "param_5") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";"))) (if_statement "if (param_5 != 1) {\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" (if "if") (parenthesized_expression "(param_5 != 1)" (( "(") (binary_expression "param_5 != 1" (identifier "param_5") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n      wmemcpy(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" ({ "{") (expression_statement "wmemcpy(__s1,param_4,param_5);" (call_expression "wmemcpy(__s1,param_4,param_5)" (identifier "wmemcpy") (argument_list "(__s1,param_4,param_5)" (( "(") (identifier "__s1") (, ",") (identifier "param_4") (, ",") (identifier "param_5") () ")"))) (; ";")) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" (else "else") (compound_statement "{\n    if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }\n    if (param_5 <= param_3) goto LAB_001ec0f9;\n    pwVar3 = __s1 + param_3;\n    if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }\n    if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }\n  }" ({ "{") (if_statement "if ((param_5 == 0) || (param_3 < param_5)) {\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }\n    else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" (if "if") (parenthesized_expression "((param_5 == 0) || (param_3 < param_5))" (( "(") (binary_expression "(param_5 == 0) || (param_3 < param_5)" (parenthesized_expression "(param_5 == 0)" (( "(") (binary_expression "param_5 == 0" (identifier "param_5") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(param_3 < param_5)" (( "(") (binary_expression "param_3 < param_5" (identifier "param_3") (< "<") (identifier "param_5")) () ")"))) () ")")) (compound_statement "{\nLAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;\n    }" ({ "{") (labeled_statement "LAB_001ec254:\n      if (bVar6 && bVar7) goto LAB_001ec160;" (statement_identifier "LAB_001ec254") (: ":") (if_statement "if (bVar6 && bVar7) goto LAB_001ec160;" (if "if") (parenthesized_expression "(bVar6 && bVar7)" (( "(") (binary_expression "bVar6 && bVar7" (identifier "bVar6") (&& "&&") (identifier "bVar7")) () ")")) (goto_statement "goto LAB_001ec160;" (goto "goto") (statement_identifier "LAB_001ec160") (; ";")))) (} "}")) (else_clause "else {\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" (else "else") (compound_statement "{\n      if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }\n      wmemmove(__s1,param_4,param_5);\n      if (!bVar6 || !bVar7) goto LAB_001ec0f9;\nLAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }\n    }" ({ "{") (if_statement "if (param_5 == 1) {\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }" (if "if") (parenthesized_expression "(param_5 == 1)" (( "(") (binary_expression "param_5 == 1" (identifier "param_5") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__s1 = *param_4;\n        goto LAB_001ec254;\n      }" ({ "{") (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*param_4" (* "*") (identifier "param_4"))) (; ";")) (goto_statement "goto LAB_001ec254;" (goto "goto") (statement_identifier "LAB_001ec254") (; ";")) (} "}"))) (expression_statement "wmemmove(__s1,param_4,param_5);" (call_expression "wmemmove(__s1,param_4,param_5)" (identifier "wmemmove") (argument_list "(__s1,param_4,param_5)" (( "(") (identifier "__s1") (, ",") (identifier "param_4") (, ",") (identifier "param_5") () ")"))) (; ";")) (if_statement "if (!bVar6 || !bVar7) goto LAB_001ec0f9;" (if "if") (parenthesized_expression "(!bVar6 || !bVar7)" (( "(") (binary_expression "!bVar6 || !bVar7" (unary_expression "!bVar6" (! "!") (identifier "bVar6")) (|| "||") (unary_expression "!bVar7" (! "!") (identifier "bVar7"))) () ")")) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";"))) (labeled_statement "LAB_001ec160:\n      if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" (statement_identifier "LAB_001ec160") (: ":") (if_statement "if (sVar4 == 1) {\n        __s1[param_5] = __s1[param_3];\n      }\n      else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" (if "if") (parenthesized_expression "(sVar4 == 1)" (( "(") (binary_expression "sVar4 == 1" (identifier "sVar4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        __s1[param_5] = __s1[param_3];\n      }" ({ "{") (expression_statement "__s1[param_5] = __s1[param_3];" (assignment_expression "__s1[param_5] = __s1[param_3]" (subscript_expression "__s1[param_5]" (identifier "__s1") ([ "[") (identifier "param_5") (] "]")) (= "=") (subscript_expression "__s1[param_3]" (identifier "__s1") ([ "[") (identifier "param_3") (] "]"))) (; ";")) (} "}")) (else_clause "else {\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" (else "else") (compound_statement "{\n        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);\n      }" ({ "{") (expression_statement "wmemmove(__s1 + param_5,__s1 + param_3,sVar4);" (call_expression "wmemmove(__s1 + param_5,__s1 + param_3,sVar4)" (identifier "wmemmove") (argument_list "(__s1 + param_5,__s1 + param_3,sVar4)" (( "(") (binary_expression "__s1 + param_5" (identifier "__s1") (+ "+") (identifier "param_5")) (, ",") (binary_expression "__s1 + param_3" (identifier "__s1") (+ "+") (identifier "param_3")) (, ",") (identifier "sVar4") () ")"))) (; ";")) (} "}"))))) (} "}")))) (if_statement "if (param_5 <= param_3) goto LAB_001ec0f9;" (if "if") (parenthesized_expression "(param_5 <= param_3)" (( "(") (binary_expression "param_5 <= param_3" (identifier "param_5") (<= "<=") (identifier "param_3")) () ")")) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";"))) (expression_statement "pwVar3 = __s1 + param_3;" (assignment_expression "pwVar3 = __s1 + param_3" (identifier "pwVar3") (= "=") (binary_expression "__s1 + param_3" (identifier "__s1") (+ "+") (identifier "param_3"))) (; ";")) (if_statement "if (pwVar3 < param_4 + param_5) {\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }" (if "if") (parenthesized_expression "(pwVar3 < param_4 + param_5)" (( "(") (binary_expression "pwVar3 < param_4 + param_5" (identifier "pwVar3") (< "<") (binary_expression "param_4 + param_5" (identifier "param_4") (+ "+") (identifier "param_5"))) () ")")) (compound_statement "{\n      if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }\n      goto LAB_001ec0f9;\n    }" ({ "{") (if_statement "if (param_4 < pwVar3) {\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }\n      else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" (if "if") (parenthesized_expression "(param_4 < pwVar3)" (( "(") (binary_expression "param_4 < pwVar3" (identifier "param_4") (< "<") (identifier "pwVar3")) () ")")) (compound_statement "{\n        sVar4 = (int)pwVar3 - (int)param_4 >> 2;\n        if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }\n        sVar4 = param_5 - sVar4;\n        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));\n        if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }\n      }" ({ "{") (expression_statement "sVar4 = (int)pwVar3 - (int)param_4 >> 2;" (assignment_expression "sVar4 = (int)pwVar3 - (int)param_4 >> 2" (identifier "sVar4") (= "=") (binary_expression "(int)pwVar3 - (int)param_4 >> 2" (binary_expression "(int)pwVar3 - (int)param_4" (cast_expression "(int)pwVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pwVar3")) (- "-") (cast_expression "(int)param_4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_4"))) (>> ">>") (number_literal "2"))) (; ";")) (if_statement "if (sVar4 == 1) {\n          *__s1 = *param_4;\n        }\n        else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" (if "if") (parenthesized_expression "(sVar4 == 1)" (( "(") (binary_expression "sVar4 == 1" (identifier "sVar4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *__s1 = *param_4;\n        }" ({ "{") (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*param_4" (* "*") (identifier "param_4"))) (; ";")) (} "}")) (else_clause "else if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" (else "else") (if_statement "if (sVar4 != 0) {\n          wmemmove(__s1,param_4,sVar4);\n        }" (if "if") (parenthesized_expression "(sVar4 != 0)" (( "(") (binary_expression "sVar4 != 0" (identifier "sVar4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          wmemmove(__s1,param_4,sVar4);\n        }" ({ "{") (expression_statement "wmemmove(__s1,param_4,sVar4);" (call_expression "wmemmove(__s1,param_4,sVar4)" (identifier "wmemmove") (argument_list "(__s1,param_4,sVar4)" (( "(") (identifier "__s1") (, ",") (identifier "param_4") (, ",") (identifier "sVar4") () ")"))) (; ";")) (} "}"))))) (expression_statement "sVar4 = param_5 - sVar4;" (assignment_expression "sVar4 = param_5 - sVar4" (identifier "sVar4") (= "=") (binary_expression "param_5 - sVar4" (identifier "param_5") (- "-") (identifier "sVar4"))) (; ";")) (expression_statement "pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));" (assignment_expression "pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4))" (identifier "pwVar3") (= "=") (cast_expression "(wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4))" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)__s1 + ((int)pwVar3 - (int)param_4))" (( "(") (binary_expression "(int)__s1 + ((int)pwVar3 - (int)param_4)" (cast_expression "(int)__s1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__s1")) (+ "+") (parenthesized_expression "((int)pwVar3 - (int)param_4)" (( "(") (binary_expression "(int)pwVar3 - (int)param_4" (cast_expression "(int)pwVar3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "pwVar3")) (- "-") (cast_expression "(int)param_4" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_4"))) () ")"))) () ")")))) (; ";")) (if_statement "if (sVar4 == 1) {\n          *pwVar3 = __s1[param_5];\n        }\n        else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" (if "if") (parenthesized_expression "(sVar4 == 1)" (( "(") (binary_expression "sVar4 == 1" (identifier "sVar4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          *pwVar3 = __s1[param_5];\n        }" ({ "{") (expression_statement "*pwVar3 = __s1[param_5];" (assignment_expression "*pwVar3 = __s1[param_5]" (pointer_expression "*pwVar3" (* "*") (identifier "pwVar3")) (= "=") (subscript_expression "__s1[param_5]" (identifier "__s1") ([ "[") (identifier "param_5") (] "]"))) (; ";")) (} "}")) (else_clause "else if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" (else "else") (if_statement "if (sVar4 != 0) {\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" (if "if") (parenthesized_expression "(sVar4 != 0)" (( "(") (binary_expression "sVar4 != 0" (identifier "sVar4") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n          wmemcpy(pwVar3,__s1 + param_5,sVar4);\n        }" ({ "{") (expression_statement "wmemcpy(pwVar3,__s1 + param_5,sVar4);" (call_expression "wmemcpy(pwVar3,__s1 + param_5,sVar4)" (identifier "wmemcpy") (argument_list "(pwVar3,__s1 + param_5,sVar4)" (( "(") (identifier "pwVar3") (, ",") (binary_expression "__s1 + param_5" (identifier "__s1") (+ "+") (identifier "param_5")) (, ",") (identifier "sVar4") () ")"))) (; ";")) (} "}"))))) (} "}")) (else_clause "else if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" (else "else") (if_statement "if (param_5 == 1) {\n        *__s1 = param_4[param_5 - param_3];\n      }\n      else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" (if "if") (parenthesized_expression "(param_5 == 1)" (( "(") (binary_expression "param_5 == 1" (identifier "param_5") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *__s1 = param_4[param_5 - param_3];\n      }" ({ "{") (expression_statement "*__s1 = param_4[param_5 - param_3];" (assignment_expression "*__s1 = param_4[param_5 - param_3]" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (subscript_expression "param_4[param_5 - param_3]" (identifier "param_4") ([ "[") (binary_expression "param_5 - param_3" (identifier "param_5") (- "-") (identifier "param_3")) (] "]"))) (; ";")) (} "}")) (else_clause "else {\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" (else "else") (compound_statement "{\n        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);\n      }" ({ "{") (expression_statement "wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);" (call_expression "wmemcpy(__s1,param_4 + (param_5 - param_3),param_5)" (identifier "wmemcpy") (argument_list "(__s1,param_4 + (param_5 - param_3),param_5)" (( "(") (identifier "__s1") (, ",") (binary_expression "param_4 + (param_5 - param_3)" (identifier "param_4") (+ "+") (parenthesized_expression "(param_5 - param_3)" (( "(") (binary_expression "param_5 - param_3" (identifier "param_5") (- "-") (identifier "param_3")) () ")"))) (, ",") (identifier "param_5") () ")"))) (; ";")) (} "}")))))) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";")) (} "}"))) (if_statement "if (param_5 != 1) {\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" (if "if") (parenthesized_expression "(param_5 != 1)" (( "(") (binary_expression "param_5 != 1" (identifier "param_5") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n      wmemmove(__s1,param_4,param_5);\n      goto LAB_001ec0f9;\n    }" ({ "{") (expression_statement "wmemmove(__s1,param_4,param_5);" (call_expression "wmemmove(__s1,param_4,param_5)" (identifier "wmemmove") (argument_list "(__s1,param_4,param_5)" (( "(") (identifier "__s1") (, ",") (identifier "param_4") (, ",") (identifier "param_5") () ")"))) (; ";")) (goto_statement "goto LAB_001ec0f9;" (goto "goto") (statement_identifier "LAB_001ec0f9") (; ";")) (} "}"))) (} "}")))) (expression_statement "*__s1 = *param_4;" (assignment_expression "*__s1 = *param_4" (pointer_expression "*__s1" (* "*") (identifier "__s1")) (= "=") (pointer_expression "*param_4" (* "*") (identifier "param_4"))) (; ";")) (labeled_statement "LAB_001ec0f9:\n  param_1[1] = uVar1;" (statement_identifier "LAB_001ec0f9") (: ":") (expression_statement "param_1[1] = uVar1;" (assignment_expression "param_1[1] = uVar1" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "uVar1")) (; ";"))) (expression_statement "*(undefined4 *)(*param_1 + uVar1 * 4) = 0;" (assignment_expression "*(undefined4 *)(*param_1 + uVar1 * 4) = 0" (pointer_expression "*(undefined4 *)(*param_1 + uVar1 * 4)" (* "*") (cast_expression "(undefined4 *)(*param_1 + uVar1 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + uVar1 * 4)" (( "(") (binary_expression "*param_1 + uVar1 * 4" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (binary_expression "uVar1 * 4" (identifier "uVar1") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return param_1;" (return "return") (identifier "param_1") (; ";")) (} "}")))

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

type_2 * __thiscall
std::type_2::_M_replace(type_2 *var_1,type_1 var_10,type_1 var_2,type_3 *var_12,type_1 var_4)

{
  type_1 var_8;
  type_2 *var_15;
  int var_3;
  type_2 *var_6;
  size_t var_11;
  type_1 var_7;
  bool var_13;
  bool var_14;
  
  var_3 = *(int *)(var_1 + 4);
  if ((var_2 + 0x1fffffff) - var_3 < var_4) {
                    /* WARNING: Subroutine does not return */
    var_5("basic_string::_M_replace");
  }
  var_8 = var_3 + (var_4 - var_2);
  var_6 = *(type_2 **)var_1;
  if (var_6 == var_1 + 8) {
    var_7 = 3;
  }
  else {
    var_7 = *(type_1 *)(var_1 + 8);
  }
  if (var_7 < var_8) {
    var_9(var_1,var_10,var_2,var_12,var_4);
    goto LAB_001ec0f9;
  }
  var_15 = var_6 + var_10 * 4;
  var_11 = var_3 - (var_10 + var_2);
  var_13 = var_11 != 0;
  var_14 = var_2 != var_4;
  if ((var_12 < var_6) || (var_6 + var_3 * 4 < var_12)) {
    if (var_13 && var_14) {
      if (var_11 == 1) {
        *(type_3 *)(var_15 + var_4 * 4) = *(type_3 *)(var_15 + var_2 * 4);
      }
      else {
        var_16((type_3 *)(var_15 + var_4 * 4),(type_3 *)(var_15 + var_2 * 4),var_11);
      }
    }
    if (var_4 == 0) goto LAB_001ec0f9;
    if (var_4 != 1) {
      var_17((type_3 *)var_15,var_12,var_4);
      goto LAB_001ec0f9;
    }
  }
  else {
    if ((var_4 == 0) || (var_2 < var_4)) {
LAB_001ec254:
      if (var_13 && var_14) goto LAB_001ec160;
    }
    else {
      if (var_4 == 1) {
        *(type_3 *)var_15 = *var_12;
        goto LAB_001ec254;
      }
      var_16((type_3 *)var_15,var_12,var_4);
      if (!var_13 || !var_14) goto LAB_001ec0f9;
LAB_001ec160:
      if (var_11 == 1) {
        *(type_3 *)(var_15 + var_4 * 4) = *(type_3 *)(var_15 + var_2 * 4);
      }
      else {
        var_16((type_3 *)(var_15 + var_4 * 4),(type_3 *)(var_15 + var_2 * 4),var_11);
      }
    }
    if (var_4 <= var_2) goto LAB_001ec0f9;
    var_6 = var_15 + var_2 * 4;
    if (var_6 < (type_2 *)(var_12 + var_4)) {
      if (var_12 < var_6) {
        var_11 = (int)var_6 - (int)var_12 >> 2;
        if (var_11 == 1) {
          *(type_3 *)var_15 = *var_12;
        }
        else if (var_11 != 0) {
          var_16((type_3 *)var_15,var_12,var_11);
        }
        var_11 = var_4 - var_11;
        if (var_11 == 1) {
          *(type_3 *)(var_15 + ((int)var_6 - (int)var_12)) = *(type_3 *)(var_15 + var_4 * 4);
        }
        else if (var_11 != 0) {
          var_17((type_3 *)(var_15 + ((int)var_6 - (int)var_12)),(type_3 *)(var_15 + var_4 * 4),
                  var_11);
        }
      }
      else if (var_4 == 1) {
        *(type_3 *)var_15 = var_12[var_4 - var_2];
      }
      else {
        var_17((type_3 *)var_15,var_12 + (var_4 - var_2),var_4);
      }
      goto LAB_001ec0f9;
    }
    if (var_4 != 1) {
      var_16((type_3 *)var_15,var_12,var_4);
      goto LAB_001ec0f9;
    }
  }
  *(type_3 *)var_15 = *var_12;
LAB_001ec0f9:
  *(type_1 *)(var_1 + 4) = var_8;
  *(type_4 *)(*(int *)var_1 + var_8 * 4) = 0;
  return var_1;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) 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)) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (identifier)) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier) (identifier)))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) right: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (identifier))))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (subscript_expression argument: (identifier) index: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)) (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (goto_statement label: (statement_identifier))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) consequence: (compound_statement (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (goto_statement label: (statement_identifier))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (goto_statement label: (statement_identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (unary_expression argument: (identifier)) right: (unary_expression argument: (identifier)))) consequence: (goto_statement label: (statement_identifier))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (subscript_expression argument: (identifier) index: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)) (binary_expression left: (identifier) right: (identifier)) (identifier))))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (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: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (subscript_expression argument: (identifier) index: (identifier))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier)) (identifier))))))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (subscript_expression argument: (identifier) index: (binary_expression left: (identifier) right: (identifier)))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (identifier))))))))) (goto_statement label: (statement_identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (goto_statement label: (statement_identifier))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (identifier)))) (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal))) (return_statement (identifier)))))

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

uint * MASKED(uint *param_1,int param_2,uint param_3,wchar_t *param_4,uint param_5)

{
  uint uVar1;
  wchar_t *__s1;
  uint uVar2;
  wchar_t *pwVar3;
  size_t sVar4;
  uint uVar5;
  bool bVar6;
  bool bVar7;
  
  uVar2 = param_1[1];
  if ((param_3 + 0x1fffffff) - uVar2 < param_5) {
                    /* WARNING: Subroutine does not return */
    FUN_0022c7a0("basic_string::_M_replace");
  }
  uVar1 = uVar2 + (param_5 - param_3);
  pwVar3 = (wchar_t *)*param_1;
  if (pwVar3 == (wchar_t *)(param_1 + 2)) {
    uVar5 = 3;
  }
  else {
    uVar5 = param_1[2];
  }
  if (uVar5 < uVar1) {
    FUN_001eb0a0(param_1,param_2,param_3,param_4,param_5);
    goto LAB_001ec0f9;
  }
  __s1 = pwVar3 + param_2;
  sVar4 = uVar2 - (param_2 + param_3);
  bVar6 = sVar4 != 0;
  bVar7 = param_3 != param_5;
  if ((param_4 < pwVar3) || (pwVar3 + uVar2 < param_4)) {
    if (bVar6 && bVar7) {
      if (sVar4 == 1) {
        __s1[param_5] = __s1[param_3];
      }
      else {
        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);
      }
    }
    if (param_5 == 0) goto LAB_001ec0f9;
    if (param_5 != 1) {
      wmemcpy(__s1,param_4,param_5);
      goto LAB_001ec0f9;
    }
  }
  else {
    if ((param_5 == 0) || (param_3 < param_5)) {
LAB_001ec254:
      if (bVar6 && bVar7) goto LAB_001ec160;
    }
    else {
      if (param_5 == 1) {
        *__s1 = *param_4;
        goto LAB_001ec254;
      }
      wmemmove(__s1,param_4,param_5);
      if (!bVar6 || !bVar7) goto LAB_001ec0f9;
LAB_001ec160:
      if (sVar4 == 1) {
        __s1[param_5] = __s1[param_3];
      }
      else {
        wmemmove(__s1 + param_5,__s1 + param_3,sVar4);
      }
    }
    if (param_5 <= param_3) goto LAB_001ec0f9;
    pwVar3 = __s1 + param_3;
    if (pwVar3 < param_4 + param_5) {
      if (param_4 < pwVar3) {
        sVar4 = (int)pwVar3 - (int)param_4 >> 2;
        if (sVar4 == 1) {
          *__s1 = *param_4;
        }
        else if (sVar4 != 0) {
          wmemmove(__s1,param_4,sVar4);
        }
        sVar4 = param_5 - sVar4;
        pwVar3 = (wchar_t *)((int)__s1 + ((int)pwVar3 - (int)param_4));
        if (sVar4 == 1) {
          *pwVar3 = __s1[param_5];
        }
        else if (sVar4 != 0) {
          wmemcpy(pwVar3,__s1 + param_5,sVar4);
        }
      }
      else if (param_5 == 1) {
        *__s1 = param_4[param_5 - param_3];
      }
      else {
        wmemcpy(__s1,param_4 + (param_5 - param_3),param_5);
      }
      goto LAB_001ec0f9;
    }
    if (param_5 != 1) {
      wmemmove(__s1,param_4,param_5);
      goto LAB_001ec0f9;
    }
  }
  *__s1 = *param_4;
LAB_001ec0f9:
  param_1[1] = uVar1;
  *(undefined4 *)(*param_1 + uVar1 * 4) = 0;
  return param_1;
}

