
/* std::wstring::_M_mutate(unsigned long, unsigned long, unsigned long) */

void __thiscall std::wstring::_M_mutate(wstring *this,ulong param_1,ulong param_2,ulong param_3)

{
  long lVar1;
  wchar_t *pwVar2;
  long lVar3;
  undefined8 *puVar4;
  wchar_t *pwVar5;
  wchar_t wVar6;
  size_t __n;
  ulong uVar7;
  ulong uVar8;
  undefined8 *puVar9;
  allocator local_39 [9];
  
  lVar1 = param_2 + param_1;
  lVar3 = *(long *)this;
  uVar8 = *(ulong *)(lVar3 + -0x10);
  uVar7 = (param_3 - param_2) + *(long *)(lVar3 + -0x18);
  __n = *(long *)(lVar3 + -0x18) - lVar1;
  if (uVar8 < uVar7) {
LAB_00355df9:
    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);
    if (param_1 == 0) {
      pwVar5 = *(wchar_t **)this;
    }
    else {
      pwVar5 = *(wchar_t **)this;
      if (param_1 == 1) {
        *(wchar_t *)(puVar4 + 3) = *pwVar5;
      }
      else {
        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);
        pwVar5 = *(wchar_t **)this;
      }
    }
    puVar9 = puVar4 + 3;
    if (__n != 0) {
      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);
      if (__n == 1) {
        *pwVar2 = pwVar5[lVar1];
      }
      else {
        wmemcpy(pwVar2,pwVar5 + lVar1,__n);
        pwVar5 = *(wchar_t **)this;
      }
    }
    if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {
      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {
        wVar6 = pwVar5[-2];
        pwVar5[-2] = wVar6 + L'\xffffffff';
      }
      else {
        LOCK();
        pwVar2 = pwVar5 + -2;
        wVar6 = *pwVar2;
        *pwVar2 = *pwVar2 + L'\xffffffff';
        UNLOCK();
      }
      if (wVar6 < L'\x01') {
        _Rep::_M_destroy((allocator *)(pwVar5 + -6));
      }
    }
    *(undefined8 **)this = puVar9;
  }
  else {
    if (0 < *(int *)(lVar3 + -8)) {
      uVar8 = *(ulong *)(*(long *)this + -0x10);
      goto LAB_00355df9;
    }
    puVar9 = *(undefined8 **)this;
    if ((__n == 0) || (param_3 == param_2)) {
LAB_00355efe:
      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {
        return;
      }
      goto LAB_00355f18;
    }
    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);
    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);
    if (__n != 1) {
      wmemmove(pwVar2,pwVar5,__n);
      puVar9 = *(undefined8 **)this;
      goto LAB_00355efe;
    }
    puVar4 = puVar9 + -3;
    *pwVar2 = *pwVar5;
  }
  if (puVar4 == &_Rep::_S_empty_rep_storage) {
    return;
  }
LAB_00355f18:
  *(undefined4 *)(puVar9 + -1) = 0;
  puVar9[-3] = uVar7;
  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;
  return;
}



void FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)

{
  long lVar1;
  wchar_t *pwVar2;
  wchar_t wVar3;
  long lVar4;
  undefined8 *puVar5;
  wchar_t *pwVar6;
  size_t __n;
  ulong uVar7;
  ulong uVar8;
  undefined8 *puVar9;
  undefined1 local_39 [9];
  
  lVar1 = param_3 + param_2;
  lVar4 = *param_1;
  uVar8 = *(ulong *)(lVar4 + -0x10);
  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);
  __n = *(long *)(lVar4 + -0x18) - lVar1;
  if (uVar8 < uVar7) {
LAB_00355df9:
    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);
    if (param_2 == 0) {
      pwVar6 = (wchar_t *)*param_1;
    }
    else {
      pwVar6 = (wchar_t *)*param_1;
      if (param_2 == 1) {
        *(wchar_t *)(puVar5 + 3) = *pwVar6;
      }
      else {
        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);
        pwVar6 = (wchar_t *)*param_1;
      }
    }
    puVar9 = puVar5 + 3;
    if (__n != 0) {
      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);
      if (__n == 1) {
        *pwVar2 = pwVar6[lVar1];
      }
      else {
        wmemcpy(pwVar2,pwVar6 + lVar1,__n);
        pwVar6 = (wchar_t *)*param_1;
      }
    }
    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {
      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {
        wVar3 = pwVar6[-2];
        pwVar6[-2] = wVar3 + L'\xffffffff';
      }
      else {
        LOCK();
        pwVar2 = pwVar6 + -2;
        wVar3 = *pwVar2;
        *pwVar2 = *pwVar2 + L'\xffffffff';
        UNLOCK();
      }
      if (wVar3 < L'\x01') {
        thunk_FUN_002dac70(pwVar6 + -6,local_39);
      }
    }
    *param_1 = (long)puVar9;
  }
  else {
    if (0 < *(int *)(lVar4 + -8)) {
      uVar8 = *(ulong *)(*param_1 + -0x10);
      goto LAB_00355df9;
    }
    puVar9 = (undefined8 *)*param_1;
    if ((__n == 0) || (param_4 == param_3)) {
LAB_00355efe:
      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {
        return;
      }
      goto LAB_00355f18;
    }
    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);
    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);
    if (__n != 1) {
      wmemmove(pwVar2,pwVar6,__n);
      puVar9 = (undefined8 *)*param_1;
      goto LAB_00355efe;
    }
    puVar5 = puVar9 + -3;
    *pwVar2 = *pwVar6;
  }
  if (puVar5 == &DAT_0044bdc0) {
    return;
  }
LAB_00355f18:
  *(undefined4 *)(puVar9 + -1) = 0;
  puVar9[-3] = uVar7;
  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;
  return;
}


