// Decompiled from acclient.exe — chunk 0x00420000
// Ghidra 12.0.4 + pyghidra headless

// --- FUN_004220b0 at 0x004220B0 (size: 45) ---


int * __thiscall FUN_004220b0(int *param_1,int param_2,int param_3)



{

  int iVar1;

  

  *param_1 = param_3;

  param_1[1] = param_2;

  if ((param_2 != DAT_00837cb8) && (param_3 == 0)) {

    iVar1 = FUN_0041c280(param_2);

    *param_1 = iVar1;

  }

  return param_1;

}





// --- FUN_004220e0 at 0x004220E0 (size: 27) ---


undefined4 __thiscall FUN_004220e0(int *param_1,undefined2 *param_2)



{

  undefined2 uVar1;

  int iVar2;

  

  iVar2 = *param_1;

  if (iVar2 != 0) {

    uVar1 = *(undefined2 *)(iVar2 + 0x36);

    *param_2 = uVar1;

    return CONCAT31((int3)(CONCAT22((short)((uint)iVar2 >> 0x10),uVar1) >> 8),1);

  }

  return 0;

}





// --- FUN_00422100 at 0x00422100 (size: 25) ---


undefined4 __thiscall FUN_00422100(int *param_1,undefined1 *param_2)



{

  int iVar1;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    *param_2 = *(undefined1 *)(iVar1 + 0x38);

    return CONCAT31((int3)((uint)iVar1 >> 8),1);

  }

  return 0;

}





// --- FUN_00422120 at 0x00422120 (size: 27) ---


undefined4 __thiscall FUN_00422120(int *param_1,undefined2 *param_2)



{

  undefined2 uVar1;

  int iVar2;

  

  iVar2 = *param_1;

  if (iVar2 != 0) {

    uVar1 = *(undefined2 *)(iVar2 + 0x34);

    *param_2 = uVar1;

    return CONCAT31((int3)(CONCAT22((short)((uint)iVar2 >> 0x10),uVar1) >> 8),1);

  }

  return 0;

}





// --- FUN_00422140 at 0x00422140 (size: 27) ---


undefined4 __thiscall FUN_00422140(int *param_1,undefined2 *param_2)



{

  undefined2 uVar1;

  int iVar2;

  

  iVar2 = *param_1;

  if (iVar2 != 0) {

    uVar1 = *(undefined2 *)(iVar2 + 0x3a);

    *param_2 = uVar1;

    return CONCAT31((int3)(CONCAT22((short)((uint)iVar2 >> 0x10),uVar1) >> 8),1);

  }

  return 0;

}





// --- FUN_00422160 at 0x00422160 (size: 94) ---


int __thiscall FUN_00422160(int *param_1,int param_2)



{

  int iVar1;

  uint3 uVar2;

  

  iVar1 = *param_1;

  uVar2 = (uint3)((uint)iVar1 >> 8);

  if (iVar1 != 0) {

    if (param_2 == 0) {

      if (*(char *)(iVar1 + 0x4c) != '\0') {

LAB_00422175:

        return CONCAT31(uVar2,1);

      }

    }

    else if (param_2 == 1) {

      if (*(char *)(iVar1 + 0x4d) != '\0') {

        return CONCAT31(uVar2,1);

      }

    }

    else if (param_2 == -1) {

      if (*(char *)(iVar1 + 0x4e) != '\0') {

        return CONCAT31(uVar2,1);

      }

    }

    else {

      if ((1 < param_2) && (*(char *)(iVar1 + 0x4f) != '\0')) goto LAB_00422175;

      if ((param_2 < -1) && (*(char *)(iVar1 + 0x50) != '\0')) {

        return CONCAT31(uVar2,1);

      }

    }

  }

  return (uint)uVar2 << 8;

}





// --- FUN_004221c0 at 0x004221C0 (size: 67) ---


undefined4 FUN_004221c0(void)



{

  int *piVar1;

  int iVar2;

  

  piVar1 = (int *)FUN_005df0f5(4);

  if (piVar1 == (int *)0x0) {

    DAT_00837cc8 = (int *)0x0;

  }

  else {

    *piVar1 = 0;

    DAT_00837cc8 = piVar1;

    iVar2 = FUN_00415730(1,4,0x30);

    if (iVar2 != 0) {

      *piVar1 = iVar2;

      return 1;

    }

  }

  return 0;

}





// --- FUN_00422210 at 0x00422210 (size: 52) ---


undefined4 FUN_00422210(void)



{

  int *piVar1;

  

  piVar1 = DAT_00837cc8;

  if (DAT_00837cc8 != (int *)0x0) {

    if ((int *)*DAT_00837cc8 != (int *)0x0) {

      (**(code **)(*(int *)*DAT_00837cc8 + 0x14))();

      *piVar1 = 0;

    }

    operator_delete(piVar1);

  }

  DAT_00837cc8 = (int *)0x0;

  return 1;

}





// --- FUN_00422250 at 0x00422250 (size: 80) ---


void FUN_00422250(char *param_1,int param_2)



{

  char *pcVar1;

  char cVar2;

  

  cVar2 = *param_1;

  FUN_0040ad10(1);

  pcVar1 = (char *)FUN_0040acf0(1);

  if (pcVar1 != (char *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) == 0) {

      cVar2 = *pcVar1;

    }

    else {

      *pcVar1 = cVar2;

    }

  }

  if ((((*(byte *)(param_2 + 4) & 5) == 0) && (cVar2 != '\0')) && (cVar2 != '\x01')) {

    FUN_0040aa50();

  }

  *param_1 = cVar2 != '\0';

  return;

}





// --- FUN_00422380 at 0x00422380 (size: 310) ---


void __fastcall FUN_00422380(undefined4 *param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  puVar2 = (undefined4 *)(param_1[0x2c] + -0x14);

  *param_1 = &PTR_LAB_00796b20;

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x2c] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x19] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x19] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x18] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x18] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x17] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x17] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x16] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x16] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x15] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x15] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x12] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x12] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x11] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x11] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x10] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x10] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0xf] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0xf] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  FUN_004154b0();

  return;

}





// --- FUN_004224f0 at 0x004224F0 (size: 30) ---


void * __thiscall FUN_004224f0(void *param_1,byte param_2)



{

  FUN_00422380();

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00422510 at 0x00422510 (size: 80) ---


undefined4 __thiscall FUN_00422510(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 0x3c)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x3c);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_00422560 at 0x00422560 (size: 80) ---


undefined4 __thiscall FUN_00422560(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 0x44)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x44);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_004225b0 at 0x004225B0 (size: 80) ---


undefined4 __thiscall FUN_004225b0(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 0x40)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x40);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_00422600 at 0x00422600 (size: 80) ---


undefined4 __thiscall FUN_00422600(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 0x48)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x48);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_00422650 at 0x00422650 (size: 80) ---


undefined4 __thiscall FUN_00422650(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 0x60)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x60);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_004226a0 at 0x004226A0 (size: 80) ---


undefined4 __thiscall FUN_004226a0(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 100)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 100);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_004226f0 at 0x004226F0 (size: 214) ---


undefined4 __thiscall FUN_004226f0(int *param_1,int *param_2,int *param_3,int *param_4)



{

  int iVar1;

  int iVar2;

  LONG LVar3;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar2 = *param_2;

    if (iVar2 != *(int *)(iVar1 + 0x54)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x54);

      *param_2 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    iVar1 = *param_1;

    iVar2 = *param_3;

    if (iVar2 != *(int *)(iVar1 + 0x58)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x58);

      *param_3 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    iVar1 = *param_1;

    iVar2 = *param_4;

    if (iVar2 != *(int *)(iVar1 + 0x5c)) {

      LVar3 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar1 = *(int *)(iVar1 + 0x5c);

      *param_4 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    return 1;

  }

  return 0;

}





// --- FUN_004227d0 at 0x004227D0 (size: 145) ---


void __thiscall FUN_004227d0(int *param_1,int param_2)



{

  uint uVar1;

  int iVar2;

  int iVar3;

  uint uVar4;

  

  iVar2 = param_2;

  if ((*(byte *)(param_2 + 4) & 1) != 0) {

    param_2 = *(int *)(*param_1 + -4) + -1;

  }

  FUN_00401a80(&param_2,&param_2,iVar2);

  iVar3 = param_2;

  if ((*(uint *)(iVar2 + 4) >> 2 & 1) == 0) {

    uVar1 = param_2 * 2;

    if ((~*(byte *)(iVar2 + 4) & 1) != 0) {

      uVar4 = FUN_0040a8f0();

      if (uVar4 < uVar1) {

        FUN_0040aa50();

        return;

      }

      FUN_004010a0();

      FUN_004022d0(iVar3);

      *(undefined2 *)(uVar1 + *param_1) = 0;

    }

    FUN_00401590(*param_1,uVar1,iVar2);

  }

  return;

}





// --- FUN_00422d00 at 0x00422D00 (size: 30) ---


void FUN_00422d00(undefined4 *param_1,undefined4 *param_2,undefined4 *param_3)



{

  for (; param_1 != param_2; param_1 = param_1 + 1) {

    *param_1 = *param_3;

  }

  return;

}





// --- FUN_00422d20 at 0x00422D20 (size: 63) ---


void FUN_00422d20(int param_1,int param_2,uint *param_3)



{

  int iVar1;

  int iVar2;

  

  iVar2 = param_2 - param_1 >> 2;

  if (0 < iVar2) {

    do {

      iVar1 = iVar2 >> 1;

      if (*(uint *)(param_1 + iVar1 * 4) < *param_3) {

        param_1 = param_1 + 4 + iVar1 * 4;

        iVar1 = iVar2 + (-1 - iVar1);

      }

      iVar2 = iVar1;

    } while (0 < iVar1);

  }

  return;

}





// --- FUN_00422d60 at 0x00422D60 (size: 82) ---


undefined4 * __thiscall FUN_00422d60(int param_1,int *param_2)



{

  int iVar1;

  undefined4 *puVar2;

  char cVar3;

  uint uVar4;

  

  iVar1 = *param_2;

  uVar4 = *(uint *)(iVar1 + -8);

  if (uVar4 == 0xffffffff) {

    uVar4 = FUN_004016b0(iVar1);

    *(uint *)(iVar1 + -8) = uVar4;

  }

  puVar2 = *(undefined4 **)

            (*(int *)(param_1 + 4) +

            (uVar4 % (uint)(*(int *)(param_1 + 8) - *(int *)(param_1 + 4) >> 2)) * 4);

  while ((puVar2 != (undefined4 *)0x0 && (cVar3 = FUN_00401920(param_2), cVar3 == '\0'))) {

    puVar2 = (undefined4 *)*puVar2;

  }

  return puVar2;

}





// --- FUN_00422dc0 at 0x00422DC0 (size: 78) ---


void * FUN_00422dc0(int param_1,void *param_2,void *param_3)



{

  void *_Dst;

  

  if (param_1 == 0) {

    _Dst = (void *)0x0;

  }

  else if ((uint)(param_1 << 2) < 0x81) {

    _Dst = (void *)FUN_004050d0(param_1 << 2);

  }

  else {

    _Dst = (void *)FUN_005df0f5();

  }

  if (param_3 != param_2) {

    memmove(_Dst,param_2,(int)param_3 - (int)param_2);

  }

  return _Dst;

}





// --- FUN_00422e10 at 0x00422E10 (size: 145) ---


void __thiscall FUN_00422e10(int *param_1,uint param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  

  iVar1 = *param_1;

  if ((uint)(param_1[2] - iVar1 >> 2) < param_2) {

    iVar2 = param_1[1];

    if (iVar1 == 0) {

      if (param_2 == 0) {

        iVar4 = 0;

      }

      else if (param_2 * 4 < 0x81) {

        iVar4 = FUN_004050d0(param_2 * 4);

      }

      else {

        iVar4 = FUN_005df0f5();

      }

    }

    else {

      iVar4 = FUN_00422dc0(param_2,iVar1,iVar2);

      iVar3 = *param_1;

      if (iVar3 != 0) {

        FUN_004051c0(iVar3,(param_1[2] - iVar3 >> 2) << 2);

      }

    }

    *param_1 = iVar4;

    param_1[1] = iVar4 + (iVar2 - iVar1 >> 2) * 4;

    param_1[2] = iVar4 + param_2 * 4;

  }

  return;

}





// --- FUN_00422eb0 at 0x00422EB0 (size: 108) ---


undefined4 * __thiscall FUN_00422eb0(undefined4 *param_1,int param_2,undefined4 *param_3)



{

  undefined4 *puVar1;

  

  *param_1 = 0;

  param_1[1] = 0;

  param_1[2] = 0;

  if (param_2 == 0) {

    puVar1 = (undefined4 *)0x0;

  }

  else if ((uint)(param_2 * 4) < 0x81) {

    puVar1 = (undefined4 *)FUN_004050d0(param_2 * 4);

  }

  else {

    puVar1 = (undefined4 *)FUN_005df0f5();

  }

  *param_1 = puVar1;

  param_1[1] = puVar1;

  param_1[2] = puVar1 + param_2;

  for (; param_2 != 0; param_2 = param_2 + -1) {

    *puVar1 = *param_3;

    puVar1 = puVar1 + 1;

  }

  param_1[1] = puVar1;

  return param_1;

}





// --- FUN_00422f20 at 0x00422F20 (size: 284) ---


void __thiscall FUN_00422f20(int param_1,undefined4 *param_2,uint param_3,undefined4 *param_4)



{

  undefined4 uVar1;

  undefined4 *_Dst;

  uint uVar2;

  int iVar3;

  size_t _Size;

  undefined4 *puVar4;

  void *_Dst_00;

  

  if (param_3 != 0) {

    if (param_3 <= (uint)(*(int *)(param_1 + 8) - *(int *)(param_1 + 4) >> 2)) {

      uVar1 = *param_4;

      _Dst = *(undefined4 **)(param_1 + 4);

      uVar2 = *(int *)(param_1 + 4) - (int)param_2 >> 2;

      if (uVar2 <= param_3) {

        param_4 = (undefined4 *)(param_3 - uVar2);

        iVar3 = (int)param_4;

        puVar4 = _Dst;

        if (param_4 != (undefined4 *)0x0) {

          for (; iVar3 != 0; iVar3 = iVar3 + -1) {

            *puVar4 = uVar1;

            puVar4 = puVar4 + 1;

          }

        }

        _Dst_00 = (void *)(*(int *)(param_1 + 4) + (int)param_4 * 4);

        *(void **)(param_1 + 4) = _Dst_00;

        param_3 = uVar1;

        if (_Dst != param_2) {

          memmove(_Dst_00,param_2,(int)_Dst - (int)param_2);

        }

        *(uint *)(param_1 + 4) = *(int *)(param_1 + 4) + uVar2 * 4;

        FUN_00422d00(param_2,_Dst,&param_3);

        return;

      }

      param_4 = (undefined4 *)(param_3 * 4);

      puVar4 = _Dst + -param_3;

      param_3 = uVar1;

      if (_Dst != puVar4) {

        memmove(_Dst,puVar4,(int)_Dst - (int)puVar4);

      }

      _Size = (int)puVar4 - (int)param_2;

      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + (int)param_4;

      if (0 < (int)_Size) {

        memmove((void *)((int)_Dst - _Size),param_2,_Size);

      }

      FUN_00422d00(param_2,(int)param_4 + (int)param_2,&param_3);

      return;

    }

    FUN_004052a0(param_2,param_4,&param_4,param_3,0);

  }

  return;

}





// --- FUN_00423040 at 0x00423040 (size: 205) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void __fastcall FUN_00423040(int param_1)



{

  undefined4 *puVar1;

  undefined4 *puVar2;

  LONG LVar3;

  undefined4 *puVar4;

  uint local_8;

  

  local_8 = 0;

  if (*(int *)(param_1 + 8) - *(int *)(param_1 + 4) >> 2 != 0) {

    do {

      puVar1 = *(undefined4 **)(*(int *)(param_1 + 4) + local_8 * 4);

      while (puVar2 = puVar1, puVar2 != (undefined4 *)0x0) {

        puVar1 = (undefined4 *)*puVar2;

        puVar4 = (undefined4 *)(puVar2[2] + -0x14);

        LVar3 = InterlockedDecrement((LONG *)(puVar2[2] + -0x10));

        if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

          (**(code **)*puVar4)(1);

        }

        puVar4 = (undefined4 *)(puVar2[1] + -0x14);

        LVar3 = InterlockedDecrement((LONG *)(puVar2[1] + -0x10));

        if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

          (**(code **)*puVar4)(1);

        }

        FUN_00404d90(&DAT_008376c0);

        *puVar2 = DAT_008376cc;

        _DAT_008376c0 = 0;

        DAT_008376cc = puVar2;

      }

      *(undefined4 *)(*(int *)(param_1 + 4) + local_8 * 4) = 0;

      local_8 = local_8 + 1;

    } while (local_8 < (uint)(*(int *)(param_1 + 8) - *(int *)(param_1 + 4) >> 2));

  }

  *(undefined4 *)(param_1 + 0x10) = 0;

  return;

}





// --- FUN_00423110 at 0x00423110 (size: 271) ---


void __thiscall FUN_00423110(int param_1,uint param_2)



{

  undefined4 *puVar1;

  int iVar2;

  int iVar3;

  uint *puVar4;

  uint uVar5;

  uint uVar6;

  undefined4 local_14;

  uint local_10;

  int local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  uVar6 = *(int *)(param_1 + 8) - *(int *)(param_1 + 4) >> 2;

  if (uVar6 < param_2) {

    uVar5 = 0;

    local_10 = uVar6;

    puVar4 = (uint *)FUN_00422d20(&DAT_00796b78,"config/ProjectSettings.xml",&param_2,param_2,0);

    if (puVar4 == (uint *)"config/ProjectSettings.xml") {

      param_2 = 0xfffffffb;

    }

    else {

      param_2 = *puVar4;

    }

    if (uVar6 < param_2) {

      local_14 = 0;

      FUN_00422eb0(param_2,&local_14,&param_2);

      if (uVar6 != 0) {

        do {

          puVar1 = *(undefined4 **)(*(int *)(param_1 + 4) + uVar5 * 4);

          while (puVar1 != (undefined4 *)0x0) {

            iVar2 = puVar1[1];

            uVar6 = *(uint *)(iVar2 + -8);

            if (uVar6 == 0xffffffff) {

              uVar6 = FUN_004016b0(iVar2);

              *(uint *)(iVar2 + -8) = uVar6;

            }

            *(undefined4 *)(*(int *)(param_1 + 4) + uVar5 * 4) = *puVar1;

            *puVar1 = *(undefined4 *)(local_c + (uVar6 % param_2) * 4);

            *(undefined4 **)(local_c + (uVar6 % param_2) * 4) = puVar1;

            uVar6 = local_10;

            puVar1 = *(undefined4 **)(*(int *)(param_1 + 4) + uVar5 * 4);

          }

          uVar5 = uVar5 + 1;

        } while (uVar5 < uVar6);

      }

      iVar2 = *(int *)(param_1 + 4);

      *(int *)(param_1 + 4) = local_c;

      *(undefined4 *)(param_1 + 8) = local_8;

      iVar3 = *(int *)(param_1 + 0xc);

      *(undefined4 *)(param_1 + 0xc) = local_4;

      if (iVar2 != 0) {

        FUN_004051c0(iVar2,(iVar3 - iVar2 >> 2) << 2);

      }

    }

  }

  return;

}





// --- FUN_00423220 at 0x00423220 (size: 162) ---


int * __thiscall FUN_00423220(int param_1,int *param_2)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  undefined4 uVar5;

  uint uVar6;

  undefined4 *puVar7;

  

  FUN_00423110(*(int *)(param_1 + 0x10) + 1);

  iVar2 = *(int *)(param_1 + 4);

  iVar3 = *(int *)(param_1 + 8);

  iVar4 = *param_2;

  uVar6 = *(uint *)(iVar4 + -8);

  if (uVar6 == 0xffffffff) {

    uVar6 = FUN_004016b0(iVar4);

    *(uint *)(iVar4 + -8) = uVar6;

  }

  uVar6 = uVar6 % (uint)(iVar3 - iVar2 >> 2);

  uVar5 = *(undefined4 *)(*(int *)(param_1 + 4) + uVar6 * 4);

  puVar7 = (undefined4 *)FUN_004050d0(0xc);

  piVar1 = puVar7 + 1;

  *puVar7 = 0;

  if (piVar1 != (int *)0x0) {

    iVar2 = *param_2;

    *piVar1 = iVar2;

    InterlockedIncrement((LONG *)(iVar2 + -0x10));

    iVar2 = param_2[1];

    puVar7[2] = iVar2;

    InterlockedIncrement((LONG *)(iVar2 + -0x10));

  }

  *puVar7 = uVar5;

  *(undefined4 **)(*(int *)(param_1 + 4) + uVar6 * 4) = puVar7;

  *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;

  return piVar1;

}





// --- FUN_004232d0 at 0x004232D0 (size: 229) ---


int FUN_004232d0(int *param_1)



{

  LONG *lpAddend;

  undefined *puVar1;

  int *piVar2;

  int iVar3;

  LONG LVar4;

  int iVar5;

  undefined4 *puVar6;

  bool bVar7;

  int local_8;

  undefined *local_4;

  

  piVar2 = param_1;

  iVar3 = FUN_00422d60(param_1);

  puVar1 = PTR_DAT_00818344;

  bVar7 = iVar3 != 0;

  if (bVar7) {

    iVar3 = iVar3 + 8;

    iVar5 = local_8;

  }

  else {

    lpAddend = (LONG *)(PTR_DAT_00818344 + -0x10);

    param_1 = (int *)PTR_DAT_00818344;

    InterlockedIncrement(lpAddend);

    iVar5 = *piVar2;

    local_8 = iVar5;

    InterlockedIncrement((LONG *)(iVar5 + -0x10));

    local_4 = puVar1;

    InterlockedIncrement(lpAddend);

    iVar3 = FUN_00423220(&local_8);

    iVar3 = iVar3 + 4;

  }

  if (!bVar7) {

    puVar6 = (undefined4 *)(local_4 + -0x14);

    LVar4 = InterlockedDecrement((LONG *)(local_4 + -0x10));

    if ((LVar4 == 0) && (puVar6 != (undefined4 *)0x0)) {

      (**(code **)*puVar6)(1);

    }

    LVar4 = InterlockedDecrement((LONG *)(iVar5 + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(iVar5 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(iVar5 + -0x14))(1);

    }

  }

  if (!bVar7) {

    LVar4 = InterlockedDecrement(param_1 + -4);

    if ((LVar4 == 0) && (param_1 + -5 != (int *)0x0)) {

      (**(code **)param_1[-5])(1);

    }

  }

  return iVar3;

}





// --- FUN_004233c0 at 0x004233C0 (size: 106) ---


void __thiscall FUN_004233c0(int param_1,undefined4 param_2)



{

  char *pcVar1;

  undefined4 uVar2;

  

  pcVar1 = (char *)FUN_00422d20(&DAT_00796b78,"config/ProjectSettings.xml",&param_2,param_2,0);

  uVar2 = 0xfffffffb;

  if (pcVar1 != "config/ProjectSettings.xml") {

    uVar2 = *(undefined4 *)pcVar1;

  }

  FUN_00422e10(uVar2);

  param_2 = 0;

  FUN_00422f20(*(undefined4 *)(param_1 + 8),uVar2,&param_2);

  *(undefined4 *)(param_1 + 0x10) = 0;

  return;

}





// --- FUN_00423430 at 0x00423430 (size: 109) ---


int * FUN_00423430(int *param_1,undefined4 param_2)



{

  LONG LVar1;

  int *piVar2;

  int local_4;

  

  piVar2 = &local_4;

  FUN_004232d0(&DAT_00837ce4);

  FUN_0040bbc0(piVar2,param_2);

  thunk_FUN_0040da10(&local_4,0);

  *param_1 = local_4;

  InterlockedIncrement((LONG *)(local_4 + -0x10));

  LVar1 = InterlockedDecrement((LONG *)(local_4 + -0x10));

  if ((LVar1 == 0) && ((undefined4 *)(local_4 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(local_4 + -0x14))(1);

  }

  return param_1;

}





// --- FUN_004234a0 at 0x004234A0 (size: 8) ---


void FUN_004234a0(void)



{

  FUN_0041af60();

  return;

}





// --- FUN_004234b0 at 0x004234B0 (size: 18) ---


int __fastcall FUN_004234b0(undefined4 *param_1)



{

  int iVar1;

  

  iVar1 = param_1[1] + -1;

  param_1[1] = iVar1;

  if (iVar1 == 0) {

    (**(code **)*param_1)(1);

    iVar1 = 0;

  }

  return iVar1;

}





// --- FUN_004234d0 at 0x004234D0 (size: 53) ---


void __fastcall FUN_004234d0(int *param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  

  puVar2 = (undefined4 *)*param_1;

  if (puVar2 != (undefined4 *)0x0) {

    piVar1 = puVar2 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar2)(1);

    }

    *param_1 = 0;

  }

  puVar2 = (undefined4 *)param_1[1];

  if (puVar2 != (undefined4 *)0x0) {

    piVar1 = puVar2 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar2)(1);

    }

    param_1[1] = 0;

  }

  return;

}





// --- FUN_00423550 at 0x00423550 (size: 52) ---


uint __thiscall FUN_00423550(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0xe0))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00423590 at 0x00423590 (size: 54) ---


uint __thiscall FUN_00423590(int param_1,int *param_2)



{

  uint uVar1;

  uint unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if ((char)uVar1 != '\0') {

    uVar1 = *(uint *)(param_1 + 8);

    *(bool *)param_2 = uVar1 < unaff_retaddr;

    return CONCAT31((int3)(uVar1 >> 8),1);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_004235d0 at 0x004235D0 (size: 40) ---


void __thiscall FUN_004235d0(int param_1,int *param_2)



{

  char cVar1;

  uint unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if (cVar1 != '\0') {

    *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) & unaff_retaddr;

  }

  return;

}





// --- FUN_00423600 at 0x00423600 (size: 40) ---


void __thiscall FUN_00423600(int param_1,int *param_2)



{

  char cVar1;

  uint unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if (cVar1 != '\0') {

    *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) | unaff_retaddr;

  }

  return;

}





// --- FUN_00423630 at 0x00423630 (size: 40) ---


void __thiscall FUN_00423630(int param_1,int *param_2)



{

  char cVar1;

  uint unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if (cVar1 != '\0') {

    *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) ^ unaff_retaddr;

  }

  return;

}





// --- FUN_00423660 at 0x00423660 (size: 48) ---


uint __thiscall FUN_00423660(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) != unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00423690 at 0x00423690 (size: 48) ---


uint __thiscall FUN_00423690(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_004236c0 at 0x004236C0 (size: 50) ---


uint __thiscall FUN_004236c0(int param_1,int *param_2)



{

  uint uVar1;

  uint unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)((*(uint *)(param_1 + 8) & unaff_retaddr) == unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00423700 at 0x00423700 (size: 42) ---


void __thiscall FUN_00423700(int param_1,int *param_2)



{

  char cVar1;

  uint unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0xe0))(&param_2);

  if (cVar1 != '\0') {

    *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) & ~unaff_retaddr;

  }

  return;

}





// --- FUN_00423b30 at 0x00423B30 (size: 49) ---


uint __thiscall FUN_00423b30(int param_1,int *param_2)



{

  uint in_EAX;

  char unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0x70))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(char *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00423b70 at 0x00423B70 (size: 51) ---


undefined4 __thiscall FUN_00423b70(int param_1,int *param_2)



{

  char cVar1;

  byte unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x70))(&param_2);

  if (cVar1 != '\0') {

    *(bool *)param_2 = *(byte *)(param_1 + 8) < unaff_retaddr;

    return 1;

  }

  return 0;

}





// --- FUN_00423bb0 at 0x00423BB0 (size: 45) ---


uint __thiscall FUN_00423bb0(int param_1,int *param_2)



{

  uint uVar1;

  char unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x70))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(char *)(param_1 + 8) != unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00423be0 at 0x00423BE0 (size: 45) ---


uint __thiscall FUN_00423be0(int param_1,int *param_2)



{

  uint uVar1;

  char unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x70))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(char *)(param_1 + 8) == unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00423c10 at 0x00423C10 (size: 37) ---


void __thiscall FUN_00423c10(int param_1,int *param_2)



{

  char cVar1;

  byte unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x70))(&param_2);

  if (cVar1 != '\0') {

    *(byte *)(param_1 + 8) = *(byte *)(param_1 + 8) & unaff_retaddr;

  }

  return;

}





// --- FUN_00423c40 at 0x00423C40 (size: 37) ---


void __thiscall FUN_00423c40(int param_1,int *param_2)



{

  char cVar1;

  byte unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x70))(&param_2);

  if (cVar1 != '\0') {

    *(byte *)(param_1 + 8) = *(byte *)(param_1 + 8) | unaff_retaddr;

  }

  return;

}





// --- FUN_00423c70 at 0x00423C70 (size: 37) ---


void __thiscall FUN_00423c70(int param_1,int *param_2)



{

  char cVar1;

  byte unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x70))(&param_2);

  if (cVar1 != '\0') {

    *(byte *)(param_1 + 8) = *(byte *)(param_1 + 8) ^ unaff_retaddr;

  }

  return;

}





// --- FUN_00423d30 at 0x00423D30 (size: 66) ---


void __thiscall FUN_00423d30(int param_1,undefined1 param_2)



{

  undefined4 *puVar1;

  

  if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

    (**(code **)**(undefined4 **)(param_1 + 8))(1);

  }

  *(undefined4 *)(param_1 + 8) = 0;

  puVar1 = (undefined4 *)FUN_005df0f5(8);

  if (puVar1 != (undefined4 *)0x0) {

    *puVar1 = &PTR_FUN_00797010;

    *(undefined1 *)(puVar1 + 1) = param_2;

    *(undefined4 **)(param_1 + 8) = puVar1;

    return;

  }

  *(undefined4 *)(param_1 + 8) = 0;

  return;

}





// --- FUN_00423db0 at 0x00423DB0 (size: 54) ---


void __fastcall FUN_00423db0(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_LAB_00797048;

  param_1[2] = DAT_00818874;

  param_1[3] = DAT_00818878;

  param_1[4] = DAT_0081887c;

  param_1[5] = DAT_00818880;

  return;

}





// --- FUN_00423e60 at 0x00423E60 (size: 34) ---


undefined4 __thiscall FUN_00423e60(int param_1,undefined4 *param_2)



{

  undefined4 uVar1;

  

  *(undefined4 *)(param_1 + 8) = *param_2;

  *(undefined4 *)(param_1 + 0xc) = param_2[1];

  *(undefined4 *)(param_1 + 0x10) = param_2[2];

  uVar1 = param_2[3];

  *(undefined4 *)(param_1 + 0x14) = uVar1;

  return CONCAT31((int3)((uint)uVar1 >> 8),1);

}





// --- FUN_00423f00 at 0x00423F00 (size: 60) ---


uint FUN_00423f00(int *param_1)



{

  uint in_EAX;

  uint uVar1;

  undefined1 local_10 [16];

  

  if (param_1 != (int *)0x0) {

    in_EAX = (**(code **)(*param_1 + 0x98))(local_10);

    if ((char)in_EAX != '\0') {

      uVar1 = FUN_00423f40(&stack0xffffffec);

      return uVar1;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00423f40 at 0x00423F40 (size: 99) ---


undefined4 __thiscall FUN_00423f40(float *param_1,float *param_2)



{

  if ((((ABS(*param_1 - *param_2) < DAT_00796c48 != (ABS(*param_1 - *param_2) == DAT_00796c48)) &&

       (ABS(param_1[1] - param_2[1]) < DAT_00796c48 !=

        (ABS(param_1[1] - param_2[1]) == DAT_00796c48))) &&

      (ABS(param_1[2] - param_2[2]) < DAT_00796c48 != (ABS(param_1[2] - param_2[2]) == DAT_00796c48)

      )) && (ABS(param_1[3] - param_2[3]) < DAT_00796c48 !=

             (ABS(param_1[3] - param_2[3]) == DAT_00796c48))) {

    return 1;

  }

  return 0;

}





// --- FUN_00424000 at 0x00424000 (size: 79) ---


uint FUN_00424000(void)



{

  int iVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  

  iVar1 = FUN_005df4c4();

  uVar2 = FUN_005df4c4();

  uVar3 = FUN_005df4c4();

  uVar4 = FUN_005df4c4();

  return uVar4 | ((iVar1 << 8 | uVar2) << 8 | uVar3) << 8;

}





// --- FUN_004240c0 at 0x004240C0 (size: 48) ---


uint __thiscall FUN_004240c0(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0xb0))(&param_2);

    if ((char)in_EAX != '\0') {

      return CONCAT31((int3)((uint)*(int *)(param_1 + 8) >> 8),

                      *(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_004240f0 at 0x004240F0 (size: 44) ---


uint __thiscall FUN_004240f0(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xb0))(&param_2);

  if ((char)uVar1 != '\0') {

    return CONCAT31((int3)((uint)*(int *)(param_1 + 8) >> 8),*(int *)(param_1 + 8) != unaff_retaddr)

    ;

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424120 at 0x00424120 (size: 44) ---


uint __thiscall FUN_00424120(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xb0))(&param_2);

  if ((char)uVar1 != '\0') {

    return CONCAT31((int3)((uint)*(int *)(param_1 + 8) >> 8),*(int *)(param_1 + 8) == unaff_retaddr)

    ;

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424150 at 0x00424150 (size: 11) ---


bool __fastcall FUN_00424150(int param_1)



{

  return *(int *)(param_1 + 8) != 0;

}





// --- FUN_00424180 at 0x00424180 (size: 52) ---


uint __thiscall FUN_00424180(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0xa8))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_004241c0 at 0x004241C0 (size: 48) ---


uint __thiscall FUN_004241c0(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xa8))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) != unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_004241f0 at 0x004241F0 (size: 48) ---


uint __thiscall FUN_004241f0(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0xa8))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424270 at 0x00424270 (size: 73) ---


uint __thiscall FUN_00424270(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (*(float *)(param_1 + 8) < unaff_retaddr) {

    *(undefined1 *)param_2 = 1;

    return 1;

  }

  *(undefined1 *)param_2 = 0;

  return 1;

}





// --- FUN_004242c0 at 0x004242C0 (size: 38) ---


void __thiscall FUN_004242c0(int param_1,int *param_2)



{

  char cVar1;

  float unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if (cVar1 != '\0') {

    *(float *)(param_1 + 8) = unaff_retaddr + *(float *)(param_1 + 8);

  }

  return;

}





// --- FUN_004242f0 at 0x004242F0 (size: 38) ---


void __thiscall FUN_004242f0(int param_1,int *param_2)



{

  char cVar1;

  float unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if (cVar1 != '\0') {

    *(float *)(param_1 + 8) = *(float *)(param_1 + 8) - unaff_retaddr;

  }

  return;

}





// --- FUN_00424320 at 0x00424320 (size: 38) ---


void __thiscall FUN_00424320(int param_1,int *param_2)



{

  char cVar1;

  float unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if (cVar1 != '\0') {

    *(float *)(param_1 + 8) = unaff_retaddr * *(float *)(param_1 + 8);

  }

  return;

}





// --- FUN_00424350 at 0x00424350 (size: 38) ---


void __thiscall FUN_00424350(int param_1,int *param_2)



{

  char cVar1;

  float unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if (cVar1 != '\0') {

    *(float *)(param_1 + 8) = *(float *)(param_1 + 8) / unaff_retaddr;

  }

  return;

}





// --- FUN_00424380 at 0x00424380 (size: 59) ---


uint __thiscall FUN_00424380(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (unaff_retaddr < *(float *)(param_1 + 8)) {

    return 1;

  }

  return 0;

}





// --- FUN_004243c0 at 0x004243C0 (size: 59) ---


uint __thiscall FUN_004243c0(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (unaff_retaddr <= *(float *)(param_1 + 8)) {

    return 1;

  }

  return 0;

}





// --- FUN_00424400 at 0x00424400 (size: 59) ---


uint __thiscall FUN_00424400(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (*(float *)(param_1 + 8) < unaff_retaddr) {

    return 1;

  }

  return 0;

}





// --- FUN_00424440 at 0x00424440 (size: 59) ---


uint __thiscall FUN_00424440(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (*(float *)(param_1 + 8) < unaff_retaddr != (*(float *)(param_1 + 8) == unaff_retaddr)) {

    return 1;

  }

  return 0;

}





// --- FUN_00424480 at 0x00424480 (size: 59) ---


uint __thiscall FUN_00424480(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (*(float *)(param_1 + 8) != unaff_retaddr) {

    return 1;

  }

  return 0;

}





// --- FUN_004244c0 at 0x004244C0 (size: 59) ---


uint __thiscall FUN_004244c0(int param_1,int *param_2)



{

  uint uVar1;

  float unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x88))(&param_2);

  if ((char)uVar1 == '\0') {

    return uVar1 & 0xffffff00;

  }

  if (*(float *)(param_1 + 8) == unaff_retaddr) {

    return 1;

  }

  return 0;

}





