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

// --- FUN_004402d0 at 0x004402D0 (size: 1310) ---


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



uint FUN_004402d0(void)



{

  int *piVar1;

  undefined4 uVar2;

  int iVar3;

  undefined4 *puVar4;

  undefined4 uStack_64;

  undefined4 uStack_60;

  undefined4 *puStack_5c;

  undefined4 local_40;

  undefined4 local_3c;

  undefined4 local_38;

  undefined4 local_34;

  undefined4 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  puVar4 = &DAT_008383b8;

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

    *puVar4 = 0;

    puVar4 = puVar4 + 1;

  }

  DAT_00838450 = 0;

  DAT_00838454 = 0;

  DAT_00838458 = 0;

  DAT_0083845c = (int *)0x0;

  DAT_00838418 = 0;

  _DAT_008385c4 = 0;

  _DAT_008385c0 = 0;

  DAT_008385bc = 0;

  _DAT_008385d4 = 0;

  _DAT_008385d0 = 0;

  _DAT_008385c8 = 0;

  _DAT_008385e4 = 0;

  _DAT_008385dc = 0;

  _DAT_008385d8 = 0;

  _DAT_008385f0 = 0;

  _DAT_008385ec = 0;

  _DAT_008385e8 = 0;

  _DAT_008385f4 = 0x3f800000;

  _DAT_008385e0 = 0x3f800000;

  _DAT_008385cc = 0x3f800000;

  DAT_008385b8 = 0x3f800000;

  _DAT_00838604 = 0;

  _DAT_00838600 = 0;

  DAT_008385fc = 0;

  _DAT_00838614 = 0;

  _DAT_00838610 = 0;

  _DAT_00838608 = 0;

  _DAT_00838624 = 0;

  _DAT_0083861c = 0;

  _DAT_00838618 = 0;

  _DAT_00838630 = 0;

  _DAT_0083862c = 0;

  _DAT_00838628 = 0;

  _DAT_00838634 = 0x3f800000;

  _DAT_00838620 = 0x3f800000;

  _DAT_0083860c = 0x3f800000;

  DAT_008385f8 = 0x3f800000;

  _DAT_00838644 = 0;

  _DAT_00838640 = 0;

  DAT_0083863c = 0;

  _DAT_00838654 = 0;

  _DAT_00838650 = 0;

  _DAT_00838648 = 0;

  _DAT_00838664 = 0;

  _DAT_0083865c = 0;

  _DAT_00838658 = 0;

  _DAT_00838670 = 0;

  _DAT_0083866c = 0;

  _DAT_00838668 = 0;

  _DAT_00838674 = 0x3f800000;

  _DAT_00838660 = 0x3f800000;

  _DAT_0083864c = 0x3f800000;

  DAT_00838638 = 0x3f800000;

  local_40 = 0x3f800000;

  local_3c = 0;

  local_38 = 0;

  local_34 = 0;

  local_c = 0;

  local_8 = 0;

  local_4 = 0;

  puStack_5c = (undefined4 *)0x440463;

  FUN_00535b30();

  puStack_5c = &local_40;

  _DAT_00818cc4 = 0;

  uStack_60 = 0x44047b;

  FUN_00425f10();

  puStack_5c = (undefined4 *)0x440480;

  piVar1 = (int *)FUN_0043ffe0();

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

    puStack_5c = (undefined4 *)0xb0;

    DAT_00838470 = 1;

    uStack_60 = 0x440499;

    iVar3 = FUN_005df0f5();

    if (iVar3 == 0) {

      DAT_00838460 = 0;

    }

    else {

      puStack_5c = (undefined4 *)0x4404a7;

      DAT_00838460 = FUN_004451c0();

    }

    uStack_60 = 0x4404b6;

    puStack_5c = (undefined4 *)DAT_00838460;

    piVar1 = (int *)FUN_0043dd30();

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

      puStack_5c = (undefined4 *)0xb0;

      uStack_60 = 0x4404cb;

      iVar3 = FUN_005df0f5();

      if (iVar3 == 0) {

        DAT_00838464 = 0;

      }

      else {

        puStack_5c = (undefined4 *)0x4404d9;

        DAT_00838464 = FUN_004451c0();

      }

      uStack_60 = 0x4404e8;

      puStack_5c = (undefined4 *)DAT_00838464;

      piVar1 = (int *)FUN_0043ed80();

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

        puStack_5c = (undefined4 *)0x4404fe;

        DAT_0083845c = (int *)(**(code **)(*DAT_00870340 + 0x1c))();

        piVar1 = (int *)0x0;

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

          puStack_5c = (undefined4 *)0xffffffff;

          uStack_60 = 0;

          uStack_64 = 0;

          piVar1 = (int *)(**(code **)(*DAT_0083845c + 4))(3,0x102);

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

            piVar1 = (int *)FUN_00691dc0(&uStack_60,&DAT_00838468);

            if (-1 < *piVar1) {

              piVar1 = (int *)FUN_005de320(&uStack_60,&DAT_0083846c);

              if (-1 < *piVar1) {

                FUN_0054fc10(FUN_004154a0);

                FUN_0043f5d0();

                uVar2 = FUN_00424d10();

                FUN_0043e8e0(uVar2);

                DAT_00818c10 = 1;

                DAT_00818c14 = 1;

                _DAT_00838438 = 0;

                _DAT_0083843c = 0;

                _DAT_00818c18 = 9;

                _DAT_00818c1c = 9;

                FUN_00401340(

                            "Number of horizontal screen shot subdivision frames to capture (for high resolution images)"

                            );

                FUN_00401340("SceneTool.ScreenShotWidthScale");

                FUN_004369a0(&DAT_00818c10,4,&uStack_64,&uStack_60,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                FUN_00401340(

                            "Number of vertical screen shot subdivision frames to capture (for high resolution images)"

                            );

                FUN_00401340("SceneTool.ScreenShotHeightScale");

                FUN_004369a0(&DAT_00818c14,4,&uStack_60,&uStack_64,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                FUN_00401340(

                            "Zero-based index of first horizontal screen shot subdivision frame with the \'width\' range to capture"

                            );

                FUN_00401340("SceneTool.ScreenShotMinX");

                FUN_004369a0(&DAT_00838438,4,&uStack_60,&uStack_64,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                FUN_00401340(

                            "Zero-based index of first vertical screen shot subdivision frame with the \'height\' range to capture"

                            );

                FUN_00401340("SceneTool.ScreenShotMinY");

                FUN_004369a0(&DAT_0083843c,4,&uStack_60,&uStack_64,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                FUN_00401340(

                            "Zero-based index of last horizontal screen shot subdivision frame with the \'width\' range to capture"

                            );

                FUN_00401340("SceneTool.ScreenShotMaxX");

                FUN_004369a0(&DAT_00818c18,4,&uStack_60,&uStack_64,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                FUN_00401340(

                            "Zero-based index of last vertical screen shot subdivision frame with the \'height\' range to capture"

                            );

                FUN_00401340("SceneTool.ScreenShotMaxY");

                FUN_004369a0(&DAT_00818c1c,4,&uStack_60,&uStack_64,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                FUN_00401340("Toggles drawing of UI objects");

                FUN_00401340("SceneTool.RenderUIObjects");

                FUN_004369a0(&DAT_00818c0c,2,&uStack_60,&uStack_64,0,0,0,0);

                FUN_004011b0();

                FUN_004011b0();

                if (10 < DAT_00818c10) {

                  DAT_00818c10 = 10;

                }

                if (10 < DAT_00818c14) {

                  DAT_00818c14 = 10;

                }

                return 1;

              }

            }

          }

        }

      }

    }

  }

  return (uint)piVar1 & 0xffffff00;

}





// --- FUN_004407f0 at 0x004407F0 (size: 42) ---


void __fastcall FUN_004407f0(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_0079a5b0;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[5] = 0;

  *(undefined1 *)(param_1 + 6) = 0;

  param_1[7] = 0;

  param_1[8] = 0;

  *(undefined1 *)(param_1 + 9) = 0;

  return;

}





// --- FUN_00440820 at 0x00440820 (size: 288) ---


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



undefined4 __fastcall FUN_00440820(int param_1)



{

  int *piVar1;

  float fVar2;

  float fVar3;

  float fVar4;

  float fVar5;

  char cVar6;

  int *piVar7;

  undefined4 *puVar8;

  int iVar9;

  

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

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

    piVar7 = puVar8 + 1;

    *piVar7 = *piVar7 + -1;

    if (*piVar7 == 0) {

      (**(code **)*puVar8)(1);

    }

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

  }

  piVar7 = (int *)FUN_00447e40();

  *(int **)(param_1 + 0x14) = piVar7;

  cVar6 = (**(code **)(*piVar7 + 4))(4,0x102,1,1,0xffffffff);

  piVar7 = *(int **)(param_1 + 0x14);

  if (cVar6 == '\0') {

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

      piVar1 = piVar7 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)*piVar7)(1);

      }

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

    }

    return 0;

  }

  puVar8 = (undefined4 *)(**(code **)(*piVar7 + 0xc))(0,piVar7[0x1f]);

  iVar9 = *(int *)(param_1 + 0x1c) + -1;

  fVar2 = (float)iVar9;

  if (iVar9 < 0) {

    fVar2 = fVar2 + _DAT_0079920c;

  }

  iVar9 = *(int *)(*(int *)(param_1 + 8) + 0x88) + -1;

  fVar3 = (float)iVar9;

  if (iVar9 < 0) {

    fVar3 = fVar3 + _DAT_0079920c;

  }

  iVar9 = *(int *)(param_1 + 0x20) + -1;

  fVar4 = (float)iVar9;

  if (iVar9 < 0) {

    fVar4 = fVar4 + _DAT_0079920c;

  }

  iVar9 = *(int *)(*(int *)(param_1 + 8) + 0x8c) + -1;

  fVar5 = (float)iVar9;

  if (iVar9 < 0) {

    fVar5 = fVar5 + _DAT_0079920c;

  }

  puVar8[1] = 0;

  puVar8[3] = 0;

  puVar8[4] = 0;

  *puVar8 = 0xbf000000;

  puVar8[2] = 0x3f000000;

  puVar8[5] = 0x3f000000;

  puVar8[6] = 0;

  puVar8[7] = 0x3f000000;

  puVar8[9] = 0;

  puVar8[8] = fVar2 / fVar3;

  puVar8[10] = 0xbf000000;

  puVar8[0xb] = 0;

  puVar8[0xc] = 0xbf000000;

  puVar8[0xe] = fVar4 / fVar5;

  puVar8[0xd] = 0;

  puVar8[0xf] = 0x3f000000;

  puVar8[0x10] = 0;

  puVar8[0x11] = 0xbf000000;

  puVar8[0x12] = fVar2 / fVar3;

  puVar8[0x13] = fVar4 / fVar5;

  (**(code **)(**(int **)(param_1 + 0x14) + 0x10))(1,0);

  return 1;

}





// --- FUN_00440940 at 0x00440940 (size: 169) ---


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



void __fastcall FUN_00440940(int param_1)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  undefined4 *puVar4;

  int iVar5;

  

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

  *(undefined1 *)(param_1 + 0x24) = 0;

  if (iVar5 != 0) {

    iVar2 = *(int *)(iVar5 + 0x8c);

    iVar3 = *(int *)(iVar5 + 0x88);

    iVar5 = FUN_0043d7d0(*(undefined4 *)(iVar5 + 0x60));

    DAT_00838cd4 = DAT_00838cd4 - ((uint)*(byte *)(iVar5 + 0xc) * iVar2 * iVar3 >> 3);

  }

  if (*(int *)(param_1 + 0x10) != 0) {

    *(double *)(*(int *)(param_1 + 0x10) + 0x70) = _DAT_008379b0 - _DAT_0079a5a8;

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

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

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

    }

  }

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

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

    piVar1 = puVar4 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

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

    }

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

  }

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

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

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

  }

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

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

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

  }

  return;

}





// --- FUN_004409f0 at 0x004409F0 (size: 215) ---


undefined4 FUN_004409f0(uint param_1,uint param_2,uint *param_3,uint *param_4,char param_5)



{

  int iVar1;

  uint uVar2;

  

  if ((*(char *)(DAT_00870340 + 0x4e) != '\0') && (param_5 == '\0')) {

    *param_3 = param_1;

    *param_4 = param_2;

    return 1;

  }

  if (param_1 == 0) {

    *param_3 = 0;

  }

  else if (param_1 < 0x800) {

    *param_3 = param_1;

    iVar1 = 0x1f;

    if (param_1 != 0) {

      for (; param_1 >> iVar1 == 0; iVar1 = iVar1 + -1) {

      }

    }

    uVar2 = 1 << ((byte)iVar1 & 0x1f);

    if (uVar2 < *param_3) {

      *param_3 = uVar2 * 2;

    }

  }

  else {

    *param_3 = 0x800;

  }

  if (param_2 == 0) {

    *param_4 = 0;

    return 1;

  }

  if (0x7ff < param_2) {

    *param_4 = 0x800;

    return 1;

  }

  *param_4 = param_2;

  iVar1 = 0x1f;

  if (param_2 != 0) {

    for (; param_2 >> iVar1 == 0; iVar1 = iVar1 + -1) {

    }

  }

  uVar2 = 1 << ((byte)iVar1 & 0x1f);

  if (uVar2 < *param_4) {

    *param_4 = uVar2 * 2;

  }

  return 1;

}





// --- FUN_00440ad0 at 0x00440AD0 (size: 84) ---


undefined4 FUN_00440ad0(int param_1,int param_2)



{

  int local_8;

  int local_4;

  

  local_8 = 0;

  local_4 = 0;

  FUN_004409f0(param_1,param_2,&local_8,&local_4,1);

  if ((param_1 == local_8) && (param_2 == local_4)) {

    return 1;

  }

  return 0;

}





// --- FUN_00440b30 at 0x00440B30 (size: 490) ---


uint __thiscall FUN_00440b30(int param_1,int *param_2,uint param_3,byte param_4)



{

  int iVar1;

  int iVar2;

  undefined4 uVar3;

  int *piVar4;

  int iVar5;

  uint uVar6;

  uint uVar7;

  uint uVar8;

  int iVar9;

  

  piVar4 = DAT_00870340;

  if ((((DAT_00870340 != (int *)0x0) && (piVar4 = param_2, param_2 < (int *)0x801)) &&

      (param_3 < 0x801)) && ((param_2 != (int *)0x0 && (param_3 != 0)))) {

    *(int **)(param_1 + 0x1c) = param_2;

    *(uint *)(param_1 + 0x20) = param_3;

    uVar6 = *(uint *)(param_1 + 0x20);

    uVar8 = *(uint *)(param_1 + 0x1c);

    piVar4 = DAT_00870340;

    if (*(char *)((int)DAT_00870340 + 0x4e) == '\0') {

      if (uVar8 == 0) {

        uVar8 = 0;

      }

      else if (uVar8 < 0x800) {

        piVar4 = (int *)0x1f;

        if (uVar8 != 0) {

          for (; uVar8 >> (int)piVar4 == 0; piVar4 = (int *)((int)piVar4 + -1)) {

          }

        }

        uVar7 = 1 << ((byte)piVar4 & 0x1f);

        if (uVar7 < uVar8) {

          uVar8 = uVar7 * 2;

        }

      }

      else {

        uVar8 = 0x800;

      }

      if (uVar6 == 0) {

        uVar6 = 0;

      }

      else if (uVar6 < 0x800) {

        piVar4 = (int *)0x1f;

        if (uVar6 != 0) {

          for (; uVar6 >> (int)piVar4 == 0; piVar4 = (int *)((int)piVar4 + -1)) {

          }

        }

        uVar7 = 1 << ((byte)piVar4 & 0x1f);

        if (uVar7 < uVar6) {

          uVar6 = uVar7 * 2;

        }

      }

      else {

        uVar6 = 0x800;

      }

    }

    if ((uVar8 != 0) && (uVar6 != 0)) {

      uVar3 = FUN_0054fe80();

      *(undefined1 *)(param_1 + 0x18) = 0;

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

        *(undefined1 *)(param_1 + 0x18) = 1;

        uVar3 = FUN_0054fe80();

      }

      piVar4 = (int *)(**(code **)(*DAT_00870340 + 0x14))();

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

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

        iVar9 = 1;

        piVar4 = (int *)(**(code **)(**(int **)(param_1 + 8) + 0x58))(uVar8,uVar6,1,uVar3);

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

          iVar5 = (**(code **)(*piRam0000000a + 100))(0,0);

          if (iVar5 == 0) {

            iVar5 = 0;

          }

          else {

            iVar5 = iVar5 + -0x30;

          }

          *(int *)(iVar9 + 0xc) = iVar5;

          piVar4 = (int *)0x0;

          if ((*(int *)(iVar9 + 0xc) != 0) && (piVar4 = (int *)FUN_00440820(), (char)piVar4 != '\0')

             ) {

            *(undefined1 *)(*(int *)(iVar9 + 0xc) + 0x11c) = 1;

            iVar5 = *(int *)(iVar9 + 8);

            iVar1 = *(int *)(iVar5 + 0x88);

            iVar2 = *(int *)(iVar5 + 0x8c);

            iVar5 = FUN_0043d7d0(*(undefined4 *)(iVar5 + 0x60));

            uVar6 = (uint)*(byte *)(iVar5 + 0xc) * iVar1 * iVar2;

            DAT_00838cd4 = DAT_00838cd4 + (uVar6 >> 3);

            *(undefined1 *)(iVar9 + 0x24) = 1;

            return CONCAT31((uint3)(uVar6 >> 0xb),1);

          }

        }

      }

    }

  }

  return (uint)piVar4 & 0xffffff00;

}





// --- FUN_00440d20 at 0x00440D20 (size: 90) ---


undefined4 __fastcall FUN_00440d20(int param_1)



{

  undefined4 uVar1;

  undefined4 uVar2;

  char cVar3;

  

  if ((*(char *)(param_1 + 0x24) != '\0') && (DAT_00870340 != 0)) {

    if ((*(char *)(*(int *)(param_1 + 8) + 0x38) != '\0') ||

       (*(char *)(*(int *)(param_1 + 0xc) + 0x38) != '\0')) {

      cVar3 = *(char *)(param_1 + 0x18);

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

      uVar2 = *(undefined4 *)(param_1 + 0x1c);

      FUN_00440940();

      cVar3 = FUN_00440b30(uVar2,uVar1,cVar3 != '\0');

      if (cVar3 == '\0') {

        return 0;

      }

    }

    return 1;

  }

  return 0;

}





// --- FUN_00440d80 at 0x00440D80 (size: 42) ---


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



{

  *param_1 = &PTR_FUN_0079a5b0;

  FUN_00440940();

  *param_1 = &PTR_LAB_00796c4c;

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00440e50 at 0x00440E50 (size: 227) ---


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



undefined4 __fastcall FUN_00440e50(int param_1)



{

  int iVar1;

  char cVar2;

  int *piVar3;

  

  if (*(char *)(param_1 + 0x24) == '\0') {

    return 0;

  }

  cVar2 = FUN_00440d20();

  if (cVar2 == '\0') {

    return 0;

  }

  if (*(int *)(param_1 + 0xc) == 0) {

    return 0;

  }

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

    return 0;

  }

  if (*(char *)(*(int *)(param_1 + 0xc) + 0x11c) == '\0') {

    return 1;

  }

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

  if (iVar1 != 0) {

    if (*(char *)(iVar1 + 0x38) == '\0') goto LAB_00440f15;

    if (iVar1 != 0) {

      *(double *)(iVar1 + 0x70) = _DAT_008379b0 - _DAT_0079a5a8;

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

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

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

      }

    }

  }

  piVar3 = (int *)(**(code **)(*DAT_00870340 + 0x14))();

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

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

    return 0;

  }

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

  cVar2 = (**(code **)(*piVar3 + 0x58))

                    (*(undefined4 *)(iVar1 + 0x88),*(undefined4 *)(iVar1 + 0x8c),

                     *(undefined4 *)(iVar1 + 0x5c),*(undefined4 *)(iVar1 + 0x60),0);

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

  if (cVar2 == '\0') {

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

      return 0;

    }

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

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

    return 0;

  }

  *(undefined1 *)(piVar3 + 0x1e) = 0;

LAB_00440f15:

  cVar2 = (**(code **)(**(int **)(param_1 + 0x10) + 0x60))(*(undefined4 *)(param_1 + 8));

  if (cVar2 == '\0') {

    return 0;

  }

  *(undefined1 *)(*(int *)(param_1 + 0xc) + 0x11c) = 0;

  return 1;

}





// --- FUN_00440f40 at 0x00440F40 (size: 9) ---


undefined4 __fastcall FUN_00440f40(int param_1)



{

  return CONCAT31((int3)((uint)*(int *)(param_1 + 0x1c) >> 8),*(int *)(param_1 + 0x1c) == 0);

}





// --- FUN_00440f50 at 0x00440F50 (size: 143) ---


void __thiscall FUN_00440f50(int param_1,int param_2,int *param_3)



{

  int *piVar1;

  

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

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

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

  *piVar1 = *param_3;

  *(int *)(param_1 + 0x10) = param_3[1];

  *(int *)(param_1 + 0x14) = param_3[2];

  *(int *)(param_1 + 0x18) = param_3[3];

  if (*piVar1 < 0) {

    *piVar1 = 0;

  }

  if (*(int *)(param_1 + 0x10) < 0) {

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

  }

  if (*(int *)(param_2 + 0xa0) < *(int *)(param_1 + 0x14)) {

    *(int *)(param_1 + 0x14) = *(int *)(param_2 + 0xa0);

  }

  if (*(int *)(param_2 + 0xa4) < *(int *)(param_1 + 0x18)) {

    *(int *)(param_1 + 0x18) = *(int *)(param_2 + 0xa4);

  }

  if (*(int *)(param_1 + 0x14) < 1) {

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

  }

  if (*(int *)(param_1 + 0x18) < 1) {

    *(undefined4 *)(param_1 + 0x18) = 1;

  }

  if (*(int *)(param_1 + 0x14) <= *piVar1) {

    *piVar1 = *(int *)(param_1 + 0x14) + -1;

  }

  if (*(int *)(param_1 + 0x18) <= *(int *)(param_1 + 0x10)) {

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

  }

  return;

}





// --- FUN_00440fe0 at 0x00440FE0 (size: 58) ---


void FUN_00440fe0(undefined4 param_1,undefined4 param_2,undefined4 param_3,int param_4,int param_5)



{

  undefined4 local_10;

  undefined4 local_c;

  int local_8;

  int local_4;

  

  local_10 = param_2;

  local_c = param_3;

  local_8 = param_4 + 1;

  local_4 = param_5 + 1;

  FUN_00440f50(param_1,&local_10);

  return;

}





// --- FUN_00441020 at 0x00441020 (size: 81) ---


void FUN_00441020(int param_1,int *param_2)



{

  int extraout_ECX;

  int local_10;

  int local_c;

  int local_8;

  int local_4;

  

  local_10 = *param_2 + *(int *)(param_1 + 0xc);

  local_c = param_2[1] + *(int *)(param_1 + 0x10);

  local_8 = param_2[2] + *(int *)(param_1 + 0xc);

  local_4 = param_2[3] + *(int *)(param_1 + 0x10);

  FUN_00440f50(*(undefined4 *)(param_1 + 4),&local_10);

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

  return;

}





// --- FUN_00441080 at 0x00441080 (size: 54) ---


void __thiscall

FUN_00441080(int param_1,int param_2,int param_3,undefined4 param_4,undefined4 param_5)



{

  FUN_005a48c0(*(int *)(param_1 + 0xc) + param_2,*(int *)(param_1 + 0x10) + param_3,

               *(undefined4 *)(*(int *)(param_1 + 4) + 0xa0),

               *(undefined4 *)(*(int *)(param_1 + 4) + 0xa4),param_4,param_5);

  return;

}





// --- FUN_004410c0 at 0x004410C0 (size: 259) ---


undefined4 __thiscall FUN_004410c0(int param_1,undefined4 param_2)



{

  int *piVar1;

  int iVar2;

  char cVar3;

  int iVar4;

  int iVar5;

  

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

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

    if (*(int *)(param_1 + 0x1c) == 0) {

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

        FUN_004410c0(param_2);

        *(bool *)(param_1 + 0x20) = (char)param_2 == '\0';

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

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

        iVar4 = *(int *)(param_1 + 0xc) - *(int *)(iVar2 + 0xc);

        iVar5 = *(int *)(param_1 + 0x10) - *(int *)(iVar2 + 0x10);

        *(undefined4 *)(param_1 + 0x24) = *(undefined4 *)(iVar2 + 0x24);

        *(undefined4 *)(param_1 + 0x28) = *(undefined4 *)(iVar2 + 0x28);

        if (iVar4 != 0) {

          iVar4 = (uint)*(byte *)(*(int *)(param_1 + 4) + 0xe8) * iVar4;

          *(int *)(param_1 + 0x24) =

               *(int *)(param_1 + 0x24) + ((int)(iVar4 + (iVar4 >> 0x1f & 7U)) >> 3);

        }

        if (iVar5 == 0) {

          return 1;

        }

        *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + *(int *)(param_1 + 0x28) * iVar5;

        return 1;

      }

      if (((char)piVar1[0x36] == '\0') &&

         (cVar3 = (**(code **)(*piVar1 + 0x60))

                            (param_1 + 0xc,-((char)param_2 != '\0') & 2,param_1 + 0x28,

                             param_1 + 0x24), cVar3 != '\0')) {

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

        *(bool *)(param_1 + 0x20) = (char)param_2 == '\0';

        return 1;

      }

    }

    else if (((char)param_2 == '\0') == (bool)*(char *)(param_1 + 0x20)) {

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

      return 1;

    }

  }

  return 0;

}





// --- FUN_004411d0 at 0x004411D0 (size: 109) ---


uint __fastcall FUN_004411d0(int param_1)



{

  int *piVar1;

  int iVar2;

  uint in_EAX;

  

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

  if (((iVar2 != 0) && (in_EAX = *(uint *)(param_1 + 0x1c), in_EAX != 0)) &&

     (*(char *)(iVar2 + 0xd8) != '\0')) {

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

      if (*(char *)(param_1 + 0x20) != '\0') {

        *(undefined1 *)(iVar2 + 0x11c) = 1;

      }

      piVar1 = (int *)(param_1 + 0x1c);

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

        (**(code **)(**(int **)(param_1 + 4) + 100))();

      }

    }

    else {

      *(uint *)(param_1 + 0x1c) = in_EAX - 1;

      if (in_EAX - 1 == 0) {

        FUN_004411d0();

      }

    }

    if (*(int *)(param_1 + 0x1c) == 0) {

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

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

      *(undefined1 *)(param_1 + 0x20) = 0;

    }

    return CONCAT31((int3)((uint)*(int *)(param_1 + 0x1c) >> 8),1);

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_00441240 at 0x00441240 (size: 57) ---


undefined4 __thiscall FUN_00441240(int *param_1,undefined4 param_2)



{

  char cVar1;

  

  if ((char)param_1[1] != '\0') {

    return 1;

  }

  if (*param_1 != 0) {

    cVar1 = FUN_004410c0(param_2);

    if (cVar1 != '\0') {

      *(undefined1 *)(param_1 + 1) = 1;

      return 1;

    }

  }

  *(undefined1 *)(param_1 + 1) = 0;

  return 0;

}





// --- FUN_00441280 at 0x00441280 (size: 302) ---


undefined4 __thiscall FUN_00441280(int param_1,int param_2)



{

  int iVar1;

  char cVar2;

  uint uVar3;

  int local_20;

  undefined4 local_1c;

  undefined4 local_18;

  int local_14;

  undefined4 local_10;

  undefined4 local_c;

  uint local_8;

  uint local_4;

  

  if (param_1 == 0) {

    return 0;

  }

  cVar2 = FUN_004410c0(0);

  if (cVar2 == '\0') {

    return 0;

  }

  if ((param_2 == 0) || (cVar2 = FUN_004410c0(1), cVar2 == '\0')) goto LAB_0044139d;

  if (*(int *)(param_1 + 4) == 0) {

LAB_004412e0:

    local_14 = -1;

  }

  else {

    iVar1 = *(int *)(*(int *)(param_1 + 4) + 0xdc);

    if (iVar1 == 0x15) {

      local_14 = 2;

    }

    else {

      if (iVar1 != 0x1c) goto LAB_004412e0;

      local_14 = 1;

    }

  }

  local_c = *(undefined4 *)(param_1 + 0x28);

  local_10 = *(undefined4 *)(param_1 + 0x24);

  if (*(int *)(param_2 + 4) == 0) {

LAB_0044131a:

    local_20 = -1;

  }

  else {

    iVar1 = *(int *)(*(int *)(param_2 + 4) + 0xdc);

    if (iVar1 == 0x15) {

      local_20 = 2;

    }

    else {

      if (iVar1 != 0x1c) goto LAB_0044131a;

      local_20 = 1;

    }

  }

  local_18 = *(undefined4 *)(param_2 + 0x28);

  local_1c = *(undefined4 *)(param_2 + 0x24);

  if ((local_14 != -1) && (local_20 != -1)) {

    local_8 = *(int *)(param_2 + 0x14) - *(int *)(param_2 + 0xc);

    local_4 = *(int *)(param_2 + 0x18) - *(int *)(param_2 + 0x10);

    uVar3 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

    if (uVar3 < local_4) {

      local_4 = uVar3;

    }

    uVar3 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

    if (uVar3 < local_8) {

      local_8 = uVar3;

    }

    FUN_006613a0(&local_20);

    FUN_004411d0();

    FUN_004411d0();

    return 1;

  }

  FUN_004411d0();

LAB_0044139d:

  FUN_004411d0();

  return 0;

}





// --- FUN_004413b0 at 0x004413B0 (size: 479) ---


undefined4 __thiscall

FUN_004413b0(int param_1,undefined4 param_2,int param_3,int param_4,int param_5,int param_6)



{

  int iVar1;

  byte bVar2;

  char cVar3;

  int iVar4;

  undefined4 uVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  

  iVar7 = param_4;

  iVar4 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

  iVar9 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

  if (((((param_3 <= iVar4) || (param_5 <= iVar4)) && ((-1 < param_3 || (-1 < param_5)))) &&

      ((param_4 <= iVar9 || (param_6 <= iVar9)))) && ((-1 < param_4 || (-1 < param_6)))) {

    uVar5 = FUN_00424000();

    bVar2 = *(byte *)(*(int *)(param_1 + 4) + 0xe8) >> 3;

    cVar3 = FUN_004410c0(0);

    if (cVar3 != '\0') {

      iVar1 = *(int *)(param_1 + 0x24);

      iVar6 = param_5 - param_3;

      iVar10 = iVar6;

      if (iVar6 < 0) {

        iVar10 = param_3 - param_5;

      }

      param_5 = iVar10;

      iVar8 = param_6 - param_4;

      iVar10 = iVar8;

      if (iVar8 < 0) {

        iVar10 = param_4 - param_6;

      }

      iVar11 = param_5 - iVar10;

      if (iVar6 < 1) {

        param_6 = -(uint)(iVar6 < 0);

      }

      else {

        param_6 = 1;

      }

      if (iVar8 < 1) {

        param_2 = -(uint)(iVar8 < 0);

      }

      else {

        param_2 = 1;

      }

      param_4 = iVar10;

      if (param_5 < iVar10) {

LAB_00441520:

        if ((((-1 < param_3) && (-1 < iVar7)) && (param_3 < iVar4)) && (iVar7 < iVar9)) {

          *(undefined4 *)(*(int *)(param_1 + 0x28) * iVar7 + iVar1 + (uint)bVar2 * param_3) = uVar5;

        }

        if (-1 < iVar11) goto code_r0x0044155b;

        goto LAB_00441563;

      }

      param_4 = param_5;

LAB_004414c0:

      if (((-1 < param_3) && (-1 < iVar7)) && ((param_3 < iVar4 && (iVar7 < iVar9)))) {

        *(undefined4 *)(*(int *)(param_1 + 0x28) * iVar7 + iVar1 + (uint)bVar2 * param_3) = uVar5;

      }

      if (-1 < iVar11) goto code_r0x004414fb;

      goto LAB_00441512;

    }

  }

  return 0;

code_r0x0044155b:

  param_3 = param_3 + param_6;

  iVar11 = iVar11 - iVar10;

  if (iVar11 < 0) {

LAB_00441563:

    if (param_4 != 0) {

      iVar11 = iVar11 + param_5;

      iVar7 = iVar7 + param_2;

      param_4 = param_4 + -1;

      goto LAB_00441520;

    }

    goto LAB_0044157a;

  }

  goto LAB_00441520;

code_r0x004414fb:

  iVar6 = param_4 + -1;

  if (param_4 == 0) {

LAB_0044157a:

    FUN_004411d0();

    return 1;

  }

  param_3 = param_3 + param_6;

  iVar11 = iVar11 - iVar10;

  param_4 = iVar6;

  if (iVar11 < 0) {

LAB_00441512:

    iVar7 = iVar7 + param_2;

    iVar11 = iVar11 + param_5;

  }

  goto LAB_004414c0;

}





// --- FUN_00441590 at 0x00441590 (size: 129) ---


bool FUN_00441590(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,

                 undefined4 param_5)



{

  char cVar1;

  

  cVar1 = FUN_004413b0(param_1,param_2,param_3,param_4,param_3);

  if (cVar1 == '\0') {

    return false;

  }

  cVar1 = FUN_004413b0(param_1,param_2,param_5,param_4,param_5);

  if (cVar1 != '\0') {

    cVar1 = FUN_004413b0(param_1,param_2,param_3,param_2,param_5);

    if (cVar1 != '\0') {

      cVar1 = FUN_004413b0(param_1,param_4,param_3,param_4,param_5);

      return cVar1 != '\0';

    }

  }

  return false;

}





// --- FUN_00441620 at 0x00441620 (size: 176) ---


void __fastcall

FUN_00441620(undefined4 param_1,int param_2,int param_3,int param_4,int param_5,int param_6,

            int param_7,int param_8,int param_9,int param_10,int *param_11,int *param_12)



{

  int unaff_EBX;

  

  *param_11 = param_3 - param_2;

  param_11[1] = param_4 - param_10;

  param_11[2] = param_3 + param_5 + param_2;

  param_11[3] = param_4 + param_6 + param_10;

  param_12[1] = unaff_EBX - param_10;

  param_12[2] = param_5 + param_7 + param_2;

  param_7 = param_7 - param_2;

  *param_12 = param_7;

  param_12[3] = param_6 + unaff_EBX + param_2;

  if (param_7 < 0) {

    *param_11 = *param_11 - param_7;

    *param_12 = 0;

  }

  if (param_12[1] < 0) {

    param_11[1] = param_11[1] - param_12[1];

    param_12[1] = 0;

  }

  if (param_8 < param_12[2]) {

    param_11[2] = param_11[2] + (param_8 - param_12[2]);

    param_12[2] = param_8;

  }

  if (param_9 < param_12[3]) {

    param_11[3] = param_11[3] + (param_9 - param_12[3]);

    param_12[3] = param_9;

  }

  return;

}





// --- FUN_004416d0 at 0x004416D0 (size: 118) ---


undefined1 __fastcall FUN_004416d0(int param_1)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  char cVar5;

  int iVar6;

  undefined4 uVar7;

  int iVar8;

  int iVar9;

  

  cVar5 = FUN_004410c0(0);

  if (cVar5 == '\0') {

    return 0;

  }

  iVar1 = *(int *)(param_1 + 0x14);

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

  iVar6 = FUN_00424000();

  uVar7 = FUN_00424000();

  iVar9 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

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

  while (iVar9 = iVar9 + -1, -1 < iVar9) {

    iVar8 = *(int *)(param_1 + 0x28) * iVar9 + iVar3;

    iVar4 = iVar1 - iVar2;

    while (iVar4 = iVar4 + -1, -1 < iVar4) {

      if (*(int *)(iVar8 + iVar4 * 4) == iVar6) {

        *(undefined4 *)(iVar8 + iVar4 * 4) = uVar7;

      }

    }

  }

  FUN_004411d0();

  return 1;

}





// --- FUN_00441750 at 0x00441750 (size: 232) ---


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



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  char cVar5;

  int iVar6;

  int iVar7;

  int iVar8;

  int iVar9;

  int iVar10;

  int *piVar11;

  

  if ((((uint)(*(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc)) <=

        (uint)(*(int *)(param_3 + 0x14) - *(int *)(param_3 + 0xc))) &&

      ((uint)(*(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10)) <=

       (uint)(*(int *)(param_3 + 0x18) - *(int *)(param_3 + 0x10)))) &&

     (cVar5 = FUN_004410c0(0), cVar5 != '\0')) {

    cVar5 = FUN_004410c0(1);

    if (cVar5 != '\0') {

      iVar10 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

      iVar6 = FUN_00424000();

      iVar2 = *(int *)(param_1 + 0x24);

      iVar3 = *(int *)(param_3 + 0x24);

      iVar9 = (*(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10)) + -1;

      if (-1 < iVar9) {

        iVar1 = iVar10 + -1;

        do {

          iVar7 = *(int *)(param_1 + 0x28) * iVar9 + iVar2;

          iVar4 = *(int *)(param_3 + 0x28);

          if (-1 < iVar1) {

            piVar11 = (int *)(iVar7 + iVar1 * 4);

            iVar8 = iVar10;

            do {

              if (*piVar11 == iVar6) {

                *piVar11 = *(int *)(((iVar4 * iVar9 + iVar3) - iVar7) + (int)piVar11);

              }

              piVar11 = piVar11 + -1;

              iVar8 = iVar8 + -1;

            } while (iVar8 != 0);

          }

          iVar9 = iVar9 + -1;

        } while (-1 < iVar9);

      }

      FUN_004411d0();

      FUN_004411d0();

      return 1;

    }

    FUN_004411d0();

  }

  return 0;

}





// --- FUN_00441840 at 0x00441840 (size: 129) ---


bool __thiscall FUN_00441840(int param_1,int param_2,int param_3)



{

  int iVar1;

  char cVar2;

  uint uVar3;

  

  if ((((-1 < param_2) && (-1 < param_3)) &&

      (param_2 < *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc))) &&

     (param_3 < *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10))) {

    cVar2 = FUN_004410c0(1);

    if (cVar2 != '\0') {

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

      uVar3 = *(uint *)((uint)(*(byte *)(iVar1 + 0xe8) >> 3) * param_2 +

                        *(int *)(param_1 + 0x28) * param_3 + *(int *)(param_1 + 0x24));

      if ((*(byte *)(iVar1 + 0xe0) & 2) != 0) {

        uVar3 = uVar3 & ~*(uint *)(iVar1 + 0xf8);

      }

      FUN_004411d0();

      return uVar3 != 0;

    }

  }

  return false;

}





// --- FUN_004418d0 at 0x004418D0 (size: 117) ---


undefined4 __thiscall FUN_004418d0(int param_1,undefined4 param_2,int param_3,int param_4)



{

  undefined4 uVar1;

  char cVar2;

  

  if ((((-1 < param_3) && (-1 < param_4)) &&

      (param_3 < *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc))) &&

     (param_4 < *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10))) {

    cVar2 = FUN_004410c0(1);

    if (cVar2 != '\0') {

      uVar1 = *(undefined4 *)

               ((uint)(*(byte *)(*(int *)(param_1 + 4) + 0xe8) >> 3) * param_3 +

                *(int *)(param_1 + 0x28) * param_4 + *(int *)(param_1 + 0x24));

      FUN_004411d0();

      FUN_00430cd0(uVar1);

      return 1;

    }

  }

  return 0;

}





// --- FUN_00441950 at 0x00441950 (size: 507) ---


char __thiscall FUN_00441950(int param_1,int *param_2,int *param_3,undefined4 param_4,char param_5)



{

  char cVar1;

  int iVar2;

  uint uVar3;

  uint uVar4;

  int iVar5;

  uint uVar6;

  int iVar7;

  uint uVar8;

  int iVar9;

  int iVar10;

  int iVar11;

  char local_3d;

  

  local_3d = '\0';

  cVar1 = FUN_004410c0(1);

  if (cVar1 == '\0') {

    return '\0';

  }

  iVar2 = FUN_005df4c4();

  uVar3 = FUN_005df4c4();

  uVar4 = FUN_005df4c4();

  iVar5 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

  iVar9 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

  iVar10 = 0;

  param_4 = 0xffffffff;

  if (0 < iVar5) {

    do {

      if (local_3d != '\0') break;

      iVar11 = 0;

      if (0 < iVar9) {

        do {

          uVar6 = *(uint *)((uint)(*(byte *)(*(int *)(param_1 + 4) + 0xe8) >> 3) * iVar11 +

                            *(int *)(param_1 + 0x28) * iVar10 + *(int *)(param_1 + 0x24));

          uVar6 = (uVar6 << 8 | uVar6) << 8 | uVar6;

          if (uVar6 == ((iVar2 << 8 | uVar3) << 8 | uVar4)) {

            *param_2 = iVar11;

            *param_3 = iVar10;

            local_3d = '\x01';

            break;

          }

          if (param_5 != '\0') {

            FUN_00430cd0(uVar6);

            iVar7 = FUN_005df4c4();

            uVar6 = FUN_005df4c4();

            uVar8 = FUN_005df4c4();

            uVar8 = (iVar7 << 8 | uVar6) << 8 | uVar8;

            if (uVar8 < param_4) {

              *param_2 = iVar11;

              *param_3 = iVar10;

              param_4 = uVar8;

            }

          }

          iVar11 = iVar11 + 1;

        } while (iVar11 < iVar9);

      }

      iVar10 = iVar10 + 1;

    } while (iVar10 < iVar5);

  }

  FUN_004411d0();

  cVar1 = '\x01';

  if (param_5 == '\0') {

    cVar1 = local_3d;

  }

  return cVar1;

}





// --- FUN_00441b60 at 0x00441B60 (size: 361) ---


undefined4 FUN_00441b60(int *param_1,uint param_2,int *param_3,uint *param_4)



{

  int *piVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  

  piVar1 = param_1;

  if (*param_1 == *param_3) {

    *param_4 = param_2;

    return 1;

  }

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

    *param_4 = 0;

    if (((*(byte *)(param_1 + 1) & 1) != 0) && ((*(byte *)(param_3 + 1) & 1) != 0)) {

      uVar2 = (param_1[4] & param_2) >> (*(byte *)(param_1 + 9) & 0x1f);

      uVar3 = (param_1[5] & param_2) >> (*(byte *)((int)param_1 + 0x25) & 0x1f);

      uVar4 = (param_1[6] & param_2) >> (*(byte *)((int)param_1 + 0x26) & 0x1f);

      if (((char)param_1[8] != '\0') && ((char)param_1[8] != (char)param_3[8])) {

        uVar2 = (param_3[10] * uVar2) / (uint)param_1[10];

      }

      param_1 = (int *)uVar2;

      if ((*(char *)((int)piVar1 + 0x21) != '\0') &&

         (*(char *)((int)piVar1 + 0x21) != *(char *)((int)param_3 + 0x21))) {

        uVar3 = (param_3[0xb] * uVar3) / (uint)piVar1[0xb];

      }

      if ((*(char *)((int)piVar1 + 0x22) != '\0') &&

         (*(char *)((int)piVar1 + 0x22) != *(char *)((int)param_3 + 0x22))) {

        uVar4 = (param_3[0xc] * uVar4) / (uint)piVar1[0xc];

      }

      uVar2 = (int)param_1 << (*(byte *)(param_3 + 9) & 0x1f) & param_3[4];

      *param_4 = uVar2;

      uVar2 = uVar3 << (*(byte *)((int)param_3 + 0x25) & 0x1f) & param_3[5] | uVar2;

      *param_4 = uVar2;

      *param_4 = uVar4 << (*(byte *)((int)param_3 + 0x26) & 0x1f) & param_3[6] | uVar2;

    }

    if ((*(byte *)(param_3 + 1) & 2) != 0) {

      if ((*(byte *)(piVar1 + 1) & 2) != 0) {

        uVar2 = (piVar1[7] & param_2) >> (*(byte *)((int)piVar1 + 0x27) & 0x1f);

        if ((*(char *)((int)piVar1 + 0x23) != '\0') &&

           (*(char *)((int)piVar1 + 0x23) != *(char *)((int)param_3 + 0x23))) {

          uVar2 = (param_3[0xd] * uVar2) / (uint)piVar1[0xd];

        }

        *param_4 = *param_4 | uVar2 << (*(byte *)((int)param_3 + 0x27) & 0x1f) & param_3[7];

        return 1;

      }

      *param_4 = *param_4 | param_3[7];

    }

    return 1;

  }

  return 0;

}





// --- FUN_00441cd0 at 0x00441CD0 (size: 41) ---


void __fastcall FUN_00441cd0(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_00799d14;

  param_1[1] = 0;

  param_1[6] = 0;

  param_1[5] = 0;

  param_1[4] = 0;

  param_1[3] = 0;

  param_1[7] = 0;

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

  param_1[10] = 0;

  param_1[9] = 0;

  param_1[2] = 0;

  return;

}





// --- FUN_00441d00 at 0x00441D00 (size: 58) ---


undefined4 __thiscall FUN_00441d00(undefined4 *param_1,undefined4 param_2,undefined4 param_3)



{

  undefined4 extraout_ECX;

  

  param_1[1] = 0;

  param_1[6] = 0;

  param_1[5] = 0;

  param_1[4] = 0;

  param_1[3] = 0;

  param_1[7] = 0;

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

  param_1[10] = 0;

  param_1[9] = 0;

  param_1[2] = 0;

  *param_1 = &PTR_FUN_00799d14;

  FUN_00440f50(param_2,param_3);

  return extraout_ECX;

}





// --- FUN_00441d40 at 0x00441D40 (size: 98) ---


undefined4 __thiscall

FUN_00441d40(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,

            int param_5,int param_6)



{

  undefined4 extraout_ECX;

  undefined4 local_10;

  undefined4 local_c;

  int local_8;

  int local_4;

  

  param_1[1] = 0;

  param_1[6] = 0;

  param_1[5] = 0;

  param_1[4] = 0;

  param_1[3] = 0;

  param_1[7] = 0;

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

  param_1[10] = 0;

  param_1[9] = 0;

  param_1[2] = 0;

  local_10 = param_3;

  local_c = param_4;

  local_8 = param_5 + 1;

  local_4 = param_6 + 1;

  *param_1 = &PTR_FUN_00799d14;

  FUN_00440f50(param_2,&local_10);

  return extraout_ECX;

}





// --- FUN_00441db0 at 0x00441DB0 (size: 58) ---


undefined4 __thiscall FUN_00441db0(undefined4 *param_1,undefined4 param_2,undefined4 param_3)



{

  undefined4 extraout_ECX;

  

  param_1[1] = 0;

  param_1[6] = 0;

  param_1[5] = 0;

  param_1[4] = 0;

  param_1[3] = 0;

  param_1[7] = 0;

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

  param_1[10] = 0;

  param_1[9] = 0;

  param_1[2] = 0;

  *param_1 = &PTR_FUN_00799d14;

  FUN_00441020(param_2,param_3);

  return extraout_ECX;

}





// --- FUN_00441df0 at 0x00441DF0 (size: 2446) ---


uint __thiscall

FUN_00441df0(int param_1,int param_2,byte param_3,undefined4 param_4,int param_5,int param_6)



{

  bool bVar1;

  bool bVar2;

  bool bVar3;

  bool bVar4;

  bool bVar5;

  bool bVar6;

  bool bVar7;

  char cVar8;

  byte bVar9;

  uint uVar10;

  int iVar11;

  int iVar12;

  byte *pbVar13;

  undefined1 *puVar14;

  undefined4 uVar15;

  undefined3 uVar16;

  undefined3 extraout_var;

  uint *puVar17;

  uint uVar18;

  int iVar19;

  undefined1 *puVar20;

  uint uVar21;

  int iVar22;

  byte bVar23;

  undefined4 *puVar24;

  uint *puVar25;

  uint uVar26;

  int iVar27;

  undefined4 *puVar28;

  uint uVar29;

  bool bVar30;

  undefined4 local_80;

  char local_7c;

  byte local_7b;

  byte local_7a;

  char local_79;

  uint local_78;

  undefined4 *local_74;

  int local_70;

  int local_6c;

  undefined4 *local_68;

  uint *local_64;

  int local_60;

  int local_5c;

  int local_58;

  uint local_54;

  int local_50;

  int local_4c;

  int local_48;

  int local_44;

  int local_40;

  int local_3c;

  int local_38;

  int local_34;

  int local_30;

  undefined4 *local_2c;

  int local_28;

  uint local_24;

  uint local_20;

  int *local_1c;

  uint local_18;

  int local_14;

  uint local_10;

  int local_c;

  int *local_8;

  int local_4;

  

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

  local_4c = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

  local_70 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

  local_60 = *(int *)(param_2 + 0x14) - *(int *)(param_2 + 0xc);

  local_44 = *(int *)(param_2 + 0x18) - *(int *)(param_2 + 0x10);

  iVar27 = *(int *)(param_2 + 4);

  local_1c = (int *)(iVar27 + 0xdc);

  local_8 = (int *)(iVar22 + 0xdc);

  iVar11 = *local_1c;

  bVar30 = iVar11 == *(int *)(iVar22 + 0xdc);

  bVar3 = false;

  if ((((iVar11 == 0x16) && (*(int *)(iVar22 + 0xdc) == 0x15)) ||

      ((iVar11 == 0x15 && (*local_8 == 0x16)))) && (bVar30 = true, *local_8 == 0x15)) {

    bVar3 = true;

  }

  if (((*(byte *)(iVar27 + 0xe0) & 4) != 0) ||

     (local_7c = '\0', (*(byte *)(iVar22 + 0xe0) & 4) != 0)) {

    local_7c = '\x01';

  }

  if ((local_60 != local_4c) || (bVar4 = false, local_44 != local_70)) {

    bVar4 = true;

  }

  if (((param_3 & 4) == 0) || (bVar5 = true, bVar30)) {

    bVar5 = false;

  }

  if ((((param_3 & 0x10) == 0) || (iVar11 != 0x15)) || (!bVar30)) {

    bVar6 = false;

  }

  else {

    bVar6 = true;

  }

  if ((((param_3 & 0x50) != 0x50) || (!bVar6)) || (bVar7 = true, *local_8 != 0x15)) {

    bVar7 = false;

  }

  if ((((param_3 & 0x20) == 0) || (!bVar30)) || (param_5 == 0)) {

    bVar1 = false;

LAB_00441f5c:

    bVar2 = false;

  }

  else {

    bVar1 = true;

    if ((param_6 == 0) ||

       ((iVar11 = *(int *)(*(int *)(param_6 + 4) + 0xdc), iVar11 != 0x15 && (iVar11 != 0x1c))))

    goto LAB_00441f5c;

    bVar2 = true;

  }

  local_3c = param_1;

  uVar10 = FUN_004410c0(1);

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

LAB_00442050:

    return uVar10 & 0xffffff00;

  }

  cVar8 = FUN_004410c0(0);

  if (cVar8 == '\0') {

    uVar10 = FUN_004411d0();

    return uVar10 & 0xffffff00;

  }

  local_74 = *(undefined4 **)(param_1 + 0x24);

  bVar9 = *(byte *)(iVar27 + 0xe8) >> 3;

  local_68 = *(undefined4 **)(param_2 + 0x24);

  bVar23 = *(byte *)(iVar22 + 0xe8) >> 3;

  local_7b = bVar23;

  local_40 = FUN_005df4c4();

  local_48 = 0;

  if (bVar1) {

    local_78 = FUN_00424000();

    uVar21 = local_78 >> 8 & 0xff;

    uVar10 = local_78 >> 0x10 & 0xff;

    local_6c = uVar10 + (uVar10 != 0);

    local_58 = uVar21 + (uVar21 != 0);

    local_5c = (local_78 & 0xff) + (uint)((local_78 & 0xff) != 0);

  }

  if (bVar2) {

    cVar8 = FUN_004410c0(1);

    if (cVar8 == '\0') {

      FUN_004411d0();

      uVar10 = FUN_004411d0();

      goto LAB_00442050;

    }

    local_48 = *(int *)(param_6 + 0x24);

    local_7a = *(byte *)(*(int *)(param_6 + 4) + 0xe8) >> 3;

    local_79 = *(int *)(*(int *)(param_6 + 4) + 0xdc) == 0x1c;

  }

  if (local_7c == '\0') {

    if (((((bVar30) && (!bVar3)) && (!bVar4)) && ((!bVar5 && (!bVar6)))) && (!bVar1)) {

      iVar27 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

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

      if ((iVar27 == *(int *)(iVar22 + 0xa0)) &&

         (*(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10) == *(int *)(iVar22 + 0xa4))) {

        iVar11 = *(int *)(param_2 + 4);

        local_78 = *(uint *)(iVar22 + 0xa8);

        if (((local_78 == *(uint *)(iVar11 + 0xa8)) &&

            (((iVar22 = *(int *)(param_2 + 0x14) - *(int *)(param_2 + 0xc),

              iVar22 == *(int *)(iVar11 + 0xa0) &&

              (*(int *)(param_2 + 0x18) - *(int *)(param_2 + 0x10) == *(int *)(iVar11 + 0xa4))) &&

             (*(int *)(param_1 + 0x28) == (uint)bVar23 * iVar27)))) &&

           (*(int *)(param_2 + 0x28) == (uint)bVar9 * iVar22)) {

          puVar24 = local_68;

          puVar28 = local_74;

          for (uVar10 = local_78 >> 2; uVar10 != 0; uVar10 = uVar10 - 1) {

            *puVar28 = *puVar24;

            puVar24 = puVar24 + 1;

            puVar28 = puVar28 + 1;

          }

          for (uVar10 = local_78 & 3; uVar10 != 0; uVar10 = uVar10 - 1) {

            *(undefined1 *)puVar28 = *(undefined1 *)puVar24;

            puVar24 = (undefined4 *)((int)puVar24 + 1);

            puVar28 = (undefined4 *)((int)puVar28 + 1);

          }

          goto LAB_00442746;

        }

      }

    }

    if ((bVar9 < 3) || (bVar23 < 3)) {

      local_78 = local_70 - 1;

      if (-1 < (int)local_78) {

        iVar22 = local_4c + -1;

        do {

          if (-1 < iVar22) {

            local_54 = (uint)bVar9;

            puVar20 = (undefined1 *)

                      ((int)local_74 +

                      iVar22 * (uint)local_7b + *(int *)(local_3c + 0x28) * local_78);

            puVar14 = (undefined1 *)

                      ((int)local_68 + iVar22 * local_54 + *(int *)(param_2 + 0x28) * local_78);

            iVar27 = local_4c;

            do {

              *puVar20 = *puVar14;

              puVar14 = puVar14 + -local_54;

              puVar20 = puVar20 + -(uint)local_7b;

              iVar27 = iVar27 + -1;

            } while (iVar27 != 0);

          }

          local_78 = local_78 - 1;

        } while (-1 < (int)local_78);

      }

    }

    else {

      local_50 = local_70 + -1;

      if (-1 < local_50) {

        local_78 = local_50 * local_44;

        local_4 = -local_44;

        do {

          local_34 = (int)local_78 / local_70;

          puVar24 = (undefined4 *)(*(int *)(param_2 + 0x28) * local_34 + (int)local_68);

          iVar22 = local_4c + -1;

          local_38 = iVar22;

          local_2c = puVar24;

          if (-1 < iVar22) {

            local_10 = (uint)local_7b;

            local_54 = (uint)bVar9;

            local_c = -local_10;

            local_14 = -local_60;

            local_28 = iVar22 * local_60;

            puVar25 = (uint *)((int)local_74 +

                              iVar22 * local_10 + *(int *)(local_3c + 0x28) * local_50);

            do {

              local_30 = iVar22;

              if (bVar4) {

                local_30 = local_28 / local_4c;

              }

              puVar17 = (uint *)(local_30 * local_54 + (int)puVar24);

              if (((-1 < local_30) && (local_30 < local_60)) ||

                 ((-1 < local_34 && (local_34 < local_44)))) {

                if (bVar5) {

                  local_64 = puVar25;

                  local_38 = iVar22;

                  FUN_00441b60(local_1c,*puVar17,local_8,&local_80);

                  if (local_10 == 2) {

                    *(undefined2 *)puVar25 = (undefined2)local_80;

                  }

                  else if (local_10 == 3) {

                    *(undefined2 *)puVar25 = (undefined2)local_80;

                    *(byte *)((int)puVar25 + 2) = local_80._2_1_;

                  }

                  else if (local_10 == 4) {

                    *puVar25 = local_80;

                  }

                }

                else if (bVar6) {

                  local_80 = *puVar17;

                  if ((local_80 >> 0x18 != 0) && (local_40 != 0)) {

                    local_18 = *puVar25;

                    uVar10 = (local_80 >> 0x18) + 1;

                    if ((bVar1) || (uVar10 != 0x100)) {

                      if (local_40 != 0x100) goto LAB_0044237a;

LAB_00442380:

                      uVar26 = local_18 >> 0x10 & 0xff;

                      local_24 = local_80 >> 8 & 0xff;

                      local_20 = local_80 & 0xff;

                      uVar29 = local_18 >> 8 & 0xff;

                      uVar21 = local_18 & 0xff;

                      uVar18 = local_18 >> 0x18;

                      local_80._2_1_ = (byte)(local_80 >> 0x10);

                      if (bVar7) {

                        iVar19 = uVar18 + (uVar18 != 0);

                        iVar27 = iVar19 * uVar10;

                        iVar19 = iVar19 + (uVar10 - ((int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8))

                        ;

                        iVar11 = (int)((uVar26 - local_80._2_1_) * uVar10) / iVar19;

                        iVar12 = (int)((uVar29 - local_24) * uVar10) / iVar19;

                        iVar27 = (int)((uVar21 - local_20) * uVar10) / iVar19;

                        uVar18 = iVar19 - (uint)(iVar19 != 0);

                      }

                      else {

                        iVar27 = (uVar26 - local_80._2_1_) * uVar10;

                        iVar11 = (int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8;

                        iVar27 = (uVar29 - local_24) * uVar10;

                        iVar12 = (int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8;

                        iVar27 = (uVar21 - local_20) * uVar10;

                        iVar27 = (int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8;

                      }

                      uVar29 = uVar29 - iVar12;

                      uVar26 = uVar26 - iVar11;

                      local_80 = uVar21 - iVar27;

                      if (bVar2) {

                        pbVar13 = (byte *)(*(int *)(param_6 + 0x28) * local_34 +

                                          local_48 + (uint)local_7a * local_30);

                        if (local_79 == '\0') {

                          bVar23 = pbVar13[3];

                        }

                        else {

                          bVar23 = *pbVar13;

                        }

                        iVar11 = (uint)bVar23 + (uint)(bVar23 != 0);

                        iVar27 = (uVar26 - (uVar26 * local_6c >> 8)) * iVar11;

                        uVar26 = uVar26 - ((int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8);

                        iVar27 = (uVar29 - (uVar29 * local_58 >> 8)) * iVar11;

                        uVar29 = uVar29 - ((int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8);

                        iVar11 = (local_80 - (local_80 * local_5c >> 8)) * iVar11;

                        local_80 = local_80 - ((int)(iVar11 + (iVar11 >> 0x1f & 0xffU)) >> 8);

                      }

                      else if (bVar1) {

                        uVar26 = uVar26 * local_6c >> 8;

                        uVar29 = uVar29 * local_58 >> 8;

                        local_80 = local_80 * local_5c >> 8;

                      }

                      local_80 = ((uVar18 << 8 | uVar26) << 8 | uVar29) << 8 | local_80;

                      puVar24 = local_2c;

                    }

                    else {

                      if (local_40 != 0x100) {

LAB_0044237a:

                        uVar10 = uVar10 * local_40 >> 8;

                        goto LAB_00442380;

                      }

                      if (!bVar7) {

                        local_80 = (local_18 ^ local_80) & 0xffffff ^ local_18;

                        *puVar25 = local_80;

                        goto LAB_00442676;

                      }

                    }

                    *puVar25 = local_80;

                  }

                }

                else if (bVar1) {

                  uVar10 = *puVar17;

                  uVar21 = uVar10 >> 0x10 & 0xff;

                  uVar18 = uVar10 >> 8 & 0xff;

                  local_80 = uVar10 & 0xff;

                  if (bVar2) {

                    pbVar13 = (byte *)(*(int *)(param_6 + 0x28) * local_34 +

                                      local_48 + (uint)local_7a * local_30);

                    if (local_79 == '\0') {

                      bVar23 = pbVar13[3];

                    }

                    else {

                      bVar23 = *pbVar13;

                    }

                    iVar11 = (uint)bVar23 + (uint)(bVar23 != 0);

                    iVar27 = (uVar21 - (uVar21 * local_6c >> 8)) * iVar11;

                    uVar21 = uVar21 - ((int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8);

                    iVar27 = (uVar18 - (uVar18 * local_58 >> 8)) * iVar11;

                    uVar18 = uVar18 - ((int)(iVar27 + (iVar27 >> 0x1f & 0xffU)) >> 8);

                    iVar11 = (local_80 - (local_80 * local_5c >> 8)) * iVar11;

                    local_80 = local_80 - ((int)(iVar11 + (iVar11 >> 0x1f & 0xffU)) >> 8);

                  }

                  else {

                    uVar21 = uVar21 * local_6c >> 8;

                    uVar18 = uVar18 * local_58 >> 8;

                    local_80 = local_80 * local_5c >> 8;

                  }

                  local_80 = (((uVar10 >> 0x18) << 8 | uVar21) << 8 | uVar18) << 8 | local_80;

                  *puVar25 = local_80;

                  puVar24 = local_2c;

                }

                else if (bVar3) {

                  *puVar25 = *puVar17 | 0xff000000;

                }

                else {

                  *puVar25 = *puVar17;

                }

              }

LAB_00442676:

              iVar22 = iVar22 + -1;

              local_28 = local_28 + local_14;

              puVar25 = (uint *)((int)puVar25 + local_c);

              local_64 = puVar25;

              local_38 = iVar22;

            } while (-1 < iVar22);

          }

          local_50 = local_50 + -1;

          local_78 = local_78 + local_4;

        } while (-1 < local_50);

      }

    }

  }

  else {

    uVar10 = *(uint *)(*(int *)(param_1 + 4) + 0xa8);

    puVar24 = local_68;

    puVar28 = local_74;

    for (uVar21 = uVar10 >> 2; uVar21 != 0; uVar21 = uVar21 - 1) {

      *puVar28 = *puVar24;

      puVar24 = puVar24 + 1;

      puVar28 = puVar28 + 1;

    }

    for (uVar10 = uVar10 & 3; uVar10 != 0; uVar10 = uVar10 - 1) {

      *(undefined1 *)puVar28 = *(undefined1 *)puVar24;

      puVar24 = (undefined4 *)((int)puVar24 + 1);

      puVar28 = (undefined4 *)((int)puVar28 + 1);

    }

  }

LAB_00442746:

  FUN_004411d0();

  uVar15 = FUN_004411d0();

  uVar16 = (undefined3)((uint)uVar15 >> 8);

  if (bVar2) {

    FUN_004411d0();

    uVar16 = extraout_var;

  }

  return CONCAT31(uVar16,1);

}





// --- FUN_00442780 at 0x00442780 (size: 298) ---


undefined4 __thiscall FUN_00442780(int param_1,int param_2,uint param_3,int param_4,int param_5)



{

  int iVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  char cVar5;

  int *piVar6;

  uint *puVar7;

  int iVar8;

  int iVar9;

  uint uVar10;

  int local_8;

  int local_4;

  

  local_8 = 0;

  piVar6 = &local_8;

  if (-1 < param_2) {

    piVar6 = &param_2;

  }

  param_2 = *piVar6;

  piVar6 = (int *)(param_1 + 0x14);

  if (param_4 <= *(int *)(param_1 + 0x14)) {

    piVar6 = &param_4;

  }

  local_8 = *piVar6;

  param_4 = 0;

  piVar6 = &param_4;

  if (-1 < (int)param_3) {

    piVar6 = (int *)&param_3;

  }

  iVar8 = *piVar6;

  piVar6 = (int *)(param_1 + 0x18);

  if (param_5 <= *(int *)(param_1 + 0x18)) {

    piVar6 = &param_5;

  }

  iVar9 = *piVar6;

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

  uVar2 = *(uint *)(iVar1 + 0xf0);

  uVar3 = *(uint *)(iVar1 + 0xf4);

  uVar4 = *(uint *)(iVar1 + 0xec);

  param_3 = *(uint *)(iVar1 + 0xf8);

  if (((*(byte *)(iVar1 + 0xe0) & 4) == 0) &&

     (local_4 = iVar9, cVar5 = FUN_004410c0(0), cVar5 != '\0')) {

    param_4 = iVar8;

    if (iVar8 < iVar9) {

      uVar10 = (uint)(*(byte *)(*(int *)(param_1 + 4) + 0xe8) >> 3);

      param_5 = uVar10 * param_2;

      do {

        puVar7 = (uint *)(*(int *)(param_1 + 0x28) * iVar8 + *(int *)(param_1 + 0x24) + param_5);

        if (param_2 < local_8) {

          iVar9 = local_8 - param_2;

          do {

            *puVar7 = ~*puVar7 & (uVar3 | uVar2 | uVar4) | *puVar7 & param_3;

            puVar7 = (uint *)((int)puVar7 + uVar10);

            iVar9 = iVar9 + -1;

          } while (iVar9 != 0);

        }

        iVar8 = iVar8 + 1;

        param_4 = iVar8;

      } while (iVar8 < local_4);

    }

    FUN_004411d0();

    return 1;

  }

  return 0;

}





// --- FUN_004428b0 at 0x004428B0 (size: 804) ---


/* WARNING: Removing unreachable block (ram,0x00442ade) */

/* WARNING: Removing unreachable block (ram,0x00442bb8) */

/* WARNING: Removing unreachable block (ram,0x00442a72) */



undefined1 __thiscall

FUN_004428b0(int param_1,int param_2,int param_3,undefined4 param_4,uint param_5,int param_6,

            undefined4 param_7)



{

  int iVar1;

  int iVar2;

  char cVar3;

  undefined1 uVar4;

  uint uVar5;

  uint uVar6;

  uint uVar7;

  uint local_54;

  char local_50;

  int local_44;

  undefined4 local_40;

  int local_3c;

  undefined4 local_38;

  undefined4 local_34;

  uint local_30;

  uint local_2c;

  int local_28;

  int local_24;

  undefined4 local_20;

  undefined4 local_1c;

  int local_18;

  undefined4 local_14;

  undefined4 local_10;

  uint local_c;

  uint local_8;

  undefined1 local_4;

  

  iVar2 = param_2;

  local_54 = param_5;

  local_50 = '\0';

  if ((param_1 == 0) || (cVar3 = FUN_004410c0(0), cVar3 == '\0')) {

    return 0;

  }

  if (*(int *)(param_1 + 4) == 0) {

LAB_00442914:

    local_18 = -1;

  }

  else {

    iVar1 = *(int *)(*(int *)(param_1 + 4) + 0xdc);

    if (iVar1 == 0x14) {

      local_18 = 2;

    }

    else if (iVar1 == 0x15) {

      local_18 = 0;

    }

    else {

      if (iVar1 != 0x16) goto LAB_00442914;

      local_18 = 1;

    }

  }

  local_10 = *(undefined4 *)(param_1 + 0x28);

  local_14 = *(undefined4 *)(param_1 + 0x24);

  local_28 = 7;

  uVar6 = local_8;

  uVar7 = local_c;

  if (((param_2 != 0) && (param_3 != 7)) &&

     (cVar3 = FUN_00441240(1), uVar6 = local_8, uVar7 = local_c, cVar3 != '\0')) {

    local_28 = param_3;

    if (*(int *)(param_2 + 4) == 0) {

LAB_00442995:

      param_2 = -1;

    }

    else {

      iVar1 = *(int *)(*(int *)(param_2 + 4) + 0xdc);

      if (iVar1 == 0x14) {

        param_2 = 2;

      }

      else if (iVar1 == 0x15) {

        param_2 = 0;

      }

      else {

        if (iVar1 != 0x16) goto LAB_00442995;

        param_2 = 1;

      }

    }

    local_1c = *(undefined4 *)(iVar2 + 0x28);

    local_20 = *(undefined4 *)(iVar2 + 0x24);

    local_24 = param_2;

    uVar7 = *(int *)(iVar2 + 0x14) - *(int *)(iVar2 + 0xc);

    uVar6 = *(int *)(iVar2 + 0x18) - *(int *)(iVar2 + 0x10);

    local_c = uVar7;

    local_8 = uVar6;

    local_4 = FUN_005df4c4();

    uVar5 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

    if (uVar5 < uVar7) {

      uVar7 = uVar5;

      local_c = uVar5;

    }

    uVar5 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

    if (uVar5 < uVar6) {

      uVar6 = uVar5;

      local_8 = uVar5;

    }

    if ((local_18 == -1) || (param_2 == -1)) {

      uVar6 = 4;

      if (param_3 == 1) {

        uVar6 = 0x14;

      }

      else if (param_3 == 2) {

        uVar6 = 0x54;

      }

      if (param_6 != 7) {

        uVar6 = uVar6 | 0x20;

      }

      FUN_00430cd0(param_7);

      uVar4 = FUN_00441df0(iVar2,uVar6,param_4,&local_54,param_5);

      FUN_004411d0();

      return uVar4;

    }

  }

  local_44 = param_6;

  if (param_6 == 7) goto LAB_00442b8d;

  if (param_5 == 0) {

    local_3c = 0;

  }

  else {

    cVar3 = FUN_00441240(1);

    if (cVar3 == '\0') goto LAB_00442ac5;

    if (*(int *)(param_5 + 4) == 0) {

LAB_00442b1f:

      local_3c = -1;

    }

    else {

      iVar2 = *(int *)(*(int *)(param_5 + 4) + 0xdc);

      if (iVar2 == 0x15) {

        local_3c = 2;

      }

      else {

        if (iVar2 != 0x1c) goto LAB_00442b1f;

        local_3c = 1;

      }

    }

    local_38 = *(undefined4 *)(param_5 + 0x24);

    local_34 = *(undefined4 *)(param_5 + 0x28);

    uVar7 = *(int *)(param_5 + 0x14) - *(int *)(param_5 + 0xc);

    uVar6 = *(int *)(param_5 + 0x18) - *(int *)(param_5 + 0x10);

    if (local_3c == -1) {

      local_3c = -1;

      local_30 = uVar7;

      local_2c = uVar6;

LAB_00442ac5:

      if (local_50 != '\0') {

        FUN_004411d0();

      }

      FUN_004411d0();

      return 0;

    }

  }

  local_40 = param_7;

  uVar5 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

  local_30 = uVar7;

  if (uVar5 < uVar7) {

    local_30 = uVar5;

  }

  uVar7 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

  local_2c = uVar6;

  if (uVar7 < uVar6) {

    local_2c = uVar7;

  }

LAB_00442b8d:

  FUN_006612a0(&local_28,&local_44);

  if (local_50 != '\0') {

    FUN_004411d0();

  }

  FUN_004411d0();

  return 1;

}





// --- FUN_00442be0 at 0x00442BE0 (size: 137) ---


undefined4 __thiscall FUN_00442be0(int *param_1,uint param_2)



{

  int iVar1;

  int iVar2;

  

  if (param_2 < (uint)param_1[2]) {

    return 0;

  }

  if ((param_1[1] & 0x7fffffffU) < param_2) {

    if (param_2 == 0) {

      FUN_0059d3e0();

      return 1;

    }

    iVar2 = thunk_FUN_005df0f5(param_2);

    if (iVar2 == 0) {

      return 0;

    }

    if (*param_1 != 0) {

      iVar1 = param_1[2];

      while (iVar1 = iVar1 + -1, -1 < iVar1) {

        *(undefined1 *)(iVar1 + iVar2) = *(undefined1 *)(iVar1 + *param_1);

      }

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

        operator_delete__((void *)*param_1);

      }

    }

    *param_1 = iVar2;

    param_1[1] = param_2 | 0x80000000;

  }

  return 1;

}





// --- FUN_00442c70 at 0x00442C70 (size: 32) ---


void FUN_00442c70(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  FUN_004428b0(param_1,param_2,param_3,0,7,0xff000000);

  return;

}





// --- FUN_00442c90 at 0x00442C90 (size: 114) ---


void FUN_00442c90(undefined4 param_1,undefined4 param_2)



{

  int iVar1;

  uint uVar2;

  uint uVar3;

  uint uVar4;

  

  iVar1 = FUN_005df4c4();

  uVar2 = FUN_005df4c4();

  uVar3 = FUN_005df4c4();

  uVar4 = FUN_005df4c4();

  FUN_004428b0(0,7,0x3f800000,param_1,param_2,((iVar1 << 8 | uVar2) << 8 | uVar3) << 8 | uVar4);

  return;

}





// --- FUN_00442d10 at 0x00442D10 (size: 32) ---


void FUN_00442d10(undefined4 param_1,undefined4 param_2,undefined4 param_3)



{

  FUN_004428b0(0,7,0x3f800000,param_1,param_2,param_3);

  return;

}





// --- FUN_00442d30 at 0x00442D30 (size: 769) ---


uint __thiscall

FUN_00442d30(int param_1,int param_2,undefined4 param_3,int param_4,undefined4 param_5,

            undefined4 param_6,uint param_7,undefined4 param_8)



{

  undefined1 uVar1;

  undefined2 uVar2;

  undefined2 uVar3;

  int iVar4;

  char cVar5;

  int iVar6;

  uint uVar7;

  int iVar8;

  int iVar9;

  uint local_b0;

  int local_98;

  int local_94;

  int local_90;

  int local_8c;

  undefined1 local_88 [4];

  int local_84;

  undefined1 local_30 [16];

  undefined1 local_20 [16];

  undefined1 local_10 [16];

  

  if (((param_4 == 0) || (*(int *)(param_1 + 0x1c) == 0)) ||

     (iVar4 = FUN_004434c0(param_5), iVar4 == 0)) {

    return 0;

  }

  uVar1 = *(undefined1 *)(iVar4 + 7);

  uVar7 = (uint)*(byte *)(iVar4 + 6);

  iVar6 = 0;

  if ((param_7 & 1) == 0) {

    local_b0 = uVar7;

    if ((param_7 & 0x1000) != 0) {

      iVar6 = (int)*(char *)(iVar4 + 8);

      local_b0 = *(char *)(iVar4 + 9) + iVar6 + uVar7;

    }

  }

  else {

    local_b0 = *(int *)(param_4 + 0x34) + 1;

  }

  iVar8 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

  cVar5 = (char)(param_7 >> 8);

  iVar9 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

  uVar2 = *(undefined2 *)(iVar4 + 4);

  uVar3 = *(undefined2 *)(iVar4 + 2);

  FUN_00441620(uVar3,uVar2,uVar7,uVar1,iVar6 + param_2,iVar8,iVar9,0,local_10,&local_98);

  if ((local_98 < local_90) && (local_94 < local_8c)) {

    if ((*(int *)(param_4 + 0x60) != 0) && ((param_7 & 0x4000) != 0)) {

      FUN_00441620(uVar3,uVar2,uVar7,uVar1,iVar6 + param_2,iVar8,iVar9,

                   *(undefined4 *)(param_4 + 0x44),local_20,local_30);

      FUN_00441db0(*(int *)(param_4 + 0x60) + 0xac,local_20);

      FUN_00441db0(param_1,local_30);

      if ((param_7 & 0x100) == 0) {

        if ((*(int *)(local_84 + 0xdc) == 0x1c) || (cVar5 < '\0')) {

          FUN_00442d10(local_88,2,param_8);

        }

        else {

          FUN_004428b0(local_88,2,0x3f800000,0,7,0xff000000);

        }

      }

      else {

        FUN_00441280(local_88);

      }

    }

    if (((param_7 & 0x2000) == 0) && (*(int *)(param_4 + 0x54) != 0)) {

      FUN_00441db0(*(int *)(param_4 + 0x54) + 0xac,local_10);

      FUN_00441db0(param_1,&local_98);

      if ((param_7 & 0x100) != 0) {

        FUN_00441280(local_88);

        return local_b0;

      }

      if ((*(int *)(local_84 + 0xdc) != 0x1c) && (-1 < cVar5)) {

        FUN_004428b0(local_88,2,0x3f800000,0,7,0xff000000);

        return local_b0;

      }

      FUN_00442d10(local_88,2,param_6);

    }

  }

  return local_b0;

}





// --- FUN_00443040 at 0x00443040 (size: 362) ---


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



undefined4 __fastcall FUN_00443040(int param_1)



{

  int iVar1;

  char extraout_AL;

  char cVar2;

  uint uVar3;

  undefined4 uVar4;

  undefined4 *puVar5;

  undefined4 *puVar6;

  uint uVar7;

  uint uVar8;

  uint uVar9;

  undefined4 *puVar10;

  int iStack00000004;

  

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

  if ((((*(byte *)(iVar1 + 0xe0) & 4) != 0) || (*(char *)(iVar1 + 0xe8) != ' ')) ||

     (FUN_004410c0(0), extraout_AL == '\0')) {

    return 0;

  }

  iStack00000004 = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

  uVar9 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

  uVar7 = *(byte *)(iVar1 + 0xe8) * uVar9;

  uVar3 = (uint)(*(byte *)(iVar1 + 0xe8) >> 3);

  uVar8 = uVar7 >> 3;

  uVar4 = FUN_00424000();

  if (uVar9 < 0x101) {

    puVar5 = *(undefined4 **)(param_1 + 0x24);

    if (-1 < iStack00000004 + -1) {

      do {

        puVar6 = puVar5;

        uVar7 = uVar9;

        if (-1 < (int)(uVar9 - 1)) {

          do {

            *puVar6 = uVar4;

            uVar7 = uVar7 - 1;

            puVar6 = (undefined4 *)((int)puVar6 + uVar3);

          } while (uVar7 != 0);

        }

        puVar5 = (undefined4 *)((int)puVar5 + *(int *)(param_1 + 0x28));

        iStack00000004 = iStack00000004 + -1;

      } while (iStack00000004 != 0);

    }

  }

  else {

    if ((DAT_00838e14 & 1) == 0) {

      DAT_00838e14 = DAT_00838e14 | 1;

      DAT_00838e08 = (undefined4 *)0x0;

      DAT_00838e0c = 0;

      _DAT_00838e10 = 0;

      _atexit((_func_4879 *)&LAB_0072b6d0);

    }

    if ((uVar8 <= (DAT_00838e0c & 0x7fffffff)) || (cVar2 = FUN_00442be0(uVar8), cVar2 != '\0')) {

      _DAT_00838e10 = uVar8;

    }

    puVar5 = DAT_00838e08;

    if (-1 < (int)(uVar9 - 1)) {

      do {

        *puVar5 = uVar4;

        uVar9 = uVar9 - 1;

        puVar5 = (undefined4 *)((int)puVar5 + uVar3);

      } while (uVar9 != 0);

    }

    puVar5 = *(undefined4 **)(param_1 + 0x24);

    if (-1 < iStack00000004 + -1) {

      do {

        puVar6 = DAT_00838e08;

        puVar10 = puVar5;

        for (uVar3 = uVar7 >> 5; uVar3 != 0; uVar3 = uVar3 - 1) {

          *puVar10 = *puVar6;

          puVar6 = puVar6 + 1;

          puVar10 = puVar10 + 1;

        }

        for (uVar3 = uVar8 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {

          *(undefined1 *)puVar10 = *(undefined1 *)puVar6;

          puVar6 = (undefined4 *)((int)puVar6 + 1);

          puVar10 = (undefined4 *)((int)puVar10 + 1);

        }

        puVar5 = (undefined4 *)((int)puVar5 + *(int *)(param_1 + 0x28));

        iStack00000004 = iStack00000004 + -1;

      } while (iStack00000004 != 0);

      FUN_004411d0();

      return 1;

    }

  }

  FUN_004411d0();

  return 1;

}





// --- FUN_004431b0 at 0x004431B0 (size: 146) ---


void __thiscall FUN_004431b0(int param_1,undefined4 param_2,int *param_3)



{

  int local_3c;

  int local_38;

  int local_34;

  int local_30;

  undefined **local_2c;

  undefined4 local_28;

  int local_24;

  undefined4 local_20;

  undefined4 local_1c;

  undefined4 local_18;

  undefined4 local_14;

  undefined4 local_10;

  undefined1 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  local_28 = 0;

  local_14 = 0;

  local_18 = 0;

  local_1c = 0;

  local_20 = 0;

  local_10 = 0;

  local_c = 0;

  local_4 = 0;

  local_8 = 0;

  local_24 = 0;

  local_3c = *param_3 + *(int *)(param_1 + 0xc);

  local_38 = param_3[1] + *(int *)(param_1 + 0x10);

  local_34 = param_3[2] + *(int *)(param_1 + 0xc);

  local_30 = param_3[3] + *(int *)(param_1 + 0x10);

  local_2c = &PTR_FUN_00799d14;

  FUN_00440f50(*(undefined4 *)(param_1 + 4),&local_3c);

  local_24 = param_1;

  FUN_00443040(param_2);

  return;

}





// --- FUN_00443250 at 0x00443250 (size: 58) ---


void FUN_00443250(undefined4 param_1,undefined4 param_2,undefined4 param_3,int param_4,int param_5)



{

  undefined4 local_10;

  undefined4 local_c;

  int local_8;

  int local_4;

  

  local_10 = param_2;

  local_c = param_3;

  local_8 = param_4 + 1;

  local_4 = param_5 + 1;

  FUN_004431b0(param_1,&local_10);

  return;

}





// --- FUN_00443290 at 0x00443290 (size: 437) ---


uint __thiscall FUN_00443290(int param_1,uint param_2)



{

  int iVar1;

  int iVar2;

  bool bVar3;

  uint uVar4;

  char cVar5;

  undefined1 uVar6;

  uint *puVar7;

  uint uVar8;

  uint uVar9;

  uint *puVar10;

  undefined4 *puVar11;

  undefined4 *puVar12;

  uint local_c;

  uint local_8;

  uint local_4;

  

  if (param_1 == 0) {

    return 0;

  }

  cVar5 = FUN_004410c0(0);

  uVar4 = param_2;

  if (cVar5 == '\0') {

    return 0;

  }

  if ((param_2 == 0) || (cVar5 = FUN_004410c0(1), cVar5 == '\0')) {

    FUN_004411d0();

    return 0;

  }

  iVar1 = *(int *)(uVar4 + 4);

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

  if ((((*(byte *)(iVar1 + 0xe0) & 4) == 0) || (*(int *)(iVar2 + 0xa8) != *(int *)(iVar1 + 0xa8)))

     && (*(int *)(param_1 + 0x28) != *(int *)(uVar4 + 0x28))) {

    bVar3 = false;

  }

  else {

    bVar3 = true;

  }

  if (((((*(int *)(iVar1 + 0xdc) == *(int *)(iVar2 + 0xdc)) && (bVar3)) &&

       ((*(int *)(param_1 + 0xc) == 0 &&

        ((*(int *)(param_1 + 0x10) == 0 && (*(int *)(uVar4 + 0x14) == *(int *)(param_1 + 0x14)))))))

      && (*(int *)(uVar4 + 0x18) == *(int *)(param_1 + 0x18))) &&

     ((*(int *)(param_1 + 0x14) == *(int *)(iVar2 + 0xa0) &&

      (*(int *)(param_1 + 0x18) == *(int *)(iVar2 + 0xa4))))) {

    uVar9 = *(uint *)(iVar2 + 0xa8);

    puVar11 = *(undefined4 **)(uVar4 + 0x24);

    puVar12 = *(undefined4 **)(param_1 + 0x24);

    for (uVar8 = uVar9 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {

      *puVar12 = *puVar11;

      puVar11 = puVar11 + 1;

      puVar12 = puVar12 + 1;

    }

    for (uVar9 = uVar9 & 3; uVar9 != 0; uVar9 = uVar9 - 1) {

      *(undefined1 *)puVar12 = *(undefined1 *)puVar11;

      puVar11 = (undefined4 *)((int)puVar11 + 1);

      puVar12 = (undefined4 *)((int)puVar12 + 1);

    }

    FUN_004411d0();

    FUN_004411d0();

    return 1;

  }

  if (*(int *)(iVar1 + 0xdc) == 0x1c) {

    if (*(int *)(iVar2 + 0xdc) != 0x1c) {

      param_2 = *(int *)(uVar4 + 0x18) - *(int *)(uVar4 + 0x10);

      local_c = *(int *)(param_1 + 0x18) - *(int *)(param_1 + 0x10);

      local_8 = *(int *)(uVar4 + 0x14) - *(int *)(uVar4 + 0xc);

      local_4 = *(int *)(param_1 + 0x14) - *(int *)(param_1 + 0xc);

      puVar10 = &param_2;

      if (local_c <= param_2) {

        puVar10 = &local_c;

      }

      puVar7 = &local_8;

      if (local_4 <= local_8) {

        puVar7 = &local_4;

      }

      FUN_00443250(&DAT_00818e00,0,0,*puVar7 - 1,*puVar10 - 1);

    }

  }

  else if (*(int *)(iVar2 + 0xdc) != 0x1c) {

    uVar6 = FUN_004428b0(uVar4,0,0x3f800000,0,7,0xff000000);

    goto LAB_004433a1;

  }

  uVar6 = FUN_00441280(uVar4);

LAB_004433a1:

  param_2 = CONCAT31(param_2._1_3_,uVar6);

  FUN_004411d0();

  FUN_004411d0();

  return param_2 & 0xff;

}





// --- FUN_00443450 at 0x00443450 (size: 56) ---


void __fastcall FUN_00443450(int *param_1)



{

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

  if ((void *)param_1[0x1b] != (void *)0x0) {

    operator_delete__((void *)param_1[0x1b]);

    param_1[0x1b] = 0;

  }

  if ((void *)param_1[0xf] != (void *)0x0) {

    operator_delete__((void *)param_1[0xf]);

    param_1[0xf] = 0;

  }

  return;

}





// --- FUN_00443490 at 0x00443490 (size: 45) ---


undefined4 __fastcall FUN_00443490(int param_1)



{

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

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

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

  }

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

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

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

  }

  return 1;

}





// --- FUN_004434c0 at 0x004434C0 (size: 131) ---


int __thiscall FUN_004434c0(int param_1,ushort param_2)



{

  ushort uVar1;

  ushort *puVar2;

  uint uVar3;

  ushort *puVar4;

  

  puVar2 = *(ushort **)(param_1 + 0x3c);

  if (puVar2 == (ushort *)0x0) {

    return 0;

  }

  do {

    if (*(int *)(param_1 + 0x6c) == 0) {

      uVar3 = 0;

      puVar4 = puVar2;

      if (*(uint *)(param_1 + 0x38) != 0) {

        do {

          if (*puVar4 == param_2) goto LAB_00443505;

          uVar3 = uVar3 + 1;

          puVar4 = (ushort *)((int)puVar4 + 0xb);

        } while (uVar3 < *(uint *)(param_1 + 0x38));

      }

    }

    else if ((*(ushort *)(param_1 + 100) <= param_2) && (param_2 <= *(ushort *)(param_1 + 0x66))) {

      uVar1 = *(ushort *)

               (*(int *)(param_1 + 0x6c) + ((uint)param_2 - (uint)*(ushort *)(param_1 + 100)) * 2);

      if (*(uint *)(param_1 + 0x38) <= (uint)uVar1) {

        return 0;

      }

      if ((uint)uVar1 * 0xb + (int)puVar2 != 0) {

        uVar3 = (uint)uVar1;

LAB_00443505:

        return uVar3 * 0xb + (int)puVar2;

      }

    }

    if (param_2 == 0x3f) {

      return 0;

    }

    param_2 = 0x3f;

  } while( true );

}





// --- FUN_00443550 at 0x00443550 (size: 42) ---


int FUN_00443550(undefined4 param_1)



{

  int iVar1;

  

  iVar1 = FUN_004434c0(param_1);

  if (iVar1 != 0) {

    return (uint)*(byte *)(iVar1 + 9) + (uint)*(byte *)(iVar1 + 8) + (uint)*(byte *)(iVar1 + 6);

  }

  return 0;

}





// --- FUN_00443580 at 0x00443580 (size: 71) ---


undefined1 __thiscall FUN_00443580(int param_1,ushort param_2)



{

  uint uVar1;

  

  if (*(int *)(param_1 + 0x3c) != 0) {

    if (*(int *)(param_1 + 0x6c) == 0) {

      return 1;

    }

    if ((((*(ushort *)(param_1 + 100) <= param_2) && (param_2 <= *(ushort *)(param_1 + 0x66))) &&

        (uVar1 = (uint)*(ushort *)

                        (*(int *)(param_1 + 0x6c) +

                        ((uint)param_2 - (uint)*(ushort *)(param_1 + 100)) * 2),

        uVar1 < *(uint *)(param_1 + 0x38))) && (uVar1 * 0xb + *(int *)(param_1 + 0x3c) != 0)) {

      return 1;

    }

  }

  return 0;

}





// --- FUN_004435d0 at 0x004435D0 (size: 196) ---


uint __fastcall FUN_004435d0(int param_1)



{

  ushort uVar1;

  uint in_EAX;

  uint uVar2;

  int iVar3;

  undefined4 *puVar4;

  uint uVar5;

  

  if (*(int *)(param_1 + 0x3c) != 0) {

    uVar5 = 0;

    *(undefined2 *)(param_1 + 100) = 0xffff;

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

    if (*(int *)(param_1 + 0x38) != 0) {

      uVar2 = 0;

      do {

        uVar1 = *(ushort *)(uVar2 * 0xb + *(int *)(param_1 + 0x3c));

        if (uVar1 < *(ushort *)(param_1 + 100)) {

          *(ushort *)(param_1 + 100) = uVar1;

        }

        if (*(ushort *)(param_1 + 0x66) < uVar1) {

          *(ushort *)(param_1 + 0x66) = uVar1;

        }

        uVar5 = uVar5 + 1;

        uVar2 = uVar5 & 0xffff;

      } while (uVar2 < *(uint *)(param_1 + 0x38));

    }

    uVar1 = *(ushort *)(param_1 + 0x66);

    in_EAX = (uint)uVar1;

    if (*(ushort *)(param_1 + 100) <= uVar1) {

      iVar3 = ((uint)uVar1 - (uint)*(ushort *)(param_1 + 100)) + 1;

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

      puVar4 = (undefined4 *)thunk_FUN_005df0f5(iVar3 * 2);

      uVar2 = *(int *)(param_1 + 0x68) << 1;

      *(undefined4 **)(param_1 + 0x6c) = puVar4;

      for (uVar5 = uVar2 >> 2; uVar5 != 0; uVar5 = uVar5 - 1) {

        *puVar4 = 0;

        puVar4 = puVar4 + 1;

      }

      for (uVar2 = uVar2 & 3; uVar2 != 0; uVar2 = uVar2 - 1) {

        *(undefined1 *)puVar4 = 0;

        puVar4 = (undefined4 *)((int)puVar4 + 1);

      }

      uVar5 = 0;

      if (*(int *)(param_1 + 0x38) != 0) {

        uVar2 = 0;

        do {

          *(short *)(*(int *)(param_1 + 0x6c) +

                    ((uint)*(ushort *)(uVar2 * 0xb + *(int *)(param_1 + 0x3c)) -

                    (uint)*(ushort *)(param_1 + 100)) * 2) = (short)uVar5;

          uVar5 = uVar5 + 1;

          uVar2 = uVar5 & 0xffff;

        } while (uVar2 < *(uint *)(param_1 + 0x38));

      }

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

    }

  }

  return in_EAX & 0xffffff00;

}





// --- FUN_004436a0 at 0x004436A0 (size: 59) ---


undefined4 __fastcall FUN_004436a0(int param_1)



{

  char cVar1;

  

  if ((*(int *)(param_1 + 0x54) != 0) && (cVar1 = FUN_004410c0(1), cVar1 == '\0')) {

    return 0;

  }

  if ((*(int *)(param_1 + 0x60) != 0) && (cVar1 = FUN_004410c0(1), cVar1 == '\0')) {

    return 0;

  }

  return 1;

}





// --- FUN_004436e0 at 0x004436E0 (size: 55) ---


undefined4 __fastcall FUN_004436e0(int param_1)



{

  char cVar1;

  

  if ((*(int *)(param_1 + 0x54) != 0) && (cVar1 = FUN_004411d0(), cVar1 == '\0')) {

    return 0;

  }

  if ((*(int *)(param_1 + 0x60) != 0) && (cVar1 = FUN_004411d0(), cVar1 == '\0')) {

    return 0;

  }

  return 1;

}





// --- FUN_00443960 at 0x00443960 (size: 187) ---


void __fastcall FUN_00443960(int param_1)



{

  undefined *puVar1;

  undefined4 uVar2;

  LONG LVar3;

  LONG *pLVar4;

  

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

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

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

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

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

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

  puVar1 = *(undefined **)(param_1 + 0x4c);

  if (puVar1 != PTR_DAT_00818344) {

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

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

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

    }

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

    *(undefined **)(param_1 + 0x4c) = PTR_DAT_00818344;

    InterlockedIncrement(pLVar4);

  }

  *(undefined4 *)(param_1 + 0x50) = DAT_00838e84;

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

  puVar1 = *(undefined **)(param_1 + 0x58);

  if (puVar1 != PTR_DAT_00818344) {

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

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

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

    }

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

    *(undefined **)(param_1 + 0x58) = PTR_DAT_00818344;

    InterlockedIncrement(pLVar4);

  }

  uVar2 = DAT_00838e84;

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

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

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

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

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

  *(undefined4 *)(param_1 + 0x5c) = uVar2;

  return;

}





// --- FUN_00443a20 at 0x00443A20 (size: 62) ---


void __fastcall FUN_00443a20(int *param_1)



{

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

  if ((void *)param_1[0x1b] != (void *)0x0) {

    operator_delete__((void *)param_1[0x1b]);

    param_1[0x1b] = 0;

  }

  if ((void *)param_1[0xf] != (void *)0x0) {

    operator_delete__((void *)param_1[0xf]);

    param_1[0xf] = 0;

  }

  FUN_00443960();

  return;

}





// --- FUN_00443ac0 at 0x00443AC0 (size: 34) ---


undefined4 FUN_00443ac0(undefined4 param_1)



{

  switch(param_1) {

  case 0x29:

  case 0x65:

  case 0xf3:

  case 0xf4:

    return 0;

  default:

    return 1;

  }

}





// --- FUN_00443bc0 at 0x00443BC0 (size: 95) ---


void __fastcall FUN_00443bc0(int param_1)



{

  undefined4 uVar1;

  

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

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

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

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

  FUN_0043d290(0);

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

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

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

  *(undefined1 *)(param_1 + 0xd8) = 0;

  FUN_0043d290(0);

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

  uVar1 = DAT_00838f14;

  *(undefined1 *)(param_1 + 0x11c) = 0;

  *(undefined1 *)(param_1 + 0x11d) = 0;

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

  return;

}





// --- FUN_00443c20 at 0x00443C20 (size: 29) ---


undefined1 __fastcall FUN_00443c20(int *param_1)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    cVar1 = (**(code **)(*param_1 + 0x5c))();

    if (cVar1 == '\0') {

      return 0;

    }

  }

  return 1;

}





// --- FUN_00443c40 at 0x00443C40 (size: 122) ---


undefined4 __thiscall FUN_00443c40(int param_1,int *param_2,uint param_3,uint *param_4,int *param_5)



{

  int iVar1;

  uint uVar2;

  

  if (*(char *)(param_1 + 0xd8) == '\0') {

    if (*(int *)(param_1 + 0x114) != 0) {

      uVar2 = *(int *)(param_1 + 0xa0) * (uint)*(byte *)(param_1 + 0xe8) >> 3;

      *param_4 = uVar2;

      iVar1 = (uint)*(byte *)(param_1 + 0xe8) * *param_2;

      *param_5 = ((int)(iVar1 + (iVar1 >> 0x1f & 7U)) >> 3) + param_2[1] * uVar2 +

                 *(int *)(param_1 + 0x114);

    }

    *(byte *)(param_1 + 0x11d) = (byte)(param_3 >> 1) & 1;

    *(undefined1 *)(param_1 + 0xd8) = 1;

    return 1;

  }

  return 0;

}





// --- FUN_00443cc0 at 0x00443CC0 (size: 40) ---


void __fastcall FUN_00443cc0(int param_1)



{

  if (*(char *)(param_1 + 0xd8) != '\0') {

    if (*(char *)(param_1 + 0x11d) == '\0') {

      *(undefined1 *)(param_1 + 0x11c) = 1;

    }

    *(undefined1 *)(param_1 + 0xd8) = 0;

    *(undefined1 *)(param_1 + 0x11d) = 0;

  }

  return;

}





// --- FUN_00443cf0 at 0x00443CF0 (size: 198) ---


undefined4 __thiscall FUN_00443cf0(int param_1,undefined4 param_2)



{

  uint uVar1;

  char cVar2;

  undefined4 uVar3;

  

  cVar2 = FUN_00413a70();

  if (((cVar2 != '\0') && (DAT_0086734c != 0)) && (DAT_00819248 != '\0')) {

    cVar2 = FUN_00443ac0(param_2);

    if (cVar2 == '\0') {

      return param_2;

    }

    if (*(int *)(param_1 + 4) == 6) {

      uVar3 = FUN_0054fe80();

      return uVar3;

    }

    if (*(int *)(param_1 + 4) != 10) {

      uVar1 = *(uint *)(param_1 + 0x6c);

      if ((uVar1 & 4) == 0) {

        if (((uVar1 & 2) != 0) && ((uVar1 & 1) != 0)) {

          return *(undefined4 *)(DAT_00870340 + 0x6c);

        }

        if ((uVar1 & 2) != 0) {

          return *(undefined4 *)(DAT_00870340 + 0x70);

        }

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

          return *(undefined4 *)(DAT_00870340 + 0x68);

        }

      }

      else if (*(char *)(DAT_00870340 + 0x55) == '\0') {

        return *(undefined4 *)(DAT_00870340 + 0x6c);

      }

    }

  }

  return param_2;

}





// --- FUN_00443dc0 at 0x00443DC0 (size: 405) ---


/* WARNING: Function: __chkstk replaced with injection: alloca_probe */



undefined4 __fastcall FUN_00443dc0(int *param_1)



{

  char cVar1;

  int *piVar2;

  int iVar3;

  int *piVar4;

  int *piVar5;

  int local_4e70;

  int local_4e6c;

  int iStack_4e68;

  uint uStack_4e64;

  undefined4 uStack_4e60;

  undefined4 uStack_4e58;

  int iStack_4e4c;

  int iStack_4e48;

  undefined4 uStack_4e44;

  undefined4 uStack_4e40;

  undefined4 uStack_4e3c;

  undefined4 uStack_4e28;

  undefined4 *puStack_c;

  undefined4 uStack_4;

  

  uStack_4 = 0x443dca;

  piVar2 = param_1;

  if (param_1[0x37] != 0x14) {

    piVar2 = (int *)(**(code **)(*DAT_00870340 + 0x10))();

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

      return 0;

    }

    cVar1 = (**(code **)(*piVar2 + 0x58))(param_1[0x28],param_1[0x29],0x14,1);

    if (cVar1 == '\0') {

      return 0;

    }

    cVar1 = (**(code **)(*piVar2 + 0x68))(param_1);

    if (cVar1 == '\0') {

      return 0;

    }

  }

  piVar5 = &local_4e70;

  piVar4 = &local_4e6c;

  local_4e70 = 0;

  cVar1 = (**(code **)(*piVar2 + 0x60))(param_1 + 0x2e,2,piVar4,piVar5);

  if (((cVar1 != '\0') && (piVar4 != (int *)0x0)) &&

     (iVar3 = FUN_00615c60(&stack0xffffb188), iVar3 == 0)) {

    local_4e70 = piVar2[0x28];

    local_4e6c = piVar2[0x29];

    iStack_4e68 = (int)piVar5 - ((uint)*(byte *)(piVar2 + 0x3a) * piVar2[0x28] >> 3);

    uStack_4e58 = *puStack_c;

    uStack_4e64 = (uint)(*(byte *)(piVar2 + 0x3a) >> 3);

    uStack_4e60 = 2;

    iStack_4e4c = piVar2[0x28];

    iStack_4e48 = piVar2[0x29];

    uStack_4e44 = 3;

    uStack_4e40 = 3;

    uStack_4e3c = 1;

    uStack_4e28 = 0x5a;

    iVar3 = FUN_00617900(&stack0xffffb188,8);

    if (iVar3 == 0) {

      iVar3 = FUN_006163f0(&stack0xffffb188);

      if (iVar3 == 0) {

        (**(code **)(*piVar2 + 100))();

        if (piVar2 != param_1) {

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

        }

        return 1;

      }

      (**(code **)(*piVar2 + 100))();

      return 0;

    }

    (**(code **)(*piVar2 + 100))();

  }

  return 0;

}





// --- FUN_00443f60 at 0x00443F60 (size: 365) ---


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



{

  int iVar1;

  undefined1 uVar2;

  char cVar3;

  int *piVar4;

  int *piVar5;

  

  iVar1 = param_2[0x37];

  if (((iVar1 == param_1[0x37]) && (param_2[0x28] == param_1[0x28])) &&

     (param_2[0x29] == param_1[0x29])) {

    uVar2 = FUN_00443290(param_2 + 0x2b);

    return uVar2;

  }

  cVar3 = FUN_00443ac0(param_1[0x37]);

  if (((cVar3 != '\0') && (cVar3 = FUN_00443ac0(iVar1), cVar3 != '\0')) &&

     (DAT_00870340 != (int *)0x0)) {

    if (param_1[0x45] == 0) {

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

      piVar4 = param_1;

    }

    else {

      piVar4 = (int *)(**(code **)(*DAT_00870340 + 0x10))();

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

        return 0;

      }

      cVar3 = (**(code **)(*piVar4 + 0x58))(param_1[0x28],param_1[0x29],param_1[0x37],0);

      if (cVar3 == '\0') {

        return 0;

      }

    }

    if (param_2[0x45] == 0) {

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

    }

    else {

      piVar5 = (int *)(**(code **)(*DAT_00870340 + 0x10))();

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

        return 0;

      }

      cVar3 = (**(code **)(*piVar5 + 0x58))(param_2[0x28],param_2[0x29],param_2[0x37],0);

      if (cVar3 == '\0') {

        return 0;

      }

      cVar3 = FUN_00443290(param_2 + 0x2b);

      param_2 = piVar5;

      if (cVar3 == '\0') {

        return 0;

      }

    }

    cVar3 = (**(code **)(*piVar4 + 0x68))(param_2);

    if (cVar3 != '\0') {

      if ((param_1[0x45] != 0) && (cVar3 = FUN_00443290(piVar4 + 0x2b), cVar3 == '\0')) {

        return 0;

      }

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

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

      return 1;

    }

  }

  return 0;

}





// --- FUN_004440d0 at 0x004440D0 (size: 28) ---


void __fastcall FUN_004440d0(int param_1)



{

  if (*(void **)(param_1 + 100) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 100));

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

  }

  return;

}





// --- FUN_004440f0 at 0x004440F0 (size: 79) ---


undefined4 * __fastcall FUN_004440f0(undefined4 *param_1)



{

  FUN_00415460(DAT_00838f14);

  FUN_00447220();

  *param_1 = &PTR_LAB_0079a690;

  param_1[0xc] = &PTR_LAB_0079a67c;

  FUN_00535a80();

  FUN_00441cd0();

  FUN_00535a80();

  FUN_00443bc0();

  return param_1;

}





// --- FUN_00444150 at 0x00444150 (size: 168) ---


undefined4 __thiscall

FUN_00444150(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,char param_5)



{

  char cVar1;

  int iVar2;

  

  *(undefined4 *)(param_1 + 0xa4) = param_3;

  *(undefined4 *)(param_1 + 0xa0) = param_2;

  *(undefined1 *)(param_1 + 0xd8) = 0;

  *(undefined1 *)(param_1 + 0x11c) = 0;

  FUN_0043d290(param_4);

  *(uint *)(param_1 + 0xa8) =

       (uint)*(byte *)(param_1 + 0xe8) * *(int *)(param_1 + 0xa0) * *(int *)(param_1 + 0xa4) >> 3;

  FUN_00440fe0(param_1,0,0,*(int *)(param_1 + 0xa0) + -1,*(int *)(param_1 + 0xa4) + -1);

  if ((param_5 == '\0') && (cVar1 = FUN_00443ac0(param_4), cVar1 != '\0')) {

    return 1;

  }

  iVar2 = thunk_FUN_005df0f5(*(undefined4 *)(param_1 + 0xa8));

  *(int *)(param_1 + 0x114) = iVar2;

  if (iVar2 != 0) {

    return 1;

  }

  return 0;

}





// --- FUN_00444200 at 0x00444200 (size: 753) ---


/* WARNING: Function: __chkstk replaced with injection: alloca_probe */



undefined4 __fastcall FUN_00444200(int *param_1)



{

  byte bVar1;

  char cVar2;

  int iVar3;

  uint uVar4;

  int unaff_EBX;

  int *piVar5;

  undefined4 unaff_ESI;

  uint uVar6;

  undefined4 *puVar7;

  undefined4 *puVar8;

  undefined4 *puVar9;

  uint uStack_4ed0;

  undefined4 uStack_4ecc;

  int *local_4ec8;

  uint local_4ec4;

  undefined4 *puStack_4ec0;

  undefined4 uStack_4ebc;

  int *local_4eb8;

  uint local_4eac;

  undefined1 auStack_4e80 [4];

  undefined4 *puStack_4e7c;

  undefined1 *puStack_4e74;

  int local_4e70 [9];

  int local_4e4c;

  int local_4e48;

  uint local_4e44;

  int *local_4e40;

  int local_4e3c;

  undefined4 uStack_c;

  

  uStack_c = 0x444210;

  if (param_1[0x19] == 0) {

    return 0;

  }

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

    return 0;

  }

  uVar6 = param_1[0x1a];

  local_4ec4 = param_1[0x16];

  local_4ec8 = (int *)param_1[0x17];

  if (uVar6 == 500) {

    piVar5 = local_4e70;

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

      *piVar5 = 0;

      piVar5 = piVar5 + 1;

    }

    iVar3 = FUN_00615c60(local_4e70);

    if (iVar3 != 0) {

      return 0;

    }

    local_4e4c = param_1[0x19];

    local_4e48 = param_1[0x18];

    iVar3 = FUN_00616de0(local_4e70,1);

    if (iVar3 != 0) {

      return 0;

    }

    local_4ec4 = local_4e44;

    local_4ec8 = local_4e40;

    uVar6 = 0x14;

    if (local_4e3c != 3) {

      return 0;

    }

  }

  uStack_4ecc = (undefined4 *)((uint)uStack_4ecc & 0xffffff);

  local_4eac = FUN_00443cf0(uVar6);

  if (local_4eac == uVar6) {

    local_4eb8 = param_1;

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

    piVar5 = param_1;

  }

  else {

    uStack_4ecc = (undefined4 *)CONCAT13(1,(undefined3)uStack_4ecc);

    local_4eb8 = (int *)(**(code **)(*DAT_00870340 + 0x10))();

    piVar5 = local_4eb8;

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

      return 0;

    }

  }

  cVar2 = (**(code **)(*piVar5 + 0x58))(local_4ec4,local_4ec8,uVar6,1);

  if ((cVar2 != '\0') &&

     (cVar2 = (**(code **)(*piVar5 + 0x60))(piVar5 + 0x2e,1,&uStack_4ed0,&puStack_4ec0),

     cVar2 != '\0')) {

    if (puStack_4ec0 == (undefined4 *)0x0) {

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

      return 0;

    }

    if (param_1[0x1a] == 500) {

      FUN_00535a80();

      FUN_0043d290(uVar6);

      local_4e70[0] = uStack_4ed0 - ((local_4eac & 0xff) * unaff_EBX >> 3);

      local_4e70[1] = 3;

      local_4e70[2] = 2;

      puStack_4e7c = puStack_4ec0;

      local_4e48 = 3;

      puStack_4e74 = &stack0xfffffffc;

      iVar3 = FUN_00616de0(auStack_4e80,3);

      if (iVar3 != 0) {

        return 0;

      }

      iVar3 = FUN_006163f0(auStack_4e80);

      if (iVar3 != 0) {

        return 0;

      }

    }

    else {

      puVar8 = (undefined4 *)param_1[0x19];

      if ((*(byte *)(param_1 + 0x1b) & 4) == 0) {

        uVar6 = (uint)*(byte *)(param_1 + 0x1d) * param_1[0x16] >> 3;

        uStack_4ecc = puVar8;

        if (uStack_4ed0 == uVar6) {

          uVar6 = param_1[0x18];

          for (uVar4 = uVar6 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {

            *puStack_4ec0 = *puVar8;

            puVar8 = puVar8 + 1;

            puStack_4ec0 = puStack_4ec0 + 1;

          }

          for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {

            *(undefined1 *)puStack_4ec0 = *(undefined1 *)puVar8;

            puVar8 = (undefined4 *)((int)puVar8 + 1);

            puStack_4ec0 = (undefined4 *)((int)puStack_4ec0 + 1);

          }

        }

        else {

          local_4ec4 = 0;

          if (param_1[0x17] != 0) {

            do {

              bVar1 = *(byte *)(param_1 + 0x1d);

              iVar3 = param_1[0x16];

              puVar7 = puVar8;

              puVar9 = puStack_4ec0;

              for (uVar4 = (uint)bVar1 * iVar3 >> 5; uVar4 != 0; uVar4 = uVar4 - 1) {

                *puVar9 = *puVar7;

                puVar7 = puVar7 + 1;

                puVar9 = puVar9 + 1;

              }

              for (uVar4 = (uint)bVar1 * iVar3 >> 3 & 3; uVar4 != 0; uVar4 = uVar4 - 1) {

                *(undefined1 *)puVar9 = *(undefined1 *)puVar7;

                puVar7 = (undefined4 *)((int)puVar7 + 1);

                puVar9 = (undefined4 *)((int)puVar9 + 1);

              }

              puStack_4ec0 = (undefined4 *)((int)puStack_4ec0 + uStack_4ed0);

              puVar8 = (undefined4 *)((int)puVar8 + uVar6);

              local_4ec4 = local_4ec4 + 1;

              piVar5 = local_4ec8;

              uStack_4ecc = puVar8;

            } while (local_4ec4 < (uint)param_1[0x17]);

          }

        }

      }

      else {

        uVar6 = param_1[0x18];

        for (uVar4 = uVar6 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {

          *puStack_4ec0 = *puVar8;

          puVar8 = puVar8 + 1;

          puStack_4ec0 = puStack_4ec0 + 1;

        }

        for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {

          *(undefined1 *)puStack_4ec0 = *(undefined1 *)puVar8;

          puVar8 = (undefined4 *)((int)puVar8 + 1);

          puStack_4ec0 = (undefined4 *)((int)puStack_4ec0 + 1);

        }

      }

    }

    (**(code **)(*piVar5 + 100))();

    FUN_004440d0();

    if (((char)((uint)unaff_ESI >> 0x18) == '\0') ||

       ((cVar2 = (**(code **)(*param_1 + 0x58))(unaff_EBX,&stack0xfffffffc,uStack_4ebc,1),

        cVar2 != '\0' && (cVar2 = (**(code **)(*param_1 + 0x68))(piVar5), cVar2 != '\0')))) {

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

      return 1;

    }

  }

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

  return 0;

}





// --- FUN_00444540 at 0x00444540 (size: 63) ---


void __fastcall FUN_00444540(int param_1)



{

  if (*(void **)(param_1 + 100) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 100));

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

  }

  if (*(void **)(param_1 + 0x114) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 0x114));

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

  }

  FUN_00443bc0();

  return;

}





// --- FUN_00444580 at 0x00444580 (size: 104) ---


void __fastcall FUN_00444580(undefined4 *param_1)



{

  *param_1 = &PTR_LAB_0079a690;

  param_1[0xc] = &PTR_LAB_0079a67c;

  if ((void *)param_1[0x19] != (void *)0x0) {

    operator_delete__((void *)param_1[0x19]);

    param_1[0x19] = 0;

  }

  if ((void *)param_1[0x45] != (void *)0x0) {

    operator_delete__((void *)param_1[0x45]);

    param_1[0x45] = 0;

  }

  param_1[0x2b] = &PTR_FUN_00799d14;

  FUN_00440f40();

  FUN_00446f00();

  FUN_004154b0();

  return;

}





// --- FUN_00444620 at 0x00444620 (size: 30) ---


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



{

  FUN_00444580();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00444800 at 0x00444800 (size: 21) ---


undefined4 * __fastcall FUN_00444800(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_0079a750;

  FUN_00406d60();

  return param_1;

}





// --- FUN_00444850 at 0x00444850 (size: 45) ---


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



{

  *param_1 = &PTR_FUN_0079a750;

  FUN_00406f90();

  *param_1 = &PTR_FUN_0079702c;

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00444880 at 0x00444880 (size: 75) ---


undefined4 __thiscall FUN_00444880(float *param_1,float *param_2,float param_3)



{

  float fVar1;

  undefined4 uVar2;

  

  fVar1 = *param_2 * *param_1 + param_2[1] * param_1[1] + param_2[2] * param_1[2] + param_1[3];

  if (param_3 < fVar1) {

    return 0;

  }

  uVar2 = 1;

  if (-param_3 <= fVar1) {

    uVar2 = 2;

  }

  return uVar2;

}





// --- FUN_00444900 at 0x00444900 (size: 228) ---


void FUN_00444900(undefined4 param_1,uint param_2)



{

  char cVar1;

  uint uVar2;

  undefined4 *puVar3;

  undefined4 *puVar4;

  undefined4 uVar5;

  uint uVar6;

  undefined4 *puVar7;

  undefined1 local_c [12];

  

  uVar6 = param_2;

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

    param_2 = FUN_00406db0();

  }

  FUN_004449f0(&param_2,uVar6);

  if ((*(byte *)(uVar6 + 4) & 5) == 0) {

    uVar2 = FUN_0040a8f0();

    if (uVar2 < param_2) {

LAB_0044495b:

      FUN_0040aa50();

      return;

    }

    uVar2 = FUN_00406db0();

    if (uVar2 < param_2) {

      cVar1 = FUN_00406d70();

      if (cVar1 == '\0') goto LAB_0044495b;

      FUN_004074b0(param_2,1);

    }

  }

  uVar2 = param_2;

  puVar3 = (undefined4 *)FUN_00406d80();

  puVar4 = (undefined4 *)FUN_0040acf0(uVar2);

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

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

      puVar7 = puVar4;

      for (uVar6 = uVar2 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {

        *puVar3 = *puVar7;

        puVar7 = puVar7 + 1;

        puVar3 = puVar3 + 1;

      }

    }

    else {

      puVar7 = puVar3;

      puVar3 = puVar4;

      for (uVar6 = uVar2 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {

        *puVar3 = *puVar7;

        puVar7 = puVar7 + 1;

        puVar3 = puVar3 + 1;

      }

    }

    for (uVar2 = uVar2 & 3; uVar2 != 0; uVar2 = uVar2 - 1) {

      *(undefined1 *)puVar3 = *(undefined1 *)puVar7;

      puVar7 = (undefined4 *)((int)puVar7 + 1);

      puVar3 = (undefined4 *)((int)puVar3 + 1);

    }

  }

  uVar5 = FUN_00407140(local_c,0,param_2);

  FUN_004070d0(uVar5);

  FUN_00406f90();

  return;

}





// --- FUN_004449f0 at 0x004449F0 (size: 49) ---


void FUN_004449f0(undefined4 *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 = *param_1;

      return;

    }

    *param_1 = *puVar1;

  }

  return;

}





// --- FUN_00444a30 at 0x00444A30 (size: 139) ---


undefined4 __fastcall FUN_00444a30(int param_1)



{

  int *piVar1;

  undefined4 uVar2;

  int iVar3;

  uint uVar4;

  undefined1 local_d;

  

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

  local_d = 1;

  if ((iVar3 != 0) && (uVar4 = 0, *(int *)(iVar3 + 0x10) != 0)) {

    do {

      piVar1 = (int *)(*(int *)(iVar3 + 8) + uVar4 * 8);

      if (*piVar1 != DAT_00839058) {

        uVar2 = FUN_004220b0(*piVar1,0x21);

        iVar3 = FUN_00415430(uVar2);

        if (iVar3 == 0) {

          local_d = 0;

        }

        else {

          if ((int *)piVar1[1] != (int *)0x0) {

            (**(code **)(*(int *)piVar1[1] + 0x14))();

            piVar1[1] = 0;

          }

          piVar1[1] = iVar3;

        }

      }

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

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(iVar3 + 0x10));

    return CONCAT31((int3)((uint)iVar3 >> 8),local_d);

  }

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

}





// --- FUN_00444b00 at 0x00444B00 (size: 117) ---


void __fastcall FUN_00444b00(int param_1)



{

  int iVar1;

  uint uVar2;

  uint uVar3;

  int *piVar4;

  int *piVar5;

  uint local_4;

  

  *(undefined1 *)(param_1 + 0x71) = 0;

  local_4 = 0;

  if (*(int *)(param_1 + 0x58) == 0) {

    return;

  }

  piVar4 = *(int **)(param_1 + 0x50);

  do {

    iVar1 = *(int *)(*(int *)(param_1 + 0x44) + *piVar4 * 4);

    uVar2 = *(uint *)(iVar1 + 0x14);

    uVar3 = 0;

    if (uVar2 != 0) {

      piVar5 = *(int **)(iVar1 + 0xc);

      do {

        if (*(int *)(*(int *)(*(int *)(*(int *)(*(int *)(*piVar5 + 0xc) + 0x3c) + 8) +

                             *(int *)(*piVar5 + 0x14) * 4) + 0x20) != 0) {

          *(undefined1 *)(param_1 + 0x71) = 1;

          return;

        }

        uVar3 = uVar3 + 1;

        piVar5 = piVar5 + 1;

      } while (uVar3 < uVar2);

    }

    local_4 = local_4 + 1;

    piVar4 = piVar4 + 1;

  } while (local_4 < *(uint *)(param_1 + 0x58));

  return;

}





// --- FUN_00444b80 at 0x00444B80 (size: 109) ---


void __fastcall FUN_00444b80(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  uint uVar3;

  undefined4 *puVar4;

  

  if (*(int *)(param_1 + 0x58) != 0) {

    FUN_005b2ea0();

    iVar1 = *(int *)(*(int *)(param_1 + 0x44) + **(int **)(param_1 + 0x50) * 4);

    uVar3 = 0;

    if (*(int *)(iVar1 + 0x14) != 0) {

      do {

        FUN_005b2e20(param_1 + 0x7c);

        uVar3 = uVar3 + 1;

      } while (uVar3 < *(uint *)(iVar1 + 0x14));

    }

    return;

  }

  puVar2 = &DAT_008ef180;

  puVar4 = (undefined4 *)(param_1 + 0x7c);

  for (iVar1 = 6; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar4 = *puVar2;

    puVar2 = puVar2 + 1;

    puVar4 = puVar4 + 1;

  }

  return;

}





// --- FUN_00444bf0 at 0x00444BF0 (size: 350) ---


uint __thiscall FUN_00444bf0(int param_1,int param_2)



{

  int iVar1;

  int iVar2;

  char cVar3;

  uint uVar4;

  int *piVar5;

  int iVar6;

  char local_11;

  undefined4 local_10;

  int local_c;

  uint local_8;

  int local_4;

  

  uVar4 = 0;

  local_11 = '\0';

  if (*(uint *)(param_1 + 0x4c) != 0) {

    piVar5 = *(int **)(param_1 + 0x44);

    while (*(int *)(*piVar5 + 0x1c) != param_2) {

      uVar4 = uVar4 + 1;

      piVar5 = piVar5 + 1;

      if (*(uint *)(param_1 + 0x4c) <= uVar4) {

        return uVar4 & 0xffffff00;

      }

    }

    iVar6 = (*(int **)(param_1 + 0x44))[uVar4];

    if (iVar6 != 0) {

      uVar4 = 0;

      local_8 = 0;

      local_c = iVar6;

      if (*(int *)(iVar6 + 0x14) != 0) {

        do {

          iVar1 = *(int *)(*(int *)(iVar6 + 0xc) + local_8 * 4);

          param_2 = *(undefined4 *)(iVar1 + 0x2c);

          piVar5 = *(int **)(*(int *)(*(int *)(*(int *)(iVar1 + 0xc) + 0x3c) + 8) +

                            *(int *)(iVar1 + 0x14) * 4);

          local_10 = *(undefined4 *)(iVar1 + 0x30);

          if (*(int *)(iVar1 + 0x18) == -1) {

            cVar3 = (**(code **)(*piVar5 + 0x18))

                              (*(undefined4 *)(iVar1 + 8),0,*(undefined4 *)(iVar1 + 0x20),&param_2,

                               &local_10);

            if (cVar3 == '\0') goto LAB_00444d0e;

            local_11 = '\x01';

LAB_00444d16:

            *(undefined4 *)(iVar1 + 0x24) = 0;

            *(undefined4 *)(iVar1 + 0x28) = 0;

            *(int *)(iVar1 + 0x2c) = param_2;

            *(undefined4 *)(iVar1 + 0x30) = local_10;

          }

          else {

            iVar6 = *(int *)(*(int *)(*(int *)(*(int *)(iVar1 + 0xc) + 0x40) + 8) +

                            *(int *)(iVar1 + 0x18) * 4);

            FUN_0044cb90();

            iVar2 = *(int *)(iVar6 + 0x20);

            FUN_0044cb90();

            local_4 = *(int *)(iVar6 + 0x1c);

            FUN_0044cb90();

            cVar3 = (**(code **)(*piVar5 + 0x14))

                              (*(undefined4 *)(iVar1 + 8),*(undefined4 *)(iVar1 + 0x1c),

                               *(undefined4 *)(iVar1 + 0x20),*(undefined4 *)(iVar6 + 0x1c),

                               (iVar2 - local_4) + 1,0,iVar6,0,&param_2,&local_10,1);

            iVar6 = local_c;

            if (cVar3 != '\0') {

              local_11 = '\x01';

              goto LAB_00444d16;

            }

LAB_00444d0e:

            if (local_11 != '\0') goto LAB_00444d16;

          }

          uVar4 = local_8 + 1;

          local_8 = uVar4;

        } while (uVar4 < *(uint *)(iVar6 + 0x14));

      }

      return CONCAT31((int3)(uVar4 >> 8),local_11);

    }

  }

  return uVar4 & 0xffffff00;

}





// --- FUN_00444d50 at 0x00444D50 (size: 53) ---


void __fastcall FUN_00444d50(int param_1)



{

  uint uVar1;

  

  FUN_00444a30();

  uVar1 = 0;

  if (*(int *)(param_1 + 0x58) != 0) {

    do {

      if (*(int *)(*(int *)(*(int *)(param_1 + 0x44) +

                           *(int *)(*(int *)(param_1 + 0x50) + uVar1 * 4) * 4) + 0x18) == 0) {

        FUN_0044f1e0();

      }

      uVar1 = uVar1 + 1;

    } while (uVar1 < *(uint *)(param_1 + 0x58));

  }

  return;

}





// --- FUN_00444d90 at 0x00444D90 (size: 46) ---


void __fastcall FUN_00444d90(int param_1)



{

  uint uVar1;

  

  FUN_00444a30();

  uVar1 = 0;

  if (*(int *)(param_1 + 0x58) != 0) {

    do {

      FUN_0044e7e0();

      uVar1 = uVar1 + 1;

    } while (uVar1 < *(uint *)(param_1 + 0x58));

  }

  return;

}





// --- FUN_00444dc0 at 0x00444DC0 (size: 99) ---


void __fastcall FUN_00444dc0(int *param_1)



{

  int iVar1;

  int iVar2;

  undefined4 local_8;

  

  param_1[2] = 0;

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

    if (*param_1 != 0) {

      operator_delete__((void *)(*param_1 + -4));

    }

    *param_1 = 0;

    param_1[1] = 0;

    return;

  }

  if (*param_1 != 0) {

    iVar2 = (param_1[1] & 0x7fffffffU) - 1;

    while (-1 < iVar2) {

      iVar2 = iVar2 + -1;

      iVar1 = *param_1;

      *(undefined4 *)(iVar1 + 8 + iVar2 * 8) = local_8;

      *(undefined4 *)(iVar1 + 0xc + iVar2 * 8) = 0;

    }

  }

  return;

}





// --- FUN_00444e30 at 0x00444E30 (size: 193) ---


undefined4 __thiscall FUN_00444e30(int *param_1,uint param_2)



{

  uint *puVar1;

  int iVar2;

  uint *puVar3;

  int iVar4;

  

  if ((uint)param_1[2] <= param_2) {

    if (param_2 <= (param_1[1] & 0x7fffffffU)) {

      return 1;

    }

    if (param_2 == 0) {

      FUN_00444dc0();

      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_004448d0);

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

        if (*param_1 != 0) {

          iVar4 = param_1[2] + -1;

          while (-1 < iVar4) {

            iVar4 = iVar4 + -1;

            iVar2 = *param_1;

            puVar3[iVar4 * 2 + 3] = *(uint *)(iVar2 + 8 + iVar4 * 8);

            puVar3[iVar4 * 2 + 4] = *(uint *)(iVar2 + 0xc + iVar4 * 8);

          }

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

            operator_delete__((void *)(*param_1 + -4));

          }

        }

        *param_1 = (int)puVar1;

        param_1[1] = param_2 | 0x80000000;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_00444f00 at 0x00444F00 (size: 196) ---


undefined1 __fastcall FUN_00444f00(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 == 9) {

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

      return 1;

    }

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

    piVar3 = (int *)FUN_005df0f5(0x10);

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

      piVar3 = (int *)0x0;

    }

    else {

      *piVar3 = (int)&PTR_FUN_0079a750;

      FUN_00406d60();

    }

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

    if (cVar1 == '\0') {

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

      uVar5 = 0;

    }

    else {

      FUN_004070d0(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_00444fd0 at 0x00444FD0 (size: 108) ---


void __fastcall FUN_00444fd0(undefined4 *param_1)



{

  int *piVar1;

  uint uVar2;

  

  uVar2 = 0;

  *param_1 = &PTR_FUN_0079a770;

  if (param_1[4] != 0) {

    do {

      piVar1 = *(int **)(param_1[2] + 4 + uVar2 * 8);

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

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

        *(undefined4 *)(param_1[2] + 4 + uVar2 * 8) = 0;

      }

      uVar2 = uVar2 + 1;

    } while (uVar2 < (uint)param_1[4]);

  }

  FUN_00444dc0();

  if (((param_1[3] & 0x80000000) == 0x80000000) && (param_1[2] != 0)) {

    operator_delete__((void *)(param_1[2] + -4));

  }

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_00445040 at 0x00445040 (size: 180) ---


void __fastcall FUN_00445040(undefined4 *param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  uint uVar4;

  

  uVar4 = 0;

  *param_1 = &PTR_FUN_0079a774;

  if (param_1[4] != 0) {

    do {

      puVar2 = *(undefined4 **)(param_1[2] + uVar4 * 4);

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

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

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

        }

        *(undefined4 *)(param_1[2] + uVar4 * 4) = 0;

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < (uint)param_1[4]);

  }

  param_1[4] = 0;

  if ((param_1[3] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[2]);

    param_1[2] = 0;

    param_1[3] = 0;

  }

  else if (param_1[2] != 0) {

    iVar3 = (param_1[3] & 0x7fffffff) - 1;

    while (-1 < iVar3) {

      iVar3 = iVar3 + -1;

      *(undefined4 *)(param_1[2] + 4 + iVar3 * 4) = 0;

    }

  }

  if ((param_1[3] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[2]);

  }

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_00445100 at 0x00445100 (size: 180) ---


void __fastcall FUN_00445100(undefined4 *param_1)



{

  undefined4 *puVar1;

  int iVar2;

  uint uVar3;

  

  uVar3 = 0;

  *param_1 = &PTR_FUN_0079a778;

  if (param_1[4] != 0) {

    do {

      puVar1 = *(undefined4 **)(param_1[2] + uVar3 * 4);

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

        (**(code **)*puVar1)(1);

      }

      *(undefined4 *)(param_1[2] + uVar3 * 4) = 0;

      uVar3 = uVar3 + 1;

    } while (uVar3 < (uint)param_1[4]);

  }

  param_1[4] = 0;

  if ((param_1[3] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[2]);

    param_1[2] = 0;

    param_1[3] = 0;

  }

  else if (param_1[2] != 0) {

    iVar2 = (param_1[3] & 0x7fffffff) - 1;

    while (-1 < iVar2) {

      iVar2 = iVar2 + -1;

      *(undefined4 *)(param_1[2] + 4 + iVar2 * 4) = 0;

    }

  }

  if ((param_1[3] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[2]);

  }

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_004451c0 at 0x004451C0 (size: 252) ---


undefined4 * __fastcall FUN_004451c0(undefined4 *param_1)



{

  FUN_00415460(DAT_00839058);

  *param_1 = &PTR_LAB_0079a780;

  param_1[0xc] = 7;

  param_1[0xd] = 0;

  param_1[0xe] = 0;

  param_1[0xf] = 0;

  param_1[0x10] = 0;

  param_1[0x11] = 0;

  param_1[0x12] = 0;

  param_1[0x13] = 0;

  param_1[0x14] = 0;

  param_1[0x15] = 0;

  param_1[0x16] = 0;

  param_1[0x17] = 0;

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  *(undefined1 *)(param_1 + 0x1b) = 0;

  *(undefined1 *)((int)param_1 + 0x6d) = 0;

  *(undefined1 *)((int)param_1 + 0x6e) = 0;

  *(undefined1 *)((int)param_1 + 0x6f) = 0;

  *(undefined1 *)(param_1 + 0x1c) = 0;

  *(undefined1 *)((int)param_1 + 0x71) = 0;

  *(undefined1 *)((int)param_1 + 0x72) = 0;

  param_1[0x1a] = 0xffffffff;

  param_1[0x1d] = 0xffffffff;

  param_1[0x1e] = 0xffffffff;

  param_1[0x1f] = DAT_008ef180;

  param_1[0x20] = DAT_008ef184;

  param_1[0x21] = DAT_008ef188;

  param_1[0x22] = DAT_008ef18c;

  param_1[0x23] = DAT_008ef190;

  param_1[0x24] = DAT_008ef194;

  param_1[0x25] = DAT_008ef180;

  param_1[0x26] = DAT_008ef184;

  param_1[0x27] = DAT_008ef188;

  param_1[0x28] = DAT_008ef18c;

  param_1[0x29] = DAT_008ef190;

  param_1[0x2a] = DAT_008ef194;

  *(undefined1 *)(param_1 + 0x2b) = 0;

  return param_1;

}





// --- FUN_004452d0 at 0x004452D0 (size: 277) ---


void __fastcall FUN_004452d0(int param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  uint uVar4;

  

  uVar4 = 0;

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

  if (*(int *)(param_1 + 0x4c) != 0) {

    do {

      puVar2 = *(undefined4 **)(*(int *)(param_1 + 0x44) + uVar4 * 4);

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

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

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

        }

        *(undefined4 *)(*(int *)(param_1 + 0x44) + uVar4 * 4) = 0;

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(param_1 + 0x4c));

  }

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

  if ((*(uint *)(param_1 + 0x48) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x44));

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

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

  }

  else if (*(int *)(param_1 + 0x44) != 0) {

    iVar3 = (*(uint *)(param_1 + 0x48) & 0x7fffffff) - 1;

    while (-1 < iVar3) {

      iVar3 = iVar3 + -1;

      *(undefined4 *)(*(int *)(param_1 + 0x44) + 4 + iVar3 * 4) = 0;

    }

  }

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

  if ((*(uint *)(param_1 + 0x54) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x50));

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

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

  }

  else if (*(int *)(param_1 + 0x50) != 0) {

    iVar3 = (*(uint *)(param_1 + 0x54) & 0x7fffffff) - 1;

    while (-1 < iVar3) {

      iVar3 = iVar3 + -1;

      *(undefined4 *)(*(int *)(param_1 + 0x50) + 4 + iVar3 * 4) = 0;

    }

  }

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

  if ((*(uint *)(param_1 + 0x60) & 0x80000000) != 0x80000000) {

    if (*(int *)(param_1 + 0x5c) != 0) {

      iVar3 = (*(uint *)(param_1 + 0x60) & 0x7fffffff) - 1;

      while (-1 < iVar3) {

        iVar3 = iVar3 + -1;

        *(undefined4 *)(*(int *)(param_1 + 0x5c) + 4 + iVar3 * 4) = 0;

      }

    }

    *(undefined4 *)(param_1 + 0x68) = 0xffffffff;

    return;

  }

  operator_delete__(*(void **)(param_1 + 0x5c));

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

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

  *(undefined4 *)(param_1 + 0x68) = 0xffffffff;

  return;

}





// --- FUN_004453f0 at 0x004453F0 (size: 186) ---


void __fastcall FUN_004453f0(int param_1)



{

  int *piVar1;

  int iVar2;

  undefined4 *puVar3;

  undefined4 *puVar4;

  

  FUN_0044dcb0();

  FUN_0044dcb0();

  *(undefined4 *)(param_1 + 0x68) = 0xffffffff;

  FUN_004452d0();

  *(uint *)(param_1 + 0x30) = *(uint *)(param_1 + 0x30) | 1;

  puVar3 = *(undefined4 **)(param_1 + 0x38);

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

    piVar1 = puVar3 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar3)(1);

    }

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

  }

  *(uint *)(param_1 + 0x30) = *(uint *)(param_1 + 0x30) | 2;

  puVar3 = *(undefined4 **)(param_1 + 0x3c);

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

    piVar1 = puVar3 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar3)(1);

    }

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

  }

  *(uint *)(param_1 + 0x30) = *(uint *)(param_1 + 0x30) | 4;

  puVar3 = *(undefined4 **)(param_1 + 0x40);

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

    piVar1 = puVar3 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

      (**(code **)*puVar3)(1);

    }

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

  }

  *(undefined4 *)(param_1 + 0x74) = 0xffffffff;

  *(undefined4 *)(param_1 + 0x78) = 0xffffffff;

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

  *(undefined1 *)(param_1 + 0x6c) = 0;

  *(undefined1 *)(param_1 + 0x6d) = 0;

  *(undefined1 *)(param_1 + 0x6e) = 0;

  *(undefined1 *)(param_1 + 0x6f) = 0;

  *(undefined1 *)(param_1 + 0x70) = 0;

  *(undefined1 *)(param_1 + 0x71) = 0;

  *(undefined1 *)(param_1 + 0x72) = 0;

  puVar3 = &DAT_008ef180;

  puVar4 = (undefined4 *)(param_1 + 0x7c);

  for (iVar2 = 6; iVar2 != 0; iVar2 = iVar2 + -1) {

    *puVar4 = *puVar3;

    puVar3 = puVar3 + 1;

    puVar4 = puVar4 + 1;

  }

  puVar3 = &DAT_008ef180;

  puVar4 = (undefined4 *)(param_1 + 0x94);

  for (iVar2 = 6; iVar2 != 0; iVar2 = iVar2 + -1) {

    *puVar4 = *puVar3;

    puVar3 = puVar3 + 1;

    puVar4 = puVar4 + 1;

  }

  *(undefined1 *)(param_1 + 0xac) = 0;

  return;

}





// --- FUN_00445540 at 0x00445540 (size: 30) ---


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



{

  FUN_00444fd0();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00445560 at 0x00445560 (size: 30) ---


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



{

  FUN_00445040();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00445580 at 0x00445580 (size: 30) ---


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



{

  FUN_00445100();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_004455a0 at 0x004455A0 (size: 107) ---


void __fastcall FUN_004455a0(undefined4 *param_1)



{

  *param_1 = &PTR_LAB_0079a780;

  FUN_004453f0();

  if ((param_1[0x18] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x17]);

  }

  if ((param_1[0x15] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x14]);

  }

  if ((param_1[0x12] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x11]);

  }

  FUN_004154b0();

  return;

}





// --- FUN_00445610 at 0x00445610 (size: 30) ---


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



{

  FUN_004455a0();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00445630 at 0x00445630 (size: 131) ---


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



{

  int iVar1;

  undefined4 uVar2;

  int iVar3;

  int iVar4;

  char cVar5;

  undefined4 *puVar6;

  uint uVar7;

  undefined4 uVar8;

  

  if (*(int *)(param_1 + 0x38) == 0) {

    puVar6 = (undefined4 *)FUN_005df0f5(0x14);

    if (puVar6 == (undefined4 *)0x0) {

      puVar6 = (undefined4 *)0x0;

    }

    else {

      puVar6[1] = 1;

      *puVar6 = &PTR_FUN_0079a770;

      puVar6[2] = 0;

      puVar6[3] = 0;

      puVar6[4] = 0;

    }

    *(undefined4 **)(param_1 + 0x38) = puVar6;

  }

  iVar1 = *(int *)(param_1 + 0x38);

  uVar2 = *(undefined4 *)(iVar1 + 0x10);

  uVar7 = *(uint *)(iVar1 + 0xc) & 0x7fffffff;

  if (uVar7 <= *(uint *)(iVar1 + 0x10)) {

    uVar8 = FUN_00453850(uVar7 + 1);

    cVar5 = FUN_00444e30(uVar8);

    if (cVar5 == '\0') {

      return uVar2;

    }

  }

  iVar3 = *(int *)(iVar1 + 0x10);

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

  *(undefined4 *)(iVar4 + iVar3 * 8) = param_2;

  *(undefined4 *)(iVar4 + 4 + iVar3 * 8) = param_3;

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

  return uVar2;

}





// --- FUN_004456c0 at 0x004456C0 (size: 123) ---


undefined4 __thiscall FUN_004456c0(int param_1,undefined4 param_2)



{

  int iVar1;

  undefined4 uVar2;

  char cVar3;

  undefined4 *puVar4;

  uint uVar5;

  undefined4 uVar6;

  

  if (*(int *)(param_1 + 0x3c) == 0) {

    puVar4 = (undefined4 *)FUN_005df0f5(0x14);

    if (puVar4 == (undefined4 *)0x0) {

      puVar4 = (undefined4 *)0x0;

    }

    else {

      puVar4[1] = 1;

      *puVar4 = &PTR_FUN_0079a774;

      puVar4[2] = 0;

      puVar4[3] = 0;

      puVar4[4] = 0;

    }

    *(undefined4 **)(param_1 + 0x3c) = puVar4;

  }

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

  uVar2 = *(undefined4 *)(iVar1 + 0x10);

  uVar5 = *(uint *)(iVar1 + 0xc) & 0x7fffffff;

  if (uVar5 <= *(uint *)(iVar1 + 0x10)) {

    uVar6 = FUN_00453850(uVar5 + 1);

    cVar3 = FUN_004180a0(uVar6);

    if (cVar3 == '\0') {

      return uVar2;

    }

  }

  *(undefined4 *)(*(int *)(iVar1 + 8) + *(int *)(iVar1 + 0x10) * 4) = param_2;

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

  return uVar2;

}





// --- FUN_00445740 at 0x00445740 (size: 123) ---


undefined4 __thiscall FUN_00445740(int param_1,undefined4 param_2)



{

  int iVar1;

  undefined4 uVar2;

  char cVar3;

  undefined4 *puVar4;

  uint uVar5;

  undefined4 uVar6;

  

  if (*(int *)(param_1 + 0x40) == 0) {

    puVar4 = (undefined4 *)FUN_005df0f5(0x14);

    if (puVar4 == (undefined4 *)0x0) {

      puVar4 = (undefined4 *)0x0;

    }

    else {

      puVar4[1] = 1;

      *puVar4 = &PTR_FUN_0079a778;

      puVar4[2] = 0;

      puVar4[3] = 0;

      puVar4[4] = 0;

    }

    *(undefined4 **)(param_1 + 0x40) = puVar4;

  }

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

  uVar2 = *(undefined4 *)(iVar1 + 0x10);

  uVar5 = *(uint *)(iVar1 + 0xc) & 0x7fffffff;

  if (uVar5 <= *(uint *)(iVar1 + 0x10)) {

    uVar6 = FUN_00453850(uVar5 + 1);

    cVar3 = FUN_004180a0(uVar6);

    if (cVar3 == '\0') {

      return uVar2;

    }

  }

  *(undefined4 *)(*(int *)(iVar1 + 8) + *(int *)(iVar1 + 0x10) * 4) = param_2;

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

  return uVar2;

}





// --- FUN_00445ea0 at 0x00445EA0 (size: 524) ---


undefined4 __thiscall FUN_00445ea0(int param_1,undefined4 *param_2)



{

  char cVar1;

  int *piVar2;

  int iVar3;

  LONG LVar4;

  undefined4 *puVar5;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 extraout_ECX_01;

  undefined4 *puVar6;

  undefined4 uVar7;

  

  if (param_2 == (undefined4 *)0x0) {

    return 0;

  }

  FUN_0065cf90(param_2);

  piVar2 = (int *)FUN_0065c810();

  do {

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

      FUN_0065cae0();

      return 1;

    }

    cVar1 = FUN_0065cc50(&DAT_00839758);

    puVar5 = (undefined4 *)PTR_DAT_00818344;

    if (cVar1 == '\0') {

      cVar1 = FUN_0065cc50(&DAT_0083975c);

      if (cVar1 == '\0') {

        cVar1 = FUN_0065cc50(&DAT_008397a8);

        if ((((cVar1 != '\0') || (cVar1 = FUN_0065cc50(&DAT_00839130), cVar1 != '\0')) ||

            (cVar1 = FUN_0065cc50(&DAT_0083912c), cVar1 != '\0')) ||

           (cVar1 = FUN_0065cc50(&DAT_008397c0), cVar1 != '\0')) goto LAB_00446074;

        uVar7 = extraout_ECX_01;

        FUN_00401340("Unrecognized keyword in mesh file");

        FUN_0065d670(piVar2,uVar7);

      }

      else {

        iVar3 = FUN_005df0f5(0x20);

        if (iVar3 == 0) {

          puVar5 = (undefined4 *)0x0;

        }

        else {

          puVar5 = (undefined4 *)FUN_0044df50();

        }

        param_2 = puVar5;

        cVar1 = FUN_0044e610(piVar2,param_1);

        if (cVar1 == '\0') {

          uVar7 = extraout_ECX_00;

          FUN_00401340("Error parsing mesh fragment");

          FUN_0065d620(piVar2,uVar7);

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

            piVar2 = puVar5 + 1;

            *piVar2 = *piVar2 + -1;

            if (*piVar2 == 0) {

              (**(code **)*puVar5)(1);

            }

          }

LAB_00446074:

          FUN_0065cae0();

          return 0;

        }

        FUN_004637a0(&param_2);

      }

    }

    else {

      param_2 = (undefined4 *)PTR_DAT_00818344;

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

      iVar3 = (**(code **)(*piVar2 + 0xc))(0);

      if (iVar3 != 0) {

        FUN_00426020(&param_2);

        puVar5 = param_2;

      }

      iVar3 = param_1 + 0x34;

      puVar6 = puVar5;

      InterlockedIncrement(puVar5 + -4);

      cVar1 = FUN_0041b8f0(8,puVar6,iVar3);

      if (cVar1 == '\0') {

        uVar7 = extraout_ECX;

        FUN_00401340("Invalid mesh appearance type name");

        FUN_0065d620(piVar2,uVar7);

        LVar4 = InterlockedDecrement(puVar5 + -4);

        if ((LVar4 == 0) && (puVar5 + -5 != (undefined4 *)0x0)) {

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

        }

        goto LAB_00446074;

      }

      LVar4 = InterlockedDecrement(puVar5 + -4);

      if ((LVar4 == 0) && (puVar5 + -5 != (undefined4 *)0x0)) {

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

      }

    }

    piVar2 = (int *)FUN_0065cb10();

  } while( true );

}





// --- FUN_004460c0 at 0x004460C0 (size: 190) ---


void __fastcall FUN_004460c0(int param_1)



{

  int iVar1;

  char cVar2;

  uint uVar3;

  undefined4 uVar4;

  uint uVar5;

  

  FUN_0044dcb0();

  FUN_0044dcb0();

  uVar5 = 0;

  *(undefined4 *)(param_1 + 0x68) = 0xffffffff;

  if (*(int *)(param_1 + 0x4c) != 0) {

    do {

      iVar1 = *(int *)(*(int *)(*(int *)(param_1 + 0x44) + uVar5 * 4) + 8);

      if (iVar1 == 1) {

        uVar3 = *(uint *)(param_1 + 0x54) & 0x7fffffff;

        if (uVar3 <= *(uint *)(param_1 + 0x58)) {

          uVar4 = FUN_00453850(uVar3 + 1);

          cVar2 = FUN_004180a0(uVar4);

          if (cVar2 == '\0') goto LAB_0044616d;

        }

        *(uint *)(*(int *)(param_1 + 0x50) + *(int *)(param_1 + 0x58) * 4) = uVar5;

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

      }

      else if (iVar1 == 2) {

        uVar3 = *(uint *)(param_1 + 0x60) & 0x7fffffff;

        if (uVar3 <= *(uint *)(param_1 + 100)) {

          uVar4 = FUN_00453850(uVar3 + 1);

          cVar2 = FUN_004180a0(uVar4);

          if (cVar2 == '\0') goto LAB_0044616d;

        }

        *(uint *)(*(int *)(param_1 + 0x5c) + *(int *)(param_1 + 100) * 4) = uVar5;

        *(int *)(param_1 + 100) = *(int *)(param_1 + 100) + 1;

      }

      else if (iVar1 == 4) {

        *(uint *)(param_1 + 0x68) = uVar5;

      }

LAB_0044616d:

      uVar5 = uVar5 + 1;

    } while (uVar5 < *(uint *)(param_1 + 0x4c));

  }

  return;

}





// --- FUN_00446180 at 0x00446180 (size: 125) ---


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



{

  int iVar1;

  int local_4;

  

  local_4 = param_1;

  if (*(uint *)(param_1 + 0x58) <= param_2) {

    if (param_2 != *(uint *)(param_1 + 0x58)) {

      return 0;

    }

    iVar1 = FUN_005df0f5(0x20);

    if (iVar1 == 0) {

      param_2 = 0;

    }

    else {

      param_2 = FUN_0044df50();

    }

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

    local_4 = *(int *)(param_1 + 0x4c);

    FUN_004637a0(&local_4);

    FUN_004637a0(&param_2);

  }

  FUN_0044e5d0(param_3);

  return 1;

}





// --- FUN_00446200 at 0x00446200 (size: 900) ---


void __fastcall FUN_00446200(int param_1)



{

  char cVar1;

  char cVar2;

  int iVar3;

  int iVar4;

  bool bVar5;

  int *piVar6;

  LONG LVar7;

  undefined4 *puVar8;

  int iVar9;

  undefined *local_24;

  undefined *local_20;

  undefined *puStack_1c;

  int local_18;

  uint local_14;

  uint local_10;

  int local_c;

  int iStack_8;

  int local_4;

  

  bVar5 = false;

  *(undefined1 *)(param_1 + 0x6c) = 0;

  *(undefined1 *)(param_1 + 0x6d) = 0;

  *(undefined1 *)(param_1 + 0x6f) = 0;

  *(undefined1 *)(param_1 + 0x70) = 0;

  *(undefined1 *)(param_1 + 0x6e) = 1;

  local_10 = 0;

  if (*(int *)(param_1 + 0x58) != 0) {

    do {

      iVar9 = *(int *)(*(int *)(param_1 + 0x44) +

                      *(int *)(*(int *)(param_1 + 0x50) + local_10 * 4) * 4);

      local_14 = 0;

      local_4 = iVar9;

      if (*(int *)(iVar9 + 0x14) != 0) {

        do {

          iVar3 = *(int *)(*(int *)(iVar9 + 0xc) + local_14 * 4);

          iVar4 = *(int *)(iVar3 + 0x10);

          if ((iVar4 != -1) &&

             (iVar3 = *(int *)(*(int *)(*(int *)(*(int *)(iVar3 + 0xc) + 0x38) + 8) + 4 + iVar4 * 8)

             , iVar3 != 0)) {

            local_18 = *(int *)(iVar3 + 0x50);

            cVar1 = *(char *)(local_18 + 0x9d);

            cVar2 = *(char *)(local_18 + 0x9e);

            if (bVar5) {

              if (*(char *)(param_1 + 0x6d) != cVar2) {

                local_24 = PTR_DAT_008183b4;

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

                if (*(int *)(local_24 + -4) == 1) {

                  piVar6 = (int *)FUN_00679240(&local_c,*(undefined4 *)(param_1 + 0x28));

                  if (local_24 != (undefined *)*piVar6) {

                    puVar8 = (undefined4 *)(local_24 + -0x14);

                    LVar7 = InterlockedDecrement((LONG *)(local_24 + -0x10));

                    if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                      (**(code **)*puVar8)(1);

                    }

                    local_24 = (undefined *)*piVar6;

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

                  }

                  puVar8 = (undefined4 *)(local_c + -0x14);

                  LVar7 = InterlockedDecrement((LONG *)(local_c + -0x10));

                  if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                    (**(code **)*puVar8)(1);

                  }

                  if (*(int *)(local_24 + -4) == 1) {

                    if (*(int *)(param_1 + 0x28) == DAT_00839058) {

                      FUN_00405000("Unknown");

                    }

                    else {

                      FUN_00402710(&local_24,"DataID:0x%08X",*(int *)(param_1 + 0x28));

                    }

                  }

                }

                local_20 = PTR_DAT_00818344;

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

                FUN_00402710(&local_20,

                             "Mesh [%s] is assigned to materials that contradict each other!  At least one of the materials is designed for multi-pass lighting, but another material only works with vertex lighting.  This is not allowed!"

                             ,PTR_DAT_008183b4);

                puVar8 = (undefined4 *)(local_20 + -0x14);

                LVar7 = InterlockedDecrement((LONG *)(local_20 + -0x10));

                if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                  (**(code **)*puVar8)(1);

                }

                puVar8 = (undefined4 *)(local_24 + -0x14);

                LVar7 = InterlockedDecrement((LONG *)(local_24 + -0x10));

                if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                  (**(code **)*puVar8)(1);

                }

              }

              if (((*(char *)(param_1 + 0x6d) != '\0') || (cVar2 != '\0')) &&

                 (*(char *)(param_1 + 0x6c) != cVar1)) {

                local_24 = PTR_DAT_008183b4;

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

                if (*(int *)(local_24 + -4) == 1) {

                  piVar6 = (int *)FUN_00679240(&iStack_8,*(undefined4 *)(param_1 + 0x28));

                  if (local_24 != (undefined *)*piVar6) {

                    puVar8 = (undefined4 *)(local_24 + -0x14);

                    LVar7 = InterlockedDecrement((LONG *)(local_24 + -0x10));

                    if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                      (**(code **)*puVar8)(1);

                    }

                    local_24 = (undefined *)*piVar6;

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

                  }

                  puVar8 = (undefined4 *)(iStack_8 + -0x14);

                  LVar7 = InterlockedDecrement((LONG *)(iStack_8 + -0x10));

                  if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                    (**(code **)*puVar8)(1);

                  }

                  if (*(int *)(local_24 + -4) == 1) {

                    if (*(int *)(param_1 + 0x28) == DAT_00839058) {

                      FUN_00405000("Unknown");

                    }

                    else {

                      FUN_00402710(&local_24,"DataID:0x%08X",*(int *)(param_1 + 0x28));

                    }

                  }

                }

                puStack_1c = PTR_DAT_00818344;

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

                FUN_00402710(&puStack_1c,

                             "All materials used within a mesh must be either LIT or UNLIT materials, but not BOTH.  Mesh [%s] is breaking this rule!  Also keep in mind that all meshes within an object must be either LIT or UNLIT, but not BOTH.  Note that this limitation does not apply to \'SIMPLE LIT\' materials -- those can be freely mixed with UNLIT materials within a mesh or entity."

                             ,local_24);

                puVar8 = (undefined4 *)(puStack_1c + -0x14);

                LVar7 = InterlockedDecrement((LONG *)(puStack_1c + -0x10));

                if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                  (**(code **)*puVar8)(1);

                }

                puVar8 = (undefined4 *)(local_24 + -0x14);

                LVar7 = InterlockedDecrement((LONG *)(local_24 + -0x10));

                if ((LVar7 == 0) && (puVar8 != (undefined4 *)0x0)) {

                  (**(code **)*puVar8)(1);

                }

              }

            }

            if (cVar1 != '\0') {

              *(undefined1 *)(param_1 + 0x6c) = 1;

            }

            if ((cVar2 != '\0') &&

               (*(undefined1 *)(param_1 + 0x6d) = 1, *(char *)(local_18 + 0x9f) == '\0')) {

              *(undefined1 *)(param_1 + 0x6e) = 0;

            }

            if (*(char *)(local_18 + 0xa0) != '\0') {

              *(undefined1 *)(param_1 + 0x6f) = 1;

            }

            if (*(char *)(local_18 + 0xa1) != '\0') {

              *(undefined1 *)(param_1 + 0x70) = 1;

            }

            bVar5 = true;

            iVar9 = local_4;

          }

          local_14 = local_14 + 1;

        } while (local_14 < *(uint *)(iVar9 + 0x14));

      }

      local_10 = local_10 + 1;

    } while (local_10 < *(uint *)(param_1 + 0x58));

  }

  return;

}





// --- FUN_00446590 at 0x00446590 (size: 23) ---


void FUN_00446590(void)



{

  FUN_00446200();

  FUN_00444b00();

  FUN_00444b80();

  return;

}





// --- FUN_004465b0 at 0x004465B0 (size: 34) ---


undefined1 FUN_004465b0(void)



{

  char cVar1;

  

  cVar1 = FUN_00444a30();

  if (cVar1 == '\0') {

    return 0;

  }

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    FUN_00446200();

  }

  return 1;

}





// --- FUN_004465e0 at 0x004465E0 (size: 28) ---


undefined1 FUN_004465e0(void)



{

  FUN_00446200();

  FUN_00444b00();

  FUN_00444b80();

  return 1;

}





// --- FUN_00446600 at 0x00446600 (size: 150) ---


undefined4 __thiscall

FUN_00446600(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,

            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,

            undefined4 param_9,undefined4 param_10)



{

  char cVar1;

  int iVar2;

  undefined4 *puVar3;

  

  iVar2 = FUN_005df0f5(0x34);

  if (iVar2 == 0) {

    puVar3 = (undefined4 *)0x0;

  }

  else {

    puVar3 = (undefined4 *)FUN_0044f2c0();

  }

  puVar3[3] = param_1;

  cVar1 = FUN_0044f330(param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10);

  if (cVar1 == '\0') {

    iVar2 = puVar3[1];

  }

  else {

    cVar1 = FUN_00446180(param_2,puVar3);

    iVar2 = puVar3[1];

    if (cVar1 != '\0') {

      puVar3[1] = iVar2 + -1;

      if (iVar2 + -1 == 0) {

        (**(code **)*puVar3)(1);

      }

      return 1;

    }

  }

  puVar3[1] = iVar2 + -1;

  if (iVar2 + -1 == 0) {

    (**(code **)*puVar3)(1);

  }

  return 0;

}





// --- FUN_004466a0 at 0x004466A0 (size: 44) ---


void __fastcall FUN_004466a0(undefined4 *param_1)



{

  *param_1 = &PTR_LAB_0079aa94;

  if ((param_1[0xe] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0xd]);

  }

  FUN_0040b060();

  return;

}





// --- FUN_00446770 at 0x00446770 (size: 105) ---


void __thiscall FUN_00446770(int param_1,undefined4 param_2)



{

  undefined1 *local_4c;

  uint local_48;

  undefined4 local_44;

  undefined1 local_40 [64];

  

  local_4c = local_40;

  local_48 = 8;

  local_44 = 0;

  FUN_00410a00(&local_4c);

  if ((local_48 & 0x80000000) == 0x80000000) {

    operator_delete__(local_4c);

  }

  FUN_0040b020(param_1 + 0x24,param_2);

  return;

}





// --- FUN_00446890 at 0x00446890 (size: 67) ---


undefined4 __fastcall FUN_00446890(int param_1)



{

  char cVar1;

  

  FUN_004460c0();

  if (*(int *)(param_1 + 0x58) != 0) {

    FUN_00444d90();

    FUN_00446200();

    FUN_00444b00();

    FUN_00444b80();

    cVar1 = FUN_00413a70();

    if (cVar1 == '\0') {

      FUN_00444d50();

    }

    return 1;

  }

  return 0;

}





// --- FUN_004468e0 at 0x004468E0 (size: 97) ---


undefined4 * __thiscall FUN_004468e0(undefined4 *param_1,undefined4 param_2,undefined4 param_3)



{

  *param_1 = &PTR_FUN_00793b3c;

  param_1[1] = 0;

  param_1[2] = 0;

  FUN_00406d60();

  param_1[6] = 0;

  param_1[7] = 0;

  param_1[8] = 0;

  *param_1 = &PTR_LAB_0079aa94;

  param_1[9] = &PTR_LAB_0079aa90;

  param_1[0xc] = &PTR_LAB_00795430;

  param_1[0xd] = param_1 + 0x10;

  param_1[0xe] = 8;

  param_1[0xf] = 0;

  *(undefined1 *)(param_1 + 0x20) = 1;

  FUN_00446770(param_3);

  return param_1;

}





// --- FUN_00446950 at 0x00446950 (size: 268) ---


uint __thiscall FUN_00446950(int *param_1,undefined4 param_2)



{

  char cVar1;

  int iVar2;

  uint uVar3;

  undefined4 uVar4;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined1 local_90 [8];

  undefined **ppuStack_88;

  uint local_84 [12];

  void *pvStack_54;

  uint uStack_50;

  

  iVar2 = FUN_0065ca90();

  if (iVar2 == 0) {

    uVar4 = extraout_ECX;

    FUN_00401340("Expected binary mesh data, got nothing!");

    uVar3 = FUN_0065d620(param_2,uVar4);

    return uVar3 & 0xffffff00;

  }

  FUN_00406d60();

  cVar1 = FUN_00444f00(local_90);

  if (cVar1 == '\0') {

    uVar4 = extraout_ECX_00;

    FUN_00401340("Failed retrieving binary mesh data");

    FUN_0065d620(param_2,uVar4);

    uVar3 = FUN_00406f90();

    return uVar3 & 0xffffff00;

  }

  FUN_004468e0(0,local_90);

  FUN_0040aa10(1);

  (**(code **)(*param_1 + 0x1c))(local_84);

  FUN_0065e850();

  ppuStack_88 = &PTR_LAB_0079aa94;

  if ((uStack_50 & 0x80000000) == 0x80000000) {

    operator_delete__(pvStack_54);

  }

  FUN_0040b060();

  uVar4 = FUN_00406f90();

  return CONCAT31((int3)((uint)uVar4 >> 8),~(byte)(local_84[0] >> 2)) & 0xffffff01;

}





// --- FUN_00446b90 at 0x00446B90 (size: 51) ---


undefined4 __thiscall FUN_00446b90(int param_1,int param_2)



{

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

  *(undefined1 *)(param_2 + 0x1c) = *(undefined1 *)(param_1 + 0x1c);

  *(undefined1 *)(param_2 + 0x1d) = *(undefined1 *)(param_1 + 0x1d);

  *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)(param_1 + 0x20);

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

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

  *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(param_1 + 0x18);

  return 1;

}





// --- FUN_00446bd0 at 0x00446BD0 (size: 10) ---


void __thiscall FUN_00446bd0(int param_1,undefined4 param_2)



{

  *(undefined4 *)(param_1 + 0x20) = param_2;

  return;

}





// --- FUN_00446be0 at 0x00446BE0 (size: 10) ---


void __thiscall FUN_00446be0(int param_1,undefined1 param_2)



{

  *(undefined1 *)(param_1 + 0x1c) = param_2;

  return;

}





// --- FUN_00446bf0 at 0x00446BF0 (size: 10) ---


void __thiscall FUN_00446bf0(int param_1,undefined1 param_2)



{

  *(undefined1 *)(param_1 + 0x1d) = param_2;

  return;

}





// --- FUN_00446c00 at 0x00446C00 (size: 5) ---


void __fastcall FUN_00446c00(int param_1)



{

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

  return;

}





// --- FUN_00446c10 at 0x00446C10 (size: 5) ---


void __fastcall FUN_00446c10(int param_1)



{

  *(undefined1 *)(param_1 + 8) = 1;

  return;

}





// --- FUN_00446c20 at 0x00446C20 (size: 9) ---


bool __fastcall FUN_00446c20(int param_1)



{

  return *(char *)(param_1 + 8) != '\0';

}





// --- FUN_00446c30 at 0x00446C30 (size: 52) ---


uint __thiscall FUN_00446c30(uint *param_1,uint param_2)



{

  uint uVar1;

  

  uVar1 = param_1[2];

  if (param_2 < uVar1) {

    uVar1 = uVar1 - 1;

    param_1[2] = uVar1;

    if (param_2 != uVar1) {

      *(undefined4 *)(*param_1 + param_2 * 4) = *(undefined4 *)(*param_1 + uVar1 * 4);

      uVar1 = *param_1;

      *(undefined4 *)(uVar1 + param_1[2] * 4) = 0;

    }

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

  }

  return uVar1 & 0xffffff00;

}





// --- FUN_00446c70 at 0x00446C70 (size: 93) ---


void FUN_00446c70(int param_1,int param_2,int param_3,int param_4)



{

  int iVar1;

  int iVar2;

  

  if (param_2 <= param_3) {

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

    return;

  }

  do {

    iVar2 = (param_2 + -1) / 2;

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

    if (*(double *)(param_4 + 0x10) <= *(double *)(iVar1 + 0x10)) break;

    *(int *)(param_1 + param_2 * 4) = iVar1;

    param_2 = iVar2;

  } while (param_3 < iVar2);

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

  return;

}





// --- FUN_00446cd0 at 0x00446CD0 (size: 81) ---


void FUN_00446cd0(int param_1)



{

  uint uVar1;

  int iVar2;

  uint uVar3;

  

  uVar1 = *(uint *)(param_1 + 0x24);

  if (((uVar1 != 0xffffffff) && (DAT_008398cc != 0)) && (uVar1 < DAT_008398cc)) {

    uVar3 = DAT_008398cc - 1;

    if (uVar1 < uVar3) {

      iVar2 = *(int *)(DAT_008398c4 + uVar3 * 4);

      *(int *)(DAT_008398c4 + uVar1 * 4) = iVar2;

      *(uint *)(iVar2 + 0x24) = uVar1;

    }

    *(undefined4 *)(param_1 + 0x24) = 0xffffffff;

    *(undefined4 *)(DAT_008398c4 + uVar3 * 4) = 0;

    FUN_00446c30(uVar3);

  }

  return;

}





// --- FUN_00446d30 at 0x00446D30 (size: 68) ---


undefined4 FUN_00446d30(void)



{

  int *piVar1;

  char cVar2;

  uint uVar3;

  

  uVar3 = 0;

  if (DAT_008398cc != 0) {

    do {

      piVar1 = *(int **)(DAT_008398c4 + uVar3 * 4);

      if (((piVar1 != (int *)0x0) && ((char)piVar1[2] == '\0')) &&

         (cVar2 = (**(code **)(*piVar1 + 8))(), cVar2 != '\0')) {

        *(undefined1 *)(piVar1 + 2) = 1;

        uVar3 = 0xffffffff;

      }

      uVar3 = uVar3 + 1;

    } while (uVar3 < DAT_008398cc);

  }

  return 1;

}





// --- FUN_00446d80 at 0x00446D80 (size: 64) ---


undefined4 FUN_00446d80(void)



{

  int *piVar1;

  char cVar2;

  uint uVar3;

  

  uVar3 = 0;

  if (DAT_008398cc != 0) {

    do {

      piVar1 = *(int **)(DAT_008398c4 + uVar3 * 4);

      if ((((char)piVar1[2] != '\0') && (*(char *)((int)piVar1 + 0x1d) != '\0')) &&

         (cVar2 = (**(code **)(*piVar1 + 0xc))(), cVar2 != '\0')) {

        uVar3 = 0xffffffff;

      }

      uVar3 = uVar3 + 1;

    } while (uVar3 < DAT_008398cc);

  }

  return 1;

}





// --- FUN_00446dc0 at 0x00446DC0 (size: 134) ---


void FUN_00446dc0(double param_1)



{

  int *piVar1;

  undefined4 uVar2;

  undefined4 uVar3;

  char cVar4;

  uint uVar5;

  

  uVar3 = DAT_008379b4;

  uVar2 = DAT_008379b0;

  uVar5 = 0;

  if (DAT_008398cc != 0) {

    do {

      piVar1 = *(int **)(DAT_008398c4 + uVar5 * 4);

      if (((((char)piVar1[2] == '\0') && ((char)piVar1[7] != '\0')) &&

          (piVar1[6] != *(int *)(DAT_00870340 + 0xb0))) &&

         (((piVar1[8] != 0 && (param_1 < (double)CONCAT44(uVar3,uVar2) - *(double *)(piVar1 + 4)))

          && (cVar4 = (**(code **)(*piVar1 + 8))(), cVar4 != '\0')))) {

        *(undefined1 *)(piVar1 + 2) = 1;

        uVar5 = 0xffffffff;

      }

      uVar5 = uVar5 + 1;

    } while (uVar5 < DAT_008398cc);

  }

  return;

}





// --- FUN_00446e50 at 0x00446E50 (size: 64) ---


void FUN_00446e50(int *param_1,int *param_2)



{

  int iVar1;

  int iVar2;

  int *piVar3;

  

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

    iVar1 = *param_1;

    piVar3 = param_1;

    while( true ) {

      iVar2 = piVar3[-1];

      if (*(double *)(iVar2 + 0x10) <= *(double *)(iVar1 + 0x10)) break;

      *piVar3 = iVar2;

      piVar3 = piVar3 + -1;

    }

    *piVar3 = iVar1;

  }

  return;

}





// --- FUN_00446e90 at 0x00446E90 (size: 108) ---


void FUN_00446e90(int param_1,int param_2,int param_3,undefined4 param_4,undefined4 param_5)



{

  int iVar1;

  int iVar2;

  int iVar3;

  

  iVar3 = param_2;

  while( true ) {

    iVar1 = iVar3 * 2;

    iVar2 = iVar1 + 2;

    if (param_3 <= iVar2) break;

    if (*(double *)(*(int *)(param_1 + iVar2 * 4) + 0x10) <

        *(double *)(*(int *)(param_1 + -4 + iVar2 * 4) + 0x10)) {

      iVar2 = iVar1 + 1;

    }

    *(undefined4 *)(param_1 + iVar3 * 4) = *(undefined4 *)(param_1 + iVar2 * 4);

    iVar3 = iVar2;

  }

  if (iVar2 == param_3) {

    *(undefined4 *)(param_1 + iVar3 * 4) = *(undefined4 *)(param_1 + -4 + iVar2 * 4);

    iVar3 = iVar1 + 1;

  }

  FUN_00446c70(param_1,iVar3,param_2,param_4,param_5);

  return;

}





// --- FUN_00446f00 at 0x00446F00 (size: 14) ---


void __fastcall FUN_00446f00(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_0079bf64;

  FUN_00446cd0(param_1);

  return;

}





// --- FUN_00446f10 at 0x00446F10 (size: 77) ---


int * FUN_00446f10(int *param_1,int *param_2,int param_3)



{

  int *piVar1;

  int iVar2;

  

  while( true ) {

    for (; *(double *)(*param_1 + 0x10) < *(double *)(param_3 + 0x10); param_1 = param_1 + 1) {

    }

    do {

      piVar1 = param_2 + -1;

      param_2 = param_2 + -1;

    } while (*(double *)(param_3 + 0x10) < *(double *)(*piVar1 + 0x10));

    if (param_2 <= param_1) break;

    iVar2 = *param_1;

    *param_1 = *param_2;

    *param_2 = iVar2;

    param_1 = param_1 + 1;

  }

  return param_1;

}





// --- FUN_00446f60 at 0x00446F60 (size: 83) ---


void FUN_00446f60(int param_1,int param_2,undefined4 param_3)



{

  int iVar1;

  int iVar2;

  int iVar3;

  

  iVar2 = param_2 - param_1 >> 2;

  if (1 < iVar2) {

    iVar3 = (iVar2 + -2) / 2;

    FUN_00446e90(param_1,iVar3,iVar2,*(undefined4 *)(param_1 + iVar3 * 4),param_3);

    while (iVar3 != 0) {

      iVar1 = iVar3 * 4;

      iVar3 = iVar3 + -1;

      FUN_00446e90(param_1,iVar3,iVar2,*(undefined4 *)(param_1 + -4 + iVar1),param_3);

    }

  }

  return;

}





// --- FUN_00446fc0 at 0x00446FC0 (size: 41) ---


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



{

  *param_1 = &PTR_FUN_0079bf64;

  FUN_00446cd0(param_1);

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00446ff0 at 0x00446FF0 (size: 10) ---


void FUN_00446ff0(void)



{

  FUN_0044dcb0();

  return;

}





// --- FUN_00447000 at 0x00447000 (size: 153) ---


void FUN_00447000(int *param_1,int *param_2)



{

  int iVar1;

  int *piVar2;

  int *piVar3;

  int *piVar4;

  size_t _Size;

  int *piVar5;

  

  if ((param_1 != param_2) && (piVar5 = param_1 + 1, piVar5 != param_2)) {

    _Size = (int)piVar5 - (int)param_1;

    do {

      iVar1 = *piVar5;

      if (*(double *)(*param_1 + 0x10) <= *(double *)(iVar1 + 0x10)) {

        piVar2 = (int *)((int)param_1 + (_Size - 4));

        piVar4 = piVar5;

        while (piVar3 = piVar2, *(double *)(iVar1 + 0x10) < *(double *)(*piVar3 + 0x10)) {

          *piVar4 = *piVar3;

          piVar4 = piVar3;

          piVar2 = piVar3 + -1;

        }

        *piVar4 = iVar1;

      }

      else {

        if (0 < (int)_Size) {

          memmove((void *)((int)piVar5 + (4 - _Size)),param_1,_Size);

        }

        *param_1 = iVar1;

      }

      piVar5 = piVar5 + 1;

      _Size = _Size + 4;

    } while (piVar5 != param_2);

  }

  return;

}





// --- FUN_004470a0 at 0x004470A0 (size: 77) ---


void FUN_004470a0(undefined4 *param_1,int param_2,undefined4 param_3)



{

  undefined4 uVar1;

  uint uVar2;

  

  uVar2 = param_2 - (int)param_1;

  while (4 < (int)(uVar2 & 0xfffffffc)) {

    uVar1 = *(undefined4 *)((int)param_1 + (uVar2 - 4));

    *(undefined4 *)((int)param_1 + (uVar2 - 4)) = *param_1;

    FUN_00446e90(param_1,0,(int)(uVar2 - 4) >> 2,uVar1,param_3);

    uVar2 = uVar2 - 4;

  }

  return;

}





// --- FUN_004470f0 at 0x004470F0 (size: 89) ---


void FUN_004470f0(int param_1)



{

  uint uVar1;

  char cVar2;

  undefined4 uVar3;

  

  uVar1 = DAT_008398cc;

  if ((DAT_008398c8 & 0x7fffffff) <= DAT_008398cc) {

    uVar3 = FUN_00453850((DAT_008398c8 & 0x7fffffff) + 1);

    cVar2 = FUN_004180a0(uVar3);

    if (cVar2 == '\0') {

      *(uint *)(param_1 + 0x24) = uVar1;

      return;

    }

  }

  *(int *)(DAT_008398c4 + DAT_008398cc * 4) = param_1;

  DAT_008398cc = DAT_008398cc + 1;

  *(uint *)(param_1 + 0x24) = uVar1;

  return;

}





// --- FUN_00447150 at 0x00447150 (size: 72) ---


void FUN_00447150(int param_1,int param_2,undefined4 param_3)



{

  if (0x40 < (int)(param_2 - param_1 & 0xfffffffcU)) {

    FUN_00447000(param_1,param_1 + 0x40,param_3);

    FUN_00446e50(param_1 + 0x40,param_2,0,param_3);

    return;

  }

  FUN_00447000(param_1,param_2,param_3);

  return;

}





// --- FUN_004471a0 at 0x004471A0 (size: 116) ---


void FUN_004471a0(int *param_1,int *param_2,int *param_3,undefined4 param_4,undefined4 param_5)



{

  int iVar1;

  int *piVar2;

  

  FUN_00446f60(param_1,param_2,param_5,0,0);

  for (piVar2 = param_2; piVar2 < param_3; piVar2 = piVar2 + 1) {

    iVar1 = *piVar2;

    if (*(double *)(iVar1 + 0x10) < *(double *)(*param_1 + 0x10)) {

      *piVar2 = *param_1;

      FUN_00446e90(param_1,0,(int)param_2 - (int)param_1 >> 2,iVar1,param_5);

    }

  }

  FUN_004470a0(param_1,param_2,param_5);

  return;

}





// --- FUN_00447220 at 0x00447220 (size: 88) ---


undefined4 * __fastcall FUN_00447220(undefined4 *param_1)



{

  undefined4 uVar1;

  

  param_1[4] = 0;

  param_1[5] = 0;

  *param_1 = &PTR_FUN_0079bf64;

  *(undefined1 *)(param_1 + 2) = 0;

  *(undefined1 *)(param_1 + 7) = 0;

  *(undefined1 *)((int)param_1 + 0x1d) = 0;

  param_1[8] = 0;

  param_1[6] = 0xffffffff;

  param_1[9] = 0xffffffff;

  uVar1 = DAT_008379b4;

  param_1[4] = DAT_008379b0;

  param_1[5] = uVar1;

  if (DAT_00870340 != 0) {

    param_1[6] = *(undefined4 *)(DAT_00870340 + 0xb0);

  }

  FUN_004470f0(param_1);

  return param_1;

}





// --- FUN_00447280 at 0x00447280 (size: 244) ---


void FUN_00447280(int *param_1,int param_2,undefined4 param_3,int param_4,undefined4 param_5)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  int iVar5;

  

  if (0x40 < (int)(param_2 - (int)param_1 & 0xfffffffcU)) {

    while (param_4 != 0) {

      iVar5 = *param_1;

      param_4 = param_4 + -1;

      iVar3 = (param_2 - (int)param_1 >> 2) - (param_2 - (int)param_1 >> 0x1f) >> 1;

      iVar2 = param_1[iVar3];

      piVar1 = (int *)(param_2 + -4);

      piVar4 = param_1;

      if (*(double *)(iVar2 + 0x10) <= *(double *)(iVar5 + 0x10)) {

        if ((*(double *)(*piVar1 + 0x10) <= *(double *)(iVar5 + 0x10)) &&

           (piVar4 = piVar1, *(double *)(*piVar1 + 0x10) <= *(double *)(iVar2 + 0x10)))

        goto LAB_0044731d;

      }

      else if (*(double *)(iVar2 + 0x10) < *(double *)(*piVar1 + 0x10)) {

LAB_0044731d:

        piVar4 = param_1 + iVar3;

      }

      else if (*(double *)(iVar5 + 0x10) < *(double *)(*piVar1 + 0x10)) {

        piVar4 = piVar1;

      }

      iVar5 = FUN_00446f10(param_1,param_2,*piVar4,param_5);

      FUN_00447280(iVar5,param_2,0,param_4,param_5);

      param_2 = iVar5;

      if ((int)(iVar5 - (int)param_1 & 0xfffffffcU) < 0x41) {

        return;

      }

    }

    FUN_004471a0(param_1,param_2,param_2,0,param_5);

  }

  return;

}





// --- FUN_00447380 at 0x00447380 (size: 74) ---


void FUN_00447380(int param_1,int param_2,undefined4 param_3)



{

  int iVar1;

  int iVar2;

  

  if (param_1 != param_2) {

    iVar2 = 0;

    for (iVar1 = param_2 - param_1 >> 2; iVar1 != 1; iVar1 = iVar1 >> 1) {

      iVar2 = iVar2 + 1;

    }

    FUN_00447280(param_1,param_2,0,iVar2 * 2,param_3);

    FUN_00447150(param_1,param_2,param_3);

  }

  return;

}





// --- FUN_004473d0 at 0x004473D0 (size: 187) ---


undefined4 FUN_004473d0(uint param_1)



{

  int *piVar1;

  int iVar2;

  char cVar3;

  uint uVar4;

  uint uVar5;

  

  FUN_00447380(DAT_008398c4,DAT_008398c4 + DAT_008398cc * 4,param_1);

  uVar4 = 0;

  if (DAT_008398cc != 0) {

    do {

      *(uint *)(*(int *)(DAT_008398c4 + uVar4 * 4) + 0x24) = uVar4;

      uVar4 = uVar4 + 1;

    } while (uVar4 < DAT_008398cc);

  }

  uVar4 = 0;

  uVar5 = 0;

  if (DAT_008398cc != 0) {

    do {

      piVar1 = *(int **)(DAT_008398c4 + uVar5 * 4);

      if (((((char)piVar1[7] != '\0') && ((char)piVar1[2] == '\0')) &&

          (iVar2 = piVar1[8], iVar2 != 0)) &&

         ((piVar1[6] != *(int *)(DAT_00870340 + 0xb0) &&

          (cVar3 = (**(code **)(*piVar1 + 8))(), cVar3 != '\0')))) {

        uVar4 = uVar4 + iVar2;

        *(undefined1 *)(piVar1 + 2) = 1;

        if (param_1 <= uVar4) {

          return 1;

        }

        uVar5 = 0xffffffff;

      }

      uVar5 = uVar5 + 1;

    } while (uVar5 < DAT_008398cc);

  }

  if (param_1 <= uVar4) {

    return 1;

  }

  return 0;

}





// --- FUN_00447490 at 0x00447490 (size: 80) ---


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



void __fastcall FUN_00447490(float *param_1)



{

  if (_DAT_007938b0 < param_1[3]) {

    param_1[3] = 1.0;

  }

  if (_DAT_007938b0 < *param_1) {

    *param_1 = 1.0;

  }

  if (_DAT_007938b0 < param_1[1]) {

    param_1[1] = 1.0;

  }

  if (_DAT_007938b0 < param_1[2]) {

    param_1[2] = 1.0;

  }

  return;

}





// --- FUN_004474e0 at 0x004474E0 (size: 58) ---


void __fastcall FUN_004474e0(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  undefined4 *puVar3;

  

  *(undefined1 *)(param_1 + 0xb0) = 0;

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

  *(undefined1 *)(param_1 + 300) = 0;

  *(undefined1 *)(param_1 + 0x12d) = 1;

  puVar2 = &DAT_008ef180;

  puVar3 = (undefined4 *)(param_1 + 0x130);

  for (iVar1 = 6; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar3 = *puVar2;

    puVar2 = puVar2 + 1;

    puVar3 = puVar3 + 1;

  }

  *(undefined1 *)(param_1 + 0x148) = 0;

  return;

}





// --- FUN_00447520 at 0x00447520 (size: 34) ---


void __fastcall FUN_00447520(int param_1)



{

  if (*(void **)(param_1 + 0x128) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 0x128));

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

  }

  return;

}





// --- FUN_00447550 at 0x00447550 (size: 193) ---


undefined4 __thiscall

FUN_00447550(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5

            ,uint param_6)



{

  uint *puVar1;

  char cVar2;

  uint uVar3;

  int iVar4;

  undefined4 *puVar5;

  undefined4 *puVar6;

  

  cVar2 = FUN_005d83c0(param_2,param_3,param_4,param_5,param_6);

  if (cVar2 == '\0') {

    return 0;

  }

  *(bool *)(param_1 + 0xb0) = (char)param_4 == '\0';

  uVar3 = *(uint *)(param_1 + 8) & 0x52;

  puVar1 = (uint *)(param_1 + 0xb4);

  *puVar1 = uVar3;

  if (*(char *)(param_1 + 0x86) == '\0') {

    *puVar1 = *(uint *)(param_1 + 8) & 0xf52;

  }

  else if (*(int *)(param_1 + 0x1c) != 0) {

    *puVar1 = uVar3 | 0x100;

  }

  *puVar1 = *puVar1 & param_6;

  FUN_005d97f0();

  if (*(char *)(param_1 + 0xb0) != '\0') {

    iVar4 = thunk_FUN_005df0f5(*(int *)(param_1 + 0xb8) * *(int *)(param_1 + 0x7c));

    *(int *)(param_1 + 0x128) = iVar4;

    if (iVar4 == 0) {

      return 0;

    }

  }

  puVar5 = &DAT_008ef180;

  puVar6 = (undefined4 *)(param_1 + 0x130);

  for (iVar4 = 6; iVar4 != 0; iVar4 = iVar4 + -1) {

    *puVar6 = *puVar5;

    puVar5 = puVar5 + 1;

    puVar6 = puVar6 + 1;

  }

  *(undefined1 *)(param_1 + 0x148) = 0;

  return 1;

}





// --- FUN_00447620 at 0x00447620 (size: 94) ---


void __fastcall FUN_00447620(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  undefined4 *puVar3;

  

  if (*(void **)(param_1 + 0x128) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 0x128));

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

  }

  FUN_005d86d0();

  *(undefined1 *)(param_1 + 0xb0) = 0;

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

  *(undefined1 *)(param_1 + 300) = 0;

  *(undefined1 *)(param_1 + 0x12d) = 1;

  puVar2 = &DAT_008ef180;

  puVar3 = (undefined4 *)(param_1 + 0x130);

  for (iVar1 = 6; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar3 = *puVar2;

    puVar2 = puVar2 + 1;

    puVar3 = puVar3 + 1;

  }

  *(undefined1 *)(param_1 + 0x148) = 0;

  return;

}





// --- FUN_004476d0 at 0x004476D0 (size: 962) ---


void FUN_004476d0(undefined4 *param_1,uint *param_2,undefined4 *param_3,uint *param_4,int param_5,

                 char param_6)



{

  undefined4 uVar1;

  undefined4 uVar2;

  bool bVar3;

  bool bVar4;

  bool bVar5;

  bool bVar6;

  bool bVar7;

  bool bVar8;

  uint uVar9;

  uint uVar10;

  int iVar11;

  undefined4 *puVar12;

  uint *puVar13;

  uint uVar14;

  uint uVar15;

  undefined4 *puVar16;

  uint local_14;

  uint local_10;

  int local_8;

  

  uVar10 = *param_2;

  uVar9 = *param_4;

  if ((uVar10 == uVar9) && (param_6 == '\0')) {

    uVar10 = param_4[1];

    for (uVar9 = uVar10 * param_5 >> 2; uVar9 != 0; uVar9 = uVar9 - 1) {

      *param_3 = *param_1;

      param_1 = param_1 + 1;

      param_3 = param_3 + 1;

    }

    for (uVar10 = uVar10 * param_5 & 3; uVar10 != 0; uVar10 = uVar10 - 1) {

      *(undefined1 *)param_3 = *(undefined1 *)param_1;

      param_1 = (undefined4 *)((int)param_1 + 1);

      param_3 = (undefined4 *)((int)param_3 + 1);

    }

    return;

  }

  uVar14 = param_4[5];

  if (param_2[5] < param_4[5]) {

    uVar14 = param_2[5];

  }

  uVar15 = param_4[4];

  if (param_2[4] < param_4[4]) {

    uVar15 = param_2[4];

  }

  if (((uVar9 & 0x10) == 0) || (bVar3 = true, (uVar10 & 0x10) == 0)) {

    bVar3 = false;

  }

  if (((uVar9 & 0x20) == 0) || (bVar4 = true, (uVar10 & 0x20) == 0)) {

    bVar4 = false;

  }

  if (((uVar9 & 0x40) == 0) || (bVar5 = true, (uVar10 & 0x40) == 0)) {

    bVar5 = false;

  }

  if ((-1 < (char)uVar9) || (bVar6 = true, -1 < (char)uVar10)) {

    bVar6 = false;

  }

  if (((uVar9 & 0x10000000) == 0) || (bVar7 = true, (uVar10 & 0x10000000) == 0)) {

    bVar7 = false;

  }

  if (((uVar9 & 0x20000000) == 0) || (bVar8 = true, (uVar10 & 0x20000000) == 0)) {

    bVar8 = false;

  }

  if (param_5 != 0) {

    local_8 = param_5;

    do {

      if (param_6 == '\0') {

        *param_3 = *param_1;

        param_3[1] = param_1[1];

        param_3[2] = param_1[2];

      }

      else {

        *param_3 = *param_1;

        uVar1 = param_1[1];

        param_3[1] = uVar1;

        uVar2 = param_1[2];

        param_3[2] = uVar1;

        param_3[1] = uVar2;

      }

      if (uVar15 != 0) {

        local_14 = 0;

        uVar10 = 0;

        if (3 < (int)uVar15) {

          local_10 = 3;

          iVar11 = 8;

          do {

            *(undefined4 *)(param_4[8] + iVar11 + -8 + (int)param_3) =

                 *(undefined4 *)((int)param_1 + param_2[8] + iVar11 + -8);

            *(undefined4 *)((int)param_3 + param_4[8] + iVar11 + -4) =

                 *(undefined4 *)((int)param_1 + param_2[8] + iVar11 + -4);

            *(undefined4 *)((int)param_3 + param_4[8] + iVar11) =

                 *(undefined4 *)((int)param_1 + param_2[8] + iVar11);

            *(undefined4 *)((int)param_3 + param_4[8] + iVar11 + 4) =

                 *(undefined4 *)((int)param_1 + param_2[8] + iVar11 + 4);

            local_10 = local_10 + 4;

            local_14 = local_14 + 4;

            iVar11 = iVar11 + 0x10;

            uVar10 = local_14;

          } while (local_10 < uVar15);

        }

        for (; uVar10 < uVar15; uVar10 = uVar10 + 1) {

          *(undefined4 *)(param_4[8] + uVar10 * 4 + (int)param_3) =

               *(undefined4 *)((int)param_1 + param_2[8] + uVar10 * 4);

        }

      }

      if (bVar3) {

        if (param_6 == '\0') {

          puVar12 = (undefined4 *)(param_2[0xd] + (int)param_1);

          puVar16 = (undefined4 *)(param_4[0xd] + (int)param_3);

          *puVar16 = *puVar12;

          puVar16[1] = puVar12[1];

          puVar16[2] = puVar12[2];

        }

        else {

          uVar10 = param_2[0xd];

          puVar12 = (undefined4 *)(param_4[0xd] + (int)param_3);

          *puVar12 = *(undefined4 *)(uVar10 + (int)param_1);

          uVar1 = *(undefined4 *)((int)param_1 + uVar10 + 4);

          puVar12[1] = uVar1;

          uVar2 = *(undefined4 *)((int)param_1 + uVar10 + 8);

          puVar12[2] = uVar1;

          puVar12[1] = uVar2;

        }

      }

      if (bVar4) {

        *(undefined4 *)((int)param_3 + param_4[0xe]) = *(undefined4 *)((int)param_1 + param_2[0xe]);

      }

      if (bVar5) {

        *(undefined4 *)((int)param_3 + param_4[0xf]) = *(undefined4 *)((int)param_1 + param_2[0xf]);

      }

      if (bVar6) {

        *(undefined4 *)((int)param_3 + param_4[0x10]) =

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

      }

      if ((uVar14 != 0) && (uVar14 != 0)) {

        puVar13 = param_4 + 0x11;

        local_14 = uVar14;

        do {

          iVar11 = *(int *)(((int)param_2 - (int)param_4) + (int)puVar13);

          uVar10 = *puVar13;

          *(undefined4 *)(uVar10 + (int)param_3) = *(undefined4 *)(iVar11 + (int)param_1);

          *(undefined4 *)(uVar10 + 4 + (int)param_3) = *(undefined4 *)(iVar11 + 4 + (int)param_1);

          puVar13 = puVar13 + 1;

          local_14 = local_14 - 1;

        } while (local_14 != 0);

      }

      if (bVar7) {

        if (param_6 == '\0') {

          puVar12 = (undefined4 *)(param_2[0x19] + (int)param_1);

          puVar16 = (undefined4 *)(param_4[0x19] + (int)param_3);

          *puVar16 = *puVar12;

          puVar16[1] = puVar12[1];

          puVar16[2] = puVar12[2];

        }

        else {

          uVar10 = param_2[0x19];

          puVar12 = (undefined4 *)(param_4[0x19] + (int)param_3);

          *puVar12 = *(undefined4 *)(uVar10 + (int)param_1);

          uVar1 = *(undefined4 *)((int)param_1 + uVar10 + 4);

          puVar12[1] = uVar1;

          uVar2 = *(undefined4 *)((int)param_1 + uVar10 + 8);

          puVar12[2] = uVar1;

          puVar12[1] = uVar2;

        }

      }

      if (bVar8) {

        if (param_6 == '\0') {

          puVar12 = (undefined4 *)(param_2[0x1a] + (int)param_1);

          puVar16 = (undefined4 *)(param_4[0x1a] + (int)param_3);

          *puVar16 = *puVar12;

          puVar16[1] = puVar12[1];

          puVar16[2] = puVar12[2];

        }

        else {

          uVar10 = param_2[0x1a];

          puVar12 = (undefined4 *)(param_4[0x1a] + (int)param_3);

          *puVar12 = *(undefined4 *)(uVar10 + (int)param_1);

          uVar1 = *(undefined4 *)((int)param_1 + uVar10 + 4);

          puVar12[1] = uVar1;

          uVar2 = *(undefined4 *)((int)param_1 + uVar10 + 8);

          puVar12[2] = uVar1;

          puVar12[1] = uVar2;

        }

      }

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

      param_3 = (undefined4 *)((int)param_3 + param_4[1]);

      local_8 = local_8 + -1;

    } while (local_8 != 0);

  }

  return;

}





// --- FUN_00447aa0 at 0x00447AA0 (size: 300) ---


uint __thiscall

FUN_00447aa0(int *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,

            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,int param_9,

            int param_10,int param_11,int param_12,undefined4 param_13,undefined4 param_14,

            undefined4 param_15,undefined4 param_16,undefined4 param_17,undefined4 param_18)



{

  int iVar1;

  float fVar2;

  byte bVar3;

  char cVar4;

  uint uVar5;

  ushort uVar6;

  undefined1 local_5;

  uint local_4;

  

  fVar2 = *(float *)(param_12 + 0xc);

  uVar6 = (ushort)(fVar2 < DAT_00796344) << 8 | (ushort)(NAN(fVar2) || NAN(DAT_00796344)) << 10 |

          (ushort)(fVar2 == DAT_00796344) << 0xe;

  if (fVar2 != DAT_00796344) {

    fVar2 = *(float *)(param_10 + 0xa4);

    uVar6 = (ushort)(fVar2 < DAT_00796344) << 8 | (ushort)(NAN(fVar2) || NAN(DAT_00796344)) << 10 |

            (ushort)(fVar2 == DAT_00796344) << 0xe;

    if (fVar2 != DAT_00796344) {

      local_5 = 0;

      local_4 = 0;

      do {

        iVar1 = local_4 + (DAT_0083841c + 0x38 + param_11 * 8) * 3;

        bVar3 = *(byte *)(iVar1 + param_10);

        uVar5 = CONCAT31((int3)((uint)iVar1 >> 8),bVar3);

        if (bVar3 == 0xff) break;

        iVar1 = *(int *)((uint)bVar3 * 4 + *(int *)(param_10 + 0x78));

        fVar2 = *(float *)(iVar1 + 0x88);

        uVar5 = (uint)(ushort)((ushort)(fVar2 < DAT_00796344) << 8 |

                               (ushort)(NAN(fVar2) || NAN(DAT_00796344)) << 10 |

                              (ushort)(fVar2 == DAT_00796344) << 0xe);

        if (fVar2 == DAT_00796344) break;

        FUN_005a1d80(*(undefined4 *)(*(int *)(param_9 + 0x78) + (uint)bVar3 * 4),iVar1,param_1[0x2d]

                     ,param_12,param_13,param_14);

        cVar4 = (**(code **)(*param_1 + 0x14))

                          (param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_15,param_16

                           ,param_17,param_18);

        if (cVar4 != '\0') {

          local_5 = 1;

        }

        uVar5 = local_4 + 1;

        local_4 = uVar5;

      } while (uVar5 < 3);

      return CONCAT31((int3)(uVar5 >> 8),local_5);

    }

  }

  return (uint)uVar6;

}





// --- FUN_00447be0 at 0x00447BE0 (size: 266) ---


uint __thiscall

FUN_00447be0(int *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,int param_5,

            int param_6,int param_7,int param_8,undefined4 param_9,undefined4 param_10,

            undefined4 param_11)



{

  int iVar1;

  float fVar2;

  byte bVar3;

  char cVar4;

  uint uVar5;

  ushort uVar6;

  undefined1 local_5;

  uint local_4;

  

  fVar2 = *(float *)(param_8 + 0xc);

  uVar6 = (ushort)(fVar2 < DAT_00796344) << 8 | (ushort)(NAN(fVar2) || NAN(DAT_00796344)) << 10 |

          (ushort)(fVar2 == DAT_00796344) << 0xe;

  if (fVar2 != DAT_00796344) {

    fVar2 = *(float *)(param_6 + 0xa4);

    uVar6 = (ushort)(fVar2 < DAT_00796344) << 8 | (ushort)(NAN(fVar2) || NAN(DAT_00796344)) << 10 |

            (ushort)(fVar2 == DAT_00796344) << 0xe;

    if (fVar2 != DAT_00796344) {

      local_5 = 0;

      local_4 = 0;

      do {

        iVar1 = local_4 + (DAT_0083841c + 0x38 + param_7 * 8) * 3;

        bVar3 = *(byte *)(iVar1 + param_6);

        uVar5 = CONCAT31((int3)((uint)iVar1 >> 8),bVar3);

        if (bVar3 == 0xff) break;

        iVar1 = *(int *)((uint)bVar3 * 4 + *(int *)(param_6 + 0x78));

        fVar2 = *(float *)(iVar1 + 0x88);

        uVar5 = (uint)(ushort)((ushort)(fVar2 < DAT_00796344) << 8 |

                               (ushort)(NAN(fVar2) || NAN(DAT_00796344)) << 10 |

                              (ushort)(fVar2 == DAT_00796344) << 0xe);

        if (fVar2 == DAT_00796344) break;

        FUN_005a1d80(*(undefined4 *)(*(int *)(param_5 + 0x78) + (uint)bVar3 * 4),iVar1,param_1[0x2d]

                     ,param_8,param_9,0);

        cVar4 = (**(code **)(*param_1 + 0x18))(param_2,param_3,param_4,param_10,param_11);

        if (cVar4 != '\0') {

          local_5 = 1;

        }

        uVar5 = local_4 + 1;

        local_4 = uVar5;

      } while (uVar5 < 3);

      return CONCAT31((int3)(uVar5 >> 8),local_5);

    }

  }

  return (uint)uVar6;

}





// --- FUN_00447cf0 at 0x00447CF0 (size: 55) ---


void __fastcall FUN_00447cf0(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_0079bfe8;

  FUN_005d86a0();

  if ((param_1[0x29] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x28]);

  }

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_00447d30 at 0x00447D30 (size: 75) ---


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



{

  *param_1 = &PTR_FUN_0079bfe8;

  FUN_005d86a0();

  if ((param_1[0x29] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x28]);

  }

  *param_1 = &PTR_LAB_00796c4c;

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00447d80 at 0x00447D80 (size: 108) ---


undefined4 * __fastcall FUN_00447d80(undefined4 *param_1)



{

  int iVar1;

  undefined4 *puVar2;

  undefined4 *puVar3;

  

  param_1[1] = 1;

  *param_1 = &PTR_FUN_0079bfe8;

  param_1[0x28] = 0;

  param_1[0x29] = 0;

  param_1[0x2a] = 0;

  FUN_005d8650();

  *(undefined1 *)(param_1 + 0x2c) = 0;

  param_1[0x4a] = 0;

  *(undefined1 *)(param_1 + 0x4b) = 0;

  *param_1 = &PTR_FUN_0079bffc;

  *(undefined1 *)((int)param_1 + 0x12d) = 1;

  puVar2 = &DAT_008ef180;

  puVar3 = param_1 + 0x4c;

  for (iVar1 = 6; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar3 = *puVar2;

    puVar2 = puVar2 + 1;

    puVar3 = puVar3 + 1;

  }

  *(undefined1 *)(param_1 + 0x52) = 0;

  return param_1;

}





// --- FUN_00447e10 at 0x00447E10 (size: 43) ---


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



{

  *param_1 = &PTR_FUN_0079bffc;

  FUN_00447520();

  FUN_00447cf0();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_00447e40 at 0x00447E40 (size: 47) ---


undefined4 FUN_00447e40(void)



{

  undefined4 uVar1;

  int iVar2;

  

  if (DAT_0086734c != 0) {

                    /* WARNING: Could not recover jumptable at 0x00447e51. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    uVar1 = (**(code **)(*DAT_00870340 + 0x1c))();

    return uVar1;

  }

  iVar2 = FUN_005df0f5(0x14c);

  if (iVar2 != 0) {

    uVar1 = FUN_00447d80();

    return uVar1;

  }

  return 0;

}





// --- FUN_00447e70 at 0x00447E70 (size: 111) ---


void __fastcall FUN_00447e70(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  undefined4 *puVar3;

  

  if ((*(char *)(param_1 + 0xb0) != '\0') && (*(char *)(param_1 + 0x12d) != '\0')) {

    FUN_004476d0(*(undefined4 *)(param_1 + 0x80),param_1 + 8,*(undefined4 *)(param_1 + 0x128),

                 param_1 + 0xb4,*(undefined4 *)(param_1 + 0x7c),*(char *)(param_1 + 0xac) == '\0');

    puVar2 = (undefined4 *)(param_1 + 0x88);

    puVar3 = (undefined4 *)(param_1 + 0x130);

    for (iVar1 = 6; iVar1 != 0; iVar1 = iVar1 + -1) {

      *puVar3 = *puVar2;

      puVar2 = puVar2 + 1;

      puVar3 = puVar3 + 1;

    }

    *(undefined1 *)(param_1 + 0x148) = 1;

    *(undefined1 *)(param_1 + 0x12d) = 0;

  }

  return;

}





// --- FUN_00447f60 at 0x00447F60 (size: 15) ---


undefined1 __fastcall FUN_00447f60(int param_1)



{

  FUN_0054d2e0(param_1 + 0xc);

  return 1;

}





// --- FUN_00447f70 at 0x00447F70 (size: 200) ---


void __fastcall FUN_00447f70(int *param_1)



{

  undefined *puVar1;

  LONG LVar2;

  LONG *pLVar3;

  

  puVar1 = (undefined *)*param_1;

  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[1];

  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[1] = (int)PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

  }

  param_1[2] = DAT_00839a7c;

  param_1[5] = 1;

  param_1[6] = 1;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[0xc] = 0;

  param_1[0xf] = 0;

  param_1[0x10] = 0;

  *(undefined1 *)(param_1 + 0x11) = 0;

  param_1[7] = 2;

  param_1[8] = 2;

  param_1[9] = 2;

  param_1[10] = 3;

  param_1[0xb] = 2;

  param_1[0xd] = 3;

  param_1[0xe] = 2;

  return;

}





// --- FUN_00448040 at 0x00448040 (size: 251) ---


undefined4 __thiscall FUN_00448040(int *param_1,char param_2,int *param_3)



{

  int iVar1;

  LONG LVar2;

  

  if (param_2 == '\0') {

    iVar1 = *param_3;

    if (iVar1 != *param_1) {

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

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

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

      }

      iVar1 = *param_1;

      *param_3 = iVar1;

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

    }

    iVar1 = param_3[1];

    if (iVar1 != param_1[1]) {

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

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

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

      }

      iVar1 = param_1[1];

      param_3[1] = iVar1;

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

    }

  }

  param_3[2] = param_1[2];

  param_3[3] = 0;

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

    (**(code **)(*(int *)param_1[3] + 0x10))();

    iVar1 = param_1[3];

    param_3[3] = iVar1;

    FUN_00695670(iVar1);

  }

  param_3[4] = param_1[4];

  param_3[5] = param_1[5];

  param_3[6] = param_1[6];

  param_3[7] = param_1[7];

  param_3[8] = param_1[8];

  param_3[9] = param_1[9];

  param_3[10] = param_1[10];

  param_3[0xb] = param_1[0xb];

  param_3[0xc] = param_1[0xc];

  param_3[0xd] = param_1[0xd];

  param_3[0xe] = param_1[0xe];

  param_3[0xf] = param_1[0xf];

  iVar1 = param_1[0x10];

  param_3[0x10] = iVar1;

  *(char *)(param_3 + 0x11) = (char)param_1[0x11];

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

}





// --- FUN_00448140 at 0x00448140 (size: 180) ---


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



{

  LONG LVar1;

  undefined4 uVar2;

  int iVar3;

  

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

  if (iVar3 != *param_2) {

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

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

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

    }

    iVar3 = *param_2;

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

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

  }

  if ((*(int *)(param_1 + 8) != param_3) ||

     ((*(int *)(param_1 + 8) != DAT_00839a7c && (*(int *)(param_1 + 0xc) == 0)))) {

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

    iVar3 = 0;

    if (param_3 != DAT_00839a7c) {

      uVar2 = FUN_004220b0(param_3,0x1e);

      iVar3 = FUN_00415430(uVar2);

      if (iVar3 == 0) {

        return 0;

      }

      FUN_00695670(iVar3);

    }

    FUN_0054d2e0((int *)(param_1 + 0xc));

    if (iVar3 != 0) {

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

    }

  }

  return 1;

}





// --- FUN_00448200 at 0x00448200 (size: 134) ---


undefined4 __thiscall FUN_00448200(int param_1,int *param_2)



{

  undefined *puVar1;

  LONG LVar2;

  LONG *lpAddend;

  

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

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

  }

  else {

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

    FUN_00695670(param_2);

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

  }

  FUN_0054d2e0((undefined4 *)(param_1 + 0xc));

  puVar1 = *(undefined **)(param_1 + 4);

  if (puVar1 != PTR_DAT_00818344) {

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

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

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

    }

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

    *(undefined **)(param_1 + 4) = PTR_DAT_00818344;

    InterlockedIncrement(lpAddend);

  }

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

  return 1;

}





// --- FUN_00448290 at 0x00448290 (size: 180) ---


undefined1 __thiscall FUN_00448290(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 == 1) {

      *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_00798108;

    }

    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_00448350 at 0x00448350 (size: 54) ---


undefined4 * __fastcall FUN_00448350(undefined4 *param_1)



{

  LONG *pLVar1;

  

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

  *param_1 = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

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

  param_1[1] = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  FUN_00447f70();

  return param_1;

}





// --- FUN_00448390 at 0x00448390 (size: 89) ---


void __fastcall FUN_00448390(int *param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  FUN_0054d2e0(param_1 + 3);

  FUN_00447f70();

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

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

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

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

  }

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

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

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

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

  }

  return;

}





// --- FUN_004483f0 at 0x004483F0 (size: 98) ---


uint FUN_004483f0(undefined4 param_1)



{

  char cVar1;

  undefined4 *puVar2;

  LONG *pLVar3;

  

  puVar2 = (undefined4 *)FUN_005df0f5(0x48);

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

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

    *puVar2 = PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

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

    puVar2[1] = PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

    FUN_00447f70();

    cVar1 = FUN_00448040(param_1,puVar2);

    return -(uint)(cVar1 != '\0') & (uint)puVar2;

  }

  return 0;

}





// --- FUN_00448460 at 0x00448460 (size: 120) ---


undefined4 __fastcall FUN_00448460(int param_1)



{

  undefined4 *puVar1;

  int iVar2;

  char cVar3;

  LONG LVar4;

  int local_4;

  

  if (*(int *)(param_1 + 8) != DAT_00839a7c) {

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

    local_4 = iVar2;

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

    cVar3 = FUN_00448140(&local_4,*(undefined4 *)(param_1 + 8));

    puVar1 = (undefined4 *)(iVar2 + -0x14);

    if (cVar3 == '\0') {

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

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

        (**(code **)*puVar1)(1);

      }

      return 0;

    }

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

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

      (**(code **)*puVar1)(1);

    }

  }

  return 1;

}





// --- FUN_004484e0 at 0x004484E0 (size: 673) ---


void __thiscall FUN_004484e0(int param_1,int param_2)



{

  undefined4 *puVar1;

  byte *pbVar2;

  byte bVar3;

  

  FUN_00402400(param_2);

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

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

    }

    else {

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

    }

  }

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

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

    }

    else {

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

    }

  }

  bVar3 = *(byte *)(param_1 + 0x14);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x14) = (uint)bVar3;

  }

  bVar3 = *(byte *)(param_1 + 0x18);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x18) = (uint)bVar3;

  }

  bVar3 = *(byte *)(param_1 + 0x1c);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x1c) = (uint)bVar3;

  }

  bVar3 = *(byte *)(param_1 + 0x20);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x20) = (uint)bVar3;

  }

  bVar3 = *(byte *)(param_1 + 0x24);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x24) = (uint)bVar3;

  }

  bVar3 = *(byte *)(param_1 + 0x28);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x28) = (uint)bVar3;

  }

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

      *(undefined4 *)(param_1 + 0x2c) = *puVar1;

    }

    else {

      *puVar1 = *(undefined4 *)(param_1 + 0x2c);

    }

  }

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

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

    }

    else {

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

    }

  }

  bVar3 = *(byte *)(param_1 + 0x34);

  FUN_0040ad10(1);

  pbVar2 = (byte *)FUN_0040acf0(1);

  if (pbVar2 != (byte *)0x0) {

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

      bVar3 = *pbVar2;

    }

    else {

      *pbVar2 = bVar3;

    }

  }

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

    *(uint *)(param_1 + 0x34) = (uint)bVar3;

  }

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

      *(undefined4 *)(param_1 + 0x38) = *puVar1;

    }

    else {

      *puVar1 = *(undefined4 *)(param_1 + 0x38);

    }

  }

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

      *(undefined4 *)(param_1 + 0x3c) = *puVar1;

    }

    else {

      *puVar1 = *(undefined4 *)(param_1 + 0x3c);

    }

  }

  FUN_0040ad10(4);

  puVar1 = (undefined4 *)FUN_0040acf0(4);

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

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

      *puVar1 = *(undefined4 *)(param_1 + 0x40);

      FUN_00422250(param_1 + 0x44,param_2);

      return;

    }

    *(undefined4 *)(param_1 + 0x40) = *puVar1;

  }

  FUN_00422250(param_1 + 0x44,param_2);

  return;

}





// --- FUN_00448790 at 0x00448790 (size: 124) ---


undefined4 FUN_00448790(void)



{

  char cVar1;

  undefined2 *puVar2;

  

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

    (**(code **)*DAT_0083a18c)(1);

  }

  DAT_0083a18c = (int *)0x0;

  DAT_0083a18c = (int *)FUN_0054d2a0();

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

    cVar1 = (**(code **)(*DAT_0083a18c + 4))(6,2,1,1,1);

    if (cVar1 != '\0') {

      puVar2 = (undefined2 *)FUN_0044cb70();

      *puVar2 = 0;

      puVar2[1] = 2;

      puVar2[2] = 1;

      puVar2[3] = 1;

      puVar2[4] = 2;

      puVar2[5] = 3;

      FUN_0044cb80();

      return 1;

    }

  }

  return 0;

}





// --- FUN_00448810 at 0x00448810 (size: 11) ---


bool FUN_00448810(void)



{

  char cVar1;

  

  cVar1 = FUN_00448790();

  return cVar1 != '\0';

}





// --- FUN_00448820 at 0x00448820 (size: 64) ---


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



{

  *param_1 = &PTR_FUN_0079c09c;

  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_00448860 at 0x00448860 (size: 52) ---


undefined4 __thiscall FUN_00448860(int param_1,uint *param_2)



{

  uint *puVar1;

  bool bVar2;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 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_004488a0 at 0x004488A0 (size: 110) ---


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



void FUN_004488a0(void)



{

  int iVar1;

  

  iVar1 = 0;

  DAT_0083a190 = 1;

  _DAT_0083a194 = 0;

  if (DAT_0083a334 != 0) {

    if (DAT_0083a338 == 0) {

      iVar1 = 0;

    }

    else {

      iVar1 = DAT_0083a338 + -8;

    }

  }

  for (; iVar1 != 0; iVar1 = *(int *)(iVar1 + 8) + -8) {

    if ((char)(*(int **)(iVar1 + 0x10))[2] != '\0') {

      (**(code **)(**(int **)(iVar1 + 0x10) + 4))();

    }

    if (*(int *)(iVar1 + 8) == 0) break;

  }

  FUN_00695670();

  DAT_0083a190 = 0;

  return;

}





// --- FUN_00448910 at 0x00448910 (size: 346) ---


void FUN_00448910(uint *param_1,uint *param_2,int *param_3,int *param_4)



{

  int iVar1;

  int iVar2;

  uint uVar3;

  uint uVar4;

  uint uVar5;

  uint uVar6;

  uint uVar7;

  

  *param_1 = 0;

  *param_2 = 0;

  iVar2 = FUN_0054fd20();

  *param_3 = iVar2;

  iVar2 = FUN_0054fd30();

  *param_4 = iVar2;

  uVar5 = 0;

  iVar2 = FUN_0054fd20();

  uVar7 = iVar2 - 1;

  uVar4 = 0;

  iVar2 = FUN_0054fd30();

  uVar6 = iVar2 - 1;

  iVar2 = 0;

  if (DAT_0083a334 != 0) {

    if (DAT_0083a338 == 0) {

      iVar2 = 0;

    }

    else {

      iVar2 = DAT_0083a338 + -8;

    }

  }

  for (; iVar2 != 0; iVar2 = *(int *)(iVar2 + 8) + -8) {

    iVar1 = *(int *)(iVar2 + 0x10);

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

      switch(*(undefined4 *)(iVar1 + 0xc)) {

      case 1:

        uVar3 = *(int *)(iVar1 + 0x2c) + *(int *)(iVar1 + 0x24);

        if (uVar4 < uVar3) {

          uVar4 = uVar3;

        }

        break;

      case 2:

        uVar3 = *(int *)(iVar1 + 0x24) - 1;

        if (uVar3 < uVar6) {

          uVar6 = uVar3;

        }

        break;

      case 3:

        uVar3 = *(int *)(iVar1 + 0x28) + *(int *)(iVar1 + 0x20);

        if (uVar5 < uVar3) {

          uVar5 = uVar3;

        }

        break;

      case 4:

        uVar3 = *(int *)(iVar1 + 0x20) - 1;

        if (uVar3 < uVar7) {

          uVar7 = uVar3;

        }

      }

    }

    if (*(int *)(iVar2 + 8) == 0) break;

  }

  iVar2 = FUN_0054fd20();

  if (iVar2 - 2U <= uVar5) {

    iVar2 = FUN_0054fd20();

    uVar5 = iVar2 - 2;

  }

  iVar2 = FUN_0054fd30();

  if (iVar2 - 2U <= uVar4) {

    iVar2 = FUN_0054fd30();

    uVar4 = iVar2 - 2;

  }

  if (uVar7 <= uVar5) {

    uVar7 = uVar5 + 1;

  }

  if (uVar6 <= uVar4) {

    uVar6 = uVar4 + 1;

  }

  *param_1 = uVar5;

  *param_2 = uVar4;

  *param_3 = (uVar7 - uVar5) + 1;

  *param_4 = (uVar6 - uVar4) + 1;

  return;

}





// --- FUN_00448a80 at 0x00448A80 (size: 143) ---


undefined4 * __thiscall FUN_00448a80(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_0079c09c;

  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_00448b10 at 0x00448B10 (size: 202) ---


uint __thiscall FUN_00448b10(int param_1,uint param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int iVar4;

  int *piVar5;

  

  if (param_2 == *(uint *)(param_1 + 0x68)) {

    return param_2 & 0xffffff00;

  }

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

  iVar1 = 0;

  do {

    if (iVar3 == 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);

      while (iVar1 != 0) {

        iVar3 = *(int *)(iVar1 + 4);

        FUN_00448c90(iVar1);

        iVar1 = iVar3;

      }

      return 1;

    }

    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);

        iVar4 = *piVar5;

        goto LAB_00448b5e;

      }

      piVar5 = *(int **)(param_1 + 100) + 1;

      *(int **)(param_1 + 100) = piVar5;

    }

    piVar5 = (int *)0x0;

    iVar4 = 0;

LAB_00448b5e:

    iVar3 = *piVar5;

    if (iVar3 == iVar4) {

LAB_00448b71:

      *piVar5 = *(int *)(iVar3 + 4);

    }

    else {

      do {

        iVar2 = iVar3;

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

      } while (iVar3 != iVar4);

      if (iVar2 == 0) goto LAB_00448b71;

      *(undefined4 *)(iVar2 + 4) = *(undefined4 *)(iVar3 + 4);

    }

    *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + -1;

    *(int *)(iVar4 + 4) = iVar1;

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

    iVar1 = iVar4;

  } while( true );

}





// --- FUN_00448be0 at 0x00448BE0 (size: 88) ---


void FUN_00448be0(void)



{

  undefined4 local_10;

  undefined4 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  FUN_00448910(&local_4,&local_8,&local_c,&local_10);

  (**(code **)(*DAT_00870340 + 0x40))(local_4,local_8,local_c,local_10,0);

  FUN_00693760(local_4,local_8,local_c,local_10);

  return;

}





// --- FUN_00448c40 at 0x00448C40 (size: 73) ---


void __fastcall FUN_00448c40(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_00448b10(*puVar2);

  return;

}





// --- FUN_00448c90 at 0x00448C90 (size: 62) ---


void __thiscall FUN_00448c90(int param_1,uint *param_2)



{

  uint *puVar1;

  

  if (*(int *)(param_1 + 0x68) * 2 < *(int *)(param_1 + 0x6c) + 1) {

    FUN_00448c40();

  }

  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_00448cd0 at 0x00448CD0 (size: 198) ---


void __fastcall FUN_00448cd0(int param_1)



{

  int *piVar1;

  int iVar2;

  undefined4 *puVar3;

  uint *puVar4;

  uint *puVar5;

  uint *puVar6;

  uint uVar7;

  uint *puVar8;

  

LAB_00448cd6:

  while( true ) {

    puVar8 = (uint *)0x0;

    if (*(int *)(param_1 + 0x6c) == 0) {

      return;

    }

    piVar1 = *(int **)(param_1 + 0x70);

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

      if ((int *)piVar1[1] == (int *)0x0) {

        iVar2 = *piVar1;

        *(int *)(param_1 + 0x70) = iVar2;

        if (iVar2 != 0) {

          *(undefined4 *)(iVar2 + 4) = 0;

        }

      }

      else {

        *(int *)piVar1[1] = *piVar1;

      }

      if (*piVar1 == 0) {

        puVar3 = *(undefined4 **)(*(int *)(param_1 + 0x74) + 4);

        *(undefined4 **)(param_1 + 0x74) = puVar3;

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

          *puVar3 = 0;

        }

      }

      else {

        *(int *)(*piVar1 + 4) = piVar1[1];

      }

      *piVar1 = 0;

      piVar1[1] = 0;

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

        puVar8 = (uint *)(piVar1 + -2);

      }

    }

    uVar7 = *puVar8 % *(uint *)(param_1 + 0x68);

    puVar6 = *(uint **)(*(int *)(param_1 + 0x60) + uVar7 * 4);

    puVar4 = puVar6;

    if (puVar6 == (uint *)0x0) break;

    do {

      if (*puVar4 == *puVar8) {

        if (puVar4 == (uint *)0x0) goto LAB_00448d83;

        if (puVar6 != puVar4) goto LAB_00448d66;

        goto LAB_00448d73;

      }

      puVar4 = (uint *)puVar4[1];

    } while (puVar4 != (uint *)0x0);

    operator_delete(puVar8);

  }

  goto LAB_00448d83;

LAB_00448d66:

  do {

    puVar5 = puVar6;

    puVar6 = (uint *)puVar5[1];

  } while (puVar6 != puVar4);

  if (puVar5 == (uint *)0x0) {

LAB_00448d73:

    *(uint *)(*(int *)(param_1 + 0x60) + uVar7 * 4) = puVar6[1];

  }

  else {

    puVar5[1] = puVar6[1];

  }

  *(int *)(param_1 + 0x6c) = *(int *)(param_1 + 0x6c) + -1;

LAB_00448d83:

  operator_delete(puVar8);

  goto LAB_00448cd6;

}





// --- FUN_00448da0 at 0x00448DA0 (size: 120) ---


uint __thiscall FUN_00448da0(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_00448dcb:

      if ((int)(*(uint *)(param_1 + 0x68) * 2) < *(int *)(param_1 + 0x6c) + 1) {

        FUN_00448c40();

      }

      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_00448dcb;

    }

    puVar1 = (uint *)puVar1[1];

  } while( true );

}





// --- FUN_00448e20 at 0x00448E20 (size: 124) ---


undefined4 __thiscall FUN_00448e20(int param_1,uint *param_2)



{

  uint *puVar1;

  undefined3 uVar2;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  do {

    if (puVar1 == (uint *)0x0) {

LAB_00448e4b:

      FUN_00448da0(param_2);

LAB_00448e53:

      puVar1 = param_2 + 2;

      *puVar1 = *(uint *)(param_1 + 0x70);

      uVar2 = (undefined3)((uint)puVar1 >> 8);

      if (*(int *)(param_1 + 0x70) != 0) {

        *(uint **)(*(int *)(param_1 + 0x70) + 4) = puVar1;

        *(uint **)(param_1 + 0x70) = puVar1;

        param_2[3] = 0;

        return CONCAT31(uVar2,1);

      }

      *(uint **)(param_1 + 0x74) = puVar1;

      *(uint **)(param_1 + 0x70) = puVar1;

      param_2[3] = 0;

      return CONCAT31(uVar2,1);

    }

    if (*puVar1 == *param_2) {

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

        FUN_00410880(param_2 + 2);

        goto LAB_00448e53;

      }

      goto LAB_00448e4b;

    }

    puVar1 = (uint *)puVar1[1];

  } while( true );

}





// --- FUN_00448ea0 at 0x00448EA0 (size: 117) ---


void FUN_00448ea0(void)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  

  if (DAT_0083a334 != 0) {

    iVar3 = 0;

    if (DAT_0083a334 != 0) {

      if (DAT_0083a338 == 0) {

        iVar3 = 0;

      }

      else {

        iVar3 = DAT_0083a338 + -8;

      }

    }

    for (; iVar3 != 0; iVar3 = *(int *)(iVar3 + 8) + -8) {

      puVar2 = *(undefined4 **)(iVar3 + 0x10);

      piVar1 = puVar2 + 1;

      *piVar1 = *piVar1 + -1;

      if (*piVar1 == 0) {

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

      }

      if (*(int *)(iVar3 + 8) == 0) break;

    }

    FUN_00448cd0();

  }

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

    (**(code **)*DAT_0083a18c)(1);

  }

  DAT_0083a18c = (undefined4 *)0x0;

  return;

}





// --- FUN_00448f20 at 0x00448F20 (size: 56) ---


void FUN_00448f20(undefined4 *param_1)



{

  int iVar1;

  undefined4 *puVar2;

  void *pvVar3;

  

  puVar2 = param_1;

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

    pvVar3 = (void *)FUN_006767f0(&param_1);

    if (pvVar3 != (void *)0x0) {

      operator_delete(pvVar3);

      iVar1 = puVar2[1];

      puVar2[1] = iVar1 + -1;

      if (iVar1 + -1 == 0) {

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

      }

    }

  }

  return;

}





// --- FUN_00448f60 at 0x00448F60 (size: 69) ---


undefined4 __thiscall FUN_00448f60(int param_1,uint *param_2)



{

  uint *puVar1;

  undefined4 uVar2;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

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

    while (*puVar1 != *param_2) {

      puVar1 = (uint *)puVar1[1];

      if (puVar1 == (uint *)0x0) {

        return 0;

      }

    }

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

      uVar2 = FUN_00448e20();

      return uVar2;

    }

  }

  return 0;

}





// --- FUN_00448fb0 at 0x00448FB0 (size: 117) ---


uint __thiscall FUN_00448fb0(int param_1,uint *param_2)



{

  uint *puVar1;

  undefined3 uVar2;

  

  puVar1 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  do {

    if (puVar1 == (uint *)0x0) {

LAB_00448fdb:

      FUN_00448da0(param_2);

      puVar1 = param_2 + 2;

      *puVar1 = *(uint *)(param_1 + 0x70);

      uVar2 = (undefined3)((uint)puVar1 >> 8);

      if (*(int *)(param_1 + 0x70) != 0) {

        *(uint **)(*(int *)(param_1 + 0x70) + 4) = puVar1;

        *(uint **)(param_1 + 0x70) = puVar1;

        param_2[3] = 0;

        return CONCAT31(uVar2,1);

      }

      *(uint **)(param_1 + 0x74) = puVar1;

      *(uint **)(param_1 + 0x70) = puVar1;

      param_2[3] = 0;

      return CONCAT31(uVar2,1);

    }

    if (*puVar1 == *param_2) {

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

        return (uint)puVar1 & 0xffffff00;

      }

      goto LAB_00448fdb;

    }

    puVar1 = (uint *)puVar1[1];

  } while( true );

}





// --- FUN_00449030 at 0x00449030 (size: 106) ---


undefined4 FUN_00449030(int param_1,int param_2)



{

  char cVar1;

  undefined4 uVar2;

  

  if (param_1 == 0) {

    uVar2 = FUN_00448fb0(param_2);

    return uVar2;

  }

  cVar1 = FUN_00448860(param_2);

  if (cVar1 != '\0') {

    return 0;

  }

  FUN_00448da0(param_2);

  if (param_2 != 0) {

    FUN_00410820(param_2 + 8,param_1 + 8);

    return 1;

  }

  FUN_00410820(0,param_1 + 8);

  return 1;

}





// --- FUN_004490a0 at 0x004490A0 (size: 129) ---


undefined4 FUN_004490a0(int param_1,int param_2)



{

  char cVar1;

  undefined4 uVar2;

  

  if (param_1 == 0) {

    uVar2 = FUN_00448e20(param_2);

    return uVar2;

  }

  cVar1 = FUN_00448860(param_2);

  if (cVar1 == '\0') {

    FUN_00448da0(param_2);

  }

  else if (param_2 == 0) {

    FUN_00410880(0);

  }

  else {

    FUN_00410880(param_2 + 8);

  }

  if (param_2 != 0) {

    FUN_00410820(param_2 + 8,param_1 + 8);

    return 1;

  }

  FUN_00410820(0,param_1 + 8);

  return 1;

}





// --- FUN_00449130 at 0x00449130 (size: 147) ---


char __thiscall FUN_00449130(int param_1,uint *param_2,uint *param_3)



{

  char cVar1;

  uint *puVar2;

  

  puVar2 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  do {

    if (puVar2 == (uint *)0x0) {

LAB_0044915b:

      puVar2 = (uint *)FUN_005df0f5(0x14);

      if (puVar2 == (uint *)0x0) {

        puVar2 = (uint *)0x0;

      }

      else {

        *puVar2 = *param_2;

        puVar2[1] = 0;

        puVar2[2] = 0;

        puVar2[3] = 0;

        puVar2[4] = *param_3;

      }

      cVar1 = FUN_00448fb0(puVar2);

      if ((cVar1 == '\0') && (puVar2 != (uint *)0x0)) {

        operator_delete(puVar2);

      }

      return cVar1;

    }

    if (*puVar2 == *param_2) {

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

        cVar1 = FUN_00448f60(param_2);

        return cVar1;

      }

      goto LAB_0044915b;

    }

    puVar2 = (uint *)puVar2[1];

  } while( true );

}





// --- FUN_004491d0 at 0x004491D0 (size: 109) ---


uint __thiscall FUN_004491d0(int param_1,uint *param_2,uint *param_3)



{

  uint *puVar1;

  uint *puVar2;

  uint uVar3;

  

  for (puVar1 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

      (puVar1 != (uint *)0x0 && (*puVar1 != *param_2)); puVar1 = (uint *)puVar1[1]) {

  }

  for (puVar2 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_3 % *(uint *)(param_1 + 0x68)) * 4);

      (puVar2 != (uint *)0x0 && (*puVar2 != *param_3)); puVar2 = (uint *)puVar2[1]) {

  }

  if ((puVar1 != (uint *)0x0) && (puVar2 != (uint *)0x0)) {

    uVar3 = FUN_004490a0(puVar1,puVar2);

    return uVar3;

  }

  return (uint)puVar2 & 0xffffff00;

}





// --- FUN_00449240 at 0x00449240 (size: 220) ---


undefined4 __thiscall

FUN_00449240(int param_1,uint *param_2,undefined4 *param_3,undefined4 *param_4)



{

  char cVar1;

  undefined4 uVar2;

  undefined4 *puVar3;

  uint *puVar4;

  

  puVar4 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

  if (puVar4 != (uint *)0x0) {

    while (*puVar4 != *param_2) {

      puVar4 = (uint *)puVar4[1];

      if (puVar4 == (uint *)0x0) {

        return 0;

      }

    }

    if (puVar4 != (uint *)0x0) {

      cVar1 = FUN_00448860(param_3);

      if (cVar1 != '\0') {

        uVar2 = FUN_004491d0(param_2,param_3);

        return uVar2;

      }

      puVar3 = (undefined4 *)FUN_005df0f5(0x14);

      if (puVar3 == (undefined4 *)0x0) {

        puVar3 = (undefined4 *)0x0;

      }

      else {

        *puVar3 = *param_3;

        puVar3[1] = 0;

        puVar3[2] = 0;

        puVar3[3] = 0;

        puVar3[4] = *param_4;

      }

      puVar4 = *(uint **)(*(int *)(param_1 + 0x60) + (*param_2 % *(uint *)(param_1 + 0x68)) * 4);

      do {

        if (puVar4 == (uint *)0x0) {

LAB_004492f1:

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

            operator_delete(puVar3);

          }

          return 0;

        }

        if (*puVar4 == *param_2) {

          if ((puVar4 != (uint *)0x0) && (cVar1 = FUN_00449030(puVar4,puVar3), cVar1 != '\0')) {

            return 1;

          }

          goto LAB_004492f1;

        }

        puVar4 = (uint *)puVar4[1];

      } while( true );

    }

  }

  return 0;

}





// --- FUN_00449320 at 0x00449320 (size: 168) ---


void FUN_00449320(int param_1)



{

  int iVar1;

  char cVar2;

  int iVar3;

  int local_10;

  undefined *local_c;

  

  iVar1 = param_1;

  if (param_1 != 0) {

    iVar3 = 0;

    if (DAT_0083a334 != 0) {

      if (DAT_0083a33c == 0) {

        iVar3 = 0;

      }

      else {

        iVar3 = DAT_0083a33c + -8;

      }

    }

    local_c = &DAT_0083a2c8;

    if (iVar3 != 0) {

      do {

        local_10 = *(int *)(iVar3 + 0x10);

        if (*(int *)(local_10 + 0x10) != *(int *)(param_1 + 0x10)) {

          if (*(int *)(local_10 + 0x10) < *(int *)(param_1 + 0x10)) goto LAB_004493a6;

LAB_0044937b:

          cVar2 = FUN_00449240(&local_10,&param_1,&param_1);

          goto LAB_00449392;

        }

        if (*(double *)(local_10 + 0x18) <= *(double *)(param_1 + 0x18)) goto LAB_0044937b;

LAB_004493a6:

      } while ((*(int *)(iVar3 + 0xc) != 0) && (iVar3 = *(int *)(iVar3 + 0xc) + -8, iVar3 != 0));

    }

    cVar2 = FUN_00449130(&param_1,&param_1);

LAB_00449392:

    if (cVar2 != '\0') {

      *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + 1;

    }

  }

  return;

}





// --- FUN_004493d0 at 0x004493D0 (size: 75) ---


void FUN_004493d0(int param_1,int param_2)



{

  int iVar1;

  char cVar2;

  

  iVar1 = param_1;

  if (param_1 == 0) {

    return;

  }

  if (((param_2 != 0) || (cVar2 = FUN_00449130(&param_1,&param_1), cVar2 == '\0')) &&

     (cVar2 = FUN_00449240(&param_2,&param_1,&param_1), cVar2 == '\0')) {

    return;

  }

  *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + 1;

  return;

}





// --- FUN_00449420 at 0x00449420 (size: 181) ---


undefined4 __thiscall

FUN_00449420(int param_1,int *param_2,int param_3,undefined4 param_4,int param_5,int param_6)



{

  int *piVar1;

  int *piVar2;

  int iVar3;

  LONG LVar4;

  uint uVar5;

  int *piVar6;

  undefined4 *puVar7;

  uint local_8;

  

  local_8 = 0;

  if (*(uint *)(param_1 + 0x70) != 0) {

    puVar7 = *(undefined4 **)(param_1 + 0x68);

    do {

      piVar1 = (int *)*puVar7;

      uVar5 = 0;

      if (piVar1[9] != 0) {

        piVar6 = (int *)piVar1[7];

        do {

          piVar2 = (int *)*piVar6;

          if (((*piVar2 == param_3) && (piVar2[2] == param_5)) && (piVar2[3] == param_6)) {

            iVar3 = *param_2;

            if (iVar3 != *piVar1) {

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

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

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

              }

              iVar3 = *piVar1;

              *param_2 = iVar3;

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

            }

            return 1;

          }

          uVar5 = uVar5 + 1;

          piVar6 = piVar6 + 1;

        } while (uVar5 < (uint)piVar1[9]);

      }

      local_8 = local_8 + 1;

      puVar7 = puVar7 + 1;

    } while (local_8 < *(uint *)(param_1 + 0x70));

  }

  return 0;

}





// --- FUN_004494e0 at 0x004494E0 (size: 546) ---


void __fastcall FUN_004494e0(int param_1)



{

  byte *pbVar1;

  uint uVar2;

  int iVar3;

  bool bVar4;

  bool bVar5;

  char cVar6;

  byte bVar7;

  byte bVar8;

  undefined1 uVar9;

  uint uVar10;

  byte bVar11;

  int iVar12;

  undefined4 *puVar13;

  char local_1a;

  undefined1 local_19;

  undefined1 local_17;

  undefined1 local_16;

  undefined1 local_15;

  uint local_14;

  uint local_10;

  float local_c;

  

  puVar13 = (undefined4 *)(param_1 + 0xa8);

  for (iVar12 = 0x10e; iVar12 != 0; iVar12 = iVar12 + -1) {

    *puVar13 = 0xffffffff;

    puVar13 = puVar13 + 1;

  }

  local_19 = 0;

  local_1a = '\0';

  bVar5 = false;

  local_17 = 0;

  local_16 = 0;

  local_15 = 0;

  local_c = 1.0;

  local_10 = 0;

  cVar6 = '\0';

  if (*(int *)(param_1 + 0x80) != 0) {

    do {

      pbVar1 = *(byte **)(*(int *)(param_1 + 0x78) + local_10 * 4);

      iVar12 = *(int *)(pbVar1 + 0xc);

      if ((((*pbVar1 & 0x82) != 0) || (iVar12 == 1)) || (iVar12 == 2)) {

        local_19 = 1;

      }

      if ((iVar12 == 1) || (iVar12 == 2)) {

        local_1a = '\x01';

      }

      if ((iVar12 == 4) || (iVar12 == 5)) {

        bVar5 = true;

      }

      if ((iVar12 == 7) || (iVar12 == 8)) {

        local_17 = 1;

      }

      if (iVar12 == 10) {

        local_16 = 1;

      }

      if ((pbVar1[4] & 3) != 0) {

        local_15 = 1;

      }

      if (*(float *)(pbVar1 + 0x88) < local_c) {

        local_c = *(float *)(pbVar1 + 0x88);

      }

      cVar6 = FUN_00413a70();

      if (cVar6 != '\0') {

        local_14 = 0;

        do {

          uVar10 = *(uint *)(pbVar1 + 8);

          bVar7 = (byte)local_14 & 1;

          uVar2 = *(uint *)(pbVar1 + 4);

          bVar11 = (byte)(local_14 >> 2) & 1;

          bVar8 = (byte)(local_14 >> 1) & 1;

          bVar4 = true;

          if ((uVar2 != 0) &&

             (((((uVar2 & 1) != 0 && (bVar8 != 1)) || (((uVar2 & 2) != 0 && (bVar11 != 1)))) ||

              ((((uVar2 & 4) != 0 && (bVar7 != 1)) || ((uVar2 & 8) != 0)))))) {

            bVar4 = false;

          }

          if (((uVar10 == 0) ||

              ((((uVar10 & 1) == 0 || (bVar8 != 1)) &&

               ((((uVar10 & 2) == 0 || (bVar11 != 1)) && (((uVar10 & 4) == 0 || (bVar7 != 1))))))))

             && (bVar4)) {

            iVar3 = (local_14 + 0x38 + iVar12 * 8) * 3;

            uVar10 = 0;

            do {

              if (*(char *)(iVar3 + param_1 + uVar10) == -1) {

                *(undefined1 *)(iVar3 + uVar10 + param_1) = (undefined1)local_10;

                break;

              }

              uVar10 = uVar10 + 1;

            } while (uVar10 < 3);

          }

          local_14 = local_14 + 1;

        } while (local_14 < 8);

      }

      local_10 = local_10 + 1;

      cVar6 = local_1a;

    } while (local_10 < *(uint *)(param_1 + 0x80));

  }

  *(undefined1 *)(param_1 + 0x9d) = local_19;

  *(char *)(param_1 + 0x9e) = cVar6;

  if ((cVar6 == '\0') || (!bVar5)) {

    uVar9 = 0;

  }

  else {

    uVar9 = 1;

  }

  *(undefined1 *)(param_1 + 0x9f) = uVar9;

  *(undefined1 *)(param_1 + 0xa0) = local_17;

  *(undefined1 *)(param_1 + 0xa1) = local_16;

  *(undefined1 *)(param_1 + 0xa2) = local_15;

  *(float *)(param_1 + 0xa4) = local_c;

  *(undefined1 *)(param_1 + 0x9c) = 1;

  return;

}





// --- FUN_00449710 at 0x00449710 (size: 199) ---


void __fastcall FUN_00449710(int param_1)



{

  int iVar1;

  undefined4 uVar2;

  int *piVar3;

  uint uVar4;

  uint uVar5;

  undefined4 uVar6;

  

  uVar4 = 0;

  if (*(int *)(param_1 + 0x70) != 0) {

    do {

      iVar1 = *(int *)(*(int *)(param_1 + 0x68) + uVar4 * 4);

      if ((*(int *)(iVar1 + 8) == 3000) && (iVar1 = **(int **)(iVar1 + 0x10), iVar1 != DAT_0083a9d8)

         ) {

        uVar6 = 0;

        uVar2 = FUN_004220b0(iVar1,0);

        FUN_0041a4e0(uVar2,uVar6);

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(param_1 + 0x70));

  }

  uVar4 = 0;

  if (*(int *)(param_1 + 0x80) != 0) {

    do {

      piVar3 = (int *)(*(int *)(param_1 + 0x78) + uVar4 * 4);

      if ((*piVar3 != 0) && (uVar5 = 0, *(int *)(*piVar3 + 0x24) != 0)) {

        do {

          iVar1 = *(int *)(*(int *)(*(int *)(*piVar3 + 0x1c) + uVar5 * 4) + 8);

          if (iVar1 != DAT_0083a9d8) {

            uVar6 = 0;

            uVar2 = FUN_004220b0(iVar1,0);

            FUN_0041a4e0(uVar2,uVar6);

          }

          piVar3 = (int *)(*(int *)(param_1 + 0x78) + uVar4 * 4);

          uVar5 = uVar5 + 1;

        } while (uVar5 < *(uint *)(*(int *)(*(int *)(param_1 + 0x78) + uVar4 * 4) + 0x24));

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(param_1 + 0x80));

  }

  return;

}





// --- FUN_004497e0 at 0x004497E0 (size: 155) ---


undefined4 * __fastcall FUN_004497e0(undefined4 *param_1)



{

  int iVar1;

  undefined4 *puVar2;

  

  FUN_00415460(DAT_0083a9d8);

  *param_1 = &PTR_LAB_0079c0b8;

  FUN_00450480();

  param_1[0x1e] = 0;

  param_1[0x1f] = 0;

  param_1[0x20] = 0;

  param_1[0x21] = 0;

  param_1[0x22] = 0;

  param_1[0x23] = 0;

  param_1[0x24] = 0;

  param_1[0x25] = 0;

  param_1[0x26] = 0;

  *(undefined1 *)(param_1 + 0xc) = 0;

  *(undefined1 *)(param_1 + 0x27) = 0;

  *(undefined1 *)((int)param_1 + 0x9d) = 0;

  *(undefined1 *)((int)param_1 + 0x9e) = 0;

  *(undefined1 *)((int)param_1 + 0x9f) = 0;

  *(undefined1 *)(param_1 + 0x28) = 0;

  *(undefined1 *)((int)param_1 + 0xa1) = 0;

  *(undefined1 *)((int)param_1 + 0xa2) = 0;

  param_1[0x29] = 0x3f800000;

  puVar2 = param_1 + 0x2a;

  for (iVar1 = 0x10e; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar2 = 0xffffffff;

    puVar2 = puVar2 + 1;

  }

  return param_1;

}





// --- FUN_00449890 at 0x00449890 (size: 169) ---


undefined1 __fastcall FUN_00449890(int param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  char cVar3;

  uint uVar4;

  undefined1 local_1;

  

  local_1 = 1;

  cVar3 = FUN_00413a70();

  if (cVar3 != '\0') {

    uVar4 = 0;

    if (*(int *)(param_1 + 0x80) != 0) {

      do {

        if (*(int *)(*(int *)(param_1 + 0x78) + uVar4 * 4) == 0) {

          return 0;

        }

        cVar3 = FUN_0044a380();

        if (cVar3 == '\0') {

          local_1 = 0;

        }

        uVar4 = uVar4 + 1;

      } while (uVar4 < *(uint *)(param_1 + 0x80));

    }

    FUN_00407a40();

    uVar4 = 0;

    if (*(int *)(param_1 + 0x98) != 0) {

      do {

        puVar2 = *(undefined4 **)(*(int *)(param_1 + 0x90) + 4 + uVar4 * 8);

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

          piVar1 = puVar2 + 1;

          *piVar1 = *piVar1 + -1;

          if (*piVar1 == 0) {

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

          }

          *(undefined4 *)(*(int *)(param_1 + 0x90) + 4 + uVar4 * 8) = 0;

        }

        uVar4 = uVar4 + 1;

      } while (uVar4 < *(uint *)(param_1 + 0x98));

    }

    FUN_005d8570();

  }

  return local_1;

}





// --- FUN_00449970 at 0x00449970 (size: 237) ---


void __fastcall FUN_00449970(int param_1)



{

  int *piVar1;

  void *pvVar2;

  undefined4 *puVar3;

  int iVar4;

  uint uVar5;

  

  FUN_00449890();

  uVar5 = 0;

  if (*(int *)(param_1 + 0x80) != 0) {

    do {

      pvVar2 = *(void **)(*(int *)(param_1 + 0x78) + uVar5 * 4);

      if (pvVar2 != (void *)0x0) {

        FUN_0044a8c0();

        operator_delete(pvVar2);

      }

      uVar5 = uVar5 + 1;

    } while (uVar5 < *(uint *)(param_1 + 0x80));

  }

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

  if ((*(uint *)(param_1 + 0x7c) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x78));

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

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

  }

  else if (*(int *)(param_1 + 0x78) != 0) {

    iVar4 = (*(uint *)(param_1 + 0x7c) & 0x7fffffff) - 1;

    while (-1 < iVar4) {

      iVar4 = iVar4 + -1;

      *(undefined4 *)(*(int *)(param_1 + 0x78) + 4 + iVar4 * 4) = 0;

    }

  }

  (**(code **)(*(int *)(param_1 + 0x38) + 0x3c))();

  FUN_00407a40();

  uVar5 = 0;

  if (*(int *)(param_1 + 0x98) != 0) {

    do {

      puVar3 = *(undefined4 **)(*(int *)(param_1 + 0x90) + 4 + uVar5 * 8);

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

        piVar1 = puVar3 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

          (**(code **)*puVar3)(1);

        }

        *(undefined4 *)(*(int *)(param_1 + 0x90) + 4 + uVar5 * 8) = 0;

      }

      uVar5 = uVar5 + 1;

    } while (uVar5 < *(uint *)(param_1 + 0x98));

  }

  FUN_005d8570();

  return;

}





// --- FUN_00449cf0 at 0x00449CF0 (size: 85) ---


void __fastcall FUN_00449cf0(int param_1)



{

  int iVar1;

  undefined4 *puVar2;

  

  FUN_00449970();

  *(undefined1 *)(param_1 + 0x30) = 0;

  *(undefined1 *)(param_1 + 0x9c) = 0;

  *(undefined1 *)(param_1 + 0x9d) = 0;

  *(undefined1 *)(param_1 + 0x9e) = 0;

  *(undefined1 *)(param_1 + 0x9f) = 0;

  *(undefined1 *)(param_1 + 0xa0) = 0;

  *(undefined1 *)(param_1 + 0xa1) = 0;

  *(undefined1 *)(param_1 + 0xa2) = 0;

  *(undefined4 *)(param_1 + 0xa4) = 0x3f800000;

  puVar2 = (undefined4 *)(param_1 + 0xa8);

  for (iVar1 = 0x10e; iVar1 != 0; iVar1 = iVar1 + -1) {

    *puVar2 = 0xffffffff;

    puVar2 = puVar2 + 1;

  }

  return;

}





// --- FUN_00449e50 at 0x00449E50 (size: 127) ---


void __fastcall FUN_00449e50(undefined4 *param_1)



{

  *param_1 = &PTR_LAB_0079c0b8;

  FUN_00449cf0();

  if ((param_1[0x25] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x24]);

  }

  if (((param_1[0x22] & 0x80000000) == 0x80000000) && (param_1[0x21] != 0)) {

    FUN_00407920(3);

  }

  if ((param_1[0x1f] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x1e]);

  }

  FUN_004505f0();

  FUN_004154b0();

  return;

}





// --- FUN_0044a200 at 0x0044A200 (size: 283) ---


undefined4 __thiscall

FUN_0044a200(int param_1,undefined4 *param_2,undefined4 param_3,undefined4 *param_4,

            undefined4 param_5,undefined4 param_6)



{

  char *_Str1;

  undefined4 *puVar1;

  int iVar2;

  LONG LVar3;

  undefined4 *puVar4;

  uint uVar5;

  char *pcVar6;

  

  _Str1 = (char *)*param_2;

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

  if ((*(int *)(_Str1 + -4) != 0) && (*_Str1 == '$')) {

    pcVar6 = _Str1;

    FUN_00401280(1);

    *pcVar6 = '$';

    pcVar6[1] = '\0';

    FUN_00435720(1,0,pcVar6);

    uVar5 = 0;

    if (*(int *)(param_1 + 0x70) != 0) {

      do {

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

        iVar2 = _stricmp(_Str1,(char *)*puVar1);

        if ((iVar2 == 0) && (param_4 == (undefined4 *)puVar1[2])) {

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

          *puVar4 = param_3;

          puVar4[1] = param_4;

          puVar4[2] = param_5;

          puVar4[3] = param_6;

          param_4 = puVar4;

          FUN_0044a770(&param_4,puVar1[9]);

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

          if ((LVar3 == 0) && (_Str1 + -0x14 != (char *)0x0)) {

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

          }

          return 1;

        }

        uVar5 = uVar5 + 1;

      } while (uVar5 < *(uint *)(param_1 + 0x70));

    }

  }

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

  if ((LVar3 == 0) && (_Str1 + -0x14 != (char *)0x0)) {

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

  }

  return 0;

}





// --- FUN_0044a320 at 0x0044A320 (size: 30) ---


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



{

  FUN_00449e50();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0044a340 at 0x0044A340 (size: 49) ---


undefined4 __fastcall FUN_0044a340(int param_1)



{

  undefined1 uVar1;

  char cVar2;

  uint uVar3;

  undefined1 uVar4;

  uint uVar5;

  

  uVar5 = 0;

  uVar4 = 1;

  uVar3 = 0;

  uVar1 = 1;

  if (*(int *)(param_1 + 0x24) != 0) {

    do {

      uVar4 = uVar1;

      cVar2 = FUN_00448460();

      if (cVar2 == '\0') {

        uVar4 = 0;

      }

      uVar3 = *(uint *)(param_1 + 0x24);

      uVar5 = uVar5 + 1;

      uVar1 = uVar4;

    } while (uVar5 < uVar3);

  }

  return CONCAT31((int3)(uVar3 >> 8),uVar4);

}





// --- FUN_0044a380 at 0x0044A380 (size: 47) ---


undefined4 __fastcall FUN_0044a380(int param_1)



{

  undefined1 uVar1;

  char cVar2;

  uint uVar3;

  undefined1 uVar4;

  uint uVar5;

  

  uVar5 = 0;

  uVar4 = 1;

  uVar3 = 0;

  uVar1 = 1;

  if (*(int *)(param_1 + 0x24) != 0) {

    do {

      uVar4 = uVar1;

      cVar2 = FUN_00447f60();

      if (cVar2 == '\0') {

        uVar4 = 0;

      }

      uVar3 = *(uint *)(param_1 + 0x24);

      uVar5 = uVar5 + 1;

      uVar1 = uVar4;

    } while (uVar5 < uVar3);

  }

  return CONCAT31((int3)(uVar3 >> 8),uVar4);

}





// --- FUN_0044a3f0 at 0x0044A3F0 (size: 87) ---


void __fastcall FUN_0044a3f0(int param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  FUN_00406f90();

  FUN_00406f90();

  puVar2 = (undefined4 *)(*(int *)(param_1 + 8) + -0x14);

  LVar1 = InterlockedDecrement((LONG *)(*(int *)(param_1 + 8) + -0x10));

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

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

  }

  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_0044a450 at 0x0044A450 (size: 151) ---


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



{

  int iVar1;

  LONG LVar2;

  

  *param_1 = *param_2;

  iVar1 = param_1[1];

  if (iVar1 != param_2[1]) {

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

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

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

    }

    iVar1 = param_2[1];

    param_1[1] = iVar1;

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

  }

  iVar1 = param_1[2];

  if (iVar1 != param_2[2]) {

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

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

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

    }

    iVar1 = param_2[2];

    param_1[2] = iVar1;

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

  }

  FUN_004070d0(param_2 + 3);

  FUN_004070d0(param_2 + 6);

  return param_1;

}





// --- FUN_0044a4f0 at 0x0044A4F0 (size: 270) ---


void __fastcall FUN_0044a4f0(int param_1)



{

  void *pvVar1;

  int iVar2;

  uint uVar3;

  

  uVar3 = 0;

  if (*(int *)(param_1 + 0x24) != 0) {

    do {

      FUN_00447f60();

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 0x24));

  }

  uVar3 = 0;

  if (*(int *)(param_1 + 0x24) != 0) {

    do {

      pvVar1 = *(void **)(*(int *)(param_1 + 0x1c) + uVar3 * 4);

      if (pvVar1 != (void *)0x0) {

        FUN_00448390();

        operator_delete(pvVar1);

      }

      *(undefined4 *)(*(int *)(param_1 + 0x1c) + uVar3 * 4) = 0;

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 0x24));

  }

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

  if ((*(uint *)(param_1 + 0x20) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x1c));

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

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

  }

  else if (*(int *)(param_1 + 0x1c) != 0) {

    iVar2 = (*(uint *)(param_1 + 0x20) & 0x7fffffff) - 1;

    while (-1 < iVar2) {

      iVar2 = iVar2 + -1;

      *(undefined4 *)(*(int *)(param_1 + 0x1c) + 4 + iVar2 * 4) = 0;

    }

  }

  uVar3 = 0;

  if (*(int *)(param_1 + 0x30) != 0) {

    do {

      operator_delete(*(void **)(*(int *)(param_1 + 0x28) + uVar3 * 4));

      *(undefined4 *)(*(int *)(param_1 + 0x28) + uVar3 * 4) = 0;

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 0x30));

  }

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

  if ((*(uint *)(param_1 + 0x2c) & 0x80000000) != 0x80000000) {

    if (*(int *)(param_1 + 0x28) != 0) {

      iVar2 = (*(uint *)(param_1 + 0x2c) & 0x7fffffff) - 1;

      while (-1 < iVar2) {

        iVar2 = iVar2 + -1;

        *(undefined4 *)(*(int *)(param_1 + 0x28) + 4 + iVar2 * 4) = 0;

      }

    }

    return;

  }

  operator_delete__(*(void **)(param_1 + 0x28));

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

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

  return;

}





// --- FUN_0044a600 at 0x0044A600 (size: 184) ---


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



{

  LONG LVar1;

  undefined4 *puVar2;

  int iVar3;

  int local_4;

  

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

    FUN_0044a3f0();

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

      operator_delete(param_1);

    }

    return param_1;

  }

  local_4 = *(int *)((int)param_1 + -4);

  if (-1 < local_4 + -1) {

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

    do {

      FUN_00406f90();

      FUN_00406f90();

      puVar2 = (undefined4 *)(*(int *)(iVar3 + -0x28) + -0x14);

      LVar1 = InterlockedDecrement((LONG *)(*(int *)(iVar3 + -0x28) + -0x10));

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

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

      }

      puVar2 = (undefined4 *)(*(int *)(iVar3 + -0x2c) + -0x14);

      LVar1 = InterlockedDecrement((LONG *)(*(int *)(iVar3 + -0x2c) + -0x10));

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

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

      }

      local_4 = local_4 + -1;

      iVar3 = iVar3 + -0x24;

    } while (local_4 != 0);

  }

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

    operator_delete__((void *)((int)param_1 + -4));

  }

  return (void *)((int)param_1 + -4);

}





// --- FUN_0044a6c0 at 0x0044A6C0 (size: 169) ---


void __fastcall FUN_0044a6c0(int *param_1)



{

  uint uVar1;

  undefined1 local_24 [4];

  undefined *local_20;

  undefined *local_1c;

  

  param_1[2] = 0;

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

    if ((*param_1 != 0) && (uVar1 = param_1[1] & 0x7fffffff, -1 < (int)(uVar1 - 1))) {

      do {

        local_20 = PTR_DAT_00818344;

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

        local_1c = PTR_DAT_00818344;

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

        FUN_00406d60();

        FUN_00406d60();

        FUN_0044a450(local_24);

        FUN_0044a3f0();

        uVar1 = uVar1 - 1;

      } while (uVar1 != 0);

    }

    return;

  }

  if (*param_1 != 0) {

    FUN_0044a600(3);

  }

  *param_1 = 0;

  param_1[1] = 0;

  return;

}





// --- FUN_0044a770 at 0x0044A770 (size: 108) ---


uint __thiscall FUN_0044a770(int *param_1,undefined4 *param_2,uint param_3)



{

  int iVar1;

  uint in_EAX;

  undefined4 uVar2;

  undefined4 *puVar3;

  

  if ((uint)param_1[2] < param_3) {

LAB_0044a7d5:

    return in_EAX & 0xffffff00;

  }

  if ((param_1[1] & 0x7fffffffU) <= (uint)param_1[2]) {

    uVar2 = FUN_00453850((param_1[1] & 0x7fffffffU) + 1);

    in_EAX = FUN_004180a0(uVar2);

    if ((char)in_EAX == '\0') goto LAB_0044a7d5;

  }

  if (param_1[2] != 0) {

    iVar1 = *param_1;

    for (puVar3 = (undefined4 *)(iVar1 + -4 + param_1[2] * 4);

        (undefined4 *)(iVar1 + param_3 * 4) <= puVar3; puVar3 = puVar3 + -1) {

      puVar3[1] = *puVar3;

    }

  }

  iVar1 = *param_1;

  *(undefined4 *)(iVar1 + param_3 * 4) = *param_2;

  param_1[2] = param_1[2] + 1;

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

}





// --- FUN_0044a7e0 at 0x0044A7E0 (size: 213) ---


undefined4 __thiscall FUN_0044a7e0(int *param_1,uint param_2)



{

  uint *puVar1;

  uint uVar2;

  uint *puVar3;

  int iVar4;

  

  uVar2 = param_2;

  if ((uint)param_1[2] <= param_2) {

    if (param_2 <= (param_1[1] & 0x7fffffffU)) {

      return 1;

    }

    if (param_2 == 0) {

      FUN_0044a6c0();

      return 1;

    }

    puVar3 = (uint *)thunk_FUN_005df0f5(param_2 * 0x24 + 4);

    if (puVar3 != (uint *)0x0) {

      puVar1 = puVar3 + 1;

      *puVar3 = param_2;

      FUN_00401000(puVar1,0x24,param_2,&LAB_0044a3b0);

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

        if (*param_1 != 0) {

          param_2 = param_1[2];

          if (-1 < (int)(param_2 + -1)) {

            iVar4 = (param_2 + -1) * 0x24;

            do {

              FUN_0044a450(*param_1 + iVar4);

              iVar4 = iVar4 + -0x24;

              param_2 = param_2 + -1;

            } while (param_2 != 0);

          }

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

            FUN_0044a600(3);

          }

        }

        *param_1 = (int)puVar1;

        param_1[1] = uVar2 | 0x80000000;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_0044a8c0 at 0x0044A8C0 (size: 97) ---


void __fastcall FUN_0044a8c0(int param_1)



{

  FUN_0044a4f0();

  if ((*(uint *)(param_1 + 0x2c) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x28));

  }

  if ((*(uint *)(param_1 + 0x20) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x1c));

  }

  if (((*(uint *)(param_1 + 0x14) & 0x80000000) == 0x80000000) && (*(int *)(param_1 + 0x10) != 0)) {

    FUN_0044a600(3);

  }

  return;

}





// --- FUN_0044a930 at 0x0044A930 (size: 269) ---


void __fastcall FUN_0044a930(undefined4 *param_1)



{

  undefined4 uVar1;

  undefined4 *puVar2;

  

  *param_1 = 0;

  param_1[1] = 0;

  param_1[2] = 0;

  param_1[3] = 0;

  FUN_0044a6c0();

  param_1[0xd] = 2;

  param_1[0x12] = 2;

  param_1[0xe] = 1;

  param_1[0xf] = 1;

  param_1[0x10] = 4;

  *(undefined1 *)(param_1 + 0x11) = 1;

  *(undefined1 *)(param_1 + 0x13) = 0;

  puVar2 = (undefined4 *)FUN_005b2280(0x3f666666);

  param_1[0x14] = *puVar2;

  param_1[0x15] = puVar2[1];

  param_1[0x16] = puVar2[2];

  param_1[0x17] = puVar2[3];

  param_1[0x18] = puVar2[4];

  param_1[0x19] = puVar2[5];

  param_1[0x1a] = puVar2[6];

  param_1[0x1b] = puVar2[7];

  param_1[0x1c] = puVar2[8];

  param_1[0x1d] = puVar2[9];

  param_1[0x1e] = puVar2[10];

  param_1[0x1f] = DAT_00819228;

  param_1[0x20] = DAT_0081922c;

  param_1[0x21] = DAT_00819230;

  param_1[0x22] = DAT_00819234;

  param_1[0x23] = DAT_00819228;

  param_1[0x24] = DAT_0081922c;

  param_1[0x25] = DAT_00819230;

  uVar1 = DAT_00819234;

  param_1[0x28] = 0;

  param_1[0x26] = uVar1;

  param_1[0x32] = DAT_00819228;

  param_1[0x33] = DAT_0081922c;

  param_1[0x34] = DAT_00819230;

  param_1[0x35] = DAT_00819234;

  return;

}





// --- FUN_0044aa40 at 0x0044AA40 (size: 62) ---


int __fastcall FUN_0044aa40(int param_1)



{

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

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

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

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

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

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

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

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

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

  FUN_005b2250();

  FUN_005b2250();

  FUN_0044a930();

  return param_1;

}





// --- FUN_0044aa80 at 0x0044AA80 (size: 1233) ---


undefined4 __thiscall FUN_0044aa80(undefined4 *param_1,undefined4 param_2,undefined4 *param_3)



{

  int *piVar1;

  int iVar2;

  char cVar3;

  undefined4 uVar4;

  LONG LVar5;

  undefined4 *puVar6;

  uint uVar7;

  int iVar8;

  uint uVar9;

  int *piVar10;

  uint uVar11;

  uint local_20;

  uint uStack_1c;

  undefined1 auStack_18 [12];

  undefined1 auStack_c [12];

  

  FUN_0044a4f0();

  *param_3 = *param_1;

  param_3[1] = param_1[1];

  param_3[2] = param_1[2];

  param_3[3] = param_1[3];

  FUN_0044a6c0();

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

    iVar8 = 0;

    local_20 = 0;

    if (param_1[6] != 0) {

      do {

        if ((uint)param_3[6] < (param_3[5] & 0x7fffffff)) {

LAB_0044ab2b:

          param_3[6] = param_3[6] + 1;

        }

        else {

          uVar4 = FUN_00453850((param_3[5] & 0x7fffffff) + 1);

          cVar3 = FUN_0044a7e0(uVar4);

          if (cVar3 != '\0') goto LAB_0044ab2b;

        }

        *(undefined4 *)(iVar8 + param_3[4]) = *(undefined4 *)(iVar8 + param_1[4]);

        piVar10 = (int *)(param_1[4] + 4 + iVar8);

        piVar1 = (int *)(param_3[4] + 4 + iVar8);

        iVar2 = *piVar1;

        if (iVar2 != *piVar10) {

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

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

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

          }

          iVar2 = *piVar10;

          *piVar1 = iVar2;

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

        }

        piVar10 = (int *)(param_1[4] + 8 + iVar8);

        piVar1 = (int *)(param_3[4] + 8 + iVar8);

        iVar2 = *piVar1;

        if (iVar2 != *piVar10) {

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

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

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

          }

          iVar2 = *piVar10;

          *piVar1 = iVar2;

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

        }

        uVar4 = FUN_004073f0(auStack_18);

        FUN_004070d0(uVar4);

        FUN_00406f90();

        uVar4 = FUN_004073f0(auStack_c);

        FUN_004070d0(uVar4);

        FUN_00406f90();

        local_20 = local_20 + 1;

        iVar8 = iVar8 + 0x24;

      } while (local_20 < (uint)param_1[6]);

    }

  }

  param_3[0xd] = param_1[0xd];

  param_3[0xe] = param_1[0xe];

  param_3[0xf] = param_1[0xf];

  param_3[0x10] = param_1[0x10];

  *(undefined1 *)(param_3 + 0x11) = *(undefined1 *)(param_1 + 0x11);

  param_3[0x12] = param_1[0x12];

  *(undefined1 *)(param_3 + 0x13) = *(undefined1 *)(param_1 + 0x13);

  param_3[0x14] = param_1[0x14];

  param_3[0x15] = param_1[0x15];

  param_3[0x16] = param_1[0x16];

  param_3[0x17] = param_1[0x17];

  param_3[0x18] = param_1[0x18];

  param_3[0x19] = param_1[0x19];

  param_3[0x1a] = param_1[0x1a];

  param_3[0x1b] = param_1[0x1b];

  param_3[0x1c] = param_1[0x1c];

  param_3[0x1d] = param_1[0x1d];

  param_3[0x1e] = param_1[0x1e];

  param_3[0x1f] = param_1[0x1f];

  param_3[0x20] = param_1[0x20];

  param_3[0x21] = param_1[0x21];

  param_3[0x22] = param_1[0x22];

  param_3[0x23] = param_1[0x23];

  param_3[0x24] = param_1[0x24];

  param_3[0x25] = param_1[0x25];

  param_3[0x26] = param_1[0x26];

  param_3[0x27] = param_1[0x27];

  param_3[0x28] = param_1[0x28];

  param_3[0x29] = param_1[0x29];

  param_3[0x2a] = param_1[0x2a];

  param_3[0x2b] = param_1[0x2b];

  param_3[0x2c] = param_1[0x2c];

  param_3[0x2d] = param_1[0x2d];

  param_3[0x2e] = param_1[0x2e];

  param_3[0x2f] = param_1[0x2f];

  param_3[0x30] = param_1[0x30];

  param_3[0x31] = param_1[0x31];

  param_3[0x32] = param_1[0x32];

  param_3[0x33] = param_1[0x33];

  param_3[0x34] = param_1[0x34];

  param_3[0x35] = param_1[0x35];

  FUN_0044dcb0();

  uVar9 = 0;

  if (param_1[9] != 0) {

    do {

      uVar4 = param_3[9];

      local_20 = FUN_004483f0(param_2);

      FUN_0044a770(&local_20,uVar4);

      uVar9 = uVar9 + 1;

    } while (uVar9 < (uint)param_1[9]);

  }

  piVar10 = param_3 + 10;

  param_3[0xc] = 0;

  if ((param_3[0xb] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)*piVar10);

    *piVar10 = 0;

    param_3[0xb] = 0;

  }

  else if (*piVar10 != 0) {

    iVar8 = (param_3[0xb] & 0x7fffffff) - 1;

    while (-1 < iVar8) {

      iVar8 = iVar8 + -1;

      *(undefined4 *)(*piVar10 + 4 + iVar8 * 4) = 0;

    }

  }

  local_20 = 0;

  if (param_1[0xc] != 0) {

    do {

      uVar9 = param_3[0xc];

      uVar4 = (**(code **)(**(int **)(param_1[10] + local_20 * 4) + 0x10))();

      if (uVar9 <= (uint)param_3[0xc]) {

        if ((param_3[0xb] & 0x7fffffff) <= (uint)param_3[0xc]) {

          uVar7 = (param_3[0xb] & 0x7fffffff) + 1;

          if (uVar7 < 9) {

            uVar7 = 8;

          }

          else if (uVar7 < 0x4001) {

            iVar8 = 0x1f;

            if (uVar7 != 0) {

              for (; uVar7 >> iVar8 == 0; iVar8 = iVar8 + -1) {

              }

            }

            uVar11 = 1 << ((byte)iVar8 & 0x1f);

            uStack_1c = uVar7;

            if (uVar11 < uVar7) {

              uVar7 = uVar11 * 2;

            }

          }

          else if ((uVar7 & 0x3fff) != 0) {

            uVar7 = uVar7 + (0x4000 - (uVar7 & 0x3fff));

          }

          cVar3 = FUN_004180a0(uVar7);

          if (cVar3 == '\0') goto LAB_0044af34;

        }

        if (param_3[0xc] != 0) {

          iVar8 = param_3[10];

          for (puVar6 = (undefined4 *)(iVar8 + -4 + param_3[0xc] * 4);

              (undefined4 *)(iVar8 + uVar9 * 4) <= puVar6; puVar6 = puVar6 + -1) {

            puVar6[1] = *puVar6;

          }

        }

        *(undefined4 *)(param_3[10] + uVar9 * 4) = uVar4;

        param_3[0xc] = param_3[0xc] + 1;

      }

LAB_0044af34:

      local_20 = local_20 + 1;

    } while (local_20 < (uint)param_1[0xc]);

  }

  return 1;

}





// --- FUN_0044af60 at 0x0044AF60 (size: 1661) ---


void __thiscall FUN_0044af60(undefined4 *param_1,int param_2)



{

  char cVar1;

  undefined4 *puVar2;

  int *piVar3;

  undefined4 uVar4;

  uint *puVar5;

  uint uVar6;

  undefined1 *puVar7;

  byte *pbVar8;

  char *pcVar9;

  byte bVar10;

  int iVar11;

  uint uVar12;

  undefined4 *puVar13;

  int iVar14;

  uint uVar15;

  undefined4 uVar16;

  uint local_c;

  uint local_8;

  uint uStack_4;

  

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

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

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

      *param_1 = *puVar2;

    }

    else {

      *puVar2 = *param_1;

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

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

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

      param_1[1] = *puVar2;

    }

    else {

      *puVar2 = param_1[1];

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

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

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

      param_1[2] = *puVar2;

    }

    else {

      *puVar2 = param_1[2];

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

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

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

      param_1[3] = *puVar2;

    }

    else {

      *puVar2 = param_1[3];

    }

  }

  iVar11 = param_1[6];

  FUN_0040ad10(4);

  piVar3 = (int *)FUN_0040acf0(4);

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

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

      iVar11 = *piVar3;

    }

    else {

      *piVar3 = iVar11;

    }

  }

  if (iVar11 != 0) {

    iVar14 = 0;

    do {

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

        if ((param_1[5] & 0x7fffffff) <= (uint)param_1[6]) {

          uVar4 = FUN_00453850((param_1[5] & 0x7fffffff) + 1);

          cVar1 = FUN_0044a7e0(uVar4);

          if (cVar1 == '\0') goto LAB_0044b0bc;

        }

        param_1[6] = param_1[6] + 1;

      }

LAB_0044b0bc:

      puVar13 = (undefined4 *)(param_1[4] + iVar14);

      FUN_0040ad10(4);

      puVar2 = (undefined4 *)FUN_0040acf0(4);

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

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

          *puVar13 = *puVar2;

        }

        else {

          *puVar2 = *puVar13;

        }

      }

      FUN_00444900(puVar13 + 3,param_2);

      FUN_00444900(puVar13 + 6,param_2);

      iVar14 = iVar14 + 0x24;

      iVar11 = iVar11 + -1;

    } while (iVar11 != 0);

  }

  uVar12 = param_1[9];

  FUN_0040ad10(4);

  puVar5 = (uint *)FUN_0040acf0(4);

  if (puVar5 != (uint *)0x0) {

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

      uVar12 = *puVar5;

    }

    else {

      *puVar5 = uVar12;

    }

  }

  uVar15 = 0;

  if (uVar12 != 0) {

    do {

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

        uVar6 = *(uint *)(param_1[7] + uVar15 * 4);

      }

      else {

        iVar11 = FUN_005df0f5(0x48);

        if (iVar11 == 0) {

          uVar6 = 0;

        }

        else {

          uVar6 = FUN_00448350();

        }

      }

      FUN_004484e0(param_2);

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

        local_8 = uVar6;

        FUN_0044a770(&local_8,param_1[9]);

      }

      uVar15 = uVar15 + 1;

    } while (uVar15 < uVar12);

  }

  uVar12 = param_1[0xc];

  local_8 = uVar12;

  FUN_0040ad10(4);

  puVar5 = (uint *)FUN_0040acf0(4);

  if (puVar5 != (uint *)0x0) {

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

      uVar12 = *puVar5;

      local_8 = uVar12;

    }

    else {

      *puVar5 = uVar12;

    }

  }

  local_c = 0;

  if (uVar12 != 0) {

    do {

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

        piVar3 = *(int **)(param_1[10] + local_c * 4);

      }

      else {

        uVar16 = 1;

        uVar4 = FUN_0040a8d0(1);

        puVar7 = (undefined1 *)FUN_0040ac70(uVar4,uVar16);

        switch(*puVar7) {

        case 1:

          iVar11 = FUN_005df0f5(0x60);

          if (iVar11 == 0) {

LAB_0044b288:

            piVar3 = (int *)0x0;

          }

          else {

            piVar3 = (int *)FUN_004507e0();

          }

          break;

        case 2:

          iVar11 = FUN_005df0f5(0x34);

          if (iVar11 == 0) goto LAB_0044b288;

          piVar3 = (int *)FUN_004508b0();

          break;

        case 3:

          iVar11 = FUN_005df0f5(0x60);

          if (iVar11 == 0) goto LAB_0044b288;

          piVar3 = (int *)FUN_00450950();

          break;

        case 4:

          iVar11 = FUN_005df0f5(0x48);

          if (iVar11 == 0) goto LAB_0044b288;

          piVar3 = (int *)FUN_00450ac0();

          break;

        default:

          goto switchD_0044b236_default;

        }

      }

      (**(code **)(*piVar3 + 0x1c))(param_2);

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

        uVar12 = param_1[0xc];

        if (uVar12 <= (uint)param_1[0xc]) {

          if ((param_1[0xb] & 0x7fffffff) <= (uint)param_1[0xc]) {

            uVar15 = (param_1[0xb] & 0x7fffffff) + 1;

            if (uVar15 < 9) {

              uVar15 = 8;

            }

            else if (uVar15 < 0x4001) {

              iVar11 = 0x1f;

              if (uVar15 != 0) {

                for (; uVar15 >> iVar11 == 0; iVar11 = iVar11 + -1) {

                }

              }

              uVar6 = 1 << ((byte)iVar11 & 0x1f);

              uStack_4 = uVar15;

              if (uVar6 < uVar15) {

                uVar15 = uVar6 * 2;

              }

            }

            else if ((uVar15 & 0x3fff) != 0) {

              uVar15 = uVar15 + (0x4000 - (uVar15 & 0x3fff));

            }

            cVar1 = FUN_004180a0(uVar15);

            if (cVar1 == '\0') goto LAB_0044b36b;

          }

          if (param_1[0xc] != 0) {

            iVar11 = param_1[10];

            for (puVar2 = (undefined4 *)(iVar11 + -4 + param_1[0xc] * 4);

                (undefined4 *)(iVar11 + uVar12 * 4) <= puVar2; puVar2 = puVar2 + -1) {

              puVar2[1] = *puVar2;

            }

          }

          *(int **)(param_1[10] + uVar12 * 4) = piVar3;

          param_1[0xc] = param_1[0xc] + 1;

        }

      }

LAB_0044b36b:

      local_c = local_c + 1;

    } while (local_c < local_8);

  }

  bVar10 = *(byte *)(param_1 + 0xd);

  FUN_0040ad10(1);

  pbVar8 = (byte *)FUN_0040acf0(1);

  if (pbVar8 != (byte *)0x0) {

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

      bVar10 = *pbVar8;

    }

    else {

      *pbVar8 = bVar10;

    }

  }

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

    param_1[0xd] = (uint)bVar10;

  }

  bVar10 = *(byte *)(param_1 + 0xe);

  FUN_0040ad10(1);

  pbVar8 = (byte *)FUN_0040acf0(1);

  if (pbVar8 != (byte *)0x0) {

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

      bVar10 = *pbVar8;

    }

    else {

      *pbVar8 = bVar10;

    }

  }

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

    param_1[0xe] = (uint)bVar10;

  }

  bVar10 = *(byte *)(param_1 + 0xf);

  FUN_0040ad10(1);

  pbVar8 = (byte *)FUN_0040acf0(1);

  if (pbVar8 != (byte *)0x0) {

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

      bVar10 = *pbVar8;

    }

    else {

      *pbVar8 = bVar10;

    }

  }

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

    param_1[0xf] = (uint)bVar10;

  }

  bVar10 = *(byte *)(param_1 + 0x10);

  FUN_0040ad10(1);

  pbVar8 = (byte *)FUN_0040acf0(1);

  if (pbVar8 != (byte *)0x0) {

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

      bVar10 = *pbVar8;

    }

    else {

      *pbVar8 = bVar10;

    }

  }

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

    param_1[0x10] = (uint)bVar10;

  }

  cVar1 = *(char *)(param_1 + 0x11);

  FUN_0040ad10(1);

  pcVar9 = (char *)FUN_0040acf0(1);

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

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

      cVar1 = *pcVar9;

    }

    else {

      *pcVar9 = cVar1;

    }

  }

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

    FUN_0040aa50();

  }

  *(bool *)(param_1 + 0x11) = cVar1 != '\0';

  bVar10 = *(byte *)(param_1 + 0x12);

  FUN_0040ad10(1);

  pbVar8 = (byte *)FUN_0040acf0(1);

  if (pbVar8 != (byte *)0x0) {

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

      bVar10 = *pbVar8;

    }

    else {

      *pbVar8 = bVar10;

    }

  }

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

    param_1[0x12] = (uint)bVar10;

  }

  cVar1 = *(char *)(param_1 + 0x13);

  FUN_0040ad10(1);

  pcVar9 = (char *)FUN_0040acf0(1);

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

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

      cVar1 = *pcVar9;

    }

    else {

      *pcVar9 = cVar1;

    }

  }

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

    FUN_0040aa50();

  }

  *(bool *)(param_1 + 0x13) = cVar1 != '\0';

  FUN_005b22c0(param_2);

  FUN_0065c3f0(param_2);

  FUN_0065c3f0(param_2);

  FUN_005b22c0(param_2);

  FUN_0065c3f0(param_2);

switchD_0044b236_default:

  return;

}





// --- FUN_0044b5f0 at 0x0044B5F0 (size: 109) ---


uint FUN_0044b5f0(undefined4 param_1)



{

  char cVar1;

  uint uVar2;

  

  uVar2 = FUN_005df0f5(0xd8);

  if (uVar2 != 0) {

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

    *(undefined4 *)(uVar2 + 0x14) = 0;

    *(undefined4 *)(uVar2 + 0x18) = 0;

    *(undefined4 *)(uVar2 + 0x1c) = 0;

    *(undefined4 *)(uVar2 + 0x20) = 0;

    *(undefined4 *)(uVar2 + 0x24) = 0;

    *(undefined4 *)(uVar2 + 0x28) = 0;

    *(undefined4 *)(uVar2 + 0x2c) = 0;

    *(undefined4 *)(uVar2 + 0x30) = 0;

    FUN_005b2250();

    FUN_005b2250();

    FUN_0044a930();

    cVar1 = FUN_0044aa80(param_1,uVar2);

    return -(uint)(cVar1 != '\0') & uVar2;

  }

  return 0;

}





// --- FUN_0044b660 at 0x0044B660 (size: 29) ---


void FUN_0044b660(undefined4 param_1)



{

  undefined4 uVar1;

  

  uVar1 = FUN_004220b0(param_1,0x2e);

  FUN_00415430(uVar1);

  return;

}





// --- FUN_0044b680 at 0x0044B680 (size: 62) ---


undefined4 FUN_0044b680(undefined4 param_1)



{

  int iVar1;

  undefined4 uVar2;

  

  iVar1 = FUN_0041c280(param_1);

  if (iVar1 == 0x2e) {

    uVar2 = 0x2e;

  }

  else {

    if (iVar1 != 0x2f) {

      return 0;

    }

    uVar2 = 0x2f;

  }

  uVar2 = FUN_004220b0(param_1,uVar2);

  uVar2 = FUN_00415430(uVar2);

  return uVar2;

}





// --- FUN_0044b6c0 at 0x0044B6C0 (size: 117) ---


void __fastcall FUN_0044b6c0(int *param_1)



{

  int iVar1;

  undefined4 *puVar2;

  int iVar3;

  

  param_1[2] = 0;

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

    if (*param_1 != 0) {

      operator_delete__((void *)(*param_1 + -4));

    }

    *param_1 = 0;

    param_1[1] = 0;

    return;

  }

  if ((*param_1 != 0) && (iVar3 = (param_1[1] & 0x7fffffffU) - 1, -1 < iVar3)) {

    puVar2 = (undefined4 *)FUN_0050a140();

    do {

      iVar3 = iVar3 + -1;

      iVar1 = *param_1;

      *(undefined4 *)(iVar1 + 8 + iVar3 * 8) = *puVar2;

      *(undefined4 *)(iVar1 + 0xc + iVar3 * 8) = puVar2[1];

    } while (-1 < iVar3);

  }

  return;

}





// --- FUN_0044b740 at 0x0044B740 (size: 193) ---


undefined4 __thiscall FUN_0044b740(int *param_1,uint param_2)



{

  uint *puVar1;

  int iVar2;

  uint *puVar3;

  int iVar4;

  

  if ((uint)param_1[2] <= param_2) {

    if (param_2 <= (param_1[1] & 0x7fffffffU)) {

      return 1;

    }

    if (param_2 == 0) {

      FUN_0044b6c0();

      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,FUN_0050a140);

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

        if (*param_1 != 0) {

          iVar4 = param_1[2] + -1;

          while (-1 < iVar4) {

            iVar4 = iVar4 + -1;

            iVar2 = *param_1;

            puVar3[iVar4 * 2 + 3] = *(uint *)(iVar2 + 8 + iVar4 * 8);

            puVar3[iVar4 * 2 + 4] = *(uint *)(iVar2 + 0xc + iVar4 * 8);

          }

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

            operator_delete__((void *)(*param_1 + -4));

          }

        }

        *param_1 = (int)puVar1;

        param_1[1] = param_2 | 0x80000000;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_0044b810 at 0x0044B810 (size: 13) ---


undefined1 FUN_0044b810(void)



{

  FUN_0044b6c0();

  return 1;

}





// --- FUN_0044b820 at 0x0044B820 (size: 68) ---


void FUN_0044b820(void)



{

  int *piVar1;

  uint uVar2;

  

  uVar2 = 0;

  if (DAT_0083b1d8 != 0) {

    do {

      piVar1 = *(int **)(DAT_0083b1d0 + 4 + uVar2 * 8);

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

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

        *(undefined4 *)(DAT_0083b1d0 + 4 + uVar2 * 8) = 0;

      }

      uVar2 = uVar2 + 1;

    } while (uVar2 < DAT_0083b1d8);

  }

  FUN_0044b6c0();

  return;

}





// --- FUN_0044b870 at 0x0044B870 (size: 211) ---


int FUN_0044b870(int param_1)



{

  char cVar1;

  uint uVar2;

  int iVar3;

  undefined4 uVar4;

  

  if (param_1 == DAT_0083b1cc) {

    return 0;

  }

  uVar2 = 0;

  if (DAT_0083b1d8 != 0) {

    do {

      if (*(int *)(DAT_0083b1d0 + uVar2 * 8) == param_1) {

        return *(int *)(DAT_0083b1d0 + 4 + uVar2 * 8);

      }

      uVar2 = uVar2 + 1;

    } while (uVar2 < DAT_0083b1d8);

  }

  iVar3 = FUN_0041c280(param_1);

  if (iVar3 == 0x2e) {

    uVar4 = 0x2e;

  }

  else {

    if (iVar3 != 0x2f) {

      return 0;

    }

    uVar4 = 0x2f;

  }

  uVar4 = FUN_004220b0(param_1,uVar4);

  iVar3 = FUN_00415430(uVar4);

  if (iVar3 != 0) {

    if ((DAT_0083b1d4 & 0x7fffffff) <= DAT_0083b1d8) {

      uVar4 = FUN_00453850((DAT_0083b1d4 & 0x7fffffff) + 1);

      cVar1 = FUN_0044b740(uVar4);

      if (cVar1 == '\0') {

        return iVar3;

      }

    }

    *(int *)(DAT_0083b1d0 + DAT_0083b1d8 * 8) = param_1;

    *(int *)(DAT_0083b1d0 + 4 + DAT_0083b1d8 * 8) = iVar3;

    DAT_0083b1d8 = DAT_0083b1d8 + 1;

    return iVar3;

  }

  return 0;

}





// --- FUN_0044b9f0 at 0x0044B9F0 (size: 28) ---


bool FUN_0044b9f0(void)



{

  char cVar1;

  

  cVar1 = (**(code **)(*(int *)(DAT_00837bac + 4) + 0x44))(0x69466948,1);

  return cVar1 == '\0';

}





// --- FUN_0044ba10 at 0x0044BA10 (size: 34) ---


bool __fastcall FUN_0044ba10(int *param_1)



{

  char cVar1;

  

  cVar1 = (**(code **)(*param_1 + 0x2c))();

  if (cVar1 != '\0') {

    cVar1 = (**(code **)(*param_1 + 0x28))();

    return cVar1 != '\0';

  }

  return false;

}





// --- FUN_0044ba40 at 0x0044BA40 (size: 122) ---


undefined4 FUN_0044ba40(undefined4 param_1)



{

  char cVar1;

  undefined4 local_34;

  

  FUN_0043d7d0(param_1);

  cVar1 = FUN_00413a70();

  if ((((cVar1 != '\0') && (DAT_0086734c != 0)) && (DAT_00819248 != '\0')) && ((local_34 & 4) == 0))

  {

    if (((local_34 & 2) != 0) && ((local_34 & 1) != 0)) {

      return *(undefined4 *)(DAT_00870340 + 0x6c);

    }

    if ((local_34 & 2) != 0) {

      return *(undefined4 *)(DAT_00870340 + 0x70);

    }

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

      param_1 = *(undefined4 *)(DAT_00870340 + 0x68);

    }

  }

  return param_1;

}





// --- FUN_0044bac0 at 0x0044BAC0 (size: 91) ---


void __fastcall FUN_0044bac0(int param_1)



{

  int *piVar1;

  int iVar2;

  int iVar3;

  undefined4 local_4;

  

  local_4 = 0;

  if (*(int *)(param_1 + 0x84) != 0) {

    iVar3 = 0;

    do {

      iVar2 = 6;

      do {

        piVar1 = *(int **)(iVar3 + 8 + *(int *)(param_1 + 0x7c));

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

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

          *(undefined4 *)(iVar3 + 8 + *(int *)(param_1 + 0x7c)) = 0;

        }

        iVar3 = iVar3 + 0xc;

        iVar2 = iVar2 + -1;

      } while (iVar2 != 0);

      local_4 = local_4 + 1;

    } while (local_4 < *(uint *)(param_1 + 0x84));

  }

  return;

}





// --- FUN_0044bb20 at 0x0044BB20 (size: 23) ---


undefined1 FUN_0044bb20(void)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    FUN_0044bac0();

  }

  return 1;

}





// --- FUN_0044bb40 at 0x0044BB40 (size: 218) ---


undefined1 __fastcall FUN_0044bb40(int param_1)



{

  int iVar1;

  undefined4 uVar2;

  int iVar3;

  int iVar4;

  bool bVar5;

  undefined1 local_19;

  undefined4 local_18;

  undefined4 local_14;

  

  local_19 = 1;

  if (*(int *)(param_1 + 0x58) != 5) {

    if (*(int *)(param_1 + 0x84) == 0) {

      return 0;

    }

    local_14 = 0;

    iVar1 = 0;

    do {

      local_18 = 6;

      do {

        iVar4 = *(int *)(param_1 + 0x7c) + iVar1;

        if (*(int *)(*(int *)(param_1 + 0x7c) + 4 + iVar1) != DAT_0083b230) {

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

          if ((iVar3 == 2) || (iVar3 == 4)) {

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

              (**(code **)(**(int **)(iVar4 + 8) + 0x14))();

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

            }

            uVar2 = FUN_004220b0(*(undefined4 *)(iVar4 + 4),0xc);

            iVar3 = FUN_00415430(uVar2);

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

            bVar5 = iVar3 == 0;

          }

          else {

            bVar5 = iVar3 == 3;

          }

          if (bVar5) {

            local_19 = 0;

          }

        }

        iVar1 = iVar1 + 0xc;

        local_18 = local_18 + -1;

      } while (local_18 != 0);

      local_14 = local_14 + 1;

    } while (local_14 < *(uint *)(param_1 + 0x84));

  }

  return local_19;

}





// --- FUN_0044bc30 at 0x0044BC30 (size: 836) ---


undefined4 __fastcall FUN_0044bc30(int *param_1)



{

  int *piVar1;

  undefined4 uVar2;

  char cVar3;

  undefined4 uVar4;

  int *piVar5;

  int iVar6;

  undefined4 uVar7;

  undefined4 unaff_EBX;

  uint uVar8;

  int iVar9;

  undefined4 unaff_EBP;

  uint uVar10;

  undefined4 unaff_EDI;

  int iVar11;

  int iStack_14;

  

  FUN_00446be0(CONCAT31((uint3)((uint)param_1[0x19] >> 9),~(byte)((uint)param_1[0x19] >> 1)) &

               0xffffff01);

  iVar11 = param_1[0x16];

  if ((iVar11 != 5) && ((param_1[0x21] == 0 || (param_1[0x21] == 0)))) {

    return 0;

  }

  if (iVar11 == 2) {

    iVar11 = *(int *)(param_1[0x1f] + 8);

    if (iVar11 != 0) {

      uVar7 = *(undefined4 *)(iVar11 + 0xa0);

      uVar2 = *(undefined4 *)(iVar11 + 0xa4);

      uVar4 = FUN_0044ba40(*(undefined4 *)(iVar11 + 0xdc));

      piVar5 = (int *)(**(code **)(*DAT_00870340 + 0x14))();

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

        cVar3 = (**(code **)(*piVar5 + 0x58))(uVar7,uVar2,param_1[0x21],uVar4,2);

        if (cVar3 != '\0') {

          uVar10 = 0;

          if (param_1[0x21] != 0) {

            iVar11 = 0;

            uVar7 = unaff_EBX;

            do {

              iVar9 = *(int *)(iVar11 + 8 + param_1[0x1f]);

              if (iVar9 == 0) {

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

                return 0;

              }

              iVar6 = (**(code **)(*piVar5 + 100))(uVar10,0);

              if ((iVar6 == 0) || (piVar1 = (int *)(iVar6 + -0x30), piVar1 == (int *)0x0))

              goto LAB_0044bda5;

              cVar3 = (**(code **)(*piVar1 + 0x68))(iVar9);

              if (cVar3 == '\0') {

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

                goto LAB_0044bda5;

              }

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

              uVar10 = uVar10 + 1;

              iVar11 = iVar11 + 0x48;

            } while (uVar10 < (uint)param_1[0x21]);

          }

          cVar3 = (**(code **)(*param_1 + 0x58))(uVar7,unaff_EDI,param_1[0x21],unaff_EBP,0);

          if (cVar3 != '\0') {

            cVar3 = (**(code **)(*param_1 + 0x60))(piVar5);

            if (cVar3 == '\0') {

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

              return 0;

            }

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

            FUN_0044bac0();

            return 1;

          }

        }

LAB_0044bda5:

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

        return 0;

      }

    }

  }

  else if (iVar11 == 4) {

    iVar11 = *(int *)(param_1[0x1f] + 8);

    if ((iVar11 != 0) && (iVar9 = *(int *)(iVar11 + 0xa0), iVar9 == *(int *)(iVar11 + 0xa4))) {

      uVar7 = FUN_0044ba40(*(undefined4 *)(iVar11 + 0xdc));

      piVar5 = (int *)(**(code **)(*DAT_00870340 + 0x14))();

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

        cVar3 = (**(code **)(*piVar5 + 0x5c))(iVar9,param_1[0x21],uVar7,2);

        if (cVar3 != '\0') {

          uVar10 = 0;

          if (param_1[0x21] != 0) {

            iVar11 = 0;

            do {

              uVar8 = 0;

              iVar9 = iVar11;

              do {

                if (*(int *)(iVar11 + 8 + param_1[0x1f]) == 0) goto LAB_0044bf33;

                iVar6 = (**(code **)(*piVar5 + 100))(uVar10,uVar8);

                if ((iVar6 == 0) || (piVar1 = (int *)(iVar6 + -0x30), piVar1 == (int *)0x0)) {

LAB_0044bf13:

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

                  return 0;

                }

                cVar3 = (**(code **)(*piVar1 + 0x68))(iVar9);

                if (cVar3 == '\0') {

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

                  goto LAB_0044bf13;

                }

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

                uVar8 = uVar8 + 1;

                iVar11 = iVar11 + 0xc;

              } while (uVar8 < 6);

              uVar10 = uVar10 + 1;

              iVar11 = iVar9 + 0x48;

              iVar9 = iStack_14;

              uVar7 = unaff_EDI;

            } while (uVar10 < (uint)param_1[0x21]);

          }

          cVar3 = (**(code **)(*param_1 + 0x5c))(iVar9,param_1[0x21],uVar7,0);

          if (cVar3 != '\0') {

            cVar3 = (**(code **)(*param_1 + 0x60))(piVar5);

            if (cVar3 != '\0') {

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

              FUN_0044bac0();

              return 1;

            }

LAB_0044bf33:

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

            return 0;

          }

        }

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

        return 0;

      }

    }

  }

  else if (iVar11 == 5) {

    FUN_0044bac0();

    return 1;

  }

  return 0;

}





// --- FUN_0044bf80 at 0x0044BF80 (size: 54) ---


bool FUN_0044bf80(void)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 == '\0') {

    return true;

  }

  if (DAT_0086734c != 0) {

    cVar1 = FUN_0044bb40();

    if (cVar1 != '\0') {

      cVar1 = FUN_0044bc30();

      return cVar1 != '\0';

    }

  }

  return false;

}





// --- FUN_0044bfc0 at 0x0044BFC0 (size: 107) ---


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



{

  int iVar1;

  LONG LVar2;

  int iVar3;

  int *piVar4;

  

  param_2 = param_2 - (int)param_1;

  iVar3 = 6;

  piVar4 = param_1;

  do {

    iVar1 = *piVar4;

    if (iVar1 != *(int *)(param_2 + (int)piVar4)) {

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

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

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

      }

      iVar1 = *(int *)(param_2 + (int)piVar4);

      *piVar4 = iVar1;

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

    }

    piVar4[1] = *(int *)(param_2 + 4 + (int)piVar4);

    piVar4[2] = *(int *)(param_2 + 8 + (int)piVar4);

    piVar4 = piVar4 + 3;

    iVar3 = iVar3 + -1;

  } while (iVar3 != 0);

  return param_1;

}





// --- FUN_0044c030 at 0x0044C030 (size: 67) ---


undefined4 * __fastcall FUN_0044c030(undefined4 *param_1)



{

  LONG *lpAddend;

  undefined4 *puVar1;

  int iVar2;

  

  iVar2 = 6;

  puVar1 = param_1;

  do {

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

    *puVar1 = PTR_DAT_00818344;

    InterlockedIncrement(lpAddend);

    puVar1[1] = DAT_0083b230;

    puVar1[2] = 0;

    puVar1 = puVar1 + 3;

    iVar2 = iVar2 + -1;

  } while (iVar2 != 0);

  return param_1;

}





// --- FUN_0044c080 at 0x0044C080 (size: 81) ---


void __fastcall FUN_0044c080(int param_1)



{

  int iVar1;

  LONG LVar2;

  undefined4 *puVar3;

  int *piVar4;

  int local_4;

  

  local_4 = 6;

  piVar4 = (int *)(param_1 + 0x48);

  do {

    if ((int *)piVar4[-1] != (int *)0x0) {

      (**(code **)(*(int *)piVar4[-1] + 0x14))();

      piVar4[-1] = 0;

    }

    iVar1 = piVar4[-3];

    puVar3 = (undefined4 *)(iVar1 + -0x14);

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

    if ((LVar2 == 0) && (puVar3 != (undefined4 *)0x0)) {

      (**(code **)*puVar3)(1);

    }

    local_4 = local_4 + -1;

    piVar4 = piVar4 + -3;

  } while (local_4 != 0);

  return;

}





// --- FUN_0044c0e0 at 0x0044C0E0 (size: 74) ---


void __fastcall FUN_0044c0e0(int *param_1)



{

  int iVar1;

  int iVar2;

  

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

    iVar2 = *(int *)(iVar1 + -4);

    if (-1 < iVar2 + -1) {

      do {

        FUN_0044c080();

        iVar2 = iVar2 + -1;

      } while (iVar2 != 0);

    }

    operator_delete__((void *)(iVar1 + -4));

  }

  return;

}





// --- FUN_0044c130 at 0x0044C130 (size: 167) ---


void __fastcall FUN_0044c130(int *param_1)



{

  int iVar1;

  uint uVar2;

  undefined4 uVar3;

  int iVar4;

  

  param_1[2] = 0;

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

    if ((*param_1 != 0) && (uVar2 = param_1[1] & 0x7fffffff, -1 < (int)(uVar2 - 1))) {

      do {

        uVar3 = FUN_0044c030();

        FUN_0044bfc0(uVar3);

        FUN_0044c080();

        uVar2 = uVar2 - 1;

      } while (uVar2 != 0);

    }

    return;

  }

  iVar1 = *param_1;

  if (iVar1 != 0) {

    iVar4 = *(int *)(iVar1 + -4);

    if (-1 < iVar4 + -1) {

      do {

        FUN_0044c080();

        iVar4 = iVar4 + -1;

      } while (iVar4 != 0);

    }

    operator_delete__((void *)(iVar1 + -4));

  }

  *param_1 = 0;

  param_1[1] = 0;

  return;

}





// --- FUN_0044c1e0 at 0x0044C1E0 (size: 267) ---


undefined4 __thiscall FUN_0044c1e0(int *param_1,uint param_2)



{

  uint *puVar1;

  uint uVar2;

  uint *puVar3;

  int iVar4;

  

  uVar2 = param_2;

  if ((uint)param_1[2] <= param_2) {

    if (param_2 <= (param_1[1] & 0x7fffffffU)) {

      return 1;

    }

    if (param_2 == 0) {

      FUN_0044c130();

      return 1;

    }

    puVar3 = (uint *)thunk_FUN_005df0f5(param_2 * 0x48 + 4);

    if (puVar3 != (uint *)0x0) {

      puVar1 = puVar3 + 1;

      *puVar3 = param_2;

      FUN_00401000(puVar1,0x48,param_2,FUN_0044c030);

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

        if (*param_1 != 0) {

          param_2 = param_1[2];

          if (-1 < (int)(param_2 + -1)) {

            iVar4 = (param_2 + -1) * 0x48;

            do {

              FUN_0044bfc0(*param_1 + iVar4);

              iVar4 = iVar4 + -0x48;

              param_2 = param_2 + -1;

            } while (param_2 != 0);

          }

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

            param_2 = *(int *)(iVar4 + -4);

            if (-1 < (int)(param_2 + -1)) {

              do {

                FUN_0044c080();

                param_2 = param_2 + -1;

              } while (param_2 != 0);

            }

            operator_delete__((void *)(iVar4 + -4));

          }

        }

        *param_1 = (int)puVar1;

        param_1[1] = uVar2 | 0x80000000;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_0044c2f0 at 0x0044C2F0 (size: 173) ---


int __thiscall FUN_0044c2f0(int param_1,uint *param_2)



{

  char cVar1;

  undefined4 uVar2;

  uint uVar3;

  uint uVar4;

  

  if ((*(uint *)(param_1 + 4) & 0x7fffffff) < (param_2[1] & 0x7fffffff)) {

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

    cVar1 = FUN_0044c1e0(param_2[1] & 0x7fffffff);

    if (cVar1 == '\0') {

      return param_1;

    }

  }

  uVar3 = *param_2;

  uVar4 = uVar3 + param_2[2] * 0x48;

  for (; uVar3 < uVar4; uVar3 = uVar3 + 0x48) {

    FUN_0044bfc0(uVar3);

  }

  uVar4 = param_2[2];

  if (uVar4 < *(uint *)(param_1 + 8)) {

    do {

      uVar2 = FUN_0044c030();

      FUN_0044bfc0(uVar2);

      FUN_0044c080();

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(param_1 + 8));

  }

  *(uint *)(param_1 + 8) = param_2[2];

  return param_1;

}





// --- FUN_0044c3a0 at 0x0044C3A0 (size: 134) ---


undefined1 __thiscall FUN_0044c3a0(int param_1,uint param_2,char param_3)



{

  char cVar1;

  uint uVar2;

  undefined4 uVar3;

  

  if ((*(uint *)(param_1 + 4) & 0x7fffffff) < param_2) {

    uVar2 = param_2;

    if (param_3 == '\0') {

      uVar2 = FUN_00453850(param_2);

    }

    cVar1 = FUN_0044c1e0(uVar2);

    if (cVar1 == '\0') {

      return 0;

    }

  }

  else {

    uVar2 = param_2;

    if (param_2 < *(uint *)(param_1 + 8)) {

      do {

        uVar3 = FUN_0044c030();

        FUN_0044bfc0(uVar3);

        FUN_0044c080();

        uVar2 = uVar2 + 1;

      } while (uVar2 < *(uint *)(param_1 + 8));

    }

  }

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

  return 1;

}





// --- FUN_0044c430 at 0x0044C430 (size: 112) ---


undefined4 * __fastcall FUN_0044c430(undefined4 *param_1)



{

  FUN_00415460(DAT_0083b230);

  FUN_00447220();

  *param_1 = &PTR_LAB_0079c1a8;

  param_1[0xc] = &PTR_LAB_0079c198;

  param_1[0x1b] = 0;

  param_1[0x1c] = 0;

  param_1[0x1d] = 0;

  *(undefined1 *)(param_1 + 0x1e) = 1;

  param_1[0x1f] = 0;

  param_1[0x20] = 0;

  param_1[0x21] = 0;

  param_1[0x16] = 1;

  param_1[0x17] = 0;

  param_1[0x18] = 0;

  param_1[0x19] = 0;

  *(undefined1 *)(param_1 + 0x1a) = 0;

  FUN_0044c130();

  param_1[0x22] = 0;

  param_1[0x23] = 0;

  param_1[0x24] = 0;

  return param_1;

}





// --- FUN_0044c4c0 at 0x0044C4C0 (size: 35) ---


void FUN_0044c4c0(void)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    FUN_0044bac0();

  }

  FUN_0044bac0();

  FUN_0044c130();

  return;

}





// --- FUN_0044c4f0 at 0x0044C4F0 (size: 88) ---


void __fastcall FUN_0044c4f0(int param_1)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    FUN_0044bac0();

  }

  FUN_0044bac0();

  FUN_0044c130();

  *(undefined4 *)(param_1 + 0x58) = 1;

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

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

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

  *(undefined1 *)(param_1 + 0x68) = 0;

  FUN_0044c130();

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

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

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

  return;

}





// --- FUN_0044c550 at 0x0044C550 (size: 252) ---


undefined4 __fastcall FUN_0044c550(int param_1)



{

  uint uVar1;

  char cVar2;

  int iVar3;

  uint uVar4;

  int iVar5;

  undefined4 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  if (*(char *)(param_1 + 0x68) != '\0') {

    return 1;

  }

  *(undefined1 *)(param_1 + 0x68) = 1;

  if (DAT_0086734c == 0) {

    return 0;

  }

  switch(DAT_0081ffac) {

  case 0:

    cVar2 = FUN_0044b9f0();

    if (cVar2 == '\0') {

      return 1;

    }

  case 1:

    uVar4 = 1;

    break;

  case 2:

    uVar4 = 2;

    break;

  case 3:

    uVar4 = 3;

    break;

  case 4:

    uVar4 = 4;

    break;

  default:

    goto switchD_0044c588_default;

  }

  uVar1 = *(uint *)(param_1 + 0x84);

  if (1 < uVar1) {

    if (uVar1 <= uVar4) {

      uVar4 = uVar1 - 1;

    }

    iVar3 = uVar1 - uVar4;

    local_c = 0;

    local_8 = 0;

    local_4 = 0;

    FUN_0044c3a0(iVar3,1);

    if (iVar3 != 0) {

      iVar5 = uVar4 * 0x48;

      do {

        FUN_0044bfc0(*(int *)(param_1 + 0x7c) + iVar5);

        iVar5 = iVar5 + 0x48;

        iVar3 = iVar3 + -1;

      } while (iVar3 != 0);

    }

    FUN_0044bac0();

    FUN_0044c130();

    FUN_0044c2f0(&local_c);

    FUN_0044c0e0();

    return 1;

  }

switchD_0044c588_default:

  return 1;

}





// --- FUN_0044c6a0 at 0x0044C6A0 (size: 30) ---


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



{

  FUN_0044c6c0();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0044c6c0 at 0x0044C6C0 (size: 77) ---


void __fastcall FUN_0044c6c0(undefined4 *param_1)



{

  char cVar1;

  

  *param_1 = &PTR_LAB_0079c1a8;

  param_1[0xc] = &PTR_LAB_0079c198;

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    FUN_0044bac0();

  }

  FUN_0044bac0();

  FUN_0044c130();

  FUN_0044c0e0();

  FUN_00446f00();

  FUN_004154b0();

  return;

}





// --- FUN_0044c710 at 0x0044C710 (size: 354) ---


undefined4 __thiscall FUN_0044c710(int param_1,int param_2)



{

  int iVar1;

  int iVar2;

  int iVar3;

  int *piVar4;

  undefined4 uVar5;

  LONG LVar6;

  int iVar7;

  undefined4 local_c;

  undefined4 local_8;

  

  if (param_2 == 0) {

    iVar7 = 0;

  }

  else {

    iVar7 = param_2 + 0x30;

  }

  uVar5 = FUN_00446b90(iVar7);

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

    return uVar5;

  }

  *(undefined4 *)(param_2 + 0x58) = *(undefined4 *)(param_1 + 0x58);

  *(undefined4 *)(param_2 + 0x5c) = *(undefined4 *)(param_1 + 0x5c);

  *(undefined4 *)(param_2 + 0x60) = *(undefined4 *)(param_1 + 0x60);

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

  *(undefined1 *)(param_2 + 0x68) = *(undefined1 *)(param_1 + 0x68);

  uVar5 = *(undefined4 *)(param_1 + 0x84);

  FUN_0044bac0();

  FUN_0044c130();

  FUN_0044c3a0(uVar5,1);

  iVar7 = 0;

  local_8 = 0;

  if (*(int *)(param_1 + 0x84) != 0) {

    do {

      local_c = 6;

      do {

        iVar1 = *(int *)(param_1 + 0x7c);

        iVar2 = *(int *)(param_2 + 0x7c);

        iVar3 = *(int *)(iVar2 + iVar7);

        if (iVar3 != *(int *)(iVar1 + iVar7)) {

          LVar6 = InterlockedDecrement((LONG *)(iVar3 + -0x10));

          if ((LVar6 == 0) && ((undefined4 *)(iVar3 + -0x14) != (undefined4 *)0x0)) {

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

          }

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

          *(int *)(iVar2 + iVar7) = iVar1;

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

        }

        *(undefined4 *)(iVar7 + 4 + *(int *)(param_2 + 0x7c)) =

             *(undefined4 *)(iVar7 + 4 + *(int *)(param_1 + 0x7c));

        *(undefined4 *)(iVar7 + 8 + *(int *)(param_2 + 0x7c)) =

             *(undefined4 *)(iVar7 + 8 + *(int *)(param_1 + 0x7c));

        piVar4 = *(int **)(iVar7 + 8 + *(int *)(param_1 + 0x7c));

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

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

        }

        iVar7 = iVar7 + 0xc;

        local_c = local_c + -1;

      } while (local_c != 0);

      local_8 = local_8 + 1;

    } while (local_8 < *(uint *)(param_1 + 0x84));

  }

  *(undefined4 *)(param_2 + 0x88) = *(undefined4 *)(param_1 + 0x88);

  *(undefined4 *)(param_2 + 0x8c) = *(undefined4 *)(param_1 + 0x8c);

  uVar5 = *(undefined4 *)(param_1 + 0x90);

  *(undefined4 *)(param_2 + 0x90) = uVar5;

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

}





// --- FUN_0044c880 at 0x0044C880 (size: 155) ---


void __fastcall FUN_0044c880(int param_1)



{

  int iVar1;

  char cVar2;

  undefined4 uVar3;

  undefined4 uVar4;

  int iVar5;

  uint uVar6;

  int local_14;

  

  cVar2 = FUN_00413a70();

  if (cVar2 != '\0') {

    FUN_0044c550();

  }

  uVar6 = 0;

  if (*(int *)(param_1 + 0x84) != 0) {

    do {

      iVar5 = uVar6 * 0x48;

      local_14 = 6;

      do {

        iVar1 = *(int *)(*(int *)(param_1 + 0x7c) + 4 + iVar5);

        if (iVar1 != DAT_0083b230) {

          uVar4 = 0;

          if ((uVar6 == 0) && (1 < *(uint *)(param_1 + 0x84))) {

            uVar4 = 4;

          }

          uVar3 = FUN_004220b0(iVar1,0);

          FUN_0041a4e0(uVar3,uVar4);

        }

        iVar5 = iVar5 + 0xc;

        local_14 = local_14 + -1;

      } while (local_14 != 0);

      uVar6 = uVar6 + 1;

    } while (uVar6 < *(uint *)(param_1 + 0x84));

  }

  return;

}





// --- FUN_0044c920 at 0x0044C920 (size: 30) ---


bool FUN_0044c920(void)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 == '\0') {

    return true;

  }

  cVar1 = FUN_0044c550();

  return cVar1 != '\0';

}





// --- FUN_0044ca60 at 0x0044CA60 (size: 41) ---


void __fastcall FUN_0044ca60(int param_1)



{

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

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

  *(undefined1 *)(param_1 + 0xc) = 2;

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

  *(undefined1 *)(param_1 + 0x14) = 0;

  *(undefined1 *)(param_1 + 0x15) = 0;

  *(undefined1 *)(param_1 + 0x16) = 0;

  *(undefined1 *)(param_1 + 0x17) = 0;

  *(undefined1 *)(param_1 + 0x18) = 1;

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

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

  *(undefined1 *)(param_1 + 0x24) = 0;

  return;

}





// --- FUN_0044ca90 at 0x0044CA90 (size: 34) ---


void __fastcall FUN_0044ca90(int param_1)



{

  if (*(void **)(param_1 + 0x10) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 0x10));

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

  }

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

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

  return;

}





// --- FUN_0044cac0 at 0x0044CAC0 (size: 93) ---


undefined4 __thiscall

FUN_0044cac0(int param_1,int param_2,char param_3,undefined1 param_4,undefined1 param_5,

            undefined1 param_6)



{

  undefined4 uVar1;

  

  *(undefined1 *)(param_1 + 0x14) = param_4;

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

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

  *(char *)(param_1 + 0xc) = param_3;

  *(undefined1 *)(param_1 + 0x15) = param_5;

  if (param_3 == '\x02') {

    param_2 = param_2 * 2;

  }

  else {

    param_2 = param_2 * 4;

  }

  uVar1 = thunk_FUN_005df0f5(param_2);

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

  *(undefined1 *)(param_1 + 0x16) = 0;

  *(undefined1 *)(param_1 + 0x17) = 0;

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

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

  *(undefined1 *)(param_1 + 0x24) = 0;

  *(undefined1 *)(param_1 + 0x18) = param_6;

  return 1;

}





// --- FUN_0044cb20 at 0x0044CB20 (size: 66) ---


void __fastcall FUN_0044cb20(int param_1)



{

  if (*(void **)(param_1 + 0x10) != (void *)0x0) {

    operator_delete__(*(void **)(param_1 + 0x10));

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

  }

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

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

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

  *(undefined1 *)(param_1 + 0x14) = 0;

  *(undefined1 *)(param_1 + 0x15) = 0;

  *(undefined1 *)(param_1 + 0x16) = 0;

  *(undefined1 *)(param_1 + 0x17) = 0;

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

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

  *(undefined1 *)(param_1 + 0x24) = 0;

  *(undefined1 *)(param_1 + 0xc) = 2;

  *(undefined1 *)(param_1 + 0x18) = 1;

  return;

}





// --- FUN_0044cb70 at 0x0044CB70 (size: 8) ---


undefined4 __fastcall FUN_0044cb70(int param_1)



{

  *(undefined1 *)(param_1 + 0x16) = 1;

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

}





// --- FUN_0044cb80 at 0x0044CB80 (size: 13) ---


void __fastcall FUN_0044cb80(int param_1)



{

  *(undefined1 *)(param_1 + 0x16) = 0;

  *(undefined1 *)(param_1 + 0x17) = 1;

  *(undefined1 *)(param_1 + 0x24) = 1;

  return;

}





// --- FUN_0044cb90 at 0x0044CB90 (size: 149) ---


void __fastcall FUN_0044cb90(int param_1)



{

  int iVar1;

  uint *puVar2;

  uint uVar3;

  

  if ((*(char *)(param_1 + 0x24) != '\0') && (*(char *)(param_1 + 0x18) != '\0')) {

    puVar2 = *(uint **)(param_1 + 0x10);

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

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

    if ((puVar2 != (uint *)0x0) && (iVar1 = *(int *)(param_1 + 4), iVar1 != 0)) {

      uVar3 = 0;

      *(undefined4 *)(param_1 + 0x1c) = 0xffffffff;

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

      if (*(char *)(param_1 + 0xc) == '\x02') {

        if (iVar1 != 0) {

          do {

            if ((uint)(ushort)*puVar2 < *(uint *)(param_1 + 0x1c)) {

              *(uint *)(param_1 + 0x1c) = (uint)(ushort)*puVar2;

            }

            if (*(uint *)(param_1 + 0x20) < (uint)(ushort)*puVar2) {

              *(uint *)(param_1 + 0x20) = (uint)(ushort)*puVar2;

            }

            uVar3 = uVar3 + 1;

            puVar2 = (uint *)((int)puVar2 + 2);

          } while (uVar3 < *(uint *)(param_1 + 4));

          *(undefined1 *)(param_1 + 0x24) = 0;

          return;

        }

      }

      else if (iVar1 != 0) {

        do {

          if (*puVar2 < *(uint *)(param_1 + 0x1c)) {

            *(uint *)(param_1 + 0x1c) = *puVar2;

          }

          if (*(uint *)(param_1 + 0x20) < *puVar2) {

            *(uint *)(param_1 + 0x20) = *puVar2;

          }

          uVar3 = uVar3 + 1;

          puVar2 = puVar2 + 1;

        } while (uVar3 < *(uint *)(param_1 + 4));

      }

      *(undefined1 *)(param_1 + 0x24) = 0;

    }

  }

  return;

}





// --- FUN_0044cc30 at 0x0044CC30 (size: 36) ---


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



{

  *param_1 = &PTR_FUN_0079c26c;

  FUN_0044ca90();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0044cc60 at 0x0044CC60 (size: 88) ---


undefined4 * FUN_0044cc60(void)



{

  undefined4 *puVar1;

  

  if (DAT_0086734c != 0) {

                    /* WARNING: Could not recover jumptable at 0x0044cc75. Too many branches */

                    /* WARNING: Treating indirect jump as call */

    puVar1 = (undefined4 *)(**(code **)(*DAT_00870340 + 0x18))();

    return puVar1;

  }

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

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

    puVar1[1] = 0;

    puVar1[2] = 0;

    puVar1[4] = 0;

    *(undefined1 *)(puVar1 + 5) = 0;

    *(undefined1 *)((int)puVar1 + 0x15) = 0;

    *(undefined1 *)((int)puVar1 + 0x16) = 0;

    *(undefined1 *)((int)puVar1 + 0x17) = 0;

    puVar1[7] = 0;

    puVar1[8] = 0;

    *(undefined1 *)(puVar1 + 9) = 0;

    *puVar1 = &PTR_FUN_0079c26c;

    *(undefined1 *)(puVar1 + 3) = 2;

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

    return puVar1;

  }

  return (undefined4 *)0x0;

}





// --- FUN_0044ccc0 at 0x0044CCC0 (size: 145) ---


undefined1 __thiscall FUN_0044ccc0(int *param_1,int param_2)



{

  char cVar1;

  uint uVar2;

  uint uVar3;

  undefined4 *puVar4;

  undefined4 *puVar5;

  

  cVar1 = (**(code **)(*param_1 + 4))

                    (*(undefined4 *)(param_2 + 8),*(undefined1 *)(param_2 + 0xc),

                     *(undefined1 *)(param_2 + 0x14),*(undefined1 *)(param_2 + 0x15),

                     *(undefined1 *)(param_2 + 0x18));

  if (cVar1 == '\0') {

    return 0;

  }

  if (*(uint *)(param_2 + 4) <= (uint)param_1[2]) {

    param_1[1] = *(uint *)(param_2 + 4);

    *(undefined1 *)(param_1 + 9) = 1;

    *(undefined1 *)((int)param_1 + 0x17) = 1;

  }

  *(undefined1 *)((int)param_1 + 0x16) = 1;

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

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

    return 0;

  }

  uVar2 = (uint)*(byte *)(param_1 + 3) * param_1[2];

  puVar4 = *(undefined4 **)(param_2 + 0x10);

  puVar5 = (undefined4 *)param_1[4];

  for (uVar3 = uVar2 >> 2; uVar3 != 0; uVar3 = uVar3 - 1) {

    *puVar5 = *puVar4;

    puVar4 = puVar4 + 1;

    puVar5 = puVar5 + 1;

  }

  for (uVar2 = uVar2 & 3; uVar2 != 0; uVar2 = uVar2 - 1) {

    *(undefined1 *)puVar5 = *(undefined1 *)puVar4;

    puVar4 = (undefined4 *)((int)puVar4 + 1);

    puVar5 = (undefined4 *)((int)puVar5 + 1);

  }

  *(undefined1 *)((int)param_1 + 0x16) = 0;

  *(undefined1 *)((int)param_1 + 0x17) = 1;

  *(undefined1 *)(param_1 + 9) = 1;

  return 1;

}





// --- FUN_0044cd60 at 0x0044CD60 (size: 140) ---


void __thiscall FUN_0044cd60(int *param_1,int param_2)



{

  char cVar1;

  int *piVar2;

  

  FUN_0040ad10(4);

  piVar2 = (int *)FUN_0040acf0(4);

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

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

      param_1[2] = *piVar2;

    }

    else {

      *piVar2 = param_1[2];

    }

  }

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

    cVar1 = (**(code **)(*param_1 + 4))(param_1[2],2,1,1,1);

    if (cVar1 == '\0') goto LAB_0044cdbc;

  }

  *(undefined1 *)((int)param_1 + 0x16) = 1;

  if (param_1[4] != 0) {

    FUN_00401590(param_1[4],(uint)*(byte *)(param_1 + 3) * param_1[1],param_2);

    *(undefined1 *)((int)param_1 + 0x17) = 1;

    *(undefined1 *)(param_1 + 9) = 1;

    *(undefined1 *)((int)param_1 + 0x16) = 0;

    return;

  }

LAB_0044cdbc:

  FUN_0040aa50();

  return;

}





// --- FUN_0044cdf0 at 0x0044CDF0 (size: 107) ---


undefined4 * __fastcall FUN_0044cdf0(undefined4 param_1)



{

  char cVar1;

  undefined4 *puVar2;

  

  puVar2 = (undefined4 *)FUN_005df0f5(0x28);

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

    puVar2 = (undefined4 *)0x0;

  }

  else {

    *puVar2 = &PTR_FUN_0079c26c;

    puVar2[1] = 0;

    puVar2[2] = 0;

    *(undefined1 *)(puVar2 + 3) = 2;

    puVar2[4] = 0;

    *(undefined1 *)(puVar2 + 5) = 0;

    *(undefined1 *)((int)puVar2 + 0x15) = 0;

    *(undefined1 *)((int)puVar2 + 0x16) = 0;

    *(undefined1 *)((int)puVar2 + 0x17) = 0;

    *(undefined1 *)(puVar2 + 6) = 1;

    puVar2[7] = 0;

    puVar2[8] = 0;

    *(undefined1 *)(puVar2 + 9) = 0;

  }

  cVar1 = FUN_0044ccc0(param_1);

  if (cVar1 == '\0') {

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

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

    }

    return (undefined4 *)0x0;

  }

  return puVar2;

}





// --- FUN_0044ce60 at 0x0044CE60 (size: 83) ---


undefined4 * __fastcall FUN_0044ce60(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_00793b3c;

  param_1[1] = 0;

  param_1[2] = 0;

  FUN_00406d60();

  param_1[6] = 0;

  param_1[7] = 0;

  param_1[8] = 0;

  *param_1 = &PTR_LAB_0079aa94;

  param_1[9] = &PTR_LAB_0079aa90;

  param_1[0xc] = &PTR_LAB_00795430;

  param_1[0xf] = 0;

  param_1[0xd] = param_1 + 0x10;

  param_1[0xe] = 8;

  *(undefined1 *)(param_1 + 0x20) = 1;

  return param_1;

}





// --- FUN_0044cec0 at 0x0044CEC0 (size: 676) ---


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



{

  bool bVar1;

  undefined1 uVar2;

  char cVar3;

  LONG LVar4;

  int iVar5;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 extraout_ECX_01;

  undefined4 extraout_ECX_02;

  undefined4 uVar6;

  undefined4 extraout_ECX_03;

  undefined4 *puVar7;

  uint uVar8;

  undefined2 local_98 [2];

  int local_94;

  undefined1 auStack_90 [12];

  undefined **appuStack_84 [13];

  void *pvStack_50;

  uint uStack_4c;

  

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

    return 0;

  }

  FUN_00401340("IndexArray");

  uVar2 = FUN_0065cc50(&local_94);

  puVar7 = (undefined4 *)(local_94 + -0x14);

  local_98[0] = CONCAT11(local_98[0]._1_1_,uVar2);

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

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

    (**(code **)*puVar7)(1);

  }

  if ((char)local_98[0] == '\0') {

    FUN_00401340("BinaryIndexArray");

    uVar2 = FUN_0065cc50(&local_94);

    puVar7 = (undefined4 *)(local_94 + -0x14);

    local_98[0] = CONCAT11(local_98[0]._1_1_,uVar2);

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

    uVar6 = extraout_ECX;

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

      (**(code **)*puVar7)(1);

      uVar6 = extraout_ECX_00;

    }

    if ((char)local_98[0] == '\0') {

      FUN_00401340("unable to parse indices");

      FUN_0065d620(param_2,uVar6);

      return 0;

    }

    bVar1 = false;

  }

  else {

    bVar1 = true;

  }

  FUN_0044ce60();

  if (bVar1) {

    iVar5 = FUN_0065ca40();

    param_1[2] = iVar5;

  }

  else {

    FUN_00406d60();

    iVar5 = FUN_0065ca90();

    uVar6 = extraout_ECX_01;

    if ((iVar5 == 0) || (cVar3 = FUN_00444f00(auStack_90), uVar6 = extraout_ECX_02, cVar3 == '\0'))

    {

      FUN_00401340("corrupt index data");

      FUN_0065d620(param_2,uVar6);

      FUN_00406f90();

      FUN_004466a0();

      return 0;

    }

    FUN_00446770(auStack_90);

    FUN_004449f0(param_1 + 2,appuStack_84);

    FUN_00406f90();

  }

  if (param_1[2] != 0) {

    cVar3 = (**(code **)(*param_1 + 4))(param_1[2],2,1,1,1);

    if ((cVar3 == '\0') || (*(undefined1 *)((int)param_1 + 0x16) = 1, param_1[4] == 0)) {

LAB_0044d0a9:

      FUN_004466a0();

      return 0;

    }

    uVar8 = 0;

    if (bVar1) {

      if (param_1[1] != 0) {

        do {

          local_94 = 0;

          (**(code **)(*param_2 + 0xc))(uVar8);

          cVar3 = FUN_00448290(&local_94);

          if (cVar3 == '\0') {

            uVar6 = extraout_ECX_03;

            FUN_00401340("unable to parse indices");

            FUN_0065d620(param_2,uVar6);

            *(undefined1 *)((int)param_1 + 0x16) = 0;

            *(undefined1 *)((int)param_1 + 0x17) = 1;

            *(undefined1 *)(param_1 + 9) = 1;

            goto LAB_0044d0a9;

          }

          *(undefined2 *)(param_1[4] + uVar8 * 2) = (undefined2)local_94;

          uVar8 = uVar8 + 1;

        } while (uVar8 < (uint)param_1[1]);

      }

    }

    else if (param_1[1] != 0) {

      do {

        FUN_004019e0(local_98,appuStack_84);

        *(undefined2 *)(param_1[4] + uVar8 * 2) = local_98[0];

        uVar8 = uVar8 + 1;

      } while (uVar8 < (uint)param_1[1]);

    }

    *(undefined1 *)((int)param_1 + 0x16) = 0;

    *(undefined1 *)((int)param_1 + 0x17) = 1;

    *(undefined1 *)(param_1 + 9) = 1;

  }

  FUN_0065e850();

  appuStack_84[0] = &PTR_LAB_0079aa94;

  if ((uStack_4c & 0x80000000) == 0x80000000) {

    operator_delete__(pvStack_50);

  }

  FUN_0040b060();

  return 1;

}





// --- FUN_0044d180 at 0x0044D180 (size: 195) ---


void __fastcall FUN_0044d180(int param_1)



{

  undefined *puVar1;

  undefined *puVar2;

  LONG LVar3;

  LONG *pLVar4;

  

  puVar2 = PTR_DAT_00818344;

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

  InterlockedIncrement(pLVar4);

  puVar1 = *(undefined **)(param_1 + 0x30);

  if (puVar1 != puVar2) {

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

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

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

    }

    *(undefined **)(param_1 + 0x30) = puVar2;

    InterlockedIncrement(pLVar4);

  }

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

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

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

  }

  *(undefined4 *)(param_1 + 0x34) = DAT_0083c150;

  puVar1 = *(undefined **)(param_1 + 0x38);

  if (puVar1 != PTR_DAT_00818344) {

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

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

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

    }

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

    *(undefined **)(param_1 + 0x38) = PTR_DAT_00818344;

    InterlockedIncrement(pLVar4);

  }

  *(undefined4 *)(param_1 + 0x3c) = 2;

  *(undefined1 *)(param_1 + 0x4c) = 1;

  *(undefined1 *)(param_1 + 0x4d) = 0;

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

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

  *(undefined1 *)(param_1 + 100) = 1;

  return;

}





// --- FUN_0044d2d0 at 0x0044D2D0 (size: 151) ---


undefined4 __fastcall FUN_0044d2d0(int param_1)



{

  int *piVar1;

  int iVar2;

  uint uVar3;

  

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

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

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

  }

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

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

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

  }

  if (*(int *)(param_1 + 0x5c) != 0) {

    uVar3 = 0;

    do {

      piVar1 = *(int **)(*(int *)(param_1 + 0x54) + uVar3 * 4);

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

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

        *(undefined4 *)(*(int *)(param_1 + 0x54) + uVar3 * 4) = 0;

      }

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 0x5c));

  }

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

  if ((*(uint *)(param_1 + 0x58) & 0x80000000) != 0x80000000) {

    if (*(int *)(param_1 + 0x54) != 0) {

      iVar2 = (*(uint *)(param_1 + 0x58) & 0x7fffffff) - 1;

      while (-1 < iVar2) {

        iVar2 = iVar2 + -1;

        *(undefined4 *)(*(int *)(param_1 + 0x54) + 4 + iVar2 * 4) = 0;

      }

    }

    return 1;

  }

  operator_delete__(*(void **)(param_1 + 0x54));

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

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

  return 1;

}





// --- FUN_0044d410 at 0x0044D410 (size: 174) ---


void __fastcall FUN_0044d410(int param_1)



{

  int *piVar1;

  LONG LVar2;

  int iVar3;

  uint uVar4;

  undefined4 *puVar5;

  

  FUN_0044d2d0();

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

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

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

  }

  uVar4 = 0;

  if (*(int *)(param_1 + 0x48) != 0) {

    do {

      piVar1 = *(int **)(*(int *)(param_1 + 0x40) + uVar4 * 4);

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

        puVar5 = (undefined4 *)(*piVar1 + -0x14);

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

        if ((LVar2 == 0) && (puVar5 != (undefined4 *)0x0)) {

          (**(code **)*puVar5)(1);

        }

        operator_delete(piVar1);

      }

      *(undefined4 *)(*(int *)(param_1 + 0x40) + uVar4 * 4) = 0;

      uVar4 = uVar4 + 1;

    } while (uVar4 < *(uint *)(param_1 + 0x48));

  }

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

  if ((*(uint *)(param_1 + 0x44) & 0x80000000) == 0x80000000) {

    operator_delete__(*(void **)(param_1 + 0x40));

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

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

    return;

  }

  if (*(int *)(param_1 + 0x40) != 0) {

    iVar3 = (*(uint *)(param_1 + 0x44) & 0x7fffffff) - 1;

    while (-1 < iVar3) {

      iVar3 = iVar3 + -1;

      *(undefined4 *)(*(int *)(param_1 + 0x40) + 4 + iVar3 * 4) = 0;

    }

  }

  return;

}





// --- FUN_0044d790 at 0x0044D790 (size: 16) ---


void FUN_0044d790(void)



{

  FUN_0044d410();

  FUN_0044d180();

  return;

}





// --- FUN_0044da30 at 0x0044DA30 (size: 144) ---


void __fastcall FUN_0044da30(undefined4 *param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  *param_1 = &PTR_LAB_0079c2e0;

  FUN_0044d410();

  if ((param_1[0x16] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x15]);

  }

  if ((param_1[0x11] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[0x10]);

  }

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

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

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

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

  }

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

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

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

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

  }

  FUN_004154b0();

  return;

}





// --- FUN_0044dac0 at 0x0044DAC0 (size: 30) ---


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



{

  FUN_0044da30();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0044dae0 at 0x0044DAE0 (size: 101) ---


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



uint __thiscall FUN_0044dae0(undefined4 *param_1,float *param_2)



{

  float *pfVar1;

  uint uVar2;

  

  uVar2 = 0;

  if (param_1[2] != 0) {

    pfVar1 = (float *)*param_1;

    do {

      if (ABS(*pfVar1 - *param_2) < _DAT_0079c33c != (ABS(*pfVar1 - *param_2) == _DAT_0079c33c)) {

        if (ABS(pfVar1[1] - param_2[1]) < _DAT_0079c33c !=

            (ABS(pfVar1[1] - param_2[1]) == _DAT_0079c33c)) {

          if (ABS(pfVar1[2] - param_2[2]) < _DAT_0079c33c !=

              (ABS(pfVar1[2] - param_2[2]) == _DAT_0079c33c)) {

            return uVar2;

          }

        }

      }

      uVar2 = uVar2 + 1;

      pfVar1 = pfVar1 + 3;

    } while (uVar2 < (uint)param_1[2]);

  }

  return 0xffffffff;

}





// --- FUN_0044db50 at 0x0044DB50 (size: 119) ---


void __thiscall FUN_0044db50(int param_1,int param_2)



{

  undefined2 *puVar1;

  uint uVar2;

  

  uVar2 = 0;

  do {

    FUN_0040ad10(2);

    puVar1 = (undefined2 *)FUN_0040acf0(2);

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

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

        *(undefined2 *)(param_1 + uVar2 * 2) = *puVar1;

      }

      else {

        *puVar1 = *(undefined2 *)(param_1 + uVar2 * 2);

      }

    }

    FUN_0040ad10(2);

    puVar1 = (undefined2 *)FUN_0040acf0(2);

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

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

        *(undefined2 *)(param_1 + 6 + uVar2 * 2) = *puVar1;

      }

      else {

        *puVar1 = *(undefined2 *)(param_1 + 6 + uVar2 * 2);

      }

    }

    uVar2 = uVar2 + 1;

  } while (uVar2 < 3);

  return;

}





// --- FUN_0044dbd0 at 0x0044DBD0 (size: 119) ---


void __thiscall FUN_0044dbd0(int param_1,int param_2)



{

  undefined2 *puVar1;

  uint uVar2;

  

  uVar2 = 0;

  do {

    FUN_0040ad10(2);

    puVar1 = (undefined2 *)FUN_0040acf0(2);

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

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

        *(undefined2 *)(param_1 + uVar2 * 2) = *puVar1;

      }

      else {

        *puVar1 = *(undefined2 *)(param_1 + uVar2 * 2);

      }

    }

    FUN_0040ad10(2);

    puVar1 = (undefined2 *)FUN_0040acf0(2);

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

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

        *(undefined2 *)(param_1 + 4 + uVar2 * 2) = *puVar1;

      }

      else {

        *puVar1 = *(undefined2 *)(param_1 + 4 + uVar2 * 2);

      }

    }

    uVar2 = uVar2 + 1;

  } while (uVar2 < 2);

  return;

}





// --- FUN_0044dc50 at 0x0044DC50 (size: 92) ---


void __fastcall FUN_0044dc50(int *param_1)



{

  int iVar1;

  

  param_1[2] = 0;

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

    operator_delete__((void *)*param_1);

    *param_1 = 0;

    param_1[1] = 0;

    return;

  }

  if (*param_1 != 0) {

    iVar1 = (param_1[1] & 0x7fffffffU) - 1;

    while (-1 < iVar1) {

      iVar1 = iVar1 + -1;

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

    }

  }

  return;

}





// --- FUN_0044dcb0 at 0x0044DCB0 (size: 83) ---


void __fastcall FUN_0044dcb0(int *param_1)



{

  int iVar1;

  

  param_1[2] = 0;

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

    if (*param_1 != 0) {

      iVar1 = (param_1[1] & 0x7fffffffU) - 1;

      while (-1 < iVar1) {

        iVar1 = iVar1 + -1;

        *(undefined4 *)(*param_1 + 4 + iVar1 * 4) = 0;

      }

    }

    return;

  }

  operator_delete__((void *)*param_1);

  *param_1 = 0;

  param_1[1] = 0;

  return;

}





// --- FUN_0044dd10 at 0x0044DD10 (size: 148) ---


undefined4 __thiscall FUN_0044dd10(int *param_1,uint param_2)



{

  int iVar1;

  int iVar2;

  

  if (param_2 < (uint)param_1[2]) {

    return 0;

  }

  if ((param_1[1] & 0x7fffffffU) < param_2) {

    if (param_2 == 0) {

      FUN_0044dc50();

      return 1;

    }

    iVar1 = thunk_FUN_005df0f5(param_2 * 4);

    if (iVar1 == 0) {

      return 0;

    }

    if (*param_1 != 0) {

      iVar2 = param_1[2] + -1;

      while (-1 < iVar2) {

        iVar2 = iVar2 + -1;

        *(undefined4 *)(iVar1 + 4 + iVar2 * 4) = *(undefined4 *)(*param_1 + 4 + iVar2 * 4);

      }

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

        operator_delete__((void *)*param_1);

      }

    }

    *param_1 = iVar1;

    param_1[1] = param_2 | 0x80000000;

  }

  return 1;

}





// --- FUN_0044ddb0 at 0x0044DDB0 (size: 91) ---


undefined1 __thiscall FUN_0044ddb0(int *param_1,uint param_2,undefined4 param_3)



{

  char cVar1;

  uint uVar2;

  

  if ((param_1[1] & 0x7fffffffU) < param_2) {

    uVar2 = param_2;

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

      uVar2 = FUN_00453850(param_2);

    }

    cVar1 = FUN_0044dd10(uVar2);

    if (cVar1 == '\0') {

      return 0;

    }

  }

  else {

    uVar2 = param_2;

    if (param_2 < (uint)param_1[2]) {

      do {

        *(undefined4 *)(*param_1 + uVar2 * 4) = param_3;

        uVar2 = uVar2 + 1;

      } while (uVar2 < (uint)param_1[2]);

    }

  }

  param_1[2] = param_2;

  return 1;

}





// --- FUN_0044de10 at 0x0044DE10 (size: 203) ---


undefined4 __thiscall FUN_0044de10(int *param_1,uint param_2)



{

  undefined4 *puVar1;

  uint uVar2;

  int iVar3;

  int iVar4;

  undefined4 *puVar5;

  

  uVar2 = param_2;

  if (param_2 < (uint)param_1[2]) {

    return 0;

  }

  if ((param_1[1] & 0x7fffffffU) < param_2) {

    if (param_2 == 0) {

      FUN_004cd4c0();

      return 1;

    }

    iVar3 = thunk_FUN_005df0f5(param_2 * 0xc);

    if (iVar3 == 0) {

      return 0;

    }

    FUN_00401000(iVar3,0xc,param_2,FUN_0050a140);

    if (*param_1 != 0) {

      param_2 = param_1[2];

      if (-1 < (int)(param_2 + -1)) {

        iVar4 = (param_2 + -1) * 0xc;

        do {

          puVar5 = (undefined4 *)(*param_1 + iVar4);

          puVar1 = (undefined4 *)(iVar4 + iVar3);

          *puVar1 = *puVar5;

          puVar1[1] = puVar5[1];

          puVar1[2] = puVar5[2];

          iVar4 = iVar4 + -0xc;

          param_2 = param_2 + -1;

        } while (param_2 != 0);

      }

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

        operator_delete__((void *)*param_1);

      }

    }

    *param_1 = iVar3;

    param_1[1] = uVar2 | 0x80000000;

  }

  return 1;

}





// --- FUN_0044def0 at 0x0044DEF0 (size: 82) ---


void __fastcall FUN_0044def0(int *param_1)



{

  int iVar1;

  

  param_1[2] = 0;

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

    if (*param_1 != 0) {

      iVar1 = (param_1[1] & 0x7fffffffU) - 1;

      while (-1 < iVar1) {

        iVar1 = iVar1 + -1;

        *(undefined2 *)(*param_1 + 2 + iVar1 * 2) = 0;

      }

    }

    return;

  }

  operator_delete__((void *)*param_1);

  *param_1 = 0;

  param_1[1] = 0;

  return;

}





// --- FUN_0044df50 at 0x0044DF50 (size: 40) ---


void __fastcall FUN_0044df50(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_FUN_0079c340;

  param_1[2] = 0;

  param_1[3] = 0;

  param_1[4] = 0;

  param_1[5] = 0;

  param_1[6] = 0;

  param_1[7] = 0xffffffff;

  return;

}





// --- FUN_0044df80 at 0x0044DF80 (size: 189) ---


void __fastcall FUN_0044df80(undefined4 *param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  int iVar3;

  uint uVar4;

  

  puVar2 = (undefined4 *)param_1[6];

  *param_1 = &PTR_FUN_0079c340;

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

    piVar1 = puVar2 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

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

    }

    param_1[6] = 0;

  }

  uVar4 = 0;

  if (param_1[5] != 0) {

    do {

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

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

        piVar1 = puVar2 + 1;

        *piVar1 = *piVar1 + -1;

        if (*piVar1 == 0) {

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

        }

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

      }

      uVar4 = uVar4 + 1;

    } while (uVar4 < (uint)param_1[5]);

  }

  param_1[5] = 0;

  if ((param_1[4] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[3]);

    param_1[3] = 0;

    param_1[4] = 0;

  }

  else if (param_1[3] != 0) {

    iVar3 = (param_1[4] & 0x7fffffff) - 1;

    while (-1 < iVar3) {

      iVar3 = iVar3 + -1;

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

    }

  }

  param_1[2] = 0;

  if ((param_1[4] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[3]);

  }

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_0044e050 at 0x0044E050 (size: 102) ---


void __fastcall FUN_0044e050(undefined4 *param_1)



{

  *param_1 = &PTR_FUN_0079c344;

  if ((param_1[9] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[8]);

  }

  if ((param_1[6] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[5]);

  }

  if ((param_1[3] & 0x80000000) == 0x80000000) {

    operator_delete__((void *)param_1[2]);

  }

  *param_1 = &PTR_LAB_00796c4c;

  return;

}





// --- FUN_0044e0c0 at 0x0044E0C0 (size: 206) ---


void __thiscall FUN_0044e0c0(int *param_1,int param_2)



{

  undefined1 *puVar1;

  uint *puVar2;

  uint uVar3;

  undefined1 *puVar4;

  undefined2 *puVar5;

  uint uVar6;

  uint uVar7;

  

  uVar7 = param_1[2];

  FUN_0040ad10(4);

  puVar2 = (uint *)FUN_0040acf0(4);

  uVar6 = 0;

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

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

      uVar7 = *puVar2;

    }

    else {

      *puVar2 = uVar7;

    }

  }

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

    uVar3 = FUN_0040a8f0();

    if (uVar3 < uVar7) {

      FUN_0040aa50();

      return;

    }

    param_1[2] = 0;

    FUN_0044ddb0(uVar7,1);

  }

  if (param_1[2] != 0) {

    do {

      puVar1 = (undefined1 *)(*param_1 + uVar6 * 4);

      FUN_0040ad10(1);

      puVar4 = (undefined1 *)FUN_0040acf0(1);

      if (puVar4 != (undefined1 *)0x0) {

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

          *puVar1 = *puVar4;

        }

        else {

          *puVar4 = *puVar1;

        }

      }

      FUN_0040ad10(2);

      puVar5 = (undefined2 *)FUN_0040acf0(2);

      if (puVar5 != (undefined2 *)0x0) {

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

          *(undefined2 *)(puVar1 + 2) = *puVar5;

        }

        else {

          *puVar5 = *(undefined2 *)(puVar1 + 2);

        }

      }

      uVar6 = uVar6 + 1;

    } while (uVar6 < (uint)param_1[2]);

  }

  return;

}





// --- FUN_0044e190 at 0x0044E190 (size: 150) ---


undefined4 __thiscall FUN_0044e190(int *param_1,uint param_2)



{

  int iVar1;

  int iVar2;

  

  if (param_2 < (uint)param_1[2]) {

    return 0;

  }

  if ((param_1[1] & 0x7fffffffU) < param_2) {

    if (param_2 == 0) {

      FUN_0044def0();

      return 1;

    }

    iVar1 = thunk_FUN_005df0f5(param_2 * 2);

    if (iVar1 == 0) {

      return 0;

    }

    if (*param_1 != 0) {

      iVar2 = param_1[2] + -1;

      while (-1 < iVar2) {

        iVar2 = iVar2 + -1;

        *(undefined2 *)(iVar1 + 2 + iVar2 * 2) = *(undefined2 *)(*param_1 + 2 + iVar2 * 2);

      }

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

        operator_delete__((void *)*param_1);

      }

    }

    *param_1 = iVar1;

    param_1[1] = param_2 | 0x80000000;

  }

  return 1;

}





// --- FUN_0044e230 at 0x0044E230 (size: 139) ---


undefined1 __thiscall FUN_0044e230(int *param_1,uint param_2,char param_3)



{

  char cVar1;

  uint uVar2;

  int iVar3;

  undefined4 *puVar4;

  undefined4 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  if ((param_1[1] & 0x7fffffffU) < param_2) {

    uVar2 = param_2;

    if (param_3 == '\0') {

      uVar2 = FUN_00453850(param_2);

    }

    cVar1 = FUN_004f6680(uVar2);

    if (cVar1 == '\0') {

      return 0;

    }

  }

  else if (param_2 < (uint)param_1[2]) {

    iVar3 = param_2 * 0xc;

    uVar2 = param_2;

    do {

      puVar4 = (undefined4 *)(*param_1 + iVar3);

      *puVar4 = local_c;

      puVar4[1] = local_8;

      puVar4[2] = local_4;

      uVar2 = uVar2 + 1;

      iVar3 = iVar3 + 0xc;

    } while (uVar2 < (uint)param_1[2]);

  }

  param_1[2] = param_2;

  return 1;

}





// --- FUN_0044e2c0 at 0x0044E2C0 (size: 135) ---


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



{

  undefined2 *puVar1;

  char cVar2;

  undefined2 *puVar3;

  uint uVar4;

  undefined2 *puVar5;

  

  if ((param_1[1] & 0x7fffffffU) < (param_2[1] & 0x7fffffff)) {

    param_1[2] = 0;

    cVar2 = FUN_0044e190(param_2[1] & 0x7fffffff);

    if (cVar2 == '\0') {

      return param_1;

    }

  }

  puVar3 = (undefined2 *)*param_2;

  puVar1 = puVar3 + param_2[2];

  puVar5 = (undefined2 *)*param_1;

  for (; puVar3 < puVar1; puVar3 = puVar3 + 1) {

    *puVar5 = *puVar3;

    puVar5 = puVar5 + 1;

  }

  uVar4 = param_2[2];

  if (uVar4 < (uint)param_1[2]) {

    do {

      *(undefined2 *)(*param_1 + uVar4 * 2) = 0;

      uVar4 = uVar4 + 1;

    } while (uVar4 < (uint)param_1[2]);

  }

  param_1[2] = param_2[2];

  return param_1;

}





// --- FUN_0044e350 at 0x0044E350 (size: 30) ---


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



{

  FUN_0044df80();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0044e370 at 0x0044E370 (size: 30) ---


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



{

  FUN_0044e050();

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

    operator_delete(param_1);

  }

  return param_1;

}





// --- FUN_0044e390 at 0x0044E390 (size: 140) ---


void __thiscall FUN_0044e390(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_0044e230(uVar3,1);

  }

  uVar3 = 0;

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

    do {

      FUN_0044db50(param_2);

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 8));

  }

  return;

}





// --- FUN_0044e420 at 0x0044E420 (size: 137) ---


void __thiscall FUN_0044e420(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_005d8710(uVar3,1);

  }

  uVar3 = 0;

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

    do {

      FUN_0044dbd0(param_2);

      uVar3 = uVar3 + 1;

    } while (uVar3 < *(uint *)(param_1 + 8));

  }

  return;

}





// --- FUN_0044e4b0 at 0x0044E4B0 (size: 142) ---


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



{

  uint *puVar1;

  int iVar2;

  undefined4 *puVar3;

  

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

    if ((*(uint *)((int)param_1 + 8) & 0x80000000) == 0x80000000) {

      operator_delete__(*(void **)((int)param_1 + 4));

    }

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

      operator_delete(param_1);

    }

    return param_1;

  }

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

  if (-1 < iVar2 + -1) {

    puVar3 = (undefined4 *)((int)param_1 + iVar2 * 0x10 + 4);

    do {

      puVar1 = puVar3 + -3;

      puVar3 = puVar3 + -4;

      if ((*puVar1 & 0x80000000) == 0x80000000) {

        operator_delete__((void *)*puVar3);

      }

      iVar2 = iVar2 + -1;

    } while (iVar2 != 0);

  }

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

    operator_delete__((void *)((int)param_1 + -4));

  }

  return (void *)((int)param_1 + -4);

}





// --- FUN_0044e540 at 0x0044E540 (size: 129) ---


void __fastcall FUN_0044e540(int *param_1)



{

  uint uVar1;

  int iVar2;

  undefined4 local_10;

  undefined4 local_c;

  undefined4 local_8;

  undefined4 local_4;

  

  param_1[2] = 0;

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

    if (*param_1 != 0) {

      uVar1 = param_1[1] & 0x7fffffff;

      if (-1 < (int)(uVar1 - 1)) {

        local_c = 0;

        local_8 = 0;

        local_4 = 0;

        iVar2 = (uVar1 - 1) * 0x10;

        do {

          *(undefined4 *)(*param_1 + iVar2) = local_10;

          FUN_0044e2c0(&local_c);

          iVar2 = iVar2 + -0x10;

          uVar1 = uVar1 - 1;

        } while (uVar1 != 0);

      }

    }

    return;

  }

  if (*param_1 != 0) {

    FUN_0044e4b0(3);

  }

  *param_1 = 0;

  param_1[1] = 0;

  return;

}





// --- FUN_0044e5d0 at 0x0044E5D0 (size: 64) ---


void __thiscall FUN_0044e5d0(int param_1,int param_2)



{

  char cVar1;

  uint uVar2;

  undefined4 uVar3;

  

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

  uVar2 = *(uint *)(param_1 + 0x10) & 0x7fffffff;

  if (uVar2 <= *(uint *)(param_1 + 0x14)) {

    uVar3 = FUN_00453850(uVar2 + 1);

    cVar1 = FUN_004180a0(uVar3);

    if (cVar1 == '\0') {

      return;

    }

  }

  *(int *)(*(int *)(param_1 + 0xc) + *(int *)(param_1 + 0x14) * 4) = param_2;

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

  return;

}





// --- FUN_0044e610 at 0x0044E610 (size: 452) ---


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



{

  char cVar1;

  int *piVar2;

  int iVar3;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 extraout_ECX_01;

  undefined4 *puVar4;

  undefined4 uVar5;

  

  if (param_2 == 0) {

    return 0;

  }

  FUN_0065cf90(param_2);

  piVar2 = (int *)FUN_0065c810();

  do {

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

      FUN_0065cae0();

      return 1;

    }

    cVar1 = FUN_0065cc50(&DAT_0083c1ec);

    if (cVar1 == '\0') {

      cVar1 = FUN_0065cc50(&DAT_0083c204);

      if (cVar1 == '\0') {

        uVar5 = extraout_ECX_00;

        FUN_00401340("Unrecognized keyword in mesh file");

        FUN_0065d670(piVar2,uVar5);

      }

      else {

        iVar3 = FUN_005df0f5(0x34);

        if (iVar3 == 0) {

          puVar4 = (undefined4 *)0x0;

        }

        else {

          puVar4 = (undefined4 *)FUN_0044f2c0();

        }

        puVar4[3] = param_3;

        cVar1 = FUN_0044f570(piVar2);

        if (cVar1 == '\0') {

          uVar5 = extraout_ECX_01;

          FUN_00401340("Error parsing mesh batch");

          FUN_0065d620(piVar2,uVar5);

          iVar3 = puVar4[1];

          puVar4[1] = iVar3 + -1;

          if (iVar3 + -1 == 0) {

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

            FUN_0065cae0();

            return 0;

          }

          goto LAB_0044e785;

        }

        FUN_0044e5d0(puVar4);

        piVar2 = puVar4 + 1;

        *piVar2 = *piVar2 + -1;

        if (*piVar2 == 0) {

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

        }

      }

    }

    else {

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

      iVar3 = FUN_0065ca40();

      if (iVar3 == 0) {

LAB_0044e785:

        FUN_0065cae0();

        return 0;

      }

      puVar4 = &DAT_0083c1f0;

      (**(code **)(*piVar2 + 0xc))(0,&DAT_0083c1f0);

      cVar1 = FUN_0065cc50(puVar4);

      if (cVar1 == '\0') {

        puVar4 = &DAT_0083c1f4;

        (**(code **)(*piVar2 + 0xc))(0,&DAT_0083c1f4);

        cVar1 = FUN_0065cc50(puVar4);

        if (cVar1 == '\0') {

          puVar4 = &DAT_0083c1f8;

          (**(code **)(*piVar2 + 0xc))(0,&DAT_0083c1f8);

          cVar1 = FUN_0065cc50(puVar4);

          if (cVar1 == '\0') {

            uVar5 = extraout_ECX;

            FUN_00401340("Unrecognized mesh fragment type");

            FUN_0065d620(piVar2,uVar5);

            goto LAB_0044e785;

          }

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

        }

        else {

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

        }

      }

      else {

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

      }

    }

    piVar2 = (int *)FUN_0065cb10();

  } while( true );

}





// --- FUN_0044e7e0 at 0x0044E7E0 (size: 388) ---


/* WARNING: Removing unreachable block (ram,0x0044e934) */

/* WARNING: Removing unreachable block (ram,0x0044e82c) */

/* WARNING: Removing unreachable block (ram,0x0044e830) */

/* WARNING: Removing unreachable block (ram,0x0044e83f) */

/* WARNING: Removing unreachable block (ram,0x0044e850) */

/* WARNING: Removing unreachable block (ram,0x0044e857) */

/* WARNING: Removing unreachable block (ram,0x0044e85f) */

/* WARNING: Removing unreachable block (ram,0x0044e8a6) */

/* WARNING: Removing unreachable block (ram,0x0044e8b5) */

/* WARNING: Removing unreachable block (ram,0x0044e8ca) */

/* WARNING: Removing unreachable block (ram,0x0044e86b) */

/* WARNING: Removing unreachable block (ram,0x0044e87c) */

/* WARNING: Removing unreachable block (ram,0x0044e895) */

/* WARNING: Removing unreachable block (ram,0x0044e8d5) */

/* WARNING: Removing unreachable block (ram,0x0044e951) */

/* WARNING: Removing unreachable block (ram,0x0044e8fa) */

/* WARNING: Removing unreachable block (ram,0x0044e900) */



void __fastcall FUN_0044e7e0(int param_1)



{

  if (*(int *)(param_1 + 0x18) == 0) {

    FUN_005c0220(param_1 + 0xc);

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

    FUN_004180a0(*(undefined4 *)(param_1 + 0x14));

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

  }

  return;

}





// --- FUN_0044e970 at 0x0044E970 (size: 829) ---


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



{

  undefined2 *puVar1;

  undefined2 *puVar2;

  ushort uVar3;

  ushort uVar4;

  int iVar5;

  int iVar6;

  char cVar7;

  int *piVar8;

  uint uVar9;

  uint uVar10;

  ushort *puVar11;

  uint uVar12;

  int iVar13;

  ushort *puVar14;

  int iVar15;

  uint uVar16;

  int *piVar17;

  uint local_2c;

  uint local_28;

  ushort local_20;

  int local_18;

  uint local_14;

  int *local_c;

  

  iVar13 = param_2[2];

  iVar15 = 0;

  piVar8 = param_2;

  if (iVar13 != 0) {

    piVar17 = (int *)*param_2;

    do {

      uVar12 = *(uint *)(*(int *)(*(int *)(*(int *)(*(int *)(*piVar17 + 0xc) + 0x40) + 8) +

                                 *(int *)(*piVar17 + 0x18) * 4) + 4);

      piVar8 = (int *)(uVar12 * -0x55555555);

      iVar15 = iVar15 + uVar12 / 3;

      piVar17 = piVar17 + 4;

      iVar13 = iVar13 + -1;

    } while (iVar13 != 0);

    if (iVar15 != 0) {

      FUN_004f6680(iVar15);

      piVar8 = (int *)FUN_00459e20(iVar15 * 3);

      local_c = (int *)0x0;

      if (param_2[2] != 0) {

        local_18 = 0;

        do {

          iVar13 = *(int *)(*param_2 + local_18);

          iVar15 = *param_2 + local_18;

          iVar13 = *(int *)(*(int *)(*(int *)(*(int *)(iVar13 + 0xc) + 0x40) + 8) +

                           *(int *)(iVar13 + 0x18) * 4);

          puVar14 = *(ushort **)(iVar13 + 0x10);

          for (uVar12 = *(uint *)(iVar13 + 4) / 3; uVar12 != 0; uVar12 = uVar12 - 1) {

            iVar13 = *(int *)(param_1 + 0x18);

            iVar5 = *(int *)(iVar13 + 0x1c);

            uVar9 = *(uint *)(iVar13 + 0x18) & 0x7fffffff;

            if (*(uint *)(iVar13 + 0x1c) < uVar9) {

LAB_0044eaa8:

              *(int *)(iVar13 + 0x1c) = *(int *)(iVar13 + 0x1c) + 1;

            }

            else {

              uVar9 = uVar9 + 1;

              if (uVar9 < 9) {

                uVar9 = 8;

              }

              else if (uVar9 < 0x4001) {

                iVar6 = 0x1f;

                if (uVar9 != 0) {

                  for (; uVar9 >> iVar6 == 0; iVar6 = iVar6 + -1) {

                  }

                }

                uVar10 = 1 << ((byte)iVar6 & 0x1f);

                if (uVar10 < uVar9) {

                  uVar9 = uVar10 * 2;

                }

              }

              else if ((uVar9 & 0x3fff) != 0) {

                uVar9 = uVar9 + (0x4000 - (uVar9 & 0x3fff));

              }

              cVar7 = FUN_004f6680(uVar9);

              if (cVar7 != '\0') goto LAB_0044eaa8;

            }

            puVar1 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x18) + 0x14) + iVar5 * 0xc);

            local_14 = 0;

            do {

              if (local_14 == 0) {

                iVar13 = *(int *)(iVar15 + 4);

                uVar3 = *(ushort *)(iVar13 + (uint)*puVar14 * 2);

                uVar4 = puVar14[1];

LAB_0044eb18:

                local_2c = (uint)uVar3;

                local_28 = (uint)*(ushort *)(iVar13 + (uint)uVar4 * 2);

              }

              else {

                if (local_14 == 1) {

                  iVar13 = *(int *)(iVar15 + 4);

                  uVar3 = *(ushort *)(iVar13 + (uint)puVar14[1] * 2);

                  uVar4 = puVar14[2];

                  goto LAB_0044eb18;

                }

                if (local_14 == 2) {

                  local_2c = (uint)*(ushort *)(*(int *)(iVar15 + 4) + (uint)puVar14[2] * 2);

                  local_28 = (uint)*(ushort *)(*(int *)(iVar15 + 4) + (uint)*puVar14 * 2);

                }

              }

              iVar13 = *(int *)(param_1 + 0x18);

              uVar9 = *(uint *)(iVar13 + 0x28);

              uVar10 = 0;

              local_20 = (ushort)iVar5;

              if (uVar9 != 0) {

                puVar11 = *(ushort **)(iVar13 + 0x20);

                do {

                  if (((*puVar11 == local_28) && (puVar11[1] == local_2c)) && (puVar11[3] == 0xffff)

                     ) {

                    if (uVar10 != 0xffff) {

                      (*(ushort **)(iVar13 + 0x20))[uVar10 * 4 + 3] = local_20;

                      goto LAB_0044ec1f;

                    }

                    break;

                  }

                  uVar10 = uVar10 + 1;

                  puVar11 = puVar11 + 4;

                } while (uVar10 < uVar9);

              }

              uVar10 = *(uint *)(iVar13 + 0x24) & 0x7fffffff;

              if (*(uint *)(iVar13 + 0x28) < uVar10) {

LAB_0044ebdd:

                *(int *)(iVar13 + 0x28) = *(int *)(iVar13 + 0x28) + 1;

              }

              else {

                uVar10 = uVar10 + 1;

                if (uVar10 < 9) {

                  uVar10 = 8;

                }

                else if (uVar10 < 0x4001) {

                  iVar6 = 0x1f;

                  if (uVar10 != 0) {

                    for (; uVar10 >> iVar6 == 0; iVar6 = iVar6 + -1) {

                    }

                  }

                  uVar16 = 1 << ((byte)iVar6 & 0x1f);

                  if (uVar16 < uVar10) {

                    uVar10 = uVar16 * 2;

                  }

                }

                else if ((uVar10 & 0x3fff) != 0) {

                  uVar10 = uVar10 + (0x4000 - (uVar10 & 0x3fff));

                }

                cVar7 = FUN_00459e20(uVar10);

                if (cVar7 != '\0') goto LAB_0044ebdd;

              }

              puVar2 = (undefined2 *)(*(int *)(*(int *)(param_1 + 0x18) + 0x20) + uVar9 * 8);

              *puVar2 = (undefined2)local_2c;

              puVar2[1] = (undefined2)local_28;

              puVar2[2] = local_20;

              puVar2[3] = 0xffff;

              uVar10 = uVar9;

LAB_0044ec1f:

              puVar1[local_14 + 3] = (short)uVar10;

              local_14 = local_14 + 1;

            } while (local_14 < 3);

            *puVar1 = *(undefined2 *)(*(int *)(iVar15 + 4) + (uint)*puVar14 * 2);

            puVar1[1] = *(undefined2 *)(*(int *)(iVar15 + 4) + (uint)puVar14[1] * 2);

            puVar11 = puVar14 + 2;

            puVar14 = puVar14 + 3;

            puVar1[2] = *(undefined2 *)(*(int *)(iVar15 + 4) + (uint)*puVar11 * 2);

          }

          piVar8 = (int *)((int)local_c + 1);

          local_18 = local_18 + 0x10;

          local_c = piVar8;

        } while (piVar8 < (int *)param_2[2]);

      }

    }

  }

  return piVar8;

}





// --- FUN_0044ecb0 at 0x0044ECB0 (size: 221) ---


undefined4 __thiscall FUN_0044ecb0(int *param_1,uint param_2)



{

  uint *puVar1;

  int iVar2;

  uint uVar3;

  uint *puVar4;

  int iVar5;

  

  uVar3 = param_2;

  if ((uint)param_1[2] <= param_2) {

    if (param_2 <= (param_1[1] & 0x7fffffffU)) {

      return 1;

    }

    if (param_2 == 0) {

      FUN_0044e540();

      return 1;

    }

    puVar4 = (uint *)thunk_FUN_005df0f5(param_2 * 0x10 + 4);

    if (puVar4 != (uint *)0x0) {

      puVar1 = puVar4 + 1;

      *puVar4 = param_2;

      FUN_00401000(puVar1,0x10,param_2,&LAB_0044dee0);

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

        if (*param_1 != 0) {

          param_2 = param_1[2];

          if (-1 < (int)(param_2 + -1)) {

            iVar5 = (param_2 + -1) * 0x10;

            do {

              iVar2 = *param_1;

              *(undefined4 *)(iVar5 + (int)puVar1) = *(undefined4 *)(iVar2 + iVar5);

              FUN_0044e2c0(iVar2 + iVar5 + 4);

              iVar5 = iVar5 + -0x10;

              param_2 = param_2 + -1;

            } while (param_2 != 0);

          }

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

            FUN_0044e4b0(3);

          }

        }

        *param_1 = (int)puVar1;

        param_1[1] = uVar3 | 0x80000000;

        return 1;

      }

    }

  }

  return 0;

}





// --- FUN_0044ed90 at 0x0044ED90 (size: 411) ---


void __thiscall FUN_0044ed90(int param_1,uint param_2,undefined4 param_3)



{

  int iVar1;

  char cVar2;

  undefined4 *puVar3;

  uint *puVar4;

  int iVar5;

  undefined4 uVar6;

  uint uVar7;

  undefined4 uVar8;

  char *pcVar9;

  uint uVar10;

  

  iVar1 = param_2;

  FUN_0040ad10(4);

  puVar3 = (undefined4 *)FUN_0040acf0(4);

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

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

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

    }

    else {

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

    }

  }

  uVar10 = *(uint *)(param_1 + 0x14);

  FUN_0040ad10(4);

  puVar4 = (uint *)FUN_0040acf0(4);

  if (puVar4 != (uint *)0x0) {

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

      uVar10 = *puVar4;

    }

    else {

      *puVar4 = uVar10;

    }

  }

  param_2 = uVar10;

  uVar10 = 0;

  if (param_2 != 0) {

    do {

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

        iVar5 = FUN_005df0f5(0x34);

        if (iVar5 == 0) {

          uVar6 = 0;

        }

        else {

          uVar6 = FUN_0044f2c0();

        }

        uVar7 = *(uint *)(param_1 + 0x10) & 0x7fffffff;

        if (uVar7 <= *(uint *)(param_1 + 0x14)) {

          uVar8 = FUN_00453850(uVar7 + 1);

          cVar2 = FUN_004180a0(uVar8);

          if (cVar2 == '\0') goto LAB_0044ee58;

        }

        *(undefined4 *)(*(int *)(param_1 + 0xc) + *(int *)(param_1 + 0x14) * 4) = uVar6;

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

      }

LAB_0044ee58:

      FUN_0044f450(iVar1,param_3);

      uVar10 = uVar10 + 1;

    } while (uVar10 < param_2);

  }

  cVar2 = *(int *)(param_1 + 0x18) != 0;

  FUN_0040ad10(1);

  pcVar9 = (char *)FUN_0040acf0(1);

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

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

      cVar2 = *pcVar9;

    }

    else {

      *pcVar9 = cVar2;

    }

  }

  if ((*(byte *)(iVar1 + 4) & 5) == 0) {

    if (cVar2 == '\0') {

      return;

    }

    if (cVar2 != '\x01') {

      FUN_0040aa50();

    }

  }

  if (cVar2 != '\0') {

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

      puVar3 = (undefined4 *)FUN_005df0f5(0x2c);

      if (puVar3 == (undefined4 *)0x0) {

        puVar3 = (undefined4 *)0x0;

      }

      else {

        puVar3[1] = 1;

        *puVar3 = &PTR_FUN_0079c344;

        puVar3[2] = 0;

        puVar3[3] = 0;

        puVar3[4] = 0;

        puVar3[5] = 0;

        puVar3[6] = 0;

        puVar3[7] = 0;

        puVar3[8] = 0;

        puVar3[9] = 0;

        puVar3[10] = 0;

      }

      *(undefined4 **)(param_1 + 0x18) = puVar3;

    }

    FUN_0044e0c0(iVar1);

    FUN_0044e390(iVar1);

    FUN_0044e420(iVar1);

  }

  return;

}





// --- FUN_0044ef30 at 0x0044EF30 (size: 681) ---


void __thiscall FUN_0044ef30(int param_1,int *param_2,int *param_3)



{

  undefined4 *puVar1;

  int *piVar2;

  int iVar3;

  int iVar4;

  int iVar5;

  char cVar6;

  undefined4 uVar7;

  int iVar8;

  uint uVar9;

  uint uVar10;

  undefined4 *puVar11;

  uint uVar12;

  uint local_14;

  undefined4 local_10;

  

  local_14 = 0;

  if (*(int *)(param_1 + 0x14) != 0) {

    do {

      iVar8 = *(int *)(*(int *)(param_1 + 0xc) + local_14 * 4);

      if (((*(int *)(iVar8 + 0x10) == -1) ||

          (iVar3 = *(int *)(*(int *)(*(int *)(*(int *)(iVar8 + 0xc) + 0x38) + 8) + 4 +

                           *(int *)(iVar8 + 0x10) * 8), iVar3 == 0)) ||

         ((*(char *)(iVar3 + 0x4c) != '\0' && (*(char *)(iVar3 + 0x4d) == '\0')))) {

        iVar3 = *(int *)(*(int *)(*(int *)(*(int *)(iVar8 + 0xc) + 0x3c) + 8) +

                        *(int *)(iVar8 + 0x14) * 4);

        if ((uint)param_3[2] < (param_3[1] & 0x7fffffffU)) {

LAB_0044efc4:

          param_3[2] = param_3[2] + 1;

        }

        else {

          uVar7 = FUN_00453850((param_3[1] & 0x7fffffffU) + 1);

          cVar6 = FUN_0044ecb0(uVar7);

          if (cVar6 != '\0') goto LAB_0044efc4;

        }

        piVar2 = (int *)(param_3[2] * 0x10 + -0x10 + *param_3);

        *piVar2 = iVar8;

        uVar10 = 0;

        if (*(int *)(iVar3 + 0x7c) != 0) {

          do {

            puVar11 = (undefined4 *)(*(int *)(iVar3 + 0xc) * uVar10 + *(int *)(iVar3 + 0x80));

            iVar8 = FUN_0044dae0(puVar11);

            if (iVar8 == -1) {

              if ((uint)param_2[2] < (param_2[1] & 0x7fffffffU)) {

LAB_0044f084:

                puVar1 = (undefined4 *)(*param_2 + param_2[2] * 0xc);

                *puVar1 = *puVar11;

                puVar1[1] = puVar11[1];

                puVar1[2] = puVar11[2];

                param_2[2] = param_2[2] + 1;

              }

              else {

                uVar9 = (param_2[1] & 0x7fffffffU) + 1;

                if (uVar9 < 9) {

                  uVar9 = 8;

                }

                else if (uVar9 < 0x4001) {

                  iVar8 = 0x1f;

                  if (uVar9 != 0) {

                    for (; uVar9 >> iVar8 == 0; iVar8 = iVar8 + -1) {

                    }

                  }

                  uVar12 = 1 << ((byte)iVar8 & 0x1f);

                  if (uVar12 < uVar9) {

                    uVar9 = uVar12 * 2;

                  }

                }

                else if ((uVar9 & 0x3fff) != 0) {

                  uVar9 = uVar9 + (0x4000 - (uVar9 & 0x3fff));

                }

                cVar6 = FUN_0044de10(uVar9);

                if (cVar6 != '\0') goto LAB_0044f084;

              }

              iVar4 = *(int *)(param_1 + 0x18);

              iVar8 = *(int *)(iVar4 + 0x10);

              local_10 = CONCAT31(local_10._1_3_,(undefined1)local_14);

              uVar9 = *(uint *)(iVar4 + 0xc) & 0x7fffffff;

              local_10 = CONCAT22((short)uVar10,(undefined2)local_10);

              if (uVar9 <= *(uint *)(iVar4 + 0x10)) {

                uVar9 = uVar9 + 1;

                if (uVar9 < 9) {

                  uVar9 = 8;

                }

                else if (uVar9 < 0x4001) {

                  iVar5 = 0x1f;

                  if (uVar9 != 0) {

                    for (; uVar9 >> iVar5 == 0; iVar5 = iVar5 + -1) {

                    }

                  }

                  uVar12 = 1 << ((byte)iVar5 & 0x1f);

                  if (uVar12 < uVar9) {

                    uVar9 = uVar12 * 2;

                  }

                }

                else if ((uVar9 & 0x3fff) != 0) {

                  uVar9 = uVar9 + (0x4000 - (uVar9 & 0x3fff));

                }

                cVar6 = FUN_0044dd10(uVar9);

                if (cVar6 == '\0') goto LAB_0044f133;

              }

              *(undefined4 *)(*(int *)(iVar4 + 8) + *(int *)(iVar4 + 0x10) * 4) = local_10;

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

            }

LAB_0044f133:

            if ((uint)piVar2[3] < (piVar2[2] & 0x7fffffffU)) {

LAB_0044f19b:

              *(short *)(piVar2[1] + piVar2[3] * 2) = (short)iVar8;

              piVar2[3] = piVar2[3] + 1;

            }

            else {

              uVar9 = (piVar2[2] & 0x7fffffffU) + 1;

              if (uVar9 < 9) {

                uVar9 = 8;

              }

              else if (uVar9 < 0x4001) {

                iVar4 = 0x1f;

                if (uVar9 != 0) {

                  for (; uVar9 >> iVar4 == 0; iVar4 = iVar4 + -1) {

                  }

                }

                uVar12 = 1 << ((byte)iVar4 & 0x1f);

                if (uVar12 < uVar9) {

                  uVar9 = uVar12 * 2;

                }

              }

              else if ((uVar9 & 0x3fff) != 0) {

                uVar9 = uVar9 + (0x4000 - (uVar9 & 0x3fff));

              }

              cVar6 = FUN_0044e190(uVar9);

              if (cVar6 != '\0') goto LAB_0044f19b;

            }

            uVar10 = uVar10 + 1;

          } while (uVar10 < *(uint *)(iVar3 + 0x7c));

        }

      }

      local_14 = local_14 + 1;

    } while (local_14 < *(uint *)(param_1 + 0x14));

  }

  return;

}





// --- FUN_0044f1e0 at 0x0044F1E0 (size: 212) ---


void __fastcall FUN_0044f1e0(int param_1)



{

  int *piVar1;

  undefined4 *puVar2;

  int iStack_18;

  uint uStack_14;

  undefined4 uStack_10;

  void *pvStack_c;

  uint uStack_8;

  undefined4 uStack_4;

  

  puVar2 = *(undefined4 **)(param_1 + 0x18);

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

    piVar1 = puVar2 + 1;

    *piVar1 = *piVar1 + -1;

    if (*piVar1 == 0) {

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

    }

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

  }

  puVar2 = (undefined4 *)FUN_005df0f5(0x2c);

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

    puVar2 = (undefined4 *)0x0;

  }

  else {

    puVar2[1] = 1;

    *puVar2 = &PTR_FUN_0079c344;

    puVar2[2] = 0;

    puVar2[3] = 0;

    puVar2[4] = 0;

    puVar2[5] = 0;

    puVar2[6] = 0;

    puVar2[7] = 0;

    puVar2[8] = 0;

    puVar2[9] = 0;

    puVar2[10] = 0;

  }

  *(undefined4 **)(param_1 + 0x18) = puVar2;

  iStack_18 = 0;

  uStack_14 = 0;

  uStack_10 = 0;

  pvStack_c = (void *)0x0;

  uStack_8 = 0;

  uStack_4 = 0;

  FUN_0044ef30(&pvStack_c,&iStack_18);

  FUN_0044e970(&iStack_18);

  if ((uStack_8 & 0x80000000) == 0x80000000) {

    operator_delete__(pvStack_c);

  }

  if (((uStack_14 & 0x80000000) == 0x80000000) && (iStack_18 != 0)) {

    FUN_0044e4b0(3);

  }

  return;

}





// --- FUN_0044f2c0 at 0x0044F2C0 (size: 58) ---


void __fastcall FUN_0044f2c0(undefined4 *param_1)



{

  param_1[1] = 1;

  *param_1 = &PTR_LAB_0079c38c;

  param_1[2] = 0x7fffffff;

  param_1[3] = 0;

  param_1[4] = 0xffffffff;

  param_1[5] = 0xffffffff;

  param_1[6] = 0xffffffff;

  param_1[7] = 0;

  param_1[8] = 0;

  param_1[9] = 0;

  param_1[10] = 0;

  param_1[0xb] = 0xffffffff;

  param_1[0xc] = 0xffffffff;

  return;

}





// --- FUN_0044f330 at 0x0044F330 (size: 254) ---


uint __thiscall

FUN_0044f330(int param_1,int *param_2,undefined4 param_3,int param_4,uint param_5,undefined4 param_6

            ,undefined4 param_7,undefined4 param_8,int *param_9)



{

  undefined4 *puVar1;

  int *piVar2;

  uint uVar3;

  undefined4 uVar4;

  int iVar5;

  undefined3 uVar6;

  

  *param_9 = 0;

  if (param_4 == -1) {

    piVar2 = (int *)FUN_00447e40();

    *param_9 = (int)piVar2;

    uVar3 = (**(code **)(*piVar2 + 4))(param_5,param_6,param_7,param_8,0xffffffff);

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

      puVar1 = (undefined4 *)*param_9;

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

        piVar2 = puVar1 + 1;

        *piVar2 = *piVar2 + -1;

        if (*piVar2 == 0) {

          uVar3 = (**(code **)*puVar1)(1);

        }

        *param_9 = 0;

      }

      return uVar3 & 0xffffff00;

    }

  }

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

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

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

    uVar4 = FUN_00445630(DAT_0083c4ac,param_2);

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

  }

  if (param_4 == -1) {

    param_4 = FUN_004456c0(*param_9);

  }

  *(int *)(param_1 + 0x14) = param_4;

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

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

  iVar5 = *(int *)(param_1 + 8) + -1;

  uVar6 = (undefined3)((uint)iVar5 >> 8);

  switch(iVar5) {

  case 1:

    *(uint *)(param_1 + 0x20) = param_5 >> 1;

    return CONCAT31(uVar6,1);

  case 2:

    *(uint *)(param_1 + 0x20) = param_5 - 1;

    return CONCAT31(uVar6,1);

  case 3:

    *(uint *)(param_1 + 0x20) = param_5 / 3;

    return CONCAT31((int3)((ulonglong)param_5 * 0xaaaaaaab >> 8),1);

  case 4:

  case 5:

    param_5 = param_5 - 2;

  case 0:

    *(uint *)(param_1 + 0x20) = param_5;

  default:

    return CONCAT31(uVar6,1);

  }

}





// --- FUN_0044f450 at 0x0044F450 (size: 283) ---


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



{

  byte *pbVar1;

  undefined4 *puVar2;

  byte bVar3;

  

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

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

  }

  bVar3 = *(byte *)(param_1 + 8);

  FUN_0040ad10(1);

  pbVar1 = (byte *)FUN_0040acf0(1);

  if (pbVar1 != (byte *)0x0) {

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

      bVar3 = *pbVar1;

    }

    else {

      *pbVar1 = bVar3;

    }

  }

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

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

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

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

    if ((*(byte *)(param_2 + 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 *)(param_2 + 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 *)(param_2 + 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 *)(param_2 + 4) & 1) == 0) {

      *(undefined4 *)(param_1 + 0x1c) = *puVar2;

    }

    else {

      *puVar2 = *(undefined4 *)(param_1 + 0x1c);

    }

  }

  FUN_0040ad10(4);

  puVar2 = (undefined4 *)FUN_0040acf0(4);

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

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

      *puVar2 = *(undefined4 *)(param_1 + 0x20);

      return;

    }

    *(undefined4 *)(param_1 + 0x20) = *puVar2;

  }

  return;

}





// --- FUN_0044f570 at 0x0044F570 (size: 846) ---


undefined4 __thiscall FUN_0044f570(int param_1,undefined *param_2)



{

  char cVar1;

  int *piVar2;

  int iVar3;

  LONG LVar4;

  undefined4 uVar5;

  undefined4 extraout_ECX;

  undefined4 extraout_ECX_00;

  undefined4 extraout_ECX_01;

  undefined4 extraout_ECX_02;

  undefined4 extraout_ECX_03;

  undefined4 extraout_ECX_04;

  undefined4 *puVar6;

  undefined1 auStack_10 [16];

  

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

    FUN_0065cf90(param_2);

    piVar2 = (int *)FUN_0065c810();

    while (piVar2 != (int *)0x0) {

      cVar1 = FUN_0065cc50(&DAT_0083c3b0);

      if (cVar1 == '\0') {

        cVar1 = FUN_0065cc50(&DAT_0083c3cc);

        if (cVar1 == '\0') {

          cVar1 = FUN_0065cc50(&DAT_0083c3d0);

          if (cVar1 == '\0') {

            cVar1 = FUN_0065cc50(&DAT_0083c3d4);

            if (cVar1 == '\0') {

              uVar5 = extraout_ECX_03;

              FUN_00401340("Unrecognized keyword in mesh file");

              FUN_0065d670(piVar2,uVar5);

            }

            else {

              puVar6 = (undefined4 *)FUN_0044cc60();

              uVar5 = (**(code **)(*piVar2 + 0xc))(0);

              cVar1 = FUN_0044cec0(uVar5);

              if (cVar1 == '\0') {

                uVar5 = extraout_ECX_04;

                FUN_00401340("Error loading index array");

                FUN_0065d620(piVar2,uVar5);

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

                  puVar6 = (undefined4 *)*puVar6;

                  goto LAB_0044f70b;

                }

                goto LAB_0044f70d;

              }

              uVar5 = FUN_00445740(puVar6);

              *(undefined4 *)(param_1 + 0x18) = uVar5;

            }

          }

          else {

            puVar6 = (undefined4 *)FUN_00447e40();

            uVar5 = (**(code **)(*piVar2 + 0xc))(0);

            cVar1 = FUN_005d9280(uVar5);

            if (cVar1 == '\0') {

              uVar5 = extraout_ECX_02;

              FUN_00401340("Error loading vertex array");

              FUN_0065d620(piVar2,uVar5);

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

                piVar2 = puVar6 + 1;

                *piVar2 = *piVar2 + -1;

                if (*piVar2 == 0) {

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

                }

              }

              goto LAB_0044f70d;

            }

            uVar5 = FUN_004456c0(puVar6);

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

          }

        }

        else {

          param_2 = PTR_DAT_00818344;

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

          iVar3 = (**(code **)(*piVar2 + 0xc))(0);

          uVar5 = extraout_ECX_00;

          if (iVar3 != 0) {

            FUN_00426020(&param_2);

            uVar5 = extraout_ECX_01;

          }

          iVar3 = DAT_0083c4ac;

          if (*(int *)(param_2 + -4) == 1) {

            FUN_00401340("Material file name is empty!");

            FUN_0065d670(piVar2,uVar5);

          }

          else {

            piVar2 = (int *)FUN_006791f0(auStack_10,&param_2,0x21);

            iVar3 = *piVar2;

            if (iVar3 == DAT_0083c4ac) {

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

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

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

                puVar6 = (undefined4 *)*puVar6;

LAB_0044f70b:

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

              }

              goto LAB_0044f70d;

            }

          }

          uVar5 = FUN_00445630(iVar3,0);

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

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

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

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

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

          }

        }

      }

      else {

        iVar3 = (**(code **)(*piVar2 + 0xc))(0);

        if (iVar3 == 0) goto LAB_0044f70d;

        cVar1 = FUN_0065cc50(&DAT_0083c3b4);

        if (cVar1 == '\0') {

          cVar1 = FUN_0065cc50(&DAT_0083c3b8);

          if (cVar1 == '\0') {

            cVar1 = FUN_0065cc50(&DAT_0083c3bc);

            if (cVar1 == '\0') {

              cVar1 = FUN_0065cc50(&DAT_0083c3c0);

              if (cVar1 == '\0') {

                cVar1 = FUN_0065cc50(&DAT_0083c3c4);

                if (cVar1 == '\0') {

                  cVar1 = FUN_0065cc50(&DAT_0083c3c8);

                  if (cVar1 == '\0') {

                    uVar5 = extraout_ECX;

                    FUN_00401340("Unrecognized primitives type");

                    FUN_0065d620(iVar3,uVar5);

                    goto LAB_0044f70d;

                  }

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

                }

                else {

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

                }

              }

              else {

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

              }

            }

            else {

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

            }

          }

          else {

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

          }

        }

        else {

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

        }

      }

      piVar2 = (int *)FUN_0065cb10();

    }

    if ((*(int *)(param_1 + 0x14) != -1) && (*(int *)(param_1 + 8) != 0x7fffffff)) {

      FUN_0065cae0();

      return 1;

    }

LAB_0044f70d:

    FUN_0065cae0();

  }

  return 0;

}





// --- FUN_0044f8d0 at 0x0044F8D0 (size: 72) ---


void __thiscall FUN_0044f8d0(int param_1,undefined4 *param_2)



{

  *(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];

  *(undefined4 *)(param_1 + 0x30) = param_2[10];

  return;

}





// --- FUN_0044f920 at 0x0044F920 (size: 72) ---


void __thiscall FUN_0044f920(int param_1,undefined4 *param_2)



{

  *(undefined4 *)(param_1 + 0x34) = *param_2;

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

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

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

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

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

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

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

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

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

  *(undefined4 *)(param_1 + 0x5c) = param_2[10];

  return;

}





// --- FUN_0044f970 at 0x0044F970 (size: 72) ---


void __thiscall FUN_0044f970(int param_1,undefined4 *param_2)



{

  *(undefined4 *)(param_1 + 0x50) = *param_2;

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

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

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

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

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

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

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

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

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

  *(undefined4 *)(param_1 + 0x78) = param_2[10];

  return;

}





// --- FUN_0044f9c0 at 0x0044F9C0 (size: 105) ---


void __thiscall FUN_0044f9c0(int param_1,undefined4 *param_2)



{

  *(undefined4 *)(param_1 + 0x9c) = *param_2;

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

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

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

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

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

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

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

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

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

  *(undefined4 *)(param_1 + 0xc4) = param_2[10];

  return;

}





// --- FUN_0044fa30 at 0x0044FA30 (size: 28) ---


undefined1 __fastcall FUN_0044fa30(int param_1)



{

  char cVar1;

  

  cVar1 = FUN_00413a70();

  if (cVar1 != '\0') {

    FUN_0054d2e0(param_1 + 0x28);

  }

  return 1;

}





// --- FUN_0044fa50 at 0x0044FA50 (size: 151) ---


void __fastcall FUN_0044fa50(int *param_1)



{

  undefined *puVar1;

  LONG LVar2;

  LONG *pLVar3;

  

  puVar1 = (undefined *)*param_1;

  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);

  }

  param_1[1] = 0;

  param_1[2] = 0x7fffffff;

  param_1[3] = 0;

  param_1[4] = 0;

  puVar1 = (undefined *)param_1[5];

  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[5] = (int)PTR_DAT_00818344;

    InterlockedIncrement(pLVar3);

  }

  param_1[10] = 0;

  return;

}





// --- FUN_0044faf0 at 0x0044FAF0 (size: 157) ---


void __thiscall FUN_0044faf0(int param_1,int param_2,int param_3)



{

  undefined4 *puVar1;

  int iVar2;

  undefined4 *puVar3;

  int iVar4;

  uint uVar5;

  

  if ((*(char *)(param_1 + 0x18) == '\0') && (uVar5 = 0, *(int *)(param_3 + 0x24) != 0)) {

    do {

      puVar3 = *(undefined4 **)(*(int *)(param_3 + 0x1c) + uVar5 * 4);

      iVar2 = 0;

      if ((uint)puVar3[2] < *(uint *)(param_2 + 0x80)) {

        iVar2 = *(int *)(*(int *)(param_2 + 0x78) + puVar3[2] * 4);

      }

      iVar4 = 0;

      if ((iVar2 != 0) && ((uint)puVar3[3] < *(uint *)(iVar2 + 0x24))) {

        iVar4 = *(int *)(*(int *)(iVar2 + 0x1c) + puVar3[3] * 4);

      }

      switch(*puVar3) {

      case 0:

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

        *(undefined4 *)(iVar2 + 0x7c) = *puVar3;

        *(undefined4 *)(iVar2 + 0x80) = puVar3[1];

        *(undefined4 *)(iVar2 + 0x84) = puVar3[2];

        *(undefined4 *)(iVar2 + 0x88) = puVar3[3];

        break;

      case 1:

        puVar3 = (undefined4 *)(iVar2 + 0x8c);

        goto LAB_0044fbb3;

      case 2:

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

        break;

      case 3:

        puVar3 = (undefined4 *)(iVar2 + 200);

LAB_0044fbb3:

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

        *puVar3 = *puVar1;

        puVar3[1] = puVar1[1];

        puVar3[2] = puVar1[2];

        puVar3[3] = puVar1[3];

        break;

      case 4:

        *(uint *)(iVar2 + 0x48) = (**(int **)(param_1 + 0x10) == 0) + 1;

        break;

      case 5:

        *(uint *)(iVar2 + 0x40) = (uint)(**(int **)(param_1 + 0x10) == 0) * 4 + 4;

        break;

      case 6:

        *(bool *)(iVar2 + 0x44) = **(int **)(param_1 + 0x10) != 0;

        break;

      case 7:

        *(bool *)(iVar2 + 0x4c) = **(int **)(param_1 + 0x10) != 0;

        break;

      case 8:

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

        break;

      case 9:

        if (*(int *)(param_1 + 8) == 3000) {

          FUN_00448140(param_1 + 0x14,**(undefined4 **)(param_1 + 0x10));

        }

        else if (*(int *)(param_1 + 8) == 10000) {

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

        }

        break;

      case 10:

        *(uint *)(iVar4 + 0x14) = (uint)(**(int **)(param_1 + 0x10) == 0) * 2 + 1;

        break;

      case 0xb:

        *(uint *)(iVar4 + 0x18) = (uint)(**(int **)(param_1 + 0x10) == 0) * 2 + 1;

        break;

      case 0x20:

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

        break;

      case 0x21:

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

        break;

      case 0x22:

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

        break;

      case 0x23:

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

        break;

      case 0x24:

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

      }

      uVar5 = uVar5 + 1;

    } while (uVar5 < *(uint *)(param_3 + 0x24));

  }

  return;

}





// --- FUN_0044fd50 at 0x0044FD50 (size: 93) ---


undefined4 __fastcall FUN_0044fd50(int param_1)



{

  char cVar1;

  undefined4 uVar2;

  int iVar3;

  

  cVar1 = FUN_00413a70();

  if (((cVar1 != '\0') && (*(int *)(param_1 + 8) == 3000)) &&

     (**(int **)(param_1 + 0x10) != DAT_0083c4cc)) {

    uVar2 = FUN_004220b0(**(int **)(param_1 + 0x10),0x1e);

    iVar3 = FUN_00415430(uVar2);

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

    if (iVar3 == 0) {

      return 0;

    }

    FUN_00695670(iVar3);

  }

  return 1;

}





// --- FUN_0044fdb0 at 0x0044FDB0 (size: 65) ---


undefined4 * __fastcall FUN_0044fdb0(undefined4 *param_1)



{

  LONG *pLVar1;

  

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

  *param_1 = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

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

  param_1[5] = PTR_DAT_00818344;

  InterlockedIncrement(pLVar1);

  param_1[7] = 0;

  param_1[8] = 0;

  param_1[9] = 0;

  FUN_0044fa50();

  return param_1;

}





// --- FUN_0044fe00 at 0x0044FE00 (size: 222) ---


void __fastcall FUN_0044fe00(int *param_1)



{

  undefined *puVar1;

  char cVar2;

  LONG LVar3;

  int iVar4;

  LONG *lpAddend;

  uint uVar5;

  

  cVar2 = FUN_00413a70();

  if (cVar2 != '\0') {

    FUN_0054d2e0(param_1 + 10);

  }

  puVar1 = (undefined *)*param_1;

  if (puVar1 != PTR_DAT_00818344) {

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

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

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

    }

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

    *param_1 = (int)PTR_DAT_00818344;

    InterlockedIncrement(lpAddend);

  }

  operator_delete__((void *)param_1[4]);

  uVar5 = 0;

  param_1[4] = 0;

  param_1[3] = 0;

  if (param_1[9] != 0) {

    do {

      operator_delete(*(void **)(param_1[7] + uVar5 * 4));

      *(undefined4 *)(param_1[7] + uVar5 * 4) = 0;

      uVar5 = uVar5 + 1;

    } while (uVar5 < (uint)param_1[9]);

  }

  param_1[9] = 0;

  if ((param_1[8] & 0x80000000U) == 0x80000000) {

    operator_delete__((void *)param_1[7]);

    param_1[7] = 0;

    param_1[8] = 0;

    return;

  }

  if (param_1[7] != 0) {

    iVar4 = (param_1[8] & 0x7fffffffU) - 1;

    while (-1 < iVar4) {

      iVar4 = iVar4 + -1;

      *(undefined4 *)(param_1[7] + 4 + iVar4 * 4) = 0;

    }

  }

  return;

}





// --- FUN_0044fee0 at 0x0044FEE0 (size: 56) ---


void __fastcall FUN_0044fee0(int param_1)



{

  undefined4 uVar1;

  undefined4 uVar2;

  

  if ((*(int *)(param_1 + 8) == 3000) && (**(int **)(param_1 + 0x10) != DAT_0083c4cc)) {

    uVar2 = 0;

    uVar1 = FUN_004220b0(**(int **)(param_1 + 0x10),0);

    FUN_0041a4e0(uVar1,uVar2);

  }

  return;

}





// --- FUN_0044ff20 at 0x0044FF20 (size: 102) ---


void __fastcall FUN_0044ff20(int *param_1)



{

  LONG LVar1;

  undefined4 *puVar2;

  

  FUN_0044fe00();

  if ((param_1[8] & 0x80000000U) == 0x80000000) {

    operator_delete__((void *)param_1[7]);

  }

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

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

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

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

  }

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

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

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

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

  }

  return;

}





// --- FUN_0044ff90 at 0x0044FF90 (size: 397) ---


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



{

  int iVar1;

  int *piVar2;

  int *piVar3;

  char cVar4;

  LONG LVar5;

  undefined4 *puVar6;

  undefined4 uVar7;

  uint uVar8;

  uint uVar9;

  undefined4 *puVar10;

  

  piVar3 = param_2;

  iVar1 = *param_2;

  if (iVar1 != *param_1) {

    LVar5 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

    if ((LVar5 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

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

    }

    iVar1 = *param_1;

    *piVar3 = iVar1;

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

  }

  piVar3[1] = param_1[1];

  piVar3[2] = param_1[2];

  piVar3[3] = param_1[3];

  if (param_1[4] == 0) {

LAB_0045001b:

    iVar1 = piVar3[5];

    if (iVar1 != param_1[5]) {

      LVar5 = InterlockedDecrement((LONG *)(iVar1 + -0x10));

      if ((LVar5 == 0) && ((undefined4 *)(iVar1 + -0x14) != (undefined4 *)0x0)) {

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

      }

      iVar1 = param_1[5];

      piVar3[5] = iVar1;

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

    }

    *(char *)(piVar3 + 6) = (char)param_1[6];

    param_2 = (int *)0x0;

    if (param_1[9] != 0) {

      do {

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

        if (puVar6 == (undefined4 *)0x0) {

          return 0;

        }

        puVar10 = *(undefined4 **)(param_1[7] + (int)param_2 * 4);

        *puVar6 = *puVar10;

        puVar6[1] = puVar10[1];

        puVar6[2] = puVar10[2];

        puVar6[3] = puVar10[3];

        if ((uint)piVar3[9] < (piVar3[8] & 0x7fffffffU)) {

LAB_004500c2:

          *(undefined4 **)(piVar3[7] + piVar3[9] * 4) = puVar6;

          piVar3[9] = piVar3[9] + 1;

        }

        else {

          uVar7 = FUN_00453850((piVar3[8] & 0x7fffffffU) + 1);

          cVar4 = FUN_004180a0(uVar7);

          if (cVar4 != '\0') goto LAB_004500c2;

        }

        param_2 = (int *)((int)param_2 + 1);

      } while (param_2 < (uint)param_1[9]);

    }

    piVar2 = (int *)param_1[10];

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

      param_2 = (int *)piVar3[10];

      piVar3[10] = (int)piVar2;

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

      FUN_00695670(piVar3[10]);

      FUN_0054d2e0(&param_2);

    }

    return 1;

  }

  if (param_1[3] != 0) {

    puVar6 = (undefined4 *)thunk_FUN_005df0f5(param_1[3]);

    piVar3[4] = (int)puVar6;

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

      uVar9 = param_1[3];

      puVar10 = (undefined4 *)param_1[4];

      for (uVar8 = uVar9 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {

        *puVar6 = *puVar10;

        puVar10 = puVar10 + 1;

        puVar6 = puVar6 + 1;

      }

      for (uVar9 = uVar9 & 3; uVar9 != 0; uVar9 = uVar9 - 1) {

        *(undefined1 *)puVar6 = *(undefined1 *)puVar10;

        puVar10 = (undefined4 *)((int)puVar10 + 1);

        puVar6 = (undefined4 *)((int)puVar6 + 1);

      }

      goto LAB_0045001b;

    }

  }

  return 0;

}





