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

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

{
  int *piVar1;
  long lVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *__dest;
  size_t __n;
  ulong uVar5;
  ulong uVar6;
  long lVar7;
  undefined1 *puVar8;
  allocator local_39 [9];
  
  lVar2 = param_2 + param_1;
  lVar7 = *(long *)this;
  uVar6 = *(ulong *)(lVar7 + -0x10);
  uVar5 = (param_3 - param_2) + *(long *)(lVar7 + -0x18);
  __n = *(long *)(lVar7 + -0x18) - lVar2;
  if (uVar6 < uVar5) {
LAB_0030dc19:
    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,local_39);
    __dest = puVar4 + 3;
    if (param_1 == 0) {
LAB_0030dc6a:
      lVar7 = *(long *)this;
    }
    else {
      __dest = puVar4 + 3;
      if (param_1 != 1) {
        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);
        goto LAB_0030dc6a;
      }
      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;
      lVar7 = *(long *)this;
    }
    if (__n != 0) {
      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);
      if (__n == 1) {
        *puVar8 = *(undefined1 *)(lVar7 + lVar2);
        lVar7 = *(long *)this;
      }
      else {
        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);
        lVar7 = *(long *)this;
      }
    }
    if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {
      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {
        iVar3 = *(int *)(lVar7 + -8);
        *(int *)(lVar7 + -8) = iVar3 + -1;
      }
      else {
        LOCK();
        piVar1 = (int *)(lVar7 + -8);
        iVar3 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
      }
      if (iVar3 < 1) {
        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));
      }
    }
    *(undefined8 **)this = __dest;
  }
  else {
    if (0 < *(int *)(lVar7 + -8)) {
      uVar6 = *(ulong *)(*(long *)this + -0x10);
      goto LAB_0030dc19;
    }
    __dest = *(undefined8 **)this;
    if ((__n == 0) || (param_3 == param_2)) {
LAB_0030dd07:
      if (__dest == (undefined8 *)&DAT_0044a558) {
        return;
      }
      goto LAB_0030dd20;
    }
    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);
    if (__n != 1) {
      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);
      __dest = *(undefined8 **)this;
      goto LAB_0030dd07;
    }
    *puVar8 = *(undefined1 *)((long)__dest + lVar2);
    __dest = *(undefined8 **)this;
    puVar4 = __dest + -3;
  }
  if (puVar4 == &_Rep::_S_empty_rep_storage) {
    return;
  }
LAB_0030dd20:
  *(undefined4 *)(__dest + -1) = 0;
  __dest[-3] = uVar5;
  *(undefined1 *)((long)__dest + uVar5) = 0;
  return;
}



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

{
  int *piVar1;
  long lVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *__dest;
  size_t __n;
  ulong uVar5;
  ulong uVar6;
  long lVar7;
  undefined1 *puVar8;
  undefined1 local_39 [9];
  
  lVar2 = param_3 + param_2;
  lVar7 = *param_1;
  uVar6 = *(ulong *)(lVar7 + -0x10);
  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);
  __n = *(long *)(lVar7 + -0x18) - lVar2;
  if (uVar6 < uVar5) {
LAB_0030dc19:
    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);
    __dest = puVar4 + 3;
    if (param_2 == 0) {
LAB_0030dc6a:
      lVar7 = *param_1;
    }
    else {
      __dest = puVar4 + 3;
      if (param_2 != 1) {
        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);
        goto LAB_0030dc6a;
      }
      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;
      lVar7 = *param_1;
    }
    if (__n != 0) {
      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);
      if (__n == 1) {
        *puVar8 = *(undefined1 *)(lVar7 + lVar2);
        lVar7 = *param_1;
      }
      else {
        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);
        lVar7 = *param_1;
      }
    }
    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {
      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {
        iVar3 = *(int *)(lVar7 + -8);
        *(int *)(lVar7 + -8) = iVar3 + -1;
      }
      else {
        LOCK();
        piVar1 = (int *)(lVar7 + -8);
        iVar3 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
      }
      if (iVar3 < 1) {
        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);
      }
    }
    *param_1 = (long)__dest;
  }
  else {
    if (0 < *(int *)(lVar7 + -8)) {
      uVar6 = *(ulong *)(*param_1 + -0x10);
      goto LAB_0030dc19;
    }
    __dest = (undefined8 *)*param_1;
    if ((__n == 0) || (param_4 == param_3)) {
LAB_0030dd07:
      if (__dest == (undefined8 *)&DAT_0044a558) {
        return;
      }
      goto LAB_0030dd20;
    }
    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);
    if (__n != 1) {
      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);
      __dest = (undefined8 *)*param_1;
      goto LAB_0030dd07;
    }
    *puVar8 = *(undefined1 *)((long)__dest + lVar2);
    __dest = (undefined8 *)*param_1;
    puVar4 = __dest + -3;
  }
  if (puVar4 == &DAT_0044a540) {
    return;
  }
LAB_0030dd20:
  *(undefined4 *)(__dest + -1) = 0;
  __dest[-3] = uVar5;
  *(undefined1 *)((long)__dest + uVar5) = 0;
  return;
}