// --- FUN_00424570 at 0x00424570 (size: 71) ---


uint __thiscall FUN_00424570(int param_1,int *param_2)



{

  float fVar1;

  uint in_EAX;

  float unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0x88))(&param_2);

    if ((char)in_EAX != '\0') {

      fVar1 = ABS(*(float *)(param_1 + 8) - unaff_retaddr);

      if (fVar1 < DAT_00796c48 != (fVar1 == DAT_00796c48)) {

        return 1;

      }

      return 0;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_004245e0 at 0x004245E0 (size: 52) ---


uint __thiscall FUN_004245e0(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 200))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00424670 at 0x00424670 (size: 49) ---


uint __thiscall FUN_00424670(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0x78))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_004246b0 at 0x004246B0 (size: 51) ---


uint __thiscall FUN_004246b0(int param_1,int *param_2)



{

  int iVar1;

  uint uVar2;

  int unaff_retaddr;

  

  uVar2 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar2 != '\0') {

    iVar1 = *(int *)(param_1 + 8);

    *(bool *)param_2 = iVar1 < unaff_retaddr;

    return CONCAT31((int3)((uint)iVar1 >> 8),1);

  }

  return uVar2 & 0xffffff00;

}





// --- FUN_004246f0 at 0x004246F0 (size: 37) ---


void __thiscall FUN_004246f0(int param_1,int *param_2)



{

  char cVar1;

  int unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if (cVar1 != '\0') {

    *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + unaff_retaddr;

  }

  return;

}





// --- FUN_00424720 at 0x00424720 (size: 37) ---


void __thiscall FUN_00424720(int param_1,int *param_2)



{

  char cVar1;

  int unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if (cVar1 != '\0') {

    *(int *)(param_1 + 8) = *(int *)(param_1 + 8) - unaff_retaddr;

  }

  return;

}





// --- FUN_00424750 at 0x00424750 (size: 36) ---


void __thiscall FUN_00424750(int param_1,int *param_2)



{

  char cVar1;

  int unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if (cVar1 != '\0') {

    *(int *)(param_1 + 8) = *(int *)(param_1 + 8) * unaff_retaddr;

  }

  return;

}





// --- FUN_00424780 at 0x00424780 (size: 36) ---


void __thiscall FUN_00424780(int param_1,int *param_2)



{

  char cVar1;

  int unaff_retaddr;

  

  cVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if (cVar1 != '\0') {

    *(int *)(param_1 + 8) = *(int *)(param_1 + 8) / unaff_retaddr;

  }

  return;

}





// --- FUN_004247b0 at 0x004247B0 (size: 45) ---


uint __thiscall FUN_004247b0(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(unaff_retaddr < *(int *)(param_1 + 8));

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_004247e0 at 0x004247E0 (size: 45) ---


uint __thiscall FUN_004247e0(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(unaff_retaddr <= *(int *)(param_1 + 8));

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424810 at 0x00424810 (size: 45) ---


uint __thiscall FUN_00424810(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) < unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424840 at 0x00424840 (size: 45) ---


uint __thiscall FUN_00424840(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) <= unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424870 at 0x00424870 (size: 45) ---


uint __thiscall FUN_00424870(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) != unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_004248a0 at 0x004248A0 (size: 45) ---


uint __thiscall FUN_004248a0(int param_1,int *param_2)



{

  uint uVar1;

  int unaff_retaddr;

  

  uVar1 = (**(code **)(*param_2 + 0x78))(&param_2);

  if ((char)uVar1 != '\0') {

    return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424ce0 at 0x00424CE0 (size: 38) ---


undefined4 * __fastcall FUN_00424ce0(undefined4 *param_1)



{

  *param_1 = 0x3f800000;

  param_1[1] = 0;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[0xd] = 0;

  param_1[0xe] = 0;

  param_1[0xf] = 0;

  FUN_00535b30();

  return param_1;

}





// --- FUN_00424d10 at 0x00424D10 (size: 50) ---


undefined4 * __fastcall FUN_00424d10(undefined4 *param_1)



{

  *param_1 = &PTR_LAB_00797910;

  param_1[1] = 0;

  param_1[2] = 0x3f800000;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[5] = 0;

  param_1[0xf] = 0;

  param_1[0x10] = 0;

  param_1[0x11] = 0;

  FUN_00535b30();

  return param_1;

}





// --- FUN_00424d50 at 0x00424D50 (size: 64) ---


undefined4 * __fastcall FUN_00424d50(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_LAB_00797928;

  param_1[2] = &PTR_LAB_00797910;

  param_1[3] = 0;

  param_1[4] = 0x3f800000;

  param_1[5] = 0;

  param_1[6] = 0;

  param_1[7] = 0;

  param_1[0x11] = 0;

  param_1[0x12] = 0;

  param_1[0x13] = 0;

  FUN_00535b30();

  return param_1;

}





// --- FUN_00424dd0 at 0x00424DD0 (size: 178) ---


uint __thiscall FUN_00424dd0(int param_1,int *param_2)



{

  uint uVar1;

  int iVar2;

  undefined **local_48;

  undefined4 local_44;

  undefined4 local_40;

  undefined4 local_3c;

  undefined4 local_38;

  undefined4 local_34;

  undefined4 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  local_48 = &PTR_LAB_00797910;

  local_44 = 0;

  local_40 = 0x3f800000;

  local_3c = 0;

  local_38 = 0;

  local_34 = 0;

  local_c = 0;

  local_8 = 0;

  local_4 = 0;

  uVar1 = FUN_00535b30();

  if (param_2 != (int *)0x0) {

    uVar1 = (**(code **)(*param_2 + 0xd0))(&local_48);

    if ((char)uVar1 != '\0') {

      if (*(undefined ***)(param_1 + 0xc) == local_48) {

        iVar2 = FUN_00424e90(&local_44);

        if (iVar2 != 0) {

          return 1;

        }

      }

      return 0;

    }

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00424e90 at 0x00424E90 (size: 63) ---


undefined4 __thiscall FUN_00424e90(int param_1,int param_2)



{

  char cVar1;

  int iVar2;

  

  cVar1 = FUN_00424f40(param_1 + 0x34,param_2 + 0x34,DAT_00796c48);

  if (cVar1 != '\0') {

    iVar2 = FUN_00424ed0(param_2);

    if (iVar2 != 0) {

      return 1;

    }

  }

  return 0;

}





// --- FUN_00424ed0 at 0x00424ED0 (size: 107) ---


undefined4 __thiscall FUN_00424ed0(float *param_1,float *param_2)



{

  if ((((ABS(*param_1 - *param_2) < DAT_00796c48) && (ABS(param_1[1] - param_2[1]) < DAT_00796c48))

      && (ABS(param_1[2] - param_2[2]) < DAT_00796c48)) &&

     (ABS(param_1[3] - param_2[3]) < DAT_00796c48)) {

    return 1;

  }

  return 0;

}





// --- FUN_00424f40 at 0x00424F40 (size: 72) ---


undefined4 FUN_00424f40(float *param_1,float *param_2,float param_3)



{

  if (((ABS(*param_1 - *param_2) < param_3 != (ABS(*param_1 - *param_2) == param_3)) &&

      (ABS(param_1[1] - param_2[1]) < param_3 != (ABS(param_1[1] - param_2[1]) == param_3))) &&

     (ABS(param_1[2] - param_2[2]) < param_3 != (ABS(param_1[2] - param_2[2]) == param_3))) {

    return 1;

  }

  return 0;

}





// --- FUN_00424fc0 at 0x00424FC0 (size: 28) ---


undefined4 * __fastcall FUN_00424fc0(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_00797a68;

  FUN_0042dc80();

  return param_1;

}





// --- FUN_00425170 at 0x00425170 (size: 45) ---


undefined4 * __thiscall FUN_00425170(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00797a68;

  FUN_0042e590();

  *param_1 = &PTR_LAB_00796c4c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_004251c0 at 0x004251C0 (size: 52) ---


uint __thiscall FUN_004251c0(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0x138))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00425200 at 0x00425200 (size: 54) ---


uint __thiscall FUN_00425200(int param_1,int *param_2)



{

  int iVar1;

  uint uVar2;

  int unaff_retaddr;

  

  uVar2 = (**(code **)(*param_2 + 0x138))(&param_2);

  if ((char)uVar2 != '\0') {

    iVar1 = *(int *)(param_1 + 8);

    *(bool *)param_2 = iVar1 < unaff_retaddr;

    return CONCAT31((int3)((uint)iVar1 >> 8),1);

  }

  return uVar2 & 0xffffff00;

}





// --- FUN_00425270 at 0x00425270 (size: 34) ---


void __fastcall FUN_00425270(undefined4 *param_1)



{

  undefined4 uVar1;

  undefined4 uVar2;

  

  uVar2 = DAT_00796c44;

  uVar1 = DAT_00796c40;

  param_1[1] = 1;

  *param_1 = &PTR_LAB_00797ce8;

  param_1[2] = uVar1;

  param_1[3] = uVar2;

  return;

}





// --- FUN_00425410 at 0x00425410 (size: 73) ---


void __thiscall FUN_00425410(int param_1,undefined4 param_2,undefined4 param_3)



{

  undefined4 *puVar1;

  

  if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

    (**(code **)**(undefined4 **)(param_1 + 8))(1);

  }

  *(undefined4 *)(param_1 + 8) = 0;

  puVar1 = (undefined4 *)FUN_005df0f5(0x10);

  if (puVar1 != (undefined4 *)0x0) {

    *puVar1 = &PTR_FUN_00797e28;

    puVar1[2] = param_2;

    puVar1[3] = param_3;

    *(undefined4 **)(param_1 + 8) = puVar1;

    return;

  }

  *(undefined4 *)(param_1 + 8) = 0;

  return;

}





// --- FUN_004254b0 at 0x004254B0 (size: 61) ---


void FUN_004254b0(undefined4 *param_1,int param_2)



{

  undefined4 *puVar1;

  

  FUN_0040ad10(8);

  puVar1 = (undefined4 *)FUN_0040acf0(8);

  if (puVar1 != (undefined4 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) != 0) {

      *puVar1 = *param_1;

      puVar1[1] = param_1[1];

      return;

    }

    *param_1 = *puVar1;

    param_1[1] = puVar1[1];

  }

  return;

}





// --- FUN_004254f0 at 0x004254F0 (size: 43) ---


void __fastcall FUN_004254f0(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_LAB_00797e48;

  param_1[2] = DAT_00837d6c;

  param_1[3] = DAT_00837d70;

  param_1[4] = DAT_00837d74;

  return;

}





// --- FUN_004256e0 at 0x004256E0 (size: 39) ---


undefined4 * __fastcall FUN_004256e0(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_LAB_00797f88;

  FUN_005b2250();

  FUN_005b1fe0();

  return param_1;

}





// --- FUN_00425710 at 0x00425710 (size: 42) ---


bool FUN_00425710(undefined4 param_1,int *param_2)



{

  char cVar1;

  undefined4 uVar2;

  

  if (param_2 != (int *)0x0) {

    uVar2 = (**(code **)(*param_2 + 0xc))(0);

    cVar1 = FUN_005b2300(uVar2);

    return cVar1 != '\0';

  }

  return false;

}





// --- FUN_00425780 at 0x00425780 (size: 73) ---


void __thiscall FUN_00425780(undefined4 *param_1,undefined4 *param_2)



{

  *param_1 = *param_2;

  param_1[1] = param_2[1];

  param_1[2] = param_2[2];

  param_1[3] = param_2[3];

  param_1[4] = param_2[4];

  param_1[5] = param_2[5];

  param_1[6] = param_2[6];

  param_1[7] = param_2[7];

  param_1[8] = param_2[8];

  param_1[9] = param_2[9];

  param_1[10] = param_2[10];

  return;

}





// --- FUN_004257d0 at 0x004257D0 (size: 74) ---


undefined4 __thiscall FUN_004257d0(int param_1,undefined4 *param_2)



{

  undefined4 uVar1;

  

  *(undefined4 *)(param_1 + 8) = *param_2;

  *(undefined4 *)(param_1 + 0xc) = param_2[1];

  *(undefined4 *)(param_1 + 0x10) = param_2[2];

  *(undefined4 *)(param_1 + 0x14) = param_2[3];

  *(undefined4 *)(param_1 + 0x18) = param_2[4];

  *(undefined4 *)(param_1 + 0x1c) = param_2[5];

  *(undefined4 *)(param_1 + 0x20) = param_2[6];

  *(undefined4 *)(param_1 + 0x24) = param_2[7];

  *(undefined4 *)(param_1 + 0x28) = param_2[8];

  *(undefined4 *)(param_1 + 0x2c) = param_2[9];

  uVar1 = param_2[10];

  *(undefined4 *)(param_1 + 0x30) = uVar1;

  return CONCAT31((int3)((uint)uVar1 >> 8),1);

}





// --- FUN_00425890 at 0x00425890 (size: 253) ---


undefined4 __thiscall FUN_00425890(int *param_1,int *param_2)



{

  if ((((((*param_1 == *param_2) &&

         (ABS((float)param_1[1] - (float)param_2[1]) < DAT_00796c48 !=

          (ABS((float)param_1[1] - (float)param_2[1]) == DAT_00796c48))) &&

        (ABS((float)param_1[2] - (float)param_2[2]) < DAT_00796c48 !=

         (ABS((float)param_1[2] - (float)param_2[2]) == DAT_00796c48))) &&

       ((ABS((float)param_1[3] - (float)param_2[3]) < DAT_00796c48 !=

         (ABS((float)param_1[3] - (float)param_2[3]) == DAT_00796c48) &&

        (ABS((float)param_1[4] - (float)param_2[4]) < DAT_00796c48 !=

         (ABS((float)param_1[4] - (float)param_2[4]) == DAT_00796c48))))) &&

      ((ABS((float)param_1[5] - (float)param_2[5]) < DAT_00796c48 !=

        (ABS((float)param_1[5] - (float)param_2[5]) == DAT_00796c48) &&

       ((ABS((float)param_1[6] - (float)param_2[6]) < DAT_00796c48 !=

         (ABS((float)param_1[6] - (float)param_2[6]) == DAT_00796c48) &&

        (ABS((float)param_1[7] - (float)param_2[7]) < DAT_00796c48 !=

         (ABS((float)param_1[7] - (float)param_2[7]) == DAT_00796c48))))))) &&

     ((ABS((float)param_1[8] - (float)param_2[8]) < DAT_00796c48 !=

       (ABS((float)param_1[8] - (float)param_2[8]) == DAT_00796c48) &&

      ((ABS((float)param_1[9] - (float)param_2[9]) < DAT_00796c48 !=

        (ABS((float)param_1[9] - (float)param_2[9]) == DAT_00796c48) &&

       (ABS((float)param_1[10] - (float)param_2[10]) < DAT_00796c48 !=

        (ABS((float)param_1[10] - (float)param_2[10]) == DAT_00796c48))))))) {

    return 1;

  }

  return 0;

}





// --- FUN_00425a60 at 0x00425A60 (size: 64) ---


undefined4 * __thiscall FUN_00425a60(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_007980c8;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00425aa0 at 0x00425AA0 (size: 64) ---


undefined4 * __thiscall FUN_00425aa0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_007980cc;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00425ae0 at 0x00425AE0 (size: 178) ---


int * __thiscall FUN_00425ae0(int *param_1,byte param_2)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  int *piVar4;

  

  if ((param_2 & 2) == 0) {

    puVar2 = (undefined4 *)*param_1;

    if (puVar2 != (undefined4 *)0x0) {

      piVar4 = puVar2 + 1;

      *piVar4 = *piVar4 + -1;

      if (*piVar4 == 0) {

        (**(code **)*puVar2)(1);

      }

      *param_1 = 0;

    }

    puVar2 = (undefined4 *)param_1[1];

    if (puVar2 != (undefined4 *)0x0) {

      piVar4 = puVar2 + 1;

      *piVar4 = *piVar4 + -1;

      if (*piVar4 == 0) {

        (**(code **)*puVar2)(1);

      }

      param_1[1] = 0;

    }

    if ((param_2 & 1) != 0) {

      operator_delete(param_1);

    }

    return param_1;

  }

  iVar3 = param_1[-1];

  piVar4 = param_1 + iVar3 * 2;

  if (-1 < iVar3 + -1) {

    do {

      puVar2 = (undefined4 *)piVar4[-2];

      if (puVar2 != (undefined4 *)0x0) {

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar2)(1);

        }

        piVar4[-2] = 0;

      }

      puVar2 = (undefined4 *)piVar4[-1];

      if (puVar2 != (undefined4 *)0x0) {

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar2)(1);

        }

        piVar4[-1] = 0;

      }

      iVar3 = iVar3 + -1;

      piVar4 = piVar4 + -2;

    } while (iVar3 != 0);

  }

  if ((param_2 & 1) != 0) {

    operator_delete__(param_1 + -1);

  }

  return param_1 + -1;

}





// --- FUN_00425ba0 at 0x00425BA0 (size: 127) ---


int * __fastcall FUN_00425ba0(int *param_1)



{

  int *piVar1;

  

  *param_1 = 0;

  if (DAT_00837db8 == (int *)0x0) {

    piVar1 = (int *)FUN_00415730(0xf,2,0x2d);

    if (DAT_00837db8 != (int *)0x0) {

      (**(code **)(*DAT_00837db8 + 0x14))();

      DAT_00837db8 = (int *)0x0;

    }

    if (piVar1 != (int *)0x0) {

      DAT_00837db8 = piVar1;

      (**(code **)(*piVar1 + 0x10))();

      (**(code **)(*piVar1 + 0x14))();

    }

    if ((int *)*param_1 != (int *)0x0) {

      (**(code **)(*(int *)*param_1 + 0x14))();

      *param_1 = 0;

    }

    if (DAT_00837db8 == (int *)0x0) {

      return param_1;

    }

  }

  piVar1 = DAT_00837db8;

  *param_1 = (int)DAT_00837db8;

  (**(code **)(*piVar1 + 0x10))();

  return param_1;

}





// --- FUN_00425c50 at 0x00425C50 (size: 66) ---


void __thiscall FUN_00425c50(int param_1,undefined4 param_2)



{

  undefined4 *puVar1;

  

  if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

    (**(code **)**(undefined4 **)(param_1 + 8))(1);

  }

  *(undefined4 *)(param_1 + 8) = 0;

  puVar1 = (undefined4 *)FUN_005df0f5(8);

  if (puVar1 != (undefined4 *)0x0) {

    *puVar1 = &PTR_FUN_007980d0;

    puVar1[1] = param_2;

    *(undefined4 **)(param_1 + 8) = puVar1;

    return;

  }

  *(undefined4 *)(param_1 + 8) = 0;

  return;

}





// --- FUN_00425d00 at 0x00425D00 (size: 66) ---


void __thiscall FUN_00425d00(int param_1,undefined4 param_2)



{

  undefined4 *puVar1;

  

  if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

    (**(code **)**(undefined4 **)(param_1 + 8))(1);

  }

  *(undefined4 *)(param_1 + 8) = 0;

  puVar1 = (undefined4 *)FUN_005df0f5(8);

  if (puVar1 != (undefined4 *)0x0) {

    puVar1[1] = param_2;

    *puVar1 = &PTR_FUN_007980ec;

    *(undefined4 **)(param_1 + 8) = puVar1;

    return;

  }

  *(undefined4 *)(param_1 + 8) = 0;

  return;

}





// --- FUN_00425de0 at 0x00425DE0 (size: 66) ---


void __thiscall FUN_00425de0(int param_1,undefined4 param_2)



{

  undefined4 *puVar1;

  

  if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

    (**(code **)**(undefined4 **)(param_1 + 8))(1);

  }

  *(undefined4 *)(param_1 + 8) = 0;

  puVar1 = (undefined4 *)FUN_005df0f5(8);

  if (puVar1 != (undefined4 *)0x0) {

    *puVar1 = &PTR_FUN_00798124;

    puVar1[1] = param_2;

    *(undefined4 **)(param_1 + 8) = puVar1;

    return;

  }

  *(undefined4 *)(param_1 + 8) = 0;

  return;

}





// --- FUN_00425e60 at 0x00425E60 (size: 31) ---