PUSH R15
LEA R15,[RDX + RSI*0x1]
PUSH R14
MOV R14,RCX
PUSH R13
MOV R13,RSI
PUSH R12
MOV R12,RDI
PUSH RBP
MOV RBP,RCX
PUSH RBX
SUB RBP,RDX
SUB RSP,0x38
MOV RAX,qword ptr [RDI]
MOV RBX,qword ptr [RAX + -0x18]
MOV RSI,qword ptr [RAX + -0x10]
ADD RBP,RBX
SUB RBX,R15
CMP RBP,RSI
JA 0x00355df9
MOV EAX,dword ptr [RAX + -0x8]
TEST EAX,EAX
JLE 0x00355ed0
MOV RAX,qword ptr [RDI]
MOV RSI,qword ptr [RAX + -0x10]
LEA RAX,[RSP + 0x2f]
MOV RDI,RBP
MOV RDX,RAX
MOV qword ptr [RSP + 0x8],RAX
CALL 0x00355a20
MOV R8,RAX
TEST R13,R13
JNZ 0x00355e90
LEA R9,[RAX + 0x18]
MOV RAX,qword ptr [R12]
TEST RBX,RBX
JZ 0x00355e59
ADD R13,R14
LEA RSI,[RAX + R15*0x4]
LEA RDI,[R8 + R13*0x4 + 0x18]
CMP RBX,0x1
JZ 0x00355f48
MOV RDX,RBX
MOV qword ptr [RSP + 0x18],R9
MOV qword ptr [RSP + 0x10],R8
CALL 0x001470f0
MOV RAX,qword ptr [R12]
MOV R9,qword ptr [RSP + 0x18]
MOV R8,qword ptr [RSP + 0x10]
LEA RBX,[0x44bdc0]
LEA RDI,[RAX + -0x18]
CMP RDI,RBX
JNZ 0x00355f58
MOV qword ptr [R12],R9
CMP R8,RBX
JNZ 0x00355f18
ADD RSP,0x38
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RAX,qword ptr [R12]
LEA R9,[R8 + 0x18]
CMP R13,0x1
JZ 0x00355f38
MOV RDI,R9
MOV RDX,R13
MOV RSI,RAX
MOV qword ptr [RSP + 0x18],R8
MOV qword ptr [RSP + 0x10],R9
CALL 0x001470f0
MOV RAX,qword ptr [R12]
MOV R8,qword ptr [RSP + 0x18]
MOV R9,qword ptr [RSP + 0x10]
JMP 0x00355e1e
MOV R9,qword ptr [RDI]
TEST RBX,RBX
JZ 0x00355efe
CMP RCX,RDX
JZ 0x00355efe
ADD R13,RCX
LEA RSI,[R9 + R15*0x4]
LEA RDI,[R9 + R13*0x4]
CMP RBX,0x1
JZ 0x00355fb0
MOV RDX,RBX
CALL 0x00147720
MOV R9,qword ptr [R12]
LEA RBX,[0x44bdc0]
LEA R8,[R9 + -0x18]
CMP R8,RBX
JZ 0x00355e7a
NOP word ptr [RAX + RAX*0x1]
MOV dword ptr [R9 + -0x8],0x0
MOV qword ptr [R9 + -0x18],RBP
MOV dword ptr [R9 + RBP*0x4],0x0
JMP 0x00355e7a
MOV EDX,dword ptr [RAX]
MOV dword ptr [R8 + 0x18],EDX
JMP 0x00355e1e
MOV EDX,dword ptr [RSI]
MOV dword ptr [RDI],EDX
JMP 0x00355e59
CMP qword ptr [0x0043dee8],0x0
JZ 0x00355fa0
MOV EDX,0xffffffff
XADD.LOCK dword ptr [RAX + -0x8],EDX
TEST EDX,EDX
JG 0x00355e6d
MOV RSI,qword ptr [RSP + 0x8]
MOV qword ptr [RSP + 0x18],R9
MOV qword ptr [RSP + 0x10],R8
CALL 0x00355c20
MOV R9,qword ptr [RSP + 0x18]
MOV R8,qword ptr [RSP + 0x10]
JMP 0x00355e6d
MOV EDX,dword ptr [RAX + -0x8]
LEA ECX,[RDX + -0x1]
MOV dword ptr [RAX + -0x8],ECX
JMP 0x00355f6c
MOV EAX,dword ptr [RSI]
LEA R8,[R9 + -0x18]
LEA RBX,[0x44bdc0]
MOV dword ptr [RDI],EAX
JMP 0x00355e71
(translation_unit "void FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}\n\n" (function_definition "void FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" primitive_type (function_declarator "FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)" identifier (parameter_list "(long *param_1,size_t param_2,long param_3,long param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "wchar_t wVar3;" type_identifier identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "wchar_t *pwVar6;" type_identifier (pointer_declarator "*pwVar6" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (declaration "ulong uVar8;" type_identifier identifier ;) (declaration "undefined8 *puVar9;" type_identifier (pointer_declarator "*puVar9" * identifier) ;) (declaration "undefined1 local_39 [9];" type_identifier (array_declarator "local_39 [9]" identifier [ number_literal ]) ;) (expression_statement "lVar1 = param_3 + param_2;" (assignment_expression "lVar1 = param_3 + param_2" identifier = (binary_expression "param_3 + param_2" identifier + identifier)) ;) (expression_statement "lVar4 = *param_1;" (assignment_expression "lVar4 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar8 = *(ulong *)(lVar4 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(lVar4 + -0x10)" identifier = (pointer_expression "*(ulong *)(lVar4 + -0x10)" * (cast_expression "(ulong *)(lVar4 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -0x10)" ( (binary_expression "lVar4 + -0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);" (assignment_expression "uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18)" identifier = (binary_expression "(param_4 - param_3) + *(long *)(lVar4 + -0x18)" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + (pointer_expression "*(long *)(lVar4 + -0x18)" * (cast_expression "(long *)(lVar4 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -0x18)" ( (binary_expression "lVar4 + -0x18" identifier + number_literal) )))))) ;) (expression_statement "__n = *(long *)(lVar4 + -0x18) - lVar1;" (assignment_expression "__n = *(long *)(lVar4 + -0x18) - lVar1" identifier = (binary_expression "*(long *)(lVar4 + -0x18) - lVar1" (pointer_expression "*(long *)(lVar4 + -0x18)" * (cast_expression "(long *)(lVar4 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -0x18)" ( (binary_expression "lVar4 + -0x18" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" if (parenthesized_expression "(uVar8 < uVar7)" ( (binary_expression "uVar8 < uVar7" identifier < identifier) )) (compound_statement "{\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }" { (labeled_statement "LAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);" statement_identifier : (expression_statement "puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);" (assignment_expression "puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39)" identifier = (cast_expression "(undefined8 *)FUN_00355a20(uVar7,uVar8,local_39)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00355a20(uVar7,uVar8,local_39)" identifier (argument_list "(uVar7,uVar8,local_39)" ( identifier , identifier , identifier ))))) ;)) (if_statement "if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      pwVar6 = (wchar_t *)*param_1;\n    }" { (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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))) ;) }) (else_clause "else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" else (compound_statement "{\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" { (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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 (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }" { (expression_statement "*(wchar_t *)(puVar5 + 3) = *pwVar6;" (assignment_expression "*(wchar_t *)(puVar5 + 3) = *pwVar6" (pointer_expression "*(wchar_t *)(puVar5 + 3)" * (cast_expression "(wchar_t *)(puVar5 + 3)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar5 + 3)" ( (binary_expression "puVar5 + 3" identifier + number_literal) )))) = (pointer_expression "*pwVar6" * identifier)) ;) }) (else_clause "else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" else (compound_statement "{\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);" (call_expression "wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2)" identifier (argument_list "((wchar_t *)(puVar5 + 3),pwVar6,param_2)" ( (cast_expression "(wchar_t *)(puVar5 + 3)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar5 + 3)" ( (binary_expression "puVar5 + 3" identifier + number_literal) ))) , identifier , identifier ))) ;) (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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))) ;) }))) }))) (expression_statement "puVar9 = puVar5 + 3;" (assignment_expression "puVar9 = puVar5 + 3" identifier = (binary_expression "puVar5 + 3" identifier + number_literal)) ;) (if_statement "if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" { (expression_statement "pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" identifier = (cast_expression "(wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" ( (binary_expression "(long)puVar5 + (param_2 + param_4) * 4 + 0x18" (binary_expression "(long)puVar5 + (param_2 + param_4) * 4" (cast_expression "(long)puVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(param_2 + param_4) * 4" (parenthesized_expression "(param_2 + param_4)" ( (binary_expression "param_2 + param_4" identifier + identifier) )) * number_literal)) + number_literal) )))) ;) (if_statement "if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *pwVar2 = pwVar6[lVar1];\n      }" { (expression_statement "*pwVar2 = pwVar6[lVar1];" (assignment_expression "*pwVar2 = pwVar6[lVar1]" (pointer_expression "*pwVar2" * identifier) = (subscript_expression "pwVar6[lVar1]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" else (compound_statement "{\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy(pwVar2,pwVar6 + lVar1,__n);" (call_expression "wmemcpy(pwVar2,pwVar6 + lVar1,__n)" identifier (argument_list "(pwVar2,pwVar6 + lVar1,__n)" ( identifier , (binary_expression "pwVar6 + lVar1" identifier + identifier) , identifier ))) ;) (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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 (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }" if (parenthesized_expression "(pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0)" ( (binary_expression "pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0" (binary_expression "pwVar6 + -6" identifier + number_literal) != (cast_expression "(wchar_t *)&DAT_0044bdc0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044bdc0" & identifier))) )) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" if (parenthesized_expression "(PTR___pthread_key_create_0043dee8 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0043dee8 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }" { (expression_statement "wVar3 = pwVar6[-2];" (assignment_expression "wVar3 = pwVar6[-2]" identifier = (subscript_expression "pwVar6[-2]" identifier [ number_literal ])) ;) (expression_statement "pwVar6[-2] = wVar3 + L'\xffffffff';" (assignment_expression "pwVar6[-2] = wVar3 + L'\xffffffff'" (subscript_expression "pwVar6[-2]" identifier [ number_literal ]) = (binary_expression "wVar3 + L'\xffffffff'" identifier + (char_literal "L'\xffffffff'" L' escape_sequence character character character character '))) ;) }) (else_clause "else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "pwVar2 = pwVar6 + -2;" (assignment_expression "pwVar2 = pwVar6 + -2" identifier = (binary_expression "pwVar6 + -2" identifier + number_literal)) ;) (expression_statement "wVar3 = *pwVar2;" (assignment_expression "wVar3 = *pwVar2" identifier = (pointer_expression "*pwVar2" * identifier)) ;) (expression_statement "*pwVar2 = *pwVar2 + L'\xffffffff';" (assignment_expression "*pwVar2 = *pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" * identifier) = (binary_expression "*pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" * identifier) + (char_literal "L'\xffffffff'" L' escape_sequence character character character character '))) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }" if (parenthesized_expression "(wVar3 < L'\x01')" ( (binary_expression "wVar3 < L'\x01'" identifier < (char_literal "L'\x01'" L' escape_sequence ')) )) (compound_statement "{\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }" { (expression_statement "thunk_FUN_002dac70(pwVar6 + -6,local_39);" (call_expression "thunk_FUN_002dac70(pwVar6 + -6,local_39)" identifier (argument_list "(pwVar6 + -6,local_39)" ( (binary_expression "pwVar6 + -6" identifier + number_literal) , identifier ))) ;) })) })) (expression_statement "*param_1 = (long)puVar9;" (assignment_expression "*param_1 = (long)puVar9" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) (else_clause "else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" else (compound_statement "{\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" { (if_statement "if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }" if (parenthesized_expression "(0 < *(int *)(lVar4 + -8))" ( (binary_expression "0 < *(int *)(lVar4 + -8)" number_literal < (pointer_expression "*(int *)(lVar4 + -8)" * (cast_expression "(int *)(lVar4 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -8)" ( (binary_expression "lVar4 + -8" identifier + number_literal) ))))) )) (compound_statement "{\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }" { (expression_statement "uVar8 = *(ulong *)(*param_1 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(*param_1 + -0x10)" identifier = (pointer_expression "*(ulong *)(*param_1 + -0x10)" * (cast_expression "(ulong *)(*param_1 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0x10)" ( (binary_expression "*param_1 + -0x10" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (goto_statement "goto LAB_00355df9;" goto statement_identifier ;) })) (expression_statement "puVar9 = (undefined8 *)*param_1;" (assignment_expression "puVar9 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" if (parenthesized_expression "((__n == 0) || (param_4 == param_3))" ( (binary_expression "(__n == 0) || (param_4 == param_3)" (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) || (parenthesized_expression "(param_4 == param_3)" ( (binary_expression "param_4 == param_3" identifier == identifier) ))) )) (compound_statement "{\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" { (labeled_statement "LAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" statement_identifier : (if_statement "if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" if (parenthesized_expression "(puVar9 == (undefined8 *)&DAT_0044bdd8)" ( (binary_expression "puVar9 == (undefined8 *)&DAT_0044bdd8" identifier == (cast_expression "(undefined8 *)&DAT_0044bdd8" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044bdd8" & identifier))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) }))) (goto_statement "goto LAB_00355f18;" goto statement_identifier ;) })) (expression_statement "pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);" (assignment_expression "pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4)" identifier = (cast_expression "(wchar_t *)((long)puVar9 + lVar1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + lVar1 * 4)" ( (binary_expression "(long)puVar9 + lVar1 * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "lVar1 * 4" identifier * number_literal)) )))) ;) (expression_statement "pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4)" identifier = (cast_expression "(wchar_t *)((long)puVar9 + (param_2 + param_4) * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + (param_2 + param_4) * 4)" ( (binary_expression "(long)puVar9 + (param_2 + param_4) * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(param_2 + param_4) * 4" (parenthesized_expression "(param_2 + param_4)" ( (binary_expression "param_2 + param_4" identifier + identifier) )) * number_literal)) )))) ;) (if_statement "if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }" if (parenthesized_expression "(__n != 1)" ( (binary_expression "__n != 1" identifier != number_literal) )) (compound_statement "{\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }" { (expression_statement "wmemmove(pwVar2,pwVar6,__n);" (call_expression "wmemmove(pwVar2,pwVar6,__n)" identifier (argument_list "(pwVar2,pwVar6,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar9 = (undefined8 *)*param_1;" (assignment_expression "puVar9 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (goto_statement "goto LAB_00355efe;" goto statement_identifier ;) })) (expression_statement "puVar5 = puVar9 + -3;" (assignment_expression "puVar5 = puVar9 + -3" identifier = (binary_expression "puVar9 + -3" identifier + number_literal)) ;) (expression_statement "*pwVar2 = *pwVar6;" (assignment_expression "*pwVar2 = *pwVar6" (pointer_expression "*pwVar2" * identifier) = (pointer_expression "*pwVar6" * identifier)) ;) }))) (if_statement "if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }" if (parenthesized_expression "(puVar5 == &DAT_0044bdc0)" ( (binary_expression "puVar5 == &DAT_0044bdc0" identifier == (pointer_expression "&DAT_0044bdc0" & identifier)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;" statement_identifier : (expression_statement "*(undefined4 *)(puVar9 + -1) = 0;" (assignment_expression "*(undefined4 *)(puVar9 + -1) = 0" (pointer_expression "*(undefined4 *)(puVar9 + -1)" * (cast_expression "(undefined4 *)(puVar9 + -1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar9 + -1)" ( (binary_expression "puVar9 + -1" identifier + number_literal) )))) = number_literal) ;)) (expression_statement "puVar9[-3] = uVar7;" (assignment_expression "puVar9[-3] = uVar7" (subscript_expression "puVar9[-3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0" (pointer_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4)" * (cast_expression "(undefined4 *)((long)puVar9 + uVar7 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + uVar7 * 4)" ( (binary_expression "(long)puVar9 + uVar7 * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "uVar7 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "/* std::wstring::_M_mutate(unsigned long, unsigned long, unsigned long) */\n\nvoid __thiscall std::wstring::_M_mutate(wstring *this,ulong param_1,ulong param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  wchar_t *pwVar5;\n  wchar_t wVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  allocator local_39 [9];\n  \n  lVar1 = param_2 + param_1;\n  lVar3 = *(long *)this;\n  uVar8 = *(ulong *)(lVar3 + -0x10);\n  uVar7 = (param_3 - param_2) + *(long *)(lVar3 + -0x18);\n  __n = *(long *)(lVar3 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);\n    if (param_1 == 0) {\n      pwVar5 = *(wchar_t **)this;\n    }\n    else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    puVar9 = puVar4 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }\n    *(undefined8 **)this = puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }\n    puVar4 = puVar9 + -3;\n    *pwVar2 = *pwVar5;\n  }\n  if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}\n\n" comment (function_definition "void __thiscall std::wstring::_M_mutate(wstring *this,ulong param_1,ulong param_2,ulong param_3)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  wchar_t *pwVar5;\n  wchar_t wVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  allocator local_39 [9];\n  \n  lVar1 = param_2 + param_1;\n  lVar3 = *(long *)this;\n  uVar8 = *(ulong *)(lVar3 + -0x10);\n  uVar7 = (param_3 - param_2) + *(long *)(lVar3 + -0x18);\n  __n = *(long *)(lVar3 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);\n    if (param_1 == 0) {\n      pwVar5 = *(wchar_t **)this;\n    }\n    else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    puVar9 = puVar4 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }\n    *(undefined8 **)this = puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }\n    puVar4 = puVar9 + -3;\n    *pwVar2 = *pwVar5;\n  }\n  if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::wstring::" identifier : : identifier : :) (function_declarator "_M_mutate(wstring *this,ulong param_1,ulong param_2,ulong param_3)" identifier (parameter_list "(wstring *this,ulong param_1,ulong param_2,ulong param_3)" ( (parameter_declaration "wstring *this" type_identifier (pointer_declarator "*this" * identifier)) , (parameter_declaration "ulong param_1" type_identifier identifier) , (parameter_declaration "ulong param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  long lVar3;\n  undefined8 *puVar4;\n  wchar_t *pwVar5;\n  wchar_t wVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  allocator local_39 [9];\n  \n  lVar1 = param_2 + param_1;\n  lVar3 = *(long *)this;\n  uVar8 = *(ulong *)(lVar3 + -0x10);\n  uVar7 = (param_3 - param_2) + *(long *)(lVar3 + -0x18);\n  __n = *(long *)(lVar3 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);\n    if (param_1 == 0) {\n      pwVar5 = *(wchar_t **)this;\n    }\n    else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    puVar9 = puVar4 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }\n    *(undefined8 **)this = puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }\n    puVar4 = puVar9 + -3;\n    *pwVar2 = *pwVar5;\n  }\n  if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "long lVar3;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "wchar_t *pwVar5;" type_identifier (pointer_declarator "*pwVar5" * identifier) ;) (declaration "wchar_t wVar6;" type_identifier identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (declaration "ulong uVar8;" type_identifier identifier ;) (declaration "undefined8 *puVar9;" type_identifier (pointer_declarator "*puVar9" * identifier) ;) (declaration "allocator local_39 [9];" type_identifier (array_declarator "local_39 [9]" identifier [ number_literal ]) ;) (expression_statement "lVar1 = param_2 + param_1;" (assignment_expression "lVar1 = param_2 + param_1" identifier = (binary_expression "param_2 + param_1" identifier + identifier)) ;) (expression_statement "lVar3 = *(long *)this;" (assignment_expression "lVar3 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;) (expression_statement "uVar8 = *(ulong *)(lVar3 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(lVar3 + -0x10)" identifier = (pointer_expression "*(ulong *)(lVar3 + -0x10)" * (cast_expression "(ulong *)(lVar3 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar3 + -0x10)" ( (binary_expression "lVar3 + -0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar7 = (param_3 - param_2) + *(long *)(lVar3 + -0x18);" (assignment_expression "uVar7 = (param_3 - param_2) + *(long *)(lVar3 + -0x18)" identifier = (binary_expression "(param_3 - param_2) + *(long *)(lVar3 + -0x18)" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + (pointer_expression "*(long *)(lVar3 + -0x18)" * (cast_expression "(long *)(lVar3 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar3 + -0x18)" ( (binary_expression "lVar3 + -0x18" identifier + number_literal) )))))) ;) (expression_statement "__n = *(long *)(lVar3 + -0x18) - lVar1;" (assignment_expression "__n = *(long *)(lVar3 + -0x18) - lVar1" identifier = (binary_expression "*(long *)(lVar3 + -0x18) - lVar1" (pointer_expression "*(long *)(lVar3 + -0x18)" * (cast_expression "(long *)(lVar3 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar3 + -0x18)" ( (binary_expression "lVar3 + -0x18" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);\n    if (param_1 == 0) {\n      pwVar5 = *(wchar_t **)this;\n    }\n    else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    puVar9 = puVar4 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }\n    *(undefined8 **)this = puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }\n    puVar4 = puVar9 + -3;\n    *pwVar2 = *pwVar5;\n  }" if (parenthesized_expression "(uVar8 < uVar7)" ( (binary_expression "uVar8 < uVar7" identifier < identifier) )) (compound_statement "{\nLAB_00355df9:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);\n    if (param_1 == 0) {\n      pwVar5 = *(wchar_t **)this;\n    }\n    else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    puVar9 = puVar4 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }\n    if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }\n    *(undefined8 **)this = puVar9;\n  }" { (labeled_statement "LAB_00355df9:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar7,uVar8,local_39);" statement_identifier : (ERROR "puVar4 = (undefined8 *)_Rep::" (assignment_expression "puVar4 = (undefined8 *)_Rep" identifier = (cast_expression "(undefined8 *)_Rep" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) : :) (expression_statement "_S_create(uVar7,uVar8,local_39);" (call_expression "_S_create(uVar7,uVar8,local_39)" identifier (argument_list "(uVar7,uVar8,local_39)" ( identifier , identifier , identifier ))) ;)) (if_statement "if (param_1 == 0) {\n      pwVar5 = *(wchar_t **)this;\n    }\n    else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n      pwVar5 = *(wchar_t **)this;\n    }" { (expression_statement "pwVar5 = *(wchar_t **)this;" (assignment_expression "pwVar5 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }) (else_clause "else {\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }" else (compound_statement "{\n      pwVar5 = *(wchar_t **)this;\n      if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }" { (expression_statement "pwVar5 = *(wchar_t **)this;" (assignment_expression "pwVar5 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if (param_1 == 1) {\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }" if (parenthesized_expression "(param_1 == 1)" ( (binary_expression "param_1 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(puVar4 + 3) = *pwVar5;\n      }" { (expression_statement "*(wchar_t *)(puVar4 + 3) = *pwVar5;" (assignment_expression "*(wchar_t *)(puVar4 + 3) = *pwVar5" (pointer_expression "*(wchar_t *)(puVar4 + 3)" * (cast_expression "(wchar_t *)(puVar4 + 3)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 3)" ( (binary_expression "puVar4 + 3" identifier + number_literal) )))) = (pointer_expression "*pwVar5" * identifier)) ;) }) (else_clause "else {\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }" else (compound_statement "{\n        wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);\n        pwVar5 = *(wchar_t **)this;\n      }" { (expression_statement "wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1);" (call_expression "wmemcpy((wchar_t *)(puVar4 + 3),pwVar5,param_1)" identifier (argument_list "((wchar_t *)(puVar4 + 3),pwVar5,param_1)" ( (cast_expression "(wchar_t *)(puVar4 + 3)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 3)" ( (binary_expression "puVar4 + 3" identifier + number_literal) ))) , identifier , identifier ))) ;) (expression_statement "pwVar5 = *(wchar_t **)this;" (assignment_expression "pwVar5 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) }))) (expression_statement "puVar9 = puVar4 + 3;" (assignment_expression "puVar9 = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }\n    }" { (expression_statement "pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18)" identifier = (cast_expression "(wchar_t *)((long)puVar4 + (param_1 + param_3) * 4 + 0x18)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar4 + (param_1 + param_3) * 4 + 0x18)" ( (binary_expression "(long)puVar4 + (param_1 + param_3) * 4 + 0x18" (binary_expression "(long)puVar4 + (param_1 + param_3) * 4" (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(param_1 + param_3) * 4" (parenthesized_expression "(param_1 + param_3)" ( (binary_expression "param_1 + param_3" identifier + identifier) )) * number_literal)) + number_literal) )))) ;) (if_statement "if (__n == 1) {\n        *pwVar2 = pwVar5[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *pwVar2 = pwVar5[lVar1];\n      }" { (expression_statement "*pwVar2 = pwVar5[lVar1];" (assignment_expression "*pwVar2 = pwVar5[lVar1]" (pointer_expression "*pwVar2" * identifier) = (subscript_expression "pwVar5[lVar1]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }" else (compound_statement "{\n        wmemcpy(pwVar2,pwVar5 + lVar1,__n);\n        pwVar5 = *(wchar_t **)this;\n      }" { (expression_statement "wmemcpy(pwVar2,pwVar5 + lVar1,__n);" (call_expression "wmemcpy(pwVar2,pwVar5 + lVar1,__n)" identifier (argument_list "(pwVar2,pwVar5 + lVar1,__n)" ( identifier , (binary_expression "pwVar5 + lVar1" identifier + identifier) , identifier ))) ;) (expression_statement "pwVar5 = *(wchar_t **)this;" (assignment_expression "pwVar5 = *(wchar_t **)this" identifier = (pointer_expression "*(wchar_t **)this" * (cast_expression "(wchar_t **)this" ( (type_descriptor "wchar_t **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) }))) })) (if_statement "if ((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }" if (parenthesized_expression "((allocator *)(pwVar5 + -6) != (allocator *)&_Rep::_S_empty_rep_storage)" ( (binary_expression "(allocator *)(pwVar5 + -6) != (allocator *)&_Rep" (cast_expression "(allocator *)(pwVar5 + -6)" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar5 + -6)" ( (binary_expression "pwVar5 + -6" identifier + number_literal) ))) != (cast_expression "(allocator *)&_Rep" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&_Rep" & identifier))) (ERROR "::_S_empty_rep_storage" : : identifier) )) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" if (parenthesized_expression "(PTR___pthread_key_create_0043dee8 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0043dee8 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        wVar6 = pwVar5[-2];\n        pwVar5[-2] = wVar6 + L'\xffffffff';\n      }" { (expression_statement "wVar6 = pwVar5[-2];" (assignment_expression "wVar6 = pwVar5[-2]" identifier = (subscript_expression "pwVar5[-2]" identifier [ number_literal ])) ;) (expression_statement "pwVar5[-2] = wVar6 + L'\xffffffff';" (assignment_expression "pwVar5[-2] = wVar6 + L'\xffffffff'" (subscript_expression "pwVar5[-2]" identifier [ number_literal ]) = (binary_expression "wVar6 + L'\xffffffff'" identifier + (char_literal "L'\xffffffff'" L' escape_sequence character character character character '))) ;) }) (else_clause "else {\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        pwVar2 = pwVar5 + -2;\n        wVar6 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "pwVar2 = pwVar5 + -2;" (assignment_expression "pwVar2 = pwVar5 + -2" identifier = (binary_expression "pwVar5 + -2" identifier + number_literal)) ;) (expression_statement "wVar6 = *pwVar2;" (assignment_expression "wVar6 = *pwVar2" identifier = (pointer_expression "*pwVar2" * identifier)) ;) (expression_statement "*pwVar2 = *pwVar2 + L'\xffffffff';" (assignment_expression "*pwVar2 = *pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" * identifier) = (binary_expression "*pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" * identifier) + (char_literal "L'\xffffffff'" L' escape_sequence character character character character '))) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (wVar6 < L'\x01') {\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }" if (parenthesized_expression "(wVar6 < L'\x01')" ( (binary_expression "wVar6 < L'\x01'" identifier < (char_literal "L'\x01'" L' escape_sequence ')) )) (compound_statement "{\n        _Rep::_M_destroy((allocator *)(pwVar5 + -6));\n      }" { (labeled_statement "_Rep::_M_destroy((allocator *)(pwVar5 + -6));" statement_identifier : (ERROR ":" :) (expression_statement "_M_destroy((allocator *)(pwVar5 + -6));" (call_expression "_M_destroy((allocator *)(pwVar5 + -6))" identifier (argument_list "((allocator *)(pwVar5 + -6))" ( (cast_expression "(allocator *)(pwVar5 + -6)" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(pwVar5 + -6)" ( (binary_expression "pwVar5 + -6" identifier + number_literal) ))) ))) ;)) })) })) (expression_statement "*(undefined8 **)this = puVar9;" (assignment_expression "*(undefined8 **)this = puVar9" (pointer_expression "*(undefined8 **)this" * (cast_expression "(undefined8 **)this" ( (type_descriptor "undefined8 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) = identifier) ;) }) (else_clause "else {\n    if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }\n    puVar4 = puVar9 + -3;\n    *pwVar2 = *pwVar5;\n  }" else (compound_statement "{\n    if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }\n    puVar4 = puVar9 + -3;\n    *pwVar2 = *pwVar5;\n  }" { (if_statement "if (0 < *(int *)(lVar3 + -8)) {\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }" if (parenthesized_expression "(0 < *(int *)(lVar3 + -8))" ( (binary_expression "0 < *(int *)(lVar3 + -8)" number_literal < (pointer_expression "*(int *)(lVar3 + -8)" * (cast_expression "(int *)(lVar3 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar3 + -8)" ( (binary_expression "lVar3 + -8" identifier + number_literal) ))))) )) (compound_statement "{\n      uVar8 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_00355df9;\n    }" { (expression_statement "uVar8 = *(ulong *)(*(long *)this + -0x10);" (assignment_expression "uVar8 = *(ulong *)(*(long *)this + -0x10)" identifier = (pointer_expression "*(ulong *)(*(long *)this + -0x10)" * (cast_expression "(ulong *)(*(long *)this + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*(long *)this + -0x10)" ( (binary_expression "*(long *)this + -0x10" (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier)) + number_literal) ))))) ;) (goto_statement "goto LAB_00355df9;" goto statement_identifier ;) })) (expression_statement "puVar9 = *(undefined8 **)this;" (assignment_expression "puVar9 = *(undefined8 **)this" identifier = (pointer_expression "*(undefined8 **)this" * (cast_expression "(undefined8 **)this" ( (type_descriptor "undefined8 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (if_statement "if ((__n == 0) || (param_3 == param_2)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" if (parenthesized_expression "((__n == 0) || (param_3 == param_2))" ( (binary_expression "(__n == 0) || (param_3 == param_2)" (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) || (parenthesized_expression "(param_3 == param_2)" ( (binary_expression "param_3 == param_2" identifier == identifier) ))) )) (compound_statement "{\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" { (labeled_statement "LAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" statement_identifier : (if_statement "if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" if (parenthesized_expression "(puVar9 == (undefined8 *)&DAT_0044bdd8)" ( (binary_expression "puVar9 == (undefined8 *)&DAT_0044bdd8" identifier == (cast_expression "(undefined8 *)&DAT_0044bdd8" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044bdd8" & identifier))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) }))) (goto_statement "goto LAB_00355f18;" goto statement_identifier ;) })) (expression_statement "pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4);" (assignment_expression "pwVar5 = (wchar_t *)((long)puVar9 + lVar1 * 4)" identifier = (cast_expression "(wchar_t *)((long)puVar9 + lVar1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + lVar1 * 4)" ( (binary_expression "(long)puVar9 + lVar1 * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "lVar1 * 4" identifier * number_literal)) )))) ;) (expression_statement "pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar9 + (param_1 + param_3) * 4)" identifier = (cast_expression "(wchar_t *)((long)puVar9 + (param_1 + param_3) * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + (param_1 + param_3) * 4)" ( (binary_expression "(long)puVar9 + (param_1 + param_3) * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(param_1 + param_3) * 4" (parenthesized_expression "(param_1 + param_3)" ( (binary_expression "param_1 + param_3" identifier + identifier) )) * number_literal)) )))) ;) (if_statement "if (__n != 1) {\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }" if (parenthesized_expression "(__n != 1)" ( (binary_expression "__n != 1" identifier != number_literal) )) (compound_statement "{\n      wmemmove(pwVar2,pwVar5,__n);\n      puVar9 = *(undefined8 **)this;\n      goto LAB_00355efe;\n    }" { (expression_statement "wmemmove(pwVar2,pwVar5,__n);" (call_expression "wmemmove(pwVar2,pwVar5,__n)" identifier (argument_list "(pwVar2,pwVar5,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar9 = *(undefined8 **)this;" (assignment_expression "puVar9 = *(undefined8 **)this" identifier = (pointer_expression "*(undefined8 **)this" * (cast_expression "(undefined8 **)this" ( (type_descriptor "undefined8 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (goto_statement "goto LAB_00355efe;" goto statement_identifier ;) })) (expression_statement "puVar4 = puVar9 + -3;" (assignment_expression "puVar4 = puVar9 + -3" identifier = (binary_expression "puVar9 + -3" identifier + number_literal)) ;) (expression_statement "*pwVar2 = *pwVar5;" (assignment_expression "*pwVar2 = *pwVar5" (pointer_expression "*pwVar2" * identifier) = (pointer_expression "*pwVar5" * identifier)) ;) }))) (if_statement "if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }" if (parenthesized_expression "(puVar4 == &_Rep::_S_empty_rep_storage)" ( (ERROR "puVar4 == &_Rep::" (binary_expression "puVar4 == &_Rep" identifier == (pointer_expression "&_Rep" & identifier)) : :) identifier )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;" statement_identifier : (expression_statement "*(undefined4 *)(puVar9 + -1) = 0;" (assignment_expression "*(undefined4 *)(puVar9 + -1) = 0" (pointer_expression "*(undefined4 *)(puVar9 + -1)" * (cast_expression "(undefined4 *)(puVar9 + -1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar9 + -1)" ( (binary_expression "puVar9 + -1" identifier + number_literal) )))) = number_literal) ;)) (expression_statement "puVar9[-3] = uVar7;" (assignment_expression "puVar9[-3] = uVar7" (subscript_expression "puVar9[-3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0" (pointer_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4)" * (cast_expression "(undefined4 *)((long)puVar9 + uVar7 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + uVar7 * 4)" ( (binary_expression "(long)puVar9 + uVar7 * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "uVar7 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}\n\n" (function_definition "void FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" primitive_type (function_declarator "FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)" identifier (parameter_list "(long *param_1,size_t param_2,long param_3,long param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_4" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "wchar_t wVar3;" type_identifier identifier ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined8 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "wchar_t *pwVar6;" type_identifier (pointer_declarator "*pwVar6" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar7;" type_identifier identifier ;) (declaration "ulong uVar8;" type_identifier identifier ;) (declaration "undefined8 *puVar9;" type_identifier (pointer_declarator "*puVar9" * identifier) ;) (declaration "undefined1 local_39 [9];" type_identifier (array_declarator "local_39 [9]" identifier [ number_literal ]) ;) (expression_statement "lVar1 = param_3 + param_2;" (assignment_expression "lVar1 = param_3 + param_2" identifier = (binary_expression "param_3 + param_2" identifier + identifier)) ;) (expression_statement "lVar4 = *param_1;" (assignment_expression "lVar4 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar8 = *(ulong *)(lVar4 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(lVar4 + -0x10)" identifier = (pointer_expression "*(ulong *)(lVar4 + -0x10)" * (cast_expression "(ulong *)(lVar4 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -0x10)" ( (binary_expression "lVar4 + -0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);" (assignment_expression "uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18)" identifier = (binary_expression "(param_4 - param_3) + *(long *)(lVar4 + -0x18)" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + (pointer_expression "*(long *)(lVar4 + -0x18)" * (cast_expression "(long *)(lVar4 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -0x18)" ( (binary_expression "lVar4 + -0x18" identifier + number_literal) )))))) ;) (expression_statement "__n = *(long *)(lVar4 + -0x18) - lVar1;" (assignment_expression "__n = *(long *)(lVar4 + -0x18) - lVar1" identifier = (binary_expression "*(long *)(lVar4 + -0x18) - lVar1" (pointer_expression "*(long *)(lVar4 + -0x18)" * (cast_expression "(long *)(lVar4 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -0x18)" ( (binary_expression "lVar4 + -0x18" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" if (parenthesized_expression "(uVar8 < uVar7)" ( (binary_expression "uVar8 < uVar7" identifier < identifier) )) (compound_statement "{\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }" { (labeled_statement "LAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);" statement_identifier : (expression_statement "puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);" (assignment_expression "puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39)" identifier = (cast_expression "(undefined8 *)FUN_00355a20(uVar7,uVar8,local_39)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00355a20(uVar7,uVar8,local_39)" identifier (argument_list "(uVar7,uVar8,local_39)" ( identifier , identifier , identifier ))))) ;)) (if_statement "if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n      pwVar6 = (wchar_t *)*param_1;\n    }" { (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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))) ;) }) (else_clause "else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" else (compound_statement "{\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" { (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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 (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(param_2 == 1)" ( (binary_expression "param_2 == 1" identifier == number_literal) )) (compound_statement "{\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }" { (expression_statement "*(wchar_t *)(puVar5 + 3) = *pwVar6;" (assignment_expression "*(wchar_t *)(puVar5 + 3) = *pwVar6" (pointer_expression "*(wchar_t *)(puVar5 + 3)" * (cast_expression "(wchar_t *)(puVar5 + 3)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar5 + 3)" ( (binary_expression "puVar5 + 3" identifier + number_literal) )))) = (pointer_expression "*pwVar6" * identifier)) ;) }) (else_clause "else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" else (compound_statement "{\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);" (call_expression "wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2)" identifier (argument_list "((wchar_t *)(puVar5 + 3),pwVar6,param_2)" ( (cast_expression "(wchar_t *)(puVar5 + 3)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar5 + 3)" ( (binary_expression "puVar5 + 3" identifier + number_literal) ))) , identifier , identifier ))) ;) (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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))) ;) }))) }))) (expression_statement "puVar9 = puVar5 + 3;" (assignment_expression "puVar9 = puVar5 + 3" identifier = (binary_expression "puVar5 + 3" identifier + number_literal)) ;) (if_statement "if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" { (expression_statement "pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" identifier = (cast_expression "(wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" ( (binary_expression "(long)puVar5 + (param_2 + param_4) * 4 + 0x18" (binary_expression "(long)puVar5 + (param_2 + param_4) * 4" (cast_expression "(long)puVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(param_2 + param_4) * 4" (parenthesized_expression "(param_2 + param_4)" ( (binary_expression "param_2 + param_4" identifier + identifier) )) * number_literal)) + number_literal) )))) ;) (if_statement "if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *pwVar2 = pwVar6[lVar1];\n      }" { (expression_statement "*pwVar2 = pwVar6[lVar1];" (assignment_expression "*pwVar2 = pwVar6[lVar1]" (pointer_expression "*pwVar2" * identifier) = (subscript_expression "pwVar6[lVar1]" identifier [ identifier ])) ;) }) (else_clause "else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" else (compound_statement "{\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" { (expression_statement "wmemcpy(pwVar2,pwVar6 + lVar1,__n);" (call_expression "wmemcpy(pwVar2,pwVar6 + lVar1,__n)" identifier (argument_list "(pwVar2,pwVar6 + lVar1,__n)" ( identifier , (binary_expression "pwVar6 + lVar1" identifier + identifier) , identifier ))) ;) (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (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 (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }" if (parenthesized_expression "(pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0)" ( (binary_expression "pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0" (binary_expression "pwVar6 + -6" identifier + number_literal) != (cast_expression "(wchar_t *)&DAT_0044bdc0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044bdc0" & identifier))) )) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" if (parenthesized_expression "(PTR___pthread_key_create_0043dee8 == (undefined *)0x0)" ( (binary_expression "PTR___pthread_key_create_0043dee8 == (undefined *)0x0" identifier == (cast_expression "(undefined *)0x0" ( (type_descriptor "undefined *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }" { (expression_statement "wVar3 = pwVar6[-2];" (assignment_expression "wVar3 = pwVar6[-2]" identifier = (subscript_expression "pwVar6[-2]" identifier [ number_literal ])) ;) (expression_statement "pwVar6[-2] = wVar3 + L'\xffffffff';" (assignment_expression "pwVar6[-2] = wVar3 + L'\xffffffff'" (subscript_expression "pwVar6[-2]" identifier [ number_literal ]) = (binary_expression "wVar3 + L'\xffffffff'" identifier + (char_literal "L'\xffffffff'" L' escape_sequence character character character character '))) ;) }) (else_clause "else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "pwVar2 = pwVar6 + -2;" (assignment_expression "pwVar2 = pwVar6 + -2" identifier = (binary_expression "pwVar6 + -2" identifier + number_literal)) ;) (expression_statement "wVar3 = *pwVar2;" (assignment_expression "wVar3 = *pwVar2" identifier = (pointer_expression "*pwVar2" * identifier)) ;) (expression_statement "*pwVar2 = *pwVar2 + L'\xffffffff';" (assignment_expression "*pwVar2 = *pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" * identifier) = (binary_expression "*pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" * identifier) + (char_literal "L'\xffffffff'" L' escape_sequence character character character character '))) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }" if (parenthesized_expression "(wVar3 < L'\x01')" ( (binary_expression "wVar3 < L'\x01'" identifier < (char_literal "L'\x01'" L' escape_sequence ')) )) (compound_statement "{\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }" { (expression_statement "thunk_FUN_002dac70(pwVar6 + -6,local_39);" (call_expression "thunk_FUN_002dac70(pwVar6 + -6,local_39)" identifier (argument_list "(pwVar6 + -6,local_39)" ( (binary_expression "pwVar6 + -6" identifier + number_literal) , identifier ))) ;) })) })) (expression_statement "*param_1 = (long)puVar9;" (assignment_expression "*param_1 = (long)puVar9" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) (else_clause "else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" else (compound_statement "{\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" { (if_statement "if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }" if (parenthesized_expression "(0 < *(int *)(lVar4 + -8))" ( (binary_expression "0 < *(int *)(lVar4 + -8)" number_literal < (pointer_expression "*(int *)(lVar4 + -8)" * (cast_expression "(int *)(lVar4 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar4 + -8)" ( (binary_expression "lVar4 + -8" identifier + number_literal) ))))) )) (compound_statement "{\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }" { (expression_statement "uVar8 = *(ulong *)(*param_1 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(*param_1 + -0x10)" identifier = (pointer_expression "*(ulong *)(*param_1 + -0x10)" * (cast_expression "(ulong *)(*param_1 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + -0x10)" ( (binary_expression "*param_1 + -0x10" (pointer_expression "*param_1" * identifier) + number_literal) ))))) ;) (goto_statement "goto LAB_00355df9;" goto statement_identifier ;) })) (expression_statement "puVar9 = (undefined8 *)*param_1;" (assignment_expression "puVar9 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (if_statement "if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" if (parenthesized_expression "((__n == 0) || (param_4 == param_3))" ( (binary_expression "(__n == 0) || (param_4 == param_3)" (parenthesized_expression "(__n == 0)" ( (binary_expression "__n == 0" identifier == number_literal) )) || (parenthesized_expression "(param_4 == param_3)" ( (binary_expression "param_4 == param_3" identifier == identifier) ))) )) (compound_statement "{\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" { (labeled_statement "LAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" statement_identifier : (if_statement "if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" if (parenthesized_expression "(puVar9 == (undefined8 *)&DAT_0044bdd8)" ( (binary_expression "puVar9 == (undefined8 *)&DAT_0044bdd8" identifier == (cast_expression "(undefined8 *)&DAT_0044bdd8" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044bdd8" & identifier))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) }))) (goto_statement "goto LAB_00355f18;" goto statement_identifier ;) })) (expression_statement "pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);" (assignment_expression "pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4)" identifier = (cast_expression "(wchar_t *)((long)puVar9 + lVar1 * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + lVar1 * 4)" ( (binary_expression "(long)puVar9 + lVar1 * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "lVar1 * 4" identifier * number_literal)) )))) ;) (expression_statement "pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4)" identifier = (cast_expression "(wchar_t *)((long)puVar9 + (param_2 + param_4) * 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + (param_2 + param_4) * 4)" ( (binary_expression "(long)puVar9 + (param_2 + param_4) * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "(param_2 + param_4) * 4" (parenthesized_expression "(param_2 + param_4)" ( (binary_expression "param_2 + param_4" identifier + identifier) )) * number_literal)) )))) ;) (if_statement "if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }" if (parenthesized_expression "(__n != 1)" ( (binary_expression "__n != 1" identifier != number_literal) )) (compound_statement "{\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }" { (expression_statement "wmemmove(pwVar2,pwVar6,__n);" (call_expression "wmemmove(pwVar2,pwVar6,__n)" identifier (argument_list "(pwVar2,pwVar6,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "puVar9 = (undefined8 *)*param_1;" (assignment_expression "puVar9 = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (goto_statement "goto LAB_00355efe;" goto statement_identifier ;) })) (expression_statement "puVar5 = puVar9 + -3;" (assignment_expression "puVar5 = puVar9 + -3" identifier = (binary_expression "puVar9 + -3" identifier + number_literal)) ;) (expression_statement "*pwVar2 = *pwVar6;" (assignment_expression "*pwVar2 = *pwVar6" (pointer_expression "*pwVar2" * identifier) = (pointer_expression "*pwVar6" * identifier)) ;) }))) (if_statement "if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }" if (parenthesized_expression "(puVar5 == &DAT_0044bdc0)" ( (binary_expression "puVar5 == &DAT_0044bdc0" identifier == (pointer_expression "&DAT_0044bdc0" & identifier)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;" statement_identifier : (expression_statement "*(undefined4 *)(puVar9 + -1) = 0;" (assignment_expression "*(undefined4 *)(puVar9 + -1) = 0" (pointer_expression "*(undefined4 *)(puVar9 + -1)" * (cast_expression "(undefined4 *)(puVar9 + -1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar9 + -1)" ( (binary_expression "puVar9 + -1" identifier + number_literal) )))) = number_literal) ;)) (expression_statement "puVar9[-3] = uVar7;" (assignment_expression "puVar9[-3] = uVar7" (subscript_expression "puVar9[-3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0" (pointer_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4)" * (cast_expression "(undefined4 *)((long)puVar9 + uVar7 * 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)puVar9 + uVar7 * 4)" ( (binary_expression "(long)puVar9 + uVar7 * 4" (cast_expression "(long)puVar9" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (binary_expression "uVar7 * 4" identifier * number_literal)) )))) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT - IDENT) )) + (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) - IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))))) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (pointer_expression * IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) }))) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (binary_expression (parenthesized_expression ( (binary_expression IDENT + IDENT) )) * LIT)) + LIT) )))) ;) (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 (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + 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 (binary_expression IDENT + LIT) != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression & IDENT))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + (char_literal L' escape_sequence character character character character '))) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) + (char_literal L' escape_sequence character character character character '))) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < (char_literal L' escape_sequence ')) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT ))) ;) })) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + LIT) ))))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (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 == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression & IDENT))) )) (compound_statement { (return_statement return ;) }))) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (binary_expression (parenthesized_expression ( (binary_expression IDENT + IDENT) )) * LIT)) )))) ;) (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 = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * IDENT)) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression & IDENT)) )) (compound_statement { (return_statement return ;) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;)) (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 (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (binary_expression IDENT * LIT)) )))) = LIT) ;) (return_statement return ;) })))
(function_definition "void FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_00355db0(long *param_1,size_t param_2,long param_3,long param_4)" (identifier "FUN_00355db0") (parameter_list "(long *param_1,size_t param_2,long param_3,long param_4)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) (, ",") (parameter_declaration "long param_4" (sized_type_specifier "long" (long "long")) (identifier "param_4")) () ")"))) (compound_statement "{\n  long lVar1;\n  wchar_t *pwVar2;\n  wchar_t wVar3;\n  long lVar4;\n  undefined8 *puVar5;\n  wchar_t *pwVar6;\n  size_t __n;\n  ulong uVar7;\n  ulong uVar8;\n  undefined8 *puVar9;\n  undefined1 local_39 [9];\n  \n  lVar1 = param_3 + param_2;\n  lVar4 = *param_1;\n  uVar8 = *(ulong *)(lVar4 + -0x10);\n  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);\n  __n = *(long *)(lVar4 + -0x18) - lVar1;\n  if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }\n  if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }\nLAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;\n  puVar9[-3] = uVar7;\n  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;\n  return;\n}" ({ "{") (declaration "long lVar1;" (sized_type_specifier "long" (long "long")) (identifier "lVar1") (; ";")) (declaration "wchar_t *pwVar2;" (type_identifier "wchar_t") (pointer_declarator "*pwVar2" (* "*") (identifier "pwVar2")) (; ";")) (declaration "wchar_t wVar3;" (type_identifier "wchar_t") (identifier "wVar3") (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (declaration "undefined8 *puVar5;" (type_identifier "undefined8") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "wchar_t *pwVar6;" (type_identifier "wchar_t") (pointer_declarator "*pwVar6" (* "*") (identifier "pwVar6")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "ulong uVar7;" (type_identifier "ulong") (identifier "uVar7") (; ";")) (declaration "ulong uVar8;" (type_identifier "ulong") (identifier "uVar8") (; ";")) (declaration "undefined8 *puVar9;" (type_identifier "undefined8") (pointer_declarator "*puVar9" (* "*") (identifier "puVar9")) (; ";")) (declaration "undefined1 local_39 [9];" (type_identifier "undefined1") (array_declarator "local_39 [9]" (identifier "local_39") ([ "[") (number_literal "9") (] "]")) (; ";")) (expression_statement "lVar1 = param_3 + param_2;" (assignment_expression "lVar1 = param_3 + param_2" (identifier "lVar1") (= "=") (binary_expression "param_3 + param_2" (identifier "param_3") (+ "+") (identifier "param_2"))) (; ";")) (expression_statement "lVar4 = *param_1;" (assignment_expression "lVar4 = *param_1" (identifier "lVar4") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar8 = *(ulong *)(lVar4 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(lVar4 + -0x10)" (identifier "uVar8") (= "=") (pointer_expression "*(ulong *)(lVar4 + -0x10)" (* "*") (cast_expression "(ulong *)(lVar4 + -0x10)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar4 + -0x10)" (( "(") (binary_expression "lVar4 + -0x10" (identifier "lVar4") (+ "+") (number_literal "-0x10")) () ")"))))) (; ";")) (expression_statement "uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);" (assignment_expression "uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18)" (identifier "uVar7") (= "=") (binary_expression "(param_4 - param_3) + *(long *)(lVar4 + -0x18)" (parenthesized_expression "(param_4 - param_3)" (( "(") (binary_expression "param_4 - param_3" (identifier "param_4") (- "-") (identifier "param_3")) () ")")) (+ "+") (pointer_expression "*(long *)(lVar4 + -0x18)" (* "*") (cast_expression "(long *)(lVar4 + -0x18)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar4 + -0x18)" (( "(") (binary_expression "lVar4 + -0x18" (identifier "lVar4") (+ "+") (number_literal "-0x18")) () ")")))))) (; ";")) (expression_statement "__n = *(long *)(lVar4 + -0x18) - lVar1;" (assignment_expression "__n = *(long *)(lVar4 + -0x18) - lVar1" (identifier "__n") (= "=") (binary_expression "*(long *)(lVar4 + -0x18) - lVar1" (pointer_expression "*(long *)(lVar4 + -0x18)" (* "*") (cast_expression "(long *)(lVar4 + -0x18)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar4 + -0x18)" (( "(") (binary_expression "lVar4 + -0x18" (identifier "lVar4") (+ "+") (number_literal "-0x18")) () ")")))) (- "-") (identifier "lVar1"))) (; ";")) (if_statement "if (uVar8 < uVar7) {\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }\n  else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" (if "if") (parenthesized_expression "(uVar8 < uVar7)" (( "(") (binary_expression "uVar8 < uVar7" (identifier "uVar8") (< "<") (identifier "uVar7")) () ")")) (compound_statement "{\nLAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);\n    if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    puVar9 = puVar5 + 3;\n    if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }\n    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }\n    *param_1 = (long)puVar9;\n  }" ({ "{") (labeled_statement "LAB_00355df9:\n    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);" (statement_identifier "LAB_00355df9") (: ":") (expression_statement "puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);" (assignment_expression "puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39)" (identifier "puVar5") (= "=") (cast_expression "(undefined8 *)FUN_00355a20(uVar7,uVar8,local_39)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00355a20(uVar7,uVar8,local_39)" (identifier "FUN_00355a20") (argument_list "(uVar7,uVar8,local_39)" (( "(") (identifier "uVar7") (, ",") (identifier "uVar8") (, ",") (identifier "local_39") () ")"))))) (; ";"))) (if_statement "if (param_2 == 0) {\n      pwVar6 = (wchar_t *)*param_1;\n    }\n    else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      pwVar6 = (wchar_t *)*param_1;\n    }" ({ "{") (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (wchar_t *)*param_1" (identifier "pwVar6") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")) (else_clause "else {\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" (else "else") (compound_statement "{\n      pwVar6 = (wchar_t *)*param_1;\n      if (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" ({ "{") (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (wchar_t *)*param_1" (identifier "pwVar6") (= "=") (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 (param_2 == 1) {\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }\n      else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" (if "if") (parenthesized_expression "(param_2 == 1)" (( "(") (binary_expression "param_2 == 1" (identifier "param_2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *(wchar_t *)(puVar5 + 3) = *pwVar6;\n      }" ({ "{") (expression_statement "*(wchar_t *)(puVar5 + 3) = *pwVar6;" (assignment_expression "*(wchar_t *)(puVar5 + 3) = *pwVar6" (pointer_expression "*(wchar_t *)(puVar5 + 3)" (* "*") (cast_expression "(wchar_t *)(puVar5 + 3)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar5 + 3)" (( "(") (binary_expression "puVar5 + 3" (identifier "puVar5") (+ "+") (number_literal "3")) () ")")))) (= "=") (pointer_expression "*pwVar6" (* "*") (identifier "pwVar6"))) (; ";")) (} "}")) (else_clause "else {\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" (else "else") (compound_statement "{\n        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);\n        pwVar6 = (wchar_t *)*param_1;\n      }" ({ "{") (expression_statement "wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);" (call_expression "wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2)" (identifier "wmemcpy") (argument_list "((wchar_t *)(puVar5 + 3),pwVar6,param_2)" (( "(") (cast_expression "(wchar_t *)(puVar5 + 3)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar5 + 3)" (( "(") (binary_expression "puVar5 + 3" (identifier "puVar5") (+ "+") (number_literal "3")) () ")"))) (, ",") (identifier "pwVar6") (, ",") (identifier "param_2") () ")"))) (; ";")) (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (wchar_t *)*param_1" (identifier "pwVar6") (= "=") (cast_expression "(wchar_t *)*param_1" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (} "}")))) (} "}")))) (expression_statement "puVar9 = puVar5 + 3;" (assignment_expression "puVar9 = puVar5 + 3" (identifier "puVar9") (= "=") (binary_expression "puVar5 + 3" (identifier "puVar5") (+ "+") (number_literal "3"))) (; ";")) (if_statement "if (__n != 0) {\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);\n      if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }\n    }" ({ "{") (expression_statement "pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" (identifier "pwVar2") (= "=") (cast_expression "(wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar5 + (param_2 + param_4) * 4 + 0x18)" (( "(") (binary_expression "(long)puVar5 + (param_2 + param_4) * 4 + 0x18" (binary_expression "(long)puVar5 + (param_2 + param_4) * 4" (cast_expression "(long)puVar5" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar5")) (+ "+") (binary_expression "(param_2 + param_4) * 4" (parenthesized_expression "(param_2 + param_4)" (( "(") (binary_expression "param_2 + param_4" (identifier "param_2") (+ "+") (identifier "param_4")) () ")")) (* "*") (number_literal "4"))) (+ "+") (number_literal "0x18")) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n        *pwVar2 = pwVar6[lVar1];\n      }\n      else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *pwVar2 = pwVar6[lVar1];\n      }" ({ "{") (expression_statement "*pwVar2 = pwVar6[lVar1];" (assignment_expression "*pwVar2 = pwVar6[lVar1]" (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2")) (= "=") (subscript_expression "pwVar6[lVar1]" (identifier "pwVar6") ([ "[") (identifier "lVar1") (] "]"))) (; ";")) (} "}")) (else_clause "else {\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" (else "else") (compound_statement "{\n        wmemcpy(pwVar2,pwVar6 + lVar1,__n);\n        pwVar6 = (wchar_t *)*param_1;\n      }" ({ "{") (expression_statement "wmemcpy(pwVar2,pwVar6 + lVar1,__n);" (call_expression "wmemcpy(pwVar2,pwVar6 + lVar1,__n)" (identifier "wmemcpy") (argument_list "(pwVar2,pwVar6 + lVar1,__n)" (( "(") (identifier "pwVar2") (, ",") (binary_expression "pwVar6 + lVar1" (identifier "pwVar6") (+ "+") (identifier "lVar1")) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "pwVar6 = (wchar_t *)*param_1;" (assignment_expression "pwVar6 = (wchar_t *)*param_1" (identifier "pwVar6") (= "=") (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 (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }" (if "if") (parenthesized_expression "(pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0)" (( "(") (binary_expression "pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0" (binary_expression "pwVar6 + -6" (identifier "pwVar6") (+ "+") (number_literal "-6")) (!= "!=") (cast_expression "(wchar_t *)&DAT_0044bdc0" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&DAT_0044bdc0" (& "&") (identifier "DAT_0044bdc0")))) () ")")) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }\n      if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }\n    }" ({ "{") (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }\n      else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" (if "if") (parenthesized_expression "(PTR___pthread_key_create_0043dee8 == (undefined *)0x0)" (( "(") (binary_expression "PTR___pthread_key_create_0043dee8 == (undefined *)0x0" (identifier "PTR___pthread_key_create_0043dee8") (== "==") (cast_expression "(undefined *)0x0" (( "(") (type_descriptor "undefined *" (type_identifier "undefined") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n        wVar3 = pwVar6[-2];\n        pwVar6[-2] = wVar3 + L'\xffffffff';\n      }" ({ "{") (expression_statement "wVar3 = pwVar6[-2];" (assignment_expression "wVar3 = pwVar6[-2]" (identifier "wVar3") (= "=") (subscript_expression "pwVar6[-2]" (identifier "pwVar6") ([ "[") (number_literal "-2") (] "]"))) (; ";")) (expression_statement "pwVar6[-2] = wVar3 + L'\xffffffff';" (assignment_expression "pwVar6[-2] = wVar3 + L'\xffffffff'" (subscript_expression "pwVar6[-2]" (identifier "pwVar6") ([ "[") (number_literal "-2") (] "]")) (= "=") (binary_expression "wVar3 + L'\xffffffff'" (identifier "wVar3") (+ "+") (char_literal "L'\xffffffff'" (L' "L'") (escape_sequence "\xffff") (character "f") (character "f") (character "f") (character "f") (' "'")))) (; ";")) (} "}")) (else_clause "else {\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" (else "else") (compound_statement "{\n        LOCK();\n        pwVar2 = pwVar6 + -2;\n        wVar3 = *pwVar2;\n        *pwVar2 = *pwVar2 + L'\xffffffff';\n        UNLOCK();\n      }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "pwVar2 = pwVar6 + -2;" (assignment_expression "pwVar2 = pwVar6 + -2" (identifier "pwVar2") (= "=") (binary_expression "pwVar6 + -2" (identifier "pwVar6") (+ "+") (number_literal "-2"))) (; ";")) (expression_statement "wVar3 = *pwVar2;" (assignment_expression "wVar3 = *pwVar2" (identifier "wVar3") (= "=") (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2"))) (; ";")) (expression_statement "*pwVar2 = *pwVar2 + L'\xffffffff';" (assignment_expression "*pwVar2 = *pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2")) (= "=") (binary_expression "*pwVar2 + L'\xffffffff'" (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2")) (+ "+") (char_literal "L'\xffffffff'" (L' "L'") (escape_sequence "\xffff") (character "f") (character "f") (character "f") (character "f") (' "'")))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (if_statement "if (wVar3 < L'\x01') {\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }" (if "if") (parenthesized_expression "(wVar3 < L'\x01')" (( "(") (binary_expression "wVar3 < L'\x01'" (identifier "wVar3") (< "<") (char_literal "L'\x01'" (L' "L'") (escape_sequence "\x01") (' "'"))) () ")")) (compound_statement "{\n        thunk_FUN_002dac70(pwVar6 + -6,local_39);\n      }" ({ "{") (expression_statement "thunk_FUN_002dac70(pwVar6 + -6,local_39);" (call_expression "thunk_FUN_002dac70(pwVar6 + -6,local_39)" (identifier "thunk_FUN_002dac70") (argument_list "(pwVar6 + -6,local_39)" (( "(") (binary_expression "pwVar6 + -6" (identifier "pwVar6") (+ "+") (number_literal "-6")) (, ",") (identifier "local_39") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "*param_1 = (long)puVar9;" (assignment_expression "*param_1 = (long)puVar9" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(long)puVar9" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar9"))) (; ";")) (} "}")) (else_clause "else {\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" (else "else") (compound_statement "{\n    if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }\n    puVar9 = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }\n    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);\n    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);\n    if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }\n    puVar5 = puVar9 + -3;\n    *pwVar2 = *pwVar6;\n  }" ({ "{") (if_statement "if (0 < *(int *)(lVar4 + -8)) {\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }" (if "if") (parenthesized_expression "(0 < *(int *)(lVar4 + -8))" (( "(") (binary_expression "0 < *(int *)(lVar4 + -8)" (number_literal "0") (< "<") (pointer_expression "*(int *)(lVar4 + -8)" (* "*") (cast_expression "(int *)(lVar4 + -8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar4 + -8)" (( "(") (binary_expression "lVar4 + -8" (identifier "lVar4") (+ "+") (number_literal "-8")) () ")"))))) () ")")) (compound_statement "{\n      uVar8 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_00355df9;\n    }" ({ "{") (expression_statement "uVar8 = *(ulong *)(*param_1 + -0x10);" (assignment_expression "uVar8 = *(ulong *)(*param_1 + -0x10)" (identifier "uVar8") (= "=") (pointer_expression "*(ulong *)(*param_1 + -0x10)" (* "*") (cast_expression "(ulong *)(*param_1 + -0x10)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + -0x10)" (( "(") (binary_expression "*param_1 + -0x10" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (number_literal "-0x10")) () ")"))))) (; ";")) (goto_statement "goto LAB_00355df9;" (goto "goto") (statement_identifier "LAB_00355df9") (; ";")) (} "}"))) (expression_statement "puVar9 = (undefined8 *)*param_1;" (assignment_expression "puVar9 = (undefined8 *)*param_1" (identifier "puVar9") (= "=") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (if_statement "if ((__n == 0) || (param_4 == param_3)) {\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" (if "if") (parenthesized_expression "((__n == 0) || (param_4 == param_3))" (( "(") (binary_expression "(__n == 0) || (param_4 == param_3)" (parenthesized_expression "(__n == 0)" (( "(") (binary_expression "__n == 0" (identifier "__n") (== "==") (number_literal "0")) () ")")) (|| "||") (parenthesized_expression "(param_4 == param_3)" (( "(") (binary_expression "param_4 == param_3" (identifier "param_4") (== "==") (identifier "param_3")) () ")"))) () ")")) (compound_statement "{\nLAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }\n      goto LAB_00355f18;\n    }" ({ "{") (labeled_statement "LAB_00355efe:\n      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" (statement_identifier "LAB_00355efe") (: ":") (if_statement "if (puVar9 == (undefined8 *)&DAT_0044bdd8) {\n        return;\n      }" (if "if") (parenthesized_expression "(puVar9 == (undefined8 *)&DAT_0044bdd8)" (( "(") (binary_expression "puVar9 == (undefined8 *)&DAT_0044bdd8" (identifier "puVar9") (== "==") (cast_expression "(undefined8 *)&DAT_0044bdd8" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&DAT_0044bdd8" (& "&") (identifier "DAT_0044bdd8")))) () ")")) (compound_statement "{\n        return;\n      }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}")))) (goto_statement "goto LAB_00355f18;" (goto "goto") (statement_identifier "LAB_00355f18") (; ";")) (} "}"))) (expression_statement "pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);" (assignment_expression "pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4)" (identifier "pwVar6") (= "=") (cast_expression "(wchar_t *)((long)puVar9 + lVar1 * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar9 + lVar1 * 4)" (( "(") (binary_expression "(long)puVar9 + lVar1 * 4" (cast_expression "(long)puVar9" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar9")) (+ "+") (binary_expression "lVar1 * 4" (identifier "lVar1") (* "*") (number_literal "4"))) () ")")))) (; ";")) (expression_statement "pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);" (assignment_expression "pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4)" (identifier "pwVar2") (= "=") (cast_expression "(wchar_t *)((long)puVar9 + (param_2 + param_4) * 4)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar9 + (param_2 + param_4) * 4)" (( "(") (binary_expression "(long)puVar9 + (param_2 + param_4) * 4" (cast_expression "(long)puVar9" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar9")) (+ "+") (binary_expression "(param_2 + param_4) * 4" (parenthesized_expression "(param_2 + param_4)" (( "(") (binary_expression "param_2 + param_4" (identifier "param_2") (+ "+") (identifier "param_4")) () ")")) (* "*") (number_literal "4"))) () ")")))) (; ";")) (if_statement "if (__n != 1) {\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }" (if "if") (parenthesized_expression "(__n != 1)" (( "(") (binary_expression "__n != 1" (identifier "__n") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n      wmemmove(pwVar2,pwVar6,__n);\n      puVar9 = (undefined8 *)*param_1;\n      goto LAB_00355efe;\n    }" ({ "{") (expression_statement "wmemmove(pwVar2,pwVar6,__n);" (call_expression "wmemmove(pwVar2,pwVar6,__n)" (identifier "wmemmove") (argument_list "(pwVar2,pwVar6,__n)" (( "(") (identifier "pwVar2") (, ",") (identifier "pwVar6") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "puVar9 = (undefined8 *)*param_1;" (assignment_expression "puVar9 = (undefined8 *)*param_1" (identifier "puVar9") (= "=") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (goto_statement "goto LAB_00355efe;" (goto "goto") (statement_identifier "LAB_00355efe") (; ";")) (} "}"))) (expression_statement "puVar5 = puVar9 + -3;" (assignment_expression "puVar5 = puVar9 + -3" (identifier "puVar5") (= "=") (binary_expression "puVar9 + -3" (identifier "puVar9") (+ "+") (number_literal "-3"))) (; ";")) (expression_statement "*pwVar2 = *pwVar6;" (assignment_expression "*pwVar2 = *pwVar6" (pointer_expression "*pwVar2" (* "*") (identifier "pwVar2")) (= "=") (pointer_expression "*pwVar6" (* "*") (identifier "pwVar6"))) (; ";")) (} "}")))) (if_statement "if (puVar5 == &DAT_0044bdc0) {\n    return;\n  }" (if "if") (parenthesized_expression "(puVar5 == &DAT_0044bdc0)" (( "(") (binary_expression "puVar5 == &DAT_0044bdc0" (identifier "puVar5") (== "==") (pointer_expression "&DAT_0044bdc0" (& "&") (identifier "DAT_0044bdc0"))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (labeled_statement "LAB_00355f18:\n  *(undefined4 *)(puVar9 + -1) = 0;" (statement_identifier "LAB_00355f18") (: ":") (expression_statement "*(undefined4 *)(puVar9 + -1) = 0;" (assignment_expression "*(undefined4 *)(puVar9 + -1) = 0" (pointer_expression "*(undefined4 *)(puVar9 + -1)" (* "*") (cast_expression "(undefined4 *)(puVar9 + -1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar9 + -1)" (( "(") (binary_expression "puVar9 + -1" (identifier "puVar9") (+ "+") (number_literal "-1")) () ")")))) (= "=") (number_literal "0")) (; ";"))) (expression_statement "puVar9[-3] = uVar7;" (assignment_expression "puVar9[-3] = uVar7" (subscript_expression "puVar9[-3]" (identifier "puVar9") ([ "[") (number_literal "-3") (] "]")) (= "=") (identifier "uVar7")) (; ";")) (expression_statement "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;" (assignment_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4) = 0" (pointer_expression "*(undefined4 *)((long)puVar9 + uVar7 * 4)" (* "*") (cast_expression "(undefined4 *)((long)puVar9 + uVar7 * 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)puVar9 + uVar7 * 4)" (( "(") (binary_expression "(long)puVar9 + uVar7 * 4" (cast_expression "(long)puVar9" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar9")) (+ "+") (binary_expression "uVar7 * 4" (identifier "uVar7") (* "*") (number_literal "4"))) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::wstring::_M_mutate(unsigned long, unsigned long, unsigned long) */

void __thiscall std::type_1::function_1(type_1 *this,type_2 var_2,type_2 var_1,type_2 var_4)

{
  long var_5;
  type_3 *pwVar2;
  long var_3;
  type_4 *var_9;
  type_3 *var_12;
  type_3 var_14;
  size_t var_11;
  type_2 var_7;
  type_2 var_6;
  type_4 *var_18;
  type_5 local_39 [9];
  
  var_5 = var_1 + var_2;
  var_3 = *(long *)this;
  var_6 = *(type_2 *)(var_3 + -0x10);
  var_7 = (var_4 - var_1) + *(long *)(var_3 + -0x18);
  var_11 = *(long *)(var_3 + -0x18) - var_5;
  if (var_6 < var_7) {
LAB_00355df9:
    var_9 = (type_4 *)_Rep::var_8(var_7,var_6,local_39);
    if (var_2 == 0) {
      var_12 = *(type_3 **)this;
    }
    else {
      var_12 = *(type_3 **)this;
      if (var_2 == 1) {
        *(type_3 *)(var_9 + 3) = *var_12;
      }
      else {
        var_10((type_3 *)(var_9 + 3),var_12,var_2);
        var_12 = *(type_3 **)this;
      }
    }
    var_18 = var_9 + 3;
    if (var_11 != 0) {
      pwVar2 = (type_3 *)((long)var_9 + (var_2 + var_4) * 4 + 0x18);
      if (var_11 == 1) {
        *pwVar2 = var_12[var_5];
      }
      else {
        var_10(pwVar2,var_12 + var_5,var_11);
        var_12 = *(type_3 **)this;
      }
    }
    if ((type_5 *)(var_12 + -6) != (type_5 *)&_Rep::_S_empty_rep_storage) {
      if (var_13 == (type_6 *)0x0) {
        var_14 = var_12[-2];
        var_12[-2] = var_14 + L'\xffffffff';
      }
      else {
        var_15();
        pwVar2 = var_12 + -2;
        var_14 = *pwVar2;
        *pwVar2 = *pwVar2 + L'\xffffffff';
        var_16();
      }
      if (var_14 < L'\x01') {
        _Rep::var_17((type_5 *)(var_12 + -6));
      }
    }
    *(type_4 **)this = var_18;
  }
  else {
    if (0 < *(int *)(var_3 + -8)) {
      var_6 = *(type_2 *)(*(long *)this + -0x10);
      goto LAB_00355df9;
    }
    var_18 = *(type_4 **)this;
    if ((var_11 == 0) || (var_4 == var_1)) {
LAB_00355efe:
      if (var_18 == (type_4 *)&DAT_0044bdd8) {
        return;
      }
      goto LAB_00355f18;
    }
    var_12 = (type_3 *)((long)var_18 + var_5 * 4);
    pwVar2 = (type_3 *)((long)var_18 + (var_2 + var_4) * 4);
    if (var_11 != 1) {
      var_19(pwVar2,var_12,var_11);
      var_18 = *(type_4 **)this;
      goto LAB_00355efe;
    }
    var_9 = var_18 + -3;
    *pwVar2 = *var_12;
  }
  if (var_9 == &_Rep::_S_empty_rep_storage) {
    return;
  }
LAB_00355f18:
  *(type_7 *)(var_18 + -1) = 0;
  var_18[-3] = var_7;
  *(type_7 *)((long)var_18 + var_7 * 4) = 0;
  return;
}


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

void MASKED(long *param_1,size_t param_2,long param_3,long param_4)

{
  long lVar1;
  wchar_t *pwVar2;
  wchar_t wVar3;
  long lVar4;
  undefined8 *puVar5;
  wchar_t *pwVar6;
  size_t __n;
  ulong uVar7;
  ulong uVar8;
  undefined8 *puVar9;
  undefined1 local_39 [9];
  
  lVar1 = param_3 + param_2;
  lVar4 = *param_1;
  uVar8 = *(ulong *)(lVar4 + -0x10);
  uVar7 = (param_4 - param_3) + *(long *)(lVar4 + -0x18);
  __n = *(long *)(lVar4 + -0x18) - lVar1;
  if (uVar8 < uVar7) {
LAB_00355df9:
    puVar5 = (undefined8 *)FUN_00355a20(uVar7,uVar8,local_39);
    if (param_2 == 0) {
      pwVar6 = (wchar_t *)*param_1;
    }
    else {
      pwVar6 = (wchar_t *)*param_1;
      if (param_2 == 1) {
        *(wchar_t *)(puVar5 + 3) = *pwVar6;
      }
      else {
        wmemcpy((wchar_t *)(puVar5 + 3),pwVar6,param_2);
        pwVar6 = (wchar_t *)*param_1;
      }
    }
    puVar9 = puVar5 + 3;
    if (__n != 0) {
      pwVar2 = (wchar_t *)((long)puVar5 + (param_2 + param_4) * 4 + 0x18);
      if (__n == 1) {
        *pwVar2 = pwVar6[lVar1];
      }
      else {
        wmemcpy(pwVar2,pwVar6 + lVar1,__n);
        pwVar6 = (wchar_t *)*param_1;
      }
    }
    if (pwVar6 + -6 != (wchar_t *)&DAT_0044bdc0) {
      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {
        wVar3 = pwVar6[-2];
        pwVar6[-2] = wVar3 + L'\xffffffff';
      }
      else {
        LOCK();
        pwVar2 = pwVar6 + -2;
        wVar3 = *pwVar2;
        *pwVar2 = *pwVar2 + L'\xffffffff';
        UNLOCK();
      }
      if (wVar3 < L'\x01') {
        thunk_FUN_002dac70(pwVar6 + -6,local_39);
      }
    }
    *param_1 = (long)puVar9;
  }
  else {
    if (0 < *(int *)(lVar4 + -8)) {
      uVar8 = *(ulong *)(*param_1 + -0x10);
      goto LAB_00355df9;
    }
    puVar9 = (undefined8 *)*param_1;
    if ((__n == 0) || (param_4 == param_3)) {
LAB_00355efe:
      if (puVar9 == (undefined8 *)&DAT_0044bdd8) {
        return;
      }
      goto LAB_00355f18;
    }
    pwVar6 = (wchar_t *)((long)puVar9 + lVar1 * 4);
    pwVar2 = (wchar_t *)((long)puVar9 + (param_2 + param_4) * 4);
    if (__n != 1) {
      wmemmove(pwVar2,pwVar6,__n);
      puVar9 = (undefined8 *)*param_1;
      goto LAB_00355efe;
    }
    puVar5 = puVar9 + -3;
    *pwVar2 = *pwVar6;
  }
  if (puVar5 == &DAT_0044bdc0) {
    return;
  }
LAB_00355f18:
  *(undefined4 *)(puVar9 + -1) = 0;
  puVar9[-3] = uVar7;
  *(undefined4 *)((long)puVar9 + uVar7 * 4) = 0;
  return;
}