PUSH R15
LEA R9,[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,0x28
MOV RAX,qword ptr [RDI]
MOV RBX,qword ptr [RAX + -0x18]
MOV RSI,qword ptr [RAX + -0x10]
ADD RBP,RBX
SUB RBX,R9
CMP RBP,RSI
JA 0x0030dc19
MOV EAX,dword ptr [RAX + -0x8]
TEST EAX,EAX
JLE 0x0030dcd8
MOV RAX,qword ptr [RDI]
MOV RSI,qword ptr [RAX + -0x10]
LEA RAX,[RSP + 0x1f]
MOV RDI,RBP
MOV qword ptr [RSP],R9
MOV RDX,RAX
MOV qword ptr [RSP + 0x8],RAX
CALL 0x0030d860
TEST R13,R13
MOV R9,qword ptr [RSP]
MOV R15,RAX
LEA R8,[RAX + 0x18]
JZ 0x0030dc6a
MOV RSI,qword ptr [R12]
LEA R8,[RAX + 0x18]
CMP R13,0x1
JZ 0x0030dd40
MOV RDI,R8
MOV RDX,R13
MOV qword ptr [RSP],R9
CALL 0x00147aa0
MOV R9,qword ptr [RSP]
MOV R8,RAX
MOV RSI,qword ptr [R12]
TEST RBX,RBX
JNZ 0x0030dca8
LEA RBX,[0x44a540]
LEA RDI,[RSI + -0x18]
CMP RDI,RBX
JNZ 0x0030dd70
MOV qword ptr [R12],R8
CMP R15,RBX
JNZ 0x0030dd20
ADD RSP,0x28
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
LEA RDI,[R13 + R14*0x1 + 0x18]
ADD RSI,R9
ADD RDI,R15
CMP RBX,0x1
JZ 0x0030dd60
MOV RDX,RBX
MOV qword ptr [RSP],R8
CALL 0x00147aa0
MOV RSI,qword ptr [R12]
MOV R8,qword ptr [RSP]
JMP 0x0030dc73
MOV R8,qword ptr [RDI]
TEST RBX,RBX
JZ 0x0030dd07
CMP RCX,RDX
JZ 0x0030dd07
LEA RCX,[RCX + R13*0x1]
LEA RSI,[R8 + R9*0x1]
LEA RDI,[R8 + RCX*0x1]
CMP RBX,0x1
JZ 0x0030ddb8
MOV RDX,RBX
CALL 0x001476d0
MOV R8,qword ptr [R12]
LEA RBX,[0x44a540]
LEA R15,[R8 + -0x18]
CMP R15,RBX
JZ 0x0030dc94
NOP dword ptr [RAX + RAX*0x1]
MOV dword ptr [R8 + -0x8],0x0
MOV qword ptr [R8 + -0x18],RBP
MOV byte ptr [R8 + RBP*0x1],0x0
JMP 0x0030dc94
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [R15 + 0x18],AL
MOV RSI,qword ptr [R12]
TEST RBX,RBX
JZ 0x0030dc73
JMP 0x0030dca8
MOVZX EAX,byte ptr [RSI]
MOV byte ptr [RDI],AL
MOV RSI,qword ptr [R12]
JMP 0x0030dc73
CMP qword ptr [0x0043dee8],0x0
JZ 0x0030dda8
MOV EAX,0xffffffff
XADD.LOCK dword ptr [RSI + -0x8],EAX
TEST EAX,EAX
JG 0x0030dc87
MOV RSI,qword ptr [RSP + 0x8]
MOV qword ptr [RSP],R8
CALL 0x0030da40
MOV R8,qword ptr [RSP]
JMP 0x0030dc87
MOV EAX,dword ptr [RSI + -0x8]
LEA EDX,[RAX + -0x1]
MOV dword ptr [RSI + -0x8],EDX
JMP 0x0030dd84
MOVZX EAX,byte ptr [RSI]
LEA RBX,[0x44a540]
MOV byte ptr [RDI],AL
MOV R8,qword ptr [R12]
LEA R15,[R8 + -0x18]
JMP 0x0030dc8b
(translation_unit "void FUN_0030dbd0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}\n\n" (function_definition "void FUN_0030dbd0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" primitive_type (function_declarator "FUN_0030dbd0(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  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined8 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "long lVar7;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "undefined1 local_39 [9];" type_identifier (array_declarator "local_39 [9]" identifier [ number_literal ]) ;) (expression_statement "lVar2 = param_3 + param_2;" (assignment_expression "lVar2 = param_3 + param_2" identifier = (binary_expression "param_3 + param_2" identifier + identifier)) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar6 = *(ulong *)(lVar7 + -0x10);" (assignment_expression "uVar6 = *(ulong *)(lVar7 + -0x10)" identifier = (pointer_expression "*(ulong *)(lVar7 + -0x10)" * (cast_expression "(ulong *)(lVar7 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x10)" ( (binary_expression "lVar7 + -0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);" (assignment_expression "uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18)" identifier = (binary_expression "(param_4 - param_3) + *(long *)(lVar7 + -0x18)" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + (pointer_expression "*(long *)(lVar7 + -0x18)" * (cast_expression "(long *)(lVar7 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) )))))) ;) (expression_statement "__n = *(long *)(lVar7 + -0x18) - lVar2;" (assignment_expression "__n = *(long *)(lVar7 + -0x18) - lVar2" identifier = (binary_expression "*(long *)(lVar7 + -0x18) - lVar2" (pointer_expression "*(long *)(lVar7 + -0x18)" * (cast_expression "(long *)(lVar7 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" if (parenthesized_expression "(uVar6 < uVar5)" ( (binary_expression "uVar6 < uVar5" identifier < identifier) )) (compound_statement "{\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }" { (labeled_statement "LAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);" statement_identifier : (expression_statement "puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);" (assignment_expression "puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39)" identifier = (cast_expression "(undefined8 *)FUN_0030d860(uVar5,uVar6,local_39)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0030d860(uVar5,uVar6,local_39)" identifier (argument_list "(uVar5,uVar6,local_39)" ( identifier , identifier , identifier ))))) ;)) (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }" { (labeled_statement "LAB_0030dc6a:\n      lVar7 = *param_1;" statement_identifier : (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;)) }) (else_clause "else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" else (compound_statement "{\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" { (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }" { (expression_statement "__dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);" (assignment_expression "__dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2)" identifier = (cast_expression "(undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,(undefined1 *)*param_1,param_2)" identifier (argument_list "(__dest,(undefined1 *)*param_1,param_2)" ( identifier , (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , identifier ))))) ;) (goto_statement "goto LAB_0030dc6a;" goto statement_identifier ;) })) (expression_statement "*(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;" (assignment_expression "*(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1" (pointer_expression "*(undefined1 *)(puVar4 + 3)" * (cast_expression "(undefined1 *)(puVar4 + 3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 3)" ( (binary_expression "puVar4 + 3" identifier + number_literal) )))) = (pointer_expression "*(undefined1 *)*param_1" * (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)))) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) (if_statement "if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }" { (expression_statement "puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);" (assignment_expression "puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4)" identifier = (cast_expression "(undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 0x18 + param_4 + (long)puVar4)" ( (binary_expression "param_2 + 0x18 + param_4 + (long)puVar4" (binary_expression "param_2 + 0x18 + param_4" (binary_expression "param_2 + 0x18" identifier + number_literal) + identifier) + (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (if_statement "if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }" { (expression_statement "*puVar8 = *(undefined1 *)(lVar7 + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)(lVar7 + lVar2)" (pointer_expression "*puVar8" * identifier) = (pointer_expression "*(undefined1 *)(lVar7 + lVar2)" * (cast_expression "(undefined1 *)(lVar7 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + lVar2)" ( (binary_expression "lVar7 + lVar2" identifier + identifier) ))))) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }) (else_clause "else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" else (compound_statement "{\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" { (expression_statement "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);" (call_expression "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" identifier (argument_list "(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" ( identifier , (cast_expression "(undefined1 *)(lVar7 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + lVar2)" ( (binary_expression "lVar7 + lVar2" identifier + identifier) ))) , identifier ))) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) })) (if_statement "if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }" if (parenthesized_expression "((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540)" ( (binary_expression "(undefined8 *)(lVar7 + -0x18) != &DAT_0044a540" (cast_expression "(undefined8 *)(lVar7 + -0x18)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) ))) != (pointer_expression "&DAT_0044a540" & identifier)) )) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\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        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }" { (expression_statement "iVar3 = *(int *)(lVar7 + -8);" (assignment_expression "iVar3 = *(int *)(lVar7 + -8)" identifier = (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(lVar7 + -8) = iVar3 + -1;" (assignment_expression "*(int *)(lVar7 + -8) = iVar3 + -1" (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) )))) = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar1 = (int *)(lVar7 + -8);" (assignment_expression "piVar1 = (int *)(lVar7 + -8)" identifier = (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) )))) ;) (expression_statement "iVar3 = *piVar1;" (assignment_expression "iVar3 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" * identifier) = (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }" if (parenthesized_expression "(iVar3 < 1)" ( (binary_expression "iVar3 < 1" identifier < number_literal) )) (compound_statement "{\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }" { (expression_statement "thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);" (call_expression "thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39)" identifier (argument_list "((undefined8 *)(lVar7 + -0x18),local_39)" ( (cast_expression "(undefined8 *)(lVar7 + -0x18)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) ))) , identifier ))) ;) })) })) (expression_statement "*param_1 = (long)__dest;" (assignment_expression "*param_1 = (long)__dest" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) (else_clause "else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" else (compound_statement "{\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" { (if_statement "if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }" if (parenthesized_expression "(0 < *(int *)(lVar7 + -8))" ( (binary_expression "0 < *(int *)(lVar7 + -8)" number_literal < (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) ))))) )) (compound_statement "{\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }" { (expression_statement "uVar6 = *(ulong *)(*param_1 + -0x10);" (assignment_expression "uVar6 = *(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_0030dc19;" goto statement_identifier ;) })) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }" { (labeled_statement "LAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" statement_identifier : (if_statement "if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" if (parenthesized_expression "(__dest == (undefined8 *)&DAT_0044a558)" ( (binary_expression "__dest == (undefined8 *)&DAT_0044a558" identifier == (cast_expression "(undefined8 *)&DAT_0044a558" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044a558" & identifier))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) }))) (goto_statement "goto LAB_0030dd20;" goto statement_identifier ;) })) (expression_statement "puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);" (assignment_expression "puVar8 = (undefined1 *)((long)__dest + param_4 + param_2)" identifier = (cast_expression "(undefined1 *)((long)__dest + param_4 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + param_4 + param_2)" ( (binary_expression "(long)__dest + param_4 + param_2" (binary_expression "(long)__dest + param_4" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) + identifier) )))) ;) (if_statement "if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }" if (parenthesized_expression "(__n != 1)" ( (binary_expression "__n != 1" identifier != number_literal) )) (compound_statement "{\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }" { (expression_statement "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);" (call_expression "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" identifier (argument_list "(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" ( identifier , (cast_expression "(undefined1 *)((long)__dest + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + lVar2)" ( (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , identifier ))) ;) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (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_0030dd07;" goto statement_identifier ;) })) (expression_statement "*puVar8 = *(undefined1 *)((long)__dest + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)((long)__dest + lVar2)" (pointer_expression "*puVar8" * identifier) = (pointer_expression "*(undefined1 *)((long)__dest + lVar2)" * (cast_expression "(undefined1 *)((long)__dest + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + lVar2)" ( (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))))) ;) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "puVar4 = __dest + -3;" (assignment_expression "puVar4 = __dest + -3" identifier = (binary_expression "__dest + -3" identifier + number_literal)) ;) }))) (if_statement "if (puVar4 == &DAT_0044a540) {\n    return;\n  }" if (parenthesized_expression "(puVar4 == &DAT_0044a540)" ( (binary_expression "puVar4 == &DAT_0044a540" identifier == (pointer_expression "&DAT_0044a540" & identifier)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;" statement_identifier : (expression_statement "*(undefined4 *)(__dest + -1) = 0;" (assignment_expression "*(undefined4 *)(__dest + -1) = 0" (pointer_expression "*(undefined4 *)(__dest + -1)" * (cast_expression "(undefined4 *)(__dest + -1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__dest + -1)" ( (binary_expression "__dest + -1" identifier + number_literal) )))) = number_literal) ;)) (expression_statement "__dest[-3] = uVar5;" (assignment_expression "__dest[-3] = uVar5" (subscript_expression "__dest[-3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((long)__dest + uVar5) = 0;" (assignment_expression "*(undefined1 *)((long)__dest + uVar5) = 0" (pointer_expression "*(undefined1 *)((long)__dest + uVar5)" * (cast_expression "(undefined1 *)((long)__dest + uVar5)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + uVar5)" ( (binary_expression "(long)__dest + uVar5" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "/* std::string::_M_mutate(unsigned long, unsigned long, unsigned long) */\n\nvoid __thiscall std::string::_M_mutate(string *this,ulong param_1,ulong param_2,ulong param_3)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  allocator local_39 [9];\n  \n  lVar2 = param_2 + param_1;\n  lVar7 = *(long *)this;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_3 - param_2) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_1 == 0) {\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }\n    if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }\n    *(undefined8 **)this = __dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = *(undefined8 **)this;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}\n\n" comment (function_definition "void __thiscall std::string::_M_mutate(string *this,ulong param_1,ulong param_2,ulong param_3)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  allocator local_39 [9];\n  \n  lVar2 = param_2 + param_1;\n  lVar7 = *(long *)this;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_3 - param_2) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_1 == 0) {\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }\n    if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }\n    *(undefined8 **)this = __dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = *(undefined8 **)this;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" primitive_type (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::string::" identifier : : identifier : :) (function_declarator "_M_mutate(string *this,ulong param_1,ulong param_2,ulong param_3)" identifier (parameter_list "(string *this,ulong param_1,ulong param_2,ulong param_3)" ( (parameter_declaration "string *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  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  allocator local_39 [9];\n  \n  lVar2 = param_2 + param_1;\n  lVar7 = *(long *)this;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_3 - param_2) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_1 == 0) {\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }\n    if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }\n    *(undefined8 **)this = __dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = *(undefined8 **)this;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &_Rep::_S_empty_rep_storage) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined8 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "long lVar7;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "allocator local_39 [9];" type_identifier (array_declarator "local_39 [9]" identifier [ number_literal ]) ;) (expression_statement "lVar2 = param_2 + param_1;" (assignment_expression "lVar2 = param_2 + param_1" identifier = (binary_expression "param_2 + param_1" identifier + identifier)) ;) (expression_statement "lVar7 = *(long *)this;" (assignment_expression "lVar7 = *(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 "uVar6 = *(ulong *)(lVar7 + -0x10);" (assignment_expression "uVar6 = *(ulong *)(lVar7 + -0x10)" identifier = (pointer_expression "*(ulong *)(lVar7 + -0x10)" * (cast_expression "(ulong *)(lVar7 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x10)" ( (binary_expression "lVar7 + -0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = (param_3 - param_2) + *(long *)(lVar7 + -0x18);" (assignment_expression "uVar5 = (param_3 - param_2) + *(long *)(lVar7 + -0x18)" identifier = (binary_expression "(param_3 - param_2) + *(long *)(lVar7 + -0x18)" (parenthesized_expression "(param_3 - param_2)" ( (binary_expression "param_3 - param_2" identifier - identifier) )) + (pointer_expression "*(long *)(lVar7 + -0x18)" * (cast_expression "(long *)(lVar7 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) )))))) ;) (expression_statement "__n = *(long *)(lVar7 + -0x18) - lVar2;" (assignment_expression "__n = *(long *)(lVar7 + -0x18) - lVar2" identifier = (binary_expression "*(long *)(lVar7 + -0x18) - lVar2" (pointer_expression "*(long *)(lVar7 + -0x18)" * (cast_expression "(long *)(lVar7 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_1 == 0) {\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }\n    if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }\n    *(undefined8 **)this = __dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = *(undefined8 **)this;\n    puVar4 = __dest + -3;\n  }" if (parenthesized_expression "(uVar6 < uVar5)" ( (binary_expression "uVar6 < uVar5" identifier < identifier) )) (compound_statement "{\nLAB_0030dc19:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_1 == 0) {\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }\n    if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }\n    *(undefined8 **)this = __dest;\n  }" { (labeled_statement "LAB_0030dc19:\n    puVar4 = (undefined8 *)_Rep::_S_create(uVar5,uVar6,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(uVar5,uVar6,local_39);" (call_expression "_S_create(uVar5,uVar6,local_39)" identifier (argument_list "(uVar5,uVar6,local_39)" ( identifier , identifier , identifier ))) ;)) (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (param_1 == 0) {\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_0030dc6a:\n      lVar7 = *(long *)this;\n    }" { (labeled_statement "LAB_0030dc6a:\n      lVar7 = *(long *)this;" statement_identifier : (expression_statement "lVar7 = *(long *)this;" (assignment_expression "lVar7 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;)) }) (else_clause "else {\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }" else (compound_statement "{\n      __dest = puVar4 + 3;\n      if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;\n      lVar7 = *(long *)this;\n    }" { (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (param_1 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }" if (parenthesized_expression "(param_1 != 1)" ( (binary_expression "param_1 != 1" identifier != number_literal) )) (compound_statement "{\n        __dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);\n        goto LAB_0030dc6a;\n      }" { (expression_statement "__dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1);" (assignment_expression "__dest = (undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1)" identifier = (cast_expression "(undefined8 *)memcpy(__dest,*(undefined1 **)this,param_1)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,*(undefined1 **)this,param_1)" identifier (argument_list "(__dest,*(undefined1 **)this,param_1)" ( identifier , (pointer_expression "*(undefined1 **)this" * (cast_expression "(undefined1 **)this" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)) , identifier ))))) ;) (goto_statement "goto LAB_0030dc6a;" goto statement_identifier ;) })) (expression_statement "*(undefined1 *)(puVar4 + 3) = **(undefined1 **)this;" (assignment_expression "*(undefined1 *)(puVar4 + 3) = **(undefined1 **)this" (pointer_expression "*(undefined1 *)(puVar4 + 3)" * (cast_expression "(undefined1 *)(puVar4 + 3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 3)" ( (binary_expression "puVar4 + 3" identifier + number_literal) )))) = (pointer_expression "**(undefined1 **)this" * (pointer_expression "*(undefined1 **)this" * (cast_expression "(undefined1 **)this" ( (type_descriptor "undefined1 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier)))) ;) (expression_statement "lVar7 = *(long *)this;" (assignment_expression "lVar7 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;) }))) (if_statement "if (__n != 0) {\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }\n    }" { (expression_statement "puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4);" (assignment_expression "puVar8 = (undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4)" identifier = (cast_expression "(undefined1 *)(param_1 + 0x18 + param_3 + (long)puVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18 + param_3 + (long)puVar4)" ( (binary_expression "param_1 + 0x18 + param_3 + (long)puVar4" (binary_expression "param_1 + 0x18 + param_3" (binary_expression "param_1 + 0x18" identifier + number_literal) + identifier) + (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (if_statement "if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *(long *)this;\n      }" { (expression_statement "*puVar8 = *(undefined1 *)(lVar7 + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)(lVar7 + lVar2)" (pointer_expression "*puVar8" * identifier) = (pointer_expression "*(undefined1 *)(lVar7 + lVar2)" * (cast_expression "(undefined1 *)(lVar7 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + lVar2)" ( (binary_expression "lVar7 + lVar2" identifier + identifier) ))))) ;) (expression_statement "lVar7 = *(long *)this;" (assignment_expression "lVar7 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;) }) (else_clause "else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }" else (compound_statement "{\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *(long *)this;\n      }" { (expression_statement "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);" (call_expression "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" identifier (argument_list "(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" ( identifier , (cast_expression "(undefined1 *)(lVar7 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + lVar2)" ( (binary_expression "lVar7 + lVar2" identifier + identifier) ))) , identifier ))) ;) (expression_statement "lVar7 = *(long *)this;" (assignment_expression "lVar7 = *(long *)this" identifier = (pointer_expression "*(long *)this" * (cast_expression "(long *)this" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) identifier))) ;) }))) })) (if_statement "if ((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }" if (parenthesized_expression "((allocator *)(lVar7 + -0x18) != (allocator *)&_Rep::_S_empty_rep_storage)" ( (binary_expression "(allocator *)(lVar7 + -0x18) != (allocator *)&_Rep" (cast_expression "(allocator *)(lVar7 + -0x18)" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" 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        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\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        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }" { (expression_statement "iVar3 = *(int *)(lVar7 + -8);" (assignment_expression "iVar3 = *(int *)(lVar7 + -8)" identifier = (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(lVar7 + -8) = iVar3 + -1;" (assignment_expression "*(int *)(lVar7 + -8) = iVar3 + -1" (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) )))) = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar1 = (int *)(lVar7 + -8);" (assignment_expression "piVar1 = (int *)(lVar7 + -8)" identifier = (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) )))) ;) (expression_statement "iVar3 = *piVar1;" (assignment_expression "iVar3 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" * identifier) = (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar3 < 1) {\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }" if (parenthesized_expression "(iVar3 < 1)" ( (binary_expression "iVar3 < 1" identifier < number_literal) )) (compound_statement "{\n        _Rep::_M_destroy((allocator *)(lVar7 + -0x18));\n      }" { (labeled_statement "_Rep::_M_destroy((allocator *)(lVar7 + -0x18));" statement_identifier : (ERROR ":" :) (expression_statement "_M_destroy((allocator *)(lVar7 + -0x18));" (call_expression "_M_destroy((allocator *)(lVar7 + -0x18))" identifier (argument_list "((allocator *)(lVar7 + -0x18))" ( (cast_expression "(allocator *)(lVar7 + -0x18)" ( (type_descriptor "allocator *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) ))) ))) ;)) })) })) (expression_statement "*(undefined8 **)this = __dest;" (assignment_expression "*(undefined8 **)this = __dest" (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 *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = *(undefined8 **)this;\n    puVar4 = __dest + -3;\n  }" else (compound_statement "{\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = *(undefined8 **)this;\n    if ((__n == 0) || (param_3 == param_2)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = *(undefined8 **)this;\n    puVar4 = __dest + -3;\n  }" { (if_statement "if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }" if (parenthesized_expression "(0 < *(int *)(lVar7 + -8))" ( (binary_expression "0 < *(int *)(lVar7 + -8)" number_literal < (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) ))))) )) (compound_statement "{\n      uVar6 = *(ulong *)(*(long *)this + -0x10);\n      goto LAB_0030dc19;\n    }" { (expression_statement "uVar6 = *(ulong *)(*(long *)this + -0x10);" (assignment_expression "uVar6 = *(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_0030dc19;" goto statement_identifier ;) })) (expression_statement "__dest = *(undefined8 **)this;" (assignment_expression "__dest = *(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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }" { (labeled_statement "LAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" statement_identifier : (if_statement "if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" if (parenthesized_expression "(__dest == (undefined8 *)&DAT_0044a558)" ( (binary_expression "__dest == (undefined8 *)&DAT_0044a558" identifier == (cast_expression "(undefined8 *)&DAT_0044a558" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044a558" & identifier))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) }))) (goto_statement "goto LAB_0030dd20;" goto statement_identifier ;) })) (expression_statement "puVar8 = (undefined1 *)((long)__dest + param_3 + param_1);" (assignment_expression "puVar8 = (undefined1 *)((long)__dest + param_3 + param_1)" identifier = (cast_expression "(undefined1 *)((long)__dest + param_3 + param_1)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + param_3 + param_1)" ( (binary_expression "(long)__dest + param_3 + param_1" (binary_expression "(long)__dest + param_3" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) + identifier) )))) ;) (if_statement "if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }" if (parenthesized_expression "(__n != 1)" ( (binary_expression "__n != 1" identifier != number_literal) )) (compound_statement "{\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = *(undefined8 **)this;\n      goto LAB_0030dd07;\n    }" { (expression_statement "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);" (call_expression "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" identifier (argument_list "(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" ( identifier , (cast_expression "(undefined1 *)((long)__dest + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + lVar2)" ( (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , identifier ))) ;) (expression_statement "__dest = *(undefined8 **)this;" (assignment_expression "__dest = *(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_0030dd07;" goto statement_identifier ;) })) (expression_statement "*puVar8 = *(undefined1 *)((long)__dest + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)((long)__dest + lVar2)" (pointer_expression "*puVar8" * identifier) = (pointer_expression "*(undefined1 *)((long)__dest + lVar2)" * (cast_expression "(undefined1 *)((long)__dest + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + lVar2)" ( (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))))) ;) (expression_statement "__dest = *(undefined8 **)this;" (assignment_expression "__dest = *(undefined8 **)this" identifier = (pointer_expression "*(undefined8 **)this" * (cast_expression "(undefined8 **)this" ( (type_descriptor "undefined8 **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) identifier))) ;) (expression_statement "puVar4 = __dest + -3;" (assignment_expression "puVar4 = __dest + -3" identifier = (binary_expression "__dest + -3" identifier + number_literal)) ;) }))) (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_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;" statement_identifier : (expression_statement "*(undefined4 *)(__dest + -1) = 0;" (assignment_expression "*(undefined4 *)(__dest + -1) = 0" (pointer_expression "*(undefined4 *)(__dest + -1)" * (cast_expression "(undefined4 *)(__dest + -1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__dest + -1)" ( (binary_expression "__dest + -1" identifier + number_literal) )))) = number_literal) ;)) (expression_statement "__dest[-3] = uVar5;" (assignment_expression "__dest[-3] = uVar5" (subscript_expression "__dest[-3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((long)__dest + uVar5) = 0;" (assignment_expression "*(undefined1 *)((long)__dest + uVar5) = 0" (pointer_expression "*(undefined1 *)((long)__dest + uVar5)" * (cast_expression "(undefined1 *)((long)__dest + uVar5)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + uVar5)" ( (binary_expression "(long)__dest + uVar5" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "void FUN_0030dbd0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}\n\n" (function_definition "void FUN_0030dbd0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" primitive_type (function_declarator "FUN_0030dbd0(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  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "undefined8 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined8 *__dest;" type_identifier (pointer_declarator "*__dest" * identifier) ;) (declaration "size_t __n;" primitive_type identifier ;) (declaration "ulong uVar5;" type_identifier identifier ;) (declaration "ulong uVar6;" type_identifier identifier ;) (declaration "long lVar7;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "undefined1 local_39 [9];" type_identifier (array_declarator "local_39 [9]" identifier [ number_literal ]) ;) (expression_statement "lVar2 = param_3 + param_2;" (assignment_expression "lVar2 = param_3 + param_2" identifier = (binary_expression "param_3 + param_2" identifier + identifier)) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "uVar6 = *(ulong *)(lVar7 + -0x10);" (assignment_expression "uVar6 = *(ulong *)(lVar7 + -0x10)" identifier = (pointer_expression "*(ulong *)(lVar7 + -0x10)" * (cast_expression "(ulong *)(lVar7 + -0x10)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x10)" ( (binary_expression "lVar7 + -0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);" (assignment_expression "uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18)" identifier = (binary_expression "(param_4 - param_3) + *(long *)(lVar7 + -0x18)" (parenthesized_expression "(param_4 - param_3)" ( (binary_expression "param_4 - param_3" identifier - identifier) )) + (pointer_expression "*(long *)(lVar7 + -0x18)" * (cast_expression "(long *)(lVar7 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) )))))) ;) (expression_statement "__n = *(long *)(lVar7 + -0x18) - lVar2;" (assignment_expression "__n = *(long *)(lVar7 + -0x18) - lVar2" identifier = (binary_expression "*(long *)(lVar7 + -0x18) - lVar2" (pointer_expression "*(long *)(lVar7 + -0x18)" * (cast_expression "(long *)(lVar7 + -0x18)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) )))) - identifier)) ;) (if_statement "if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" if (parenthesized_expression "(uVar6 < uVar5)" ( (binary_expression "uVar6 < uVar5" identifier < identifier) )) (compound_statement "{\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }" { (labeled_statement "LAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);" statement_identifier : (expression_statement "puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);" (assignment_expression "puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39)" identifier = (cast_expression "(undefined8 *)FUN_0030d860(uVar5,uVar6,local_39)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0030d860(uVar5,uVar6,local_39)" identifier (argument_list "(uVar5,uVar6,local_39)" ( identifier , identifier , identifier ))))) ;)) (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }" { (labeled_statement "LAB_0030dc6a:\n      lVar7 = *param_1;" statement_identifier : (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;)) }) (else_clause "else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" else (compound_statement "{\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" { (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" identifier = (binary_expression "puVar4 + 3" identifier + number_literal)) ;) (if_statement "if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }" { (expression_statement "__dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);" (assignment_expression "__dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2)" identifier = (cast_expression "(undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "memcpy(__dest,(undefined1 *)*param_1,param_2)" identifier (argument_list "(__dest,(undefined1 *)*param_1,param_2)" ( identifier , (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)) , identifier ))))) ;) (goto_statement "goto LAB_0030dc6a;" goto statement_identifier ;) })) (expression_statement "*(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;" (assignment_expression "*(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1" (pointer_expression "*(undefined1 *)(puVar4 + 3)" * (cast_expression "(undefined1 *)(puVar4 + 3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(puVar4 + 3)" ( (binary_expression "puVar4 + 3" identifier + number_literal) )))) = (pointer_expression "*(undefined1 *)*param_1" * (cast_expression "(undefined1 *)*param_1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier)))) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) (if_statement "if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }" if (parenthesized_expression "(__n != 0)" ( (binary_expression "__n != 0" identifier != number_literal) )) (compound_statement "{\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }" { (expression_statement "puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);" (assignment_expression "puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4)" identifier = (cast_expression "(undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_2 + 0x18 + param_4 + (long)puVar4)" ( (binary_expression "param_2 + 0x18 + param_4 + (long)puVar4" (binary_expression "param_2 + 0x18 + param_4" (binary_expression "param_2 + 0x18" identifier + number_literal) + identifier) + (cast_expression "(long)puVar4" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) ;) (if_statement "if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" if (parenthesized_expression "(__n == 1)" ( (binary_expression "__n == 1" identifier == number_literal) )) (compound_statement "{\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }" { (expression_statement "*puVar8 = *(undefined1 *)(lVar7 + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)(lVar7 + lVar2)" (pointer_expression "*puVar8" * identifier) = (pointer_expression "*(undefined1 *)(lVar7 + lVar2)" * (cast_expression "(undefined1 *)(lVar7 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + lVar2)" ( (binary_expression "lVar7 + lVar2" identifier + identifier) ))))) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }) (else_clause "else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" else (compound_statement "{\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" { (expression_statement "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);" (call_expression "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" identifier (argument_list "(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" ( identifier , (cast_expression "(undefined1 *)(lVar7 + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + lVar2)" ( (binary_expression "lVar7 + lVar2" identifier + identifier) ))) , identifier ))) ;) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) })) (if_statement "if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }" if (parenthesized_expression "((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540)" ( (binary_expression "(undefined8 *)(lVar7 + -0x18) != &DAT_0044a540" (cast_expression "(undefined8 *)(lVar7 + -0x18)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) ))) != (pointer_expression "&DAT_0044a540" & identifier)) )) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }" { (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\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        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }" { (expression_statement "iVar3 = *(int *)(lVar7 + -8);" (assignment_expression "iVar3 = *(int *)(lVar7 + -8)" identifier = (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) ))))) ;) (expression_statement "*(int *)(lVar7 + -8) = iVar3 + -1;" (assignment_expression "*(int *)(lVar7 + -8) = iVar3 + -1" (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) )))) = (binary_expression "iVar3 + -1" identifier + number_literal)) ;) }) (else_clause "else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" else (compound_statement "{\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" { (expression_statement "LOCK();" (call_expression "LOCK()" identifier (argument_list "()" ( ))) ;) (expression_statement "piVar1 = (int *)(lVar7 + -8);" (assignment_expression "piVar1 = (int *)(lVar7 + -8)" identifier = (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) )))) ;) (expression_statement "iVar3 = *piVar1;" (assignment_expression "iVar3 = *piVar1" identifier = (pointer_expression "*piVar1" * identifier)) ;) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" * identifier) = (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" * identifier) + number_literal)) ;) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" identifier (argument_list "()" ( ))) ;) }))) (if_statement "if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }" if (parenthesized_expression "(iVar3 < 1)" ( (binary_expression "iVar3 < 1" identifier < number_literal) )) (compound_statement "{\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }" { (expression_statement "thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);" (call_expression "thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39)" identifier (argument_list "((undefined8 *)(lVar7 + -0x18),local_39)" ( (cast_expression "(undefined8 *)(lVar7 + -0x18)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -0x18)" ( (binary_expression "lVar7 + -0x18" identifier + number_literal) ))) , identifier ))) ;) })) })) (expression_statement "*param_1 = (long)__dest;" (assignment_expression "*param_1 = (long)__dest" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) (else_clause "else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" else (compound_statement "{\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" { (if_statement "if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }" if (parenthesized_expression "(0 < *(int *)(lVar7 + -8))" ( (binary_expression "0 < *(int *)(lVar7 + -8)" number_literal < (pointer_expression "*(int *)(lVar7 + -8)" * (cast_expression "(int *)(lVar7 + -8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(lVar7 + -8)" ( (binary_expression "lVar7 + -8" identifier + number_literal) ))))) )) (compound_statement "{\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }" { (expression_statement "uVar6 = *(ulong *)(*param_1 + -0x10);" (assignment_expression "uVar6 = *(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_0030dc19;" goto statement_identifier ;) })) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }" { (labeled_statement "LAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" statement_identifier : (if_statement "if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" if (parenthesized_expression "(__dest == (undefined8 *)&DAT_0044a558)" ( (binary_expression "__dest == (undefined8 *)&DAT_0044a558" identifier == (cast_expression "(undefined8 *)&DAT_0044a558" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_0044a558" & identifier))) )) (compound_statement "{\n        return;\n      }" { (return_statement "return;" return ;) }))) (goto_statement "goto LAB_0030dd20;" goto statement_identifier ;) })) (expression_statement "puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);" (assignment_expression "puVar8 = (undefined1 *)((long)__dest + param_4 + param_2)" identifier = (cast_expression "(undefined1 *)((long)__dest + param_4 + param_2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + param_4 + param_2)" ( (binary_expression "(long)__dest + param_4 + param_2" (binary_expression "(long)__dest + param_4" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) + identifier) )))) ;) (if_statement "if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }" if (parenthesized_expression "(__n != 1)" ( (binary_expression "__n != 1" identifier != number_literal) )) (compound_statement "{\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }" { (expression_statement "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);" (call_expression "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" identifier (argument_list "(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" ( identifier , (cast_expression "(undefined1 *)((long)__dest + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + lVar2)" ( (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))) , identifier ))) ;) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (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_0030dd07;" goto statement_identifier ;) })) (expression_statement "*puVar8 = *(undefined1 *)((long)__dest + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)((long)__dest + lVar2)" (pointer_expression "*puVar8" * identifier) = (pointer_expression "*(undefined1 *)((long)__dest + lVar2)" * (cast_expression "(undefined1 *)((long)__dest + lVar2)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + lVar2)" ( (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) ))))) ;) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (undefined8 *)*param_1" identifier = (cast_expression "(undefined8 *)*param_1" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "puVar4 = __dest + -3;" (assignment_expression "puVar4 = __dest + -3" identifier = (binary_expression "__dest + -3" identifier + number_literal)) ;) }))) (if_statement "if (puVar4 == &DAT_0044a540) {\n    return;\n  }" if (parenthesized_expression "(puVar4 == &DAT_0044a540)" ( (binary_expression "puVar4 == &DAT_0044a540" identifier == (pointer_expression "&DAT_0044a540" & identifier)) )) (compound_statement "{\n    return;\n  }" { (return_statement "return;" return ;) })) (labeled_statement "LAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;" statement_identifier : (expression_statement "*(undefined4 *)(__dest + -1) = 0;" (assignment_expression "*(undefined4 *)(__dest + -1) = 0" (pointer_expression "*(undefined4 *)(__dest + -1)" * (cast_expression "(undefined4 *)(__dest + -1)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(__dest + -1)" ( (binary_expression "__dest + -1" identifier + number_literal) )))) = number_literal) ;)) (expression_statement "__dest[-3] = uVar5;" (assignment_expression "__dest[-3] = uVar5" (subscript_expression "__dest[-3]" identifier [ number_literal ]) = identifier) ;) (expression_statement "*(undefined1 *)((long)__dest + uVar5) = 0;" (assignment_expression "*(undefined1 *)((long)__dest + uVar5) = 0" (pointer_expression "*(undefined1 *)((long)__dest + uVar5)" * (cast_expression "(undefined1 *)((long)__dest + uVar5)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)__dest + uVar5)" ( (binary_expression "(long)__dest + uVar5" (cast_expression "(long)__dest" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + identifier) )))) = 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 TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) 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 ))))) ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;)) }) (else_clause else (compound_statement { (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 *)) ) (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)) , IDENT ))))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT)))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * 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 *)) ) (parenthesized_expression ( (binary_expression (binary_expression (binary_expression IDENT + LIT) + IDENT) + (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) })) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) != (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 = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (pointer_expression * IDENT) + LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (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 (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + IDENT) + IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) 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 (pointer_expression * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) 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 == (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) + IDENT) )))) = LIT) ;) (return_statement return ;) })))
(function_definition "void FUN_0030dbd0(long *param_1,size_t param_2,long param_3,long param_4)\n\n{\n  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0030dbd0(long *param_1,size_t param_2,long param_3,long param_4)" (identifier "FUN_0030dbd0") (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  int *piVar1;\n  long lVar2;\n  int iVar3;\n  undefined8 *puVar4;\n  undefined8 *__dest;\n  size_t __n;\n  ulong uVar5;\n  ulong uVar6;\n  long lVar7;\n  undefined1 *puVar8;\n  undefined1 local_39 [9];\n  \n  lVar2 = param_3 + param_2;\n  lVar7 = *param_1;\n  uVar6 = *(ulong *)(lVar7 + -0x10);\n  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);\n  __n = *(long *)(lVar7 + -0x18) - lVar2;\n  if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }\n  if (puVar4 == &DAT_0044a540) {\n    return;\n  }\nLAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;\n  __dest[-3] = uVar5;\n  *(undefined1 *)((long)__dest + uVar5) = 0;\n  return;\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "long lVar2;" (sized_type_specifier "long" (long "long")) (identifier "lVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "undefined8 *puVar4;" (type_identifier "undefined8") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "undefined8 *__dest;" (type_identifier "undefined8") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (declaration "ulong uVar5;" (type_identifier "ulong") (identifier "uVar5") (; ";")) (declaration "ulong uVar6;" (type_identifier "ulong") (identifier "uVar6") (; ";")) (declaration "long lVar7;" (sized_type_specifier "long" (long "long")) (identifier "lVar7") (; ";")) (declaration "undefined1 *puVar8;" (type_identifier "undefined1") (pointer_declarator "*puVar8" (* "*") (identifier "puVar8")) (; ";")) (declaration "undefined1 local_39 [9];" (type_identifier "undefined1") (array_declarator "local_39 [9]" (identifier "local_39") ([ "[") (number_literal "9") (] "]")) (; ";")) (expression_statement "lVar2 = param_3 + param_2;" (assignment_expression "lVar2 = param_3 + param_2" (identifier "lVar2") (= "=") (binary_expression "param_3 + param_2" (identifier "param_3") (+ "+") (identifier "param_2"))) (; ";")) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" (identifier "lVar7") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "uVar6 = *(ulong *)(lVar7 + -0x10);" (assignment_expression "uVar6 = *(ulong *)(lVar7 + -0x10)" (identifier "uVar6") (= "=") (pointer_expression "*(ulong *)(lVar7 + -0x10)" (* "*") (cast_expression "(ulong *)(lVar7 + -0x10)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -0x10)" (( "(") (binary_expression "lVar7 + -0x10" (identifier "lVar7") (+ "+") (number_literal "-0x10")) () ")"))))) (; ";")) (expression_statement "uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);" (assignment_expression "uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18)" (identifier "uVar5") (= "=") (binary_expression "(param_4 - param_3) + *(long *)(lVar7 + -0x18)" (parenthesized_expression "(param_4 - param_3)" (( "(") (binary_expression "param_4 - param_3" (identifier "param_4") (- "-") (identifier "param_3")) () ")")) (+ "+") (pointer_expression "*(long *)(lVar7 + -0x18)" (* "*") (cast_expression "(long *)(lVar7 + -0x18)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -0x18)" (( "(") (binary_expression "lVar7 + -0x18" (identifier "lVar7") (+ "+") (number_literal "-0x18")) () ")")))))) (; ";")) (expression_statement "__n = *(long *)(lVar7 + -0x18) - lVar2;" (assignment_expression "__n = *(long *)(lVar7 + -0x18) - lVar2" (identifier "__n") (= "=") (binary_expression "*(long *)(lVar7 + -0x18) - lVar2" (pointer_expression "*(long *)(lVar7 + -0x18)" (* "*") (cast_expression "(long *)(lVar7 + -0x18)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -0x18)" (( "(") (binary_expression "lVar7 + -0x18" (identifier "lVar7") (+ "+") (number_literal "-0x18")) () ")")))) (- "-") (identifier "lVar2"))) (; ";")) (if_statement "if (uVar6 < uVar5) {\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }\n  else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" (if "if") (parenthesized_expression "(uVar6 < uVar5)" (( "(") (binary_expression "uVar6 < uVar5" (identifier "uVar6") (< "<") (identifier "uVar5")) () ")")) (compound_statement "{\nLAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);\n    __dest = puVar4 + 3;\n    if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }\n    if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }\n    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }\n    *param_1 = (long)__dest;\n  }" ({ "{") (labeled_statement "LAB_0030dc19:\n    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);" (statement_identifier "LAB_0030dc19") (: ":") (expression_statement "puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);" (assignment_expression "puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39)" (identifier "puVar4") (= "=") (cast_expression "(undefined8 *)FUN_0030d860(uVar5,uVar6,local_39)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0030d860(uVar5,uVar6,local_39)" (identifier "FUN_0030d860") (argument_list "(uVar5,uVar6,local_39)" (( "(") (identifier "uVar5") (, ",") (identifier "uVar6") (, ",") (identifier "local_39") () ")"))))) (; ";"))) (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" (identifier "__dest") (= "=") (binary_expression "puVar4 + 3" (identifier "puVar4") (+ "+") (number_literal "3"))) (; ";")) (if_statement "if (param_2 == 0) {\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }\n    else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\nLAB_0030dc6a:\n      lVar7 = *param_1;\n    }" ({ "{") (labeled_statement "LAB_0030dc6a:\n      lVar7 = *param_1;" (statement_identifier "LAB_0030dc6a") (: ":") (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" (identifier "lVar7") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";"))) (} "}")) (else_clause "else {\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" (else "else") (compound_statement "{\n      __dest = puVar4 + 3;\n      if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }\n      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;\n      lVar7 = *param_1;\n    }" ({ "{") (expression_statement "__dest = puVar4 + 3;" (assignment_expression "__dest = puVar4 + 3" (identifier "__dest") (= "=") (binary_expression "puVar4 + 3" (identifier "puVar4") (+ "+") (number_literal "3"))) (; ";")) (if_statement "if (param_2 != 1) {\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }" (if "if") (parenthesized_expression "(param_2 != 1)" (( "(") (binary_expression "param_2 != 1" (identifier "param_2") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);\n        goto LAB_0030dc6a;\n      }" ({ "{") (expression_statement "__dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);" (assignment_expression "__dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2)" (identifier "__dest") (= "=") (cast_expression "(undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "memcpy(__dest,(undefined1 *)*param_1,param_2)" (identifier "memcpy") (argument_list "(__dest,(undefined1 *)*param_1,param_2)" (( "(") (identifier "__dest") (, ",") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (, ",") (identifier "param_2") () ")"))))) (; ";")) (goto_statement "goto LAB_0030dc6a;" (goto "goto") (statement_identifier "LAB_0030dc6a") (; ";")) (} "}"))) (expression_statement "*(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;" (assignment_expression "*(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1" (pointer_expression "*(undefined1 *)(puVar4 + 3)" (* "*") (cast_expression "(undefined1 *)(puVar4 + 3)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(puVar4 + 3)" (( "(") (binary_expression "puVar4 + 3" (identifier "puVar4") (+ "+") (number_literal "3")) () ")")))) (= "=") (pointer_expression "*(undefined1 *)*param_1" (* "*") (cast_expression "(undefined1 *)*param_1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1"))))) (; ";")) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" (identifier "lVar7") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (} "}")))) (if_statement "if (__n != 0) {\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }" (if "if") (parenthesized_expression "(__n != 0)" (( "(") (binary_expression "__n != 0" (identifier "__n") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);\n      if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }\n    }" ({ "{") (expression_statement "puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);" (assignment_expression "puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4)" (identifier "puVar8") (= "=") (cast_expression "(undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_2 + 0x18 + param_4 + (long)puVar4)" (( "(") (binary_expression "param_2 + 0x18 + param_4 + (long)puVar4" (binary_expression "param_2 + 0x18 + param_4" (binary_expression "param_2 + 0x18" (identifier "param_2") (+ "+") (number_literal "0x18")) (+ "+") (identifier "param_4")) (+ "+") (cast_expression "(long)puVar4" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar4"))) () ")")))) (; ";")) (if_statement "if (__n == 1) {\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }\n      else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" (if "if") (parenthesized_expression "(__n == 1)" (( "(") (binary_expression "__n == 1" (identifier "__n") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n        *puVar8 = *(undefined1 *)(lVar7 + lVar2);\n        lVar7 = *param_1;\n      }" ({ "{") (expression_statement "*puVar8 = *(undefined1 *)(lVar7 + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)(lVar7 + lVar2)" (pointer_expression "*puVar8" (* "*") (identifier "puVar8")) (= "=") (pointer_expression "*(undefined1 *)(lVar7 + lVar2)" (* "*") (cast_expression "(undefined1 *)(lVar7 + lVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + lVar2)" (( "(") (binary_expression "lVar7 + lVar2" (identifier "lVar7") (+ "+") (identifier "lVar2")) () ")"))))) (; ";")) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" (identifier "lVar7") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (} "}")) (else_clause "else {\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" (else "else") (compound_statement "{\n        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);\n        lVar7 = *param_1;\n      }" ({ "{") (expression_statement "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);" (call_expression "memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" (identifier "memcpy") (argument_list "(puVar8,(undefined1 *)(lVar7 + lVar2),__n)" (( "(") (identifier "puVar8") (, ",") (cast_expression "(undefined1 *)(lVar7 + lVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + lVar2)" (( "(") (binary_expression "lVar7 + lVar2" (identifier "lVar7") (+ "+") (identifier "lVar2")) () ")"))) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "lVar7 = *param_1;" (assignment_expression "lVar7 = *param_1" (identifier "lVar7") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (} "}")))) (} "}"))) (if_statement "if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }" (if "if") (parenthesized_expression "((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540)" (( "(") (binary_expression "(undefined8 *)(lVar7 + -0x18) != &DAT_0044a540" (cast_expression "(undefined8 *)(lVar7 + -0x18)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -0x18)" (( "(") (binary_expression "lVar7 + -0x18" (identifier "lVar7") (+ "+") (number_literal "-0x18")) () ")"))) (!= "!=") (pointer_expression "&DAT_0044a540" (& "&") (identifier "DAT_0044a540"))) () ")")) (compound_statement "{\n      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }\n      if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }\n    }" ({ "{") (if_statement "if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {\n        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }\n      else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\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        iVar3 = *(int *)(lVar7 + -8);\n        *(int *)(lVar7 + -8) = iVar3 + -1;\n      }" ({ "{") (expression_statement "iVar3 = *(int *)(lVar7 + -8);" (assignment_expression "iVar3 = *(int *)(lVar7 + -8)" (identifier "iVar3") (= "=") (pointer_expression "*(int *)(lVar7 + -8)" (* "*") (cast_expression "(int *)(lVar7 + -8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -8)" (( "(") (binary_expression "lVar7 + -8" (identifier "lVar7") (+ "+") (number_literal "-8")) () ")"))))) (; ";")) (expression_statement "*(int *)(lVar7 + -8) = iVar3 + -1;" (assignment_expression "*(int *)(lVar7 + -8) = iVar3 + -1" (pointer_expression "*(int *)(lVar7 + -8)" (* "*") (cast_expression "(int *)(lVar7 + -8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -8)" (( "(") (binary_expression "lVar7 + -8" (identifier "lVar7") (+ "+") (number_literal "-8")) () ")")))) (= "=") (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1"))) (; ";")) (} "}")) (else_clause "else {\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" (else "else") (compound_statement "{\n        LOCK();\n        piVar1 = (int *)(lVar7 + -8);\n        iVar3 = *piVar1;\n        *piVar1 = *piVar1 + -1;\n        UNLOCK();\n      }" ({ "{") (expression_statement "LOCK();" (call_expression "LOCK()" (identifier "LOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "piVar1 = (int *)(lVar7 + -8);" (assignment_expression "piVar1 = (int *)(lVar7 + -8)" (identifier "piVar1") (= "=") (cast_expression "(int *)(lVar7 + -8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -8)" (( "(") (binary_expression "lVar7 + -8" (identifier "lVar7") (+ "+") (number_literal "-8")) () ")")))) (; ";")) (expression_statement "iVar3 = *piVar1;" (assignment_expression "iVar3 = *piVar1" (identifier "iVar3") (= "=") (pointer_expression "*piVar1" (* "*") (identifier "piVar1"))) (; ";")) (expression_statement "*piVar1 = *piVar1 + -1;" (assignment_expression "*piVar1 = *piVar1 + -1" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (= "=") (binary_expression "*piVar1 + -1" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "UNLOCK();" (call_expression "UNLOCK()" (identifier "UNLOCK") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (if_statement "if (iVar3 < 1) {\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }" (if "if") (parenthesized_expression "(iVar3 < 1)" (( "(") (binary_expression "iVar3 < 1" (identifier "iVar3") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);\n      }" ({ "{") (expression_statement "thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);" (call_expression "thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39)" (identifier "thunk_FUN_002dac70") (argument_list "((undefined8 *)(lVar7 + -0x18),local_39)" (( "(") (cast_expression "(undefined8 *)(lVar7 + -0x18)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -0x18)" (( "(") (binary_expression "lVar7 + -0x18" (identifier "lVar7") (+ "+") (number_literal "-0x18")) () ")"))) (, ",") (identifier "local_39") () ")"))) (; ";")) (} "}"))) (} "}"))) (expression_statement "*param_1 = (long)__dest;" (assignment_expression "*param_1 = (long)__dest" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(long)__dest" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__dest"))) (; ";")) (} "}")) (else_clause "else {\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" (else "else") (compound_statement "{\n    if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }\n    __dest = (undefined8 *)*param_1;\n    if ((__n == 0) || (param_4 == param_3)) {\nLAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }\n    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);\n    if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }\n    *puVar8 = *(undefined1 *)((long)__dest + lVar2);\n    __dest = (undefined8 *)*param_1;\n    puVar4 = __dest + -3;\n  }" ({ "{") (if_statement "if (0 < *(int *)(lVar7 + -8)) {\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }" (if "if") (parenthesized_expression "(0 < *(int *)(lVar7 + -8))" (( "(") (binary_expression "0 < *(int *)(lVar7 + -8)" (number_literal "0") (< "<") (pointer_expression "*(int *)(lVar7 + -8)" (* "*") (cast_expression "(int *)(lVar7 + -8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(lVar7 + -8)" (( "(") (binary_expression "lVar7 + -8" (identifier "lVar7") (+ "+") (number_literal "-8")) () ")"))))) () ")")) (compound_statement "{\n      uVar6 = *(ulong *)(*param_1 + -0x10);\n      goto LAB_0030dc19;\n    }" ({ "{") (expression_statement "uVar6 = *(ulong *)(*param_1 + -0x10);" (assignment_expression "uVar6 = *(ulong *)(*param_1 + -0x10)" (identifier "uVar6") (= "=") (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_0030dc19;" (goto "goto") (statement_identifier "LAB_0030dc19") (; ";")) (} "}"))) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (undefined8 *)*param_1" (identifier "__dest") (= "=") (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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\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_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }\n      goto LAB_0030dd20;\n    }" ({ "{") (labeled_statement "LAB_0030dd07:\n      if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" (statement_identifier "LAB_0030dd07") (: ":") (if_statement "if (__dest == (undefined8 *)&DAT_0044a558) {\n        return;\n      }" (if "if") (parenthesized_expression "(__dest == (undefined8 *)&DAT_0044a558)" (( "(") (binary_expression "__dest == (undefined8 *)&DAT_0044a558" (identifier "__dest") (== "==") (cast_expression "(undefined8 *)&DAT_0044a558" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&DAT_0044a558" (& "&") (identifier "DAT_0044a558")))) () ")")) (compound_statement "{\n        return;\n      }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}")))) (goto_statement "goto LAB_0030dd20;" (goto "goto") (statement_identifier "LAB_0030dd20") (; ";")) (} "}"))) (expression_statement "puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);" (assignment_expression "puVar8 = (undefined1 *)((long)__dest + param_4 + param_2)" (identifier "puVar8") (= "=") (cast_expression "(undefined1 *)((long)__dest + param_4 + param_2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)__dest + param_4 + param_2)" (( "(") (binary_expression "(long)__dest + param_4 + param_2" (binary_expression "(long)__dest + param_4" (cast_expression "(long)__dest" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__dest")) (+ "+") (identifier "param_4")) (+ "+") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if (__n != 1) {\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }" (if "if") (parenthesized_expression "(__n != 1)" (( "(") (binary_expression "__n != 1" (identifier "__n") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);\n      __dest = (undefined8 *)*param_1;\n      goto LAB_0030dd07;\n    }" ({ "{") (expression_statement "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);" (call_expression "memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" (identifier "memmove") (argument_list "(puVar8,(undefined1 *)((long)__dest + lVar2),__n)" (( "(") (identifier "puVar8") (, ",") (cast_expression "(undefined1 *)((long)__dest + lVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)__dest + lVar2)" (( "(") (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__dest")) (+ "+") (identifier "lVar2")) () ")"))) (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (undefined8 *)*param_1" (identifier "__dest") (= "=") (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_0030dd07;" (goto "goto") (statement_identifier "LAB_0030dd07") (; ";")) (} "}"))) (expression_statement "*puVar8 = *(undefined1 *)((long)__dest + lVar2);" (assignment_expression "*puVar8 = *(undefined1 *)((long)__dest + lVar2)" (pointer_expression "*puVar8" (* "*") (identifier "puVar8")) (= "=") (pointer_expression "*(undefined1 *)((long)__dest + lVar2)" (* "*") (cast_expression "(undefined1 *)((long)__dest + lVar2)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)__dest + lVar2)" (( "(") (binary_expression "(long)__dest + lVar2" (cast_expression "(long)__dest" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__dest")) (+ "+") (identifier "lVar2")) () ")"))))) (; ";")) (expression_statement "__dest = (undefined8 *)*param_1;" (assignment_expression "__dest = (undefined8 *)*param_1" (identifier "__dest") (= "=") (cast_expression "(undefined8 *)*param_1" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "puVar4 = __dest + -3;" (assignment_expression "puVar4 = __dest + -3" (identifier "puVar4") (= "=") (binary_expression "__dest + -3" (identifier "__dest") (+ "+") (number_literal "-3"))) (; ";")) (} "}")))) (if_statement "if (puVar4 == &DAT_0044a540) {\n    return;\n  }" (if "if") (parenthesized_expression "(puVar4 == &DAT_0044a540)" (( "(") (binary_expression "puVar4 == &DAT_0044a540" (identifier "puVar4") (== "==") (pointer_expression "&DAT_0044a540" (& "&") (identifier "DAT_0044a540"))) () ")")) (compound_statement "{\n    return;\n  }" ({ "{") (return_statement "return;" (return "return") (; ";")) (} "}"))) (labeled_statement "LAB_0030dd20:\n  *(undefined4 *)(__dest + -1) = 0;" (statement_identifier "LAB_0030dd20") (: ":") (expression_statement "*(undefined4 *)(__dest + -1) = 0;" (assignment_expression "*(undefined4 *)(__dest + -1) = 0" (pointer_expression "*(undefined4 *)(__dest + -1)" (* "*") (cast_expression "(undefined4 *)(__dest + -1)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(__dest + -1)" (( "(") (binary_expression "__dest + -1" (identifier "__dest") (+ "+") (number_literal "-1")) () ")")))) (= "=") (number_literal "0")) (; ";"))) (expression_statement "__dest[-3] = uVar5;" (assignment_expression "__dest[-3] = uVar5" (subscript_expression "__dest[-3]" (identifier "__dest") ([ "[") (number_literal "-3") (] "]")) (= "=") (identifier "uVar5")) (; ";")) (expression_statement "*(undefined1 *)((long)__dest + uVar5) = 0;" (assignment_expression "*(undefined1 *)((long)__dest + uVar5) = 0" (pointer_expression "*(undefined1 *)((long)__dest + uVar5)" (* "*") (cast_expression "(undefined1 *)((long)__dest + uVar5)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)__dest + uVar5)" (( "(") (binary_expression "(long)__dest + uVar5" (cast_expression "(long)__dest" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "__dest")) (+ "+") (identifier "uVar5")) () ")")))) (= "=") (number_literal "0")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* std::string::_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)

{
  int *piVar1;
  long var_5;
  int var_13;
  type_3 *var_9;
  type_3 *var_17;
  size_t var_11;
  type_2 var_7;
  type_2 var_6;
  long var_3;
  type_4 *puVar8;
  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_0030dc19:
    var_9 = (type_3 *)_Rep::var_8(var_7,var_6,local_39);
    var_17 = var_9 + 3;
    if (var_2 == 0) {
LAB_0030dc6a:
      var_3 = *(long *)this;
    }
    else {
      var_17 = var_9 + 3;
      if (var_2 != 1) {
        var_17 = (type_3 *)var_10(var_17,*(type_4 **)this,var_2);
        goto LAB_0030dc6a;
      }
      *(type_4 *)(var_9 + 3) = **(type_4 **)this;
      var_3 = *(long *)this;
    }
    if (var_11 != 0) {
      puVar8 = (type_4 *)(var_2 + 0x18 + var_4 + (long)var_9);
      if (var_11 == 1) {
        *puVar8 = *(type_4 *)(var_3 + var_5);
        var_3 = *(long *)this;
      }
      else {
        var_10(puVar8,(type_4 *)(var_3 + var_5),var_11);
        var_3 = *(long *)this;
      }
    }
    if ((type_5 *)(var_3 + -0x18) != (type_5 *)&_Rep::_S_empty_rep_storage) {
      if (var_12 == (type_6 *)0x0) {
        var_13 = *(int *)(var_3 + -8);
        *(int *)(var_3 + -8) = var_13 + -1;
      }
      else {
        var_14();
        piVar1 = (int *)(var_3 + -8);
        var_13 = *piVar1;
        *piVar1 = *piVar1 + -1;
        var_15();
      }
      if (var_13 < 1) {
        _Rep::var_16((type_5 *)(var_3 + -0x18));
      }
    }
    *(type_3 **)this = var_17;
  }
  else {
    if (0 < *(int *)(var_3 + -8)) {
      var_6 = *(type_2 *)(*(long *)this + -0x10);
      goto LAB_0030dc19;
    }
    var_17 = *(type_3 **)this;
    if ((var_11 == 0) || (var_4 == var_1)) {
LAB_0030dd07:
      if (var_17 == (type_3 *)&DAT_0044a558) {
        return;
      }
      goto LAB_0030dd20;
    }
    puVar8 = (type_4 *)((long)var_17 + var_4 + var_2);
    if (var_11 != 1) {
      var_18(puVar8,(type_4 *)((long)var_17 + var_5),var_11);
      var_17 = *(type_3 **)this;
      goto LAB_0030dd07;
    }
    *puVar8 = *(type_4 *)((long)var_17 + var_5);
    var_17 = *(type_3 **)this;
    var_9 = var_17 + -3;
  }
  if (var_9 == &_Rep::_S_empty_rep_storage) {
    return;
  }
LAB_0030dd20:
  *(type_7 *)(var_17 + -1) = 0;
  var_17[-3] = var_7;
  *(type_4 *)((long)var_17 + var_7) = 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: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (primitive_type) 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: (sized_type_specifier) 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))))))) (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 (labeled_statement label: (statement_identifier) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))))) alternative: (else_clause (compound_statement (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: (call_expression function: (identifier) arguments: (argument_list (identifier) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))) (identifier)))))) (goto_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: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (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: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (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)))) 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: (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))))))) (expression_statement (assignment_expression left: (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))))) right: (binary_expression left: (identifier) right: (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (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: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (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)))))))) (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: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (identifier)) right: (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (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: (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: (pointer_expression argument: (identifier)) right: (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: (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: (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: (identifier))))) right: (number_literal))) (return_statement))))

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