undefined4 * __thiscall FUN_00425e60(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_0079702c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00425ed0 at 0x00425ED0 (size: 51) ---


undefined4 * __thiscall FUN_00425ed0(undefined4 *param_1,int param_2)



{

  param_1[1] = 1;

  *param_1 = &PTR_LAB_00797928;

  param_1[2] = &PTR_LAB_00797910;

  param_1[3] = *(undefined4 *)(param_2 + 4);

  FUN_00425f10(param_2 + 8);

  return param_1;

}





// --- FUN_00425f10 at 0x00425F10 (size: 111) ---


void __thiscall FUN_00425f10(undefined4 *param_1,undefined4 *param_2)



{

  param_1[0xd] = param_2[0xd];

  param_1[0xe] = param_2[0xe];

  param_1[0xf] = param_2[0xf];

  *param_1 = *param_2;

  param_1[1] = param_2[1];

  param_1[2] = param_2[2];

  param_1[3] = param_2[3];

  param_1[4] = param_2[4];

  param_1[5] = param_2[5];

  param_1[6] = param_2[6];

  param_1[7] = param_2[7];

  param_1[8] = param_2[8];

  param_1[9] = param_2[9];

  param_1[10] = param_2[10];

  param_1[0xb] = param_2[0xb];

  param_1[0xc] = param_2[0xc];

  return;

}





// --- FUN_00426020 at 0x00426020 (size: 195) ---


undefined1 __fastcall FUN_00426020(int param_1)



{

  char cVar1;

  int iVar2;

  int *piVar3;

  LONG LVar4;

  undefined1 uVar5;

  int unaff_ESI;

  int iStack_4;

  

  uVar5 = 0;

  if (*(int **)(param_1 + 8) != (int *)0x0) {

    iStack_4 = param_1;

    iVar2 = (**(code **)(**(int **)(param_1 + 8) + 4))();

    if (iVar2 == 0) {

      FUN_00401700(*(int **)(param_1 + 8) + 1);

      return 1;

    }

    (**(code **)(**(int **)(param_1 + 8) + 0x14))(&iStack_4);

    piVar3 = (int *)FUN_005df0f5(8);

    if (piVar3 == (int *)0x0) {

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_00798140;

      FUN_00401a40();

    }

    cVar1 = (**(code **)(*piVar3 + 0x10))(&stack0xfffffff8);

    if (cVar1 == '\0') {

      (**(code **)*piVar3)(1);

      uVar5 = 0;

    }

    else {

      FUN_00401700(piVar3 + 1);

      if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

        (**(code **)**(undefined4 **)(param_1 + 8))(1);

      }

      *(int **)(param_1 + 8) = piVar3;

      uVar5 = 1;

    }

    LVar4 = InterlockedDecrement((LONG *)(unaff_ESI + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(unaff_ESI + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(unaff_ESI + -0x14))(1);

    }

  }

  return uVar5;

}





// --- FUN_00426120 at 0x00426120 (size: 18) ---


undefined4 FUN_00426120(undefined4 param_1)



{

  FUN_00401700(param_1);

  return 1;

}





// --- FUN_00426160 at 0x00426160 (size: 45) ---


undefined4 * __thiscall FUN_00426160(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798140;

  FUN_004011b0();

  *param_1 = &PTR_FUN_0079702c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_004262b0 at 0x004262B0 (size: 40) ---


undefined4 * __fastcall FUN_004262b0(undefined4 *param_1)



{

  LONG *lpAddend;

  

  param_1[1] = 1;

  *param_1 = &PTR_FUN_00798160;

  lpAddend = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[2] = PTR_DAT_00818344;

  InterlockedIncrement(lpAddend);

  return param_1;

}





// --- FUN_00426360 at 0x00426360 (size: 41) ---


uint __thiscall FUN_00426360(int param_1,undefined4 param_2,int param_3)



{

  uint in_EAX;

  int iVar1;

  uint uVar2;

  

  if (param_3 != 0) {

    iVar1 = FUN_0065ca90();

    in_EAX = 0;

    if (iVar1 != 0) {

      uVar2 = FUN_00426020(param_1 + 8);

      return uVar2;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00426520 at 0x00426520 (size: 119) ---


undefined4 __thiscall FUN_00426520(undefined4 *param_1,undefined4 *param_2)



{

  byte bVar1;

  byte *pbVar2;

  int iVar3;

  byte *pbVar4;

  bool bVar5;

  

  pbVar4 = (byte *)*param_2;

  pbVar2 = (byte *)*param_1;

  if (*(int *)(pbVar2 + -4) == *(int *)(pbVar4 + -4)) {

    if (((*(int *)(pbVar2 + -8) == *(int *)(pbVar4 + -8)) || (*(int *)(pbVar2 + -8) == -1)) ||

       (*(int *)(pbVar4 + -8) == -1)) {

      while( true ) {

        bVar1 = *pbVar2;

        bVar5 = bVar1 < *pbVar4;

        if (bVar1 != *pbVar4) break;

        if (bVar1 == 0) {

          return 0;

        }

        bVar1 = pbVar2[1];

        bVar5 = bVar1 < pbVar4[1];

        if (bVar1 != pbVar4[1]) break;

        pbVar2 = pbVar2 + 2;

        pbVar4 = pbVar4 + 2;

        if (bVar1 == 0) {

          return 0;

        }

      }

      iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);

      return CONCAT31((int3)((uint)iVar3 >> 8),iVar3 != 0);

    }

  }

  return CONCAT31((int3)((uint)pbVar2 >> 8),1);

}





// --- FUN_00426630 at 0x00426630 (size: 45) ---


undefined4 * __thiscall FUN_00426630(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798160;

  FUN_004011b0();

  *param_1 = &PTR_LAB_00796c4c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00426660 at 0x00426660 (size: 47) ---


undefined4 * __fastcall FUN_00426660(undefined4 *param_1)



{

  LONG *lpAddend;

  

  param_1[1] = 1;

  *param_1 = &PTR_FUN_007982a0;

  param_1[2] = 0;

  lpAddend = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[3] = PTR_DAT_00818344;

  InterlockedIncrement(lpAddend);

  return param_1;

}





// --- FUN_004266b0 at 0x004266B0 (size: 52) ---


uint __thiscall FUN_004266b0(int param_1,int *param_2)



{

  uint in_EAX;

  int unaff_retaddr;

  

  if (param_2 != (int *)0x0) {

    in_EAX = (**(code **)(*param_2 + 0x130))(&param_2);

    if ((char)in_EAX != '\0') {

      return (uint)(*(int *)(param_1 + 8) == unaff_retaddr);

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_004266f0 at 0x004266F0 (size: 56) ---


void __thiscall FUN_004266f0(int param_1,int param_2)



{

  undefined4 *puVar1;

  

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

  if (puVar1 != (undefined4 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) != 0) {

      *puVar1 = *(undefined4 *)(param_1 + 8);

      return;

    }

    *(undefined4 *)(param_1 + 8) = *puVar1;

  }

  return;

}





// --- FUN_00426770 at 0x00426770 (size: 60) ---


undefined4 __thiscall FUN_00426770(int param_1,undefined4 param_2,int param_3)



{

  char cVar1;

  int iVar2;

  undefined4 uVar3;

  

  if (param_3 != 0) {

    iVar2 = FUN_0065ca90();

    if (iVar2 != 0) {

      cVar1 = FUN_00426020(param_1 + 0xc);

      if (cVar1 != '\0') {

        uVar3 = FUN_004134b0();

        *(undefined4 *)(param_1 + 8) = uVar3;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_004267b0 at 0x004267B0 (size: 45) ---


undefined4 * __thiscall FUN_004267b0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_007982a0;

  FUN_004011b0();

  *param_1 = &PTR_LAB_00796c4c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_004268d0 at 0x004268D0 (size: 58) ---


undefined1 __thiscall FUN_004268d0(int *param_1,undefined4 param_2,undefined4 param_3)



{

  undefined1 uVar1;

  

  FUN_00425ba0();

  if (param_1 == (int *)0x0) {

    return 0;

  }

  uVar1 = FUN_0041af60(param_2,param_3);

  (**(code **)(*param_1 + 0x14))();

  return uVar1;

}





// --- FUN_00426910 at 0x00426910 (size: 60) ---


undefined1 __thiscall FUN_00426910(int *param_1,undefined4 param_2,undefined4 param_3)



{

  undefined1 uVar1;

  

  FUN_00425ba0();

  if (param_1 == (int *)0x0) {

    return 0;

  }

  uVar1 = FUN_0041b060(10,param_2,param_3);

  (**(code **)(*param_1 + 0x14))();

  return uVar1;

}





// --- FUN_00426950 at 0x00426950 (size: 29) ---


void __fastcall FUN_00426950(int *param_1)



{

  if (((param_1[1] & 0x80000000U) == 0x80000000) && (*param_1 != 0)) {

    FUN_00425ae0(3);

  }

  return;

}





// --- FUN_00426970 at 0x00426970 (size: 27) ---


void __fastcall FUN_00426970(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_007983e0;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  return;

}





// --- FUN_00426990 at 0x00426990 (size: 4) ---


int __fastcall FUN_00426990(int param_1)



{

  return param_1 + 8;

}





// --- FUN_00426b60 at 0x00426B60 (size: 45) ---


undefined4 * __thiscall FUN_00426b60(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_007983e0;

  FUN_00426950();

  *param_1 = &PTR_LAB_00796c4c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00426b90 at 0x00426B90 (size: 41) ---


uint __thiscall FUN_00426b90(int param_1,undefined4 param_2,int param_3)



{

  uint in_EAX;

  int iVar1;

  uint uVar2;

  

  if (param_3 != 0) {

    iVar1 = FUN_0065ca90();

    in_EAX = 0;

    if (iVar1 != 0) {

      uVar2 = FUN_00426bc0(param_1 + 8);

      return uVar2;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00426bc0 at 0x00426BC0 (size: 180) ---


undefined1 __thiscall FUN_00426bc0(undefined1 *param_1,undefined1 *param_2)



{

  char cVar1;

  int iVar2;

  int *piVar3;

  LONG LVar4;

  undefined1 uVar5;

  int unaff_ESI;

  undefined1 *puStack_4;

  

  uVar5 = 0;

  if (*(int **)(param_1 + 8) != (int *)0x0) {

    puStack_4 = param_1;

    iVar2 = (**(code **)(**(int **)(param_1 + 8) + 4))();

    if (iVar2 == 7) {

      *param_2 = (char)(*(int **)(param_1 + 8))[1];

      return 1;

    }

    (**(code **)(**(int **)(param_1 + 8) + 0x14))(&puStack_4);

    piVar3 = (int *)FUN_005df0f5(8);

    if (piVar3 == (int *)0x0) {

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_00797010;

    }

    cVar1 = (**(code **)(*piVar3 + 0x10))(&stack0xfffffff8);

    if (cVar1 == '\0') {

      (**(code **)*piVar3)(1);

      uVar5 = 0;

    }

    else {

      *puStack_4 = (char)piVar3[1];

      if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

        (**(code **)**(undefined4 **)(param_1 + 8))(1);

      }

      *(int **)(param_1 + 8) = piVar3;

      uVar5 = 1;

    }

    LVar4 = InterlockedDecrement((LONG *)(unaff_ESI + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(unaff_ESI + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(unaff_ESI + -0x14))(1);

    }

  }

  return uVar5;

}





// --- FUN_00426c80 at 0x00426C80 (size: 41) ---


uint __thiscall FUN_00426c80(int param_1,undefined4 param_2,int param_3)



{

  uint in_EAX;

  int iVar1;

  uint uVar2;

  

  if (param_3 != 0) {

    iVar1 = FUN_0065ca90();

    in_EAX = 0;

    if (iVar1 != 0) {

      uVar2 = FUN_00426cb0(param_1 + 8);

      return uVar2;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00426cb0 at 0x00426CB0 (size: 180) ---


undefined1 __thiscall FUN_00426cb0(int *param_1,int *param_2)



{

  char cVar1;

  int iVar2;

  int *piVar3;

  LONG LVar4;

  undefined1 uVar5;

  int unaff_ESI;

  int *piStack_4;

  

  uVar5 = 0;

  if ((int *)param_1[2] != (int *)0x0) {

    piStack_4 = param_1;

    iVar2 = (**(code **)(*(int *)param_1[2] + 4))();

    if (iVar2 == 4) {

      *param_2 = ((int *)param_1[2])[1];

      return 1;

    }

    (**(code **)(*(int *)param_1[2] + 0x14))(&piStack_4);

    piVar3 = (int *)FUN_005df0f5(8);

    if (piVar3 == (int *)0x0) {

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_007980d0;

    }

    cVar1 = (**(code **)(*piVar3 + 0x10))(&stack0xfffffff8);

    if (cVar1 == '\0') {

      (**(code **)*piVar3)(1);

      uVar5 = 0;

    }

    else {

      *piStack_4 = piVar3[1];

      if ((undefined4 *)param_1[2] != (undefined4 *)0x0) {

        (*(code *)**(undefined4 **)param_1[2])(1);

      }

      param_1[2] = (int)piVar3;

      uVar5 = 1;

    }

    LVar4 = InterlockedDecrement((LONG *)(unaff_ESI + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(unaff_ESI + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(unaff_ESI + -0x14))(1);

    }

  }

  return uVar5;

}





// --- FUN_00426d70 at 0x00426D70 (size: 41) ---


uint __thiscall FUN_00426d70(int param_1,undefined4 param_2,int param_3)



{

  uint in_EAX;

  int iVar1;

  uint uVar2;

  

  if (param_3 != 0) {

    iVar1 = FUN_0065ca90();

    in_EAX = 0;

    if (iVar1 != 0) {

      uVar2 = FUN_00426da0(param_1 + 8);

      return uVar2;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00426da0 at 0x00426DA0 (size: 180) ---


undefined1 __thiscall FUN_00426da0(int *param_1,int *param_2)



{

  char cVar1;

  int iVar2;

  int *piVar3;

  LONG LVar4;

  undefined1 uVar5;

  int unaff_ESI;

  int *piStack_4;

  

  uVar5 = 0;

  if ((int *)param_1[2] != (int *)0x0) {

    piStack_4 = param_1;

    iVar2 = (**(code **)(*(int *)param_1[2] + 4))();

    if (iVar2 == 8) {

      *param_2 = ((int *)param_1[2])[1];

      return 1;

    }

    (**(code **)(*(int *)param_1[2] + 0x14))(&piStack_4);

    piVar3 = (int *)FUN_005df0f5(8);

    if (piVar3 == (int *)0x0) {

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_007980ec;

    }

    cVar1 = (**(code **)(*piVar3 + 0x10))(&stack0xfffffff8);

    if (cVar1 == '\0') {

      (**(code **)*piVar3)(1);

      uVar5 = 0;

    }

    else {

      *piStack_4 = piVar3[1];

      if ((undefined4 *)param_1[2] != (undefined4 *)0x0) {

        (*(code *)**(undefined4 **)param_1[2])(1);

      }

      param_1[2] = (int)piVar3;

      uVar5 = 1;

    }

    LVar4 = InterlockedDecrement((LONG *)(unaff_ESI + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(unaff_ESI + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(unaff_ESI + -0x14))(1);

    }

  }

  return uVar5;

}





// --- FUN_00426e60 at 0x00426E60 (size: 41) ---


uint __thiscall FUN_00426e60(int param_1,undefined4 param_2,int param_3)



{

  uint in_EAX;

  int iVar1;

  uint uVar2;

  

  if (param_3 != 0) {

    iVar1 = FUN_0065ca90();

    in_EAX = 0;

    if (iVar1 != 0) {

      uVar2 = FUN_00426e90(param_1 + 8);

      return uVar2;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00426e90 at 0x00426E90 (size: 180) ---


undefined1 __thiscall FUN_00426e90(int *param_1,int *param_2)



{

  char cVar1;

  int iVar2;

  int *piVar3;

  LONG LVar4;

  undefined1 uVar5;

  int unaff_ESI;

  int *piStack_4;

  

  uVar5 = 0;

  if ((int *)param_1[2] != (int *)0x0) {

    piStack_4 = param_1;

    iVar2 = (**(code **)(*(int *)param_1[2] + 4))();

    if (iVar2 == 2) {

      *param_2 = ((int *)param_1[2])[1];

      return 1;

    }

    (**(code **)(*(int *)param_1[2] + 0x14))(&piStack_4);

    piVar3 = (int *)FUN_005df0f5(8);

    if (piVar3 == (int *)0x0) {

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_00798124;

    }

    cVar1 = (**(code **)(*piVar3 + 0x10))(&stack0xfffffff8);

    if (cVar1 == '\0') {

      (**(code **)*piVar3)(1);

      uVar5 = 0;

    }

    else {

      *piStack_4 = piVar3[1];

      if ((undefined4 *)param_1[2] != (undefined4 *)0x0) {

        (*(code *)**(undefined4 **)param_1[2])(1);

      }

      param_1[2] = (int)piVar3;

      uVar5 = 1;

    }

    LVar4 = InterlockedDecrement((LONG *)(unaff_ESI + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(unaff_ESI + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(unaff_ESI + -0x14))(1);

    }

  }

  return uVar5;

}





// --- FUN_00426f50 at 0x00426F50 (size: 49) ---


bool __thiscall FUN_00426f50(int param_1,undefined4 param_2,int param_3)



{

  int iVar1;

  

  if (param_3 != 0) {

    iVar1 = *(int *)(param_1 + 8);

    InterlockedIncrement((LONG *)(iVar1 + -0x10));

    iVar1 = FUN_00426f90(iVar1);

    return iVar1 != 0;

  }

  return false;

}





// --- FUN_00426f90 at 0x00426F90 (size: 68) ---


undefined4 FUN_00426f90(int param_1)



{

  undefined4 uVar1;

  LONG LVar2;

  int iVar3;

  

  iVar3 = param_1;

  InterlockedIncrement((LONG *)(param_1 + -0x10));

  uVar1 = FUN_00426fe0(iVar3);

  LVar2 = InterlockedDecrement((LONG *)(param_1 + -0x10));

  if ((LVar2 == 0) && ((undefined4 *)(param_1 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(param_1 + -0x14))(1);

  }

  return uVar1;

}





// --- FUN_00426fe0 at 0x00426FE0 (size: 111) ---


int __thiscall FUN_00426fe0(int *param_1,int param_2)



{

  int iVar1;

  LONG LVar2;

  int iVar3;

  

  iVar1 = (**(code **)(*param_1 + 4))();

  if (iVar1 == 0) {

    LVar2 = InterlockedDecrement((LONG *)(param_2 + -0x10));

    if ((LVar2 == 0) && ((undefined4 *)(param_2 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(param_2 + -0x14))(1);

    }

    return 0;

  }

  iVar3 = param_2;

  InterlockedIncrement((LONG *)(param_2 + -0x10));

  FUN_00427050(iVar3);

  LVar2 = InterlockedDecrement((LONG *)(param_2 + -0x10));

  if ((LVar2 == 0) && ((undefined4 *)(param_2 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(param_2 + -0x14))(1);

  }

  return iVar1;

}





// --- FUN_00427050 at 0x00427050 (size: 104) ---


void __thiscall FUN_00427050(int param_1,int param_2)



{

  undefined4 *puVar1;

  LONG LVar2;

  

  if (*(undefined4 **)(param_1 + 8) != (undefined4 *)0x0) {

    (**(code **)**(undefined4 **)(param_1 + 8))(1);

  }

  *(undefined4 *)(param_1 + 8) = 0;

  puVar1 = (undefined4 *)FUN_005df0f5(8);

  if (puVar1 == (undefined4 *)0x0) {

    puVar1 = (undefined4 *)0x0;

  }

  else {

    *puVar1 = &PTR_FUN_00798140;

    FUN_0041ab80(&param_2);

  }

  *(undefined4 **)(param_1 + 8) = puVar1;

  puVar1 = (undefined4 *)(param_2 + -0x14);

  LVar2 = InterlockedDecrement((LONG *)(param_2 + -0x10));

  if ((LVar2 == 0) && (puVar1 != (undefined4 *)0x0)) {

    (**(code **)*puVar1)(1);

  }

  return;

}





// --- FUN_00427160 at 0x00427160 (size: 134) ---


undefined4 __thiscall FUN_00427160(int param_1,undefined4 param_2,int param_3)



{

  int iVar1;

  int iVar2;

  

  if (param_3 != 0) {

    iVar1 = *(int *)(param_1 + 8);

    if (iVar1 == 0) {

      iVar1 = DAT_00837d8c;

      InterlockedIncrement((LONG *)(DAT_00837d8c + -0x10));

      iVar1 = FUN_00426f90(iVar1);

    }

    else {

      iVar2 = DAT_00837d88;

      if ((iVar1 != 1) && (iVar2 = DAT_00837d90, iVar1 != 0xff)) {

        return 0;

      }

      InterlockedIncrement((LONG *)(iVar2 + -0x10));

      iVar1 = FUN_00426f90(iVar2);

    }

    if (iVar1 != 0) {

      return 1;

    }

  }

  return 0;

}





// --- FUN_004271f0 at 0x004271F0 (size: 75) ---


undefined1 __thiscall FUN_004271f0(int *param_1,int *param_2,undefined4 param_3)



{

  undefined1 uVar1;

  int iVar2;

  

  FUN_00425ba0();

  if (param_1 == (int *)0x0) {

    return 0;

  }

  iVar2 = *param_2;

  InterlockedIncrement((LONG *)(iVar2 + -0x10));

  uVar1 = FUN_0041b7e0(iVar2,param_3);

  (**(code **)(*param_1 + 0x14))();

  return uVar1;

}





// --- FUN_00427240 at 0x00427240 (size: 128) ---


undefined4 FUN_00427240(int param_1)



{

  int iVar1;

  char cVar2;

  int *piVar3;

  undefined4 *puVar4;

  undefined4 *puVar5;

  undefined1 local_c [12];

  

  piVar3 = (int *)FUN_0052dcf0(local_c);

  puVar4 = (undefined4 *)piVar3[2];

  iVar1 = *piVar3;

  puVar5 = (undefined4 *)piVar3[1];

  do {

    if (puVar4 == (undefined4 *)0x0) {

      return 1;

    }

    do {

      if (((puVar4[2] != 0) && (*(int *)(puVar4[2] + 0x10) == param_1)) &&

         (cVar2 = FUN_0042be30(*puVar4), cVar2 == '\0')) {

        return 0;

      }

      puVar4 = (undefined4 *)puVar4[1];

    } while (puVar4 != (undefined4 *)0x0);

    do {

      puVar5 = puVar5 + 1;

      if (puVar5 == (undefined4 *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) {

        return 1;

      }

      puVar4 = (undefined4 *)*puVar5;

    } while (puVar4 == (undefined4 *)0x0);

  } while( true );

}





// --- FUN_004272c0 at 0x004272C0 (size: 97) ---


void FUN_004272c0(undefined4 param_1)



{

  int iVar1;

  int *piVar2;

  int iVar3;

  undefined1 local_c [12];

  

  piVar2 = (int *)FUN_0052dcf0(local_c);

  iVar3 = piVar2[2];

  iVar1 = *piVar2;

  piVar2 = (int *)piVar2[1];

  do {

    if (iVar3 == 0) {

      return;

    }

    do {

      if (*(int *)(iVar3 + 8) != 0) {

        FUN_0042a580(param_1);

      }

      iVar3 = *(int *)(iVar3 + 4);

    } while (iVar3 != 0);

    do {

      piVar2 = piVar2 + 1;

      if (piVar2 == (int *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) {

        return;

      }

      iVar3 = *piVar2;

    } while (iVar3 == 0);

  } while( true );

}





// --- FUN_00427330 at 0x00427330 (size: 32) ---


void FUN_00427330(int *param_1)



{

  int iVar1;

  

  iVar1 = (**(code **)(*param_1 + 0x108))();

  if (iVar1 != 0) {

    FUN_00427350(iVar1);

  }

  return;

}





// --- FUN_00427350 at 0x00427350 (size: 70) ---


undefined4 __thiscall FUN_00427350(int param_1,int *param_2)



{

  int iVar1;

  

  FUN_004273a0(*(int *)(param_1 + 8) + param_2[2]);

  iVar1 = param_2[2];

  while (iVar1 = iVar1 + -1, -1 < iVar1) {

    FUN_00429ab0(*param_2 + iVar1 * 8);

  }

  *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + param_2[2];

  return 1;

}





// --- FUN_004273a0 at 0x004273A0 (size: 191) ---


undefined4 __thiscall FUN_004273a0(int *param_1,uint param_2)



{

  uint *puVar1;

  int iVar2;

  uint *puVar3;

  

  if ((uint)param_1[2] <= param_2) {

    if (param_2 <= (param_1[1] & 0x7fffffffU)) {

      return 1;

    }

    if (param_2 == 0) {

      FUN_00427460();

      return 1;

    }

    puVar3 = (uint *)thunk_FUN_005df0f5(param_2 * 8 + 4);

    if (puVar3 != (uint *)0x0) {

      puVar1 = puVar3 + 1;

      *puVar3 = param_2;

      FUN_00401000(puVar1,8,param_2,&LAB_004175f0);

      if (puVar1 != (uint *)0x0) {

        if (*param_1 != 0) {

          iVar2 = param_1[2];

          while (iVar2 = iVar2 + -1, -1 < iVar2) {

            FUN_00429ab0(*param_1 + iVar2 * 8);

          }

          if (((param_1[1] & 0x80000000U) == 0x80000000) && (*param_1 != 0)) {

            FUN_00425ae0(3);

          }

        }

        *param_1 = (int)puVar1;

        param_1[1] = param_2 | 0x80000000;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_00427460 at 0x00427460 (size: 169) ---


void __fastcall FUN_00427460(int *param_1)



{

  int iVar1;

  uint uVar2;

  undefined4 *local_8;

  undefined4 *local_4;

  

  param_1[2] = 0;

  if ((param_1[1] & 0x80000000U) == 0x80000000) {

    if (*param_1 != 0) {

      FUN_00425ae0(3);

    }

    *param_1 = 0;

    param_1[1] = 0;

    return;

  }

  if (*param_1 != 0) {

    uVar2 = param_1[1] & 0x7fffffff;

    while (uVar2 = uVar2 - 1, -1 < (int)uVar2) {

      local_8 = (undefined4 *)0x0;

      local_4 = (undefined4 *)0x0;

      FUN_00429ab0(&local_8);

      if (local_8 != (undefined4 *)0x0) {

        iVar1 = local_8[1];

        local_8[1] = iVar1 + -1;

        if (iVar1 + -1 == 0) {

          (**(code **)*local_8)(1);

        }

        local_8 = (undefined4 *)0x0;

      }

      if ((local_4 != (undefined4 *)0x0) &&

         (iVar1 = local_4[1], local_4[1] = iVar1 + -1, iVar1 + -1 == 0)) {

        (**(code **)*local_4)(1);

      }

    }

  }

  return;

}





// --- FUN_00427510 at 0x00427510 (size: 40) ---


undefined4 FUN_00427510(int *param_1)



{

  int iVar1;

  

  iVar1 = (**(code **)(*param_1 + 0x108))();

  if (iVar1 != 0) {

    FUN_00427540(iVar1);

    return 1;

  }

  return 0;

}





// --- FUN_00427540 at 0x00427540 (size: 229) ---


int __thiscall FUN_00427540(int param_1,uint *param_2)



{

  int iVar1;

  char cVar2;

  uint uVar3;

  uint uVar4;

  undefined4 *local_8;

  undefined4 *local_4;

  

  if ((*(uint *)(param_1 + 4) & 0x7fffffff) < (param_2[1] & 0x7fffffff)) {

    *(undefined4 *)(param_1 + 8) = 0;

    cVar2 = FUN_004273a0(param_2[1] & 0x7fffffff);

    if (cVar2 == '\0') {

      return param_1;

    }

  }

  uVar3 = *param_2;

  uVar4 = uVar3 + param_2[2] * 8;

  for (; uVar3 < uVar4; uVar3 = uVar3 + 8) {

    FUN_00429ab0(uVar3);

  }

  uVar4 = param_2[2];

  if (uVar4 < *(uint *)(param_1 + 8)) {

    do {

      local_8 = (undefined4 *)0x0;

      local_4 = (undefined4 *)0x0;

      FUN_00429ab0(&local_8);

      if (local_8 != (undefined4 *)0x0) {

        iVar1 = local_8[1];

        local_8[1] = iVar1 + -1;

        if (iVar1 + -1 == 0) {

          (**(code **)*local_8)(1);

        }

        local_8 = (undefined4 *)0x0;

      }

      if ((local_4 != (undefined4 *)0x0) &&

         (iVar1 = local_4[1], local_4[1] = iVar1 + -1, iVar1 + -1 == 0)) {

        (**(code **)*local_4)(1);

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(param_1 + 8));

  }

  *(uint *)(param_1 + 8) = param_2[2];

  return param_1;

}





// --- FUN_00427860 at 0x00427860 (size: 105) ---


undefined1 FUN_00427860(int param_1)



{

  int *piVar1;

  LONG LVar2;

  undefined1 uVar3;

  char *local_4;

  

  local_4 = (char *)0x0;

  piVar1 = _errno();

  *piVar1 = 0;

  FUN_0065de30(param_1,&local_4,0);

  if (*local_4 == '\0') {

    piVar1 = _errno();

    if (*piVar1 != 0x22) {

      uVar3 = 1;

      goto LAB_004278a5;

    }

  }

  uVar3 = 0;

LAB_004278a5:

  LVar2 = InterlockedDecrement((LONG *)(param_1 + -0x10));

  if ((LVar2 == 0) && ((undefined4 *)(param_1 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(param_1 + -0x14))(1);

  }

  return uVar3;

}





// --- FUN_004279c0 at 0x004279C0 (size: 340) ---


undefined4 __thiscall FUN_004279c0(int param_1,undefined4 param_2,undefined4 param_3,int param_4)



{

  undefined4 uVar1;

  undefined4 uVar2;

  LONG LVar3;

  undefined4 *puVar4;

  

  FUN_00404cd0();

  uVar1 = *(undefined4 *)(param_1 + 8);

  if ((char)param_4 != '\0') {

    uVar2 = *(undefined4 *)(param_1 + 0xc);

    FUN_00401a40();

    FUN_00402710(&param_4,"%I64d",uVar1,uVar2);

    FUN_004064e0(&param_4);

    FUN_004011b0();

    return 1;

  }

  uVar2 = *(undefined4 *)(param_1 + 0xc);

  FUN_00401a40();

  FUN_00402710(&param_4,"0x%016I64X",uVar1,uVar2);

  FUN_004064e0(&param_4);

  FUN_004011b0();

  FUN_00401340(&DAT_00798588);

  if (*(int *)(param_4 + -4) != 1) {

    FUN_004064e0(&param_4);

  }

  puVar4 = (undefined4 *)(param_4 + -0x14);

  LVar3 = InterlockedDecrement((LONG *)(param_4 + -0x10));

  if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

    (**(code **)*puVar4)(1);

  }

  uVar1 = *(undefined4 *)(param_1 + 8);

  uVar2 = *(undefined4 *)(param_1 + 0xc);

  FUN_00401a40();

  FUN_00402710(&param_4,"%I64d",uVar1,uVar2);

  FUN_004064e0(&param_4);

  FUN_004011b0();

  FUN_00401340(&DAT_00798584);

  if (*(int *)(param_4 + -4) != 1) {

    FUN_004064e0(&param_4);

  }

  puVar4 = (undefined4 *)(param_4 + -0x14);

  LVar3 = InterlockedDecrement((LONG *)(param_4 + -0x10));

  if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

    (**(code **)*puVar4)(1);

  }

  return 1;

}





// --- FUN_00427fa0 at 0x00427FA0 (size: 242) ---


undefined1 __thiscall FUN_00427fa0(int param_1,undefined4 param_2,char *param_3)



{

  int iVar1;

  char cVar2;

  int iVar3;

  LONG LVar4;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 uVar5;

  undefined4 extraout_ECX_01;

  undefined1 uVar6;

  char *pcVar7;

  

  iVar1 = (int)param_3;

  if (param_3 == (char *)0x0) {

    return 0;

  }

  param_3 = PTR_DAT_00818344;

  uVar6 = 1;

  InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

  iVar3 = FUN_0065ca90();

  uVar5 = extraout_ECX;

  if (iVar3 == 0) {

LAB_00427fe2:

    pcVar7 = "Expecting a leaf string node";

  }

  else {

    cVar2 = FUN_00426020(&param_3);

    uVar5 = extraout_ECX_00;

    if (cVar2 == '\0') goto LAB_00427fe2;

    iVar3 = _stricmp(param_3,DAT_00837d88);

    if (iVar3 == 0) {

      *(undefined4 *)(param_1 + 8) = 1;

      goto LAB_0042805f;

    }

    iVar3 = _stricmp(param_3,DAT_00837d8c);

    if (iVar3 == 0) {

      *(undefined4 *)(param_1 + 8) = 0;

      goto LAB_0042805f;

    }

    iVar3 = _stricmp(param_3,DAT_00837d90);

    if (iVar3 == 0) {

      *(undefined4 *)(param_1 + 8) = 0xff;

      goto LAB_0042805f;

    }

    pcVar7 = "Unknown Keyword";

    uVar5 = extraout_ECX_01;

  }

  FUN_00401340(pcVar7);

  FUN_0065d620(iVar1,uVar5);

  uVar6 = 0;

LAB_0042805f:

  pcVar7 = param_3 + -0x14;

  LVar4 = InterlockedDecrement((LONG *)(param_3 + -0x10));

  if ((LVar4 == 0) && (pcVar7 != (char *)0x0)) {

    (*(code *)**(undefined4 **)pcVar7)(1);

  }

  return uVar6;

}





// --- FUN_00428100 at 0x00428100 (size: 192) ---


undefined1 __thiscall FUN_00428100(int *param_1,int *param_2)



{

  char cVar1;

  int iVar2;

  int *piVar3;

  LONG LVar4;

  undefined1 uVar5;

  int unaff_EDI;

  int *piStack_4;

  

  uVar5 = 0;

  if ((int *)param_1[2] != (int *)0x0) {

    piStack_4 = param_1;

    iVar2 = (**(code **)(*(int *)param_1[2] + 4))();

    piVar3 = (int *)param_1[2];

    if (iVar2 == 3) {

      *param_2 = piVar3[2];

      param_2[1] = piVar3[3];

      return 1;

    }

    (**(code **)(*piVar3 + 0x14))(&piStack_4);

    piVar3 = (int *)FUN_005df0f5(0x10);

    if (piVar3 == (int *)0x0) {

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_00797e28;

    }

    cVar1 = (**(code **)(*piVar3 + 0x10))(&stack0xfffffff8);

    if (cVar1 == '\0') {

      (**(code **)*piVar3)(1);

      uVar5 = 0;

    }

    else {

      *piStack_4 = piVar3[2];

      piStack_4[1] = piVar3[3];

      if ((undefined4 *)param_1[2] != (undefined4 *)0x0) {

        (*(code *)**(undefined4 **)param_1[2])(1);

      }

      param_1[2] = (int)piVar3;

      uVar5 = 1;

    }

    LVar4 = InterlockedDecrement((LONG *)(unaff_EDI + -0x10));

    if ((LVar4 == 0) && ((undefined4 *)(unaff_EDI + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(unaff_EDI + -0x14))(1);

    }

  }

  return uVar5;

}





// --- FUN_00428210 at 0x00428210 (size: 73) ---


void __fastcall FUN_00428210(int param_1)



{

  undefined *puVar1;

  undefined4 *puVar2;

  undefined4 local_4;

  

  puVar1 = PTR_DAT_00818558;

  local_4 = *(undefined4 *)(param_1 + 0x68);

  puVar2 = (undefined4 *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&local_4,local_4,0);

  if ((puVar2 != (undefined4 *)puVar1) || (puVar2 = puVar2 + -1, puVar2 != (undefined4 *)puVar1)) {

    puVar2 = puVar2 + 1;

  }

  FUN_00428650(*puVar2);

  return;

}





// --- FUN_00428290 at 0x00428290 (size: 45) ---


undefined4 * __thiscall FUN_00428290(undefined4 *param_1,undefined4 param_2)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_007983e0;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  FUN_00427540(param_2);

  return param_1;

}





// --- FUN_004282d0 at 0x004282D0 (size: 137) ---


void __thiscall FUN_004282d0(int param_1,int param_2)



{

  uint *puVar1;

  uint uVar2;

  uint uVar3;

  

  uVar3 = *(uint *)(param_1 + 8);

  FUN_0040ad10(4);

  puVar1 = (uint *)FUN_0040acf0(4);

  if (puVar1 != (uint *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) == 0) {

      uVar3 = *puVar1;

    }

    else {

      *puVar1 = uVar3;

    }

  }

  if ((~*(byte *)(param_2 + 4) & 1) != 0) {

    uVar2 = FUN_0040a8f0();

    if (uVar2 < uVar3) {

      FUN_0040aa50();

      return;

    }

    *(undefined4 *)(param_1 + 8) = 0;

    FUN_00428360(uVar3,1);

  }

  uVar3 = 0;

  if (*(int *)(param_1 + 8) != 0) {

    do {

      FUN_0042a330(param_2);

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 8));

  }

  return;

}





// --- FUN_00428360 at 0x00428360 (size: 192) ---


undefined1 __thiscall FUN_00428360(int param_1,uint param_2,char param_3)



{

  int iVar1;

  char cVar2;

  uint uVar3;

  undefined4 *local_8;

  undefined4 *local_4;

  

  if ((*(uint *)(param_1 + 4) & 0x7fffffff) < param_2) {

    uVar3 = param_2;

    if (param_3 == '\0') {

      uVar3 = FUN_00453850(param_2);

    }

    cVar2 = FUN_004273a0(uVar3);

    if (cVar2 == '\0') {

      return 0;

    }

  }

  else {

    uVar3 = param_2;

    if (param_2 < *(uint *)(param_1 + 8)) {

      do {

        local_8 = (undefined4 *)0x0;

        local_4 = (undefined4 *)0x0;

        FUN_00429ab0(&local_8);

        if (local_8 != (undefined4 *)0x0) {

          iVar1 = local_8[1];

          local_8[1] = iVar1 + -1;

          if (iVar1 + -1 == 0) {

            (**(code **)*local_8)(1);

          }

          local_8 = (undefined4 *)0x0;

        }

        if ((local_4 != (undefined4 *)0x0) &&

           (iVar1 = local_4[1], local_4[1] = iVar1 + -1, iVar1 + -1 == 0)) {

          (**(code **)*local_4)(1);

        }

        uVar3 = uVar3 + 1;

      } while (uVar3 < *(uint *)(param_1 + 8));

    }

  }

  *(uint *)(param_1 + 8) = param_2;

  return 1;

}





// --- FUN_00428460 at 0x00428460 (size: 70) ---


undefined1 __thiscall FUN_00428460(int param_1,undefined4 param_2)



{

  char cVar1;

  uint uVar2;

  undefined4 uVar3;

  

  uVar2 = *(uint *)(param_1 + 4) & 0x7fffffff;

  if (uVar2 <= *(uint *)(param_1 + 8)) {

    uVar3 = FUN_00453850(uVar2 + 1);

    cVar1 = FUN_004273a0(uVar3);

    if (cVar1 == '\0') {

      return 0;

    }

  }

  FUN_00429ab0(param_2);

  *(int *)(param_1 + 8) = *(int *)(param_1 + 8) + 1;

  return 1;

}





// --- FUN_004284b0 at 0x004284B0 (size: 63) ---


uint __thiscall FUN_004284b0(int param_1,uint param_2)



{

  uint *puVar1;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 0x1b4) + (param_2 % *(uint *)(param_1 + 0x1bc)) * 4);

  while( true ) {

    if (puVar1 == (uint *)0x0) {

      return 0;

    }

    if (*puVar1 == param_2) break;

    puVar1 = (uint *)puVar1[1];

  }

  if (puVar1 == (uint *)0x0) {

    return 0;

  }

  return puVar1[2];

}





// --- FUN_004284f0 at 0x004284F0 (size: 143) ---


undefined4 * __thiscall FUN_004284f0(undefined4 *param_1,undefined4 param_2)



{

  undefined *puVar1;

  uint *puVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  undefined4 *puVar6;

  

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  *param_1 = &PTR_FUN_007980c8;

  puVar1 = PTR_DAT_00818558;

  puVar2 = (uint *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_2,param_2,0);

  if (puVar2 == (uint *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  uVar4 = *puVar2;

  param_1[0x1a] = uVar4;

  if (uVar4 < 0x18) {

    param_1[0x18] = param_1 + 1;

  }

  else {

    uVar3 = thunk_FUN_005df0f5(uVar4 << 2);

    param_1[0x18] = uVar3;

  }

  param_1[0x19] = (undefined4 *)param_1[0x18] + param_1[0x1a];

  puVar6 = (undefined4 *)param_1[0x18];

  for (uVar4 = param_1[0x1a] & 0x3fffffff; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar6 = 0;

    puVar6 = puVar6 + 1;

  }

  for (iVar5 = 0; iVar5 != 0; iVar5 = iVar5 + -1) {

    *(undefined1 *)puVar6 = 0;

    puVar6 = (undefined4 *)((int)puVar6 + 1);

  }

  return param_1;

}





// --- FUN_00428580 at 0x00428580 (size: 143) ---


undefined4 * __thiscall FUN_00428580(undefined4 *param_1,undefined4 param_2)



{

  undefined *puVar1;

  uint *puVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  undefined4 *puVar6;

  

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  *param_1 = &PTR_FUN_007980cc;

  puVar1 = PTR_DAT_00818558;

  puVar2 = (uint *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_2,param_2,0);

  if (puVar2 == (uint *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  uVar4 = *puVar2;

  param_1[0x1a] = uVar4;

  if (uVar4 < 0x18) {

    param_1[0x18] = param_1 + 1;

  }

  else {

    uVar3 = thunk_FUN_005df0f5(uVar4 << 2);

    param_1[0x18] = uVar3;

  }

  param_1[0x19] = (undefined4 *)param_1[0x18] + param_1[0x1a];

  puVar6 = (undefined4 *)param_1[0x18];

  for (uVar4 = param_1[0x1a] & 0x3fffffff; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar6 = 0;

    puVar6 = puVar6 + 1;

  }

  for (iVar5 = 0; iVar5 != 0; iVar5 = iVar5 + -1) {

    *(undefined1 *)puVar6 = 0;

    puVar6 = (undefined4 *)((int)puVar6 + 1);

  }

  return param_1;

}





// --- FUN_00428610 at 0x00428610 (size: 62) ---


void __thiscall FUN_00428610(int param_1,uint *param_2)



{

  uint *puVar1;

  

  if (*(int *)(param_1 + 0x68) * 2 < *(int *)(param_1 + 0x6c) + 1) {

    FUN_00428210();

  }

  puVar1 = (uint *)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  param_2[1] = *puVar1;

  *puVar1 = (uint)param_2;

  if (puVar1 < *(uint **)(param_1 + 100)) {

    *(uint **)(param_1 + 100) = puVar1;

  }

  *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + 1;

  return;

}





// --- FUN_00428650 at 0x00428650 (size: 289) ---


undefined4 __thiscall FUN_00428650(int param_1,int param_2)



{

  uint *puVar1;

  int iVar2;

  uint *puVar3;

  int *piVar4;

  undefined4 *puVar5;

  undefined4 *puVar6;

  uint *puVar7;

  

  if (param_2 == *(int *)(param_1 + 0x68)) {

    return 0;

  }

  iVar2 = *(int *)(param_1 + 0x6c);

  puVar3 = (uint *)0x0;

  do {

    if (iVar2 == 0) {

      if (*(void **)(param_1 + 0x60) != (void *)(param_1 + 4)) {

        operator_delete__(*(void **)(param_1 + 0x60));

      }

      *(undefined4 *)(param_1 + 0x60) = 0;

      *(undefined4 *)(param_1 + 100) = 0;

      *(undefined4 *)(param_1 + 0x68) = 0;

      *(undefined4 *)(param_1 + 0x6c) = 0;

      FUN_00693b20(param_2);

      puVar6 = (undefined4 *)PTR_DAT_00818558;

      while (puVar3 != (uint *)0x0) {

        param_2 = *(int *)(param_1 + 0x68);

        puVar7 = (uint *)puVar3[1];

        PTR_DAT_00818558 = (undefined *)puVar6;

        if (param_2 * 2 < *(int *)(param_1 + 0x6c) + 1) {

          puVar5 = (undefined4 *)FUN_00422d20(PTR_DAT_00818554,puVar6,&param_2,param_2,0);

          if ((puVar5 != puVar6) || (puVar5 = puVar5 + -1, puVar5 != puVar6)) {

            puVar5 = puVar5 + 1;

          }

          FUN_00428650(*puVar5);

        }

        puVar1 = (uint *)(*(int *)(param_1 + 0x60) + (*puVar3 % *(uint *)(param_1 + 0x68)) * 4);

        puVar3[1] = *puVar1;

        *puVar1 = (uint)puVar3;

        if (puVar1 < *(uint **)(param_1 + 100)) {

          *(uint **)(param_1 + 100) = puVar1;

        }

        *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + 1;

        puVar6 = (undefined4 *)PTR_DAT_00818558;

        puVar3 = puVar7;

      }

      PTR_DAT_00818558 = (undefined *)puVar6;

      return 1;

    }

    piVar4 = *(int **)(param_1 + 100);

    while (piVar4 != (int *)(*(int *)(param_1 + 0x60) + *(int *)(param_1 + 0x68) * 4)) {

      if (**(int **)(param_1 + 100) != 0) {

        puVar6 = *(undefined4 **)(param_1 + 100);

        puVar7 = (uint *)*puVar6;

        goto LAB_004286a1;

      }

      piVar4 = *(int **)(param_1 + 100) + 1;

      *(int **)(param_1 + 100) = piVar4;

    }

    puVar6 = (undefined4 *)0x0;

    puVar7 = (uint *)0x0;

LAB_004286a1:

    FUN_00428ba0(param_1,puVar6,puVar7);

    puVar7[1] = (uint)puVar3;

    iVar2 = *(int *)(param_1 + 0x6c);

    puVar3 = puVar7;

  } while( true );

}





// --- FUN_00428840 at 0x00428840 (size: 184) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



void FUN_00428840(double *param_1,int param_2,double param_3)



{

  undefined4 uVar1;

  double *pdVar2;

  undefined8 local_10;

  

  if (((byte)*(undefined4 *)(param_2 + 4) & 5) == 1) {

    if (*param_1 == (double)CONCAT44(DAT_00796c44,DAT_00796c40)) {

      local_10 = 3.4028234663852886e+38;

    }

    else {

      local_10 = *param_1 - param_3;

    }

  }

  FUN_0040ad10(8);

  pdVar2 = (double *)FUN_0040acf0(8);

  if (pdVar2 != (double *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) == 0) {

      local_10 = *pdVar2;

    }

    else {

      *(undefined4 *)pdVar2 = (undefined4)local_10;

      *(undefined4 *)((int)pdVar2 + 4) = local_10._4_4_;

    }

  }

  uVar1 = DAT_00796c44;

  if ((*(byte *)(param_2 + 4) & 5) == 0) {

    if (local_10 == _DAT_00798698) {

      *(undefined4 *)param_1 = DAT_00796c40;

      *(undefined4 *)((int)param_1 + 4) = uVar1;

      return;

    }

    *param_1 = local_10 + param_3;

  }

  return;

}





// --- FUN_00428900 at 0x00428900 (size: 661) ---


void FUN_00428900(undefined4 param_1,int param_2,uint param_3)



{

  undefined *puVar1;

  undefined *puVar2;

  uint uVar3;

  char cVar4;

  undefined *puVar5;

  byte *pbVar6;

  int *piVar7;

  undefined4 *puVar8;

  int iVar9;

  undefined4 uVar10;

  undefined4 *puVar11;

  int iVar12;

  uint uVar13;

  undefined4 *puVar14;

  undefined1 local_c [12];

  

  uVar3 = param_3;

  if ((~*(byte *)(param_3 + 4) & 1) != 0) {

    FUN_005c2c80();

  }

  puVar2 = PTR_DAT_00818558;

  puVar1 = PTR_DAT_00818554;

  if (((byte)*(undefined4 *)(uVar3 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x68);

    puVar5 = (undefined *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_3,param_3,0);

    if (puVar5 == puVar2) {

      puVar5 = puVar5 + -4;

    }

    uVar13 = (int)puVar5 - (int)puVar1 >> 2;

  }

  else {

    uVar13 = param_3 & 0xff;

  }

  FUN_0040ad10(1);

  pbVar6 = (byte *)FUN_0040acf0(1);

  if (pbVar6 != (byte *)0x0) {

    if ((*(byte *)(uVar3 + 4) & 1) == 0) {

      uVar13 = (uint)*pbVar6;

    }

    else {

      *pbVar6 = (byte)uVar13;

    }

  }

  if ((*(byte *)(uVar3 + 4) & 5) == 0) {

    if ((uVar13 & 0xff) < DAT_007956cc) {

      FUN_0042ab60(*(undefined4 *)(PTR_DAT_00818554 + (uVar13 & 0xff) * 4));

    }

    else {

      FUN_0040aa50();

    }

  }

  if (((byte)*(undefined4 *)(uVar3 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x6c);

  }

  FUN_00401a80(&param_3,&param_3,uVar3);

  if (((byte)*(undefined4 *)(uVar3 + 4) & 5) == 1) {

    piVar7 = (int *)FUN_0052dcf0(local_c);

    iVar12 = *piVar7;

    puVar14 = (undefined4 *)piVar7[1];

    puVar8 = (undefined4 *)piVar7[2];

LAB_00428a06:

    puVar11 = puVar8;

    if (puVar8 != (undefined4 *)0x0) {

      do {

        FUN_0040ad10(4);

        puVar8 = (undefined4 *)FUN_0040acf0(4);

        if (puVar8 != (undefined4 *)0x0) {

          if ((*(byte *)(uVar3 + 4) & 1) == 0) {

            *puVar11 = *puVar8;

          }

          else {

            *puVar8 = *puVar11;

          }

        }

        if ((*(uint *)(uVar3 + 4) >> 2 & 1) == 0) {

          if ((~*(byte *)(uVar3 + 4) & 1) != 0) {

            iVar9 = FUN_005df0f5(0xcc);

            if (iVar9 == 0) {

              uVar10 = 0;

            }

            else {

              uVar10 = FUN_0042ac10();

            }

            puVar11[2] = uVar10;

          }

          if (puVar11[2] == 0) {

            FUN_0040aa50();

          }

          else {

            FUN_0042a600(uVar3);

          }

        }

        puVar11 = (undefined4 *)puVar11[1];

      } while (puVar11 != (undefined4 *)0x0);

      do {

        puVar14 = puVar14 + 1;

        puVar8 = puVar11;

        if (puVar14 == (undefined4 *)(*(int *)(iVar12 + 0x60) + *(int *)(iVar12 + 0x68) * 4)) break;

        puVar8 = (undefined4 *)*puVar14;

      } while (puVar8 == (undefined4 *)0x0);

      goto LAB_00428a06;

    }

  }

  if ((*(byte *)(uVar3 + 4) & 5) == 0) {

    uVar13 = FUN_0040a8f0();

    if (uVar13 < param_3) {

LAB_00428b86:

      FUN_0040aa50();

    }

    else {

      uVar13 = 0;

      puVar14 = (undefined4 *)0x0;

      if (param_3 != 0) {

        while( true ) {

          puVar11 = (undefined4 *)FUN_005df0f5(0xc);

          puVar8 = (undefined4 *)0x0;

          if (puVar11 != (undefined4 *)0x0) {

            puVar11[1] = 0;

            puVar8 = puVar11;

          }

          FUN_0040ad10(4);

          puVar11 = (undefined4 *)FUN_0040acf0(4);

          if (puVar11 != (undefined4 *)0x0) {

            if ((*(byte *)(uVar3 + 4) & 1) == 0) {

              *puVar8 = *puVar11;

            }

            else {

              *puVar11 = *puVar8;

            }

          }

          if ((*(uint *)(uVar3 + 4) >> 2 & 1) == 0) {

            if ((~*(byte *)(uVar3 + 4) & 1) != 0) {

              iVar12 = FUN_005df0f5(0xcc);

              if (iVar12 == 0) {

                uVar10 = 0;

              }

              else {

                uVar10 = FUN_0042ac10();

              }

              puVar8[2] = uVar10;

            }

            if (puVar8[2] == 0) {

              FUN_0040aa50();

            }

            else {

              FUN_0042a600(uVar3);

            }

          }

          if ((*(uint *)(uVar3 + 4) >> 2 & 1) != 0) break;

          cVar4 = FUN_00599310(puVar8,puVar14);

          if (cVar4 == '\0') goto LAB_00428b86;

          uVar13 = uVar13 + 1;

          puVar14 = puVar8;

          if (param_3 <= uVar13) {

            return;

          }

        }

      }

    }

  }

  return;

}





// --- FUN_00428ba0 at 0x00428BA0 (size: 64) ---


void __thiscall FUN_00428ba0(int param_1,undefined4 param_2,int *param_3,int param_4)



{

  int iVar1;

  int iVar2;

  

  iVar2 = *param_3;

  if (iVar2 != param_4) {

    do {

      iVar1 = iVar2;

      iVar2 = *(int *)(iVar1 + 4);

    } while (iVar2 != param_4);

    if (iVar1 != 0) {

      *(undefined4 *)(iVar1 + 4) = *(undefined4 *)(iVar2 + 4);

      *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + -1;

      return;

    }

  }

  *param_3 = *(int *)(iVar2 + 4);

  *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + -1;

  return;

}





// --- FUN_00428be0 at 0x00428BE0 (size: 169) ---


void __fastcall FUN_00428be0(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  void *pvVar3;

  void *pvVar4;

  int *piVar5;

  void *pvVar6;

  

  iVar1 = *(int *)(param_1 + 0x6c);

  do {

    if (iVar1 == 0) {

      return;

    }

    piVar5 = *(int **)(param_1 + 100);

    while (piVar5 != (int *)(*(int *)(param_1 + 0x60) + *(int *)(param_1 + 0x68) * 4)) {

      if (**(int **)(param_1 + 100) != 0) {

        piVar5 = *(int **)(param_1 + 100);

        pvVar6 = (void *)*piVar5;

        goto LAB_00428c1e;

      }

      piVar5 = *(int **)(param_1 + 100) + 1;

      *(int **)(param_1 + 100) = piVar5;

    }

    piVar5 = (int *)0x0;

    pvVar6 = (void *)0x0;

LAB_00428c1e:

    pvVar4 = (void *)*piVar5;

    if (pvVar4 == pvVar6) {

LAB_00428c31:

      *piVar5 = *(int *)((int)pvVar4 + 4);

    }

    else {

      do {

        pvVar3 = pvVar4;

        pvVar4 = *(void **)((int)pvVar3 + 4);

      } while (pvVar4 != pvVar6);

      if (pvVar3 == (void *)0x0) goto LAB_00428c31;

      *(undefined4 *)((int)pvVar3 + 4) = *(undefined4 *)((int)pvVar4 + 4);

    }

    *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + -1;

    if (pvVar6 != (void *)0x0) {

      puVar2 = *(undefined4 **)((int)pvVar6 + 8);

      if (puVar2 != (undefined4 *)0x0) {

        piVar5 = puVar2 + 1;

        *piVar5 = *piVar5 + -1;

        if (*piVar5 == 0) {

          (**(code **)*puVar2)(1);

        }

        *(undefined4 *)((int)pvVar6 + 8) = 0;

      }

      puVar2 = *(undefined4 **)((int)pvVar6 + 0xc);

      if (puVar2 != (undefined4 *)0x0) {

        piVar5 = puVar2 + 1;

        *piVar5 = *piVar5 + -1;

        if (*piVar5 == 0) {

          (**(code **)*puVar2)(1);

        }

        *(undefined4 *)((int)pvVar6 + 0xc) = 0;

      }

      operator_delete(pvVar6);

    }

    iVar1 = *(int *)(param_1 + 0x6c);

  } while( true );

}





// --- FUN_00428d40 at 0x00428D40 (size: 116) ---


void __fastcall FUN_00428d40(int param_1)



{

  int *piVar1;

  int iVar2;

  undefined4 *puVar3;

  int *piVar4;

  int iVar5;

  undefined1 auStack_c [12];

  

  (**(code **)(*(int *)(param_1 + 0x30) + 0x3c))();

  piVar4 = (int *)FUN_0052dcf0(auStack_c);

  iVar5 = piVar4[2];

  iVar2 = *piVar4;

  piVar4 = (int *)piVar4[1];

  while (iVar5 != 0) {

    do {

      puVar3 = *(undefined4 **)(iVar5 + 8);

      if (puVar3 != (undefined4 *)0x0) {

        piVar1 = puVar3 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar3)(1);

        }

      }

      iVar5 = *(int *)(iVar5 + 4);

    } while (iVar5 != 0);

    do {

      piVar4 = piVar4 + 1;

      if (piVar4 == (int *)(*(int *)(iVar2 + 0x60) + *(int *)(iVar2 + 0x68) * 4)) goto LAB_00428da5;

      iVar5 = *piVar4;

    } while (iVar5 == 0);

  }

LAB_00428da5:

  FUN_005870f0();

  return;

}





// --- FUN_00428dc0 at 0x00428DC0 (size: 82) ---


undefined4 * __thiscall FUN_00428dc0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_007986a0;

  FUN_005870f0();

  param_1[1] = &PTR_FUN_007980c8;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00428e30 at 0x00428E30 (size: 94) ---


void __fastcall FUN_00428e30(undefined4 *param_1)



{

  *param_1 = &PTR_LAB_007986a8;

  FUN_00428d40();

  param_1[0x54] = &PTR_FUN_007986a0;

  FUN_005870f0();

  param_1[0x55] = &PTR_FUN_007980c8;

  if ((undefined4 *)param_1[0x6d] != param_1 + 0x56) {

    operator_delete__((undefined4 *)param_1[0x6d]);

  }

  param_1[0x6d] = 0;

  param_1[0x6e] = 0;

  param_1[0x6f] = 0;

  param_1[0x70] = 0;

  FUN_0041bf80();

  FUN_004154b0();

  return;

}





// --- FUN_00428ee0 at 0x00428EE0 (size: 82) ---


undefined4 * __thiscall FUN_00428ee0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798700;

  FUN_00428be0();

  param_1[1] = &PTR_FUN_007980cc;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00428fa0 at 0x00428FA0 (size: 58) ---


void __fastcall FUN_00428fa0(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_00798700;

  FUN_00428be0();

  param_1[1] = &PTR_FUN_007980cc;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  return;

}





// --- FUN_00428fe0 at 0x00428FE0 (size: 30) ---


void * __thiscall FUN_00428fe0(void *param_1,byte param_2)



{

  FUN_00428e30();

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00429000 at 0x00429000 (size: 44) ---


undefined4 * __fastcall FUN_00429000(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_00798708;

  param_1[2] = &PTR_FUN_00798700;

  FUN_00428580(0);

  param_1[2] = &PTR_FUN_00798700;

  return param_1;

}





// --- FUN_00429050 at 0x00429050 (size: 58) ---


undefined4 FUN_00429050(undefined4 param_1)



{

  undefined1 local_c [8];

  int local_4;

  

  FUN_00429090(local_c,param_1);

  if (local_4 != 0) {

    FUN_00429ab0(local_4 + 8);

    return 1;

  }

  return 0;

}





// --- FUN_00429090 at 0x00429090 (size: 57) ---


void __thiscall FUN_00429090(int param_1,int *param_2,uint *param_3)



{

  undefined4 *puVar1;

  uint *puVar2;

  

  puVar1 = (undefined4 *)(*(int *)(param_1 + 0x60) + (*param_3 % *(uint *)(param_1 + 0x68)) * 4);

  for (puVar2 = (uint *)*puVar1; (puVar2 != (uint *)0x0 && (*puVar2 != *param_3));

      puVar2 = (uint *)puVar2[1]) {

  }

  param_2[1] = (int)puVar1;

  *param_2 = param_1;

  param_2[2] = (int)puVar2;

  return;

}





// --- FUN_00429120 at 0x00429120 (size: 154) ---


undefined4 FUN_00429120(undefined4 *param_1,undefined4 param_2)



{

  undefined4 *puVar1;

  undefined1 local_c [8];

  int local_4;

  

  FUN_00429090(local_c,param_1);

  if (local_4 != 0) {

    FUN_00429ab0(param_2);

    return 1;

  }

  puVar1 = (undefined4 *)FUN_005df0f5(0x10);

  if (puVar1 == (undefined4 *)0x0) {

    puVar1 = (undefined4 *)0x0;

  }

  else {

    *puVar1 = *param_1;

    puVar1[1] = 0;

    puVar1[2] = 0;

    puVar1[3] = 0;

    FUN_00429ab0(param_2);

  }

  FUN_00429090(local_c,puVar1);

  if (local_4 == 0) {

    FUN_00428610(puVar1);

  }

  return 1;

}





// --- FUN_004291d0 at 0x004291D0 (size: 91) ---


undefined4 FUN_004291d0(undefined4 param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  void *pvVar3;

  

  pvVar3 = (void *)FUN_004171e0(param_1);

  if (pvVar3 != (void *)0x0) {

    puVar2 = *(undefined4 **)((int)pvVar3 + 8);

    if (puVar2 != (undefined4 *)0x0) {

      piVar1 = puVar2 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*puVar2)(1);

      }

      *(undefined4 *)((int)pvVar3 + 8) = 0;

    }

    puVar2 = *(undefined4 **)((int)pvVar3 + 0xc);

    if (puVar2 != (undefined4 *)0x0) {

      piVar1 = puVar2 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*puVar2)(1);

      }

      *(undefined4 *)((int)pvVar3 + 0xc) = 0;

    }

    operator_delete(pvVar3);

    return 1;

  }

  return 0;

}





// --- FUN_00429230 at 0x00429230 (size: 45) ---


undefined4 * __thiscall FUN_00429230(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798708;

  FUN_00428fa0();

  *param_1 = &PTR_LAB_00796c4c;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00429260 at 0x00429260 (size: 40) ---


undefined4 FUN_00429260(int *param_1)



{

  int iVar1;

  

  iVar1 = (**(code **)(*param_1 + 0x128))();

  if (iVar1 != 0) {

    FUN_00429290(iVar1);

    return 1;

  }

  return 0;

}





// --- FUN_00429290 at 0x00429290 (size: 226) ---


int __thiscall FUN_00429290(int param_1,int param_2)



{

  undefined4 *puVar1;

  undefined4 *puVar2;

  undefined4 uVar3;

  int iVar4;

  undefined4 *puVar5;

  undefined4 *local_10;

  undefined1 local_c [12];

  

  if (param_1 != param_2) {

    FUN_00428be0();

    uVar3 = FUN_006b3a50(*(undefined4 *)(param_2 + 0x6c));

    FUN_00428650(uVar3);

    uVar3 = FUN_006b3f60(local_c);

    FUN_006b3f40(uVar3);

    iVar4 = FUN_0052dcf0(local_c);

    puVar1 = *(undefined4 **)(iVar4 + 8);

    puVar2 = (undefined4 *)0x0;

    while (puVar1 != local_10) {

      puVar5 = (undefined4 *)FUN_005df0f5(0x10);

      if (puVar5 == (undefined4 *)0x0) {

        puVar5 = (undefined4 *)0x0;

      }

      else {

        *puVar5 = *puVar1;

        puVar5[1] = 0;

        puVar5[2] = 0;

        puVar5[3] = 0;

        FUN_00429ab0(puVar1 + 2);

      }

      FUN_00599310(puVar5,puVar2);

      FUN_00429380();

      puVar2 = puVar5;

    }

  }

  return param_1;

}





// --- FUN_00429380 at 0x00429380 (size: 55) ---


void __fastcall FUN_00429380(int *param_1)



{

  int iVar1;

  int iVar2;

  int *piVar3;

  

  iVar1 = *(int *)(param_1[2] + 4);

  param_1[2] = iVar1;

  if (iVar1 == 0) {

    iVar1 = *(int *)(*param_1 + 0x68);

    iVar2 = *(int *)(*param_1 + 0x60);

    do {

      piVar3 = (int *)(param_1[1] + 4);

      param_1[1] = (int)piVar3;

      if (piVar3 == (int *)(iVar2 + iVar1 * 4)) {

        return;

      }

    } while (*piVar3 == 0);

    param_1[2] = *piVar3;

  }

  return;

}





// --- FUN_004293c0 at 0x004293C0 (size: 660) ---


undefined4 * FUN_004293c0(undefined4 param_1)



{

  int iVar1;

  undefined4 *puVar2;

  

  switch(param_1) {

  case 1:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00796ed0;

      *(undefined1 *)(puVar2 + 2) = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 2:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00797690;

      puVar2[2] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 3:

    puVar2 = (undefined4 *)FUN_005df0f5(0x10);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_007977d0;

      puVar2[2] = 0;

      puVar2[3] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 4:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00797410;

      puVar2[2] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 5:

    iVar1 = FUN_005df0f5(0x14);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_004254f0();

      return puVar2;

    }

    break;

  case 6:

    iVar1 = FUN_005df0f5(0x18);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00423db0();

      return puVar2;

    }

    break;

  case 7:

    iVar1 = FUN_005df0f5(0xc);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_004262b0();

      return puVar2;

    }

    break;

  case 8:

    iVar1 = FUN_005df0f5(0x98);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00424fc0();

      return puVar2;

    }

    break;

  case 9:

  case 0x14:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_007972d0;

      puVar2[2] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 10:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      puVar2[1] = 1;

      *puVar2 = &PTR_LAB_00797190;

      puVar2[2] = DAT_00837d78;

      return puVar2;

    }

    break;

  case 0xb:

    iVar1 = FUN_005df0f5(0x34);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_004256e0();

      return puVar2;

    }

    break;

  case 0xc:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00797550;

      puVar2[2] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 0xd:

    iVar1 = FUN_005df0f5(0x50);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00424d50();

      return puVar2;

    }

    break;

  case 0xe:

    iVar1 = FUN_005df0f5(0x10);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00425270();

      return puVar2;

    }

    break;

  case 0xf:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00796c50;

      puVar2[2] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 0x10:

    puVar2 = (undefined4 *)FUN_005df0f5(0x10);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00796d90;

      puVar2[2] = 0;

      puVar2[3] = 0;

      puVar2[1] = 1;

      return puVar2;

    }

    break;

  case 0x11:

    iVar1 = FUN_005df0f5(0x14);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00426970();

      return puVar2;

    }

    break;

  case 0x12:

    iVar1 = FUN_005df0f5(0x7c);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00429000();

      return puVar2;

    }

    break;

  case 0x13:

    iVar1 = FUN_005df0f5(0x10);

    if (iVar1 != 0) {

      puVar2 = (undefined4 *)FUN_00426660();

      return puVar2;

    }

    break;

  case 0x15:

    puVar2 = (undefined4 *)FUN_005df0f5(0xc);

    if (puVar2 != (undefined4 *)0x0) {

      *puVar2 = &PTR_LAB_00797ba8;

      puVar2[2] = 0xff;

      puVar2[1] = 1;

      return puVar2;

    }

  }

  return (undefined4 *)0x0;

}





// --- FUN_004296e0 at 0x004296E0 (size: 65) ---


undefined4 * __thiscall FUN_004296e0(undefined4 *param_1,int param_2)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_00798708;

  param_1[2] = &PTR_FUN_00798700;

  FUN_00428580(*(undefined4 *)(param_2 + 0x6c));

  FUN_00429290(param_2);

  param_1[2] = &PTR_FUN_00798700;

  return param_1;

}





// --- FUN_00429760 at 0x00429760 (size: 407) ---


void FUN_00429760(undefined4 param_1,int param_2,uint param_3)



{

  uint uVar1;

  char cVar2;

  int iVar3;

  byte *pbVar4;

  undefined4 uVar5;

  int *piVar6;

  undefined4 uVar7;

  uint uVar8;

  int *piVar9;

  int iVar10;

  int iVar11;

  undefined1 local_c [12];

  

  uVar1 = param_3;

  if ((~*(byte *)(param_3 + 4) & 1) != 0) {

    FUN_005c2c80();

  }

  if (((byte)*(undefined4 *)(uVar1 + 4) & 5) == 1) {

    iVar3 = FUN_006b3a20(*(undefined4 *)(param_2 + 0x68));

    uVar8 = iVar3 - (int)PTR_DAT_00818554 >> 2;

  }

  else {

    uVar8 = param_3 & 0xff;

  }

  FUN_0040ad10(1);

  pbVar4 = (byte *)FUN_0040acf0(1);

  if (pbVar4 != (byte *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      uVar8 = (uint)*pbVar4;

    }

    else {

      *pbVar4 = (byte)uVar8;

    }

  }

  if ((*(byte *)(uVar1 + 4) & 5) == 0) {

    if ((uVar8 & 0xff) < DAT_007956cc) {

      uVar5 = FUN_006b3a50(*(undefined4 *)(PTR_DAT_00818554 + (uVar8 & 0xff) * 4));

      FUN_00428650(uVar5);

    }

    else {

      FUN_0040aa50();

    }

  }

  if (((byte)*(undefined4 *)(uVar1 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x6c);

  }

  FUN_00401a80(&param_3,&param_3,uVar1);

  if (((byte)*(undefined4 *)(uVar1 + 4) & 5) == 1) {

    piVar6 = (int *)FUN_0052dcf0(local_c);

    iVar3 = *piVar6;

    piVar9 = (int *)piVar6[1];

    iVar10 = piVar6[2];

LAB_00429843:

    iVar11 = iVar10;

    if (iVar10 != 0) {

      do {

        FUN_004449f0(iVar11,uVar1);

        FUN_0042a330(uVar1);

        iVar11 = *(int *)(iVar11 + 4);

      } while (iVar11 != 0);

      do {

        piVar9 = piVar9 + 1;

        iVar10 = iVar11;

        if (piVar9 == (int *)(*(int *)(iVar3 + 0x60) + *(int *)(iVar3 + 0x68) * 4)) break;

        iVar10 = *piVar9;

      } while (iVar10 == 0);

      goto LAB_00429843;

    }

  }

  if ((*(byte *)(uVar1 + 4) & 5) == 0) {

    uVar8 = FUN_0040a8f0();

    if (uVar8 < param_3) {

LAB_004298e8:

      FUN_0040aa50();

    }

    else {

      uVar8 = 0;

      uVar5 = 0;

      if (param_3 != 0) {

        while( true ) {

          uVar7 = FUN_00429900(uVar5);

          FUN_004449f0(uVar7,uVar1);

          FUN_0042a330(uVar1);

          if ((*(uint *)(uVar1 + 4) >> 2 & 1) != 0) break;

          cVar2 = FUN_00599310(uVar7,uVar5);

          if (cVar2 == '\0') goto LAB_004298e8;

          uVar8 = uVar8 + 1;

          uVar5 = uVar7;

          if (param_3 <= uVar8) {

            return;

          }

        }

      }

    }

  }

  return;

}





// --- FUN_00429900 at 0x00429900 (size: 29) ---


int FUN_00429900(void)



{

  int iVar1;

  

  iVar1 = FUN_005df0f5(0x10);

  if (iVar1 != 0) {

    *(undefined4 *)(iVar1 + 4) = 0;

    *(undefined4 *)(iVar1 + 8) = 0;

    *(undefined4 *)(iVar1 + 0xc) = 0;

    return iVar1;

  }

  return 0;

}





// --- FUN_00429920 at 0x00429920 (size: 25) ---


uint __thiscall FUN_00429920(int param_1,undefined4 *param_2)



{

  undefined4 uVar1;

  uint in_EAX;

  

  if (*(int *)(param_1 + 0xc) != 10) {

    return in_EAX & 0xffffff00;

  }

  uVar1 = *(undefined4 *)(param_1 + 0x1c);

  *param_2 = uVar1;

  return CONCAT31((int3)((uint)uVar1 >> 8),1);

}





// --- FUN_00429940 at 0x00429940 (size: 20) ---


uint __fastcall FUN_00429940(int param_1)



{

  uint in_EAX;

  uint uVar1;

  

  if (*(int **)(param_1 + 4) != (int *)0x0) {

                    /* WARNING: Could not recover jumptable at 0x00429949. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    uVar1 = (**(code **)(**(int **)(param_1 + 4) + 0xa8))();

    return uVar1;

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00429960 at 0x00429960 (size: 25) ---


undefined4 __fastcall FUN_00429960(int *param_1)



{

  int iVar1;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    return CONCAT31((int3)((uint)iVar1 >> 8),*(int *)(iVar1 + 0xa4) == 0);

  }

  return 0;

}





// --- FUN_00429980 at 0x00429980 (size: 26) ---


undefined4 __fastcall FUN_00429980(int *param_1)



{

  int iVar1;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    return CONCAT31((int3)((uint)iVar1 >> 8),*(int *)(iVar1 + 0xa4) == 1);

  }

  return 0;

}





// --- FUN_004299a0 at 0x004299A0 (size: 16) ---


undefined4 __fastcall FUN_004299a0(int *param_1)



{

  int iVar1;

  

  iVar1 = *param_1;

  if (iVar1 != 0) {

    return CONCAT31((int3)((uint)iVar1 >> 8),*(undefined1 *)(iVar1 + 0xb9));

  }

  return 0;

}





// --- FUN_004299b0 at 0x004299B0 (size: 66) ---


uint __thiscall FUN_004299b0(int *param_1,int *param_2)



{

  char cVar1;

  uint in_EAX;

  

  if ((*param_1 != 0) && ((int *)param_1[1] != (int *)0x0)) {

    in_EAX = 0;

    if (*param_2 != 0) {

      if (*(int *)(*param_1 + 8) == *(int *)(*param_2 + 8)) {

        cVar1 = (**(code **)(*(int *)param_1[1] + 8))(param_2[1]);

        if (cVar1 != '\0') {

          return 1;

        }

      }

      return 0;

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00429a00 at 0x00429A00 (size: 11) ---


undefined4 __fastcall FUN_00429a00(int *param_1)



{

  if (*param_1 == 0) {

    return 0;

  }

  return *(undefined4 *)(*param_1 + 8);

}





// --- FUN_00429a10 at 0x00429A10 (size: 13) ---


undefined4 __fastcall FUN_00429a10(int *param_1)



{

  if (*param_1 != 0) {

    return *(undefined4 *)(*param_1 + 0x10);

  }

  return 0;

}





// --- FUN_00429a20 at 0x00429A20 (size: 43) ---


void __thiscall FUN_00429a20(int *param_1,undefined4 param_2)



{

  if (*param_1 == 0) {

    FUN_004268d0(0,param_2);

    return;

  }

  FUN_004268d0(*(undefined4 *)(*param_1 + 8),param_2);

  return;

}





// --- FUN_00429a50 at 0x00429A50 (size: 31) ---


void __fastcall FUN_00429a50(undefined4 *param_1)



{

  char *_Str;

  int *piVar1;

  

  _Str = (char *)*param_1;

  piVar1 = _errno();

  *piVar1 = 0;

  strtol(_Str,(char **)0x0,0);

  return;

}





// --- FUN_00429a70 at 0x00429A70 (size: 44) ---


undefined4 __thiscall FUN_00429a70(int param_1,undefined4 *param_2)



{

  switch(*(undefined4 *)(param_1 + 0xc)) {

  case 9:

  case 0xf:

  case 0x10:

  case 0x14:

    *param_2 = *(undefined4 *)(param_1 + 0x18);

    return 1;

  default:

    return 0;

  }

}





// --- FUN_00429ab0 at 0x00429AB0 (size: 91) ---


int * __thiscall FUN_00429ab0(int *param_1,int *param_2)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  

  if (param_1 != param_2) {

    puVar2 = (undefined4 *)*param_1;

    if (puVar2 != (undefined4 *)0x0) {

      piVar1 = puVar2 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*puVar2)(1);

      }

      *param_1 = 0;

    }

    iVar3 = *param_2;

    if (iVar3 != 0) {

      *param_1 = iVar3;

      *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;

    }

    puVar2 = (undefined4 *)param_1[1];

    if (puVar2 != (undefined4 *)0x0) {

      piVar1 = puVar2 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*puVar2)(1);

      }

      param_1[1] = 0;

    }

    iVar3 = param_2[1];

    if (iVar3 != 0) {

      param_1[1] = iVar3;

      *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;

    }

  }

  return param_1;

}





// --- FUN_00429b10 at 0x00429B10 (size: 43) ---


void __fastcall FUN_00429b10(int param_1)



{

  undefined4 *puVar1;

  int iVar2;

  undefined4 uVar3;

  

  puVar1 = *(undefined4 **)(param_1 + 4);

  if ((puVar1 != (undefined4 *)0x0) && (puVar1[1] != 1)) {

    iVar2 = puVar1[1] + -1;

    puVar1[1] = iVar2;

    if (iVar2 == 0) {

      (**(code **)*puVar1)(1);

    }

    uVar3 = (**(code **)(**(int **)(param_1 + 4) + 4))();

    *(undefined4 *)(param_1 + 4) = uVar3;

  }

  return;

}





// --- FUN_00429b40 at 0x00429B40 (size: 64) ---


undefined4 * __thiscall FUN_00429b40(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798888;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00429b80 at 0x00429B80 (size: 59) ---


uint __fastcall FUN_00429b80(int param_1)



{

  undefined4 *puVar1;

  uint in_EAX;

  int iVar2;

  undefined4 uVar3;

  uint uVar4;

  

  puVar1 = *(undefined4 **)(param_1 + 4);

  if (puVar1 != (undefined4 *)0x0) {

    if (puVar1[1] != 1) {

      iVar2 = puVar1[1] + -1;

      puVar1[1] = iVar2;

      if (iVar2 == 0) {

        (**(code **)*puVar1)(1);

      }

      uVar3 = (**(code **)(**(int **)(param_1 + 4) + 4))();

      *(undefined4 *)(param_1 + 4) = uVar3;

    }

                    /* WARNING: Could not recover jumptable at 0x00429baf. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    uVar4 = (**(code **)(**(int **)(param_1 + 4) + 0x8c))();

    return uVar4;

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00429bc0 at 0x00429BC0 (size: 59) ---


uint __fastcall FUN_00429bc0(int param_1)



{

  undefined4 *puVar1;

  uint in_EAX;

  int iVar2;

  undefined4 uVar3;

  uint uVar4;

  

  puVar1 = *(undefined4 **)(param_1 + 4);

  if (puVar1 != (undefined4 *)0x0) {

    if (puVar1[1] != 1) {

      iVar2 = puVar1[1] + -1;

      puVar1[1] = iVar2;

      if (iVar2 == 0) {

        (**(code **)*puVar1)(1);

      }

      uVar3 = (**(code **)(**(int **)(param_1 + 4) + 4))();

      *(undefined4 *)(param_1 + 4) = uVar3;

    }

                    /* WARNING: Could not recover jumptable at 0x00429bef. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    uVar4 = (**(code **)(**(int **)(param_1 + 4) + 0xac))();

    return uVar4;

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00429c00 at 0x00429C00 (size: 59) ---


uint __fastcall FUN_00429c00(int param_1)



{

  undefined4 *puVar1;

  uint in_EAX;

  int iVar2;

  undefined4 uVar3;

  uint uVar4;

  

  puVar1 = *(undefined4 **)(param_1 + 4);

  if (puVar1 != (undefined4 *)0x0) {

    if (puVar1[1] != 1) {

      iVar2 = puVar1[1] + -1;

      puVar1[1] = iVar2;

      if (iVar2 == 0) {

        (**(code **)*puVar1)(1);

      }

      uVar3 = (**(code **)(**(int **)(param_1 + 4) + 4))();

      *(undefined4 *)(param_1 + 4) = uVar3;

    }

                    /* WARNING: Could not recover jumptable at 0x00429c2f. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    uVar4 = (**(code **)(**(int **)(param_1 + 4) + 0xc4))();

    return uVar4;

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00429c40 at 0x00429C40 (size: 33) ---


undefined4 * __fastcall FUN_00429c40(undefined4 *param_1)



{

  LONG *lpAddend;

  

  *param_1 = &PTR_FUN_00798140;

  lpAddend = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[1] = PTR_DAT_00818344;

  InterlockedIncrement(lpAddend);

  return param_1;

}





// --- FUN_00429c70 at 0x00429C70 (size: 44) ---


undefined4 * FUN_00429c70(undefined4 *param_1)



{

  undefined4 *puVar1;

  undefined1 local_c [12];

  

  puVar1 = (undefined4 *)FUN_0052dcf0(local_c);

  *param_1 = *puVar1;

  param_1[1] = puVar1[1];

  param_1[2] = puVar1[2];

  return param_1;

}





// --- FUN_00429ca0 at 0x00429CA0 (size: 55) ---


void __fastcall FUN_00429ca0(int *param_1)



{

  int iVar1;

  int iVar2;

  int *piVar3;

  

  iVar1 = *(int *)(param_1[2] + 4);

  param_1[2] = iVar1;

  if (iVar1 == 0) {

    iVar1 = *(int *)(*param_1 + 0x68);

    iVar2 = *(int *)(*param_1 + 0x60);

    do {

      piVar3 = (int *)(param_1[1] + 4);

      param_1[1] = (int)piVar3;

      if (piVar3 == (int *)(iVar2 + iVar1 * 4)) {

        return;

      }

    } while (*piVar3 == 0);

    param_1[2] = *piVar3;

  }

  return;

}





// --- FUN_00429ce0 at 0x00429CE0 (size: 416) ---


void __thiscall FUN_00429ce0(int *param_1,undefined4 param_2)



{

  int *piVar1;

  char cVar2;

  undefined4 uVar3;

  int *piVar4;

  int iVar5;

  int iVar6;

  undefined4 uVar7;

  int *local_a0;

  undefined4 local_9c [2];

  int iStack_94;

  undefined1 local_90 [144];

  

  FUN_00425ba0();

  piVar1 = local_a0;

  if (local_a0 != (int *)0x0) {

    uVar7 = 0;

    uVar3 = FUN_004220b0(local_a0[10],0);

    FUN_0041a4e0(uVar3,uVar7);

  }

  if (*param_1 == 0) {

    uVar3 = 0;

  }

  else {

    uVar3 = *(undefined4 *)(*param_1 + 0xc);

  }

  switch(uVar3) {

  case 8:

    FUN_0042dc80();

    if (((int *)param_1[1] != (int *)0x0) &&

       (cVar2 = (**(code **)(*(int *)param_1[1] + 0xc0))(local_90), cVar2 != '\0')) {

      FUN_0042ced0(param_2);

    }

    FUN_0042e590();

    break;

  case 10:

    if (((int *)param_1[1] != (int *)0x0) &&

       (cVar2 = (**(code **)(*(int *)param_1[1] + 0xb0))(local_9c), cVar2 != '\0')) {

      local_a0 = (int *)0x0;

      if (*param_1 != 0) {

        FUN_00429920(&local_a0);

      }

      FUN_0041aaa0(local_9c[0],local_a0);

    }

    break;

  case 0x11:

    if ((int *)param_1[1] == (int *)0x0) {

LAB_00429e68:

      if (piVar1 == (int *)0x0) {

        return;

      }

      (**(code **)(*piVar1 + 0x14))();

      return;

    }

    piVar4 = (int *)(**(code **)(*(int *)param_1[1] + 0x108))();

    if (piVar4 == (int *)0x0) {

LAB_00429e53:

      FUN_0049b890();

      return;

    }

    iVar6 = *piVar4;

    iVar5 = iVar6 + piVar4[2] * 8;

    for (; iVar6 != iVar5; iVar6 = iVar6 + 8) {

      FUN_00429ce0(param_2);

    }

    break;

  case 0x12:

    if ((int *)param_1[1] == (int *)0x0) goto LAB_00429e68;

    iVar5 = (**(code **)(*(int *)param_1[1] + 0x128))();

    if (iVar5 == 0) goto LAB_00429e53;

    FUN_00429c70(local_9c);

    while (iStack_94 != 0) {

      FUN_00429ce0(param_2);

      FUN_00429ca0();

    }

  }

  if (piVar1 != (int *)0x0) {

    (**(code **)(*piVar1 + 0x14))();

  }

  return;

}





// --- FUN_00429ea0 at 0x00429EA0 (size: 157) ---


undefined4 __thiscall FUN_00429ea0(int *param_1,undefined *param_2)



{

  char cVar1;

  undefined4 uVar2;

  int iVar3;

  undefined *puVar4;

  

  if (((param_2 != (undefined *)0x0) && (*param_1 != 0)) && (param_1[1] != 0)) {

    param_2 = PTR_DAT_00818344;

    InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

    uVar2 = 0;

    if (*param_1 != 0) {

      uVar2 = *(undefined4 *)(*param_1 + 8);

    }

    cVar1 = FUN_004268d0(uVar2,&param_2);

    if (cVar1 != '\0') {

      puVar4 = param_2;

      InterlockedIncrement((LONG *)(param_2 + -0x10));

      iVar3 = FUN_00426f90(puVar4);

      if ((iVar3 != 0) &&

         (cVar1 = (**(code **)(*(int *)param_1[1] + 100))(*param_1,iVar3), cVar1 != '\0')) {

        FUN_004011b0();

        return 1;

      }

    }

    FUN_004011b0();

  }

  return 0;

}





// --- FUN_00429f40 at 0x00429F40 (size: 87) ---


undefined4 __thiscall FUN_00429f40(int *param_1,undefined4 param_2)



{

  char cVar1;

  undefined4 extraout_ECX;

  undefined4 uVar2;

  

  if ((*param_1 != 0) && (param_1[1] != 0)) {

    if (*(int *)(*param_1 + 8) != 0) {

      FUN_00429b10();

    }

    cVar1 = (**(code **)(*(int *)param_1[1] + 0x60))(*param_1,param_2);

    if (cVar1 != '\0') {

      return 1;

    }

    uVar2 = extraout_ECX;

    FUN_00401340("unable to read property value");

    FUN_0065d620(param_2,uVar2);

  }

  return 0;

}





// --- FUN_00429fa0 at 0x00429FA0 (size: 143) ---


undefined4 * __thiscall FUN_00429fa0(undefined4 *param_1,undefined4 param_2)



{

  undefined *puVar1;

  uint *puVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  undefined4 *puVar6;

  

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  *param_1 = &PTR_FUN_00798888;

  puVar1 = PTR_DAT_00818558;

  puVar2 = (uint *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_2,param_2,0);

  if (puVar2 == (uint *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  uVar4 = *puVar2;

  param_1[0x1a] = uVar4;

  if (uVar4 < 0x18) {

    param_1[0x18] = param_1 + 1;

  }

  else {

    uVar3 = thunk_FUN_005df0f5(uVar4 << 2);

    param_1[0x18] = uVar3;

  }

  param_1[0x19] = (undefined4 *)param_1[0x18] + param_1[0x1a];

  puVar6 = (undefined4 *)param_1[0x18];

  for (uVar4 = param_1[0x1a] & 0x3fffffff; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar6 = 0;

    puVar6 = puVar6 + 1;

  }

  for (iVar5 = 0; iVar5 != 0; iVar5 = iVar5 + -1) {

    *(undefined1 *)puVar6 = 0;

    puVar6 = (undefined4 *)((int)puVar6 + 1);

  }

  return param_1;

}





// --- FUN_0042a030 at 0x0042A030 (size: 143) ---


void __fastcall FUN_0042a030(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  void *pvVar3;

  void *pvVar4;

  int *piVar5;

  void *pvVar6;

  

  iVar1 = *(int *)(param_1 + 0x6c);

  do {

    if (iVar1 == 0) {

      return;

    }

    piVar5 = *(int **)(param_1 + 100);

    while (piVar5 != (int *)(*(int *)(param_1 + 0x60) + *(int *)(param_1 + 0x68) * 4)) {

      if (**(int **)(param_1 + 100) != 0) {

        piVar5 = *(int **)(param_1 + 100);

        pvVar6 = (void *)*piVar5;

        goto LAB_0042a06f;

      }

      piVar5 = *(int **)(param_1 + 100) + 1;

      *(int **)(param_1 + 100) = piVar5;

    }

    piVar5 = (int *)0x0;

    pvVar6 = (void *)0x0;

LAB_0042a06f:

    pvVar4 = (void *)*piVar5;

    if (pvVar4 == pvVar6) {

LAB_0042a082:

      *piVar5 = *(int *)((int)pvVar4 + 4);

    }

    else {

      do {

        pvVar3 = pvVar4;

        pvVar4 = *(void **)((int)pvVar3 + 4);

      } while (pvVar4 != pvVar6);

      if (pvVar3 == (void *)0x0) goto LAB_0042a082;

      *(undefined4 *)((int)pvVar3 + 4) = *(undefined4 *)((int)pvVar4 + 4);

    }

    *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + -1;

    if (pvVar6 != (void *)0x0) {

      puVar2 = *(undefined4 **)((int)pvVar6 + 8);

      if (puVar2 != (undefined4 *)0x0) {

        piVar5 = puVar2 + 1;

        *piVar5 = *piVar5 + -1;

        if (*piVar5 == 0) {

          (**(code **)*puVar2)(1);

        }

      }

      operator_delete(pvVar6);

    }

    iVar1 = *(int *)(param_1 + 0x6c);

  } while( true );

}





// --- FUN_0042a0c0 at 0x0042A0C0 (size: 113) ---


undefined4 FUN_0042a0c0(undefined4 *param_1,int *param_2)



{

  int *piVar1;

  int iVar2;

  undefined4 *puVar3;

  char cVar4;

  undefined4 *puVar5;

  

  puVar5 = (undefined4 *)FUN_005df0f5(0xc);

  if (puVar5 == (undefined4 *)0x0) {

    puVar5 = (undefined4 *)0x0;

  }

  else {

    *puVar5 = *param_1;

    puVar5[1] = 0;

    iVar2 = *param_2;

    puVar5[2] = iVar2;

    if (iVar2 != 0) {

      *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + 1;

    }

  }

  cVar4 = FUN_0042bd40(puVar5);

  if (cVar4 != '\0') {

    return 1;

  }

  if (puVar5 != (undefined4 *)0x0) {

    puVar3 = (undefined4 *)puVar5[2];

    if (puVar3 != (undefined4 *)0x0) {

      piVar1 = puVar3 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*puVar3)(1);

      }

    }

    operator_delete(puVar5);

  }

  return 0;

}





// --- FUN_0042a140 at 0x0042A140 (size: 123) ---


undefined4 * FUN_0042a140(uint param_1)



{

  int *piVar1;

  uint *puVar2;

  undefined4 *puVar3;

  undefined4 *local_4;

  

  puVar2 = *(uint **)(DAT_00818944 + (param_1 % DAT_0081894c) * 4);

  do {

    if (puVar2 == (uint *)0x0) {

LAB_0042a16b:

      puVar3 = (undefined4 *)FUN_004293c0(param_1);

      if (puVar3 != (undefined4 *)0x0) {

        puVar3[1] = puVar3[1] + 1;

        local_4 = puVar3;

        FUN_0042a0c0(&param_1,&local_4);

        piVar1 = puVar3 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar3)(1);

        }

      }

      return puVar3;

    }

    if (*puVar2 == param_1) {

      if ((puVar2 != (uint *)0x0) && (puVar2 + 2 != (uint *)0x0)) {

        puVar3 = (undefined4 *)puVar2[2];

        piVar1 = puVar3 + 1;

        *piVar1 = *piVar1 + 1;

        return puVar3;

      }

      goto LAB_0042a16b;

    }

    puVar2 = (uint *)puVar2[1];

  } while( true );

}





// --- FUN_0042a1c0 at 0x0042A1C0 (size: 96) ---


uint __fastcall FUN_0042a1c0(int *param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  int iVar4;

  uint uVar5;

  undefined4 uVar6;

  

  if (*param_1 != 0) {

    puVar2 = (undefined4 *)param_1[1];

    if (puVar2 != (undefined4 *)0x0) {

      piVar1 = puVar2 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*puVar2)(1);

      }

      param_1[1] = 0;

    }

    iVar3 = *param_1;

    iVar4 = *(int *)(iVar3 + 0x20);

    if (iVar4 != 0) {

      param_1[1] = iVar4;

      *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 1;

      return CONCAT31((int3)((uint)iVar4 >> 8),1);

    }

    if (iVar3 == 0) {

      uVar6 = 0;

    }

    else {

      uVar6 = *(undefined4 *)(iVar3 + 0xc);

    }

    uVar5 = FUN_0042a140(uVar6);

    param_1[1] = uVar5;

    if (uVar5 != 0) {

      return uVar5 & 0xffffff00;

    }

  }

  return 0;

}





// --- FUN_0042a220 at 0x0042A220 (size: 82) ---


undefined4 * __thiscall FUN_0042a220(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_007988b4;

  FUN_0042a030();

  param_1[1] = &PTR_FUN_00798888;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042a280 at 0x0042A280 (size: 77) ---


undefined4 __thiscall FUN_0042a280(int *param_1,int param_2)



{

  int *piVar1;

  undefined4 *puVar2;

  

  puVar2 = (undefined4 *)*param_1;

  if (puVar2 != (undefined4 *)0x0) {

    piVar1 = puVar2 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar2)(1);

    }

    *param_1 = 0;

  }

  puVar2 = (undefined4 *)param_1[1];

  if (puVar2 != (undefined4 *)0x0) {

    piVar1 = puVar2 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar2)(1);

    }

    param_1[1] = 0;

  }

  if (param_2 != 0) {

    *param_1 = param_2;

    *(int *)(param_2 + 4) = *(int *)(param_2 + 4) + 1;

    FUN_0042a1c0();

  }

  return 1;

}





// --- FUN_0042a2d0 at 0x0042A2D0 (size: 83) ---


uint FUN_0042a2d0(int *param_1)



{

  uint uVar1;

  int iVar2;

  

  iVar2 = 0;

  if (param_1 == (int *)0x0) {

LAB_0042a306:

    uVar1 = FUN_0042a280(iVar2);

    return uVar1;

  }

  uVar1 = FUN_00425ba0();

  if (param_1 != (int *)0x0) {

    iVar2 = FUN_004284b0(param_1);

    if (iVar2 != 0) {

      (**(code **)(*param_1 + 0x14))();

      goto LAB_0042a306;

    }

    uVar1 = (**(code **)(*param_1 + 0x14))();

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_0042a330 at 0x0042A330 (size: 231) ---


void __thiscall FUN_0042a330(int *param_1,int param_2)



{

  char cVar1;

  undefined4 *puVar2;

  int *piVar3;

  int iVar4;

  undefined4 uVar5;

  

  if ((*(byte *)(param_2 + 4) & 1) != 0) {

    if (*param_1 == 0) {

      uVar5 = 0;

    }

    else {

      uVar5 = *(undefined4 *)(*param_1 + 8);

    }

    FUN_0040ad10(4);

    puVar2 = (undefined4 *)FUN_0040acf0(4);

    if ((puVar2 != (undefined4 *)0x0) && ((*(byte *)(param_2 + 4) & 1) != 0)) {

      *puVar2 = uVar5;

    }

  }

  if ((~*(byte *)(param_2 + 4) & 1) != 0) {

    FUN_0040ad10(4);

    piVar3 = (int *)FUN_0040acf0(4);

    iVar4 = param_2;

    if (piVar3 != (int *)0x0) {

      if ((*(byte *)(param_2 + 4) & 1) == 0) {

        iVar4 = *piVar3;

      }

      else {

        *piVar3 = param_2;

      }

    }

    cVar1 = FUN_0042a2d0(iVar4);

    if (cVar1 == '\0') {

      FUN_0040aa50();

    }

    if (*param_1 == 0) {

      return;

    }

    if (((*(int *)(*param_1 + 8) != 0) &&

        (puVar2 = (undefined4 *)param_1[1], puVar2 != (undefined4 *)0x0)) && (puVar2[1] != 1)) {

      iVar4 = puVar2[1] + -1;

      puVar2[1] = iVar4;

      if (iVar4 == 0) {

        (**(code **)*puVar2)(1);

      }

      iVar4 = (**(code **)(*(int *)param_1[1] + 4))();

      param_1[1] = iVar4;

    }

  }

  if ((*param_1 != 0) && (iVar4 = *(int *)(*param_1 + 8), iVar4 != 0)) {

    if ((int *)param_1[1] == (int *)0x0) {

      FUN_0040aa50();

      return;

    }

    (**(code **)(*(int *)param_1[1] + 0x5c))(param_2,iVar4);

  }

  return;

}





// --- FUN_0042a420 at 0x0042A420 (size: 220) ---


undefined4 FUN_0042a420(undefined *param_1)



{

  int iVar1;

  char cVar2;

  LONG LVar3;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 *puVar4;

  undefined4 uVar5;

  undefined *puVar6;

  undefined4 local_4;

  

  iVar1 = (int)param_1;

  if (param_1 != (undefined *)0x0) {

    param_1 = PTR_DAT_00818344;

    InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

    FUN_00426020(&param_1);

    cVar2 = FUN_004271f0(&param_1,&local_4);

    if (cVar2 == '\0') {

      uVar5 = extraout_ECX;

      puVar6 = param_1;

      FUN_00401340("invalid property name \'%s\'");

      FUN_0065d620(iVar1,uVar5,puVar6);

    }

    else {

      cVar2 = FUN_0042a2d0(local_4);

      if (cVar2 != '\0') {

        cVar2 = FUN_00429f40(iVar1);

        if (cVar2 == '\0') {

          FUN_004011b0();

          return 0;

        }

        FUN_004011b0();

        return 1;

      }

      uVar5 = extraout_ECX_00;

      FUN_00401340("unable to initialize property");

      FUN_0065d620(iVar1,uVar5);

    }

    puVar4 = (undefined4 *)(param_1 + -0x14);

    LVar3 = InterlockedDecrement((LONG *)(param_1 + -0x10));

    if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

      (**(code **)*puVar4)(1);

    }

  }

  return 0;

}





// --- FUN_0042a500 at 0x0042A500 (size: 64) ---


uint __thiscall FUN_0042a500(int param_1,undefined4 param_2,undefined4 param_3)



{

  uint uVar1;

  

  uVar1 = *(uint *)(param_1 + 0xc);

  if (uVar1 == 9) {

    uVar1 = FUN_0041b220(*(undefined4 *)(param_1 + 0x18),param_2,param_3);

    return uVar1;

  }

  if (uVar1 == 0x14) {

    uVar1 = FUN_004268d0(param_2,param_3);

    return uVar1;

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_0042a540 at 0x0042A540 (size: 64) ---


undefined4 * __thiscall FUN_0042a540(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798908;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042a580 at 0x0042A580 (size: 48) ---


void __fastcall FUN_0042a580(int param_1)



{

  switch(*(int *)(param_1 + 0xc)) {

  case 9:

  case 0xf:

  case 0x10:

  case 0x14:

                    /* WARNING: Could not recover jumptable at 0x0042a5a3. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    (**(code **)(&DAT_0042a5e0 + (uint)(&BYTE_0042a5df)[*(int *)(param_1 + 0xc)] * 4))();

    return;

  default:

    return;

  }

}





// --- FUN_0042a600 at 0x0042A600 (size: 1048) ---


void __thiscall FUN_0042a600(int param_1,uint param_2)



{

  uint uVar1;

  undefined4 *puVar2;

  int *piVar3;

  byte *pbVar4;

  int iVar5;

  byte bVar6;

  undefined4 uVar7;

  

  uVar1 = param_2;

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 8) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 8);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0xc) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 0xc);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0x10) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 0x10);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0x14) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 0x14);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0x18) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 0x18);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0x1c) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 0x1c);

    }

  }

  if ((*(byte *)(uVar1 + 4) & 1) == 0) {

    if ((~*(byte *)(uVar1 + 4) & 1) != 0) {

      puVar2 = *(undefined4 **)(param_1 + 0x20);

      if (puVar2 != (undefined4 *)0x0) {

        piVar3 = puVar2 + 1;

        *piVar3 = *piVar3 + -1;

        if (*piVar3 == 0) {

          (**(code **)*puVar2)(1);

        }

        *(undefined4 *)(param_1 + 0x20) = 0;

      }

      param_2 = param_2 & 0xffffff00;

      FUN_00422250(&param_2,uVar1);

      if ((char)param_2 != '\0') {

        piVar3 = (int *)FUN_004293c0(*(undefined4 *)(param_1 + 0xc));

        *(int **)(param_1 + 0x20) = piVar3;

        if (piVar3 != (int *)0x0) {

          uVar7 = *(undefined4 *)(param_1 + 8);

          iVar5 = *piVar3;

          goto LAB_0042a77e;

        }

      }

    }

  }

  else {

    param_2 = CONCAT31(param_2._1_3_,*(int *)(param_1 + 0x20) != 0);

    FUN_00422250(&param_2,uVar1);

    if (*(int **)(param_1 + 0x20) != (int *)0x0) {

      uVar7 = *(undefined4 *)(param_1 + 8);

      iVar5 = **(int **)(param_1 + 0x20);

LAB_0042a77e:

      (**(code **)(iVar5 + 0x5c))(uVar1,uVar7);

    }

  }

  if ((*(byte *)(uVar1 + 4) & 1) == 0) {

    if ((~*(byte *)(uVar1 + 4) & 1) != 0) {

      puVar2 = *(undefined4 **)(param_1 + 0x24);

      if (puVar2 != (undefined4 *)0x0) {

        piVar3 = puVar2 + 1;

        *piVar3 = *piVar3 + -1;

        if (*piVar3 == 0) {

          (**(code **)*puVar2)(1);

        }

        *(undefined4 *)(param_1 + 0x24) = 0;

      }

      param_2 = param_2 & 0xffffff00;

      FUN_00422250(&param_2,uVar1);

      if ((char)param_2 != '\0') {

        piVar3 = (int *)FUN_004293c0(*(undefined4 *)(param_1 + 0xc));

        *(int **)(param_1 + 0x24) = piVar3;

        if (piVar3 != (int *)0x0) {

          uVar7 = *(undefined4 *)(param_1 + 8);

          iVar5 = *piVar3;

          goto LAB_0042a807;

        }

      }

    }

  }

  else {

    param_2 = CONCAT31(param_2._1_3_,*(int *)(param_1 + 0x24) != 0);

    FUN_00422250(&param_2,uVar1);

    if (*(int **)(param_1 + 0x24) != (int *)0x0) {

      uVar7 = *(undefined4 *)(param_1 + 8);

      iVar5 = **(int **)(param_1 + 0x24);

LAB_0042a807:

      (**(code **)(iVar5 + 0x5c))(uVar1,uVar7);

    }

  }

  if ((*(byte *)(uVar1 + 4) & 1) == 0) {

    if ((~*(byte *)(uVar1 + 4) & 1) == 0) goto LAB_0042a894;

    puVar2 = *(undefined4 **)(param_1 + 0x28);

    if (puVar2 != (undefined4 *)0x0) {

      piVar3 = puVar2 + 1;

      *piVar3 = *piVar3 + -1;

      if (*piVar3 == 0) {

        (**(code **)*puVar2)(1);

      }

      *(undefined4 *)(param_1 + 0x28) = 0;

    }

    param_2 = param_2 & 0xffffff00;

    FUN_00422250(&param_2,uVar1);

    if ((char)param_2 == '\0') goto LAB_0042a894;

    piVar3 = (int *)FUN_004293c0(*(undefined4 *)(param_1 + 0xc));

    *(int **)(param_1 + 0x28) = piVar3;

    if (piVar3 == (int *)0x0) goto LAB_0042a894;

    uVar7 = *(undefined4 *)(param_1 + 8);

    iVar5 = *piVar3;

  }

  else {

    param_2 = CONCAT31(param_2._1_3_,*(int *)(param_1 + 0x28) != 0);

    FUN_00422250(&param_2,uVar1);

    if (*(int **)(param_1 + 0x28) == (int *)0x0) goto LAB_0042a894;

    uVar7 = *(undefined4 *)(param_1 + 8);

    iVar5 = **(int **)(param_1 + 0x28);

  }

  (**(code **)(iVar5 + 0x5c))(uVar1,uVar7);

LAB_0042a894:

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 200) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 200);

    }

  }

  bVar6 = *(byte *)(param_1 + 0xa0);

  FUN_0040ad10(1);

  pbVar4 = (byte *)FUN_0040acf0(1);

  if (pbVar4 != (byte *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      bVar6 = *pbVar4;

    }

    else {

      *pbVar4 = bVar6;

    }

  }

  if ((*(byte *)(uVar1 + 4) & 5) == 0) {

    *(uint *)(param_1 + 0xa0) = (uint)bVar6;

  }

  bVar6 = *(byte *)(param_1 + 0xa4);

  FUN_0040ad10(1);

  pbVar4 = (byte *)FUN_0040acf0(1);

  if (pbVar4 != (byte *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      bVar6 = *pbVar4;

    }

    else {

      *pbVar4 = bVar6;

    }

  }

  if ((*(byte *)(uVar1 + 4) & 5) == 0) {

    *(uint *)(param_1 + 0xa4) = (uint)bVar6;

  }

  bVar6 = *(byte *)(param_1 + 0xa8);

  FUN_0040ad10(1);

  pbVar4 = (byte *)FUN_0040acf0(1);

  if (pbVar4 != (byte *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      bVar6 = *pbVar4;

    }

    else {

      *pbVar4 = bVar6;

    }

  }

  if ((*(byte *)(uVar1 + 4) & 5) == 0) {

    *(uint *)(param_1 + 0xa8) = (uint)bVar6;

  }

  bVar6 = *(byte *)(param_1 + 0xac);

  FUN_0040ad10(1);

  pbVar4 = (byte *)FUN_0040acf0(1);

  if (pbVar4 != (byte *)0x0) {

    if ((*(byte *)(uVar1 + 4) & 1) == 0) {

      bVar6 = *pbVar4;

    }

    else {

      *pbVar4 = bVar6;

    }

  }

  if ((*(byte *)(uVar1 + 4) & 5) == 0) {

    *(uint *)(param_1 + 0xac) = (uint)bVar6;

  }

  FUN_00422250(param_1 + 0xb0,uVar1);

  FUN_00422250(param_1 + 0xb1,uVar1);

  FUN_00422250(param_1 + 0xb3,uVar1);

  FUN_00422250(param_1 + 0xb8,uVar1);

  FUN_00422250(param_1 + 0xb7,uVar1);

  FUN_00422250(param_1 + 0xb4,uVar1);

  FUN_00422250(param_1 + 0xb5,uVar1);

  FUN_00422250(param_1 + 0xb2,uVar1);

  FUN_0042c070(uVar1);

  return;

}





// --- FUN_0042aa20 at 0x0042AA20 (size: 120) ---


void FUN_0042aa20(void)



{

  int iVar1;

  int *piVar2;

  int *piVar3;

  undefined4 *puVar4;

  int *local_10;

  undefined1 local_c [12];

  

  FUN_00425ba0();

  if (local_10 != (int *)0x0) {

    piVar2 = (int *)FUN_0052dcf0(local_c);

    piVar3 = (int *)piVar2[2];

    iVar1 = *piVar2;

    puVar4 = (undefined4 *)piVar2[1];

    while (piVar3 != (int *)0x0) {

      do {

        if (*piVar3 != 0) {

          FUN_0042be30(*piVar3);

        }

        piVar3 = (int *)piVar3[1];

      } while (piVar3 != (int *)0x0);

      do {

        puVar4 = puVar4 + 1;

        if (puVar4 == (undefined4 *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4))

        goto LAB_0042aa88;

        piVar3 = (int *)*puVar4;

      } while (piVar3 == (int *)0x0);

    }

LAB_0042aa88:

    (**(code **)(*local_10 + 0x14))();

  }

  return;

}





// --- FUN_0042aaa0 at 0x0042AAA0 (size: 34) ---


undefined ** __fastcall FUN_0042aaa0(int param_1)



{

  if (*(char *)(param_1 + 0xb6) != '\0') {

    if (DAT_008189d8 == 0) {

      FUN_0042aa20();

    }

    return &PTR_PTR_00818968;

  }

  return (undefined **)(param_1 + 0x2c);

}





// --- FUN_0042aad0 at 0x0042AAD0 (size: 143) ---


undefined4 * __thiscall FUN_0042aad0(undefined4 *param_1,undefined4 param_2)



{

  undefined *puVar1;

  uint *puVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  undefined4 *puVar6;

  

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  *param_1 = &PTR_FUN_00798908;

  puVar1 = PTR_DAT_00818558;

  puVar2 = (uint *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_2,param_2,0);

  if (puVar2 == (uint *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  uVar4 = *puVar2;

  param_1[0x1a] = uVar4;

  if (uVar4 < 0x18) {

    param_1[0x18] = param_1 + 1;

  }

  else {

    uVar3 = thunk_FUN_005df0f5(uVar4 << 2);

    param_1[0x18] = uVar3;

  }

  param_1[0x19] = (undefined4 *)param_1[0x18] + param_1[0x1a];

  puVar6 = (undefined4 *)param_1[0x18];

  for (uVar4 = param_1[0x1a] & 0x3fffffff; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar6 = 0;

    puVar6 = puVar6 + 1;

  }

  for (iVar5 = 0; iVar5 != 0; iVar5 = iVar5 + -1) {

    *(undefined1 *)puVar6 = 0;

    puVar6 = (undefined4 *)((int)puVar6 + 1);

  }

  return param_1;

}





// --- FUN_0042ab60 at 0x0042AB60 (size: 67) ---


void FUN_0042ab60(undefined4 param_1)



{

  undefined *puVar1;

  undefined4 *puVar2;

  

  puVar1 = PTR_DAT_00818558;

  puVar2 = (undefined4 *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_1,param_1,0);

  if (puVar2 == (undefined4 *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  FUN_0046c280(*puVar2);

  return;

}





// --- FUN_0042abb0 at 0x0042ABB0 (size: 82) ---


undefined4 * __thiscall FUN_0042abb0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_0079890c;

  FUN_005870f0();

  param_1[1] = &PTR_FUN_00798908;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042ac10 at 0x0042AC10 (size: 207) ---


undefined4 * __fastcall FUN_0042ac10(undefined4 *param_1)



{

  LONG *lpAddend;

  

  param_1[1] = 1;

  *param_1 = &PTR_FUN_00798910;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[5] = 1;

  param_1[6] = 0;

  param_1[7] = 0;

  param_1[8] = 0;

  param_1[9] = 0;

  param_1[10] = 0;

  param_1[0xb] = &PTR_FUN_0079890c;

  FUN_0042aad0(0x17);

  param_1[0x28] = 2;

  param_1[0x29] = 2;

  param_1[0x2a] = 4;

  param_1[0x2b] = 0;

  *(undefined1 *)(param_1 + 0x2c) = 0;

  *(undefined1 *)((int)param_1 + 0xb1) = 0;

  *(undefined1 *)((int)param_1 + 0xb2) = 0;

  *(undefined1 *)((int)param_1 + 0xb3) = 0;

  *(undefined1 *)(param_1 + 0x2d) = 0;

  *(undefined1 *)((int)param_1 + 0xb5) = 0;

  *(undefined1 *)((int)param_1 + 0xb6) = 0;

  *(undefined1 *)((int)param_1 + 0xb7) = 0;

  *(undefined1 *)(param_1 + 0x2e) = 0;

  param_1[0x2f] = 0;

  param_1[0x30] = 0xffff;

  lpAddend = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[0x31] = PTR_DAT_00818344;

  InterlockedIncrement(lpAddend);

  param_1[0x32] = DAT_007988f4;

  return param_1;

}





// --- FUN_0042ace0 at 0x0042ACE0 (size: 175) ---


void __fastcall FUN_0042ace0(undefined4 *param_1)



{

  int *piVar1;

  LONG LVar2;

  undefined4 *puVar3;

  

  puVar3 = (undefined4 *)param_1[8];

  *param_1 = &PTR_FUN_00798910;

  if (puVar3 != (undefined4 *)0x0) {

    piVar1 = puVar3 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar3)(1);

    }

    param_1[8] = 0;

  }

  puVar3 = (undefined4 *)param_1[9];

  if (puVar3 != (undefined4 *)0x0) {

    piVar1 = puVar3 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar3)(1);

    }

    param_1[9] = 0;

  }

  puVar3 = (undefined4 *)param_1[10];

  if (puVar3 != (undefined4 *)0x0) {

    piVar1 = puVar3 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar3)(1);

    }

    param_1[10] = 0;

  }

  puVar3 = (undefined4 *)(param_1[0x31] + -0x14);

  LVar2 = InterlockedDecrement((LONG *)(param_1[0x31] + -0x10));

  if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

    (**(code **)*puVar3)(1);

  }

  param_1[0xb] = &PTR_FUN_0079890c;

  FUN_005870f0();

  param_1[0xc] = &PTR_FUN_00798908;

  if ((undefined4 *)param_1[0x24] != param_1 + 0xd) {

    operator_delete__((undefined4 *)param_1[0x24]);

  }

  param_1[0x24] = 0;

  param_1[0x25] = 0;

  param_1[0x26] = 0;

  param_1[0x27] = 0;

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_0042ad90 at 0x0042AD90 (size: 30) ---


void * __thiscall FUN_0042ad90(void *param_1,byte param_2)



{

  FUN_0042ace0();

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042af10 at 0x0042AF10 (size: 181) ---


undefined4 * __thiscall FUN_0042af10(int *param_1,undefined4 *param_2,int *param_3)



{

  int *piVar1;

  int iVar2;

  undefined *puVar3;

  LONG LVar4;

  int *piVar5;

  

  puVar3 = PTR_DAT_00818344;

  InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

  if (param_1[2] != 0) {

    piVar5 = (int *)*param_1;

    piVar1 = piVar5 + param_1[2] + -1;

    for (; piVar5 != piVar1; piVar5 = piVar5 + 1) {

      iVar2 = *(int *)(*piVar5 + -4);

      if (iVar2 != 1) {

        FUN_00404ef0(*piVar5,iVar2 + -1);

      }

      iVar2 = *(int *)(*param_3 + -4);

      if (iVar2 != 1) {

        FUN_00404ef0(*param_3,iVar2 + -1);

      }

    }

    iVar2 = *(int *)(*piVar5 + -4);

    if (iVar2 != 1) {

      FUN_00404ef0(*piVar5,iVar2 + -1);

    }

  }

  *param_2 = puVar3;

  InterlockedIncrement((LONG *)(puVar3 + -0x10));

  LVar4 = InterlockedDecrement((LONG *)(puVar3 + -0x10));

  if ((LVar4 == 0) && ((undefined4 *)(puVar3 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(puVar3 + -0x14))(1);

  }

  return param_2;

}





// --- FUN_0042b1b0 at 0x0042B1B0 (size: 97) ---


/* WARNING: Removing unreachable block (ram,0x0042b23e) */



undefined1 __thiscall FUN_0042b1b0(int param_1,int param_2,int param_3)



{

  char cVar1;

  undefined1 uVar2;

  int extraout_ECX;

  int *unaff_EBX;

  

  if (param_3 != 0) {

    switch(*(undefined4 *)(param_2 + 0xc)) {

    case 9:

    case 0xf:

    case 0x10:

    case 0x14:

      cVar1 = FUN_00677f00(*(undefined4 *)(param_2 + 0x18));

      param_2 = extraout_ECX;

      if (cVar1 != '\0') {

        uVar2 = func_0x00678490(*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 0xc),param_3)

        ;

        if (unaff_EBX != (int *)0x0) {

          (**(code **)(*unaff_EBX + 0x14))();

        }

        return uVar2;

      }

    }

    FUN_00401340("There was a problem with the emp");

    FUN_0065d620(param_3,param_2);

  }

  return 0;

}





// --- FUN_0042b3a0 at 0x0042B3A0 (size: 162) ---


undefined4 __thiscall FUN_0042b3a0(int param_1,int param_2,int param_3)



{

  undefined4 *puVar1;

  int iVar2;

  LONG LVar3;

  

  iVar2 = param_3;

  if (*(int *)(param_1 + 8) == 0) {

    FUN_00402710(param_3,"<file unset>");

  }

  else {

    FUN_00402710(param_3,"0x%08X",*(int *)(param_1 + 8));

    if (*(int *)(param_2 + 0xc) != 10) {

      return 0;

    }

    FUN_00679220(&param_3,*(undefined4 *)(param_1 + 8),*(undefined4 *)(param_2 + 0x18));

    if (*(int *)(param_3 + -4) != 1) {

      FUN_00402710(iVar2,&DAT_007955ac,param_3);

    }

    puVar1 = (undefined4 *)(param_3 + -0x14);

    LVar3 = InterlockedDecrement((LONG *)(param_3 + -0x10));

    if ((LVar3 == 0) && (puVar1 != (undefined4 *)0x0)) {

      (**(code **)*puVar1)(1);

      return 1;

    }

  }

  return 1;

}





// --- FUN_0042b450 at 0x0042B450 (size: 143) ---


bool FUN_0042b450(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  undefined *puVar1;

  char cVar2;

  LONG LVar3;

  undefined4 extraout_ECX;

  undefined *puVar4;

  undefined4 uVar5;

  undefined *local_4;

  

  local_4 = PTR_DAT_00818344;

  InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

  FUN_00426020(&local_4);

  puVar1 = local_4;

  puVar4 = local_4;

  InterlockedIncrement((LONG *)(local_4 + -0x10));

  cVar2 = FUN_0041bac0(param_2,puVar4,param_3);

  if (cVar2 == '\0') {

    uVar5 = extraout_ECX;

    puVar4 = puVar1;

    FUN_00401340("invalid emp value \'%s\'");

    FUN_0065d620(param_1,uVar5,puVar4);

  }

  LVar3 = InterlockedDecrement((LONG *)(puVar1 + -0x10));

  if ((LVar3 == 0) && ((undefined4 *)(puVar1 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(puVar1 + -0x14))(1);

  }

  return cVar2 != '\0';

}





// --- FUN_0042b4e0 at 0x0042B4E0 (size: 52) ---


uint FUN_0042b4e0(undefined4 param_1)



{

  int iVar1;

  uint uVar2;

  undefined4 extraout_ECX;

  undefined4 uVar3;

  

  iVar1 = FUN_0065ca90();

  if (iVar1 != 0) {

    uVar2 = FUN_0042b450();

    return uVar2;

  }

  uVar3 = extraout_ECX;

  FUN_00401340("Expecting a leaf node");

  uVar2 = FUN_0065d620(param_1,uVar3);

  return uVar2 & 0xffffff00;

}





// --- FUN_0042b520 at 0x0042B520 (size: 154) ---


undefined1 FUN_0042b520(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  LONG *lpAddend;

  undefined *puVar1;

  char cVar2;

  LONG LVar3;

  undefined1 uVar4;

  undefined4 *puVar5;

  undefined *puVar6;

  undefined *local_4;

  

  local_4 = PTR_DAT_00818344;

  uVar4 = 0;

  InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

  cVar2 = FUN_0041b220(param_2,param_3,&local_4);

  puVar1 = local_4;

  if (cVar2 != '\0') {

    lpAddend = (LONG *)(local_4 + -0x10);

    InterlockedIncrement(lpAddend);

    puVar6 = puVar1;

    InterlockedIncrement(lpAddend);

    FUN_00427050(puVar6);

    LVar3 = InterlockedDecrement((LONG *)(puVar1 + -0x10));

    if ((LVar3 == 0) && ((undefined4 *)(puVar1 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(puVar1 + -0x14))(1);

    }

    uVar4 = 1;

  }

  puVar5 = (undefined4 *)(local_4 + -0x14);

  LVar3 = InterlockedDecrement((LONG *)(local_4 + -0x10));

  if ((LVar3 == 0) && (puVar5 != (undefined4 *)0x0)) {

    (**(code **)*puVar5)(1);

  }

  return uVar4;

}





// --- FUN_0042b5c0 at 0x0042B5C0 (size: 60) ---


int FUN_0042b5c0(int *param_1,undefined4 param_2,undefined4 param_3)



{

  char cVar1;

  int iVar2;

  

  iVar2 = (**(code **)(*param_1 + 4))();

  if (iVar2 != 0) {

    cVar1 = FUN_0042b520(iVar2,param_2,param_3);

    if (cVar1 == '\0') {

      FUN_0065d360(iVar2);

      return 0;

    }

  }

  return iVar2;

}





// --- FUN_0042b940 at 0x0042B940 (size: 135) ---


void FUN_0042b940(undefined4 param_1,undefined4 param_2)



{

  int iVar1;

  undefined4 *local_8;

  undefined4 *local_4;

  

  local_8 = (undefined4 *)0x0;

  local_4 = (undefined4 *)0x0;

  FUN_00429ab0(param_1);

  FUN_00429ab0(param_2);

  FUN_00429ab0(&local_8);

  if (local_8 != (undefined4 *)0x0) {

    iVar1 = local_8[1];

    local_8[1] = iVar1 + -1;

    if (iVar1 + -1 == 0) {

      (**(code **)*local_8)(1);

    }

    local_8 = (undefined4 *)0x0;

  }

  if ((local_4 != (undefined4 *)0x0) &&

     (iVar1 = local_4[1], local_4[1] = iVar1 + -1, iVar1 + -1 == 0)) {

    (**(code **)*local_4)(1);

  }

  return;

}





// --- FUN_0042baa0 at 0x0042BAA0 (size: 584) ---


uint FUN_0042baa0(int param_1,int *param_2)



{

  bool bVar1;

  char cVar2;

  uint in_EAX;

  uint uVar3;

  undefined4 uVar4;

  LONG LVar5;

  undefined4 extraout_ECX;

  undefined4 *puVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  undefined1 local_26;

  int iStack_24;

  int iStack_20;

  uint local_1c;

  int local_18;

  uint local_14;

  undefined4 *local_10;

  undefined4 *local_c;

  

  if (param_2 == (int *)0x0) {

    return in_EAX & 0xffffff00;

  }

  local_14 = FUN_0065ca40();

  if ((DAT_00837720 == -0x7ffffffe) || (bVar1 = false, DAT_00837720 == -0x7fffffff)) {

    bVar1 = true;

  }

  uVar3 = 0;

  local_26 = 1;

  local_1c = 0;

  if (local_14 != 0) {

    do {

      local_10 = (undefined4 *)0x0;

      local_c = (undefined4 *)0x0;

      uVar4 = (**(code **)(*param_2 + 0xc))(local_1c);

      cVar2 = FUN_0042a420(uVar4);

      if (cVar2 == '\0') {

        uVar4 = extraout_ECX;

        FUN_00401340("failed to read property");

        FUN_0065d620(param_2,uVar4);

        local_26 = 0;

      }

      else if ((!bVar1) || (cVar2 = FUN_004299a0(), cVar2 == '\0')) {

        uVar4 = FUN_00429a00();

        if ((*(char *)(param_1 + 0xb6) == '\0') &&

           ((cVar2 = FUN_0042bd10(uVar4), cVar2 == '\0' && (*(char *)(param_1 + 0xb6) == '\0')))) {

          FUN_00401340("<UNKNOWN>");

          FUN_00401340("<UNKNOWN>");

          FUN_004268d0(*(undefined4 *)(param_1 + 8),&iStack_24);

          uVar4 = FUN_00429a00(&iStack_20);

          FUN_004268d0(uVar4);

          iVar7 = iStack_20;

          iVar8 = iStack_20;

          iVar9 = iStack_24;

          FUN_00401340("[%s] is not an available property for [%s]");

          FUN_0065d620(param_2,iVar7,iVar8,iVar9);

          puVar6 = (undefined4 *)(iStack_24 + -0x14);

          local_26 = 0;

          LVar5 = InterlockedDecrement((LONG *)(iStack_24 + -0x10));

          if ((LVar5 == 0) && (puVar6 != (undefined4 *)0x0)) {

            (**(code **)*puVar6)(1);

          }

          puVar6 = (undefined4 *)(iStack_20 + -0x14);

          LVar5 = InterlockedDecrement((LONG *)(iStack_20 + -0x10));

          if ((LVar5 == 0) && (puVar6 != (undefined4 *)0x0)) {

            (**(code **)*puVar6)(1);

          }

        }

        else {

          iVar7 = local_18;

          uVar3 = *(uint *)(local_18 + 0xc) & 0x7fffffff;

          if (uVar3 <= *(uint *)(local_18 + 0x10)) {

            uVar4 = FUN_00453850(uVar3 + 1);

            cVar2 = FUN_004273a0(uVar4);

            if (cVar2 == '\0') goto LAB_0042bc75;

          }

          FUN_00429ab0(&local_10);

          *(int *)(iVar7 + 0x10) = *(int *)(iVar7 + 0x10) + 1;

        }

      }

LAB_0042bc75:

      if (local_10 != (undefined4 *)0x0) {

        iVar7 = local_10[1];

        local_10[1] = iVar7 + -1;

        if (iVar7 + -1 == 0) {

          (**(code **)*local_10)(1);

        }

        local_10 = (undefined4 *)0x0;

      }

      if ((local_c != (undefined4 *)0x0) &&

         (iVar7 = local_c[1], local_c[1] = iVar7 + -1, iVar7 + -1 == 0)) {

        (**(code **)*local_c)(1);

      }

      uVar3 = local_1c + 1;

      local_1c = uVar3;

    } while (uVar3 < local_14);

  }

  return CONCAT31((int3)(uVar3 >> 8),local_26);

}





// --- FUN_0042bcf0 at 0x0042BCF0 (size: 20) ---


void __thiscall FUN_0042bcf0(int param_1,int *param_2)



{

  *param_2 = param_1 + 4;

  param_2[1] = 0;

  param_2[2] = 0;

  return;

}





// --- FUN_0042bd10 at 0x0042BD10 (size: 44) ---


undefined4 __thiscall FUN_0042bd10(int param_1,uint param_2)



{

  uint *puVar1;

  bool bVar2;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 100) + (param_2 % *(uint *)(param_1 + 0x6c)) * 4);

  bVar2 = puVar1 == (uint *)0x0;

  if (!bVar2) {

    do {

      if (*puVar1 == param_2) break;

      puVar1 = (uint *)puVar1[1];

    } while (puVar1 != (uint *)0x0);

    bVar2 = puVar1 == (uint *)0x0;

  }

  return CONCAT31((int3)((uint)puVar1 >> 8),!bVar2);

}





// --- FUN_0042bd40 at 0x0042BD40 (size: 80) ---


uint __thiscall FUN_0042bd40(int param_1,uint *param_2)



{

  uint *puVar1;

  uint *puVar2;

  int iVar3;

  

  puVar1 = (uint *)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  puVar2 = (uint *)*puVar1;

  do {

    if (puVar2 == (uint *)0x0) {

LAB_0042bd6b:

      param_2[1] = *puVar1;

      *puVar1 = (uint)param_2;

      if (puVar1 < *(uint **)(param_1 + 100)) {

        *(uint **)(param_1 + 100) = puVar1;

      }

      iVar3 = *(int *)(param_1 + 0x6c) + 1;

      *(int *)(param_1 + 0x6c) = iVar3;

      return CONCAT31((int3)((uint)iVar3 >> 8),1);

    }

    if (*puVar2 == *param_2) {

      if (puVar2 != (uint *)0x0) {

        return (uint)puVar2 & 0xffffff00;

      }

      goto LAB_0042bd6b;

    }

    puVar2 = (uint *)puVar2[1];

  } while( true );

}





// --- FUN_0042bda0 at 0x0042BDA0 (size: 142) ---


undefined4 __thiscall FUN_0042bda0(int param_1,uint *param_2,undefined4 param_3)



{

  uint *puVar1;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 100) + (*param_2 % *(uint *)(param_1 + 0x6c)) * 4);

  do {

    if (puVar1 == (uint *)0x0) {

LAB_0042bdcb:

      puVar1 = (uint *)FUN_005df0f5(0xc);

      if (puVar1 != (uint *)0x0) {

        *puVar1 = *param_2;

        puVar1[1] = 0;

        FUN_0042c690(param_3);

        FUN_0042bd40(puVar1);

        return 1;

      }

      FUN_0042bd40(0);

      return 1;

    }

    if (*puVar1 == *param_2) {

      if (puVar1 != (uint *)0x0) {

        FUN_0042c690(param_3);

        return 1;

      }

      goto LAB_0042bdcb;

    }

    puVar1 = (uint *)puVar1[1];

  } while( true );

}





// --- FUN_0042be30 at 0x0042BE30 (size: 43) ---


void FUN_0042be30(undefined4 param_1)



{

  undefined4 local_4;

  

  FUN_00535a80();

  local_4 = param_1;

  FUN_0042bda0(&param_1,&local_4);

  return;

}





// --- FUN_0042be60 at 0x0042BE60 (size: 526) ---


void FUN_0042be60(undefined4 param_1,int param_2,uint param_3)



{

  int iVar1;

  undefined *puVar2;

  undefined *puVar3;

  uint uVar4;

  char cVar5;

  undefined *puVar6;

  byte *pbVar7;

  int *piVar8;

  undefined4 *puVar9;

  undefined4 *puVar10;

  uint uVar11;

  undefined4 *puVar12;

  undefined1 local_c [12];

  

  uVar4 = param_3;

  if ((~*(byte *)(param_3 + 4) & 1) != 0) {

    FUN_005c2c80();

  }

  puVar3 = PTR_DAT_00818558;

  puVar2 = PTR_DAT_00818554;

  if (((byte)*(undefined4 *)(uVar4 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x68);

    puVar6 = (undefined *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_3,param_3,0);

    if (puVar6 == puVar3) {

      puVar6 = puVar6 + -4;

    }

    uVar11 = (int)puVar6 - (int)puVar2 >> 2;

  }

  else {

    uVar11 = param_3 & 0xff;

  }

  FUN_0040ad10(1);

  pbVar7 = (byte *)FUN_0040acf0(1);

  if (pbVar7 != (byte *)0x0) {

    if ((*(byte *)(uVar4 + 4) & 1) == 0) {

      uVar11 = (uint)*pbVar7;

    }

    else {

      *pbVar7 = (byte)uVar11;

    }

  }

  if ((*(byte *)(uVar4 + 4) & 5) == 0) {

    if ((uVar11 & 0xff) < DAT_007956cc) {

      FUN_0042ab60(*(undefined4 *)(PTR_DAT_00818554 + (uVar11 & 0xff) * 4));

    }

    else {

      FUN_0040aa50();

    }

  }

  if (((byte)*(undefined4 *)(uVar4 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x6c);

  }

  FUN_00401a80(&param_3,&param_3,uVar4);

  if (((byte)*(undefined4 *)(uVar4 + 4) & 5) == 1) {

    piVar8 = (int *)FUN_0052dcf0(local_c);

    iVar1 = *piVar8;

    puVar12 = (undefined4 *)piVar8[1];

    puVar9 = (undefined4 *)piVar8[2];

LAB_0042bf62:

    puVar10 = puVar9;

    if (puVar9 != (undefined4 *)0x0) {

      do {

        FUN_0040ad10(4);

        puVar9 = (undefined4 *)FUN_0040acf0(4);

        if (puVar9 != (undefined4 *)0x0) {

          if ((*(byte *)(uVar4 + 4) & 1) == 0) {

            *puVar10 = *puVar9;

          }

          else {

            *puVar9 = *puVar10;

          }

        }

        FUN_0068b220(uVar4);

        puVar10 = (undefined4 *)puVar10[1];

      } while (puVar10 != (undefined4 *)0x0);

      do {

        puVar12 = puVar12 + 1;

        puVar9 = puVar10;

        if (puVar12 == (undefined4 *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) break;

        puVar9 = (undefined4 *)*puVar12;

      } while (puVar9 == (undefined4 *)0x0);

      goto LAB_0042bf62;

    }

  }

  if ((*(byte *)(uVar4 + 4) & 5) == 0) {

    uVar11 = FUN_0040a8f0();

    if (uVar11 < param_3) {

LAB_0042c05f:

      FUN_0040aa50();

    }

    else {

      uVar11 = 0;

      puVar12 = (undefined4 *)0x0;

      if (param_3 != 0) {

        while( true ) {

          puVar9 = (undefined4 *)FUN_005df0f5(0xc);

          if (puVar9 == (undefined4 *)0x0) {

            puVar9 = (undefined4 *)0x0;

          }

          else {

            puVar9[1] = 0;

            FUN_00535a80();

          }

          FUN_0040ad10(4);

          puVar10 = (undefined4 *)FUN_0040acf0(4);

          if (puVar10 != (undefined4 *)0x0) {

            if ((*(byte *)(uVar4 + 4) & 1) == 0) {

              *puVar9 = *puVar10;

            }

            else {

              *puVar10 = *puVar9;

            }

          }

          FUN_0068b220(uVar4);

          if ((*(uint *)(uVar4 + 4) >> 2 & 1) != 0) break;

          cVar5 = FUN_00599310(puVar9,puVar12);

          if (cVar5 == '\0') goto LAB_0042c05f;

          uVar11 = uVar11 + 1;

          puVar12 = puVar9;

          if (param_3 <= uVar11) {

            return;

          }

        }

      }

    }

  }

  return;

}





// --- FUN_0042c070 at 0x0042C070 (size: 48) ---


void __thiscall FUN_0042c070(int param_1,int param_2)



{

  int iVar1;

  

  iVar1 = param_2;

  if ((~*(byte *)(param_2 + 4) & 1) != 0) {

    FUN_005870f0();

  }

  FUN_0042be60(&param_2,param_1 + 4,iVar1);

  return;

}





// --- FUN_0042c0a0 at 0x0042C0A0 (size: 117) ---


undefined4 FUN_0042c0a0(undefined4 param_1,int param_2)



{

  int iVar1;

  char cVar2;

  int *piVar3;

  int iVar4;

  undefined1 local_c [12];

  

  if (param_2 == 0) {

    return 0;

  }

  piVar3 = (int *)FUN_0052dcf0(local_c);

  iVar4 = piVar3[2];

  iVar1 = *piVar3;

  piVar3 = (int *)piVar3[1];

  do {

    if (iVar4 == 0) {

      return 1;

    }

    do {

      cVar2 = FUN_00429ea0(param_2);

      if (cVar2 == '\0') {

        return 0;

      }

      iVar4 = *(int *)(iVar4 + 4);

    } while (iVar4 != 0);

    do {

      piVar3 = piVar3 + 1;

      if (piVar3 == (int *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) {

        return 1;

      }

      iVar4 = *piVar3;

    } while (iVar4 == 0);

  } while( true );

}





// --- FUN_0042c210 at 0x0042C210 (size: 120) ---


uint __thiscall FUN_0042c210(int param_1,uint *param_2)



{

  uint *puVar1;

  int iVar2;

  uint uVar3;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  do {

    if (puVar1 == (uint *)0x0) {

LAB_0042c23b:

      if ((int)(*(uint *)(param_1 + 0x68) * 2) < *(int *)(param_1 + 0x6c) + 1) {

        FUN_00428210();

      }

      uVar3 = *param_2 % *(uint *)(param_1 + 0x68);

      iVar2 = *(int *)(param_1 + 0x60);

      param_2[1] = *(uint *)(iVar2 + uVar3 * 4);

      *(uint **)(iVar2 + uVar3 * 4) = param_2;

      uVar3 = iVar2 + uVar3 * 4;

      if (uVar3 < *(uint *)(param_1 + 100)) {

        *(uint *)(param_1 + 100) = uVar3;

      }

      iVar2 = *(int *)(param_1 + 0x6c) + 1;

      *(int *)(param_1 + 0x6c) = iVar2;

      return CONCAT31((int3)((uint)iVar2 >> 8),1);

    }

    if (*puVar1 == *param_2) {

      if (puVar1 != (uint *)0x0) {

        return (uint)puVar1 & 0xffffff00;

      }

      goto LAB_0042c23b;

    }

    puVar1 = (uint *)puVar1[1];

  } while( true );

}





// --- FUN_0042c290 at 0x0042C290 (size: 140) ---


undefined4 FUN_0042c290(undefined4 *param_1,undefined4 param_2)



{

  int *piVar1;

  undefined4 *puVar2;

  char cVar3;

  undefined4 *puVar4;

  

  puVar4 = (undefined4 *)FUN_005df0f5(0x10);

  if (puVar4 == (undefined4 *)0x0) {

    puVar4 = (undefined4 *)0x0;

  }

  else {

    *puVar4 = *param_1;

    puVar4[1] = 0;

    puVar4[2] = 0;

    puVar4[3] = 0;

    FUN_00429ab0(param_2);

  }

  cVar3 = FUN_0042c210(puVar4);

  if (cVar3 == '\0') {

    if (puVar4 != (undefined4 *)0x0) {

      puVar2 = (undefined4 *)puVar4[2];

      if (puVar2 != (undefined4 *)0x0) {

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar2)(1);

        }

        puVar4[2] = 0;

      }

      puVar2 = (undefined4 *)puVar4[3];

      if (puVar2 != (undefined4 *)0x0) {

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar2)(1);

        }

        puVar4[3] = 0;

      }

      operator_delete(puVar4);

    }

    return 0;

  }

  return 1;

}





// --- FUN_0042c690 at 0x0042C690 (size: 17) ---


void __thiscall FUN_0042c690(undefined4 *param_1,undefined4 *param_2)



{

  if (param_1 != param_2) {

    *param_1 = *param_2;

  }

  return;

}





// --- FUN_0042c6b0 at 0x0042C6B0 (size: 112) ---


void FUN_0042c6b0(int param_1)



{

  int *piVar1;

  

  if (param_1 == 0) {

    param_1 = 1;

  }

  piVar1 = &DAT_00837f3c;

  DAT_008189ec = param_1;

  do {

    param_1 = param_1 * 0x9c4e + (param_1 / 0xd1a4) * -0x7fffffab;

    if (param_1 < 0) {

      param_1 = param_1 + 0x7fffffab;

    }

    if ((int)piVar1 < 0x837f20) {

      *piVar1 = param_1;

    }

    piVar1 = piVar1 + -1;

  } while (0x837e9f < (int)piVar1);

  DAT_00837f20 = DAT_00837ea0;

  DAT_008189e8 = param_1;

  return;

}





// --- FUN_0042c720 at 0x0042C720 (size: 217) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



float10 FUN_0042c720(void)



{

  int iVar1;

  float10 fVar2;

  

  DAT_008189e8 = DAT_008189e8 * 0x9c4e + (DAT_008189e8 / 0xd1a4) * -0x7fffffab;

  if (DAT_008189e8 < 0) {

    DAT_008189e8 = DAT_008189e8 + 0x7fffffab;

  }

  DAT_008189ec = DAT_008189ec * 0x9ef4 + (DAT_008189ec / 0xce26) * -0x7fffff07;

  if (DAT_008189ec < 0) {

    DAT_008189ec = DAT_008189ec + 0x7fffff07;

  }

  iVar1 = DAT_00837f20 / 0x3fffffe;

  DAT_00837f20 = (&DAT_00837ea0)[iVar1] - DAT_008189ec;

  (&DAT_00837ea0)[iVar1] = DAT_008189e8;

  if (DAT_00837f20 < 1) {

    DAT_00837f20 = DAT_00837f20 + 0x7fffffaa;

  }

  fVar2 = (float10)DAT_00837f20 * (float10)_DAT_00798d50;

  if ((float10)_DAT_00798d48 < fVar2) {

    fVar2 = (float10)_DAT_00798d48;

  }

  return fVar2;

}





// --- FUN_0042c800 at 0x0042C800 (size: 23) ---


void FUN_0042c800(void)



{

  time_t tVar1;

  

  tVar1 = time((time_t *)0x0);

  DAT_008189e8 = (undefined4)tVar1;

  FUN_0042c6b0(DAT_008189e8);

  return;

}





// --- FUN_0042c820 at 0x0042C820 (size: 62) ---


int FUN_0042c820(int param_1,int param_2)



{

  int iVar1;

  

  if (param_2 != param_1) {

    if (param_2 < param_1) {

      param_1 = param_2;

    }

    FUN_0042c720();

    iVar1 = FUN_005df4c4();

    param_1 = iVar1 + param_1;

  }

  return param_1;

}





// --- FUN_0042c860 at 0x0042C860 (size: 94) ---


float10 FUN_0042c860(float param_1,float param_2)



{

  float10 fVar1;

  undefined4 local_8;

  undefined4 local_4;

  

  if (param_1 == param_2) {

    return (float10)param_1;

  }

  local_4 = param_2;

  local_8 = param_1;

  if (param_2 < param_1) {

    local_4 = param_1;

    local_8 = param_2;

  }

  fVar1 = (float10)FUN_0042c720();

  return ((float10)local_4 - (float10)local_8) * fVar1 + (float10)local_8;

}





// --- FUN_0042c8c0 at 0x0042C8C0 (size: 63) ---


uint __thiscall FUN_0042c8c0(undefined4 *param_1,undefined4 *param_2)



{

  wchar_t *_Str2;

  wchar_t *_Str1;

  uint uVar1;

  int iVar2;

  

  _Str2 = (wchar_t *)*param_2;

  _Str1 = (wchar_t *)*param_1;

  uVar1 = *(uint *)(_Str1 + -2);

  if (uVar1 == *(uint *)(_Str2 + -2)) {

    uVar1 = *(uint *)(_Str1 + -4);

    if (((uVar1 == *(uint *)(_Str2 + -4)) || (uVar1 == 0xffffffff)) ||

       (*(uint *)(_Str2 + -4) == 0xffffffff)) {

      iVar2 = wcscmp(_Str1,_Str2);

      return (uint)(iVar2 == 0);

    }

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_0042c900 at 0x0042C900 (size: 64) ---


undefined4 * __thiscall FUN_0042c900(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798d68;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042c940 at 0x0042C940 (size: 64) ---


undefined4 * __thiscall FUN_0042c940(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798d6c;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042c980 at 0x0042C980 (size: 59) ---


void __thiscall FUN_0042c980(int param_1,undefined4 param_2)



{

  undefined4 uVar1;

  undefined4 *puVar2;

  int iVar3;

  

  puVar2 = (undefined4 *)FUN_00415640(&param_2,param_2,4);

  uVar1 = *puVar2;

  iVar3 = FUN_0041c280(uVar1);

  if (iVar3 != 0x25) {

    *(undefined4 *)(param_1 + 8) = DAT_00837f28;

    return;

  }

  *(undefined4 *)(param_1 + 8) = uVar1;

  return;

}





// --- FUN_0042c9c0 at 0x0042C9C0 (size: 65) ---


void __thiscall FUN_0042c9c0(int param_1,undefined4 param_2,undefined4 param_3)



{

  undefined4 uVar1;

  undefined4 *puVar2;

  int iVar3;

  

  *(undefined4 *)(param_1 + 4) = param_2;

  puVar2 = (undefined4 *)FUN_00415640(&param_2,param_3,4);

  uVar1 = *puVar2;

  iVar3 = FUN_0041c280(uVar1);

  if (iVar3 != 0x25) {

    *(undefined4 *)(param_1 + 8) = DAT_00837f28;

    return;

  }

  *(undefined4 *)(param_1 + 8) = uVar1;

  return;

}





// --- FUN_0042ca10 at 0x0042CA10 (size: 51) ---


void __thiscall FUN_0042ca10(int param_1,undefined4 param_2,undefined4 param_3)



{

  int iVar1;

  

  *(undefined4 *)(param_1 + 4) = param_2;

  iVar1 = FUN_0041c280(param_3);

  if (iVar1 != 0x25) {

    *(undefined4 *)(param_1 + 8) = DAT_00837f28;

    return;

  }

  *(undefined4 *)(param_1 + 8) = param_3;

  return;

}





// --- FUN_0042ca50 at 0x0042CA50 (size: 152) ---


uint __thiscall FUN_0042ca50(int param_1,int *param_2)



{

  int iVar1;

  int *piVar2;

  LONG LVar3;

  undefined4 *puVar4;

  int local_4;

  

  if (*(uint *)(param_1 + 8) == DAT_00837f28) {

    return *(uint *)(param_1 + 8) & 0xffffff00;

  }

  local_4 = param_1;

  piVar2 = (int *)FUN_00679220(&local_4,*(undefined4 *)(param_1 + 8),0x25);

  iVar1 = *param_2;

  if (iVar1 != *piVar2) {

    LVar3 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

    if ((LVar3 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

    }

    iVar1 = *piVar2;

    *param_2 = iVar1;

    InterlockedIncrement((LONG *)(iVar1 + -0x10));

  }

  puVar4 = (undefined4 *)(local_4 + -0x14);

  LVar3 = InterlockedDecrement((LONG *)(local_4 + -0x10));

  if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

    (**(code **)*puVar4)(1);

  }

  return CONCAT31((int3)((uint)*param_2 >> 8),*(int *)(*param_2 + -4) != 1);

}





// --- FUN_0042caf0 at 0x0042CAF0 (size: 48) ---


undefined4 * __thiscall FUN_0042caf0(undefined4 *param_1,undefined4 param_2)



{

  undefined4 uVar1;

  

  *param_1 = 0;

  uVar1 = FUN_004220b0(param_2,0x25);

  uVar1 = FUN_00415430(uVar1);

  *param_1 = uVar1;

  return param_1;

}





// --- FUN_0042cb20 at 0x0042CB20 (size: 73) ---


void __thiscall FUN_0042cb20(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  int *piVar6;

  

  iVar1 = param_1[1];

  iVar2 = param_1[2];

  iVar3 = *(int *)(iVar2 + 4);

  iVar4 = *param_1;

  param_1[2] = iVar3;

  if (iVar3 == 0) {

    iVar3 = *(int *)(iVar4 + 0x68);

    iVar5 = *(int *)(iVar4 + 0x60);

    do {

      piVar6 = (int *)(param_1[1] + 4);

      param_1[1] = (int)piVar6;

      if (piVar6 == (int *)(iVar5 + iVar3 * 4)) goto LAB_0042cb57;

    } while (*piVar6 == 0);

    param_1[2] = *piVar6;

  }

LAB_0042cb57:

  *param_2 = iVar4;

  param_2[2] = iVar2;

  param_2[1] = iVar1;

  return;

}





// --- FUN_0042cb70 at 0x0042CB70 (size: 107) ---


void FUN_0042cb70(undefined4 param_1,int *param_2,uint param_3)



{

  ushort *puVar1;

  int iVar2;

  uint uVar3;

  

  uVar3 = param_3;

  if ((*(byte *)(param_3 + 4) & 1) != 0) {

    uVar3 = (uint)*(ushort *)(*param_2 + 4);

  }

  FUN_0040ad10(2);

  puVar1 = (ushort *)FUN_0040acf0(2);

  if (puVar1 != (ushort *)0x0) {

    if ((*(byte *)(param_3 + 4) & 1) == 0) {

      uVar3 = (uint)*puVar1;

    }

    else {

      *puVar1 = (ushort)uVar3;

    }

  }

  if ((~*(byte *)(param_3 + 4) & 1) != 0) {

    iVar2 = FUN_0042ed90(uVar3);

    *param_2 = iVar2;

  }

  if ((int *)*param_2 != (int *)0x0) {

    (**(code **)(*(int *)*param_2 + 0x10))(param_3);

  }

  return;

}





// --- FUN_0042cbe0 at 0x0042CBE0 (size: 205) ---


void __thiscall FUN_0042cbe0(int param_1,int *param_2,int param_3)



{

  int iVar1;

  int *piVar2;

  LONG LVar3;

  undefined4 *puVar4;

  

  *(undefined1 *)(param_1 + 0x84) = 1;

  if ((char)param_3 == '\0') {

    iVar1 = *(int *)(param_1 + 0x80);

    if (iVar1 != *param_2) {

      LVar3 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = *param_2;

      *(int *)(param_1 + 0x80) = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

  }

  else {

    piVar2 = (int *)FUN_0067cbc0(&param_3,param_2);

    iVar1 = *(int *)(param_1 + 0x80);

    if (iVar1 != *piVar2) {

      LVar3 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = *piVar2;

      *(int *)(param_1 + 0x80) = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    puVar4 = (undefined4 *)(param_3 + -0x14);

    LVar3 = InterlockedDecrement((LONG *)(param_3 + -0x10));

    if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

      (**(code **)*puVar4)(1);

      return;

    }

  }

  return;

}





// --- FUN_0042ccb0 at 0x0042CCB0 (size: 288) ---


int * __thiscall FUN_0042ccb0(int param_1,int *param_2,int param_3)



{

  int *piVar1;

  LONG LVar2;

  undefined4 *puVar3;

  int local_4;

  

  local_4 = *(int *)(param_1 + 0x80);

  InterlockedIncrement((LONG *)(local_4 + -0x10));

  if ((char)param_3 == '\0') {

    piVar1 = (int *)FUN_0067caf0(&param_3,&local_4);

    if (local_4 != *piVar1) {

      puVar3 = (undefined4 *)(local_4 + -0x14);

      LVar2 = InterlockedDecrement((LONG *)(local_4 + -0x10));

      if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

        (**(code **)*puVar3)(1);

      }

      local_4 = *piVar1;

      InterlockedIncrement((LONG *)(local_4 + -0x10));

    }

    puVar3 = (undefined4 *)(param_3 + -0x14);

    LVar2 = InterlockedDecrement((LONG *)(param_3 + -0x10));

    if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

      (**(code **)*puVar3)(1);

    }

  }

  piVar1 = (int *)FUN_0067cdc0(&param_3,&local_4);

  if (local_4 != *piVar1) {

    puVar3 = (undefined4 *)(local_4 + -0x14);

    LVar2 = InterlockedDecrement((LONG *)(local_4 + -0x10));

    if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

      (**(code **)*puVar3)(1);

    }

    local_4 = *piVar1;

    InterlockedIncrement((LONG *)(local_4 + -0x10));

  }

  puVar3 = (undefined4 *)(param_3 + -0x14);

  LVar2 = InterlockedDecrement((LONG *)(param_3 + -0x10));

  if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

    (**(code **)*puVar3)(1);

  }

  *param_2 = local_4;

  InterlockedIncrement((LONG *)(local_4 + -0x10));

  puVar3 = (undefined4 *)(local_4 + -0x14);

  LVar2 = InterlockedDecrement((LONG *)(local_4 + -0x10));

  if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

    (**(code **)*puVar3)(1);

  }

  return param_2;

}





// --- FUN_0042cdd0 at 0x0042CDD0 (size: 47) ---


void __thiscall FUN_0042cdd0(undefined4 *param_1,undefined4 *param_2)



{

  undefined4 uVar1;

  undefined4 uVar2;

  undefined4 uVar3;

  undefined1 local_c [12];

  

  uVar1 = param_1[2];

  uVar2 = *param_1;

  uVar3 = param_1[1];

  FUN_0042cb20(local_c,0);

  param_2[1] = uVar3;

  *param_2 = uVar2;

  param_2[2] = uVar1;

  return;

}





// --- FUN_0042ce00 at 0x0042CE00 (size: 203) ---


undefined4 __thiscall FUN_0042ce00(int param_1,undefined4 param_2)



{

  char cVar1;

  int iVar2;

  int *local_1c;

  undefined1 local_18 [8];

  int local_10;

  undefined1 auStack_c [12];

  

  if (*(char *)(param_1 + 0x84) != '\x01') {

    if ((*(int *)(param_1 + 4) == 0) || (*(int *)(param_1 + 8) == DAT_00837f28)) {

      return 0;

    }

    if (*(char *)(param_1 + 0x84) != '\x02') {

      FUN_0042caf0(*(int *)(param_1 + 8));

      if (local_1c != (int *)0x0) {

        iVar2 = FUN_004301a0(*(undefined4 *)(param_1 + 4));

        if (iVar2 != 0) {

          if ((char)param_2 != '\0') {

            FUN_00429c70(local_18);

            while (local_10 != 0) {

              if ((*(int **)(local_10 + 8) != (int *)0x0) &&

                 (cVar1 = (**(code **)(**(int **)(local_10 + 8) + 0xc))(param_2), cVar1 == '\0'))

              goto LAB_0042ce5d;

              FUN_0042cdd0(auStack_c,0);

            }

          }

          (**(code **)(*local_1c + 0x14))();

          return 1;

        }

LAB_0042ce5d:

        FUN_0049b890();

      }

      return 0;

    }

  }

  return 1;

}





// --- FUN_0042ced0 at 0x0042CED0 (size: 130) ---


void __thiscall FUN_0042ced0(int param_1,undefined4 param_2)



{

  int iVar1;

  undefined4 uVar2;

  int *piVar3;

  int iVar4;

  undefined4 uVar5;

  undefined1 local_c [12];

  

  if (*(char *)(param_1 + 0x84) != '\x01') {

    uVar5 = 0;

    uVar2 = FUN_004220b0(*(undefined4 *)(param_1 + 8),0);

    FUN_0041a4e0(uVar2,uVar5);

    piVar3 = (int *)FUN_0052dcf0(local_c);

    iVar4 = piVar3[2];

    iVar1 = *piVar3;

    piVar3 = (int *)piVar3[1];

    while (iVar4 != 0) {

      do {

        if (*(int **)(iVar4 + 8) != (int *)0x0) {

          (**(code **)(**(int **)(iVar4 + 8) + 4))(param_2);

        }

        iVar4 = *(int *)(iVar4 + 4);

      } while (iVar4 != 0);

      do {

        piVar3 = piVar3 + 1;

        if (piVar3 == (int *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) {

          return;

        }

        iVar4 = *piVar3;

      } while (iVar4 == 0);

    }

  }

  return;

}





// --- FUN_0042d020 at 0x0042D020 (size: 899) ---


undefined1 __thiscall FUN_0042d020(int *param_1,int param_2)



{

  bool bVar1;

  char cVar2;

  int iVar3;

  int iVar4;

  undefined4 uVar5;

  int *piVar6;

  LONG LVar7;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 extraout_ECX_01;

  undefined4 extraout_ECX_02;

  undefined4 extraout_ECX_03;

  undefined4 extraout_ECX_04;

  undefined4 extraout_ECX_05;

  undefined4 extraout_ECX_06;

  undefined4 extraout_ECX_07;

  undefined4 extraout_ECX_08;

  undefined4 extraout_ECX_09;

  undefined4 *puVar8;

  undefined *puVar9;

  int iVar10;

  char *pcVar11;

  int iVar12;

  undefined1 local_1a;

  undefined *local_18;

  undefined1 local_14 [4];

  undefined1 local_10 [16];

  

  iVar3 = param_2;

  if (param_2 == 0) {

    return 0;

  }

  local_18 = PTR_DAT_00818344;

  local_1a = 1;

  InterlockedIncrement((LONG *)(PTR_DAT_00818344 + -0x10));

  bVar1 = false;

  FUN_0065cf90(iVar3);

  iVar3 = FUN_0065c810();

  puVar9 = local_18;

  while (local_18 = puVar9, iVar3 != 0) {

    cVar2 = FUN_0065cc50(&DAT_00837f30);

    if (cVar2 == '\0') {

      cVar2 = FUN_0065cc50(&DAT_00837f34);

      if (cVar2 == '\0') {

        cVar2 = FUN_0065cc50(&DAT_00837f38);

        if (cVar2 == '\0') {

          cVar2 = FUN_0065cc50(&DAT_00837f3c);

          if (cVar2 == '\0') {

            cVar2 = FUN_0065cc50(&DAT_00837f40);

            if (cVar2 == '\0') {

              uVar5 = extraout_ECX_07;

              FUN_00401340("unknown keyword");

              FUN_0065d670(iVar3,uVar5);

            }

            else {

              FUN_00401a40();

              iVar4 = FUN_0065ca90();

              uVar5 = extraout_ECX_08;

              if ((iVar4 == 0) ||

                 (cVar2 = FUN_00426020(local_14), uVar5 = extraout_ECX_09, cVar2 == '\0')) {

                FUN_00401340("corrupt literal data");

                FUN_0065d620(iVar3,uVar5);

                local_1a = 0;

              }

              uVar5 = FUN_00403350(local_10,0);

              FUN_00402070(uVar5);

              FUN_004011b0();

              *(undefined1 *)(param_1 + 0x21) = 1;

              FUN_004011b0();

            }

          }

          else {

            iVar4 = FUN_0065ca90();

            uVar5 = extraout_ECX_05;

            if ((iVar4 == 0) ||

               (cVar2 = FUN_00426020(param_1 + 0x23), uVar5 = extraout_ECX_06, cVar2 == '\0')) {

              FUN_00401340("corrupt string comment data");

              FUN_0065d620(iVar3,uVar5);

              local_1a = 0;

            }

            *(undefined1 *)(param_1 + 0x21) = 2;

          }

        }

        else {

          iVar4 = FUN_0065ca90();

          uVar5 = extraout_ECX_03;

          if ((iVar4 == 0) ||

             (cVar2 = FUN_00426020(param_1 + 0x22), uVar5 = extraout_ECX_04, cVar2 == '\0')) {

            FUN_00401340("corrupt string english data");

            FUN_0065d620(iVar3,uVar5);

            local_1a = 0;

            *(undefined1 *)(param_1 + 0x21) = 2;

          }

          else {

            bVar1 = true;

            *(undefined1 *)(param_1 + 0x21) = 2;

          }

        }

      }

      else {

        iVar4 = FUN_0065ca90();

        uVar5 = extraout_ECX_01;

        if ((iVar4 == 0) || (cVar2 = FUN_00426020(param_1), uVar5 = extraout_ECX_02, cVar2 == '\0'))

        {

          pcVar11 = "corrupt string token data";

          goto LAB_0042d0db;

        }

      }

    }

    else {

      iVar4 = FUN_0065ca90();

      uVar5 = extraout_ECX;

      if ((iVar4 == 0) || (cVar2 = FUN_00426020(&local_18), uVar5 = extraout_ECX_00, cVar2 == '\0'))

      {

        pcVar11 = "corrupt string table data";

LAB_0042d0db:

        FUN_00401340(pcVar11);

        FUN_0065d620(iVar3,uVar5);

        local_1a = 0;

      }

    }

    iVar3 = FUN_0065cb10();

    puVar9 = local_18;

  }

  if (((char)param_1[0x21] == '\0') || ((char)param_1[0x21] == '\x02')) {

    if (*(int *)(puVar9 + -4) == 1) {

      iVar3 = param_1[0x23];

      iVar4 = param_1[0x22];

      iVar10 = *param_1;

      iVar12 = iVar3;

      FUN_00401340(

                  "failed parsing the stringtable name! ( token: \'%s\', english: \'%s\', comment: \'%s\'"

                  );

      FUN_0065d620(param_2,iVar3,iVar10,iVar4,iVar12);

    }

    else {

      if ((bVar1) && (cVar2 = FUN_00413a70(), cVar2 == '\0')) {

        iVar3 = param_1[0x23];

        InterlockedIncrement((LONG *)(iVar3 + -0x10));

        iVar4 = param_1[0x22];

        InterlockedIncrement((LONG *)(iVar4 + -0x10));

        iVar10 = *param_1;

        InterlockedIncrement((LONG *)(iVar10 + -0x10));

        InterlockedIncrement((LONG *)(puVar9 + -0x10));

        piVar6 = (int *)FUN_0065d560(puVar9,iVar10,iVar4,iVar3);

        iVar3 = *piVar6;

        InterlockedIncrement((LONG *)(iVar3 + -0x10));

        FUN_00430bc0(iVar3);

      }

      iVar3 = *param_1;

      iVar4 = *(int *)(iVar3 + -8);

      if (iVar4 == -1) {

        iVar4 = FUN_004016b0(iVar3);

        *(int *)(iVar3 + -8) = iVar4;

      }

      param_1[1] = iVar4;

      FUN_00403350(&param_2,0);

      puVar8 = (undefined4 *)(param_2 + -0x14);

      LVar7 = InterlockedDecrement((LONG *)(param_2 + -0x10));

      if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

        (**(code **)*puVar8)(1);

      }

      if (param_1[2] != DAT_00837f28) goto LAB_0042d363;

    }

    local_1a = 0;

  }

LAB_0042d363:

  FUN_0065cae0();

  puVar8 = (undefined4 *)(local_18 + -0x14);

  LVar7 = InterlockedDecrement((LONG *)(local_18 + -0x10));

  if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

    (**(code **)*puVar8)(1);

  }

  return local_1a;

}





// --- FUN_0042d3b0 at 0x0042D3B0 (size: 319) ---


int * __thiscall FUN_0042d3b0(int *param_1,undefined4 *param_2)



{

  LONG *lpAddend;

  int *piVar1;

  int iVar2;

  undefined *puVar3;

  undefined *puVar4;

  char cVar5;

  LONG LVar6;

  uint uVar7;

  int *piVar8;

  int *piVar9;

  

  if ((param_1[1] & 0x7fffffffU) < (param_2[1] & 0x7fffffff)) {

    param_1[2] = 0;

    cVar5 = FUN_00407f10(param_2[1] & 0x7fffffff);

    if (cVar5 == '\0') {

      return param_1;

    }

  }

  piVar8 = (int *)*param_1;

  piVar9 = (int *)*param_2;

  piVar1 = piVar9 + param_2[2];

  for (; piVar9 < piVar1; piVar9 = piVar9 + 1) {

    iVar2 = *piVar8;

    if (iVar2 != *piVar9) {

      LVar6 = InterlockedDecrement((LONG *)(iVar2 + -0x10));

      if ((LVar6 == 0) && ((undefined4 *)(iVar2 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar2 + -0x14))(1);

      }

      iVar2 = *piVar9;

      *piVar8 = iVar2;

      InterlockedIncrement((LONG *)(iVar2 + -0x10));

    }

    piVar8 = piVar8 + 1;

  }

  uVar7 = param_2[2];

  if (uVar7 < (uint)param_1[2]) {

    do {

      puVar4 = PTR_DAT_00818340;

      lpAddend = (LONG *)(PTR_DAT_00818340 + -0x10);

      InterlockedIncrement(lpAddend);

      piVar1 = (int *)(*param_1 + uVar7 * 4);

      puVar3 = (undefined *)*piVar1;

      if (puVar3 != puVar4) {

        LVar6 = InterlockedDecrement((LONG *)(puVar3 + -0x10));

        if ((LVar6 == 0) && ((undefined4 *)(puVar3 + -0x14) != (undefined4 *)0x0)) {

          (*(code *)**(undefined4 **)(puVar3 + -0x14))(1);

        }

        *piVar1 = (int)puVar4;

        InterlockedIncrement(lpAddend);

      }

      LVar6 = InterlockedDecrement((LONG *)(puVar4 + -0x10));

      if ((LVar6 == 0) && ((undefined4 *)(puVar4 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(puVar4 + -0x14))(1);

      }

      uVar7 = uVar7 + 1;

    } while (uVar7 < (uint)param_1[2]);

  }

  param_1[2] = param_2[2];

  return param_1;

}





// --- FUN_0042d4f0 at 0x0042D4F0 (size: 71) ---


int FUN_0042d4f0(int param_1,undefined4 param_2,undefined4 param_3)



{

  LONG LVar1;

  int iVar2;

  

  iVar2 = param_1;

  FUN_00402730(param_2);

  FUN_004086c0(iVar2,param_3);

  LVar1 = InterlockedDecrement((LONG *)(param_1 + -0x10));

  if ((LVar1 == 0) && ((undefined4 *)(param_1 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(param_1 + -0x14))(1);

  }

  return param_1;

}





// --- FUN_0042d540 at 0x0042D540 (size: 285) ---


undefined4 __thiscall FUN_0042d540(int param_1,int param_2)



{

  uint *puVar1;

  char cVar2;

  undefined4 uVar3;

  undefined1 local_c [8];

  uint *local_4;

  

  if (param_1 == param_2) {

    return 1;

  }

  if (*(char *)(param_1 + 0x84) == '\x01') {

    if (*(char *)(param_2 + 0x84) == '\x01') {

      uVar3 = FUN_0042c8c0(param_2 + 0x80);

      return uVar3;

    }

  }

  else if ((((*(int *)(param_1 + 4) == *(int *)(param_2 + 4)) &&

            (*(int *)(param_1 + 8) == *(int *)(param_2 + 8))) &&

           (*(char *)(param_1 + 0x84) == *(char *)(param_2 + 0x84))) &&

          (((cVar2 = FUN_00426520(param_2), cVar2 == '\0' &&

            (cVar2 = FUN_00426520(param_2 + 0x88), cVar2 == '\0')) &&

           ((cVar2 = FUN_00426520(param_2 + 0x8c), cVar2 == '\0' &&

            (*(int *)(param_1 + 0x7c) == *(int *)(param_2 + 0x7c))))))) {

    FUN_00429c70(local_c);

    while( true ) {

      if (local_4 == (uint *)0x0) {

        return 1;

      }

      puVar1 = *(uint **)(*(int *)(param_2 + 0x70) + (*local_4 % *(uint *)(param_2 + 0x78)) * 4);

      while( true ) {

        if (puVar1 == (uint *)0x0) {

          return 0;

        }

        if (*puVar1 == *local_4) break;

        puVar1 = (uint *)puVar1[1];

      }

      if (puVar1 == (uint *)0x0) break;

      cVar2 = FUN_0042f050(puVar1[2],local_4[2]);

      if (cVar2 == '\0') {

        return 0;

      }

      FUN_0046bfb0();

    }

    return 0;

  }

  return 0;

}





// --- FUN_0042d660 at 0x0042D660 (size: 143) ---


undefined4 * __thiscall FUN_0042d660(undefined4 *param_1,undefined4 param_2)



{

  undefined *puVar1;

  uint *puVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  undefined4 *puVar6;

  

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  *param_1 = &PTR_FUN_00798d68;

  puVar1 = PTR_DAT_00818558;

  puVar2 = (uint *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_2,param_2,0);

  if (puVar2 == (uint *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  uVar4 = *puVar2;

  param_1[0x1a] = uVar4;

  if (uVar4 < 0x18) {

    param_1[0x18] = param_1 + 1;

  }

  else {

    uVar3 = thunk_FUN_005df0f5(uVar4 << 2);

    param_1[0x18] = uVar3;

  }

  param_1[0x19] = (undefined4 *)param_1[0x18] + param_1[0x1a];

  puVar6 = (undefined4 *)param_1[0x18];

  for (uVar4 = param_1[0x1a] & 0x3fffffff; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar6 = 0;

    puVar6 = puVar6 + 1;

  }

  for (iVar5 = 0; iVar5 != 0; iVar5 = iVar5 + -1) {

    *(undefined1 *)puVar6 = 0;

    puVar6 = (undefined4 *)((int)puVar6 + 1);

  }

  return param_1;

}





// --- FUN_0042d6f0 at 0x0042D6F0 (size: 143) ---


undefined4 * __thiscall FUN_0042d6f0(undefined4 *param_1,undefined4 param_2)



{

  undefined *puVar1;

  uint *puVar2;

  undefined4 uVar3;

  uint uVar4;

  int iVar5;

  undefined4 *puVar6;

  

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  *param_1 = &PTR_FUN_00798d6c;

  puVar1 = PTR_DAT_00818558;

  puVar2 = (uint *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_2,param_2,0);

  if (puVar2 == (uint *)puVar1) {

    puVar2 = puVar2 + -1;

  }

  uVar4 = *puVar2;

  param_1[0x1a] = uVar4;

  if (uVar4 < 0x18) {

    param_1[0x18] = param_1 + 1;

  }

  else {

    uVar3 = thunk_FUN_005df0f5(uVar4 << 2);

    param_1[0x18] = uVar3;

  }

  param_1[0x19] = (undefined4 *)param_1[0x18] + param_1[0x1a];

  puVar6 = (undefined4 *)param_1[0x18];

  for (uVar4 = param_1[0x1a] & 0x3fffffff; uVar4 != 0; uVar4 = uVar4 - 1) {

    *puVar6 = 0;

    puVar6 = puVar6 + 1;

  }

  for (iVar5 = 0; iVar5 != 0; iVar5 = iVar5 + -1) {

    *(undefined1 *)puVar6 = 0;

    puVar6 = (undefined4 *)((int)puVar6 + 1);

  }

  return param_1;

}





// --- FUN_0042d780 at 0x0042D780 (size: 534) ---


void FUN_0042d780(undefined4 param_1,int param_2,uint param_3)



{

  int iVar1;

  undefined *puVar2;

  undefined *puVar3;

  uint uVar4;

  char cVar5;

  undefined *puVar6;

  byte *pbVar7;

  int *piVar8;

  undefined4 *puVar9;

  undefined4 *puVar10;

  uint uVar11;

  undefined4 *puVar12;

  undefined1 local_c [12];

  

  uVar4 = param_3;

  if ((~*(byte *)(param_3 + 4) & 1) != 0) {

    FUN_005c2c80();

  }

  puVar3 = PTR_DAT_00818558;

  puVar2 = PTR_DAT_00818554;

  if (((byte)*(undefined4 *)(uVar4 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x68);

    puVar6 = (undefined *)FUN_00422d20(PTR_DAT_00818554,PTR_DAT_00818558,&param_3,param_3,0);

    if (puVar6 == puVar3) {

      puVar6 = puVar6 + -4;

    }

    uVar11 = (int)puVar6 - (int)puVar2 >> 2;

  }

  else {

    uVar11 = param_3 & 0xff;

  }

  FUN_0040ad10(1);

  pbVar7 = (byte *)FUN_0040acf0(1);

  if (pbVar7 != (byte *)0x0) {

    if ((*(byte *)(uVar4 + 4) & 1) == 0) {

      uVar11 = (uint)*pbVar7;

    }

    else {

      *pbVar7 = (byte)uVar11;

    }

  }

  if ((*(byte *)(uVar4 + 4) & 5) == 0) {

    if ((uVar11 & 0xff) < DAT_007956cc) {

      FUN_0042ab60(*(undefined4 *)(PTR_DAT_00818554 + (uVar11 & 0xff) * 4));

    }

    else {

      FUN_0040aa50();

    }

  }

  if (((byte)*(undefined4 *)(uVar4 + 4) & 5) == 1) {

    param_3 = *(uint *)(param_2 + 0x6c);

  }

  FUN_00401a80(&param_3,&param_3,uVar4);

  if (((byte)*(undefined4 *)(uVar4 + 4) & 5) == 1) {

    piVar8 = (int *)FUN_0052dcf0(local_c);

    iVar1 = *piVar8;

    puVar12 = (undefined4 *)piVar8[1];

    puVar9 = (undefined4 *)piVar8[2];

LAB_0042d882:

    puVar10 = puVar9;

    if (puVar9 != (undefined4 *)0x0) {

      do {

        FUN_0040ad10(4);

        puVar9 = (undefined4 *)FUN_0040acf0(4);

        if (puVar9 != (undefined4 *)0x0) {

          if ((*(byte *)(uVar4 + 4) & 1) == 0) {

            *puVar10 = *puVar9;

          }

          else {

            *puVar9 = *puVar10;

          }

        }

        FUN_0042cb70(param_1,puVar10 + 2,uVar4);

        puVar10 = (undefined4 *)puVar10[1];

      } while (puVar10 != (undefined4 *)0x0);

      do {

        puVar12 = puVar12 + 1;

        puVar9 = puVar10;

        if (puVar12 == (undefined4 *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) break;

        puVar9 = (undefined4 *)*puVar12;

      } while (puVar9 == (undefined4 *)0x0);

      goto LAB_0042d882;

    }

  }

  if ((*(byte *)(uVar4 + 4) & 5) == 0) {

    uVar11 = FUN_0040a8f0();

    if (uVar11 < param_3) {

LAB_0042d98a:

      FUN_0040aa50();

    }

    else {

      puVar12 = (undefined4 *)0x0;

      uVar11 = 0;

      if (param_3 != 0) {

        while( true ) {

          puVar10 = (undefined4 *)FUN_005df0f5(0xc);

          puVar9 = (undefined4 *)0x0;

          if (puVar10 != (undefined4 *)0x0) {

            puVar10[1] = 0;

            puVar9 = puVar10;

          }

          FUN_0040ad10(4);

          puVar10 = (undefined4 *)FUN_0040acf0(4);

          if (puVar10 != (undefined4 *)0x0) {

            if ((*(byte *)(uVar4 + 4) & 1) == 0) {

              *puVar9 = *puVar10;

            }

            else {

              *puVar10 = *puVar9;

            }

          }

          FUN_0042cb70(param_1,puVar9 + 2,uVar4);

          if ((*(uint *)(uVar4 + 4) >> 2 & 1) != 0) break;

          cVar5 = FUN_00599310(puVar9,puVar12);

          if (cVar5 == '\0') goto LAB_0042d98a;

          uVar11 = uVar11 + 1;

          puVar12 = puVar9;

          if (param_3 <= uVar11) {

            return;

          }

        }

      }

    }

  }

  return;

}





// --- FUN_0042d9a0 at 0x0042D9A0 (size: 129) ---


undefined4 __thiscall FUN_0042d9a0(int param_1,uint *param_2,uint *param_3)



{

  uint *puVar1;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 100) + (*param_2 % *(uint *)(param_1 + 0x6c)) * 4);

  do {

    if (puVar1 == (uint *)0x0) {

LAB_0042d9cb:

      puVar1 = (uint *)FUN_005df0f5(0xc);

      if (puVar1 != (uint *)0x0) {

        *puVar1 = *param_2;

        puVar1[1] = 0;

        puVar1[2] = *param_3;

        FUN_0042bd40(puVar1);

        return 1;

      }

      FUN_0042bd40(0);

      return 1;

    }

    if (*puVar1 == *param_2) {

      if (puVar1 != (uint *)0x0) {

        puVar1[2] = *param_3;

        return 1;

      }

      goto LAB_0042d9cb;

    }

    puVar1 = (uint *)puVar1[1];

  } while( true );

}





// --- FUN_0042da30 at 0x0042DA30 (size: 190) ---


undefined4 __thiscall FUN_0042da30(int param_1,uint *param_2,uint *param_3)



{

  uint uVar1;

  uint *puVar2;

  LONG LVar3;

  

  puVar2 = *(uint **)(*(int *)(param_1 + 100) + (*param_2 % *(uint *)(param_1 + 0x6c)) * 4);

  do {

    if (puVar2 == (uint *)0x0) {

LAB_0042da5b:

      puVar2 = (uint *)FUN_005df0f5(0xc);

      if (puVar2 == (uint *)0x0) {

        FUN_0042bd40(0);

        return 1;

      }

      *puVar2 = *param_2;

      puVar2[1] = 0;

      uVar1 = *param_3;

      puVar2[2] = uVar1;

      InterlockedIncrement((LONG *)(uVar1 - 0x10));

      FUN_0042bd40(puVar2);

      return 1;

    }

    if (*puVar2 == *param_2) {

      if (puVar2 != (uint *)0x0) {

        uVar1 = puVar2[2];

        if (uVar1 == *param_3) {

          return 1;

        }

        LVar3 = InterlockedDecrement((LONG *)(uVar1 - 0x10));

        if ((LVar3 == 0) && ((undefined4 *)(uVar1 - 0x14) != (undefined4 *)0x0)) {

          (*(code *)**(undefined4 **)(uVar1 - 0x14))(1);

        }

        uVar1 = *param_3;

        puVar2[2] = uVar1;

        InterlockedIncrement((LONG *)(uVar1 - 0x10));

        return 1;

      }

      goto LAB_0042da5b;

    }

    puVar2 = (uint *)puVar2[1];

  } while( true );

}





// --- FUN_0042daf0 at 0x0042DAF0 (size: 104) ---


void FUN_0042daf0(void)



{

  int iVar1;

  int *piVar2;

  int iVar3;

  undefined1 local_c [12];

  

  piVar2 = (int *)FUN_0052dcf0(local_c);

  iVar3 = piVar2[2];

  iVar1 = *piVar2;

  piVar2 = (int *)piVar2[1];

  while (iVar3 != 0) {

    do {

      if (*(undefined4 **)(iVar3 + 8) != (undefined4 *)0x0) {

        (**(code **)**(undefined4 **)(iVar3 + 8))(1);

      }

      *(undefined4 *)(iVar3 + 8) = 0;

      iVar3 = *(int *)(iVar3 + 4);

    } while (iVar3 != 0);

    do {

      piVar2 = piVar2 + 1;

      if (piVar2 == (int *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) goto LAB_0042db49;

      iVar3 = *piVar2;

    } while (iVar3 == 0);

  }

LAB_0042db49:

  FUN_005870f0();

  return;

}





// --- FUN_0042db60 at 0x0042DB60 (size: 85) ---


void FUN_0042db60(int param_1)



{

  undefined4 *puVar1;

  void *pvVar2;

  undefined4 local_4;

  

  if (param_1 != 0) {

    local_4 = *(undefined4 *)(param_1 + 8);

    pvVar2 = (void *)FUN_004171e0(&local_4);

    if (pvVar2 != (void *)0x0) {

      puVar1 = *(undefined4 **)((int)pvVar2 + 8);

      operator_delete(pvVar2);

      if (puVar1 != (undefined4 *)0x0) {

        (**(code **)*puVar1)(1);

      }

    }

    FUN_0042d9a0(&local_4,&param_1);

  }

  return;

}





// --- FUN_0042dbc0 at 0x0042DBC0 (size: 82) ---


undefined4 * __thiscall FUN_0042dbc0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798e5c;

  FUN_005870f0();

  param_1[1] = &PTR_FUN_00798d68;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042dc20 at 0x0042DC20 (size: 82) ---


undefined4 * __thiscall FUN_0042dc20(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798e60;

  FUN_00415e50();

  param_1[1] = &PTR_FUN_00798d6c;

  if ((undefined4 *)param_1[0x19] != param_1 + 2) {

    operator_delete__((undefined4 *)param_1[0x19]);

  }

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042dc80 at 0x0042DC80 (size: 129) ---


undefined4 * __fastcall FUN_0042dc80(undefined4 *param_1)



{

  LONG *pLVar1;

  

  pLVar1 = (LONG *)(PTR_DAT_00818344 + -0x10);

  *param_1 = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  param_1[1] = 0;

  param_1[2] = DAT_00837f28;

  param_1[3] = &PTR_FUN_00798e5c;

  FUN_0042d660(0x17);

  pLVar1 = (LONG *)(PTR_DAT_00818340 + -0x10);

  param_1[0x20] = PTR_DAT_00818340;

  InterlockedIncrement(pLVar1);

  *(undefined1 *)(param_1 + 0x21) = 0;

  pLVar1 = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[0x22] = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  pLVar1 = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[0x23] = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  return param_1;

}





// --- FUN_0042dd10 at 0x0042DD10 (size: 277) ---


void __fastcall FUN_0042dd10(int *param_1)



{

  undefined *puVar1;

  LONG LVar2;

  LONG *pLVar3;

  

  param_1[1] = 0;

  param_1[2] = DAT_00837f28;

  puVar1 = (undefined *)*param_1;

  *(undefined1 *)(param_1 + 0x21) = 0;

  if (puVar1 != PTR_DAT_00818344) {

    LVar2 = InterlockedDecrement((LONG *)(puVar1 + -0x10));

    if ((LVar2 == 0) && ((undefined4 *)(puVar1 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(puVar1 + -0x14))(1);

    }

    pLVar3 = (LONG *)(PTR_DAT_00818344 + -0x10);

    *param_1 = (int)PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

  }

  puVar1 = (undefined *)param_1[0x20];

  if (puVar1 != PTR_DAT_00818340) {

    LVar2 = InterlockedDecrement((LONG *)(puVar1 + -0x10));

    if ((LVar2 == 0) && ((undefined4 *)(puVar1 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(puVar1 + -0x14))(1);

    }

    pLVar3 = (LONG *)(PTR_DAT_00818340 + -0x10);

    param_1[0x20] = (int)PTR_DAT_00818340;

    InterlockedIncrement(pLVar3);

  }

  puVar1 = (undefined *)param_1[0x22];

  if (puVar1 != PTR_DAT_00818344) {

    LVar2 = InterlockedDecrement((LONG *)(puVar1 + -0x10));

    if ((LVar2 == 0) && ((undefined4 *)(puVar1 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(puVar1 + -0x14))(1);

    }

    pLVar3 = (LONG *)(PTR_DAT_00818344 + -0x10);

    param_1[0x22] = (int)PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

  }

  puVar1 = (undefined *)param_1[0x23];

  if (puVar1 != PTR_DAT_00818344) {

    LVar2 = InterlockedDecrement((LONG *)(puVar1 + -0x10));

    if ((LVar2 == 0) && ((undefined4 *)(puVar1 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(puVar1 + -0x14))(1);

    }

    pLVar3 = (LONG *)(PTR_DAT_00818344 + -0x10);

    param_1[0x23] = (int)PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

  }

  FUN_0042daf0();

  return;

}





// --- FUN_0042de30 at 0x0042DE30 (size: 449) ---


int * __thiscall FUN_0042de30(int *param_1,int *param_2)



{

  int iVar1;

  undefined4 uVar2;

  char cVar3;

  LONG LVar4;

  int *piVar5;

  int iVar6;

  undefined4 *puVar7;

  undefined4 *puVar8;

  undefined4 *puVar9;

  undefined1 auStack_c [12];

  

  if (param_2 != param_1) {

    iVar1 = *param_1;

    if (iVar1 != *param_2) {

      LVar4 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar4 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = *param_2;

      *param_1 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    param_1[1] = param_2[1];

    param_1[2] = param_2[2];

    *(char *)(param_1 + 0x21) = (char)param_2[0x21];

    iVar1 = param_1[0x20];

    if (iVar1 != param_2[0x20]) {

      LVar4 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar4 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = param_2[0x20];

      param_1[0x20] = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    iVar1 = param_1[0x22];

    if (iVar1 != param_2[0x22]) {

      LVar4 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar4 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = param_2[0x22];

      param_1[0x22] = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    iVar1 = param_1[0x23];

    if (iVar1 != param_2[0x23]) {

      LVar4 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar4 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = param_2[0x23];

      param_1[0x23] = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    FUN_0042daf0();

    piVar5 = (int *)FUN_0052dcf0(auStack_c);

    puVar9 = (undefined4 *)piVar5[2];

    iVar1 = *piVar5;

    puVar8 = (undefined4 *)piVar5[1];

    while (puVar9 != (undefined4 *)0x0) {

      do {

        iVar6 = FUN_0042f3a0(puVar9[2]);

        if (iVar6 != 0) {

          puVar7 = (undefined4 *)FUN_005df0f5(0xc);

          if (puVar7 == (undefined4 *)0x0) {

            puVar7 = (undefined4 *)0x0;

          }

          else {

            uVar2 = *puVar9;

            puVar7[2] = iVar6;

            *puVar7 = uVar2;

            puVar7[1] = 0;

          }

          cVar3 = FUN_0042bd40(puVar7);

          if ((cVar3 == '\0') && (puVar7 != (undefined4 *)0x0)) {

            operator_delete(puVar7);

          }

        }

        puVar9 = (undefined4 *)puVar9[1];

      } while (puVar9 != (undefined4 *)0x0);

      do {

        puVar8 = puVar8 + 1;

        if (puVar8 == (undefined4 *)(*(int *)(iVar1 + 0x60) + *(int *)(iVar1 + 0x68) * 4)) {

          return param_1;

        }

        puVar9 = (undefined4 *)*puVar8;

      } while (puVar9 == (undefined4 *)0x0);

    }

  }

  return param_1;

}





// --- FUN_0042e000 at 0x0042E000 (size: 59) ---


void FUN_0042e000(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  int iVar1;

  

  iVar1 = FUN_005df0f5(0x18);

  if (iVar1 != 0) {

    iVar1 = FUN_0042eb70(param_1);

    if (iVar1 != 0) {

      *(undefined4 *)(iVar1 + 0x14) = param_3;

      *(undefined4 *)(iVar1 + 0x10) = param_2;

      FUN_0042db60(iVar1);

    }

  }

  return;

}





// --- FUN_0042e040 at 0x0042E040 (size: 59) ---


void FUN_0042e040(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  int iVar1;

  

  iVar1 = FUN_005df0f5(0x18);

  if (iVar1 != 0) {

    iVar1 = FUN_0042ebd0(param_1);

    if (iVar1 != 0) {

      *(undefined4 *)(iVar1 + 0x14) = param_3;

      *(undefined4 *)(iVar1 + 0x10) = param_2;

      FUN_0042db60(iVar1);

    }

  }

  return;

}





// --- FUN_0042e080 at 0x0042E080 (size: 68) ---


void FUN_0042e080(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined2 param_4)



{

  int iVar1;

  

  iVar1 = FUN_005df0f5(0x20);

  if (iVar1 != 0) {

    iVar1 = FUN_0042eb00(param_1);

    if (iVar1 != 0) {

      *(undefined4 *)(iVar1 + 0x10) = param_2;

      *(undefined4 *)(iVar1 + 0x14) = param_3;

      *(undefined2 *)(iVar1 + 0x18) = param_4;

      FUN_0042db60(iVar1);

    }

  }

  return;

}





// --- FUN_0042e0d0 at 0x0042E0D0 (size: 353) ---


void __thiscall FUN_0042e0d0(int param_1,int param_2)



{

  int iVar1;

  char *pcVar2;

  undefined4 *puVar3;

  char cVar4;

  char local_1;

  

  iVar1 = param_2;

  if ((DAT_00837720 == -0x7fffffff) || (local_1 = '\x01', DAT_00837720 == -0x7ffffffe)) {

    local_1 = '\0';

  }

  cVar4 = *(char *)(param_1 + 0x84);

  if ((local_1 == '\0') && (cVar4 == '\x02')) {

    cVar4 = '\0';

  }

  FUN_0040ad10(1);

  pcVar2 = (char *)FUN_0040acf0(1);

  if (pcVar2 != (char *)0x0) {

    if ((*(byte *)(iVar1 + 4) & 1) == 0) {

      cVar4 = *pcVar2;

    }

    else {

      *pcVar2 = cVar4;

    }

  }

  if ((~*(byte *)(iVar1 + 4) & 1) != 0) {

    *(char *)(param_1 + 0x84) = cVar4;

  }

  if (*(char *)(param_1 + 0x84) == '\x01') {

    FUN_004227d0(iVar1);

  }

  else {

    FUN_0040ad10(4);

    puVar3 = (undefined4 *)FUN_0040acf0(4);

    if (puVar3 != (undefined4 *)0x0) {

      if ((*(byte *)(iVar1 + 4) & 1) == 0) {

        *(undefined4 *)(param_1 + 4) = *puVar3;

      }

      else {

        *puVar3 = *(undefined4 *)(param_1 + 4);

      }

    }

    FUN_0040ad10(4);

    puVar3 = (undefined4 *)FUN_0040acf0(4);

    if (puVar3 != (undefined4 *)0x0) {

      if ((*(byte *)(iVar1 + 4) & 1) == 0) {

        *(undefined4 *)(param_1 + 8) = *puVar3;

      }

      else {

        *puVar3 = *(undefined4 *)(param_1 + 8);

      }

    }

  }

  FUN_0040ad10(1);

  pcVar2 = (char *)FUN_0040acf0(1);

  if (pcVar2 != (char *)0x0) {

    if ((*(byte *)(iVar1 + 4) & 1) == 0) {

      local_1 = *pcVar2;

    }

    else {

      *pcVar2 = local_1;

    }

  }

  if ((*(byte *)(iVar1 + 4) & 5) == 0) {

    if (local_1 == '\0') goto LAB_0042e206;

    if (local_1 != '\x01') {

      FUN_0040aa50();

    }

  }

  if (local_1 != '\0') {

    FUN_00402400(iVar1);

    FUN_00402400(iVar1);

    FUN_00402400(iVar1);

  }

LAB_0042e206:

  if ((~*(byte *)(iVar1 + 4) & 1) != 0) {

    FUN_005870f0();

  }

  FUN_0042d780(&param_2,param_1 + 0x10,iVar1);

  return;

}





// --- FUN_0042e240 at 0x0042E240 (size: 714) ---


undefined4 __thiscall FUN_0042e240(int param_1,int *param_2,char param_3)



{

  char cVar1;

  LONG LVar2;

  undefined4 uVar3;

  int iVar4;

  undefined4 uVar5;

  code *pcVar6;

  int *piVar7;

  int *piVar8;

  undefined4 *puVar9;

  int *local_88;

  int local_84;

  int local_80;

  int *local_7c;

  int local_78;

  undefined **local_74;

  undefined **local_70;

  undefined1 auStack_6c [92];

  undefined1 *puStack_10;

  undefined4 uStack_c;

  undefined4 uStack_8;

  undefined4 uStack_4;

  

  pcVar6 = InterlockedDecrement_exref;

  if (*(char *)(param_1 + 0x84) == '\x01') {

    iVar4 = *param_2;

    if (iVar4 != *(int *)(param_1 + 0x80)) {

      LVar2 = InterlockedDecrement((LONG *)(iVar4 + -0x10));

      if ((LVar2 == 0) && ((undefined4 *)(iVar4 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar4 + -0x14))(1);

      }

      iVar4 = *(int *)(param_1 + 0x80);

      *param_2 = iVar4;

      InterlockedIncrement((LONG *)(iVar4 + -0x10));

    }

  }

  else {

    if (*(char *)(param_1 + 0x84) != '\x02') {

      FUN_004027b0(param_2,L"<string table error; token: 0x%08X tableDID: 0x%08X>",

                   *(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));

      if ((*(int *)(param_1 + 4) == 0) || (*(int *)(param_1 + 8) == DAT_00837f28)) {

        cVar1 = FUN_00413a90();

        if (cVar1 != '\0') {

          FUN_00413a70();

        }

        return 1;

      }

      FUN_0042caf0(*(int *)(param_1 + 8));

      piVar8 = local_88;

      if (local_88 == (int *)0x0) {

        return 3;

      }

      local_74 = &PTR_FUN_00798e60;

      FUN_0042d6f0(0x17);

      FUN_00429c70(&local_80);

      piVar7 = local_7c;

      iVar4 = local_78;

      while (iVar4 != 0) {

        do {

          if (*(int **)(iVar4 + 8) != (int *)0x0) {

            uVar3 = (**(code **)(**(int **)(iVar4 + 8) + 0x14))(&local_84);

            FUN_0042da30(iVar4,uVar3);

            puVar9 = (undefined4 *)(local_84 + -0x14);

            LVar2 = InterlockedDecrement((LONG *)(local_84 + -0x10));

            if ((LVar2 == 0) && (puVar9 != (undefined4 *)0x0)) {

              (**(code **)*puVar9)(1);

            }

          }

          iVar4 = *(int *)(iVar4 + 4);

        } while (iVar4 != 0);

        do {

          piVar7 = piVar7 + 1;

          piVar8 = local_88;

          if (piVar7 == (int *)(*(int *)(local_80 + 0x60) + *(int *)(local_80 + 0x68) * 4))

          goto LAB_0042e43b;

          iVar4 = *piVar7;

        } while (iVar4 == 0);

      }

LAB_0042e43b:

      uVar3 = FUN_00430270(param_2,*(undefined4 *)(param_1 + 4),&local_74,1);

      if (param_3 == '\0') {

        uVar5 = FUN_0067caf0(&local_84,param_2);

        FUN_00402070(uVar5);

        LVar2 = InterlockedDecrement((LONG *)(local_84 + -0x10));

        if ((LVar2 == 0) && ((undefined4 *)(local_84 + -0x14) != (undefined4 *)0x0)) {

          (*(code *)**(undefined4 **)(local_84 + -0x14))(1);

        }

      }

      local_74 = &PTR_FUN_00798e60;

      FUN_00415e50();

      local_70 = &PTR_FUN_00798d6c;

      if (puStack_10 != auStack_6c) {

        operator_delete__(puStack_10);

      }

      puStack_10 = (undefined1 *)0x0;

      uStack_c = 0;

      uStack_8 = 0;

      uStack_4 = 0;

      (**(code **)(*piVar8 + 0x14))();

      return uVar3;

    }

    uVar3 = FUN_00403350(&local_88,0);

    FUN_00402070(uVar3);

    pcVar6 = InterlockedDecrement_exref;

    piVar8 = local_88 + -5;

    LVar2 = InterlockedDecrement(local_88 + -4);

    if ((LVar2 == 0) && (piVar8 != (int *)0x0)) {

      (**(code **)*piVar8)(1);

    }

  }

  if (param_3 == '\0') {

    uVar3 = FUN_0067caf0(&local_88,param_2);

    FUN_00402070(uVar3);

    iVar4 = (*pcVar6)(local_88 + -4);

    if ((iVar4 == 0) && (local_88 + -5 != (int *)0x0)) {

      (**(code **)local_88[-5])(1);

    }

  }

  return 0;

}





// --- FUN_0042e510 at 0x0042E510 (size: 120) ---


undefined4 * __thiscall FUN_0042e510(undefined4 *param_1,undefined4 param_2)



{

  LONG *pLVar1;

  

  pLVar1 = (LONG *)(PTR_DAT_00818344 + -0x10);

  *param_1 = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  param_1[3] = &PTR_FUN_00798e5c;

  FUN_0042d660(0x17);

  pLVar1 = (LONG *)(PTR_DAT_00818340 + -0x10);

  param_1[0x20] = PTR_DAT_00818340;

  InterlockedIncrement(pLVar1);

  pLVar1 = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[0x22] = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  pLVar1 = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[0x23] = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  FUN_0042de30(param_2);

  return param_1;

}





// --- FUN_0042e590 at 0x0042E590 (size: 198) ---


void __fastcall FUN_0042e590(int *param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  FUN_0042dd10();

  puVar2 = (undefined4 *)(param_1[0x23] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x23] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x22] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x22] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  puVar2 = (undefined4 *)(param_1[0x20] + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(param_1[0x20] + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  param_1[3] = (int)&PTR_FUN_00798e5c;

  FUN_005870f0();

  param_1[4] = (int)&PTR_FUN_00798d68;

  if ((int *)param_1[0x1c] != param_1 + 5) {

    operator_delete__((int *)param_1[0x1c]);

  }

  param_1[0x1c] = 0;

  param_1[0x1d] = 0;

  param_1[0x1e] = 0;

  param_1[0x1f] = 0;

  puVar2 = (undefined4 *)(*param_1 + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(*param_1 + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  return;

}





// --- FUN_0042e660 at 0x0042E660 (size: 65) ---


void FUN_0042e660(undefined4 param_1,undefined4 param_2)



{

  int iVar1;

  

  iVar1 = FUN_005df0f5(0x9c);

  if ((iVar1 != 0) && (iVar1 = FUN_0042ea40(param_1), iVar1 != 0)) {

    FUN_0042de30(param_2);

    FUN_0042db60(iVar1);

  }

  return;

}





// --- FUN_0042e6b0 at 0x0042E6B0 (size: 136) ---


undefined4 FUN_0042e6b0(int *param_1,int param_2)



{

  int iVar1;

  int *piVar2;

  LONG LVar3;

  undefined4 *puVar4;

  

  iVar1 = FUN_0042e240(param_1,param_2);

  if (iVar1 == 0) {

    piVar2 = (int *)FUN_0067cdc0(&param_2,param_1);

    iVar1 = *param_1;

    if (iVar1 != *piVar2) {

      LVar3 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar3 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

        (*(code *)**(undefined4 **)(iVar1 + -0x14))(1);

      }

      iVar1 = *piVar2;

      *param_1 = iVar1;

      InterlockedIncrement((LONG *)(iVar1 + -0x10));

    }

    puVar4 = (undefined4 *)(param_2 + -0x14);

    LVar3 = InterlockedDecrement((LONG *)(param_2 + -0x10));

    if ((LVar3 == 0) && (puVar4 != (undefined4 *)0x0)) {

      (**(code **)*puVar4)(1);

    }

    return 1;

  }

  return 0;

}





// --- FUN_0042e740 at 0x0042E740 (size: 405) ---


undefined4 * __thiscall FUN_0042e740(int param_1,undefined4 *param_2,wchar_t *param_3)



{

  int iVar1;

  size_t sVar2;

  LONG LVar3;

  int *piVar4;

  undefined4 *puVar5;

  undefined *local_10;

  int local_c;

  int local_8;

  int local_4;

  

  local_10 = PTR_DAT_00818340;

  InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

  iVar1 = FUN_0042e240(&local_10,param_3);

  if (iVar1 == 0) {

    FUN_00402730(&DAT_00798f60);

    sVar2 = wcslen(L"(");

    FUN_004022d0(sVar2);

    wcscpy(param_3,L"(");

    FUN_004086c0(&local_c,&local_10);

    LVar3 = InterlockedDecrement((LONG *)(param_3 + -8));

    if ((LVar3 == 0) && (param_3 + -10 != (wchar_t *)0x0)) {

      (*(code *)**(undefined4 **)(param_3 + -10))(1);

    }

    piVar4 = (int *)FUN_004086c0(&local_4,&local_8);

    if (local_10 != (undefined *)*piVar4) {

      puVar5 = (undefined4 *)(local_10 + -0x14);

      LVar3 = InterlockedDecrement((LONG *)(local_10 + -0x10));

      if ((LVar3 == 0) && (puVar5 != (undefined4 *)0x0)) {

        (**(code **)*puVar5)(1);

      }

      local_10 = (undefined *)*piVar4;

      InterlockedIncrement((LONG *)(local_10 + -0x10));

    }

    LVar3 = InterlockedDecrement((LONG *)(local_4 + -0x10));

    if ((LVar3 == 0) && ((undefined4 *)(local_4 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(local_4 + -0x14))(1);

    }

    LVar3 = InterlockedDecrement((LONG *)(local_c + -0x10));

    if ((LVar3 == 0) && ((undefined4 *)(local_c + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(local_c + -0x14))(1);

    }

    LVar3 = InterlockedDecrement((LONG *)(local_8 + -0x10));

    if ((LVar3 == 0) && ((undefined4 *)(local_8 + -0x14) != (undefined4 *)0x0)) {

      (*(code *)**(undefined4 **)(local_8 + -0x14))(1);

    }

  }

  else {

    FUN_004027b0(&local_10,L"<could not render string: table 0x%08X token 0x%08X. Reason = %d>",

                 *(undefined4 *)(param_1 + 8),*(undefined4 *)(param_1 + 4),iVar1);

  }

  *param_2 = local_10;

  InterlockedIncrement((LONG *)(local_10 + -0x10));

  puVar5 = (undefined4 *)(local_10 + -0x14);

  LVar3 = InterlockedDecrement((LONG *)(local_10 + -0x10));

  if ((LVar3 == 0) && (puVar5 != (undefined4 *)0x0)) {

    (**(code **)*puVar5)(1);

  }

  return param_2;

}





// --- FUN_0042e8e0 at 0x0042E8E0 (size: 153) ---


void FUN_0042e8e0(undefined4 param_1,int param_2)



{

  int iVar1;

  LONG LVar2;

  undefined4 *puVar3;

  undefined1 local_90 [144];

  

  FUN_0042dc80();

  FUN_0042cbe0(&param_2,1);

  iVar1 = FUN_005df0f5(0x9c);

  if (iVar1 != 0) {

    iVar1 = FUN_0042ea40(param_1);

    if (iVar1 != 0) {

      FUN_0042de30(local_90);

      FUN_0042db60(iVar1);

    }

  }

  FUN_0042e590();

  puVar3 = (undefined4 *)(param_2 + -0x14);

  LVar2 = InterlockedDecrement((LONG *)(param_2 + -0x10));

  if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

    (**(code **)*puVar3)(1);

  }

  return;

}





// --- FUN_0042e980 at 0x0042E980 (size: 102) ---


undefined4 * FUN_0042e980(undefined4 *param_1,undefined4 param_2)



{

  LONG LVar1;

  undefined4 *puVar2;

  undefined *local_4;

  

  local_4 = PTR_DAT_00818340;

  InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

  FUN_0042e6b0(&local_4,param_2);

  *param_1 = local_4;

  InterlockedIncrement((LONG *)(local_4 + -0x10));

  puVar2 = (undefined4 *)(local_4 + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(local_4 + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  return param_1;

}





// --- FUN_0042e9f0 at 0x0042E9F0 (size: 67) ---


void FUN_0042e9f0(undefined4 param_1,int param_2)



{

  LONG LVar1;

  

  FUN_00403350(&stack0xfffffff8,0);

  FUN_0042e8e0(param_1);

  LVar1 = InterlockedDecrement((LONG *)(param_2 + -0x10));

  if ((LVar1 == 0) && ((undefined4 *)(param_2 + -0x14) != (undefined4 *)0x0)) {

    (*(code *)**(undefined4 **)(param_2 + -0x14))();

  }

  return;

}





// --- FUN_0042ea40 at 0x0042EA40 (size: 36) ---


undefined4 * __thiscall FUN_0042ea40(undefined4 *param_1,undefined4 param_2)



{

  *(undefined2 *)(param_1 + 1) = 1;

  param_1[2] = param_2;

  *param_1 = &PTR_FUN_00798fc0;

  FUN_0042dc80();

  return param_1;

}





// --- FUN_0042ea70 at 0x0042EA70 (size: 45) ---


undefined4 * __thiscall FUN_0042ea70(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00798fc0;

  FUN_0042e590();

  *param_1 = &PTR_LAB_00798fa4;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042eaa0 at 0x0042EAA0 (size: 51) ---


undefined4 __thiscall FUN_0042eaa0(int param_1,int param_2)



{

  char cVar1;

  

  if ((*(short *)(param_1 + 4) == *(short *)(param_2 + 4)) &&

     (*(int *)(param_1 + 8) == *(int *)(param_2 + 8))) {

    cVar1 = FUN_0042d540(param_2 + 0xc);

    if (cVar1 != '\0') {

      return 1;

    }

  }

  return 0;

}





// --- FUN_0042eb00 at 0x0042EB00 (size: 36) ---


void __thiscall FUN_0042eb00(undefined4 *param_1,undefined4 param_2)



{

  param_1[2] = param_2;

  *(undefined2 *)(param_1 + 1) = 2;

  *param_1 = &PTR_LAB_00798fd8;

  param_1[4] = 0;

  param_1[5] = 0;

  *(undefined2 *)(param_1 + 6) = 0;

  return;

}





// --- FUN_0042eb30 at 0x0042EB30 (size: 58) ---


undefined4 __thiscall FUN_0042eb30(int param_1,int param_2)



{

  if ((((*(short *)(param_1 + 4) == *(short *)(param_2 + 4)) &&

       (*(int *)(param_1 + 8) == *(int *)(param_2 + 8))) &&

      (*(double *)(param_1 + 0x10) == *(double *)(param_2 + 0x10))) &&

     (*(short *)(param_1 + 0x18) == *(short *)(param_2 + 0x18))) {

    return 1;

  }

  return 0;

}





// --- FUN_0042eb70 at 0x0042EB70 (size: 32) ---


void __thiscall FUN_0042eb70(undefined4 *param_1,undefined4 param_2)



{

  param_1[2] = param_2;

  *(undefined2 *)(param_1 + 1) = 4;

  *param_1 = &PTR_LAB_00798ff0;

  param_1[4] = 0;

  param_1[5] = 0;

  return;

}





// --- FUN_0042eb90 at 0x0042EB90 (size: 51) ---


undefined4 __thiscall FUN_0042eb90(int param_1,int param_2)



{

  if ((((*(short *)(param_1 + 4) == *(short *)(param_2 + 4)) &&

       (*(int *)(param_1 + 8) == *(int *)(param_2 + 8))) &&

      (*(int *)(param_1 + 0x10) == *(int *)(param_2 + 0x10))) &&

     (*(int *)(param_1 + 0x14) == *(int *)(param_2 + 0x14))) {

    return 1;

  }

  return 0;

}





// --- FUN_0042ebd0 at 0x0042EBD0 (size: 32) ---


void __thiscall FUN_0042ebd0(undefined4 *param_1,undefined4 param_2)



{

  param_1[2] = param_2;

  *(undefined2 *)(param_1 + 1) = 6;

  *param_1 = &PTR_LAB_00799008;

  param_1[4] = 0;

  param_1[5] = 0;

  return;

}





// --- FUN_0042ec10 at 0x0042EC10 (size: 60) ---


void __thiscall FUN_0042ec10(undefined4 *param_1,undefined4 param_2)



{

  param_1[2] = param_2;

  param_1[4] = 0;

  param_1[5] = 0;

  *(undefined2 *)(param_1 + 6) = 0;

  param_1[8] = &PTR_FUN_00798fbc;

  *(undefined1 *)(param_1 + 9) = 1;

  *(undefined2 *)((int)param_1 + 0x26) = 0xffff;

  *param_1 = &PTR_LAB_00799024;

  param_1[8] = &PTR_LAB_00799020;

  *(undefined2 *)(param_1 + 1) = 3;

  return;

}





// --- FUN_0042ec80 at 0x0042EC80 (size: 76) ---


undefined4 __thiscall FUN_0042ec80(int param_1,int param_2)



{

  if ((((*(short *)(param_1 + 4) == *(short *)(param_2 + 4)) &&

       (*(int *)(param_1 + 8) == *(int *)(param_2 + 8))) &&

      (*(double *)(param_1 + 0x10) == *(double *)(param_2 + 0x10))) &&

     (((*(short *)(param_1 + 0x18) == *(short *)(param_2 + 0x18) &&

       (*(char *)(param_1 + 0x24) == *(char *)(param_2 + 0x24))) &&

      (*(short *)(param_1 + 0x26) == *(short *)(param_2 + 0x26))))) {

    return 1;

  }

  return 0;

}





// --- FUN_0042ecd0 at 0x0042ECD0 (size: 56) ---


void __thiscall FUN_0042ecd0(undefined4 *param_1,undefined4 param_2)



{

  param_1[2] = param_2;

  param_1[4] = 0;

  param_1[5] = 0;

  param_1[6] = &PTR_FUN_00798fbc;

  *(undefined1 *)(param_1 + 7) = 1;

  *(undefined2 *)((int)param_1 + 0x1e) = 0xffff;

  *param_1 = &PTR_LAB_00799040;

  param_1[6] = &PTR_LAB_0079903c;

  *(undefined2 *)(param_1 + 1) = 5;

  return;

}





// --- FUN_0042ed40 at 0x0042ED40 (size: 69) ---


undefined4 __thiscall FUN_0042ed40(int param_1,int param_2)



{

  if ((((*(short *)(param_1 + 4) == *(short *)(param_2 + 4)) &&

       (*(int *)(param_1 + 8) == *(int *)(param_2 + 8))) &&

      (*(int *)(param_1 + 0x10) == *(int *)(param_2 + 0x10))) &&

     (((*(int *)(param_1 + 0x14) == *(int *)(param_2 + 0x14) &&

       (*(char *)(param_1 + 0x1c) == *(char *)(param_2 + 0x1c))) &&

      (*(short *)(param_1 + 0x1e) == *(short *)(param_2 + 0x1e))))) {

    return 1;

  }

  return 0;

}





// --- FUN_0042ed90 at 0x0042ED90 (size: 150) ---


undefined4 FUN_0042ed90(undefined2 param_1)



{

  int iVar1;

  undefined4 uVar2;

  

  switch(param_1) {

  case 1:

    iVar1 = FUN_005df0f5(0x9c);

    if (iVar1 != 0) {

      uVar2 = FUN_0042ea40(0);

      return uVar2;

    }

    break;

  case 2:

    iVar1 = FUN_005df0f5(0x20);

    if (iVar1 != 0) {

      uVar2 = FUN_0042eb00(0);

      return uVar2;

    }

    break;

  case 3:

    iVar1 = FUN_005df0f5(0x28);

    if (iVar1 != 0) {

      uVar2 = FUN_0042ec10(0);

      return uVar2;

    }

    break;

  case 4:

  case 6:

    iVar1 = FUN_005df0f5(0x18);

    if (iVar1 != 0) {

      uVar2 = FUN_0042eb70(0);

      return uVar2;

    }

    break;

  case 5:

  case 7:

    iVar1 = FUN_005df0f5(0x20);

    if (iVar1 != 0) {

      uVar2 = FUN_0042ecd0(0);

      return uVar2;

    }

  }

  return 0;

}





// --- FUN_0042ee50 at 0x0042EE50 (size: 51) ---


undefined4 * __thiscall FUN_0042ee50(undefined4 *param_1,int param_2)



{

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  param_1[2] = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_FUN_00798fc0;

  FUN_0042e510(param_2 + 0xc);

  return param_1;

}





// --- FUN_0042ee90 at 0x0042EE90 (size: 55) ---


void __thiscall FUN_0042ee90(undefined4 *param_1,int param_2)



{

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  param_1[2] = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_LAB_00798fd8;

  param_1[4] = *(undefined4 *)(param_2 + 0x10);

  param_1[5] = *(undefined4 *)(param_2 + 0x14);

  *(undefined2 *)(param_1 + 6) = *(undefined2 *)(param_2 + 0x18);

  return;

}





// --- FUN_0042eed0 at 0x0042EED0 (size: 89) ---


void __thiscall FUN_0042eed0(undefined4 *param_1,int param_2)



{

  undefined4 uVar1;

  

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  uVar1 = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_LAB_00798fd8;

  param_1[2] = uVar1;

  param_1[4] = *(undefined4 *)(param_2 + 0x10);

  param_1[5] = *(undefined4 *)(param_2 + 0x14);

  *(undefined2 *)(param_1 + 6) = *(undefined2 *)(param_2 + 0x18);

  param_1[8] = &PTR_FUN_00798fbc;

  *(undefined1 *)(param_1 + 9) = *(undefined1 *)(param_2 + 0x24);

  *(undefined2 *)((int)param_1 + 0x26) = *(undefined2 *)(param_2 + 0x26);

  *param_1 = &PTR_LAB_00799024;

  param_1[8] = &PTR_LAB_00799020;

  return;

}





// --- FUN_0042ef30 at 0x0042EF30 (size: 47) ---


void __thiscall FUN_0042ef30(undefined4 *param_1,int param_2)



{

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  param_1[2] = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_LAB_00798ff0;

  param_1[4] = *(undefined4 *)(param_2 + 0x10);

  param_1[5] = *(undefined4 *)(param_2 + 0x14);

  return;

}





// --- FUN_0042ef60 at 0x0042EF60 (size: 81) ---


void __thiscall FUN_0042ef60(undefined4 *param_1,int param_2)



{

  undefined4 uVar1;

  

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  uVar1 = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_LAB_00798ff0;

  param_1[2] = uVar1;

  param_1[4] = *(undefined4 *)(param_2 + 0x10);

  param_1[5] = *(undefined4 *)(param_2 + 0x14);

  param_1[6] = &PTR_FUN_00798fbc;

  *(undefined1 *)(param_1 + 7) = *(undefined1 *)(param_2 + 0x1c);

  *(undefined2 *)((int)param_1 + 0x1e) = *(undefined2 *)(param_2 + 0x1e);

  *param_1 = &PTR_LAB_00799040;

  param_1[6] = &PTR_LAB_0079903c;

  return;

}





// --- FUN_0042efc0 at 0x0042EFC0 (size: 47) ---


void __thiscall FUN_0042efc0(undefined4 *param_1,int param_2)



{

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  param_1[2] = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_LAB_00799008;

  param_1[4] = *(undefined4 *)(param_2 + 0x10);

  param_1[5] = *(undefined4 *)(param_2 + 0x14);

  return;

}





// --- FUN_0042eff0 at 0x0042EFF0 (size: 81) ---


void __thiscall FUN_0042eff0(undefined4 *param_1,int param_2)



{

  undefined4 uVar1;

  

  *param_1 = &PTR_LAB_00798fa4;

  *(undefined2 *)(param_1 + 1) = *(undefined2 *)(param_2 + 4);

  uVar1 = *(undefined4 *)(param_2 + 8);

  *param_1 = &PTR_LAB_00799008;

  param_1[2] = uVar1;

  param_1[4] = *(undefined4 *)(param_2 + 0x10);

  param_1[5] = *(undefined4 *)(param_2 + 0x14);

  param_1[6] = &PTR_FUN_00798fbc;

  *(undefined1 *)(param_1 + 7) = *(undefined1 *)(param_2 + 0x1c);

  *(undefined2 *)((int)param_1 + 0x1e) = *(undefined2 *)(param_2 + 0x1e);

  *param_1 = &PTR_LAB_00799058;

  param_1[6] = &PTR_LAB_0079903c;

  return;

}





// --- FUN_0042f050 at 0x0042F050 (size: 101) ---


undefined1 FUN_0042f050(int param_1,int param_2)



{

  undefined1 uVar1;

  

  uVar1 = 0;

  if (((param_1 != 0) && (param_2 != 0)) && (*(short *)(param_1 + 4) == *(short *)(param_2 + 4))) {

    switch(*(short *)(param_1 + 4)) {

    case 1:

      uVar1 = FUN_0042eaa0(param_1);

      return uVar1;

    case 2:

      uVar1 = FUN_0042eb30(param_1);

      return uVar1;

    case 3:

      uVar1 = FUN_0042ec80(param_1);

      return uVar1;

    case 4:

      uVar1 = FUN_0042eb90(param_1);

      return uVar1;

    case 5:

      uVar1 = FUN_0042ed40(param_1);

      return uVar1;

    case 6:

      uVar1 = FUN_0042eb90(param_1);

      return uVar1;

    case 7:

      uVar1 = FUN_0042ed40(param_1);

    }

  }

  return uVar1;

}





// --- FUN_0042f0e0 at 0x0042F0E0 (size: 100) ---


void __thiscall FUN_0042f0e0(int param_1,int param_2)



{

  undefined2 *puVar1;

  undefined4 *puVar2;

  

  FUN_0040ad10(2);

  puVar1 = (undefined2 *)FUN_0040acf0(2);

  if (puVar1 != (undefined2 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) == 0) {

      *(undefined2 *)(param_1 + 4) = *puVar1;

    }

    else {

      *puVar1 = *(undefined2 *)(param_1 + 4);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

  if (puVar2 != (undefined4 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) != 0) {

      *puVar2 = *(undefined4 *)(param_1 + 8);

      return;

    }

    *(undefined4 *)(param_1 + 8) = *puVar2;

  }

  return;

}





// --- FUN_0042f180 at 0x0042F180 (size: 118) ---


void __thiscall FUN_0042f180(int param_1,int param_2)



{

  undefined4 *puVar1;

  undefined2 *puVar2;

  

  FUN_0042f0e0(param_2);

  FUN_0040ad10(8);

  puVar1 = (undefined4 *)FUN_0040acf0(8);

  if (puVar1 != (undefined4 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0x10) = *puVar1;

      *(undefined4 *)(param_1 + 0x14) = puVar1[1];

    }

    else {

      *puVar1 = *(undefined4 *)(param_1 + 0x10);

      puVar1[1] = *(undefined4 *)(param_1 + 0x14);

    }

  }

  FUN_0040ad10(2);

  puVar2 = (undefined2 *)FUN_0040acf0(2);

  if (puVar2 != (undefined2 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) != 0) {

      *puVar2 = *(undefined2 *)(param_1 + 0x18);

      return;

    }

    *(undefined2 *)(param_1 + 0x18) = *puVar2;

  }

  return;

}





// --- FUN_0042f250 at 0x0042F250 (size: 73) ---


void __thiscall FUN_0042f250(int param_1,int param_2)



{

  undefined2 *puVar1;

  

  FUN_00422250(param_1 + 4,param_2);

  FUN_0040ad10(2);

  puVar1 = (undefined2 *)FUN_0040acf0(2);

  if (puVar1 != (undefined2 *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) != 0) {

      *puVar1 = *(undefined2 *)(param_1 + 6);

      return;

    }

    *(undefined2 *)(param_1 + 6) = *puVar1;

  }

  return;

}





// --- FUN_0042f3a0 at 0x0042F3A0 (size: 219) ---


undefined4 FUN_0042f3a0(int param_1)



{

  int iVar1;

  undefined4 uVar2;

  

  if (param_1 != 0) {

    switch(*(undefined2 *)(param_1 + 4)) {

    case 1:

      iVar1 = FUN_005df0f5(0x9c);

      if (iVar1 != 0) {

        uVar2 = FUN_0042ee50(param_1);

        return uVar2;

      }

      break;

    case 2:

      iVar1 = FUN_005df0f5(0x20);

      if (iVar1 != 0) {

        uVar2 = FUN_0042ee90(param_1);

        return uVar2;

      }

      break;

    case 3:

      iVar1 = FUN_005df0f5(0x28);

      if (iVar1 != 0) {

        uVar2 = FUN_0042eed0(param_1);

        return uVar2;

      }

      break;

    case 4:

      iVar1 = FUN_005df0f5(0x18);

      if (iVar1 != 0) {

        uVar2 = FUN_0042ef30(param_1);

        return uVar2;

      }

      break;

    case 5:

      iVar1 = FUN_005df0f5(0x20);

      if (iVar1 != 0) {

        uVar2 = FUN_0042ef60(param_1);

        return uVar2;

      }

      break;

    case 6:

      iVar1 = FUN_005df0f5(0x18);

      if (iVar1 != 0) {

        uVar2 = FUN_0042efc0(param_1);

        return uVar2;

      }

      break;

    case 7:

      iVar1 = FUN_005df0f5(0x20);

      if (iVar1 != 0) {

        uVar2 = FUN_0042eff0(param_1);

        return uVar2;

      }

    }

  }

  return 0;

}





// --- FUN_0042f4a0 at 0x0042F4A0 (size: 1141) ---


/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */



undefined4 *

FUN_0042f4a0(undefined4 *param_1,double param_2,ushort param_3,char param_4,uint param_5)



{

  undefined *puVar1;

  int iVar2;

  LONG LVar3;

  uint uVar4;

  int iVar5;

  short sVar6;

  int unaff_ESI;

  undefined4 *puVar7;

  short sVar8;

  code *pcVar9;

  float10 fVar10;

  undefined8 uVar11;

  ulonglong uVar12;

  undefined2 auStackY_10080 [32700];

  wchar_t *pwVar13;

  undefined1 *puVar14;

  undefined *local_e4;

  undefined4 uStack_e0;

  uint local_dc;

  undefined *local_d8;

  uint local_d4;

  undefined *local_d0;

  undefined *local_cc;

  int local_c8;

  ushort local_c4 [2];

  wchar_t *local_c0;

  ushort local_bc [2];

  double local_b8;

  double local_b0;

  uint local_a8;

  undefined4 local_a4;

  double local_a0;

  int local_98;

  uint uStack_94;

  double local_90;

  undefined4 local_88;

  uint uStack_84;

  undefined2 uStack_80;

  undefined1 auStack_7e [124];

  undefined2 local_2;

  

  local_e4 = PTR_DAT_00818340;

  InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

  local_b0 = ABS(param_2);

  sVar8 = -param_3;

  local_2 = 0;

  sVar6 = 0x3e;

  local_c8 = 0;

  local_a0 = local_b0;

  if (local_b0 < _DAT_007938c0) {

    local_a0 = 1.0;

  }

  if (DAT_00837cc8 != 0) {

    local_d4 = param_5;

    if ((short)param_5 == -1) {

      FUN_00422120(&local_d4);

    }

    if ((1 < (ushort)local_d4) && (param_3 < 0x15)) {

      FUN_00422100((int)&uStack_e0 + 3);

      FUN_004220e0(local_c4);

      local_d8 = PTR_DAT_00818340;

      InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

      FUN_00422510(&local_d8);

      local_dc = local_d4 & 0xffff;

      if (*(int *)(local_d8 + -4) - 1U < local_dc) {

        *param_1 = local_e4;

        InterlockedIncrement((LONG *)(local_e4 + -0x10));

        FUN_004011b0();

        FUN_004011b0();

        return param_1;

      }

      local_dc = (uint)sVar8;

      fVar10 = (float10)_CIpow();

      local_b8 = (double)fVar10;

      FUN_00422140(local_bc);

      local_d0 = PTR_DAT_00818340;

      InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

      FUN_00422560(&local_d0);

      local_cc = PTR_DAT_00818340;

      InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

      FUN_004225b0(&local_cc);

      local_a8 = local_d4 & 0xffff;

      local_90 = (double)local_a8;

      local_a4 = 0;

      while( true ) {

        local_dc = -(int)sVar8;

        _CIpow();

        uVar11 = FUN_005df4c4();

        uVar12 = __aullrem(uVar11,local_a8,local_a4);

        puVar1 = local_d0;

        uVar4 = (uint)(uVar12 >> 0x20);

        local_98 = (int)uVar12;

        (&uStack_80)[sVar6] = *(undefined2 *)(local_d8 + local_98 * 2);

        uStack_94 = uVar4 & 0x7fffffff;

        uStack_84 = uVar4 & 0x80000000;

        local_88 = 0;

        sVar6 = sVar6 + -1;

        local_c8 = local_c8 + 1;

        sVar8 = sVar8 + 1;

        local_b0 = local_b0 -

                   (-(double)(longlong)(((ulonglong)uVar4 & 0x80000000) << 0x20) +

                   (double)(uVar12 & 0x7fffffffffffffff)) * local_b8;

        local_b8 = local_90 * local_b8;

        if ((local_a0 < local_b8) &&

           ((uStack_e0._3_1_ == '\0' || ((int)(uint)local_c4[0] <= (int)(short)local_c8)))) break;

        if (sVar6 == 0) {

          *param_1 = local_e4;

          InterlockedIncrement((LONG *)(local_e4 + -0x10));

          pcVar9 = InterlockedDecrement_exref;

LAB_0042f82c:

          puVar7 = (undefined4 *)(local_cc + -0x14);

          iVar2 = (*pcVar9)(local_cc + -0x10);

          if ((iVar2 == 0) && (puVar7 != (undefined4 *)0x0)) {

            (**(code **)*puVar7)(1);

          }

          puVar7 = (undefined4 *)(local_d4 - 0x14);

          iVar2 = (*pcVar9)(local_d4 - 0x10);

          if ((iVar2 == 0) && (puVar7 != (undefined4 *)0x0)) {

            (**(code **)*puVar7)(1);

          }

          iVar2 = (*pcVar9)(uStack_e0 + -0x10);

          if ((iVar2 == 0) && ((undefined4 *)(uStack_e0 + -0x14) != (undefined4 *)0x0)) {

            (*(code *)**(undefined4 **)(uStack_e0 + -0x14))(1);

          }

          iVar2 = (*pcVar9)(unaff_ESI + -0x10);

          if ((iVar2 == 0) && ((undefined4 *)(unaff_ESI + -0x14) != (undefined4 *)0x0)) {

            (*(code *)**(undefined4 **)(unaff_ESI + -0x14))(1);

          }

          return param_1;

        }

        if (((param_4 != '\0') && (0 < sVar8)) && ((int)sVar8 % (int)(uint)local_bc[0] == 0)) {

          for (iVar2 = *(int *)(local_d0 + -4) + -2; -1 < iVar2; iVar2 = iVar2 + -1) {

            iVar5 = (int)sVar6;

            sVar6 = sVar6 + -1;

            (&uStack_80)[iVar5] = *(undefined2 *)(puVar1 + iVar2 * 2);

          }

        }

        if (sVar8 == 0) {

          for (iVar2 = *(int *)(local_cc + -4) + -2; -1 < iVar2; iVar2 = iVar2 + -1) {

            iVar5 = (int)sVar6;

            sVar6 = sVar6 + -1;

            (&uStack_80)[iVar5] = *(undefined2 *)(local_cc + iVar2 * 2);

          }

        }

      }

      local_c0 = (wchar_t *)PTR_DAT_00818340;

      InterlockedIncrement((LONG *)(PTR_DAT_00818340 + -0x10));

      FUN_00422600(&local_c0);

      if (_DAT_00795610 <= param_2) {

        puVar14 = auStack_7e + sVar6 * 2;

        if ((ushort)local_d4 == 0x10) {

          pwVar13 = L"0x%s";

        }

        else {

          pwVar13 = L"%s";

        }

      }

      else {

        puVar14 = auStack_7e + sVar6 * 2;

        pwVar13 = local_c0;

      }

      FUN_004027b0(&local_e4,pwVar13,puVar14);

      *param_1 = local_e4;

      InterlockedIncrement((LONG *)(local_e4 + -0x10));

      pcVar9 = InterlockedDecrement_exref;

      pwVar13 = local_c0 + -10;

      LVar3 = InterlockedDecrement((LONG *)(local_c0 + -8));

      if ((LVar3 == 0) && (pwVar13 != (wchar_t *)0x0)) {

        (*(code *)**(undefined4 **)pwVar13)(1);

      }

      goto LAB_0042f82c;

    }

  }

  *param_1 = local_e4;

  InterlockedIncrement((LONG *)(local_e4 + -0x10));

  puVar7 = (undefined4 *)(local_e4 + -0x14);

  LVar3 = InterlockedDecrement((LONG *)(local_e4 + -0x10));

  if ((LVar3 == 0) && (puVar7 != (undefined4 *)0x0)) {

    (**(code **)*puVar7)(1);

  }

  return param_1;

}





// --- FUN_0042fb60 at 0x0042FB60 (size: 87) ---


undefined4 __thiscall FUN_0042fb60(undefined4 *param_1,undefined4 *param_2)



{

  byte bVar1;

  byte *pbVar2;

  int iVar3;

  byte *pbVar4;

  bool bVar5;

  

  pbVar4 = (byte *)*param_2;

  pbVar2 = (byte *)*param_1;

  while( true ) {

    bVar1 = *pbVar2;

    bVar5 = bVar1 < *pbVar4;

    if (bVar1 != *pbVar4) break;

    if (bVar1 == 0) {

      return 0;

    }

    bVar1 = pbVar2[1];

    bVar5 = bVar1 < pbVar4[1];

    if (bVar1 != pbVar4[1]) break;

    pbVar2 = pbVar2 + 2;

    pbVar4 = pbVar4 + 2;

    if (bVar1 == 0) {

      return 0;

    }

  }

  iVar3 = (1 - (uint)bVar5) - (uint)(bVar5 != 0);

  return CONCAT31((int3)((uint)iVar3 >> 8),iVar3 < 0);

}





// --- FUN_0042fbc0 at 0x0042FBC0 (size: 64) ---


undefined4 * __thiscall FUN_0042fbc0(undefined4 *param_1,byte param_2)



{

  *param_1 = &PTR_FUN_00799124;

  if ((undefined4 *)param_1[0x18] != param_1 + 1) {

    operator_delete__((undefined4 *)param_1[0x18]);

  }

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  param_1[0x1a] = 0;

  param_1[0x1b] = 0;

  if ((param_2 & 1) != 0) {

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0042fc00 at 0x0042FC00 (size: 172) ---


void __thiscall FUN_0042fc00(int *param_1,int param_2)



{

  undefined4 *puVar1;

  uint *puVar2;

  uint uVar3;

  undefined4 *puVar4;

  uint uVar5;

  

  uVar5 = param_1[2];

  FUN_0040ad10(4);

  puVar2 = (uint *)FUN_0040acf0(4);

  if (puVar2 != (uint *)0x0) {

    if ((*(byte *)(param_2 + 4) & 1) == 0) {

      uVar5 = *puVar2;

    }

    else {

      *puVar2 = uVar5;

    }

  }

  if ((~*(byte *)(param_2 + 4) & 1) != 0) {

    uVar3 = FUN_0040a8f0();

    if (uVar3 < uVar5) {

      FUN_0040aa50();

      return;

    }

    param_1[2] = 0;

    FUN_0040ee80(uVar5,1);

  }

  if (param_1[2] != 0) {

    uVar5 = 0;

    do {

      puVar1 = (undefined4 *)(*param_1 + uVar5 * 4);

      FUN_0040ad10(4);

      puVar4 = (undefined4 *)FUN_0040acf0(4);

      if (puVar4 != (undefined4 *)0x0) {

        if ((*(byte *)(param_2 + 4) & 1) == 0) {

          *puVar1 = *puVar4;

        }

        else {

          *puVar4 = *puVar1;

        }

      }

      uVar5 = uVar5 + 1;

    } while (uVar5 < (uint)param_1[2]);

  }

  return;

}





// --- FUN_0042fd20 at 0x0042FD20 (size: 80) ---


undefined4 * __fastcall FUN_0042fd20(undefined4 *param_1)



{

  LONG *lpAddend;

  

  *param_1 = DAT_00837f54;

  lpAddend = (LONG *)(PTR_DAT_00818344 + -0x10);

  param_1[1] = PTR_DAT_00818344;

  InterlockedIncrement(lpAddend);

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[5] = 0;

  param_1[6] = 0;

  param_1[7] = 0;

  param_1[8] = 0;

  param_1[9] = 0;

  param_1[10] = 0;

  param_1[0xb] = 0;

  param_1[0xc] = 0;

  param_1[0xd] = 0;

  param_1[0xe] = 1;

  return param_1;

}





// --- FUN_0042fd70 at 0x0042FD70 (size: 155) ---


void __fastcall FUN_0042fd70(int param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  if (((*(uint *)(param_1 + 0x30) & 0x80000000) == 0x80000000) && (*(int *)(param_1 + 0x2c) != 0)) {

    FUN_00407920(3);

  }

  if ((*(uint *)(param_1 + 0x24) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x20));

  }

  if (((*(uint *)(param_1 + 0x18) & 0x80000000) == 0x80000000) && (*(int *)(param_1 + 0x14) != 0)) {

    FUN_00407920(3);

  }

  if (((*(uint *)(param_1 + 0xc) & 0x80000000) == 0x80000000) && (*(int *)(param_1 + 8) != 0)) {

    FUN_00407920(3);

  }

  puVar2 = (undefined4 *)(*(int *)(param_1 + 4) + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(*(int *)(param_1 + 4) + -0x10));

  if ((LVar1 == 0) && (puVar2 != (undefined4 *)0x0)) {

    (**(code **)*puVar2)(1);

  }

  return;

}





// --- FUN_0042fe10 at 0x0042FE10 (size: 642) ---


bool __fastcall FUN_0042fe10(int param_1)



{

  wchar_t *pwVar1;

  bool bVar2;

  size_t sVar3;

  int iVar4;

  LONG LVar5;

  char cVar6;

  int iVar7;

  wchar_t *local_18;

  wchar_t *pwStack_14;

  wchar_t *local_10;

  uint local_c;

  int local_8;

  wchar_t *pwStack_4;

  

  local_8 = 0;

  local_c = 0;

  if (*(int *)(param_1 + 0x34) != 0) {

    do {

      sVar3 = wcslen(L"PRE");

      FUN_004022d0(sVar3);

      wcscpy(local_10,L"PRE");

      iVar7 = local_c * 4;

      pwVar1 = *(wchar_t **)(*(int *)(param_1 + 0x2c) + iVar7);

      if (*(int *)(pwVar1 + -2) == *(int *)(local_10 + -2)) {

        if ((((*(int *)(pwVar1 + -4) != *(int *)(local_10 + -4)) && (*(int *)(pwVar1 + -4) != -1))

            && (*(int *)(local_10 + -4) != -1)) || (iVar4 = wcscmp(pwVar1,local_10), iVar4 != 0))

        goto LAB_0042fea8;

LAB_0043003f:

        bVar2 = true;

      }

      else {

LAB_0042fea8:

        sVar3 = wcslen(L"NAME");

        FUN_004022d0(sVar3);

        wcscpy(local_18,L"NAME");

        pwVar1 = *(wchar_t **)(*(int *)(param_1 + 0x2c) + iVar7);

        if (*(int *)(pwVar1 + -2) == *(int *)(local_18 + -2)) {

          if (((*(int *)(pwVar1 + -4) == *(int *)(local_18 + -4)) || (*(int *)(pwVar1 + -4) == -1))

             || (*(int *)(local_18 + -4) == -1)) {

            iVar4 = wcscmp(pwVar1,local_18);

            cVar6 = '\x01' - (iVar4 != 0);

          }

          else {

            cVar6 = '\0';

          }

        }

        else {

          cVar6 = '\0';

        }

        LVar5 = InterlockedDecrement((LONG *)(local_18 + -8));

        if ((LVar5 == 0) && (local_18 + -10 != (wchar_t *)0x0)) {

          (*(code *)**(undefined4 **)(local_18 + -10))(1);

        }

        if (cVar6 != '\0') goto LAB_0043003f;

        sVar3 = wcslen(L"MID");

        FUN_004022d0(sVar3);

        wcscpy(pwStack_14,L"MID");

        pwVar1 = *(wchar_t **)(*(int *)(param_1 + 0x2c) + iVar7);

        cVar6 = '\0';

        if (*(int *)(pwVar1 + -2) == *(int *)(pwStack_14 + -2)) {

          if (((*(int *)(pwVar1 + -4) == *(int *)(pwStack_14 + -4)) || (*(int *)(pwVar1 + -4) == -1)

              ) || (*(int *)(pwStack_14 + -4) == -1)) {

            iVar4 = wcscmp(pwVar1,pwStack_14);

            cVar6 = '\x01' - (iVar4 != 0);

          }

          else {

            cVar6 = '\0';

          }

        }

        LVar5 = InterlockedDecrement((LONG *)(pwStack_14 + -8));

        if ((LVar5 == 0) && (pwStack_14 + -10 != (wchar_t *)0x0)) {

          (*(code *)**(undefined4 **)(pwStack_14 + -10))(1);

        }

        if (cVar6 != '\0') goto LAB_0043003f;

        FUN_00402730(L"POST");

        pwVar1 = *(wchar_t **)(*(int *)(param_1 + 0x2c) + iVar7);

        cVar6 = '\0';

        if (*(int *)(pwVar1 + -2) == *(int *)(pwStack_4 + -2)) {

          if (((*(int *)(pwVar1 + -4) == *(int *)(pwStack_4 + -4)) || (*(int *)(pwVar1 + -4) == -1))

             || (*(int *)(pwStack_4 + -4) == -1)) {

            iVar7 = wcscmp(pwVar1,pwStack_4);

            cVar6 = '\x01' - (iVar7 != 0);

          }

          else {

            cVar6 = '\0';

          }

        }

        LVar5 = InterlockedDecrement((LONG *)(pwStack_4 + -8));

        if ((LVar5 == 0) && (pwStack_4 + -10 != (wchar_t *)0x0)) {

          (*(code *)**(undefined4 **)(pwStack_4 + -10))(1);

        }

        bVar2 = false;

        if (cVar6 != '\0') goto LAB_0043003f;

      }

      LVar5 = InterlockedDecrement((LONG *)(local_10 + -8));

      if ((LVar5 == 0) && (local_10 + -10 != (wchar_t *)0x0)) {

        (*(code *)**(undefined4 **)(local_10 + -10))(1);

      }

      if (bVar2) {

        local_8 = local_8 + 1;

      }

      local_c = local_c + 1;

    } while (local_c < *(uint *)(param_1 + 0x34));

  }

  return 1 < local_8;

}