{
  int *piVar1;
  long lVar2;
  int iVar3;
  undefined8 *puVar4;
  undefined8 *__dest;
  size_t __n;
  ulong uVar5;
  ulong uVar6;
  long lVar7;
  undefined1 *puVar8;
  undefined1 local_39 [9];
  
  lVar2 = param_3 + param_2;
  lVar7 = *param_1;
  uVar6 = *(ulong *)(lVar7 + -0x10);
  uVar5 = (param_4 - param_3) + *(long *)(lVar7 + -0x18);
  __n = *(long *)(lVar7 + -0x18) - lVar2;
  if (uVar6 < uVar5) {
LAB_0030dc19:
    puVar4 = (undefined8 *)FUN_0030d860(uVar5,uVar6,local_39);
    __dest = puVar4 + 3;
    if (param_2 == 0) {
LAB_0030dc6a:
      lVar7 = *param_1;
    }
    else {
      __dest = puVar4 + 3;
      if (param_2 != 1) {
        __dest = (undefined8 *)memcpy(__dest,(undefined1 *)*param_1,param_2);
        goto LAB_0030dc6a;
      }
      *(undefined1 *)(puVar4 + 3) = *(undefined1 *)*param_1;
      lVar7 = *param_1;
    }
    if (__n != 0) {
      puVar8 = (undefined1 *)(param_2 + 0x18 + param_4 + (long)puVar4);
      if (__n == 1) {
        *puVar8 = *(undefined1 *)(lVar7 + lVar2);
        lVar7 = *param_1;
      }
      else {
        memcpy(puVar8,(undefined1 *)(lVar7 + lVar2),__n);
        lVar7 = *param_1;
      }
    }
    if ((undefined8 *)(lVar7 + -0x18) != &DAT_0044a540) {
      if (PTR___pthread_key_create_0043dee8 == (undefined *)0x0) {
        iVar3 = *(int *)(lVar7 + -8);
        *(int *)(lVar7 + -8) = iVar3 + -1;
      }
      else {
        LOCK();
        piVar1 = (int *)(lVar7 + -8);
        iVar3 = *piVar1;
        *piVar1 = *piVar1 + -1;
        UNLOCK();
      }
      if (iVar3 < 1) {
        thunk_FUN_002dac70((undefined8 *)(lVar7 + -0x18),local_39);
      }
    }
    *param_1 = (long)__dest;
  }
  else {
    if (0 < *(int *)(lVar7 + -8)) {
      uVar6 = *(ulong *)(*param_1 + -0x10);
      goto LAB_0030dc19;
    }
    __dest = (undefined8 *)*param_1;
    if ((__n == 0) || (param_4 == param_3)) {
LAB_0030dd07:
      if (__dest == (undefined8 *)&DAT_0044a558) {
        return;
      }
      goto LAB_0030dd20;
    }
    puVar8 = (undefined1 *)((long)__dest + param_4 + param_2);
    if (__n != 1) {
      memmove(puVar8,(undefined1 *)((long)__dest + lVar2),__n);
      __dest = (undefined8 *)*param_1;
      goto LAB_0030dd07;
    }
    *puVar8 = *(undefined1 *)((long)__dest + lVar2);
    __dest = (undefined8 *)*param_1;
    puVar4 = __dest + -3;
  }
  if (puVar4 == &DAT_0044a540) {
    return;
  }
LAB_0030dd20:
  *(undefined4 *)(__dest + -1) = 0;
  __dest[-3] = uVar5;
  *(undefined1 *)((long)__dest + uVar5) = 0;
  return;
}

