/* @0041f98c file=? name=FUN_0041f98c */

undefined4 __cdecl FUN_0041f98c(int param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  
  iVar2 = 0;
  while( true ) {
    if (*(int *)(param_1 + 0x124) <= iVar2) {
      return 0;
    }
    iVar1 = *(int *)(*(int *)(param_1 + 0x128) + iVar2 * 4);
    if ((iVar1 != 0) && (iVar1 = FUN_004d4b58(*(char **)(iVar1 + 0xd4),param_2), iVar1 == 0)) break;
    iVar2 = iVar2 + 1;
  }
  return *(undefined4 *)(*(int *)(param_1 + 0x128) + iVar2 * 4);
}



/* @0041f9e0 file=? name=FUN_0041f9e0 */

int __cdecl FUN_0041f9e0(undefined4 param_1,char *param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  uint *puVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int local_78 [8];
  uint local_58 [2];
  char *local_50;
  uint local_48 [2];
  char *local_40;
  int *local_38;
  uint *local_34;
  int *local_30;
  uint *local_2c;
  uint *local_28;
  char *local_24;
  uint *local_20;
  char *local_1c;
  int *local_18;
  uint *local_14;
  uint *local_10;
  uint *local_c;
  int *local_8;
  
  iVar5 = 0;
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    local_8 = (int *)0x0;
  }
  else {
    local_8 = (int *)FUN_004023f4(puVar2);
  }
  local_8[3] = local_8[3] + 1;
  puVar3 = (uint *)FUN_00402298(0x10);
  if (puVar3 == (uint *)0x0) {
    local_c = (uint *)0x0;
  }
  else {
    local_c = FUN_00402460(puVar3,s_models__004e404d);
  }
  local_c[3] = local_c[3] + 1;
  puVar3 = (uint *)FUN_00402298(0x10);
  if (puVar3 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar3,s_model_name_004e4055);
  }
  local_10[3] = local_10[3] + 1;
  puVar3 = (uint *)FUN_00402298(0x10);
  if (puVar3 == (uint *)0x0) {
    local_14 = (uint *)0x0;
  }
  else {
    local_14 = FUN_00402460(puVar3,&DAT_004e4060);
  }
  local_14[3] = local_14[3] + 1;
  FUN_00402624(local_48,(int)local_c,(int)local_10);
  local_1c = local_40;
  puVar3 = (uint *)FUN_00402298(0x10);
  if (puVar3 == (uint *)0x0) {
    local_20 = (uint *)0x0;
  }
  else {
    local_20 = FUN_00402460(puVar3,local_1c);
  }
  local_20[3] = local_20[3] + 1;
  FUN_004024d8((int *)local_48,2);
  FUN_00402624(local_58,(int)local_20,(int)local_14);
  local_24 = local_50;
  local_2c = (uint *)FUN_00402298(0x10);
  if (local_2c == (uint *)0x0) {
    local_28 = (uint *)0x0;
  }
  else {
    local_28 = FUN_00402460(local_2c,local_24);
  }
  local_28[3] = local_28[3] + 1;
  FUN_004024d8((int *)local_58,2);
  FUN_00402a4c((int *)&local_18,(int *)&local_8,(int *)&local_28);
  piVar1 = local_18 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_18,3);
  }
  puVar3 = local_28 + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_28,3);
  }
  puVar3 = local_20 + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_20,3);
  }
  FUN_00403e84(local_78,(char *)local_8[2],1);
  local_30 = FUN_0040485c((int)local_78,(char *)0x0);
  puVar2 = (undefined4 *)local_30[1];
  while ((iVar6 = -1, puVar2 != (undefined4 *)0x0 &&
         (iVar4 = FUN_004d4b58(param_2,(char *)(puVar2 + 2)), iVar6 = iVar5, iVar4 != 0))) {
    iVar5 = iVar5 + 1;
    puVar2 = (undefined4 *)*puVar2;
  }
  if (local_30 != (int *)0x0) {
    (**(code **)*local_30)(local_30,3);
  }
  FUN_00403ecc(local_78,2);
  puVar3 = local_14 + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_14,3);
  }
  puVar3 = local_10 + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  local_34 = local_c;
  puVar3 = local_c + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_c,3);
  }
  local_38 = local_8;
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  return iVar6;
}



/* @0041fc58 file=? name=FUN_0041fc58 */

void __cdecl FUN_0041fc58(int *param_1,int *param_2,int *param_3)

{
  int *piVar1;
  bool bVar2;
  int iVar3;
  
  if (param_1[0x4a] != 0) {
    if ((param_1[10] & 0xcU) == 4) {
      for (iVar3 = 0; iVar3 < param_1[0x49]; iVar3 = iVar3 + 1) {
        piVar1 = *(int **)(param_1[0x4a] + iVar3 * 4);
        if (piVar1 != (int *)0x0) {
          if (((*(byte *)(piVar1 + 10) & 2) == 0) || (piVar1[4] <= piVar1[5])) {
            bVar2 = true;
          }
          else {
            bVar2 = false;
          }
          if (bVar2) {
            (**(code **)(*piVar1 + 0x14))(piVar1,param_2,param_3);
          }
        }
      }
    }
    else {
      for (iVar3 = 0; iVar3 < param_1[0x49]; iVar3 = iVar3 + 1) {
        piVar1 = *(int **)(param_1[0x4a] + iVar3 * 4);
        if ((piVar1 != (int *)0x0) && ((*(byte *)(piVar1 + 10) & 2) == 0)) {
          (**(code **)(*piVar1 + 0x14))(piVar1,param_2,param_3);
        }
      }
    }
  }
  FUN_0041c018(param_1,param_2,param_3);
  return;
}



/* @0041fd18 file=? name=FUN_0041fd18 */

void __cdecl FUN_0041fd18(int param_1,int param_2)

{
  undefined4 uVar1;
  
  uVar1 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 0x1c);
  *(undefined4 *)(param_1 + 400) = uVar1;
  return;
}



/* @0041fd48 file=? name=FUN_0041fd48 */

void __cdecl FUN_0041fd48(int *param_1,undefined4 *param_2)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8 [2];
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8 [2];
  int local_a0;
  uint local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  int local_68;
  uint local_64;
  undefined **local_60 [6];
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  int local_18;
  int local_14;
  int local_10;
  undefined4 local_c [2];
  
  FUN_0041db7c((int)&local_48);
  FUN_00420ea4(local_c,param_2 + 0xb);
  local_10 = param_2[10];
  FUN_00408440(&local_28,param_2 + 7);
  FUN_004032dc(local_60,param_2,*param_2,0x34);
  local_60[0] = &PTR_FUN_004e42ac;
  (*(code *)PTR_FUN_004e42c8)(local_60,&local_14,4);
  iVar4 = 0;
  if (0 < local_14) {
    do {
      piVar3 = (int *)(*(code *)local_60[0][7])(local_60,&local_48,4);
      (**(code **)(*piVar3 + 0x1c))(piVar3,&local_44,4);
      (*(code *)local_60[0][7])(local_60,&local_18,4);
      iVar2 = local_10;
      iVar1 = local_18;
      local_c4 = 100;
      local_c0 = 0x12;
      local_bc = 1;
      FUN_00420ea4(local_b8,(undefined4 *)&DAT_00522524);
      local_b0 = 0;
      local_ac = 0;
      FUN_00420ea4(local_a8,local_c);
      local_a0 = iVar2;
      local_9c = (uint)(iVar2 < 0);
      local_98 = local_48;
      local_94 = local_44;
      local_90 = local_40;
      local_8c = local_3c;
      local_88 = local_38;
      local_84 = local_34;
      local_80 = local_30;
      local_7c = local_2c;
      local_78 = local_28;
      local_74 = local_24;
      local_70 = local_20;
      local_6c = local_1c;
      local_68 = iVar1;
      local_64 = (uint)(iVar1 < 0);
      (**(code **)(*param_1 + 0xc))(param_1,&local_c4);
      iVar4 = iVar4 + 1;
    } while (iVar4 < local_14);
  }
  FUN_00403310((int *)local_60,0);
  return;
}



/* @0041ff08 file=? name=FUN_0041ff08 */

void __cdecl FUN_0041ff08(int param_1,int param_2)

{
  int *piVar1;
  
  if ((*(int *)(param_1 + 0x120) != 0) && (*(int *)(param_2 + 0x24) != -1)) {
    piVar1 = *(int **)(*(int *)(param_1 + 0x120) + *(int *)(param_2 + 0x24) * 4);
    (**(code **)(*piVar1 + 0x18))(piVar1,param_2 + 0x2c);
  }
  return;
}



/* @0041ff38 file=? name=FUN_0041ff38 */

undefined4 * FUN_0041ff38(undefined4 *param_1,int param_2,undefined4 param_3)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  int aiStack_38 [6];
  undefined4 auStack_20 [2];
  int iStack_18;
  undefined4 *puStack_14;
  float *pfStack_10;
  undefined4 *puStack_c;
  int iStack_8;
  
  FUN_0041bdf0(param_1,*(undefined4 *)(param_2 + 0x1c),param_3);
  *param_1 = &PTR_FUN_004e4278;
  FUN_0040aadc(param_1 + 0x34);
  FUN_0041c42c(param_1 + 0x52,0);
  FUN_0041c42c(param_1 + 0x57,0);
  FUN_0041c42c(param_1 + 0x5c,0);
  FUN_00420e8c(param_1 + 0x61);
  iVar1 = *(int *)(DAT_004efc94 + 0x2c);
  param_1[100] = 0;
  iStack_8 = param_2 + 0x20;
  param_1[0x6f] = *(undefined4 *)(param_2 + 0x28);
  uVar3 = (**(code **)(*(int *)(iVar1 + 0x54) + 0xc))(iVar1 + 0x54,iStack_8);
  param_1[0x70] = uVar3;
  param_1[10] = *(undefined4 *)(param_2 + 0x2c);
  FUN_00420ef4(param_1 + 0x61,(undefined4 *)(param_2 + 0xc));
  param_1[99] = *(undefined4 *)(param_2 + 0x18);
  puStack_c = (undefined4 *)FUN_00414b60();
  param_1[0x67] = *puStack_c;
  param_1[0x65] = *(undefined4 *)(param_2 + 0x14);
  param_1[0x66] = 0;
  FUN_0040a938(param_1 + 0x40,(undefined4 *)(param_2 + 0x30));
  FUN_0040a938(param_1 + 0x4b,param_1 + 0x40);
  pfStack_10 = (float *)(param_1 + 0x34);
  FUN_0040ab44(pfStack_10,param_1 + 0x40);
  FUN_0040a938(param_1 + 0x68,&DAT_004e0fec);
  param_1[10] = param_1[10] & 0xffffffef;
  puStack_14 = param_1 + 0x67;
  param_1[4] = *puStack_14;
  param_1[0x49] = 0;
  param_1[0x4a] = 0;
  param_1[0x48] = 0;
  param_1[0x47] = 0;
  if (param_1[0x6f] != -1) {
    iStack_18 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],0x14);
    if (iStack_18 != 0) {
      iVar2 = *(int *)(iStack_18 + 4);
      *(int *)(iStack_18 + 4) = *(int *)(iStack_18 + 4) + 1;
      if (iVar2 == 0) {
        FUN_00406cd0(iStack_18);
      }
      FUN_004032dc(aiStack_38,*(undefined4 *)(iStack_18 + 0x3c),*(undefined4 *)(iStack_18 + 0x40),0)
      ;
      (**(code **)(aiStack_38[0] + 0x1c))(aiStack_38,param_1 + 0x47,4);
      uVar3 = FUN_004022b0(param_1[0x47] << 2);
      param_1[0x48] = uVar3;
      *(int *)(iStack_18 + 4) = *(int *)(iStack_18 + 4) + -1;
      FUN_00403310(aiStack_38,2);
    }
  }
  if ((((param_1[10] & 0xc) == 0) || (((param_1[10] & 0xc) == 0xc && ((param_1[10] & 0x100) != 0))))
     || (((param_1[10] & 0xc) == 8 &&
         ((*(int *)(param_2 + 0x18) == 0 || (*(int *)(param_2 + 0x18) == -1)))))) {
    FUN_0042913c(auStack_20,iVar1);
    FUN_00420ef4(param_1 + 0x61,auStack_20);
    uVar3 = FUN_0042904c(iVar1);
    param_1[99] = uVar3;
    FUN_00420ef4((undefined4 *)(param_2 + 0xc),param_1 + 0x61);
    *(undefined4 *)(param_2 + 0x18) = param_1[99];
  }
  FUN_00429168(iVar1,(int)param_1,param_2);
  return param_1;
}



/* @0041ff3e file=? name=FUN_0041ff3e */

undefined4 * FUN_0041ff3e(void)

{
  int *piVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined4 uVar5;
  undefined *puVar6;
  int iVar7;
  int unaff_EBP;
  
  iVar2 = *(int *)(unaff_EBP + 0xc);
  puVar3 = *(undefined4 **)(unaff_EBP + 8);
  FUN_0041bdf0(puVar3,*(undefined4 *)(iVar2 + 0x1c),*(undefined4 *)(unaff_EBP + 0x10));
  *puVar3 = &PTR_FUN_004e4278;
  FUN_0040aadc(puVar3 + 0x34);
  FUN_0041c42c(puVar3 + 0x52,0);
  FUN_0041c42c(puVar3 + 0x57,0);
  FUN_0041c42c(puVar3 + 0x5c,0);
  FUN_00420e8c(puVar3 + 0x61);
  iVar4 = *(int *)(DAT_004efc94 + 0x2c);
  puVar3[100] = 0;
  puVar3[0x6f] = *(undefined4 *)(iVar2 + 0x28);
  *(int *)(unaff_EBP + -4) = iVar2 + 0x20;
  uVar5 = (**(code **)(*(int *)(iVar4 + 0x54) + 0xc))(iVar4 + 0x54,*(undefined4 *)(unaff_EBP + -4));
  puVar3[0x70] = uVar5;
  puVar3[10] = *(undefined4 *)(iVar2 + 0x2c);
  FUN_00420ef4(puVar3 + 0x61,(undefined4 *)(iVar2 + 0xc));
  puVar3[99] = *(undefined4 *)(iVar2 + 0x18);
  puVar6 = FUN_00414b60();
  *(undefined **)(unaff_EBP + -8) = puVar6;
  puVar3[0x67] = **(undefined4 **)(unaff_EBP + -8);
  puVar3[0x65] = *(undefined4 *)(iVar2 + 0x14);
  puVar3[0x66] = 0;
  FUN_0040a938(puVar3 + 0x40,(undefined4 *)(iVar2 + 0x30));
  FUN_0040a938(puVar3 + 0x4b,puVar3 + 0x40);
  *(undefined4 **)(unaff_EBP + -0xc) = puVar3 + 0x34;
  FUN_0040ab44(*(float **)(unaff_EBP + -0xc),puVar3 + 0x40);
  FUN_0040a938(puVar3 + 0x68,&DAT_004e0fec);
  puVar3[10] = puVar3[10] & 0xffffffef;
  *(undefined4 **)(unaff_EBP + -0x10) = puVar3 + 0x67;
  puVar3[4] = **(undefined4 **)(unaff_EBP + -0x10);
  puVar3[0x49] = 0;
  puVar3[0x4a] = 0;
  puVar3[0x48] = 0;
  puVar3[0x47] = 0;
  if (puVar3[0x6f] != -1) {
    iVar7 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),puVar3[0x6f],0x14);
    *(int *)(unaff_EBP + -0x14) = iVar7;
    if (*(int *)(unaff_EBP + -0x14) != 0) {
      iVar7 = *(int *)(*(int *)(unaff_EBP + -0x14) + 4);
      piVar1 = (int *)(*(int *)(unaff_EBP + -0x14) + 4);
      *piVar1 = *piVar1 + 1;
      if (iVar7 == 0) {
        FUN_00406cd0(*(int *)(unaff_EBP + -0x14));
      }
      FUN_004032dc((undefined4 *)(unaff_EBP + -0x34),
                   *(undefined4 *)(*(int *)(unaff_EBP + -0x14) + 0x3c),
                   *(undefined4 *)(*(int *)(unaff_EBP + -0x14) + 0x40),0);
      (**(code **)(*(int *)(unaff_EBP + -0x34) + 0x1c))(unaff_EBP + -0x34,puVar3 + 0x47,4);
      uVar5 = FUN_004022b0(puVar3[0x47] << 2);
      puVar3[0x48] = uVar5;
      piVar1 = (int *)(*(int *)(unaff_EBP + -0x14) + 4);
      *piVar1 = *piVar1 + -1;
      FUN_00403310((int *)(unaff_EBP + -0x34),2);
    }
  }
  if ((((puVar3[10] & 0xc) == 0) || (((puVar3[10] & 0xc) == 0xc && ((puVar3[10] & 0x100) != 0)))) ||
     (((puVar3[10] & 0xc) == 8 && ((*(int *)(iVar2 + 0x18) == 0 || (*(int *)(iVar2 + 0x18) == -1))))
     )) {
    FUN_0042913c((undefined4 *)(unaff_EBP + -0x1c),iVar4);
    FUN_00420ef4(puVar3 + 0x61,(undefined4 *)(unaff_EBP + -0x1c));
    uVar5 = FUN_0042904c(iVar4);
    puVar3[99] = uVar5;
    FUN_00420ef4((undefined4 *)(iVar2 + 0xc),puVar3 + 0x61);
    *(undefined4 *)(iVar2 + 0x18) = puVar3[99];
  }
  FUN_00429168(iVar4,(int)puVar3,iVar2);
  return puVar3;
}



/* @00420204 file=? name=FUN_00420204 */

undefined4 * __cdecl FUN_00420204(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1c4);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041ff38(puVar1,param_1,&DAT_004e3d40);
  }
  return puVar1;
}



/* @00420234 file=? name=FUN_00420234 */

undefined4 __cdecl FUN_00420234(undefined4 *param_1)

{
  char *pcVar1;
  undefined4 uVar2;
  float10 fVar3;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  *param_1 = 0x4c;
  param_1[1] = 3;
  FUN_00420ef4(param_1 + 8,(undefined4 *)&DAT_00522524);
  param_1[2] = 0;
  param_1[7] = 0x10;
  param_1[0xb] = 0;
  pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e4065);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24((int *)&DAT_00524e68,s_X_position_coordinate_missing__004e4067,(char *)0x0);
    uVar2 = 0;
  }
  else {
    fVar3 = (float10)FUN_004dd1cc(pcVar1);
    param_1[0xc] = (float)fVar3;
    pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e4087);
    if (pcVar1 == (char *)0x0) {
      FUN_004dbb24((int *)&DAT_00524e68,s_Y_position_coordinate_missing__004e4089,(char *)0x0);
      uVar2 = 0;
    }
    else {
      fVar3 = (float10)FUN_004dd1cc(pcVar1);
      param_1[0xd] = (float)fVar3;
      pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e40a9);
      if (pcVar1 == (char *)0x0) {
        FUN_004dbb24((int *)&DAT_00524e68,s_Z_position_coordinate_missing__004e40ab,(char *)0x0);
        uVar2 = 0;
      }
      else {
        fVar3 = (float10)FUN_004dd1cc(pcVar1);
        param_1[0xe] = (float)fVar3;
        pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e40cb);
        if (pcVar1 == (char *)0x0) {
          FUN_004dbb24((int *)&DAT_00524e68,s_Pitch_missing__004e40cd,(char *)0x0);
          uVar2 = 0;
        }
        else {
          fVar3 = (float10)FUN_004dd1cc(pcVar1);
          local_1c = (float)fVar3;
          local_8 = local_1c;
          pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e40dd);
          if (pcVar1 == (char *)0x0) {
            FUN_004dbb24((int *)&DAT_00524e68,s_Yaw_missing__004e40df,(char *)0x0);
            uVar2 = 0;
          }
          else {
            fVar3 = (float10)FUN_004dd1cc(pcVar1);
            local_18 = (float)fVar3;
            local_c = local_18;
            pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e40ed);
            if (pcVar1 == (char *)0x0) {
              FUN_004dbb24((int *)&DAT_00524e68,s_Roll_missing__004e40ef,(char *)0x0);
              uVar2 = 0;
            }
            else {
              fVar3 = (float10)FUN_004dd1cc(pcVar1);
              local_14 = (float)fVar3;
              local_10 = local_14;
              FUN_00409a00((float *)(param_1 + 0xf),&local_1c);
              uVar2 = 1;
            }
          }
        }
      }
    }
  }
  return uVar2;
}



/* @004203f4 file=? name=FUN_004203f4 */

undefined4 __cdecl FUN_004203f4(undefined4 *param_1,undefined4 param_2)

{
  char *pcVar1;
  undefined4 uVar2;
  float10 fVar3;
  float local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  *param_1 = 0x2c;
  param_1[1] = 3;
  param_1[2] = 4;
  pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e40fe);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24((int *)&DAT_00524e68,s_X_position_coordinate_missing__004e4100,(char *)0x0);
    uVar2 = 0;
  }
  else {
    fVar3 = (float10)FUN_004dd1cc(pcVar1);
    param_1[4] = (float)fVar3;
    pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e4120);
    if (pcVar1 == (char *)0x0) {
      FUN_004dbb24((int *)&DAT_00524e68,s_Y_position_coordinate_missing__004e4122,(char *)0x0);
      uVar2 = 0;
    }
    else {
      fVar3 = (float10)FUN_004dd1cc(pcVar1);
      param_1[5] = (float)fVar3;
      pcVar1 = FUN_004d4d1c((char *)0x0,&DAT_004e4142);
      if (pcVar1 == (char *)0x0) {
        FUN_004dbb24((int *)&DAT_00524e68,s_Z_position_coordinate_missing__004e4144,(char *)0x0);
        uVar2 = 0;
      }
      else {
        fVar3 = (float10)FUN_004dd1cc(pcVar1);
        param_1[6] = (float)fVar3;
        local_10 = DAT_004e0f8c;
        local_c = DAT_004e0f90;
        local_8 = DAT_004e0f94;
        FUN_00409a00((float *)(param_1 + 7),&local_10);
        param_1[3] = param_2;
        uVar2 = 1;
      }
    }
  }
  return uVar2;
}



/* @004204f8 file=? name=FUN_004204f8 */

void __cdecl FUN_004204f8(int param_1)

{
  FUN_0042061c(param_1);
  return;
}



/* @00420508 file=? name=FUN_00420508 */

void __cdecl FUN_00420508(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4278;
    FUN_004291d0(*(undefined4 *)(DAT_004efc94 + 0x2c),(int)param_1);
    if (param_1[0x4a] != 0) {
      for (iVar2 = 0; iVar2 < param_1[0x49]; iVar2 = iVar2 + 1) {
        puVar1 = *(undefined4 **)(param_1[0x4a] + iVar2 * 4);
        if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
          (**(code **)*puVar1)(puVar1,3);
        }
      }
      FUN_004022d0((int *)param_1[0x4a]);
    }
    if (param_1[0x48] != 0) {
      for (iVar2 = 0; iVar2 < param_1[0x47]; iVar2 = iVar2 + 1) {
        puVar1 = *(undefined4 **)(param_1[0x48] + iVar2 * 4);
        if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
          (**(code **)*puVar1)(puVar1,3);
        }
      }
      FUN_004022d0((int *)param_1[0x48]);
    }
    FUN_0041c44b(param_1 + 0x5c,2);
    FUN_0041c44b(param_1 + 0x57,2);
    FUN_0041c44b(param_1 + 0x52,2);
    FUN_0041bec4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042061c file=? name=FUN_0042061c */

void __cdecl FUN_0042061c(int param_1)

{
  int iVar1;
  
  if ((*(byte *)(param_1 + 0x29) & 0x20) == 0) {
    iVar1 = *(int *)(*(int *)(DAT_004efc94 + 0x24) + 0x14);
    (**(code **)(*(int *)(iVar1 + 0x10) + 4))(iVar1 + 0x10,param_1);
    *(uint *)(param_1 + 0x28) = *(uint *)(param_1 + 0x28) | 0x2000;
    *(uint *)(param_1 + 0x28) = *(uint *)(param_1 + 0x28) | 2;
  }
  return;
}



/* @00420658 file=? name=FUN_00420658 */

void __cdecl FUN_00420658(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e3d10);
  return;
}



/* @00420674 file=? name=FUN_00420674 */

void __cdecl FUN_00420674(int param_1,undefined4 param_2)

{
  (**(code **)(*(int *)(param_1 + 0x148) + 4))(param_1 + 0x148,param_2);
  return;
}



/* @00420694 file=? name=FUN_00420694 */

void __cdecl FUN_00420694(int param_1,undefined4 param_2)

{
  (**(code **)(*(int *)(param_1 + 0x15c) + 4))(param_1 + 0x15c,param_2);
  return;
}



/* @004206b4 file=? name=FUN_004206b4 */

void __cdecl FUN_004206b4(int param_1,undefined4 param_2)

{
  (**(code **)(*(int *)(param_1 + 0x170) + 4))(param_1 + 0x170,param_2);
  return;
}



/* @004206d4 file=? name=FUN_004206d4 */

bool __cdecl FUN_004206d4(int param_1,int param_2)

{
  return param_1 != param_2;
}



/* @004206e8 file=? name=FUN_004206e8 */

void __cdecl FUN_004206e8(int param_1)

{
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  local_20 = 0x1c;
  local_1c = 0xd;
  local_18 = 1;
  FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
  local_c = 0;
  local_8 = 0;
  FUN_00419bbc(param_1,(int)&local_20);
  return;
}



/* @00420734 file=? name=FUN_00420734 */

void __cdecl FUN_00420734(int param_1)

{
  *(int *)(param_1 + 0x198) = *(int *)(param_1 + 0x198) + 1;
  return;
}



/* @00420744 file=? name=FUN_00420744 */

void __cdecl FUN_00420744(int param_1)

{
  *(int *)(param_1 + 0x198) = *(int *)(param_1 + 0x198) + -1;
  return;
}



/* @00420754 file=? name=FUN_00420754 */

bool __cdecl FUN_00420754(int param_1,int param_2)

{
  return param_1 == param_2;
}



/* @0042076c file=? name=FUN_0042076c */

int __cdecl FUN_0042076c(int param_1,int *param_2)

{
  int iVar1;
  int iVar2;
  
  iVar2 = 0;
  while( true ) {
    if (*(int *)(param_1 + 0x11c) <= iVar2) {
      return -1;
    }
    iVar1 = FUN_004027d8(*(int *)(*(int *)(*(int *)(param_1 + 0x120) + iVar2 * 4) + 0x15c),*param_2)
    ;
    if (iVar1 == 0) break;
    iVar2 = iVar2 + 1;
  }
  return iVar2;
}



/* @004207b4 file=? name=FUN_004207b4 */

undefined4 FUN_004207b4(int param_1,char *param_2,int param_3,undefined4 *param_4)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  uint *puVar5;
  int *piVar6;
  undefined4 *puVar7;
  int aiStack_38 [6];
  int *piStack_20;
  undefined4 *puStack_1c;
  int *piStack_18;
  int *piStack_14;
  int iStack_10;
  uint *puStack_c;
  char *pcStack_8;
  
  iVar2 = FUN_00404088(param_3,s_gamedata_004e4164,s_DamageZones_004e416d,&pcStack_8);
  if (iVar2 == 0) {
    FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_is_missing__dmg_file_specificati_004e4179,(char *)0x0);
    uVar3 = 0xffffffff;
  }
  else {
    pcVar4 = FUN_004064fc((char *)*param_4,pcStack_8);
    puVar5 = (uint *)FUN_00402298(0x10);
    if (puVar5 == (uint *)0x0) {
      puStack_c = (uint *)0x0;
    }
    else {
      puStack_c = FUN_00402460(puVar5,pcVar4);
    }
    puStack_c[3] = puStack_c[3] + 1;
    piVar6 = (int *)FUN_00402298(0x20);
    if (piVar6 == (int *)0x0) {
      piVar6 = (int *)0x0;
    }
    else {
      piVar6 = FUN_00403e84(piVar6,(char *)puStack_c[2],1);
    }
    if ((*(byte *)(piVar6 + 7) & 2) == 0) {
      iStack_10 = piVar6[3];
    }
    else {
      iStack_10 = piVar6[4];
    }
    if (iStack_10 == 0) {
      FUN_004dbb24((int *)&DAT_00524e68,(char *)puStack_c[2],(char *)0x0);
      FUN_004dbb24((int *)&DAT_00524e68,s_is_empty_or_missing__004e419f,(char *)0x0);
      FUN_00403ecc(piVar6,3);
      uVar3 = 0xffffffff;
      puVar5 = puStack_c + 3;
      *puVar5 = *puVar5 - 1;
      if (*puVar5 == 0) {
        FUN_004024d8((int *)puStack_c,3);
      }
    }
    else {
      FUN_0040328c(aiStack_38,0);
      (**(code **)(aiStack_38[0] + 0x20))(aiStack_38,&iStack_10,4);
      piStack_14 = FUN_0040485c((int)piVar6,(char *)0x0);
      puVar7 = (undefined4 *)piStack_14[1];
      puStack_1c = (undefined4 *)FUN_00402298(0x10);
      if (puStack_1c == (undefined4 *)0x0) {
        piStack_18 = (int *)0x0;
      }
      else {
        piStack_18 = (int *)FUN_004023f4(puStack_1c);
      }
      piStack_18[3] = piStack_18[3] + 1;
      for (; puVar7 != (undefined4 *)0x0; puVar7 = (undefined4 *)*puVar7) {
        FUN_00402a98((int *)&piStack_20,(int *)&piStack_18,(char *)(puVar7 + 2));
        piVar1 = piStack_20 + 3;
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_004024d8(piStack_20,3);
        }
        piStack_18[3] = piStack_18[3] + 1;
        FUN_0041e590(param_3,param_2,0,piStack_18,aiStack_38,(int)piVar6,(int)param_4);
      }
      puVar7 = (undefined4 *)FUN_00406f3c(param_1,param_2,0x14,1,0,aiStack_38,-1);
      FUN_00403ecc(piVar6,3);
      if (piStack_14 != (int *)0x0) {
        (**(code **)*piStack_14)(piStack_14,3);
      }
      uVar3 = *puVar7;
      piVar6 = piStack_18 + 3;
      *piVar6 = *piVar6 + -1;
      if (*piVar6 == 0) {
        FUN_004024d8(piStack_18,3);
      }
      FUN_00403310(aiStack_38,2);
      puVar5 = puStack_c + 3;
      *puVar5 = *puVar5 - 1;
      if (*puVar5 == 0) {
        FUN_004024d8((int *)puStack_c,3);
      }
    }
  }
  return uVar3;
}



/* @004207ba file=? name=FUN_004207ba */

undefined4 FUN_004207ba(void)

{
  char *pcVar1;
  int *piVar2;
  int iVar3;
  undefined4 uVar4;
  char *pcVar5;
  uint *puVar6;
  int *piVar7;
  int *piVar8;
  undefined4 *puVar9;
  int unaff_EBP;
  
  pcVar1 = *(char **)(unaff_EBP + 0xc);
  iVar3 = FUN_00404088(*(int *)(unaff_EBP + 0x10),s_gamedata_004e4164,s_DamageZones_004e416d,
                       (undefined4 *)(unaff_EBP + -4));
  if (iVar3 == 0) {
    FUN_004dbb24((int *)&DAT_00524e68,pcVar1,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_is_missing__dmg_file_specificati_004e4179,(char *)0x0);
    uVar4 = 0xffffffff;
  }
  else {
    pcVar5 = FUN_004064fc((char *)**(undefined4 **)(unaff_EBP + 0x14),*(char **)(unaff_EBP + -4));
    puVar6 = (uint *)FUN_00402298(0x10);
    if (puVar6 == (uint *)0x0) {
      puVar6 = (uint *)0x0;
    }
    else {
      puVar6 = FUN_00402460(puVar6,pcVar5);
    }
    *(uint **)(unaff_EBP + -8) = puVar6;
    piVar7 = (int *)(*(int *)(unaff_EBP + -8) + 0xc);
    *piVar7 = *piVar7 + 1;
    piVar7 = (int *)FUN_00402298(0x20);
    if (piVar7 == (int *)0x0) {
      piVar7 = (int *)0x0;
    }
    else {
      piVar7 = FUN_00403e84(piVar7,*(char **)(*(int *)(unaff_EBP + -8) + 8),1);
    }
    if ((*(byte *)(piVar7 + 7) & 2) == 0) {
      iVar3 = piVar7[3];
    }
    else {
      iVar3 = piVar7[4];
    }
    *(int *)(unaff_EBP + -0xc) = iVar3;
    if (*(int *)(unaff_EBP + -0xc) == 0) {
      FUN_004dbb24((int *)&DAT_00524e68,*(char **)(*(int *)(unaff_EBP + -8) + 8),(char *)0x0);
      FUN_004dbb24((int *)&DAT_00524e68,s_is_empty_or_missing__004e419f,(char *)0x0);
      FUN_00403ecc(piVar7,3);
      uVar4 = 0xffffffff;
      piVar8 = *(int **)(unaff_EBP + -8);
      piVar7 = piVar8 + 3;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_004024d8(piVar8,3);
      }
    }
    else {
      FUN_0040328c((undefined4 *)(unaff_EBP + -0x34),0);
      (**(code **)(*(int *)(unaff_EBP + -0x34) + 0x20))(unaff_EBP + -0x34,unaff_EBP + -0xc,4);
      piVar8 = FUN_0040485c((int)piVar7,(char *)0x0);
      *(int **)(unaff_EBP + -0x10) = piVar8;
      puVar9 = *(undefined4 **)(*(int *)(unaff_EBP + -0x10) + 4);
      iVar3 = FUN_00402298(0x10);
      *(int *)(unaff_EBP + -0x18) = iVar3;
      if (iVar3 == 0) {
        uVar4 = *(undefined4 *)(unaff_EBP + -0x18);
      }
      else {
        uVar4 = FUN_004023f4(*(undefined4 **)(unaff_EBP + -0x18));
      }
      *(undefined4 *)(unaff_EBP + -0x14) = uVar4;
      piVar8 = (int *)(*(int *)(unaff_EBP + -0x14) + 0xc);
      *piVar8 = *piVar8 + 1;
      for (; puVar9 != (undefined4 *)0x0; puVar9 = (undefined4 *)*puVar9) {
        FUN_00402a98((int *)(unaff_EBP + -0x1c),(int *)(unaff_EBP + -0x14),(char *)(puVar9 + 2));
        piVar2 = *(int **)(unaff_EBP + -0x1c);
        piVar8 = piVar2 + 3;
        *piVar8 = *piVar8 + -1;
        if (*piVar8 == 0) {
          FUN_004024d8(piVar2,3);
        }
        iVar3 = *(int *)(unaff_EBP + 0x14);
        piVar2 = *(int **)(unaff_EBP + -0x14);
        piVar8 = piVar2 + 3;
        *piVar8 = *piVar8 + 1;
        FUN_0041e590(*(int *)(unaff_EBP + 0x10),pcVar1,0,piVar2,(int *)(unaff_EBP + -0x34),
                     (int)piVar7,iVar3);
      }
      puVar9 = (undefined4 *)
               FUN_00406f3c(*(int *)(unaff_EBP + 8),pcVar1,0x14,1,0,(int *)(unaff_EBP + -0x34),-1);
      FUN_00403ecc(piVar7,3);
      if (*(int *)(unaff_EBP + -0x10) != 0) {
        (**(code **)**(undefined4 **)(unaff_EBP + -0x10))(*(undefined4 **)(unaff_EBP + -0x10),3);
      }
      uVar4 = *puVar9;
      piVar8 = *(int **)(unaff_EBP + -0x14);
      piVar7 = piVar8 + 3;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_004024d8(piVar8,3);
      }
      FUN_00403310((int *)(unaff_EBP + -0x34),2);
      piVar8 = *(int **)(unaff_EBP + -8);
      piVar7 = piVar8 + 3;
      *piVar7 = *piVar7 + -1;
      if (*piVar7 == 0) {
        FUN_004024d8(piVar8,3);
      }
    }
  }
  return uVar4;
}



/* @00420a00 file=? name=FUN_00420a00 */

undefined4 __cdecl FUN_00420a00(int param_1,char *param_2,int param_3,undefined4 *param_4)

{
  int iVar1;
  undefined4 uVar2;
  char *pcVar3;
  uint *puVar4;
  int *piVar5;
  uint *puVar6;
  undefined4 *puVar7;
  int *piVar8;
  int *piVar9;
  int local_44 [6];
  undefined4 local_2c;
  char *local_28;
  uint *local_24;
  char *local_20;
  int *local_1c;
  char *local_18;
  int *local_14;
  uint *local_10;
  char *local_c;
  char *local_8;
  
  iVar1 = FUN_00404088(param_3,s_gamedata_004e41b6,s_DamageZones_004e41bf,&local_8);
  if (iVar1 == 0) {
    local_c = param_2;
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_is_missing__dmg_file_specificati_004e41cb,(char *)0x0);
    uVar2 = 0xffffffff;
  }
  else {
    pcVar3 = FUN_004064fc((char *)*param_4,local_8);
    puVar4 = (uint *)FUN_00402298(0x10);
    if (puVar4 == (uint *)0x0) {
      local_10 = (uint *)0x0;
    }
    else {
      local_10 = FUN_00402460(puVar4,pcVar3);
    }
    local_10[3] = local_10[3] + 1;
    piVar5 = (int *)FUN_00402298(0x20);
    if (piVar5 == (int *)0x0) {
      local_14 = (int *)0x0;
    }
    else {
      local_14 = FUN_00403e84(piVar5,(char *)local_10[2],1);
    }
    if (local_14[3] == 0) {
      local_18 = param_2;
      FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s___dmg_file_is_empty_or_missing__004e41f1,(char *)0x0);
      FUN_00403ecc(local_14,3);
      uVar2 = 0xffffffff;
      puVar4 = local_10 + 3;
      *puVar4 = *puVar4 - 1;
      if (*puVar4 == 0) {
        FUN_004024d8((int *)local_10,3);
      }
    }
    else {
      FUN_0040328c(local_44,0);
      local_1c = FUN_0040485c((int)local_14,(char *)0x0);
      for (puVar7 = (undefined4 *)local_1c[1]; puVar7 != (undefined4 *)0x0;
          puVar7 = (undefined4 *)*puVar7) {
        iVar1 = FUN_00404088((int)local_14,(char *)(puVar7 + 2),s_ExplosionTable_004e4213,&local_20)
        ;
        if (iVar1 == 0) {
          local_2c = 0;
          (**(code **)(local_44[0] + 0x20))(local_44,&local_2c,4);
        }
        else {
          pcVar3 = FUN_004064fc((char *)*param_4,local_20);
          puVar4 = (uint *)FUN_00402298(0x10);
          if (puVar4 == (uint *)0x0) {
            local_24 = (uint *)0x0;
          }
          else {
            local_24 = FUN_00402460(puVar4,pcVar3);
          }
          local_24[3] = local_24[3] + 1;
          piVar5 = (int *)FUN_00402298(0x20);
          if (piVar5 == (int *)0x0) {
            piVar5 = (int *)0x0;
          }
          else {
            piVar5 = FUN_00403e84(piVar5,(char *)local_24[2],1);
          }
          if (piVar5[3] == 0) {
            FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
            FUN_004dbb24((int *)&DAT_00524e68,&DAT_004e4222,(char *)0x0);
            FUN_004dbb24((int *)&DAT_00524e68,(char *)local_24[2],(char *)0x0);
            FUN_004dbb24((int *)&DAT_00524e68,s_is_emoty_or_missing__004e4226,(char *)0x0);
            FUN_00403ecc(local_14,3);
            if (local_1c != (int *)0x0) {
              (**(code **)*local_1c)(local_1c,3);
            }
            FUN_00403ecc(piVar5,3);
            uVar2 = 0xffffffff;
            puVar4 = local_24 + 3;
            *puVar4 = *puVar4 - 1;
            if (*puVar4 == 0) {
              FUN_004024d8((int *)local_24,3);
            }
            FUN_00403310(local_44,2);
            puVar4 = local_10 + 3;
            *puVar4 = *puVar4 - 1;
            if (*puVar4 != 0) {
              return uVar2;
            }
            FUN_004024d8((int *)local_10,3);
            return uVar2;
          }
          piVar9 = local_44;
          local_24[3] = local_24[3] + 1;
          local_28 = param_2;
          piVar8 = piVar5;
          puVar4 = local_24;
          puVar6 = (uint *)FUN_00402298(0x10);
          if (puVar6 == (uint *)0x0) {
            puVar6 = (uint *)0x0;
          }
          else {
            puVar6 = FUN_00402460(puVar6,local_28);
          }
          puVar6[3] = puVar6[3] + 1;
          FUN_0042a828(param_1,(int *)puVar6,(uint)piVar8,(int *)puVar4,piVar9);
          FUN_00403ecc(piVar5,3);
          puVar4 = local_24 + 3;
          *puVar4 = *puVar4 - 1;
          if (*puVar4 == 0) {
            FUN_004024d8((int *)local_24,3);
          }
        }
      }
      puVar7 = (undefined4 *)FUN_00406f3c(param_1,param_2,0x1e,1,0,local_44,-1);
      FUN_00403ecc(local_14,3);
      if (local_1c != (int *)0x0) {
        (**(code **)*local_1c)(local_1c,3);
      }
      uVar2 = *puVar7;
      FUN_00403310(local_44,2);
      puVar4 = local_10 + 3;
      *puVar4 = *puVar4 - 1;
      if (*puVar4 == 0) {
        FUN_004024d8((int *)local_10,3);
      }
    }
  }
  return uVar2;
}



/* @00420e58 file=? name=FUN_00420e58 */

void __cdecl FUN_00420e58(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



/* @00420e6e file=? name=FUN_00420e6e */

void __cdecl FUN_00420e6e(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  return;
}



/* @00420e84 file=? name=FUN_00420e84 */

void FUN_00420e84(void)

{
  return;
}



/* @00420e8c file=? name=FUN_00420e8c */

void __cdecl FUN_00420e8c(undefined4 *param_1)

{
  *param_1 = 0;
  param_1[1] = DAT_004e42d0;
  return;
}



/* @00420ea4 file=? name=FUN_00420ea4 */

void __cdecl FUN_00420ea4(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  return;
}



/* @00420ebc file=? name=FUN_00420ebc */

void __cdecl FUN_00420ebc(undefined4 *param_1,undefined4 param_2)

{
  *param_1 = param_2;
  param_1[1] = DAT_004e42d0;
  return;
}



/* @00420ed4 file=? name=FUN_00420ed4 */

void __cdecl FUN_00420ed4(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  *param_1 = param_2;
  param_1[1] = param_3;
  return;
}



/* @00420ee8 file=? name=FUN_00420ee8 */

undefined4 FUN_00420ee8(void)

{
  return 1;
}



/* @00420ef4 file=? name=FUN_00420ef4 */

void __cdecl FUN_00420ef4(undefined4 *param_1,undefined4 *param_2)

{
  *param_1 = *param_2;
  param_1[1] = param_2[1];
  return;
}



/* @00420f0c file=? name=FUN_00420f0c */

void __cdecl FUN_00420f0c(int *param_1,int *param_2)

{
  *param_1 = *param_1 + *param_2;
  param_1[1] = param_1[1] + param_2[1];
  return;
}



/* @00420f24 file=? name=FUN_00420f24 */

undefined4 * __cdecl FUN_00420f24(undefined4 *param_1,int *param_2,int *param_3)

{
  FUN_00420ed4(param_1,*param_2 - *param_3,param_2[1] - param_3[1]);
  return param_1;
}



/* @00420f54 file=? name=FUN_00420f54 */

void __cdecl FUN_00420f54(int *param_1,int *param_2)

{
  *param_1 = *param_1 - *param_2;
  param_1[1] = param_1[1] - param_2[1];
  return;
}



/* @00420f6c file=? name=FUN_00420f6c */

void __cdecl FUN_00420f6c(int param_1,int param_2)

{
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + param_2;
  return;
}



/* @00420f7c file=? name=FUN_00420f7c */

void __cdecl FUN_00420f7c(int param_1,int param_2)

{
  *(int *)(param_1 + 4) = *(int *)(param_1 + 4) - param_2;
  return;
}



/* @00420f8c file=? name=FUN_00420f8c */

bool __cdecl FUN_00420f8c(int *param_1,int *param_2)

{
  bool bVar1;
  
  if (*param_1 == *param_2) {
    bVar1 = param_1[1] < param_2[1];
  }
  else {
    bVar1 = *param_1 < *param_2;
  }
  return bVar1;
}



/* @00420fbc file=? name=FUN_00420fbc */

bool __cdecl FUN_00420fbc(int *param_1,int *param_2)

{
  bool bVar1;
  
  if (*param_1 == *param_2) {
    bVar1 = param_1[1] <= param_2[1];
  }
  else {
    bVar1 = *param_1 < *param_2;
  }
  return bVar1;
}



/* @00420fec file=? name=FUN_00420fec */

bool __cdecl FUN_00420fec(int *param_1,int *param_2)

{
  bool bVar1;
  
  if (*param_1 == *param_2) {
    bVar1 = param_2[1] < param_1[1];
  }
  else {
    bVar1 = *param_2 < *param_1;
  }
  return bVar1;
}



/* @0042101c file=? name=FUN_0042101c */

bool __cdecl FUN_0042101c(int *param_1,int *param_2)

{
  bool bVar1;
  
  if (*param_1 == *param_2) {
    bVar1 = param_2[1] <= param_1[1];
  }
  else {
    bVar1 = *param_2 < *param_1;
  }
  return bVar1;
}



/* @0042104c file=? name=FUN_0042104c */

undefined4 __cdecl FUN_0042104c(int *param_1,int *param_2)

{
  undefined4 uVar1;
  
  if ((*param_1 == *param_2) && (param_1[1] == param_2[1])) {
    uVar1 = 1;
  }
  else {
    uVar1 = 0;
  }
  return uVar1;
}



/* @00421070 file=? name=FUN_00421070 */

undefined4 __cdecl FUN_00421070(int *param_1,int *param_2)

{
  undefined4 uVar1;
  
  if ((*param_1 == *param_2) && (param_1[1] == param_2[1])) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
  }
  return uVar1;
}



/* @00421094 file=? name=FUN_00421094 */

undefined4 __cdecl FUN_00421094(int param_1)

{
  return *(undefined4 *)(param_1 + 4);
}



/* @004210ac file=? name=FUN_004210ac */

undefined4 * __cdecl FUN_004210ac(undefined4 *param_1)

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e43cc;
  FUN_004213aa(param_1 + 4,0);
  return param_1;
}



/* @004210d8 file=? name=FUN_004210d8 */

void __cdecl FUN_004210d8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e43cc;
    FUN_004213c9(param_1 + 4,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00421114 file=? name=FUN_00421114 */

undefined4 * __cdecl FUN_00421114(undefined4 *param_1)

{
  undefined4 *puVar1;
  
  FUN_0041d520(param_1,0x12,&DAT_004e4304,1);
  *param_1 = &PTR_FUN_004e43b4;
  FUN_00403a30(param_1 + 6);
  puVar1 = FUN_004212b0((int)param_1,s_DeathRow_004e431a);
  param_1[5] = puVar1;
  return param_1;
}



/* @00421154 file=? name=FUN_00421154 */

void __cdecl FUN_00421154(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e43b4;
    while (iVar2 = param_1[7], iVar2 != 0) {
      puVar1 = *(undefined4 **)(iVar2 + 4);
      FUN_00403b1c((int)(param_1 + 6),iVar2 + 8);
      if (puVar1 != (undefined4 *)0x0) {
        (**(code **)*puVar1)(puVar1,3);
      }
    }
    FUN_00403a48(param_1 + 6,2);
    FUN_0041d554(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004211bc file=? name=FUN_004211bc */

void __cdecl FUN_004211bc(int param_1)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_00421414(local_10,*(int *)(param_1 + 0x14) + 0x10);
  puVar1 = (undefined4 *)(**(code **)(local_10[0] + 0x30))(local_10);
  if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  FUN_00421452(local_10,2);
  return;
}



/* @0042120c file=? name=FUN_0042120c */

void __cdecl FUN_0042120c(undefined4 param_1,undefined4 param_2,uint *param_3)

{
  int iVar1;
  
  iVar1 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_3 + 3);
  if (iVar1 == 0) {
    if (param_3[1] == 3) {
      FUN_00433294(*(int **)(DAT_004efc94 + 0x28),(int)param_3);
    }
  }
  else if ((*(int *)(iVar1 + 4) == 0x30) && (param_3[1] == 0x15)) {
    FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),4,iVar1,param_3,DAT_004e17f4);
  }
  else {
    FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),2,iVar1,param_3,DAT_004e17f4);
  }
  return;
}



/* @004212b0 file=? name=FUN_004212b0 */

undefined4 * __cdecl FUN_004212b0(int param_1,char *param_2)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  
  puVar1 = (undefined4 *)FUN_00403ad0(param_1 + 0x18,param_2);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)FUN_00402298(0x20);
    if (puVar1 == (undefined4 *)0x0) {
      puVar1 = (undefined4 *)0x0;
    }
    else {
      puVar1 = FUN_004210ac(puVar1);
    }
    uVar2 = (**(code **)(*(int *)(param_1 + 0x18) + 4))(param_1 + 0x18,param_2,puVar1);
    puVar1[3] = uVar2;
  }
  return puVar1;
}



/* @00421308 file=? name=FUN_00421308 */

void __cdecl FUN_00421308(int param_1,undefined4 *param_2)

{
  FUN_00403b1c(param_1 + 0x18,param_2[3]);
  if (param_2 != (undefined4 *)0x0) {
    (**(code **)*param_2)(param_2,3);
  }
  return;
}



/* @00421334 file=? name=FUN_00421334 */

void __cdecl FUN_00421334(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e42d4);
  return;
}



/* @004213aa file=? name=FUN_004213aa */

undefined4 * __cdecl FUN_004213aa(undefined4 *param_1,undefined4 param_2)

{
  FUN_00417be0(param_1,param_2);
  *param_1 = &PTR_FUN_004e43ac;
  return param_1;
}



/* @004213c9 file=? name=FUN_004213c9 */

void __cdecl FUN_004213c9(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e43ac;
    FUN_00417c0c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004213f5 file=? name=FUN_004213f5 */

undefined4 * __cdecl FUN_004213f5(undefined4 *param_1,int param_2)

{
  FUN_00417d00(param_1,param_2);
  *param_1 = &PTR_FUN_004e435c;
  return param_1;
}



/* @00421414 file=? name=FUN_00421414 */

undefined4 * __cdecl FUN_00421414(undefined4 *param_1,int param_2)

{
  FUN_00417d00(param_1,param_2);
  *param_1 = &PTR_FUN_004e435c;
  return param_1;
}



/* @00421433 file=? name=FUN_00421433 */

undefined4 * __cdecl FUN_00421433(undefined4 *param_1,int param_2)

{
  FUN_00417d28(param_1,param_2);
  *param_1 = &PTR_FUN_004e435c;
  return param_1;
}



/* @00421452 file=? name=FUN_00421452 */

void __cdecl FUN_00421452(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e435c;
    FUN_00417d54(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00421480 file=? name=FUN_00421480 */

undefined4 * __cdecl FUN_00421480(undefined4 *param_1,int param_2)

{
  FUN_0041c477(param_1,param_2 + 0x148);
  *param_1 = &PTR_FUN_004e44bc;
  return param_1;
}



/* @004214a4 file=? name=FUN_004214a4 */

undefined4 * __cdecl FUN_004214a4(undefined4 *param_1,int param_2)

{
  FUN_0041c4b5(param_1,param_2);
  *param_1 = &PTR_FUN_004e44bc;
  return param_1;
}



/* @004214c4 file=? name=FUN_004214c4 */

void __cdecl FUN_004214c4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e44bc;
    FUN_0041c4d4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004214f0 file=? name=FUN_004214f0 */

undefined4 * __cdecl FUN_004214f0(undefined4 *param_1,int param_2)

{
  FUN_0041c477(param_1,param_2 + 0x15c);
  *param_1 = &PTR_FUN_004e4468;
  return param_1;
}



/* @00421514 file=? name=FUN_00421514 */

undefined4 * __cdecl FUN_00421514(undefined4 *param_1,int param_2)

{
  FUN_0041c4b5(param_1,param_2);
  *param_1 = &PTR_FUN_004e4468;
  return param_1;
}



/* @00421534 file=? name=FUN_00421534 */

void __cdecl FUN_00421534(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4468;
    FUN_0041c4d4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00421560 file=? name=FUN_00421560 */

undefined4 * __cdecl FUN_00421560(undefined4 *param_1,int param_2)

{
  FUN_0041c477(param_1,param_2 + 0x170);
  *param_1 = &PTR_FUN_004e4414;
  return param_1;
}



/* @00421584 file=? name=FUN_00421584 */

void __cdecl FUN_00421584(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4414;
    FUN_0041c4d4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004215b0 file=? name=FUN_004215b0 */

int __cdecl FUN_004215b0(int param_1,char *param_2)

{
  char *pcVar1;
  undefined4 *puVar2;
  int *piVar3;
  char *pcVar4;
  char *pcVar5;
  int iVar6;
  bool bVar7;
  
  piVar3 = FUN_0040485c(param_1,(char *)0x0);
  iVar6 = 0;
  for (puVar2 = (undefined4 *)piVar3[1]; puVar2 != (undefined4 *)0x0; puVar2 = (undefined4 *)*puVar2
      ) {
    pcVar5 = (char *)(puVar2 + 2);
    pcVar4 = param_2;
    do {
      if (*pcVar4 != *pcVar5) goto LAB_00421605;
      bVar7 = true;
      if (*pcVar4 == '\0') break;
      pcVar1 = pcVar4 + 1;
      if (*pcVar1 != pcVar5[1]) goto LAB_00421605;
      pcVar4 = pcVar4 + 2;
      pcVar5 = pcVar5 + 2;
      bVar7 = *pcVar1 == '\0';
    } while (!bVar7);
    if (bVar7) {
      if (piVar3 == (int *)0x0) {
        return iVar6;
      }
      (**(code **)*piVar3)(piVar3,3);
      return iVar6;
    }
LAB_00421605:
    iVar6 = iVar6 + 1;
  }
  if (piVar3 != (int *)0x0) {
    (**(code **)*piVar3)(piVar3,3);
  }
  pcVar5 = &DAT_004e43d8;
  do {
    if (*param_2 != *pcVar5) goto LAB_00421644;
    bVar7 = true;
    if (*param_2 == '\0') break;
    pcVar4 = param_2 + 1;
    if (*pcVar4 != pcVar5[1]) goto LAB_00421644;
    param_2 = param_2 + 2;
    pcVar5 = pcVar5 + 2;
    bVar7 = *pcVar4 == '\0';
  } while (!bVar7);
  if (!bVar7) {
LAB_00421644:
    iVar6 = -1;
  }
  return iVar6;
}



/* @0042164c file=? name=FUN_0042164c */

undefined4 FUN_0042164c(void)

{
  return 1;
}



/* @00421658 file=? name=FUN_00421658 */

void __cdecl FUN_00421658(char *param_1,float *param_2)

{
  uint *puVar1;
  float10 fVar2;
  uint local_bc [2];
  char *local_b4;
  uint local_ac [2];
  char *local_a4;
  uint local_9c [2];
  char *local_94;
  uint local_8c [2];
  char *local_84;
  uint local_7c [2];
  char *local_74;
  uint local_6c [2];
  char *local_64;
  uint local_5c [2];
  char *local_54;
  uint local_4c [2];
  char *local_44;
  uint local_3c [2];
  char *local_34;
  uint *local_2c;
  uint *local_28;
  uint *local_24;
  uint *local_20;
  uint *local_1c;
  uint *local_18;
  uint *local_14;
  uint *local_10;
  uint *local_c;
  uint *local_8;
  
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,param_1);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00402838(local_3c,local_8,0,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_c = (uint *)0x0;
  }
  else {
    local_c = FUN_00402460(puVar1,local_34);
  }
  local_c[3] = local_c[3] + 1;
  FUN_004024d8((int *)local_3c,2);
  fVar2 = (float10)FUN_004dd1cc(local_c[2]);
  *param_2 = (float)fVar2;
  puVar1 = local_c + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_c,3);
  }
  FUN_00402838(local_4c,local_8,1,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar1,local_44);
  }
  local_10[3] = local_10[3] + 1;
  FUN_004024d8((int *)local_4c,2);
  fVar2 = (float10)FUN_004dd1cc(local_10[2]);
  param_2[1] = (float)fVar2;
  puVar1 = local_10 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  FUN_00402838(local_5c,local_8,2,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_14 = (uint *)0x0;
  }
  else {
    local_14 = FUN_00402460(puVar1,local_54);
  }
  local_14[3] = local_14[3] + 1;
  FUN_004024d8((int *)local_5c,2);
  fVar2 = (float10)FUN_004dd1cc(local_14[2]);
  param_2[2] = (float)fVar2;
  puVar1 = local_14 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_14,3);
  }
  FUN_00402838(local_6c,local_8,3,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_18 = (uint *)0x0;
  }
  else {
    local_18 = FUN_00402460(puVar1,local_64);
  }
  local_18[3] = local_18[3] + 1;
  FUN_004024d8((int *)local_6c,2);
  fVar2 = (float10)FUN_004dd1cc(local_18[2]);
  param_2[3] = (float)fVar2;
  puVar1 = local_18 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_18,3);
  }
  FUN_00402838(local_7c,local_8,4,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_1c = (uint *)0x0;
  }
  else {
    local_1c = FUN_00402460(puVar1,local_74);
  }
  local_1c[3] = local_1c[3] + 1;
  FUN_004024d8((int *)local_7c,2);
  fVar2 = (float10)FUN_004dd1cc(local_1c[2]);
  param_2[4] = (float)fVar2;
  puVar1 = local_1c + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_1c,3);
  }
  FUN_00402838(local_8c,local_8,5,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_20 = (uint *)0x0;
  }
  else {
    local_20 = FUN_00402460(puVar1,local_84);
  }
  local_20[3] = local_20[3] + 1;
  FUN_004024d8((int *)local_8c,2);
  fVar2 = (float10)FUN_004dd1cc(local_20[2]);
  param_2[5] = (float)fVar2;
  puVar1 = local_20 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_20,3);
  }
  FUN_00402838(local_9c,local_8,6,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_24 = (uint *)0x0;
  }
  else {
    local_24 = FUN_00402460(puVar1,local_94);
  }
  local_24[3] = local_24[3] + 1;
  FUN_004024d8((int *)local_9c,2);
  fVar2 = (float10)FUN_004dd1cc(local_24[2]);
  param_2[6] = (float)fVar2;
  puVar1 = local_24 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_24,3);
  }
  FUN_00402838(local_ac,local_8,7,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_28 = (uint *)0x0;
  }
  else {
    local_28 = FUN_00402460(puVar1,local_a4);
  }
  local_28[3] = local_28[3] + 1;
  FUN_004024d8((int *)local_ac,2);
  fVar2 = (float10)FUN_004dd1cc(local_28[2]);
  param_2[7] = (float)fVar2;
  puVar1 = local_28 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_28,3);
  }
  FUN_00402838(local_bc,local_8,8,(char *)0x0);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_2c = (uint *)0x0;
  }
  else {
    local_2c = FUN_00402460(puVar1,local_b4);
  }
  local_2c[3] = local_2c[3] + 1;
  FUN_004024d8((int *)local_bc,2);
  fVar2 = (float10)FUN_004dd1cc(local_2c[2]);
  param_2[8] = (float)fVar2;
  puVar1 = local_2c + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_2c,3);
  }
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00421aa0 file=? name=FUN_00421aa0 */

undefined4 * __cdecl FUN_00421aa0(undefined4 *param_1,int param_2)

{
  undefined4 extraout_EAX;
  
  *param_1 = &PTR_FUN_004e4510;
  param_1[1] = param_2;
  FUN_004de998((int *)0x0,0x24,param_2,1,FUN_00421b0a);
  param_1[2] = extraout_EAX;
  return param_1;
}



/* @00421ad4 file=? name=FUN_00421ad4 */

void __cdecl FUN_00421ad4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4510;
    FUN_004022e8((int *)param_1[2]);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00421b00 file=? name=FUN_00421b00 */

undefined4 FUN_00421b00(void)

{
  return 1;
}



/* @00421b0a file=? name=FUN_00421b0a */

undefined4 __cdecl FUN_00421b0a(undefined4 param_1)

{
  return param_1;
}



/* @00421b12 file=? name=FUN_00421b12 */

int __cdecl FUN_00421b12(int param_1,int param_2)

{
  return param_2 * 0x24 + *(int *)(param_1 + 8);
}



/* @00421b2c file=? name=FUN_00421b2c */

void __cdecl FUN_00421b2c(int param_1)

{
  FUN_00408744((float *)(param_1 + 0x200),(float *)(param_1 + 0x1dc),(float *)(param_1 + 0xd0));
  FUN_00408744((float *)(param_1 + 500),(float *)(param_1 + 0x1c4),(float *)(param_1 + 0xd0));
  return;
}



/* @00421b6c file=? name=FUN_00421b6c */

void __cdecl FUN_00421b6c(int param_1)

{
  FUN_0040879c((float *)(param_1 + 0x1c4),(float *)(param_1 + 500),(float *)(param_1 + 0xd0));
  FUN_0040879c((float *)(param_1 + 0x1dc),(float *)(param_1 + 0x200),(float *)(param_1 + 0xd0));
  return;
}



/* @00421bac file=? name=FUN_00421bac */

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

void __cdecl FUN_00421bac(int param_1,float param_2)

{
  float *pfVar1;
  float *pfVar2;
  float local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  float local_14 [3];
  float local_8;
  
  local_8 = _DAT_00421ca4 * param_2 * param_2;
  FUN_004086ac(local_14,(float *)(param_1 + 0x200),local_8);
  pfVar1 = (float *)(param_1 + 500);
  FUN_00408614(local_14,local_14,pfVar1,param_2);
  FUN_004085ec((float *)(param_1 + 0x100),(float *)(param_1 + 0x100),local_14);
  FUN_004086ac(local_14,(float *)(param_1 + 0x1e8),local_8);
  pfVar2 = (float *)(param_1 + 0x1d0);
  FUN_00408614(local_14,local_14,pfVar2,param_2);
  local_24 = *(float *)(param_1 + 0x10c);
  local_20 = *(undefined4 *)(param_1 + 0x110);
  local_1c = *(undefined4 *)(param_1 + 0x114);
  local_18 = *(undefined4 *)(param_1 + 0x118);
  FUN_00409f58((float *)(param_1 + 0x10c),&local_24,local_14);
  FUN_00408614(pfVar1,pfVar1,(float *)(param_1 + 0x200),param_2);
  FUN_00408614(pfVar2,pfVar2,(float *)(param_1 + 0x1e8),param_2);
  return;
}



/* @00421ca8 file=? name=FUN_00421ca8 */

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

void __cdecl
FUN_00421ca8(int param_1,float *param_2,float *param_3,float *param_4,float *param_5,float param_6)

{
  int iVar1;
  float10 fVar2;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  iVar1 = *(int *)(param_1 + 0x250);
  FUN_0040879c(&local_14,(float *)(iVar1 + 0x14),(float *)(param_1 + 0xd0));
  FUN_004085ec(&local_14,&local_14,param_3);
  if (_DAT_00421e28 <= local_14) {
    *param_2 = -*param_4;
    fVar2 = FUN_004dce94((double)local_14,SUB84((double)param_6,0),
                         (uint)((ulonglong)(double)param_6 >> 0x20));
  }
  else {
    *param_2 = *param_5;
    fVar2 = FUN_004dce94((double)-local_14,SUB84((double)param_6,0),
                         (uint)((ulonglong)(double)param_6 >> 0x20));
  }
  local_20 = (float)fVar2;
  if (_DAT_00421e28 <= local_10) {
    param_2[1] = -param_4[1];
    fVar2 = FUN_004dce94((double)local_10,SUB84((double)param_6,0),
                         (uint)((ulonglong)(double)param_6 >> 0x20));
  }
  else {
    param_2[1] = param_5[1];
    fVar2 = FUN_004dce94((double)-local_10,SUB84((double)param_6,0),
                         (uint)((ulonglong)(double)param_6 >> 0x20));
  }
  local_1c = (float)fVar2;
  if (_DAT_00421e28 <= local_c) {
    param_2[2] = -param_4[2];
    fVar2 = FUN_004dce94((double)local_c,SUB84((double)param_6,0),
                         (uint)((ulonglong)(double)param_6 >> 0x20));
  }
  else {
    param_2[2] = param_5[2];
    fVar2 = FUN_004dce94((double)-local_c,SUB84((double)param_6,0),
                         (uint)((ulonglong)(double)param_6 >> 0x20));
  }
  local_18 = (float)fVar2;
  local_8 = *(float *)(iVar1 + 4);
  FUN_004086ac(param_2,param_2,local_8);
  FUN_004086d0(param_2,param_2,&local_20);
  return;
}



/* @00421e2c file=? name=FUN_00421e2c */

void __cdecl FUN_00421e2c(int param_1,float param_2)

{
  float local_10 [3];
  
  FUN_00421ca8(param_1,local_10,(float *)(param_1 + 0x1c4),(float *)(param_1 + 0x21c),
               (float *)(param_1 + 0x228),param_2);
  FUN_004085ec((float *)(param_1 + 0x1dc),(float *)(param_1 + 0x1dc),local_10);
  FUN_004086d0(local_10,(float *)(param_1 + 0x234),(float *)(param_1 + 0x1d0));
  FUN_00408644((float *)(param_1 + 0x1e8),(float *)(param_1 + 0x1e8),local_10);
  FUN_00421b2c(param_1);
  *(float *)(param_1 + 0x204) = *(float *)(param_1 + 0x204) - **(float **)(param_1 + 0x250);
  return;
}



/* @00421ec0 file=? name=FUN_00421ec0 */

void __cdecl FUN_00421ec0(int param_1,float *param_2,float *param_3)

{
  float local_10 [3];
  
  FUN_004086f8(local_10,param_2,*(float *)(param_1 + 0x20c));
  FUN_00421ef8(param_1,local_10,param_3);
  return;
}



/* @00421ef8 file=? name=FUN_00421ef8 */

void __cdecl FUN_00421ef8(int param_1,float *param_2,float *param_3)

{
  float local_10 [3];
  
  FUN_004085ec((float *)(param_1 + 0x1dc),(float *)(param_1 + 0x1dc),param_2);
  FUN_0040866c(local_10,param_3,param_2);
  FUN_004086d0(local_10,local_10,(float *)(param_1 + 0x210));
  FUN_004085ec((float *)(param_1 + 0x1e8),(float *)(param_1 + 0x1e8),local_10);
  return;
}



/* @00421f5c file=? name=FUN_00421f5c */

undefined4 __cdecl FUN_00421f5c(int param_1)

{
  FUN_0040a938((undefined4 *)(param_1 + 0x260),(undefined4 *)(param_1 + 300));
  return 0;
}



/* @00421f7c file=? name=FUN_00421f7c */

undefined4 __cdecl FUN_00421f7c(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  float local_14 [3];
  float local_8;
  
  if (((*(uint *)(param_1 + 0x28) & 0xc) == 4) &&
     (*(int *)(param_1 + 0x10) < *(int *)(param_1 + 0x2e0))) {
    iVar1 = *(int *)(param_1 + 0x2e0) - *(int *)(param_1 + 0x14);
    uVar2 = 1;
  }
  else {
    iVar1 = *(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x14);
    uVar2 = 0;
  }
  local_8 = (float)iVar1 / DAT_0052140c;
  FUN_004086ac(local_14,(float *)(param_1 + 0x2c8),local_8);
  FUN_004085ec((float *)(param_1 + 0x260),(float *)(param_1 + 300),local_14);
  FUN_004086ac(local_14,(float *)(param_1 + 0x2d4),local_8);
  FUN_00409f58((float *)(param_1 + 0x26c),(float *)(param_1 + 0x138),local_14);
  FUN_0040a7f4((undefined4 *)(param_1 + 0x298),(undefined4 *)(param_1 + 0x2c8));
  return uVar2;
}



/* @00422060 file=? name=FUN_00422060 */

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

undefined4 __cdecl FUN_00422060(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  float local_18 [3];
  float local_c;
  float local_8;
  
  if (((*(uint *)(param_1 + 0x28) & 0xc) == 4) &&
     (*(int *)(param_1 + 0x10) < *(int *)(param_1 + 0x2e0))) {
    iVar1 = *(int *)(param_1 + 0x2e0) - *(int *)(param_1 + 0x14);
    uVar2 = 1;
  }
  else {
    iVar1 = *(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x14);
    uVar2 = 0;
  }
  local_8 = (float)iVar1 / DAT_0052140c;
  local_c = _DAT_004221bc * local_8 * local_8;
  FUN_004086ac(local_18,(float *)(param_1 + 0x2b0),local_c);
  FUN_00408614(local_18,local_18,(float *)(param_1 + 0x2c8),local_8);
  FUN_004085ec((float *)(param_1 + 0x260),(float *)(param_1 + 300),local_18);
  FUN_004086ac(local_18,(float *)(param_1 + 700),local_c);
  FUN_00408614(local_18,local_18,(float *)(param_1 + 0x2d4),local_8);
  FUN_00409f58((float *)(param_1 + 0x26c),(float *)(param_1 + 0x138),local_18);
  if ((*(uint *)(param_1 + 0x28) & 0xc) == 4) {
    FUN_00408614((float *)(param_1 + 0x298),(float *)(param_1 + 0x2c8),(float *)(param_1 + 0x200),
                 local_8);
    FUN_00408614((float *)(param_1 + 0x2a4),(float *)(param_1 + 0x2d4),(float *)(param_1 + 0x1e8),
                 local_8);
  }
  return uVar2;
}



/* @0042249c file=? name=FUN_0042249c */

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

void __cdecl FUN_0042249c(int *param_1,undefined4 *param_2)

{
  int *piVar1;
  
  if (*(short *)((int)param_2 + 6) == 0) {
    piVar1 = (int *)FUN_00414b60();
    param_1[0xb8] = *piVar1;
    if ((float)(param_1[0xb8] - param_1[5]) / DAT_0052140c < _DAT_004225a0) {
      param_1[0xb8] = param_1[0xb8] + (param_1[0xb8] - param_1[5]);
    }
    FUN_0041f76c((int)param_1,param_2);
    FUN_0040a7f4(param_1 + 0x77,param_2 + 0x11);
    FUN_00408440(param_1 + 0x80,param_2 + 0x1a);
    FUN_00408440(param_1 + 0xb2,param_2 + 0x17);
    FUN_00408440(param_1 + 0xb5,param_2 + 0xe);
    FUN_00408440(param_1 + 0xac,param_2 + 0x1a);
    FUN_00408440(param_1 + 0xaf,param_2 + 0x14);
    if ((*(byte *)((int)param_1 + 0x29) & 0x40) == 0) {
      (**(code **)(*param_1 + 0x34))(param_1);
    }
  }
  else {
    FUN_0041f76c((int)param_1,param_2);
  }
  return;
}



/* @004225a4 file=? name=FUN_004225a4 */

void __cdecl FUN_004225a4(int param_1,int *param_2,int param_3)

{
  if (param_3 == 0) {
    FUN_0041f680(param_1,param_2,0);
    *param_2 = 0x74;
    FUN_0040a7f4(param_2 + 0xb,(undefined4 *)(param_1 + 0x1c4));
    FUN_0040a7f4(param_2 + 0x11,(undefined4 *)(param_1 + 0x1dc));
    FUN_00408440(param_2 + 0x17,(undefined4 *)(param_1 + 500));
    FUN_00408440(param_2 + 0x1a,(undefined4 *)(param_1 + 0x200));
    FUN_00408440((undefined4 *)(param_1 + 0x2c8),(undefined4 *)(param_1 + 500));
    FUN_00408440((undefined4 *)(param_1 + 0x2d4),(undefined4 *)(param_1 + 0x1d0));
    FUN_00408440((undefined4 *)(param_1 + 0x2b0),(undefined4 *)(param_1 + 0x200));
    FUN_00408440((undefined4 *)(param_1 + 700),(undefined4 *)(param_1 + 0x1e8));
  }
  else {
    FUN_0041f680(param_1,param_2,param_3);
  }
  return;
}



/* @00422684 file=? name=FUN_00422684 */

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

void __cdecl FUN_00422684(int param_1)

{
  float *pfVar1;
  int iVar2;
  float local_28;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  if (*(int *)(param_1 + 0x2e4) != 0) {
    FUN_0040ab44((float *)(param_1 + 0xd0),(undefined4 *)(param_1 + 0x100));
    pfVar1 = *(float **)(param_1 + 0x2ec);
    local_10 = (*pfVar1 + pfVar1[1]) * _DAT_004227ac;
    local_c = (pfVar1[2] + pfVar1[3]) * _DAT_004227ac;
    local_8 = (pfVar1[4] + pfVar1[5]) * _DAT_004227ac;
    local_1c = *(float *)(*(int *)(param_1 + 0x2ec) + 4) - local_10;
    local_18 = *(float *)(*(int *)(param_1 + 0x2ec) + 0xc) - local_c;
    local_14 = *(float *)(*(int *)(param_1 + 0x2ec) + 0x14) - local_8;
    FUN_00408b98(&local_28,&local_10,(float *)(param_1 + 0xd0));
    pfVar1 = *(float **)(param_1 + 0x2e8);
    *pfVar1 = local_28 - local_1c;
    pfVar1[1] = local_28 + local_1c;
    pfVar1[2] = local_24 - local_18;
    pfVar1[3] = local_24 + local_18;
    pfVar1[4] = local_20 - local_14;
    pfVar1[5] = local_20 + local_14;
    if ((*(uint *)(param_1 + 0x28) & 0xc) != 4) {
      iVar2 = FUN_00433ed4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
      iVar2 = FUN_0040e36c(**(int **)(iVar2 + 0x30),*(int *)(param_1 + 0x2e8));
      *(int *)(param_1 + 0x2f0) = iVar2;
    }
  }
  return;
}



/* @004227b0 file=? name=FUN_004227b0 */

void __cdecl FUN_004227b0(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = *(undefined4 **)(param_1 + 0x2f4);
  if (puVar1 == *(undefined4 **)(param_1 + 0x2f8)) {
    puVar1 = puVar1 + 5;
  }
  puVar1[4] = 0;
  puVar1[1] = *puVar1;
  puVar1[3] = puVar1[2];
  return;
}



/* @004227e0 file=? name=FUN_004227e0 */

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

int __cdecl FUN_004227e0(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  float local_24;
  float local_20;
  float local_1c;
  int local_18 [5];
  
  if (param_2 == 0) {
    param_2 = FUN_004227b0(param_1);
  }
  FUN_004355bc(local_18,*(int *)(param_1 + 0x2fc));
  while( true ) {
    iVar2 = (**(code **)(local_18[0] + 0x28))(local_18);
    if (iVar2 == 0) break;
    if (param_1 != iVar2) {
      FUN_00408644(&local_24,(float *)(iVar2 + 0x100),(float *)(param_1 + 0x100));
      if (local_1c * local_1c + local_20 * local_20 + local_24 * local_24 <= _DAT_00422918) {
        iVar1 = FUN_0041a1a4(**(int **)(iVar2 + 0xc),0x4e4518);
        if (iVar1 == 0) {
          iVar1 = FUN_0041a1a4(**(int **)(iVar2 + 0xc),0x4e744c);
          if (iVar1 != 0) {
            for (iVar1 = 0; iVar1 < *(int *)(iVar2 + 0x124); iVar1 = iVar1 + 1) {
              FUN_00423414(param_1,param_2,
                           *(float **)(*(int *)(*(int *)(iVar2 + 0x128) + iVar1 * 4) + 0x130));
            }
          }
        }
        else {
          FUN_00423414(param_1,param_2,*(float **)(iVar2 + 0x2e8));
        }
      }
    }
  }
  FUN_0040e4ac(*(int *)(param_1 + 0x2f0),*(undefined4 *)(param_1 + 0x2e8),
               (undefined4 *)*(undefined4 *)(param_1 + 0x2e8),param_2);
  FUN_004355e8(local_18,2);
  return param_2;
}



/* @0042291c file=? name=FUN_0042291c */

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

int __cdecl FUN_0042291c(int param_1,float *param_2,int param_3)

{
  float *pfVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  int local_34 [5];
  float local_20 [3];
  float local_14;
  float local_10;
  int local_c;
  float local_8;
  
  local_8 = param_2[6] * _DAT_00422b20;
  FUN_0040cdf4(param_2,local_8,local_20);
  FUN_004355bc(local_34,*(int *)(param_1 + 0x2fc));
  local_c = 0;
  while( true ) {
    iVar4 = (**(code **)(local_34[0] + 0x28))(local_34);
    if (iVar4 == 0) break;
    if ((param_1 != iVar4) && ((param_3 == 0 || (iVar4 != param_3)))) {
      iVar2 = FUN_0041a1a4(**(int **)(iVar4 + 0xc),0x4e4518);
      if (iVar2 == 0) {
        iVar2 = FUN_0041a1a4(**(int **)(iVar4 + 0xc),0x4e744c);
        if (iVar2 != 0) {
          FUN_00408644(&local_4c,(float *)(iVar4 + 0x100),local_20);
          local_14 = local_8 + _DAT_00422b24;
          if (local_44 * local_44 + local_48 * local_48 + local_4c * local_4c <= local_14 * local_14
             ) {
            for (iVar2 = 0; iVar2 < *(int *)(iVar4 + 0x124); iVar2 = iVar2 + 1) {
              iVar3 = FUN_004234c0(param_1,(int)param_2,
                                   *(int *)(*(int *)(*(int *)(iVar4 + 0x128) + iVar2 * 4) + 0x130));
              if (iVar3 != 0) {
                local_c = iVar3;
              }
            }
          }
        }
      }
      else {
        FUN_00408644(&local_40,(float *)(iVar4 + 0x100),local_20);
        pfVar1 = *(float **)(iVar4 + 0x2e8);
        local_10 = local_8 + _DAT_00422b20 * ((pfVar1[3] - pfVar1[2]) + (pfVar1[1] - *pfVar1));
        if (local_38 * local_38 + local_3c * local_3c + local_40 * local_40 <= local_10 * local_10)
        {
          iVar4 = FUN_004234c0(param_1,(int)param_2,(int)pfVar1);
          if (iVar4 != 0) {
            local_c = iVar4;
          }
        }
      }
    }
  }
  iVar4 = FUN_00433ed4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
  iVar4 = FUN_0040eadc(*(int **)(iVar4 + 0x30),param_2);
  if (iVar4 != 0) {
    local_c = iVar4;
  }
  FUN_004355e8(local_34,2);
  return local_c;
}



/* @00422bac file=? name=FUN_00422bac */

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

void FUN_00422bac(int *param_1,int *param_2,undefined4 param_3,undefined4 param_4,
                 undefined4 *param_5)

{
  int iVar1;
  float10 fVar2;
  int iStack_74;
  int iStack_70;
  int iStack_6c;
  float fStack_68;
  int iStack_64;
  int iStack_60;
  float fStack_5c;
  undefined4 uStack_58;
  undefined4 uStack_54;
  float fStack_50;
  undefined4 uStack_4c;
  undefined4 uStack_48;
  float fStack_44;
  undefined4 uStack_40;
  undefined4 uStack_3c;
  float fStack_38;
  float *pfStack_34;
  float *pfStack_30;
  int *piStack_2c;
  int *piStack_28;
  float *pfStack_24;
  float fStack_20;
  int *piStack_1c;
  int *piStack_18;
  int iStack_14;
  float fStack_10;
  int iStack_c;
  undefined4 *puStack_8;
  
  param_5[1] = 0;
  *param_5 = 0;
  puStack_8 = param_5 + 8;
  FUN_00408440(puStack_8,&DAT_004e0f80);
  if (param_2[2] == param_2[3]) {
    param_1[0xbe] = 0;
    return;
  }
  FUN_0040fbb0(param_2,(float *)(param_1 + 0x7d));
  iStack_c = 0;
  fStack_44 = DAT_004e0f74;
  uStack_40 = DAT_004e0f78;
  uStack_3c = DAT_004e0f7c;
  fStack_50 = DAT_004e0f80;
  uStack_4c = DAT_004e0f84;
  uStack_48 = DAT_004e0f88;
  fStack_5c = DAT_004e0f74;
  uStack_58 = DAT_004e0f78;
  uStack_54 = DAT_004e0f7c;
  fStack_68 = (float)param_1[0x7d];
  iStack_64 = param_1[0x7e];
  iStack_60 = param_1[0x7f];
  iStack_74 = param_1[0x40];
  iStack_70 = param_1[0x41];
  iStack_6c = param_1[0x42];
  fStack_10 = 0.0;
  for (iStack_14 = 0; iStack_14 < (param_2[2] - param_2[3]) - param_2[4]; iStack_14 = iStack_14 + 1)
  {
    piStack_18 = param_1 + 0x7d;
    FUN_00408440(piStack_18,&fStack_68);
    piStack_1c = param_1 + 0x40;
    FUN_00408440(piStack_1c,&iStack_74);
    param_5[1] = 0;
    (**(code **)(*param_1 + 0x3c))(param_1,param_3,*param_2 + iStack_14 * 0x1c,param_4);
    if (_DAT_00422f38 < (float)param_5[1]) {
      iStack_c = iStack_c + 1;
      FUN_004085ec(&fStack_44,&fStack_44,(float *)(param_1 + 0x7d));
      FUN_004085ec(&fStack_50,&fStack_50,(float *)(param_1 + 0x40));
      FUN_004085ec(&fStack_5c,&fStack_5c,(float *)(param_5 + 5));
      fStack_10 = (float)param_5[1] + fStack_10;
      iVar1 = *param_2 + iStack_14 * 0x1c;
      param_5[8] = ((*(float *)(iVar1 + 4) + *(float *)(iVar1 + 8)) -
                   (*(float *)param_1[0xba] - ((float *)param_1[0xba])[1])) * _DAT_00422f3c +
                   (float)param_5[8];
      param_5[9] = ((*(float *)(iVar1 + 0xc) + *(float *)(iVar1 + 0x10)) -
                   (*(float *)(param_1[0xba] + 8) - *(float *)(param_1[0xba] + 0xc))) *
                   _DAT_00422f3c + (float)param_5[9];
      param_5[10] = ((*(float *)(iVar1 + 0x14) + *(float *)(iVar1 + 0x18)) -
                    (*(float *)(param_1[0xba] + 0x10) - *(float *)(param_1[0xba] + 0x14))) *
                    _DAT_00422f3c + (float)param_5[10];
    }
  }
  if (iStack_c < 2) {
    if (iStack_c != 1) goto LAB_00422f1e;
    piStack_28 = param_1 + 0x7d;
    FUN_00408440(piStack_28,&fStack_44);
    piStack_2c = param_1 + 0x40;
    FUN_00408440(piStack_2c,&fStack_50);
    pfStack_30 = (float *)(param_5 + 5);
    FUN_004087f4(pfStack_30,&fStack_5c);
  }
  else {
    FUN_004086f8((float *)(param_1 + 0x7d),&fStack_44,(float)iStack_c);
    fStack_20 = (float)iStack_c;
    pfStack_24 = (float *)(param_1 + 0x40);
    FUN_004086f8(pfStack_24,&fStack_50,fStack_20);
    FUN_004086f8((float *)(param_5 + 5),&fStack_5c,(float)iStack_c);
  }
  pfStack_34 = (float *)(param_5 + 5);
  fStack_38 = (float)param_5[7] * (float)param_5[7] +
              (float)param_5[6] * (float)param_5[6] + *pfStack_34 * *pfStack_34;
  fVar2 = FUN_004dcd00((double)fStack_38);
  if ((float10)_DAT_00422f40 < fVar2) {
    FUN_004087f4((float *)(param_5 + 5),(float *)(param_5 + 5));
  }
  else {
    param_5[5] = 0;
    param_5[6] = 0x3f800000;
    param_5[7] = 0;
  }
  (**(code **)(*param_1 + 0x34))();
  param_5[1] = fStack_10;
  FUN_00408644((float *)(param_5 + 2),(float *)(param_1 + 0x7d),&fStack_68);
LAB_00422f1e:
  param_1[0xbe] = (int)param_2;
  return;
}



/* @00422bb2 file=? name=FUN_00422bb2 */

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

void FUN_00422bb2(void)

{
  undefined4 *puVar1;
  int *piVar2;
  int *piVar3;
  undefined4 uVar4;
  int iVar5;
  int unaff_EBP;
  float10 fVar6;
  
  puVar1 = *(undefined4 **)(unaff_EBP + 0x18);
  piVar2 = *(int **)(unaff_EBP + 0xc);
  piVar3 = *(int **)(unaff_EBP + 8);
  puVar1[1] = 0;
  *puVar1 = 0;
  *(undefined4 **)(unaff_EBP + -4) = puVar1 + 8;
  FUN_00408440(*(undefined4 **)(unaff_EBP + -4),&DAT_004e0f80);
  if (piVar2[2] == piVar2[3]) {
    piVar3[0xbe] = 0;
    return;
  }
  FUN_0040fbb0(piVar2,(float *)(piVar3 + 0x7d));
  uVar4 = DAT_004e0f74;
  *(undefined4 *)(unaff_EBP + -8) = 0;
  *(undefined4 *)(unaff_EBP + -0x40) = uVar4;
  uVar4 = DAT_004e0f7c;
  *(undefined4 *)(unaff_EBP + -0x3c) = DAT_004e0f78;
  *(undefined4 *)(unaff_EBP + -0x38) = uVar4;
  uVar4 = DAT_004e0f84;
  *(undefined4 *)(unaff_EBP + -0x4c) = DAT_004e0f80;
  *(undefined4 *)(unaff_EBP + -0x48) = uVar4;
  uVar4 = DAT_004e0f74;
  *(undefined4 *)(unaff_EBP + -0x44) = DAT_004e0f88;
  *(undefined4 *)(unaff_EBP + -0x58) = uVar4;
  uVar4 = DAT_004e0f7c;
  *(undefined4 *)(unaff_EBP + -0x54) = DAT_004e0f78;
  *(undefined4 *)(unaff_EBP + -0x50) = uVar4;
  *(int *)(unaff_EBP + -100) = piVar3[0x7d];
  *(int *)(unaff_EBP + -0x60) = piVar3[0x7e];
  *(int *)(unaff_EBP + -0x5c) = piVar3[0x7f];
  *(int *)(unaff_EBP + -0x70) = piVar3[0x40];
  *(int *)(unaff_EBP + -0x6c) = piVar3[0x41];
  *(int *)(unaff_EBP + -0x68) = piVar3[0x42];
  *(undefined4 *)(unaff_EBP + -0xc) = 0;
  *(undefined4 *)(unaff_EBP + -0x10) = 0;
  while (*(int *)(unaff_EBP + -0x10) < (piVar2[2] - piVar2[3]) - piVar2[4]) {
    *(int **)(unaff_EBP + -0x14) = piVar3 + 0x7d;
    FUN_00408440(*(undefined4 **)(unaff_EBP + -0x14),(undefined4 *)(unaff_EBP + -100));
    *(int **)(unaff_EBP + -0x18) = piVar3 + 0x40;
    FUN_00408440(*(undefined4 **)(unaff_EBP + -0x18),(undefined4 *)(unaff_EBP + -0x70));
    puVar1[1] = 0;
    (**(code **)(*piVar3 + 0x3c))
              (piVar3,*(undefined4 *)(unaff_EBP + 0x10),*piVar2 + *(int *)(unaff_EBP + -0x10) * 0x1c
               ,*(undefined4 *)(unaff_EBP + 0x14));
    if (_DAT_00422f38 < (float)puVar1[1]) {
      *(int *)(unaff_EBP + -8) = *(int *)(unaff_EBP + -8) + 1;
      FUN_004085ec((float *)(unaff_EBP + -0x40),(float *)(unaff_EBP + -0x40),
                   (float *)(piVar3 + 0x7d));
      FUN_004085ec((float *)(unaff_EBP + -0x4c),(float *)(unaff_EBP + -0x4c),
                   (float *)(piVar3 + 0x40));
      FUN_004085ec((float *)(unaff_EBP + -0x58),(float *)(unaff_EBP + -0x58),(float *)(puVar1 + 5));
      *(float *)(unaff_EBP + -0xc) = (float)puVar1[1] + *(float *)(unaff_EBP + -0xc);
      iVar5 = *piVar2 + *(int *)(unaff_EBP + -0x10) * 0x1c;
      puVar1[8] = ((*(float *)(iVar5 + 4) + *(float *)(iVar5 + 8)) -
                  (*(float *)piVar3[0xba] - ((float *)piVar3[0xba])[1])) * _DAT_00422f3c +
                  (float)puVar1[8];
      puVar1[9] = ((*(float *)(iVar5 + 0xc) + *(float *)(iVar5 + 0x10)) -
                  (*(float *)(piVar3[0xba] + 8) - *(float *)(piVar3[0xba] + 0xc))) * _DAT_00422f3c +
                  (float)puVar1[9];
      puVar1[10] = ((*(float *)(iVar5 + 0x14) + *(float *)(iVar5 + 0x18)) -
                   (*(float *)(piVar3[0xba] + 0x10) - *(float *)(piVar3[0xba] + 0x14))) *
                   _DAT_00422f3c + (float)puVar1[10];
    }
    *(int *)(unaff_EBP + -0x10) = *(int *)(unaff_EBP + -0x10) + 1;
  }
  if (*(int *)(unaff_EBP + -8) < 2) {
    if (*(int *)(unaff_EBP + -8) != 1) goto LAB_00422f1e;
    *(int **)(unaff_EBP + -0x24) = piVar3 + 0x7d;
    FUN_00408440(*(undefined4 **)(unaff_EBP + -0x24),(undefined4 *)(unaff_EBP + -0x40));
    *(int **)(unaff_EBP + -0x28) = piVar3 + 0x40;
    FUN_00408440(*(undefined4 **)(unaff_EBP + -0x28),(undefined4 *)(unaff_EBP + -0x4c));
    *(undefined4 **)(unaff_EBP + -0x2c) = puVar1 + 5;
    FUN_004087f4(*(float **)(unaff_EBP + -0x2c),(float *)(unaff_EBP + -0x58));
  }
  else {
    FUN_004086f8((float *)(piVar3 + 0x7d),(float *)(unaff_EBP + -0x40),
                 (float)*(int *)(unaff_EBP + -8));
    *(float *)(unaff_EBP + -0x1c) = (float)*(int *)(unaff_EBP + -8);
    *(int **)(unaff_EBP + -0x20) = piVar3 + 0x40;
    FUN_004086f8(*(float **)(unaff_EBP + -0x20),(float *)(unaff_EBP + -0x4c),
                 *(float *)(unaff_EBP + -0x1c));
    FUN_004086f8((float *)(puVar1 + 5),(float *)(unaff_EBP + -0x58),(float)*(int *)(unaff_EBP + -8))
    ;
  }
  *(undefined4 **)(unaff_EBP + -0x30) = puVar1 + 5;
  *(float *)(unaff_EBP + -0x34) =
       *(float *)(*(int *)(unaff_EBP + -0x30) + 8) * *(float *)(*(int *)(unaff_EBP + -0x30) + 8) +
       *(float *)(*(int *)(unaff_EBP + -0x30) + 4) * *(float *)(*(int *)(unaff_EBP + -0x30) + 4) +
       **(float **)(unaff_EBP + -0x30) * **(float **)(unaff_EBP + -0x30);
  fVar6 = FUN_004dcd00((double)*(float *)(unaff_EBP + -0x34));
  if ((float10)_DAT_00422f40 < fVar6) {
    FUN_004087f4((float *)(puVar1 + 5),(float *)(puVar1 + 5));
  }
  else {
    puVar1[5] = 0;
    puVar1[6] = 0x3f800000;
    puVar1[7] = 0;
  }
  (**(code **)(*piVar3 + 0x34))();
  puVar1[1] = *(undefined4 *)(unaff_EBP + -0xc);
  FUN_00408644((float *)(puVar1 + 2),(float *)(piVar3 + 0x7d),(float *)(unaff_EBP + -100));
LAB_00422f1e:
  piVar3[0xbe] = (int)piVar2;
  return;
}



/* @00422fe0 file=? name=FUN_00422fe0 */

void __cdecl FUN_00422fe0(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = FUN_0043544c(param_1);
  *(undefined4 **)(param_1 + 0x2fc) = puVar1;
  return;
}



/* @00422ff8 file=? name=FUN_00422ff8 */

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

float10 __cdecl
FUN_00422ff8(int param_1,undefined4 param_2,float param_3,float param_4,float *param_5,
            float *param_6,float param_7,float *param_8)

{
  float *pfVar1;
  float10 fVar2;
  float local_40 [3];
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  local_8 = *(float *)(param_1 + 0x1fc) * param_5[2] +
            *(float *)(param_1 + 0x1f8) * param_5[1] + *(float *)(param_1 + 500) * *param_5;
  FUN_004086ac(&local_28,param_5,local_8);
  FUN_00408644(&local_34,(float *)(param_1 + 500),&local_28);
  if (local_8 <= _DAT_00423204) {
    if (-local_8 <= param_7 * param_3) {
      *param_6 = 0.0;
    }
    fVar2 = FUN_004dd138((double)(local_2c * local_2c + local_30 * local_30 + local_34 * local_34));
    local_10 = (float)fVar2;
    local_c = local_10;
    fVar2 = FUN_004dcd00((double)local_10);
    if ((float10)_DAT_00423208 < fVar2) {
      local_c = ((_DAT_0042320c + *param_6) * *param_8 * local_8) / local_c + _DAT_0042320c;
      if (local_c < _DAT_00423204) {
        local_c = _DAT_00423204;
        *param_8 = _DAT_00423204;
      }
    }
    else {
      local_c = _DAT_00423204;
      *param_8 = _DAT_00423204;
    }
    local_14 = local_c - _DAT_0042320c;
    pfVar1 = (float *)(param_1 + 500);
    FUN_004086ac(local_40,pfVar1,local_14);
    local_14 = local_c + *param_6;
    FUN_00408614(local_40,local_40,&local_28,-local_14);
    local_18 = _DAT_00423210 - *param_6;
    local_14 = local_18;
    FUN_004086ac(&local_28,&local_28,local_18);
    FUN_00408614(&local_34,&local_28,pfVar1,2.0);
    FUN_004085ec(pfVar1,pfVar1,local_40);
    local_1c = param_4 * param_3;
    local_14 = local_1c;
    FUN_004086ac(local_40,local_40,local_1c);
    FUN_004085ec((float *)(param_1 + 0x100),(float *)(param_1 + 0x100),local_40);
    fVar2 = ((float10)local_20 * (float10)local_2c +
            (float10)local_24 * (float10)local_30 + (float10)local_28 * (float10)local_34) *
            (float10)_DAT_00423214 * (float10)*(float *)(param_1 + 0x20c);
  }
  else {
    fVar2 = (float10)_DAT_00423204;
  }
  return fVar2;
}



/* @00423414 file=? name=FUN_00423414 */

void __cdecl FUN_00423414(int param_1,int param_2,float *param_3)

{
  int iVar1;
  float local_1c [6];
  
  while ((param_3 != (float *)0x0 &&
         ((iVar1 = FUN_0040db98(param_3,*(float **)(param_1 + 0x2e8),local_1c), iVar1 == 0 ||
          (FUN_0040de78(param_2,param_3,local_1c), *(int *)(param_2 + 0xc) != 0))))) {
    param_3 = (float *)param_3[10];
  }
  return;
}



/* @00423468 file=? name=FUN_00423468 */

void __cdecl FUN_00423468(int param_1,int param_2,float *param_3)

{
  int iVar1;
  float local_1c [6];
  
  while ((param_3 != (float *)0x0 &&
         ((iVar1 = FUN_0040db98(param_3,*(float **)(param_1 + 0x2e8),local_1c), iVar1 == 0 ||
          (FUN_0040de78(param_2,*(undefined4 *)(param_1 + 0x2e8),local_1c),
          *(int *)(param_2 + 0xc) != 0))))) {
    param_3 = (float *)param_3[10];
  }
  return;
}



/* @004234c0 file=? name=FUN_004234c0 */

int __cdecl FUN_004234c0(undefined4 param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  
  iVar2 = 0;
  for (; param_3 != 0; param_3 = *(int *)(param_3 + 0x28)) {
    iVar1 = FUN_0040dc58(param_3,param_2);
    if (iVar1 != 0) {
      iVar2 = param_3;
    }
  }
  return iVar2;
}



/* @004234f0 file=? name=FUN_004234f0 */

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

int * __cdecl FUN_004234f0(int *param_1,int param_2,undefined4 param_3)

{
  float *pfVar1;
  float *pfVar2;
  int iVar3;
  int extraout_EAX;
  int iVar4;
  int iVar5;
  int *piVar6;
  int local_54;
  
  FUN_0041ff38(param_1,param_2,param_3);
  pfVar1 = (float *)(param_1 + 0x71);
  pfVar2 = (float *)(param_1 + 0x77);
  *param_1 = (int)&PTR_FUN_004e4950;
  iVar5 = *(int *)(DAT_004efc94 + 0x68);
  FUN_0040a7f4(pfVar1,(undefined4 *)(param_2 + 0x4c));
  FUN_0040a7f4(pfVar2,(undefined4 *)(param_2 + 100));
  FUN_00408744((float *)(param_1 + 0x80),pfVar2,(float *)(param_1 + 0x34));
  FUN_00408744((float *)(param_1 + 0x7d),pfVar1,(float *)(param_1 + 0x34));
  FUN_00408440(param_1 + 0xb2,param_1 + 0x7d);
  FUN_00408440(param_1 + 0xb5,pfVar1);
  FUN_00408440(param_1 + 0xac,param_1 + 0x80);
  FUN_00408440(param_1 + 0xaf,pfVar2);
  param_1[0xb8] = param_1[5];
  param_1[0x93] = 0;
  if ((*(byte *)((int)param_1 + 0x2a) & 1) != 0) {
    FUN_0041bbd8((int)(param_1 + 0xb),1);
  }
  param_1[0xba] = 0;
  param_1[0xbb] = 0;
  param_1[0xbc] = 0;
  param_1[0xbd] = 0;
  param_1[0xbe] = 0;
  param_1[0xbf] = 0;
  param_1[0x95] = DAT_004e4624;
  param_1[0x96] = DAT_004e4628;
  param_1[0x97] = DAT_004e462c;
  param_1[0xb9] = 0;
  iVar3 = FUN_00407064(iVar5,param_1[0x6f],0xf);
  iVar4 = *(int *)(iVar3 + 4);
  *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;
  if (iVar4 == 0) {
    FUN_00406cd0(iVar3);
  }
  piVar6 = *(int **)(iVar3 + 0x3c);
  param_1[0x83] = *piVar6;
  param_1[0x84] = (int)(_DAT_00423860 / (float)piVar6[1]);
  param_1[0x85] = (int)(_DAT_00423860 / (float)piVar6[2]);
  param_1[0x86] = (int)(_DAT_00423860 / (float)piVar6[3]);
  FUN_00408440(param_1 + 0x87,piVar6 + 4);
  FUN_00408440(param_1 + 0x8a,piVar6 + 7);
  FUN_00408440(param_1 + 0x8d,piVar6 + 10);
  param_1[0x90] = piVar6[0xd];
  param_1[0x91] = piVar6[0xe];
  param_1[0x92] = piVar6[0xf];
  piVar6 = FUN_004de998((int *)0x0,0x14,2,0x211,FUN_00423d88);
  param_1[0xbd] = extraout_EAX;
  piVar6[1] = piVar6[1] + -1;
  if ((*(byte *)((int)param_1 + 0x29) & 0x40) == 0) {
    iVar4 = FUN_00407064(iVar5,param_1[0x6f],9);
    iVar5 = *(int *)(iVar4 + 4);
    *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 1;
    if (iVar5 == 0) {
      FUN_00406cd0(iVar4);
    }
    iVar5 = *(int *)(iVar4 + 0x3c);
    param_1[0xb9] = *(uint *)(iVar4 + 0x40) / 0x3c;
    for (local_54 = 0; local_54 < param_1[0xb9]; local_54 = local_54 + 1) {
      iVar3 = FUN_0040eed8(iVar5,param_1,param_1[0xbb]);
      param_1[0xbb] = iVar3;
      iVar3 = FUN_0040eed8(iVar5,param_1,param_1[0xba]);
      param_1[0xba] = iVar3;
      iVar5 = iVar5 + 0x3c;
    }
    *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + -1;
    (**(code **)(*param_1 + 0x34))(param_1);
  }
  return param_1;
}



/* @00423864 file=? name=FUN_00423864 */

undefined4 __cdecl FUN_00423864(undefined4 *param_1)

{
  int iVar1;
  
  iVar1 = FUN_00420234(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  *param_1 = 0x7c;
  param_1[7] = 0x1b;
  FUN_0040a7f4(param_1 + 0x13,(undefined4 *)&DAT_004e0fd4);
  FUN_0040a7f4(param_1 + 0x19,(undefined4 *)&DAT_004e0fd4);
  return 1;
}



/* @004238bc file=? name=FUN_004238bc */

undefined4 __cdecl
FUN_004238bc(int param_1,char *param_2,int param_3,undefined4 param_4,float *param_5)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 local_18;
  float *local_14;
  float *local_10;
  float *local_c;
  float *local_8;
  
  pfVar1 = param_5;
  if ((param_5 == (float *)0x0) && (pfVar1 = (float *)FUN_00402298(0x40), pfVar1 != (float *)0x0)) {
    local_8 = pfVar1 + 1;
    local_c = pfVar1 + 4;
    local_10 = pfVar1 + 7;
    local_14 = pfVar1 + 10;
  }
  iVar2 = FUN_00404118(param_3,s_gamedata_004e472f,s_MoverMass_004e4738,pfVar1);
  if (iVar2 == 0) {
    FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_missing_MoverMass__004e4742,(char *)0x0);
  }
  else {
    iVar2 = FUN_00404088(param_3,s_gamedata_004e4757,s_MomentOfInertia_004e4760,&local_18);
    if (iVar2 == 0) {
      FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
      FUN_004dbb24((int *)&DAT_00524e68,s_missing_MomentOfInertia__004e4770,(char *)0x0);
    }
    else {
      FUN_004d7f84(local_18,(byte *)s__f__f__f_004e478b);
      iVar2 = FUN_00404088(param_3,s_gamedata_004e4794,s_PositiveLinearDragCoefficients_004e479d,
                           &local_18);
      if (iVar2 == 0) {
        FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
        FUN_004dbb24((int *)&DAT_00524e68,s_missing_PositiveLinearDragCoeffi_004e47bc,(char *)0x0);
      }
      else {
        FUN_004d7f84(local_18,(byte *)s__f__f__f_004e47e6);
        iVar2 = FUN_00404088(param_3,s_gamedata_004e47ef,s_NegativeLinearDragCoefficients_004e47f8,
                             &local_18);
        if (iVar2 == 0) {
          FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
          FUN_004dbb24((int *)&DAT_00524e68,s_missing_NegativeLinearDragCoeffi_004e4817,(char *)0x0)
          ;
        }
        else {
          FUN_004d7f84(local_18,(byte *)s__f__f__f_004e4841);
          iVar2 = FUN_00404088(param_3,s_gamedata_004e484a,s_AngularDragCoefficients_004e4853,
                               &local_18);
          if (iVar2 == 0) {
            FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
            FUN_004dbb24((int *)&DAT_00524e68,s_missing_AngularDragCoefficients__004e486b,
                         (char *)0x0);
          }
          else {
            FUN_004d7f84(local_18,(byte *)s__f__f__f_004e488e);
            iVar2 = FUN_00404118(param_3,s_gamedata_004e4897,s_FrictionCoefficient_004e48a0,
                                 pfVar1 + 0xd);
            if (iVar2 == 0) {
              FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
              FUN_004dbb24((int *)&DAT_00524e68,s_missing_FrictionCoefficient__004e48b4,(char *)0x0)
              ;
            }
            else {
              iVar2 = FUN_00404118(param_3,s_gamedata_004e48d3,s_ElasticityCoefficient_004e48dc,
                                   pfVar1 + 0xe);
              if (iVar2 == 0) {
                FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
                FUN_004dbb24((int *)&DAT_00524e68,s_missing_ElasticityCoefficient__004e48f2,
                             (char *)0x0);
              }
              else {
                iVar2 = FUN_00404118(param_3,s_gamedata_004e4913,s_MinimumBounceSpeed_004e491c,
                                     pfVar1 + 0xf);
                if (iVar2 != 0) {
                  if (param_5 == (float *)0x0) {
                    puVar3 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,pfVar1,0x40,-1);
                    FUN_004022d0((int *)pfVar1);
                    return *puVar3;
                  }
                  return 0;
                }
                FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
                FUN_004dbb24((int *)&DAT_00524e68,s_missing_MinimumBounceSpeed__004e492f,(char *)0x0
                            );
              }
            }
          }
        }
      }
    }
  }
  if (param_5 == (float *)0x0) {
    FUN_004022d0((int *)pfVar1);
  }
  return 0xffffffff;
}



/* @00423be8 file=? name=FUN_00423be8 */

int * __cdecl FUN_00423be8(int param_1)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_00402298(0x300);
  if (piVar1 == (int *)0x0) {
    piVar1 = (int *)0x0;
  }
  else {
    piVar1 = FUN_004234f0(piVar1,param_1,&DAT_004e4548);
  }
  return piVar1;
}



/* @00423c18 file=? name=FUN_00423c18 */

void __cdecl FUN_00423c18(int *param_1,byte param_2)

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4950;
    FUN_004de8d4((int *)param_1[0xbd],0x14,0,0x19,FUN_00423daf);
    if ((*(byte *)((int)param_1 + 0x29) & 0x40) == 0) {
      iVar1 = param_1[0xbb];
      while (iVar3 = iVar1, iVar3 != 0) {
        iVar1 = *(int *)(iVar3 + 0x28);
        if (iVar3 != 0) {
          (*(code *)**(undefined4 **)(iVar3 + 0x18))(iVar3,3);
        }
      }
      iVar1 = param_1[0xba];
      while (iVar3 = iVar1, iVar3 != 0) {
        iVar1 = *(int *)(iVar3 + 0x28);
        if (iVar3 != 0) {
          (*(code *)**(undefined4 **)(iVar3 + 0x18))(iVar3,3);
        }
      }
    }
    puVar2 = (undefined4 *)param_1[0xbf];
    if ((puVar2 != (undefined4 *)0x0) && (puVar2 != (undefined4 *)0x0)) {
      (**(code **)*puVar2)(puVar2,3);
    }
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00423cc8 file=? name=FUN_00423cc8 */

void __cdecl FUN_00423cc8(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e4518);
  return;
}



/* @00423d88 file=? name=FUN_00423d88 */

undefined4 * __cdecl FUN_00423d88(undefined4 *param_1)

{
  FUN_0040de40(param_1,10);
  param_1[4] = 0;
  param_1[1] = *param_1;
  param_1[3] = param_1[2];
  return param_1;
}



/* @00423daf file=? name=FUN_00423daf */

void __cdecl FUN_00423daf(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    FUN_004022e8((int *)*param_1);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00423dd3 file=? name=FUN_00423dd3 */

void __cdecl FUN_00423dd3(undefined4 *param_1,int param_2)

{
  *param_1 = *(undefined4 *)(param_2 + 500);
  param_1[1] = *(undefined4 *)(param_2 + 0x1f8);
  param_1[2] = *(undefined4 *)(param_2 + 0x1fc);
  return;
}



/* @00423df4 file=? name=FUN_00423df4 */

void __cdecl FUN_00423df4(undefined4 *param_1,int param_2)

{
  *param_1 = *(undefined4 *)(param_2 + 0x200);
  param_1[1] = *(undefined4 *)(param_2 + 0x204);
  param_1[2] = *(undefined4 *)(param_2 + 0x208);
  return;
}



/* @00423e18 file=? name=FUN_00423e18 */

int __cdecl FUN_00423e18(int param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(*(int *)(param_1 + 0xc) + 0xc))(param_1 + 0xc,&stack0x00000008);
  if (iVar1 != 0) {
    return iVar1 + 0xc;
  }
  return 0;
}



/* @00423e3c file=? name=FUN_00423e3c */

undefined4 * __cdecl FUN_00423e3c(undefined4 *param_1)

{
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e4aec;
  FUN_00424527(param_1 + 3,0,0);
  return param_1;
}



/* @00423e6c file=? name=FUN_00423e6c */

void __cdecl FUN_00423e6c(int *param_1,byte param_2)

{
  void *this;
  int local_18 [5];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4aec;
    FUN_00424944(local_18,(int)(param_1 + 3));
    FUN_00417858(this,local_18,1);
    FUN_00424982(local_18,2);
    FUN_0042454a(param_1 + 3,2);
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00423ed8 file=? name=FUN_00423ed8 */

void __cdecl FUN_00423ed8(int param_1,int *param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041547b(puVar1,param_2);
  }
  (**(code **)(*(int *)(param_1 + 0xc) + 8))(param_1 + 0xc,puVar1,&stack0x0000000c);
  return;
}



/* @00423f18 file=? name=FUN_00423f18 */

undefined4 * __cdecl
FUN_00423f18(undefined4 *param_1,int *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)

{
  int *piVar1;
  undefined4 *puVar2;
  int iVar3;
  undefined4 *puVar4;
  int *local_8;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e4ae8;
  FUN_0040aadc(param_1 + 5);
  FUN_0040aadc(param_1 + 0x11);
  puVar2 = &DAT_004e107c;
  puVar4 = param_1 + 0x1d;
  for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
    *puVar4 = *puVar2;
    puVar2 = puVar2 + 1;
    puVar4 = puVar4 + 1;
  }
  FUN_0042487b(param_1 + 0x29,0,1);
  FUN_00424767(param_1 + 0x34,0,1);
  FUN_00424767(param_1 + 0x3a,0,1);
  FUN_0042466c(param_1 + 0x41,0,1);
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    iVar3 = 0;
  }
  else {
    iVar3 = FUN_004023f4(puVar2);
  }
  param_1[0x47] = iVar3;
  piVar1 = (int *)(param_1[0x47] + 0xc);
  *piVar1 = *piVar1 + 1;
  param_1[3] = 1;
  param_1[0x33] = param_3;
  param_1[0x32] = param_4;
  param_1[0x30] = param_5;
  param_1[0x2f] = param_6;
  puVar2 = param_1 + 0x1d;
  FUN_0040ab28(puVar2,param_7);
  param_1[0x31] = param_8;
  FUN_00402a4c((int *)&local_8,param_1 + 0x47,(int *)&param_2);
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  param_1[4] = param_9;
  param_1[0x40] = param_10;
  FUN_0040ab28(param_1 + 5,puVar2);
  FUN_0040ab28(param_1 + 0x11,puVar2);
  piVar1 = param_2 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(param_2,3);
  }
  return param_1;
}



/* @00424084 file=? name=FUN_00424084 */

int __cdecl FUN_00424084(int param_1,undefined4 param_2)

{
  int iVar1;
  undefined4 local_8;
  
  local_8 = param_2;
  iVar1 = (**(code **)(*(int *)(param_1 + 0xa4) + 0xc))(param_1 + 0xa4,&local_8);
  if (iVar1 == 0) {
    iVar1 = 0;
  }
  else {
    iVar1 = FUN_00423e18(iVar1);
  }
  return iVar1;
}



/* @004240c4 file=? name=FUN_004240c4 */

void __cdecl FUN_004240c4(int *param_1,byte param_2)

{
  int *piVar1;
  int *piVar2;
  void *this;
  void *this_00;
  void *this_01;
  int local_58 [7];
  int local_3c [7];
  int local_20 [7];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4ae8;
    FUN_00424830(local_20,(int)(param_1 + 0x3a));
    FUN_00417858(this,local_20,1);
    FUN_00424830(local_3c,(int)(param_1 + 0x34));
    FUN_00417858(this_00,local_3c,1);
    FUN_00401331(local_58,(int)(param_1 + 0x29));
    FUN_00417858(this_01,local_58,1);
    FUN_00401350(local_58,2);
    FUN_0042484f(local_3c,2);
    FUN_0042484f(local_20,2);
    piVar2 = (int *)param_1[0x47];
    piVar1 = piVar2 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(piVar2,3);
    }
    FUN_0042468f(param_1 + 0x41,2);
    FUN_0042478a(param_1 + 0x3a,2);
    FUN_0042478a(param_1 + 0x34,2);
    FUN_0042489e(param_1 + 0x29,2);
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004241dc file=? name=FUN_004241dc */

void __cdecl FUN_004241dc(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00424716(puVar1,(undefined4 *)&stack0x00000008);
  }
  (**(code **)(*(int *)(param_1 + 0xe8) + 8))(param_1 + 0xe8,puVar1,&stack0x0000000c);
  return;
}



/* @00424220 file=? name=FUN_00424220 */

void __cdecl FUN_00424220(int param_1,undefined4 param_2)

{
  (**(code **)(*(int *)(param_1 + 0x104) + 8))(param_1 + 0x104,param_2,&stack0x0000000c);
  return;
}



/* @00424244 file=? name=FUN_00424244 */

void __cdecl FUN_00424244(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00424716(puVar1,(undefined4 *)&stack0x00000008);
  }
  (**(code **)(*(int *)(param_1 + 0xd0) + 8))(param_1 + 0xd0,puVar1,&stack0x0000000c);
  return;
}



/* @00424288 file=? name=FUN_00424288 */

void __cdecl FUN_00424288(int param_1,int *param_2,undefined4 param_3,undefined4 param_4)

{
  int *piVar1;
  undefined4 *puVar2;
  int local_20 [7];
  
  FUN_00401331(local_20,param_1 + 0xa4);
  puVar2 = (undefined4 *)(**(code **)(local_20[0] + 0x54))(local_20,&param_3);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)FUN_00402298(0x24);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar2 = FUN_00423e3c(puVar2);
    }
    (**(code **)(*(int *)(param_1 + 0xa4) + 8))(param_1 + 0xa4,puVar2,&param_3);
  }
  FUN_00423ed8((int)puVar2,(int *)&param_2);
  FUN_00401350(local_20,2);
  piVar1 = param_2 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(param_2,3);
  }
  return;
}



/* @0042432c file=? name=FUN_0042432c */

int __cdecl FUN_0042432c(int param_1)

{
  uint uVar1;
  float *pfVar2;
  int iVar3;
  float *pfVar4;
  float local_f4 [12];
  float local_c4 [12];
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  iVar3 = *(int *)(param_1 + 0xbc);
  if ((iVar3 != 0) && (*(int *)(iVar3 + 0x14) != 0)) {
    *(undefined4 *)(iVar3 + 0x14) = 0;
    pfVar2 = (float *)(param_1 + 0x74);
    pfVar4 = local_34;
    for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
      *pfVar4 = *pfVar2;
      pfVar2 = pfVar2 + 1;
      pfVar4 = pfVar4 + 1;
    }
    FUN_0040aadc(local_64);
    uVar1 = *(uint *)(*(int *)(param_1 + 0xbc) + 0x10);
    if (uVar1 < 3) {
      pfVar2 = (float *)&DAT_004e107c;
      pfVar4 = local_c4;
      for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
        *pfVar4 = *pfVar2;
        pfVar2 = pfVar2 + 1;
        pfVar4 = pfVar4 + 1;
      }
      FUN_0040ab70(local_c4,*(int **)(*(int *)(param_1 + 0xbc) + 0xc));
      FUN_0040bc54(local_64,local_c4);
      FUN_0040b104((float *)(param_1 + 0x14),local_34,local_64);
    }
    else if (uVar1 == 4) {
      pfVar2 = (float *)&DAT_004e107c;
      pfVar4 = local_94;
      for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
        *pfVar4 = *pfVar2;
        pfVar2 = pfVar2 + 1;
        pfVar4 = pfVar4 + 1;
      }
      pfVar2 = (float *)FUN_0041cfa0(*(int *)(param_1 + 0xbc));
      FUN_0040ac6c(local_94,pfVar2);
      FUN_0040bc54(local_64,local_94);
      FUN_0040b104((float *)(param_1 + 0x14),local_34,local_64);
    }
    else if (uVar1 == 5) {
      pfVar2 = (float *)&DAT_004e107c;
      pfVar4 = local_f4;
      for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
        *pfVar4 = *pfVar2;
        pfVar2 = pfVar2 + 1;
        pfVar4 = pfVar4 + 1;
      }
      pfVar2 = (float *)FUN_0041cfa0(*(int *)(param_1 + 0xbc));
      FUN_0040ac6c(local_f4,pfVar2);
      pfVar2 = (float *)(param_1 + 0x14);
      FUN_0040bc54(pfVar2,local_f4);
      FUN_0040b104(local_64,local_34,pfVar2);
      FUN_0040ab28(local_34,&DAT_004e107c);
      FUN_0040b0ac((int)local_34,3,*(undefined4 **)(*(int *)(param_1 + 0xbc) + 0xc));
      FUN_0040b104(pfVar2,local_64,local_34);
    }
  }
  return param_1 + 0x14;
}



/* @004244dc file=? name=FUN_004244dc */

int __cdecl FUN_004244dc(int param_1)

{
  float *pfVar1;
  float *pfVar2;
  
  if ((*(int *)(param_1 + 0xc) != 0) && (*(int *)(param_1 + 0xc4) != 0)) {
    pfVar1 = (float *)FUN_004244dc(*(int *)(param_1 + 0xc4));
    pfVar2 = (float *)FUN_0042432c(param_1);
    FUN_0040b104((float *)(param_1 + 0x44),pfVar2,pfVar1);
    *(undefined4 *)(param_1 + 0xc) = 0;
  }
  return param_1 + 0x44;
}



/* @00424527 file=? name=FUN_00424527 */

undefined4 * __cdecl FUN_00424527(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_004186ac(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e4acc;
  return param_1;
}



/* @0042454a file=? name=FUN_0042454a */

void __cdecl FUN_0042454a(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4acc;
    FUN_004186dc(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_00424621(param_1);
    }
  }
  return;
}



/* @00424576 file=? name=FUN_00424576 */

undefined4 __cdecl FUN_00424576(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x1c) == *(int *)(param_2 + 0x1c)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*(int *)(param_2 + 0x1c) <= *(int *)(param_3 + 0x1c)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @004245a5 file=? name=FUN_004245a5 */

undefined4 __cdecl FUN_004245a5(undefined4 param_1,int *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x1c) == *param_2) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*param_2 <= *(int *)(param_3 + 0x1c)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @004245d1 file=? name=FUN_004245d1 */

void FUN_004245d1(void)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004e49b8;
  DAT_004e49b8 = DAT_004e49b8 + 1;
  puVar2 = DAT_004e49b4;
  if ((iVar1 == 0) && (puVar2 = (undefined4 *)FUN_00402298(0x28), puVar2 != (undefined4 *)0x0)) {
    FUN_00402b98(puVar2,0x18,100,100,s_VChainOf_004e4990);
  }
  DAT_004e49b4 = puVar2;
  FUN_00402f74((int)DAT_004e49b4);
  return;
}



/* @00424621 file=? name=FUN_00424621 */

void __cdecl FUN_00424621(undefined4 *param_1)

{
  FUN_00402f98((int)DAT_004e49b4,param_1);
  DAT_004e49b8 = DAT_004e49b8 + -1;
  if (DAT_004e49b8 == 0) {
    if (DAT_004e49b4 != (int *)0x0) {
      FUN_00402c28(DAT_004e49b4,0);
      FUN_004022d0(DAT_004e49b4);
    }
    DAT_004e49b4 = (int *)0x0;
  }
  return;
}



/* @0042466c file=? name=FUN_0042466c */

undefined4 * __cdecl FUN_0042466c(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_00419184(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e4ab0;
  return param_1;
}



/* @0042468f file=? name=FUN_0042468f */

void __cdecl FUN_0042468f(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4ab0;
    FUN_004191b4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004246bb file=? name=FUN_004246bb */

undefined4 __cdecl FUN_004246bb(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *(int *)(param_2 + 0x14)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*(int *)(param_2 + 0x14) <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @004246ea file=? name=FUN_004246ea */

undefined4 __cdecl FUN_004246ea(undefined4 param_1,int *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *param_2) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*param_2 <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @00424716 file=? name=FUN_00424716 */

undefined4 * __cdecl FUN_00424716(undefined4 *param_1,undefined4 *param_2)

{
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e4aac;
  param_1[3] = *param_2;
  return param_1;
}



/* @0042473b file=? name=FUN_0042473b */

void __cdecl FUN_0042473b(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4aac;
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00424767 file=? name=FUN_00424767 */

undefined4 * __cdecl FUN_00424767(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_00419184(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e4a90;
  return param_1;
}



/* @0042478a file=? name=FUN_0042478a */

void __cdecl FUN_0042478a(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4a90;
    FUN_004191b4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004247b6 file=? name=FUN_004247b6 */

undefined4 __cdecl FUN_004247b6(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *(int *)(param_2 + 0x14)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*(int *)(param_2 + 0x14) <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @004247e5 file=? name=FUN_004247e5 */

undefined4 __cdecl FUN_004247e5(undefined4 param_1,int *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *param_2) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*param_2 <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @00424811 file=? name=FUN_00424811 */

undefined4 * __cdecl FUN_00424811(undefined4 *param_1,int param_2)

{
  FUN_004194d8(param_1,param_2);
  *param_1 = &PTR_FUN_004e4a34;
  return param_1;
}



/* @00424830 file=? name=FUN_00424830 */

undefined4 * __cdecl FUN_00424830(undefined4 *param_1,int param_2)

{
  FUN_004194d8(param_1,param_2);
  *param_1 = &PTR_FUN_004e4a34;
  return param_1;
}



/* @0042484f file=? name=FUN_0042484f */

void __cdecl FUN_0042484f(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4a34;
    FUN_0041951c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042487b file=? name=FUN_0042487b */

undefined4 * __cdecl FUN_0042487b(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_00419184(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e4a18;
  return param_1;
}



/* @0042489e file=? name=FUN_0042489e */

void __cdecl FUN_0042489e(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4a18;
    FUN_004191b4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004248ca file=? name=FUN_004248ca */

undefined4 __cdecl FUN_004248ca(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *(int *)(param_2 + 0x14)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*(int *)(param_2 + 0x14) <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @004248f9 file=? name=FUN_004248f9 */

undefined4 __cdecl FUN_004248f9(undefined4 param_1,int *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *param_2) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*param_2 <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @00424925 file=? name=FUN_00424925 */

undefined4 * __cdecl FUN_00424925(undefined4 *param_1,int param_2)

{
  FUN_004188dc(param_1,param_2);
  *param_1 = &PTR_FUN_004e49bc;
  return param_1;
}



/* @00424944 file=? name=FUN_00424944 */

undefined4 * __cdecl FUN_00424944(undefined4 *param_1,int param_2)

{
  FUN_004188dc(param_1,param_2);
  *param_1 = &PTR_FUN_004e49bc;
  return param_1;
}



/* @00424963 file=? name=FUN_00424963 */

undefined4 * __cdecl FUN_00424963(undefined4 *param_1,int param_2)

{
  FUN_00418904(param_1,param_2);
  *param_1 = &PTR_FUN_004e49bc;
  return param_1;
}



/* @00424982 file=? name=FUN_00424982 */

void __cdecl FUN_00424982(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e49bc;
    FUN_00418930(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004249ae file=? name=FUN_004249ae */

undefined4 * __cdecl FUN_004249ae(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0041d485();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041d42e(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @004249de file=? name=FUN_004249de */

undefined4 * __cdecl FUN_004249de(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0041d485();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041d42e(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @00424a0e file=? name=FUN_00424a0e */

undefined4 * __cdecl FUN_00424a0e(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0041d485();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041d42e(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @00424a3e file=? name=FUN_00424a3e */

undefined4 * __cdecl FUN_00424a3e(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00424ac5();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00424a6e(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @00424a6e file=? name=FUN_00424a6e */

undefined4 * __cdecl
FUN_00424a6e(undefined4 *param_1,undefined4 param_2,int param_3,undefined4 *param_4)

{
  FUN_004185bc(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e4af8;
  param_1[7] = *param_4;
  return param_1;
}



/* @00424a99 file=? name=FUN_00424a99 */

void __cdecl FUN_00424a99(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4af8;
    FUN_004185ec(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_00424b15(param_1);
    }
  }
  return;
}



/* @00424ac5 file=? name=FUN_00424ac5 */

void FUN_00424ac5(void)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004e4af4;
  DAT_004e4af4 = DAT_004e4af4 + 1;
  puVar2 = DAT_004e4af0;
  if ((iVar1 == 0) && (puVar2 = (undefined4 *)FUN_00402298(0x28), puVar2 != (undefined4 *)0x0)) {
    FUN_00402b98(puVar2,0x20,100,100,s_VChainLinkOf_004e4999);
  }
  DAT_004e4af0 = puVar2;
  FUN_00402f74((int)DAT_004e4af0);
  return;
}



/* @00424b15 file=? name=FUN_00424b15 */

void __cdecl FUN_00424b15(undefined4 *param_1)

{
  FUN_00402f98((int)DAT_004e4af0,param_1);
  DAT_004e4af4 = DAT_004e4af4 + -1;
  if (DAT_004e4af4 == 0) {
    if (DAT_004e4af0 != (int *)0x0) {
      FUN_00402c28(DAT_004e4af0,0);
      FUN_004022d0(DAT_004e4af0);
    }
    DAT_004e4af0 = (int *)0x0;
  }
  return;
}



/* @00424b60 file=? name=FUN_00424b60 */

int __cdecl FUN_00424b60(int param_1,int *param_2)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  char cVar4;
  int local_24 [7];
  int *local_8;
  
  FUN_0041f216(local_24,param_1 + 0x300);
  do {
    iVar3 = (**(code **)(local_24[0] + 0x28))(local_24);
    if (iVar3 == 0) {
      iVar3 = 0;
      FUN_0041f235(local_24,2);
      piVar1 = param_2 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 != 0) {
        return iVar3;
      }
      FUN_004024d8(param_2,3);
      return iVar3;
    }
    local_8 = *(int **)(iVar3 + 0x11c);
    local_8[3] = local_8[3] + 1;
    iVar2 = FUN_004027d8((int)param_2,(int)local_8);
    cVar4 = iVar2 == 0;
    piVar1 = local_8 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(local_8,3);
    }
  } while (cVar4 == '\0');
  FUN_0041f235(local_24,2);
  piVar1 = param_2 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(param_2,3);
  }
  return iVar3;
}



/* @00424c28 file=? name=FUN_00424c28 */

int __cdecl FUN_00424c28(int param_1,int *param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  int *piVar3;
  int iVar4;
  int local_2c [7];
  int *local_10;
  int *local_c;
  int local_8;
  
  FUN_0041f216(local_2c,param_1 + 0x300);
  do {
    local_8 = (**(code **)(local_2c[0] + 0x28))(local_2c);
    if (local_8 == 0) {
      iVar4 = 0;
      FUN_0041f235(local_2c,2);
      piVar3 = param_2 + 3;
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_004024d8(param_2,3);
      }
      return iVar4;
    }
    puVar2 = (undefined4 *)FUN_00402298(0x1c);
    if (puVar2 == (undefined4 *)0x0) {
      piVar3 = (int *)0x0;
    }
    else {
      piVar3 = FUN_00424811(puVar2,local_8 + 0xd0);
    }
    while (iVar4 = (**(code **)(*piVar3 + 0x28))(piVar3), iVar4 != 0) {
      puVar2 = (undefined4 *)FUN_00402298(0x10);
      if (puVar2 == (undefined4 *)0x0) {
        local_c = (int *)0x0;
      }
      else {
        local_c = (int *)FUN_004023f4(puVar2);
      }
      local_c[3] = local_c[3] + 1;
      FUN_00402a4c((int *)&local_10,(int *)&local_c,
                   (int *)(*(int *)(*(int *)(param_1 + 0x120) + *(int *)(iVar4 + 0xc) * 4) + 0x15c))
      ;
      piVar1 = local_10 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_10,3);
      }
      iVar4 = FUN_004027d8((int)local_c,(int)param_2);
      if (iVar4 == 0) {
        if (piVar3 != (int *)0x0) {
          (**(code **)*piVar3)(piVar3,3);
        }
        piVar3 = local_c + 3;
        *piVar3 = *piVar3 + -1;
        iVar4 = local_8;
        if (*piVar3 == 0) {
          FUN_004024d8(local_c,3);
        }
        FUN_0041f235(local_2c,2);
        piVar3 = param_2 + 3;
        *piVar3 = *piVar3 + -1;
        if (*piVar3 != 0) {
          return iVar4;
        }
        FUN_004024d8(param_2,3);
        return iVar4;
      }
      piVar1 = local_c + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_c,3);
      }
    }
    if (piVar3 != (int *)0x0) {
      (**(code **)*piVar3)(piVar3,3);
    }
  } while( true );
}



/* @00424da8 file=? name=FUN_00424da8 */

void __cdecl FUN_00424da8(int param_1,int param_2,float *param_3)

{
  int iVar1;
  int iVar2;
  float *pfVar3;
  int local_20 [7];
  
  iVar1 = FUN_00417ab4(param_1 + 0x31c);
  if (*(int *)(iVar1 + 0xfc) != 0) {
    FUN_0041f216(local_20,param_1 + 0x300);
    while( true ) {
      iVar2 = (**(code **)(local_20[0] + 0x28))(local_20);
      if (iVar2 == 0) break;
      *(undefined4 *)(iVar2 + 0xc) = 1;
    }
    *(undefined4 *)(iVar1 + 0xfc) = 0;
    FUN_0041f235(local_20,2);
  }
  pfVar3 = (float *)FUN_004244dc(param_2);
  FUN_0040b104(param_3,pfVar3,(float *)(param_1 + 0xd0));
  return;
}



/* @00424e38 file=? name=FUN_00424e38 */

int * __cdecl FUN_00424e38(int *param_1,int param_2,undefined4 param_3)

{
  int *piVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  uint *puVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  int local_108 [7];
  int local_ec [7];
  undefined4 local_d0 [12];
  int local_a0 [6];
  int *local_88;
  int *local_84;
  undefined1 local_80 [4];
  int local_7c;
  undefined1 local_78 [4];
  int local_74;
  uint *local_70;
  int local_6c;
  uint *local_68;
  undefined4 local_64;
  int local_60;
  undefined4 local_5c;
  int local_58;
  undefined4 *local_54;
  undefined4 *local_50;
  int local_4c;
  undefined4 local_48;
  undefined4 *local_44;
  int *local_40;
  int local_3c;
  int local_38;
  undefined4 *local_34;
  undefined4 *local_30;
  int *local_2c;
  int local_28;
  int local_24;
  int *local_20;
  int *local_1c;
  undefined1 local_18 [4];
  int local_14;
  undefined4 *local_10;
  undefined4 *local_c;
  undefined4 *local_8;
  
  FUN_004234f0(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004e4fbc;
  FUN_0042466c(param_1 + 0xc0,param_1,1);
  FUN_00428601(param_1 + 199,0);
  local_c = (undefined4 *)FUN_00402298(0x100);
  if (local_c == (undefined4 *)0x0) {
    local_10 = (undefined4 *)0x0;
  }
  else {
    local_10 = FUN_0041d170(local_c,param_1,0xffffffff,&DAT_004e35c8);
  }
  local_8 = local_10;
  (**(code **)(param_1[199] + 4))(param_1 + 199,local_10);
  local_14 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),*(int *)(param_2 + 0x28),0x15);
  iVar6 = *(int *)(local_14 + 4);
  *(int *)(local_14 + 4) = *(int *)(local_14 + 4) + 1;
  if (iVar6 == 0) {
    FUN_00406cd0(local_14);
  }
  FUN_004032dc(local_a0,*(undefined4 *)(local_14 + 0x3c),*(undefined4 *)(local_14 + 0x40),0);
  local_1c = param_1 + 0xc6;
  local_20 = (int *)(**(code **)(local_a0[0] + 0x1c))(local_a0,local_1c,4);
  (**(code **)(*local_20 + 0x1c))(local_20,local_18,4);
  local_28 = 0;
  local_30 = (undefined4 *)FUN_00402298(0x10);
  if (local_30 == (undefined4 *)0x0) {
    local_2c = (int *)0x0;
  }
  else {
    local_2c = (int *)FUN_004023f4(local_30);
  }
  local_2c[3] = local_2c[3] + 1;
  local_44 = (undefined4 *)FUN_00402298(0x10);
  if (local_44 == (undefined4 *)0x0) {
    local_40 = (int *)0x0;
  }
  else {
    local_40 = (int *)FUN_004023f4(local_44);
  }
  local_40[3] = local_40[3] + 1;
  puVar2 = &DAT_004e107c;
  puVar3 = local_d0;
  for (iVar6 = 0xc; iVar6 != 0; iVar6 = iVar6 + -1) {
    *puVar3 = *puVar2;
    puVar2 = puVar2 + 1;
    puVar3 = puVar3 + 1;
  }
  for (local_4c = 0; local_4c < param_1[0xc6]; local_4c = local_4c + 1) {
    piVar1 = (int *)FUN_00402aec(local_a0,(int *)&local_2c);
    (**(code **)(*piVar1 + 0x1c))(piVar1,&local_3c,4);
    if (local_3c == -1) {
      uVar7 = 0;
    }
    else {
      FUN_0041f216(local_ec,(int)(param_1 + 0xc0));
      uVar7 = (**(code **)(local_ec[0] + 0x34))(local_ec,local_3c);
      FUN_0041f235(local_ec,2);
    }
    piVar1 = (int *)(**(code **)(local_a0[0] + 0x1c))(local_a0,&local_48,4);
    (**(code **)(*piVar1 + 0x1c))(piVar1,&local_24,4);
    if (local_24 == -1) {
      local_38 = -1;
      puVar2 = (undefined4 *)0x0;
    }
    else {
      local_38 = local_28;
      local_50 = (undefined4 *)FUN_00402298(0x1c);
      if (local_50 == (undefined4 *)0x0) {
        puVar2 = (undefined4 *)0x0;
      }
      else {
        puVar2 = FUN_0041cb78(local_50,local_8,local_24);
      }
      local_58 = local_28;
      local_54 = puVar2;
      (**(code **)(local_8[0x39] + 8))(local_8 + 0x39,puVar2,&local_58);
      local_28 = local_28 + 1;
    }
    (**(code **)(local_a0[0] + 0x1c))(local_a0,local_d0,0x30);
    (**(code **)(local_a0[0] + 0x1c))(local_a0,&local_5c,4);
    puVar3 = (undefined4 *)FUN_00402298(0x120);
    if (puVar3 == (undefined4 *)0x0) {
      local_34 = (undefined4 *)0x0;
    }
    else {
      local_2c[3] = local_2c[3] + 1;
      local_34 = FUN_00423f18(puVar3,local_2c,local_4c,local_3c,local_38,puVar2,local_d0,uVar7,
                              local_48,local_5c);
    }
    (**(code **)(param_1[0xc0] + 8))(param_1 + 0xc0,local_34,&local_4c);
    (**(code **)(local_a0[0] + 0x1c))(local_a0,&local_60,4);
    iVar6 = 0;
    if (0 < local_60) {
      do {
        piVar1 = (int *)(**(code **)(local_a0[0] + 0x1c))(local_a0,&local_64,4);
        FUN_00402aec(piVar1,(int *)&local_40);
        puVar4 = (uint *)FUN_00402298(0x10);
        if (puVar4 == (uint *)0x0) {
          local_68 = (uint *)0x0;
        }
        else {
          local_68 = FUN_00402460(puVar4,&DAT_004e4bae);
        }
        local_68[3] = local_68[3] + 1;
        iVar5 = FUN_004027d8((int)local_40,(int)local_68);
        puVar4 = local_68 + 3;
        *puVar4 = *puVar4 - 1;
        if (*puVar4 == 0) {
          FUN_004024d8((int *)local_68,3);
        }
        if (iVar5 != 0) {
          local_40[3] = local_40[3] + 1;
          FUN_00424288((int)local_34,local_40,local_64,0);
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < local_60);
    }
    (**(code **)(local_a0[0] + 0x1c))(local_a0,&local_6c,4);
    iVar6 = 0;
    if (0 < local_6c) {
      do {
        piVar1 = (int *)(**(code **)(local_a0[0] + 0x1c))(local_a0,&local_64,4);
        FUN_00402aec(piVar1,(int *)&local_40);
        puVar4 = (uint *)FUN_00402298(0x10);
        if (puVar4 == (uint *)0x0) {
          local_70 = (uint *)0x0;
        }
        else {
          local_70 = FUN_00402460(puVar4,&DAT_004e4bb3);
        }
        local_70[3] = local_70[3] + 1;
        iVar5 = FUN_004027d8((int)local_40,(int)local_70);
        puVar4 = local_70 + 3;
        *puVar4 = *puVar4 - 1;
        if (*puVar4 == 0) {
          FUN_004024d8((int *)local_70,3);
        }
        if (iVar5 != 0) {
          local_40[3] = local_40[3] + 1;
          FUN_00424288((int)local_34,local_40,local_64,1);
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 < local_6c);
    }
    (**(code **)(local_a0[0] + 0x1c))(local_a0,&local_74,4);
    if ((local_74 != 0) && (iVar6 = 0, 0 < local_74)) {
      do {
        (**(code **)(local_a0[0] + 0x1c))(local_a0,local_78,4);
        FUN_00424244((int)local_34);
        iVar6 = iVar6 + 1;
      } while (iVar6 < local_74);
    }
    (**(code **)(local_a0[0] + 0x1c))(local_a0,&local_7c,4);
    if ((local_7c != 0) && (iVar6 = 0, 0 < local_7c)) {
      do {
        (**(code **)(local_a0[0] + 0x1c))(local_a0,local_80,4);
        FUN_004241dc((int)local_34);
        iVar6 = iVar6 + 1;
      } while (iVar6 < local_7c);
    }
  }
  *(int *)(local_14 + 4) = *(int *)(local_14 + 4) + -1;
  for (local_4c = 0; local_4c < param_1[0xc6]; local_4c = local_4c + 1) {
    FUN_0041f216(local_108,(int)(param_1 + 0xc0));
    iVar6 = (**(code **)(local_108[0] + 0x34))(local_108,local_4c);
    FUN_004254a8((int)param_1,iVar6);
    FUN_0041f235(local_108,2);
  }
  local_84 = local_40;
  piVar1 = local_40 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_40,3);
  }
  local_88 = local_2c;
  piVar1 = local_2c + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_2c,3);
  }
  FUN_00403310(local_a0,2);
  return param_1;
}



/* @004254a8 file=? name=FUN_004254a8 */

void __cdecl FUN_004254a8(int param_1,int param_2)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  int iVar3;
  int local_24 [7];
  int *local_8;
  
  FUN_0041f216(local_24,param_1 + 0x300);
  puVar1 = (undefined4 *)FUN_00402298(0x1c);
  if (puVar1 == (undefined4 *)0x0) {
    local_8 = (int *)0x0;
  }
  else {
    local_8 = FUN_00424811(puVar1,param_2 + 0xe8);
  }
  while (iVar3 = (**(code **)(*local_8 + 0x28))(local_8), iVar3 != 0) {
    uVar2 = (**(code **)(local_24[0] + 0x34))(local_24,*(undefined4 *)(iVar3 + 0xc));
    FUN_00424220(param_2,uVar2);
  }
  if (local_8 != (int *)0x0) {
    (**(code **)*local_8)(local_8,3);
  }
  FUN_0041f235(local_24,2);
  return;
}



/* @00425550 file=? name=FUN_00425550 */

void __cdecl FUN_00425550(int *param_1,byte param_2)

{
  void *this;
  int local_20 [7];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4fbc;
    FUN_0041f216(local_20,(int)(param_1 + 0xc0));
    FUN_00417858(this,local_20,1);
    FUN_0041f235(local_20,2);
    FUN_00428620(param_1 + 199,2);
    FUN_0042468f(param_1 + 0xc0,2);
    FUN_00423c18(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004255d0 file=? name=FUN_004255d0 */

undefined4 __cdecl FUN_004255d0(int param_1,char *param_2,int param_3,undefined4 *param_4)

{
  char cVar1;
  bool bVar2;
  int iVar3;
  int *piVar4;
  int *piVar5;
  undefined3 extraout_var;
  uint *puVar6;
  undefined4 *puVar7;
  uint uVar8;
  uint uVar9;
  char *pcVar10;
  char *pcVar11;
  int *piVar12;
  undefined4 uVar13;
  undefined4 *puVar14;
  char local_5c [32];
  int local_3c [6];
  int local_24;
  int *local_20;
  int local_1c;
  int *local_18;
  int *local_14;
  char *local_10;
  int *local_c;
  char *local_8;
  
  iVar3 = FUN_00404088(param_3,s_video_004e4bb8,s_skeleton_004e4bbe,&local_8);
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_is_missing__skl_file_specificati_004e4bc7,(char *)0x0);
  }
  else {
    local_c = (int *)FUN_004064fc((char *)param_4[4],local_8);
    piVar4 = (int *)FUN_00402298(0x20);
    if (piVar4 == (int *)0x0) {
      piVar4 = (int *)0x0;
    }
    else {
      piVar4 = FUN_00403e84(piVar4,(char *)local_c,1);
    }
    if ((*(byte *)(piVar4 + 7) & 2) == 0) {
      iVar3 = piVar4[3];
    }
    else {
      iVar3 = piVar4[4];
    }
    if (iVar3 == 0) {
      FUN_004dbb24(&DAT_00524e20,(char *)local_c,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_is_empty_or_missing__004e4bed,(char *)0x0);
    }
    else {
      iVar3 = FUN_00404088(param_3,s_gamedata_004e4c04,s_DamageZones_004e4c0d,&local_10);
      if (iVar3 == 0) {
        FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,s_is_missing__dmg_file_specificati_004e4c19,(char *)0x0);
      }
      else {
        local_14 = (int *)FUN_004064fc((char *)*param_4,local_10);
        piVar5 = (int *)FUN_00402298(0x20);
        if (piVar5 == (int *)0x0) {
          local_18 = (int *)0x0;
        }
        else {
          local_18 = FUN_00403e84(piVar5,(char *)local_14,1);
        }
        if ((*(byte *)(local_18 + 7) & 2) == 0) {
          iVar3 = local_18[3];
        }
        else {
          iVar3 = local_18[4];
        }
        if (iVar3 == 0) {
          FUN_004dbb24(&DAT_00524e20,(char *)local_14,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s_is_empty_or_missing__004e4c3f,(char *)0x0);
        }
        else {
          bVar2 = FUN_004040d8((int)piVar4,&DAT_004e4c56,s_DZoneCount_004e4c5b,&local_1c);
          if (CONCAT31(extraout_var,bVar2) != 0) {
            FUN_0040328c(local_3c,0);
            (**(code **)(local_3c[0] + 0x20))(local_3c,&local_1c,4);
            local_20 = FUN_00404720((int)piVar4,s_DamageZones_004e4c7f,&DAT_004e4c8b);
            iVar3 = FUN_00403b60((int)local_20);
            if (iVar3 == 0) {
              FUN_004dbb24(&DAT_00524e20,s_No_dZones_listed_in_DamageZones_P_004e4c8f,(char *)0x0);
              FUN_004d9c38(&DAT_00524e20);
            }
            else {
              local_24 = 0;
              for (puVar7 = (undefined4 *)local_20[1]; puVar7 != (undefined4 *)0x0;
                  puVar7 = (undefined4 *)*puVar7) {
                local_24 = local_24 + 1;
                uVar8 = 0xffffffff;
                pcVar10 = (char *)(puVar7 + 2);
                do {
                  pcVar11 = pcVar10;
                  if (uVar8 == 0) break;
                  uVar8 = uVar8 - 1;
                  pcVar11 = pcVar10 + 1;
                  cVar1 = *pcVar10;
                  pcVar10 = pcVar11;
                } while (cVar1 != '\0');
                uVar8 = ~uVar8;
                pcVar10 = pcVar11 + -uVar8;
                pcVar11 = local_5c;
                for (uVar9 = uVar8 >> 2; uVar9 != 0; uVar9 = uVar9 - 1) {
                  *(undefined4 *)pcVar11 = *(undefined4 *)pcVar10;
                  pcVar10 = pcVar10 + 4;
                  pcVar11 = pcVar11 + 4;
                }
                for (uVar8 = uVar8 & 3; uVar8 != 0; uVar8 = uVar8 - 1) {
                  *pcVar11 = *pcVar10;
                  pcVar10 = pcVar10 + 1;
                  pcVar11 = pcVar11 + 1;
                }
                piVar5 = local_3c;
                piVar12 = local_18;
                puVar14 = param_4;
                puVar6 = (uint *)FUN_00402298(0x10);
                if (puVar6 == (uint *)0x0) {
                  puVar6 = (uint *)0x0;
                }
                else {
                  puVar6 = FUN_00402460(puVar6,local_5c);
                }
                puVar6[3] = puVar6[3] + 1;
                FUN_0041e590(param_3,param_2,(int)piVar4,(int *)puVar6,piVar5,(int)piVar12,
                             (int)puVar14);
              }
              if (local_1c == local_24) {
                puVar7 = (undefined4 *)FUN_00406f3c(param_1,param_2,0x14,1,0,local_3c,-1);
                FUN_004022d0(local_c);
                FUN_00403ecc(piVar4,3);
                FUN_004022d0(local_14);
                FUN_00403ecc(local_18,3);
                if (local_20 != (int *)0x0) {
                  (**(code **)*local_20)(local_20,3);
                }
                uVar13 = *puVar7;
                FUN_00403310(local_3c,2);
                return uVar13;
              }
              FUN_004dbb24(&DAT_00524e20,s_DZoneCount____damage_zones_found_004e4cb4,(char *)0x0);
              FUN_004d9c38(&DAT_00524e20);
            }
            FUN_004022d0(local_c);
            FUN_00403ecc(piVar4,3);
            FUN_004022d0(local_14);
            FUN_00403ecc(local_18,3);
            uVar13 = 0xffffffff;
            FUN_00403310(local_3c,2);
            return uVar13;
          }
          FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s_is_missing_DZoneCount_004e4c66,(char *)0x0);
        }
        FUN_004022e8(local_14);
        FUN_00403ecc(local_18,3);
      }
    }
    FUN_004022e8(local_c);
    FUN_00403ecc(piVar4,3);
  }
  return 0xffffffff;
}



/* @004259b0 file=? name=FUN_004259b0 */

undefined4 __cdecl FUN_004259b0(int param_1,char *param_2,uint param_3,int param_4)

{
  char *pcVar1;
  undefined4 *puVar2;
  bool bVar3;
  int iVar4;
  int *piVar5;
  undefined3 extraout_var;
  char *pcVar6;
  uint *puVar7;
  int *piVar8;
  char *pcVar9;
  undefined4 *puVar10;
  float *pfVar11;
  float *pfVar12;
  undefined8 uVar13;
  int *piVar14;
  undefined4 uVar15;
  float local_148 [12];
  float local_118;
  float local_114;
  float local_110;
  float local_10c;
  float local_108;
  float local_104;
  int local_100 [6];
  int *local_e8;
  undefined4 *local_e4;
  char *local_e0;
  char *local_dc;
  uint *local_d8;
  char *local_d4;
  int local_d0;
  int local_cc;
  int *local_c8;
  char *local_c4;
  int *local_c0;
  int local_bc;
  int *local_b8;
  undefined4 *local_b4;
  int *local_b0;
  int local_ac;
  int local_a8;
  int *local_a4;
  int *local_a0;
  int *local_9c;
  uint *local_98;
  char *local_94;
  char *local_90;
  int local_8c;
  int *local_88;
  uint *local_84;
  char *local_80;
  uint *local_7c;
  char *local_78;
  uint *local_74;
  int *local_70;
  char *local_6c;
  int *local_68;
  undefined4 local_64;
  undefined4 local_60;
  char *local_5c;
  int *local_58;
  int *local_54;
  char *local_50;
  uint *local_4c;
  char *local_48;
  char *local_44;
  int *local_40;
  undefined4 *local_3c;
  int *local_38;
  int local_34;
  int local_30;
  int *local_2c;
  int *local_28;
  char *local_24;
  int local_20;
  char *local_1c;
  int local_18;
  int *local_14;
  int *local_10;
  char *local_c;
  char *local_8;
  
  iVar4 = FUN_00404088(param_3,s_video_004e4ce9,s_skeleton_004e4cef,&local_8);
  if (iVar4 == 0) {
    local_c = param_2;
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_is_missing__skl_file_specificati_004e4cf8,(char *)0x0);
  }
  else {
    local_10 = (int *)FUN_004064fc(*(char **)(param_4 + 0x10),local_8);
    local_14 = (int *)FUN_00402298(0x20);
    if (local_14 == (int *)0x0) {
      piVar5 = (int *)0x0;
    }
    else {
      piVar5 = FUN_00403e84(local_14,(char *)local_10,1);
    }
    if ((*(byte *)(piVar5 + 7) & 2) == 0) {
      local_18 = piVar5[3];
    }
    else {
      local_18 = piVar5[4];
    }
    iVar4 = FUN_00403f84((int)piVar5,s_LAB_ONLY_004e4d1e);
    if (iVar4 != 0) {
      local_18 = local_18 + -1;
    }
    iVar4 = FUN_00403f84((int)piVar5,s_DamageZones_004e4d27);
    if (iVar4 != 0) {
      local_18 = local_18 + -1;
    }
    if (local_18 == 0) {
      local_1c = param_2;
      FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_has_no_Segments__004e4d33,(char *)0x0);
    }
    else {
      bVar3 = FUN_004040d8((int)piVar5,&DAT_004e4d46,s_JointCount_004e4d4b,&local_20);
      if (CONCAT31(extraout_var,bVar3) != 0) {
        FUN_0040328c(local_100,0);
        local_28 = (int *)(**(code **)(local_100[0] + 0x20))(local_100,&local_18,4);
        (**(code **)(*local_28 + 0x20))(local_28,&local_20,4);
        local_2c = FUN_0040485c((int)piVar5,(char *)0x0);
        puVar2 = (undefined4 *)local_2c[1];
        local_30 = -1;
        local_3c = (undefined4 *)FUN_00402298(0x10);
        if (local_3c == (undefined4 *)0x0) {
          local_38 = (int *)0x0;
        }
        else {
          local_38 = (int *)FUN_004023f4(local_3c);
        }
        local_38[3] = local_38[3] + 1;
        pfVar11 = (float *)&DAT_004e107c;
        pfVar12 = local_148;
        for (iVar4 = 0xc; iVar4 != 0; iVar4 = iVar4 + -1) {
          *pfVar12 = *pfVar11;
          pfVar11 = pfVar11 + 1;
          pfVar12 = pfVar12 + 1;
        }
joined_r0x00425bbc:
        do {
          if (puVar2 == (undefined4 *)0x0) {
            local_e4 = (undefined4 *)FUN_00406f3c(param_1,param_2,0x15,1,0,local_100,-1);
            FUN_004022d0(local_10);
            FUN_00403ecc(piVar5,3);
            if (local_2c != (int *)0x0) {
              (**(code **)*local_2c)(local_2c,3);
            }
            uVar15 = *local_e4;
            local_e8 = local_38;
            piVar5 = local_38 + 3;
            *piVar5 = *piVar5 + -1;
            if (*piVar5 == 0) {
              FUN_004024d8(local_38,3);
            }
            FUN_00403310(local_100,2);
            return uVar15;
          }
          FUN_00402a98((int *)&local_40,(int *)&local_38,(char *)(puVar2 + 2));
          piVar8 = local_40 + 3;
          *piVar8 = *piVar8 + -1;
          if (*piVar8 == 0) {
            FUN_004024d8(local_40,3);
          }
          pcVar6 = (char *)local_38[2];
          pcVar9 = s_LAB_ONLY_004e4d6f;
          do {
            bVar3 = *pcVar6 == *pcVar9;
            if (!bVar3) break;
            if (*pcVar6 == '\0') goto LAB_00425c3b;
            pcVar1 = pcVar6 + 1;
            bVar3 = *pcVar1 == pcVar9[1];
            if (!bVar3) break;
            pcVar6 = pcVar6 + 2;
            pcVar9 = pcVar9 + 2;
            bVar3 = *pcVar1 == '\0';
          } while (!bVar3);
          if (!bVar3) {
            pcVar9 = s_DamageZones_004e4d78;
            pcVar6 = (char *)local_38[2];
            do {
              if (*pcVar6 != *pcVar9) goto LAB_00425c42;
              bVar3 = true;
              if (*pcVar6 == '\0') break;
              pcVar1 = pcVar6 + 1;
              if (*pcVar1 != pcVar9[1]) goto LAB_00425c42;
              pcVar6 = pcVar6 + 2;
              pcVar9 = pcVar9 + 2;
              bVar3 = *pcVar1 == '\0';
            } while (!bVar3);
            if (!bVar3) {
LAB_00425c42:
              FUN_004029b0(local_100,(int)local_38);
              iVar4 = FUN_00404088((int)piVar5,(char *)local_38[2],s_parent_004e4d84,&local_44);
              if (iVar4 != 0) {
                local_48 = local_44;
                piVar8 = piVar5;
                local_4c = (uint *)FUN_00402298(0x10);
                if (local_4c == (uint *)0x0) {
                  puVar7 = (uint *)0x0;
                }
                else {
                  puVar7 = FUN_00402460(local_4c,local_48);
                }
                puVar7[3] = puVar7[3] + 1;
                local_30 = FUN_0042760c((int *)puVar7,(int)piVar8);
                if (local_30 == -1) {
                  local_50 = local_44;
                  uVar13 = FUN_004dbd4c(&DAT_00524e20,param_3);
                  local_54 = (int *)uVar13;
                  FUN_004dbb24(local_54,&DAT_004e4d8b,(char *)0x0);
                  FUN_004dbb24(local_54,local_50,(char *)0x0);
                  FUN_004dbb24(local_54,s_Not_Found__004e4d8d,(char *)0x0);
                  FUN_004d9c38(local_54);
                  local_58 = local_38;
                  piVar8 = local_38 + 3;
                  *piVar8 = *piVar8 + -1;
                  if (*piVar8 == 0) {
                    FUN_004024d8(local_38,3);
                  }
                  FUN_00403310(local_100,2);
                  goto LAB_00425abc;
                }
              }
              (**(code **)(local_100[0] + 0x20))(local_100,&local_30,4);
              local_60 = 0xffffffff;
              local_64 = 0;
              iVar4 = FUN_00404088((int)piVar5,(char *)local_38[2],&DAT_004e4d99,&local_5c);
              if (iVar4 == 0) {
                pcVar9 = &DAT_004e4d9e;
                pcVar6 = (char *)local_38[2];
                do {
                  bVar3 = *pcVar9 == *pcVar6;
                  if (!bVar3) break;
                  if (*pcVar9 == '\0') goto LAB_00425eee;
                  pcVar1 = pcVar9 + 1;
                  bVar3 = *pcVar1 == pcVar6[1];
                  if (!bVar3) break;
                  pcVar9 = pcVar9 + 2;
                  pcVar6 = pcVar6 + 2;
                  bVar3 = *pcVar1 == '\0';
                } while (!bVar3);
                if (!bVar3) {
                  local_64 = 1;
                }
              }
              else {
                pcVar9 = s_static_004e4da3;
                pcVar6 = local_5c;
                do {
                  if (*pcVar6 != *pcVar9) goto LAB_00425e01;
                  bVar3 = true;
                  if (*pcVar6 == '\0') break;
                  pcVar1 = pcVar6 + 1;
                  if (*pcVar1 != pcVar9[1]) goto LAB_00425e01;
                  pcVar6 = pcVar6 + 2;
                  pcVar9 = pcVar9 + 2;
                  bVar3 = *pcVar1 == '\0';
                } while (!bVar3);
                if (bVar3) {
                  local_60 = 3;
                }
                else {
LAB_00425e01:
                  pcVar9 = s_hingex_004e4daa;
                  pcVar6 = local_5c;
                  do {
                    if (*pcVar6 != *pcVar9) goto LAB_00425e31;
                    bVar3 = true;
                    if (*pcVar6 == '\0') break;
                    pcVar1 = pcVar6 + 1;
                    if (*pcVar1 != pcVar9[1]) goto LAB_00425e31;
                    pcVar6 = pcVar6 + 2;
                    pcVar9 = pcVar9 + 2;
                    bVar3 = *pcVar1 == '\0';
                  } while (!bVar3);
                  if (bVar3) {
                    local_60 = 0;
                  }
                  else {
LAB_00425e31:
                    pcVar9 = s_hingey_004e4db1;
                    pcVar6 = local_5c;
                    do {
                      if (*pcVar6 != *pcVar9) goto LAB_00425e63;
                      bVar3 = true;
                      if (*pcVar6 == '\0') break;
                      pcVar1 = pcVar6 + 1;
                      if (*pcVar1 != pcVar9[1]) goto LAB_00425e63;
                      pcVar6 = pcVar6 + 2;
                      pcVar9 = pcVar9 + 2;
                      bVar3 = *pcVar1 == '\0';
                    } while (!bVar3);
                    if (bVar3) {
                      local_60 = 1;
                    }
                    else {
LAB_00425e63:
                      pcVar9 = &DAT_004e4db8;
                      pcVar6 = local_5c;
                      do {
                        if (*pcVar6 != *pcVar9) goto LAB_00425e92;
                        bVar3 = true;
                        if (*pcVar6 == '\0') break;
                        pcVar1 = pcVar6 + 1;
                        if (*pcVar1 != pcVar9[1]) goto LAB_00425e92;
                        pcVar6 = pcVar6 + 2;
                        pcVar9 = pcVar9 + 2;
                        bVar3 = *pcVar1 == '\0';
                      } while (!bVar3);
                      if (bVar3) {
                        local_60 = 2;
                      }
                      else {
LAB_00425e92:
                        pcVar9 = &DAT_004e4dbf;
                        pcVar6 = local_5c;
                        do {
                          if (*pcVar6 != *pcVar9) goto LAB_00425ec1;
                          bVar3 = true;
                          if (*pcVar6 == '\0') break;
                          pcVar1 = pcVar6 + 1;
                          if (*pcVar1 != pcVar9[1]) goto LAB_00425ec1;
                          pcVar6 = pcVar6 + 2;
                          pcVar9 = pcVar9 + 2;
                          bVar3 = *pcVar1 == '\0';
                        } while (!bVar3);
                        if (bVar3) {
                          local_60 = 4;
                        }
                        else {
LAB_00425ec1:
                          pcVar9 = s_balltranslate_004e4dc4;
                          pcVar6 = local_5c;
                          do {
                            if (*pcVar6 != *pcVar9) goto LAB_00425eee;
                            bVar3 = true;
                            if (*pcVar6 == '\0') break;
                            pcVar1 = pcVar6 + 1;
                            if (*pcVar1 != pcVar9[1]) goto LAB_00425eee;
                            pcVar6 = pcVar6 + 2;
                            pcVar9 = pcVar9 + 2;
                            bVar3 = *pcVar1 == '\0';
                          } while (!bVar3);
                          if (bVar3) {
                            local_60 = 5;
                          }
                        }
                      }
                    }
                  }
                }
              }
LAB_00425eee:
              local_68 = (int *)(**(code **)(local_100[0] + 0x20))(local_100,&local_64,4);
              (**(code **)(*local_68 + 0x20))(local_68,&local_60,4);
              FUN_00404118((int)piVar5,(char *)local_38[2],s_tranx_004e4dd2,&local_118);
              FUN_00404118((int)piVar5,(char *)local_38[2],s_trany_004e4dd8,&local_114);
              FUN_00404118((int)piVar5,(char *)local_38[2],s_tranz_004e4dde,&local_110);
              FUN_00404118((int)piVar5,(char *)local_38[2],s_pitch_004e4de4,&local_10c);
              FUN_00404118((int)piVar5,(char *)local_38[2],&DAT_004e4dea,&local_108);
              FUN_00404118((int)piVar5,(char *)local_38[2],&DAT_004e4dee,&local_104);
              FUN_0040b0ac((int)local_148,3,&local_118);
              FUN_0040ac6c(local_148,&local_10c);
              (**(code **)(local_100[0] + 0x20))(local_100,local_148,0x30);
              iVar4 = FUN_00404088(param_3,s_video_004e4df3,s_skeleton_004e4df9,&local_6c);
              if (iVar4 == 0) {
                local_70 = local_38;
                piVar8 = local_38 + 3;
                *piVar8 = *piVar8 + -1;
                if (*piVar8 == 0) {
                  FUN_004024d8(local_38,3);
                }
                FUN_00403310(local_100,2);
                goto LAB_00425abc;
              }
              local_78 = FUN_004064fc(*(char **)(param_4 + 0x10),local_6c);
              puVar7 = (uint *)FUN_00402298(0x10);
              if (puVar7 == (uint *)0x0) {
                local_74 = (uint *)0x0;
              }
              else {
                local_74 = FUN_00402460(puVar7,local_78);
              }
              local_74[3] = local_74[3] + 1;
              piVar8 = (int *)FUN_00402298(0x20);
              if (piVar8 == (int *)0x0) {
                piVar8 = (int *)0x0;
              }
              else {
                piVar8 = FUN_00403e84(piVar8,(char *)local_74[2],1);
              }
              if ((*(byte *)(piVar8 + 7) & 2) == 0) {
                iVar4 = piVar8[3];
              }
              else {
                iVar4 = piVar8[4];
              }
              if (iVar4 == 0) {
                local_7c = local_74;
                local_80 = (char *)local_74[2];
                FUN_004dbb24(&DAT_00524e20,local_80,(char *)0x0);
                FUN_004dbb24(&DAT_00524e20,s_is_empty_or_missing__004e4e02,(char *)0x0);
                FUN_004d9c38(&DAT_00524e20);
                FUN_00403ecc(piVar8,3);
                local_84 = local_74;
                puVar7 = local_74 + 3;
                *puVar7 = *puVar7 - 1;
                if (*puVar7 == 0) {
                  FUN_004024d8((int *)local_74,3);
                }
                local_88 = local_38;
                piVar8 = local_38 + 3;
                *piVar8 = *piVar8 + -1;
                if (*piVar8 == 0) {
                  FUN_004024d8(local_38,3);
                }
                FUN_00403310(local_100,2);
                goto LAB_00425abc;
              }
              iVar4 = FUN_00404088((int)piVar8,(char *)local_38[2],s_dzone_004e4e18,&local_90);
              if (iVar4 == 0) {
                local_8c = -1;
              }
              else {
                local_94 = local_90;
                piVar14 = piVar8;
                local_98 = (uint *)FUN_00402298(0x10);
                if (local_98 == (uint *)0x0) {
                  puVar7 = (uint *)0x0;
                }
                else {
                  puVar7 = FUN_00402460(local_98,local_94);
                }
                puVar7[3] = puVar7[3] + 1;
                local_8c = FUN_004274f8((int *)puVar7,(int)piVar14);
              }
              (**(code **)(local_100[0] + 0x20))(local_100,&local_8c,4);
              FUN_00403ecc(piVar8,3);
              puVar7 = local_74 + 3;
              *puVar7 = *puVar7 - 1;
              if (*puVar7 == 0) {
                FUN_004024d8((int *)local_74,3);
              }
              local_38[3] = local_38[3] + 1;
              iVar4 = FUN_00426e64(local_100,param_3,local_38,param_4);
              if (iVar4 == 0) {
                local_9c = local_38;
                piVar8 = local_38 + 3;
                *piVar8 = *piVar8 + -1;
                if (*piVar8 == 0) {
                  FUN_004024d8(local_38,3);
                }
                FUN_00403310(local_100,2);
                goto LAB_00425abc;
              }
              local_38[3] = local_38[3] + 1;
              iVar4 = FUN_00426780(local_100,param_3,local_38,param_4);
              if (iVar4 == 0) {
                local_a0 = local_38;
                piVar8 = local_38 + 3;
                *piVar8 = *piVar8 + -1;
                if (*piVar8 == 0) {
                  FUN_004024d8(local_38,3);
                }
                FUN_00403310(local_100,2);
                goto LAB_00425abc;
              }
              local_a4 = FUN_00404720((int)piVar5,(char *)(puVar2 + 2),s_dzone_004e4e1e);
              puVar10 = (undefined4 *)local_a4[1];
              local_a8 = FUN_00403b60((int)local_a4);
              (**(code **)(local_100[0] + 0x20))(local_100,&local_a8,4);
              if ((local_a8 != 0) && (local_ac = 0, 0 < local_a8)) {
                do {
                  local_b4 = (undefined4 *)FUN_00402298(0x10);
                  if (local_b4 == (undefined4 *)0x0) {
                    local_b0 = (int *)0x0;
                  }
                  else {
                    local_b0 = (int *)FUN_004023f4(local_b4);
                  }
                  local_b0[3] = local_b0[3] + 1;
                  FUN_00402a98((int *)&local_b8,(int *)&local_b0,(char *)puVar10[1]);
                  piVar8 = local_b8 + 3;
                  *piVar8 = *piVar8 + -1;
                  if (*piVar8 == 0) {
                    FUN_004024d8(local_b8,3);
                  }
                  local_b0[3] = local_b0[3] + 1;
                  local_bc = FUN_004274f8(local_b0,(int)piVar5);
                  if (local_bc == -1) {
                    uVar13 = FUN_004dbd4c(&DAT_00524e20,param_3);
                    piVar8 = (int *)uVar13;
                    FUN_004dbb24(piVar8,&DAT_004e4e24,(char *)0x0);
                    local_c0 = local_b0;
                    local_c4 = (char *)local_b0[2];
                    FUN_004dbb24(piVar8,local_c4,(char *)0x0);
                    FUN_004dbb24(piVar8,s_Not_Found__004e4e26,(char *)0x0);
                    FUN_004d9c38(piVar8);
                    piVar8 = local_b0 + 3;
                    *piVar8 = *piVar8 + -1;
                    if (*piVar8 == 0) {
                      FUN_004024d8(local_b0,3);
                    }
                    piVar8 = local_38 + 3;
                    *piVar8 = *piVar8 + -1;
                    if (*piVar8 == 0) {
                      FUN_004024d8(local_38,3);
                    }
                    FUN_00403310(local_100,2);
                    goto LAB_00425abc;
                  }
                  (**(code **)(local_100[0] + 0x20))(local_100,&local_bc,4);
                  puVar10 = (undefined4 *)*puVar10;
                  piVar8 = local_b0 + 3;
                  *piVar8 = *piVar8 + -1;
                  if (*piVar8 == 0) {
                    FUN_004024d8(local_b0,3);
                  }
                  local_ac = local_ac + 1;
                } while (local_ac < local_a8);
              }
              if (local_a4 != (int *)0x0) {
                (**(code **)*local_a4)(local_a4,3);
              }
              local_c8 = FUN_00404720((int)piVar5,(char *)(puVar2 + 2),s_joint_004e4e32);
              puVar10 = (undefined4 *)local_c8[1];
              local_34 = 0;
              for (; puVar10 != (undefined4 *)0x0; puVar10 = (undefined4 *)*puVar10) {
                local_34 = local_34 + 1;
              }
              (**(code **)(local_100[0] + 0x20))(local_100,&local_34,4);
              if (local_34 != 0) {
                puVar10 = (undefined4 *)local_c8[1];
                local_cc = 0;
                if (0 < local_34) {
                  do {
                    local_d4 = (char *)puVar10[1];
                    piVar8 = piVar5;
                    local_d8 = (uint *)FUN_00402298(0x10);
                    if (local_d8 == (uint *)0x0) {
                      puVar7 = (uint *)0x0;
                    }
                    else {
                      puVar7 = FUN_00402460(local_d8,local_d4);
                    }
                    puVar7[3] = puVar7[3] + 1;
                    local_d0 = FUN_0042760c((int *)puVar7,(int)piVar8);
                    if (local_d0 == -1) {
                      local_dc = (char *)(puVar10 + 2);
                      local_e0 = param_2;
                      FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
                      FUN_004dbb24(&DAT_00524e20,&DAT_004e4e38,(char *)0x0);
                      FUN_004dbb24(&DAT_00524e20,local_dc,(char *)0x0);
                      FUN_004dbb24(&DAT_00524e20,s_Not_Found___004e4e3a,(char *)0x0);
                      FUN_004d9c38(&DAT_00524e20);
                      piVar8 = local_38 + 3;
                      *piVar8 = *piVar8 + -1;
                      if (*piVar8 == 0) {
                        FUN_004024d8(local_38,3);
                      }
                      FUN_00403310(local_100,2);
                      goto LAB_00425abc;
                    }
                    (**(code **)(local_100[0] + 0x20))(local_100,&local_d0,4);
                    puVar10 = (undefined4 *)*puVar10;
                    local_cc = local_cc + 1;
                  } while (local_cc < local_34);
                }
              }
              if (local_c8 != (int *)0x0) {
                (**(code **)*local_c8)(local_c8,3);
              }
              puVar2 = (undefined4 *)*puVar2;
              goto joined_r0x00425bbc;
            }
          }
LAB_00425c3b:
          puVar2 = (undefined4 *)*puVar2;
        } while( true );
      }
      local_24 = param_2;
      FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_is_missing_JointCount_004e4d56,(char *)0x0);
    }
LAB_00425abc:
    FUN_004022d0(local_10);
    FUN_00403ecc(piVar5,3);
  }
  return 0xffffffff;
}



/* @00426780 file=? name=FUN_00426780 */

undefined4 __cdecl FUN_00426780(int *param_1,int param_2,int *param_3,int param_4)

{
  int *piVar1;
  undefined4 *puVar2;
  uint *puVar3;
  int iVar4;
  int *piVar5;
  undefined4 *puVar6;
  char cVar7;
  undefined4 uVar8;
  int *local_80;
  int *local_7c;
  int *local_78;
  char *local_74;
  int *local_70;
  int *local_6c;
  uint *local_68;
  uint *local_64;
  uint *local_60;
  char *local_5c;
  uint *local_58;
  char *local_54;
  uint *local_50;
  char *local_4c;
  uint *local_48;
  int *local_44;
  uint *local_40;
  uint *local_3c;
  uint *local_38;
  uint *local_34;
  uint *local_30;
  uint *local_2c;
  uint *local_28;
  uint *local_24;
  undefined4 local_20;
  char *local_1c;
  uint *local_18;
  int *local_14;
  int *local_10;
  int local_c;
  int *local_8;
  
  local_8 = FUN_00404720(param_2,s_video_004e4e47,s_destroyed_004e4e4d);
  local_c = FUN_00403b60((int)local_8);
  local_10 = param_1;
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  if (local_c == 0) {
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
    uVar8 = 1;
    local_14 = param_3;
    piVar5 = param_3 + 3;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_004024d8(param_3,3);
    }
  }
  else {
    puVar2 = (undefined4 *)local_8[1];
    while (puVar2 != (undefined4 *)0x0) {
      local_1c = (char *)(puVar2 + 2);
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        local_18 = (uint *)0x0;
      }
      else {
        local_18 = FUN_00402460(puVar3,local_1c);
      }
      local_18[3] = local_18[3] + 1;
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        local_24 = (uint *)0x0;
      }
      else {
        local_24 = FUN_00402460(puVar3,s_destroyed_004e4e57);
      }
      local_24[3] = local_24[3] + 1;
      iVar4 = FUN_004027d8((int)local_18,(int)local_24);
      cVar7 = iVar4 == 0;
      puVar3 = local_24 + 3;
      *puVar3 = *puVar3 - 1;
      if (*puVar3 == 0) {
        FUN_004024d8((int *)local_24,3);
      }
      if (cVar7 == '\0') {
        puVar3 = (uint *)FUN_00402298(0x10);
        if (puVar3 == (uint *)0x0) {
          local_28 = (uint *)0x0;
        }
        else {
          local_28 = FUN_00402460(puVar3,s_destroyeds_004e4e61);
        }
        local_28[3] = local_28[3] + 1;
        iVar4 = FUN_004027d8((int)local_18,(int)local_28);
        cVar7 = iVar4 == 0;
        puVar3 = local_28 + 3;
        *puVar3 = *puVar3 - 1;
        if (*puVar3 == 0) {
          FUN_004024d8((int *)local_28,3);
        }
        if (cVar7 == '\0') {
          puVar3 = (uint *)FUN_00402298(0x10);
          if (puVar3 == (uint *)0x0) {
            local_2c = (uint *)0x0;
          }
          else {
            local_2c = FUN_00402460(puVar3,s_destroyedt_004e4e6c);
          }
          local_2c[3] = local_2c[3] + 1;
          iVar4 = FUN_004027d8((int)local_18,(int)local_2c);
          cVar7 = iVar4 == 0;
          puVar3 = local_2c + 3;
          *puVar3 = *puVar3 - 1;
          if (*puVar3 == 0) {
            FUN_004024d8((int *)local_2c,3);
          }
          if (cVar7 == '\0') {
            puVar3 = (uint *)FUN_00402298(0x10);
            if (puVar3 == (uint *)0x0) {
              local_30 = (uint *)0x0;
            }
            else {
              local_30 = FUN_00402460(puVar3,s_destroyedo_004e4e77);
            }
            local_30[3] = local_30[3] + 1;
            iVar4 = FUN_004027d8((int)local_18,(int)local_30);
            cVar7 = iVar4 == 0;
            puVar3 = local_30 + 3;
            *puVar3 = *puVar3 - 1;
            if (*puVar3 == 0) {
              FUN_004024d8((int *)local_30,3);
            }
            if (cVar7 == '\0') {
              puVar3 = (uint *)FUN_00402298(0x10);
              if (puVar3 == (uint *)0x0) {
                local_34 = (uint *)0x0;
              }
              else {
                local_34 = FUN_00402460(puVar3,s_destroyeda_004e4e82);
              }
              local_34[3] = local_34[3] + 1;
              iVar4 = FUN_004027d8((int)local_18,(int)local_34);
              cVar7 = iVar4 == 0;
              puVar3 = local_34 + 3;
              *puVar3 = *puVar3 - 1;
              if (*puVar3 == 0) {
                FUN_004024d8((int *)local_34,3);
              }
              if (cVar7 == '\0') {
                puVar3 = (uint *)FUN_00402298(0x10);
                if (puVar3 == (uint *)0x0) {
                  local_38 = (uint *)0x0;
                }
                else {
                  local_38 = FUN_00402460(puVar3,s_destroyedb_004e4e8d);
                }
                local_38[3] = local_38[3] + 1;
                iVar4 = FUN_004027d8((int)local_18,(int)local_38);
                cVar7 = iVar4 == 0;
                puVar3 = local_38 + 3;
                *puVar3 = *puVar3 - 1;
                if (*puVar3 == 0) {
                  FUN_004024d8((int *)local_38,3);
                }
                if (cVar7 == '\0') {
                  puVar3 = (uint *)FUN_00402298(0x10);
                  if (puVar3 == (uint *)0x0) {
                    local_3c = (uint *)0x0;
                  }
                  else {
                    local_3c = FUN_00402460(puVar3,s_destroyedc_004e4e98);
                  }
                  local_3c[3] = local_3c[3] + 1;
                  iVar4 = FUN_004027d8((int)local_18,(int)local_3c);
                  cVar7 = iVar4 == 0;
                  puVar3 = local_3c + 3;
                  *puVar3 = *puVar3 - 1;
                  if (*puVar3 == 0) {
                    FUN_004024d8((int *)local_3c,3);
                  }
                  if (cVar7 == '\0') {
                    puVar3 = (uint *)FUN_00402298(0x10);
                    if (puVar3 == (uint *)0x0) {
                      local_40 = (uint *)0x0;
                    }
                    else {
                      local_40 = FUN_00402460(puVar3,s_destroyedd_004e4ea3);
                    }
                    local_40[3] = local_40[3] + 1;
                    iVar4 = FUN_004027d8((int)local_18,(int)local_40);
                    cVar7 = iVar4 == 0;
                    puVar3 = local_40 + 3;
                    *puVar3 = *puVar3 - 1;
                    if (*puVar3 == 0) {
                      FUN_004024d8((int *)local_40,3);
                    }
                    if (cVar7 != '\0') {
                      local_20 = 7;
                    }
                  }
                  else {
                    local_20 = 6;
                  }
                }
                else {
                  local_20 = 5;
                }
              }
              else {
                local_20 = 4;
              }
            }
            else {
              local_20 = 3;
            }
          }
          else {
            local_20 = 2;
          }
        }
        else {
          local_20 = 1;
        }
      }
      else {
        local_20 = 0;
      }
      local_44 = param_1;
      (**(code **)(*param_1 + 0x20))(param_1,&local_20,4);
      local_4c = (char *)puVar2[1];
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        local_48 = (uint *)0x0;
      }
      else {
        local_48 = FUN_00402460(puVar3,local_4c);
      }
      local_48[3] = local_48[3] + 1;
      local_54 = FUN_004064fc(*(char **)(param_4 + 0x10),(char *)local_48[2]);
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        local_50 = (uint *)0x0;
      }
      else {
        local_50 = FUN_00402460(puVar3,local_54);
      }
      local_50[3] = local_50[3] + 1;
      piVar5 = (int *)FUN_00402298(0x20);
      if (piVar5 == (int *)0x0) {
        piVar5 = (int *)0x0;
      }
      else {
        piVar5 = FUN_00403e84(piVar5,(char *)local_50[2],1);
      }
      if ((*(byte *)(piVar5 + 7) & 2) == 0) {
        iVar4 = piVar5[3];
      }
      else {
        iVar4 = piVar5[4];
      }
      if (iVar4 == 0) {
        local_58 = local_50;
        local_5c = (char *)local_50[2];
        FUN_004dbb24(&DAT_00524e20,local_5c,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,s_is_empty_or_missing__004e4eae,(char *)0x0);
        FUN_004d9c38(&DAT_00524e20);
        if (local_8 != (int *)0x0) {
          (**(code **)*local_8)(local_8,3);
        }
        FUN_00403ecc(piVar5,3);
        uVar8 = 0xffffffff;
        local_60 = local_50;
        puVar3 = local_50 + 3;
        *puVar3 = *puVar3 - 1;
        if (*puVar3 == 0) {
          FUN_004024d8((int *)local_50,3);
        }
        local_64 = local_48;
        puVar3 = local_48 + 3;
        *puVar3 = *puVar3 - 1;
        if (*puVar3 == 0) {
          FUN_004024d8((int *)local_48,3);
        }
        local_68 = local_18;
        puVar3 = local_18 + 3;
        *puVar3 = *puVar3 - 1;
        if (*puVar3 == 0) {
          FUN_004024d8((int *)local_18,3);
        }
        local_6c = param_3;
        piVar5 = param_3 + 3;
        *piVar5 = *piVar5 + -1;
        if (*piVar5 != 0) {
          return uVar8;
        }
        FUN_004024d8(param_3,3);
        return uVar8;
      }
      puVar6 = (undefined4 *)FUN_00402298(0x10);
      if (puVar6 == (undefined4 *)0x0) {
        local_70 = (int *)0x0;
      }
      else {
        local_70 = (int *)FUN_004023f4(puVar6);
      }
      local_70[3] = local_70[3] + 1;
      iVar4 = FUN_00404088((int)piVar5,(char *)param_3[2],s_Object_004e4ec4,&local_74);
      if (iVar4 == 0) {
        FUN_00402a98((int *)&local_80,(int *)&local_70,&DAT_004e4ecb);
        piVar1 = local_80 + 3;
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_004024d8(local_80,3);
        }
      }
      else {
        FUN_00402a98((int *)&local_78,(int *)&local_70,local_74);
        local_7c = local_78;
        piVar1 = local_78 + 3;
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_004024d8(local_78,3);
        }
      }
      FUN_004029b0(param_1,(int)local_70);
      FUN_00403ecc(piVar5,3);
      puVar2 = (undefined4 *)*puVar2;
      piVar5 = local_70 + 3;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_004024d8(local_70,3);
      }
      puVar3 = local_50 + 3;
      *puVar3 = *puVar3 - 1;
      if (*puVar3 == 0) {
        FUN_004024d8((int *)local_50,3);
      }
      puVar3 = local_48 + 3;
      *puVar3 = *puVar3 - 1;
      if (*puVar3 == 0) {
        FUN_004024d8((int *)local_48,3);
      }
      puVar3 = local_18 + 3;
      *puVar3 = *puVar3 - 1;
      if (*puVar3 == 0) {
        FUN_004024d8((int *)local_18,3);
      }
    }
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
    uVar8 = 1;
    piVar5 = param_3 + 3;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_004024d8(param_3,3);
    }
  }
  return uVar8;
}



/* @00426e64 file=? name=FUN_00426e64 */

undefined4 __cdecl FUN_00426e64(int *param_1,int param_2,int *param_3,int param_4)

{
  int *piVar1;
  undefined4 *puVar2;
  uint *puVar3;
  int iVar4;
  int *piVar5;
  undefined4 *puVar6;
  char cVar7;
  undefined4 uVar8;
  int *local_7c;
  int *local_78;
  int *local_74;
  char *local_70;
  int *local_6c;
  int *local_68;
  uint *local_64;
  uint *local_60;
  uint *local_5c;
  char *local_58;
  uint *local_54;
  char *local_50;
  uint *local_4c;
  char *local_48;
  uint *local_44;
  int *local_40;
  uint *local_3c;
  uint *local_38;
  uint *local_34;
  uint *local_30;
  uint *local_2c;
  uint *local_28;
  uint *local_24;
  uint *local_20;
  undefined4 local_1c;
  char *local_18;
  uint *local_14;
  int *local_10;
  int local_c;
  int *local_8;
  
  local_8 = FUN_00404720(param_2,s_video_004e4ed0,s_skeleton_004e4ed6);
  local_c = FUN_00403b60((int)local_8);
  local_10 = param_1;
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  puVar2 = (undefined4 *)local_8[1];
  while( true ) {
    if (puVar2 == (undefined4 *)0x0) {
      if (local_8 != (int *)0x0) {
        (**(code **)*local_8)(local_8,3);
      }
      uVar8 = 1;
      piVar5 = param_3 + 3;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_004024d8(param_3,3);
      }
      return uVar8;
    }
    local_18 = (char *)(puVar2 + 2);
    puVar3 = (uint *)FUN_00402298(0x10);
    if (puVar3 == (uint *)0x0) {
      local_14 = (uint *)0x0;
    }
    else {
      local_14 = FUN_00402460(puVar3,local_18);
    }
    local_14[3] = local_14[3] + 1;
    puVar3 = (uint *)FUN_00402298(0x10);
    if (puVar3 == (uint *)0x0) {
      local_20 = (uint *)0x0;
    }
    else {
      local_20 = FUN_00402460(puVar3,s_skeleton_004e4edf);
    }
    local_20[3] = local_20[3] + 1;
    iVar4 = FUN_004027d8((int)local_14,(int)local_20);
    cVar7 = iVar4 == 0;
    puVar3 = local_20 + 3;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_004024d8((int *)local_20,3);
    }
    if (cVar7 == '\0') {
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        local_24 = (uint *)0x0;
      }
      else {
        local_24 = FUN_00402460(puVar3,s_skeletons_004e4ee8);
      }
      local_24[3] = local_24[3] + 1;
      iVar4 = FUN_004027d8((int)local_14,(int)local_24);
      cVar7 = iVar4 == 0;
      puVar3 = local_24 + 3;
      *puVar3 = *puVar3 - 1;
      if (*puVar3 == 0) {
        FUN_004024d8((int *)local_24,3);
      }
      if (cVar7 == '\0') {
        puVar3 = (uint *)FUN_00402298(0x10);
        if (puVar3 == (uint *)0x0) {
          local_28 = (uint *)0x0;
        }
        else {
          local_28 = FUN_00402460(puVar3,s_skeletont_004e4ef2);
        }
        local_28[3] = local_28[3] + 1;
        iVar4 = FUN_004027d8((int)local_14,(int)local_28);
        cVar7 = iVar4 == 0;
        puVar3 = local_28 + 3;
        *puVar3 = *puVar3 - 1;
        if (*puVar3 == 0) {
          FUN_004024d8((int *)local_28,3);
        }
        if (cVar7 == '\0') {
          puVar3 = (uint *)FUN_00402298(0x10);
          if (puVar3 == (uint *)0x0) {
            local_2c = (uint *)0x0;
          }
          else {
            local_2c = FUN_00402460(puVar3,s_skeletono_004e4efc);
          }
          local_2c[3] = local_2c[3] + 1;
          iVar4 = FUN_004027d8((int)local_14,(int)local_2c);
          cVar7 = iVar4 == 0;
          puVar3 = local_2c + 3;
          *puVar3 = *puVar3 - 1;
          if (*puVar3 == 0) {
            FUN_004024d8((int *)local_2c,3);
          }
          if (cVar7 == '\0') {
            puVar3 = (uint *)FUN_00402298(0x10);
            if (puVar3 == (uint *)0x0) {
              local_30 = (uint *)0x0;
            }
            else {
              local_30 = FUN_00402460(puVar3,s_skeletona_004e4f06);
            }
            local_30[3] = local_30[3] + 1;
            iVar4 = FUN_004027d8((int)local_14,(int)local_30);
            cVar7 = iVar4 == 0;
            puVar3 = local_30 + 3;
            *puVar3 = *puVar3 - 1;
            if (*puVar3 == 0) {
              FUN_004024d8((int *)local_30,3);
            }
            if (cVar7 == '\0') {
              puVar3 = (uint *)FUN_00402298(0x10);
              if (puVar3 == (uint *)0x0) {
                local_34 = (uint *)0x0;
              }
              else {
                local_34 = FUN_00402460(puVar3,s_skeletonb_004e4f10);
              }
              local_34[3] = local_34[3] + 1;
              iVar4 = FUN_004027d8((int)local_14,(int)local_34);
              cVar7 = iVar4 == 0;
              puVar3 = local_34 + 3;
              *puVar3 = *puVar3 - 1;
              if (*puVar3 == 0) {
                FUN_004024d8((int *)local_34,3);
              }
              if (cVar7 == '\0') {
                puVar3 = (uint *)FUN_00402298(0x10);
                if (puVar3 == (uint *)0x0) {
                  local_38 = (uint *)0x0;
                }
                else {
                  local_38 = FUN_00402460(puVar3,s_skeletonc_004e4f1a);
                }
                local_38[3] = local_38[3] + 1;
                iVar4 = FUN_004027d8((int)local_14,(int)local_38);
                cVar7 = iVar4 == 0;
                puVar3 = local_38 + 3;
                *puVar3 = *puVar3 - 1;
                if (*puVar3 == 0) {
                  FUN_004024d8((int *)local_38,3);
                }
                if (cVar7 == '\0') {
                  puVar3 = (uint *)FUN_00402298(0x10);
                  if (puVar3 == (uint *)0x0) {
                    local_3c = (uint *)0x0;
                  }
                  else {
                    local_3c = FUN_00402460(puVar3,s_skeletond_004e4f24);
                  }
                  local_3c[3] = local_3c[3] + 1;
                  iVar4 = FUN_004027d8((int)local_14,(int)local_3c);
                  cVar7 = iVar4 == 0;
                  puVar3 = local_3c + 3;
                  *puVar3 = *puVar3 - 1;
                  if (*puVar3 == 0) {
                    FUN_004024d8((int *)local_3c,3);
                  }
                  if (cVar7 != '\0') {
                    local_1c = 7;
                  }
                }
                else {
                  local_1c = 6;
                }
              }
              else {
                local_1c = 5;
              }
            }
            else {
              local_1c = 4;
            }
          }
          else {
            local_1c = 3;
          }
        }
        else {
          local_1c = 2;
        }
      }
      else {
        local_1c = 1;
      }
    }
    else {
      local_1c = 0;
    }
    local_40 = param_1;
    (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
    local_48 = (char *)puVar2[1];
    puVar3 = (uint *)FUN_00402298(0x10);
    if (puVar3 == (uint *)0x0) {
      local_44 = (uint *)0x0;
    }
    else {
      local_44 = FUN_00402460(puVar3,local_48);
    }
    local_44[3] = local_44[3] + 1;
    local_50 = FUN_004064fc(*(char **)(param_4 + 0x10),(char *)local_44[2]);
    puVar3 = (uint *)FUN_00402298(0x10);
    if (puVar3 == (uint *)0x0) {
      local_4c = (uint *)0x0;
    }
    else {
      local_4c = FUN_00402460(puVar3,local_50);
    }
    local_4c[3] = local_4c[3] + 1;
    piVar5 = (int *)FUN_00402298(0x20);
    if (piVar5 == (int *)0x0) {
      piVar5 = (int *)0x0;
    }
    else {
      piVar5 = FUN_00403e84(piVar5,(char *)local_4c[2],1);
    }
    if ((*(byte *)(piVar5 + 7) & 2) == 0) {
      iVar4 = piVar5[3];
    }
    else {
      iVar4 = piVar5[4];
    }
    if (iVar4 == 0) break;
    puVar6 = (undefined4 *)FUN_00402298(0x10);
    if (puVar6 == (undefined4 *)0x0) {
      local_6c = (int *)0x0;
    }
    else {
      local_6c = (int *)FUN_004023f4(puVar6);
    }
    local_6c[3] = local_6c[3] + 1;
    iVar4 = FUN_00404088((int)piVar5,(char *)param_3[2],s_Object_004e4f44,&local_70);
    if (iVar4 == 0) {
      FUN_00402a98((int *)&local_7c,(int *)&local_6c,&DAT_004e4f4b);
      piVar1 = local_7c + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_7c,3);
      }
    }
    else {
      FUN_00402a98((int *)&local_74,(int *)&local_6c,local_70);
      local_78 = local_74;
      piVar1 = local_74 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_74,3);
      }
    }
    FUN_004029b0(param_1,(int)local_6c);
    FUN_00403ecc(piVar5,3);
    puVar2 = (undefined4 *)*puVar2;
    piVar5 = local_6c + 3;
    *piVar5 = *piVar5 + -1;
    if (*piVar5 == 0) {
      FUN_004024d8(local_6c,3);
    }
    puVar3 = local_4c + 3;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_004024d8((int *)local_4c,3);
    }
    puVar3 = local_44 + 3;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_004024d8((int *)local_44,3);
    }
    puVar3 = local_14 + 3;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_004024d8((int *)local_14,3);
    }
  }
  local_54 = local_4c;
  local_58 = (char *)local_4c[2];
  FUN_004dbb24(&DAT_00524e20,local_58,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_is_empty_or_missing__004e4f2e,(char *)0x0);
  FUN_004d9c38(&DAT_00524e20);
  if (local_8 != (int *)0x0) {
    (**(code **)*local_8)(local_8,3);
  }
  FUN_00403ecc(piVar5,3);
  uVar8 = 0xffffffff;
  local_5c = local_4c;
  puVar3 = local_4c + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_4c,3);
  }
  local_60 = local_44;
  puVar3 = local_44 + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_44,3);
  }
  local_64 = local_14;
  puVar3 = local_14 + 3;
  *puVar3 = *puVar3 - 1;
  if (*puVar3 == 0) {
    FUN_004024d8((int *)local_14,3);
  }
  local_68 = param_3;
  piVar5 = param_3 + 3;
  *piVar5 = *piVar5 + -1;
  if (*piVar5 != 0) {
    return uVar8;
  }
  FUN_004024d8(param_3,3);
  return uVar8;
}



/* @004274f8 file=? name=FUN_004274f8 */

int __cdecl FUN_004274f8(int *param_1,int param_2)

{
  char *pcVar1;
  undefined4 *puVar2;
  int *piVar3;
  int iVar4;
  char *pcVar5;
  char *pcVar6;
  bool bVar7;
  int local_8;
  
  local_8 = -1;
  piVar3 = FUN_00404720(param_2,s_DamageZones_004e4f50,&DAT_004e4f5c);
  iVar4 = FUN_00403b60((int)piVar3);
  if (iVar4 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_No_dZones_listed_in_DamageZones_P_004e4f60,(char *)0x0);
    FUN_004d9c38(&DAT_00524e20);
    if (piVar3 != (int *)0x0) {
      (**(code **)*piVar3)(piVar3,3);
    }
    iVar4 = -1;
    piVar3 = param_1 + 3;
    *piVar3 = *piVar3 + -1;
    if (*piVar3 == 0) {
      FUN_004024d8(param_1,3);
    }
  }
  else {
    for (puVar2 = (undefined4 *)piVar3[1]; puVar2 != (undefined4 *)0x0;
        puVar2 = (undefined4 *)*puVar2) {
      pcVar5 = (char *)(puVar2 + 2);
      pcVar6 = (char *)param_1[2];
      do {
        if (*pcVar5 != *pcVar6) goto LAB_004275d8;
        bVar7 = true;
        if (*pcVar5 == '\0') break;
        pcVar1 = pcVar5 + 1;
        if (*pcVar1 != pcVar6[1]) goto LAB_004275d8;
        pcVar5 = pcVar5 + 2;
        pcVar6 = pcVar6 + 2;
        bVar7 = *pcVar1 == '\0';
      } while (!bVar7);
      if (bVar7) {
        FUN_00407ae0((char *)puVar2[1],&local_8);
        if (piVar3 != (int *)0x0) {
          (**(code **)*piVar3)(piVar3,3);
        }
        piVar3 = param_1 + 3;
        *piVar3 = *piVar3 + -1;
        if (*piVar3 != 0) {
          return local_8;
        }
        FUN_004024d8(param_1,3);
        return local_8;
      }
LAB_004275d8:
    }
    if (piVar3 != (int *)0x0) {
      (**(code **)*piVar3)(piVar3,3);
    }
    piVar3 = param_1 + 3;
    *piVar3 = *piVar3 + -1;
    iVar4 = local_8;
    if (*piVar3 == 0) {
      FUN_004024d8(param_1,3);
    }
  }
  return iVar4;
}



/* @0042760c file=? name=FUN_0042760c */

int __cdecl FUN_0042760c(int *param_1,int param_2)

{
  char cVar1;
  undefined4 *puVar2;
  int *piVar3;
  char *pcVar4;
  char *pcVar5;
  uint uVar6;
  uint uVar7;
  char *pcVar8;
  char *pcVar9;
  int iVar10;
  bool bVar11;
  char local_84 [128];
  
  iVar10 = -1;
  piVar3 = FUN_0040485c(param_2,(char *)0x0);
  puVar2 = (undefined4 *)piVar3[1];
joined_r0x0042762d:
  do {
    if (puVar2 == (undefined4 *)0x0) {
      if (piVar3 != (int *)0x0) {
        (**(code **)*piVar3)(piVar3,3);
      }
      iVar10 = -1;
      piVar3 = param_1 + 3;
      *piVar3 = *piVar3 + -1;
      if (*piVar3 == 0) {
        FUN_004024d8(param_1,3);
      }
      return iVar10;
    }
    uVar6 = 0xffffffff;
    pcVar5 = (char *)(puVar2 + 2);
    do {
      pcVar9 = pcVar5;
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      pcVar9 = pcVar5 + 1;
      cVar1 = *pcVar5;
      pcVar5 = pcVar9;
    } while (cVar1 != '\0');
    uVar6 = ~uVar6;
    pcVar5 = pcVar9 + -uVar6;
    pcVar9 = local_84;
    for (uVar7 = uVar6 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {
      *(undefined4 *)pcVar9 = *(undefined4 *)pcVar5;
      pcVar5 = pcVar5 + 4;
      pcVar9 = pcVar9 + 4;
    }
    pcVar8 = s_LAB_ONLY_004e4f85;
    pcVar4 = local_84;
    for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {
      *pcVar9 = *pcVar5;
      pcVar5 = pcVar5 + 1;
      pcVar9 = pcVar9 + 1;
    }
    do {
      bVar11 = *pcVar4 == *pcVar8;
      if (!bVar11) break;
      if (*pcVar4 == '\0') goto LAB_004276a8;
      pcVar5 = pcVar4 + 1;
      bVar11 = *pcVar5 == pcVar8[1];
      if (!bVar11) break;
      pcVar4 = pcVar4 + 2;
      pcVar8 = pcVar8 + 2;
      bVar11 = *pcVar5 == '\0';
    } while (!bVar11);
    if (bVar11) {
LAB_004276a8:
      puVar2 = (undefined4 *)*puVar2;
      goto joined_r0x0042762d;
    }
    pcVar5 = local_84;
    pcVar9 = s_DamageZones_004e4f8e;
    do {
      if (*pcVar5 != *pcVar9) goto LAB_004276af;
      bVar11 = true;
      if (*pcVar5 == '\0') break;
      pcVar4 = pcVar5 + 1;
      if (*pcVar4 != pcVar9[1]) goto LAB_004276af;
      pcVar5 = pcVar5 + 2;
      pcVar9 = pcVar9 + 2;
      bVar11 = *pcVar4 == '\0';
    } while (!bVar11);
    if (bVar11) goto LAB_004276a8;
LAB_004276af:
    iVar10 = iVar10 + 1;
    pcVar5 = local_84;
    pcVar9 = (char *)param_1[2];
    do {
      if (*pcVar5 != *pcVar9) goto LAB_004276fe;
      bVar11 = true;
      if (*pcVar5 == '\0') break;
      pcVar4 = pcVar5 + 1;
      if (*pcVar4 != pcVar9[1]) goto LAB_004276fe;
      pcVar5 = pcVar5 + 2;
      pcVar9 = pcVar9 + 2;
      bVar11 = *pcVar4 == '\0';
    } while (!bVar11);
    if (bVar11) {
      if (piVar3 != (int *)0x0) {
        (**(code **)*piVar3)(piVar3,3);
      }
      piVar3 = param_1 + 3;
      *piVar3 = *piVar3 + -1;
      if (*piVar3 != 0) {
        return iVar10;
      }
      FUN_004024d8(param_1,3);
      return iVar10;
    }
LAB_004276fe:
    puVar2 = (undefined4 *)*puVar2;
  } while( true );
}



/* @00427738 file=? name=FUN_00427738 */

int * __cdecl FUN_00427738(int param_1)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_00402298(0x328);
  if (piVar1 == (int *)0x0) {
    piVar1 = (int *)0x0;
  }
  else {
    piVar1 = FUN_00424e38(piVar1,param_1,&DAT_004e4b2c);
  }
  return piVar1;
}



/* @00427768 file=? name=FUN_00427768 */

undefined4 * __cdecl FUN_00427768(undefined4 *param_1,int param_2)

{
  undefined4 uVar1;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e4fb8;
  param_1[3] = 0;
  param_1[0x10] = param_2;
  uVar1 = FUN_00417ab4(param_2 + 0x31c);
  param_1[0xe] = uVar1;
  param_1[0x11] = 0;
  return param_1;
}



/* @004277a8 file=? name=FUN_004277a8 */

void __cdecl
FUN_004277a8(int param_1,int param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5)

{
  int *piVar1;
  undefined4 uVar2;
  uint uVar3;
  int iVar4;
  undefined4 *puVar5;
  int iVar6;
  int local_2c [7];
  int local_10;
  int local_c;
  int local_8;
  
  *(undefined4 *)(param_1 + 0x48) = param_3;
  *(undefined4 *)(param_1 + 0x4c) = param_4;
  *(undefined4 *)(param_1 + 0x50) = param_5;
  *(undefined4 *)(param_1 + 0x54) = 0;
  *(undefined4 *)(param_1 + 0x3c) = 0;
  if (*(int *)(param_1 + 0x44) != 0) {
    piVar1 = (int *)(*(int *)(param_1 + 0x44) + 4);
    *piVar1 = *piVar1 + -1;
  }
  iVar4 = FUN_00406fd4(*(int *)(DAT_004efc94 + 0x68),param_2);
  *(int *)(param_1 + 0x44) = iVar4;
  iVar6 = *(int *)(iVar4 + 4);
  *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 1;
  if (iVar6 == 0) {
    FUN_00406cd0(iVar4);
  }
  puVar5 = *(undefined4 **)(*(int *)(param_1 + 0x44) + 0x3c);
  *(undefined4 *)(param_1 + 0x14) = *puVar5;
  *(undefined4 *)(param_1 + 0x18) = puVar5[1];
  *(undefined4 **)(param_1 + 0x20) = puVar5 + 2;
  puVar5 = puVar5 + 3;
  *(undefined4 **)(param_1 + 0x1c) = puVar5;
  puVar5 = puVar5 + *(int *)(param_1 + 0x18);
  *(undefined4 **)(param_1 + 0x24) = puVar5;
  *(undefined4 **)(param_1 + 0x28) = puVar5 + *(int *)(param_1 + 0x14);
  *(undefined4 **)(param_1 + 0x2c) = puVar5 + *(int *)(param_1 + 0x14);
  local_8 = *(int *)(param_1 + 0x28);
  for (local_c = 0; local_c < *(int *)(param_1 + 0x14); local_c = local_c + 1) {
    for (iVar6 = 0; iVar6 < *(int *)(param_1 + 0x18); iVar6 = iVar6 + 1) {
      uVar2 = *(undefined4 *)(*(int *)(param_1 + 0x1c) + iVar6 * 4);
      FUN_0041d3b3(local_2c,*(int *)(param_1 + 0x38) + 0xe4);
      iVar4 = (**(code **)(local_2c[0] + 0x34))(local_2c,uVar2);
      FUN_0041d3d2(local_2c,2);
      uVar3 = *(uint *)(iVar4 + 0x10);
      if (uVar3 < 3) {
        local_8 = local_8 + 8;
      }
      else if (uVar3 == 4) {
        local_8 = local_8 + 0xc;
      }
      else if (uVar3 == 5) {
        local_8 = local_8 + 0x18;
      }
      local_10 = iVar4;
    }
  }
  *(int *)(param_1 + 0x34) = local_8;
  return;
}



/* @004278d4 file=? name=FUN_004278d4 */

void __cdecl FUN_004278d4(int *param_1,byte param_2)

{
  int *piVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4fb8;
    if (param_1[0x11] != 0) {
      piVar1 = (int *)(param_1[0x11] + 4);
      *piVar1 = *piVar1 + -1;
    }
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042790c file=? name=FUN_0042790c */

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

float10 __cdecl FUN_0042790c(int param_1,float param_2,int param_3)

{
  uint uVar1;
  int iVar2;
  float *pfVar3;
  int iVar4;
  int iVar5;
  float10 fVar6;
  float *pfVar7;
  float fVar8;
  float local_b0 [3];
  float local_a4 [3];
  float local_98 [3];
  int local_8c [7];
  int local_70 [7];
  float *local_54;
  float local_50;
  float local_4c;
  float local_48;
  float *local_44;
  undefined4 local_40;
  float local_3c;
  float *local_38;
  float local_34;
  float *local_30;
  float local_2c;
  float *local_28;
  float *local_24;
  float *local_20;
  float *local_1c;
  float *local_18;
  float *local_14;
  float local_10;
  float local_c;
  float *local_8;
  
  local_c = *(float *)(param_1 + 0x54) + param_2;
  local_10 = 0.0;
  local_8 = *(float **)(param_1 + 0x2c);
  while ((*(int *)(param_1 + 0x3c) < *(int *)(param_1 + 0x14) &&
         (*(float *)(*(int *)(param_1 + 0x24) + *(int *)(param_1 + 0x3c) * 4) <= local_c))) {
    for (iVar5 = 0; iVar5 < *(int *)(param_1 + 0x18); iVar5 = iVar5 + 1) {
      FUN_0041d3b3(local_70,*(int *)(param_1 + 0x38) + 0xe4);
      iVar2 = (**(code **)(local_70[0] + 0x34))(local_70);
      FUN_0041d3d2(local_70,2);
      uVar1 = *(uint *)(iVar2 + 0x10);
      if (uVar1 < 3) {
        local_20 = local_8;
        iVar4 = FUN_00408d78(*(int **)(iVar2 + 0xc),(int *)local_8,0.0001);
        if ((iVar4 == 0) && (param_3 != 0)) {
          FUN_0041cfc8(iVar2,(int *)local_8);
        }
        local_8 = local_8 + 2;
      }
      else if (uVar1 != 3) {
        if (uVar1 == 4) {
          local_24 = local_8;
          local_28 = (float *)FUN_0041cfa0(iVar2);
          iVar4 = FUN_004091f4(local_28,local_24,0.0001);
          if ((iVar4 == 0) && (param_3 != 0)) {
            FUN_0041d020(iVar2,local_8);
          }
          local_8 = local_8 + 3;
        }
        else if (uVar1 == 5) {
          local_14 = local_8;
          local_18 = (float *)FUN_0041cfa0(iVar2);
          iVar4 = FUN_004091f4(local_18,local_14,0.0001);
          if ((iVar4 == 0) && (param_3 != 0)) {
            FUN_0041d020(iVar2,local_8);
          }
          local_1c = local_8 + 3;
          local_8 = local_1c;
          iVar4 = FUN_004084fc(*(float **)(iVar2 + 0xc),local_1c,0.0001);
          if ((iVar4 == 0) && (param_3 != 0)) {
            FUN_0041d11c(iVar2,local_8);
          }
          local_8 = local_8 + 3;
        }
      }
    }
    iVar5 = *(int *)(param_1 + 0x3c);
    local_10 = (*(float *)(*(int *)(param_1 + 0x24) + iVar5 * 4) - *(float *)(param_1 + 0x54)) *
               *(float *)(*(int *)(param_1 + 0x34) + 8 + iVar5 * 0xc) + local_10;
    *(undefined4 *)(param_1 + 0x54) = *(undefined4 *)(*(int *)(param_1 + 0x24) + iVar5 * 4);
    *(int *)(param_1 + 0x3c) = *(int *)(param_1 + 0x3c) + 1;
  }
  if (*(int *)(param_1 + 0x14) == *(int *)(param_1 + 0x3c)) {
    fVar6 = (float10)(**(code **)(param_1 + 0x48))
                               (*(undefined4 *)(param_1 + 0x40),**(undefined4 **)(param_1 + 0x44),
                                local_c - *(float *)(*(int *)(param_1 + 0x24) + -4 +
                                                    *(int *)(param_1 + 0x14) * 4),param_3);
    local_10 = (float)(fVar6 + (float10)local_10);
  }
  else {
    *(float **)(param_1 + 0x2c) = local_8;
    local_2c = (local_c - *(float *)(param_1 + 0x54)) /
               (*(float *)(*(int *)(param_1 + 0x24) + *(int *)(param_1 + 0x3c) * 4) -
               *(float *)(param_1 + 0x54));
    for (iVar5 = 0; iVar5 < *(int *)(param_1 + 0x18); iVar5 = iVar5 + 1) {
      FUN_0041d3b3(local_8c,*(int *)(param_1 + 0x38) + 0xe4);
      iVar2 = (**(code **)(local_8c[0] + 0x34))(local_8c);
      FUN_0041d3d2(local_8c,2);
      uVar1 = *(uint *)(iVar2 + 0x10);
      if (uVar1 < 3) {
        FUN_00408dd4(&local_40,*(undefined4 **)(iVar2 + 0xc),(int)local_8,local_2c);
        local_44 = (float *)(*(int *)(iVar2 + 0xc) + 4);
        local_50 = *local_44;
        local_4c = local_3c;
        local_48 = local_50;
        fVar6 = FUN_004dcd00((double)(local_50 - local_3c));
        if (((float10)_DAT_00427d88 < fVar6) && (param_3 != 0)) {
          FUN_0041d0a8(iVar2,&local_3c);
        }
        local_8 = local_8 + 2;
      }
      else if (uVar1 != 3) {
        if (uVar1 == 4) {
          pfVar7 = local_8;
          fVar8 = local_2c;
          pfVar3 = (float *)FUN_0041cfa0(iVar2);
          FUN_00409390(local_b0,pfVar3,pfVar7,fVar8);
          local_54 = (float *)FUN_0041cfa0(iVar2);
          iVar4 = FUN_004091f4(local_54,local_b0,0.0001);
          if ((iVar4 == 0) && (param_3 != 0)) {
            FUN_0041d020(iVar2,local_b0);
          }
          local_8 = local_8 + 3;
        }
        else if (uVar1 == 5) {
          pfVar7 = local_8;
          fVar8 = local_2c;
          pfVar3 = (float *)FUN_0041cfa0(iVar2);
          FUN_00409390(local_a4,pfVar3,pfVar7,fVar8);
          local_30 = (float *)FUN_0041cfa0(iVar2);
          iVar4 = FUN_004091f4(local_30,local_a4,0.0001);
          if ((iVar4 == 0) && (param_3 != 0)) {
            FUN_0041d020(iVar2,local_a4);
          }
          local_8 = local_8 + 3;
          local_34 = local_2c;
          local_38 = *(float **)(iVar2 + 0xc);
          FUN_00408848(local_98,local_38,_DAT_00427d84 - local_2c,local_8,local_2c);
          iVar4 = FUN_004084fc(*(float **)(iVar2 + 0xc),local_98,0.0001);
          if ((iVar4 == 0) && (param_3 != 0)) {
            FUN_0041d11c(iVar2,local_98);
          }
          local_8 = local_8 + 3;
        }
      }
    }
    local_10 = (local_c - *(float *)(param_1 + 0x54)) *
               *(float *)(*(int *)(param_1 + 0x34) + 8 + *(int *)(param_1 + 0x3c) * 0xc) + local_10;
    *(float *)(param_1 + 0x54) = local_c;
  }
  return (float10)local_10;
}



/* @00427d92 file=? name=FUN_00427d92 */

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

bool FUN_00427d92(void)

{
  int iVar1;
  uint uVar2;
  bool bVar3;
  int iVar4;
  float *pfVar5;
  int iVar6;
  int unaff_EBP;
  int iVar7;
  float10 fVar8;
  float *pfVar9;
  float fVar10;
  
  iVar1 = *(int *)(unaff_EBP + 8);
  if (*(int *)(iVar1 + 0xc) == 0) {
    *(undefined4 *)(iVar1 + 0xc) = 1;
    *(undefined4 *)(iVar1 + 0x10) = *(undefined4 *)(unaff_EBP + 0x10);
  }
  *(float *)(unaff_EBP + -8) = *(float *)(unaff_EBP + 0xc) / *(float *)(iVar1 + 0x10);
  *(undefined4 *)(unaff_EBP + -4) = *(undefined4 *)(iVar1 + 0x2c);
  if (*(int *)(unaff_EBP + 0x14) != 0) {
    for (iVar7 = 0; iVar7 < *(int *)(iVar1 + 0x18); iVar7 = iVar7 + 1) {
      FUN_0041d3b3((undefined4 *)(unaff_EBP + -0x4c),*(int *)(iVar1 + 0x38) + 0xe4);
      iVar4 = (**(code **)(*(int *)(unaff_EBP + -0x4c) + 0x34))(unaff_EBP + -0x4c);
      FUN_0041d3d2((int *)(unaff_EBP + -0x4c),2);
      uVar2 = *(uint *)(iVar4 + 0x10);
      if (uVar2 < 3) {
        FUN_00408dd4((undefined4 *)(unaff_EBP + -0x1c),*(undefined4 **)(iVar4 + 0xc),
                     *(int *)(unaff_EBP + -4),*(float *)(unaff_EBP + -8));
        *(int *)(unaff_EBP + -0x20) = *(int *)(iVar4 + 0xc) + 4;
        *(undefined4 *)(unaff_EBP + -0x24) = **(undefined4 **)(unaff_EBP + -0x20);
        *(undefined4 *)(unaff_EBP + -0x28) = *(undefined4 *)(unaff_EBP + -0x18);
        *(undefined4 *)(unaff_EBP + -0x2c) = *(undefined4 *)(unaff_EBP + -0x24);
        fVar8 = FUN_004dcd00((double)(*(float *)(unaff_EBP + -0x2c) - *(float *)(unaff_EBP + -0x28))
                            );
        if ((float10)_DAT_00427fd4 < fVar8) {
          FUN_0041d0a8(iVar4,(float *)(unaff_EBP + -0x18));
        }
        *(int *)(unaff_EBP + -4) = *(int *)(unaff_EBP + -4) + 8;
      }
      else if (uVar2 != 3) {
        if (uVar2 == 4) {
          fVar10 = *(float *)(unaff_EBP + -8);
          pfVar9 = *(float **)(unaff_EBP + -4);
          pfVar5 = (float *)FUN_0041cfa0(iVar4);
          FUN_00409390((float *)(unaff_EBP + -0x70),pfVar5,pfVar9,fVar10);
          iVar6 = FUN_0041cfa0(iVar4);
          *(int *)(unaff_EBP + -0x30) = iVar6;
          iVar6 = FUN_004091f4(*(float **)(unaff_EBP + -0x30),(float *)(unaff_EBP + -0x70),0.0001);
          if (iVar6 == 0) {
            FUN_0041d020(iVar4,(float *)(unaff_EBP + -0x70));
          }
          *(int *)(unaff_EBP + -4) = *(int *)(unaff_EBP + -4) + 0xc;
        }
        else if (uVar2 == 5) {
          fVar10 = *(float *)(unaff_EBP + -8);
          pfVar9 = *(float **)(unaff_EBP + -4);
          pfVar5 = (float *)FUN_0041cfa0(iVar4);
          FUN_00409390((float *)(unaff_EBP + -100),pfVar5,pfVar9,fVar10);
          iVar6 = FUN_0041cfa0(iVar4);
          *(int *)(unaff_EBP + -0xc) = iVar6;
          iVar6 = FUN_004091f4(*(float **)(unaff_EBP + -0xc),(float *)(unaff_EBP + -100),0.0001);
          if (iVar6 == 0) {
            FUN_0041d020(iVar4,(float *)(unaff_EBP + -100));
          }
          *(int *)(unaff_EBP + -4) = *(int *)(unaff_EBP + -4) + 0xc;
          *(undefined4 *)(unaff_EBP + -0x10) = *(undefined4 *)(unaff_EBP + -8);
          *(undefined4 *)(unaff_EBP + -0x14) = *(undefined4 *)(iVar4 + 0xc);
          FUN_00408848((float *)(unaff_EBP + -0x58),*(float **)(unaff_EBP + -0x14),
                       _DAT_00427fd0 - *(float *)(unaff_EBP + -0x10),*(float **)(unaff_EBP + -4),
                       *(float *)(unaff_EBP + -0x10));
          iVar6 = FUN_004084fc(*(float **)(iVar4 + 0xc),(float *)(unaff_EBP + -0x58),0.0001);
          if (iVar6 == 0) {
            FUN_0041d11c(iVar4,(float *)(unaff_EBP + -0x58));
          }
          *(int *)(unaff_EBP + -4) = *(int *)(unaff_EBP + -4) + 0xc;
        }
      }
    }
  }
  *(float *)(iVar1 + 0x10) = *(float *)(iVar1 + 0x10) - *(float *)(unaff_EBP + 0xc);
  bVar3 = _DAT_00427fd8 < *(float *)(iVar1 + 0x10);
  if (!bVar3) {
    *(undefined4 *)(iVar1 + 0xc) = 0;
  }
  return bVar3;
}



/* @004283b8 file=? name=FUN_004283b8 */

void __cdecl FUN_004283b8(int param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  int iVar3;
  int local_68 [7];
  float local_4c [7];
  int local_30 [11];
  
  if (param_2 != 0) {
    local_30[10] = 0;
    local_30[9] = 0;
    local_30[8] = 0;
    local_4c[3] = 0.0;
    local_4c[4] = 0.0;
    local_4c[5] = 0.0;
    local_30[5] = 0;
    local_30[6] = 0;
    local_30[7] = 0;
    local_30[2] = 0x3f800000;
    local_30[3] = 0;
    local_30[4] = 0x3f800000;
    local_4c[6] = 2.0;
    local_30[0] = 0;
    local_30[1] = 0x40000000;
    local_4c[0] = 0.0;
    local_4c[1] = 0.0;
    local_4c[2] = 0.0;
    for (iVar3 = 0; iVar3 < *(int *)(param_1 + 0x18); iVar3 = iVar3 + 1) {
      uVar1 = *(undefined4 *)(*(int *)(param_1 + 0x1c) + iVar3 * 4);
      FUN_0041d3b3(local_68,*(int *)(param_1 + 0x38) + 0xe4);
      iVar2 = (**(code **)(local_68[0] + 0x34))(local_68,uVar1);
      FUN_0041d3d2(local_68,2);
      switch(*(undefined4 *)(iVar2 + 0x10)) {
      case 0:
        FUN_0041cfc8(iVar2,local_30 + 6);
        break;
      case 1:
        FUN_0041cfc8(iVar2,local_30 + 3);
        break;
      case 2:
        FUN_0041cfc8(iVar2,local_30);
        break;
      case 4:
        FUN_0041d020(iVar2,local_4c + 3);
        break;
      case 5:
        FUN_0041d020(iVar2,local_4c + 3);
        FUN_0041d11c(iVar2,local_4c);
      }
    }
  }
  return;
}



/* @00428508 file=? name=FUN_00428508 */

int __cdecl FUN_00428508(int param_1)

{
  undefined4 *puVar1;
  int *piVar2;
  int iVar3;
  
  piVar2 = FUN_0040485c(param_1,s_joint_004e4f9a);
  iVar3 = 0;
  for (puVar1 = (undefined4 *)piVar2[1]; puVar1 != (undefined4 *)0x0; puVar1 = (undefined4 *)*puVar1
      ) {
    iVar3 = iVar3 + 1;
  }
  if (piVar2 != (int *)0x0) {
    (**(code **)*piVar2)(piVar2,3);
  }
  return iVar3;
}



/* @00428544 file=? name=FUN_00428544 */

void __cdecl FUN_00428544(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e4afc);
  return;
}



/* @00428601 file=? name=FUN_00428601 */

undefined4 * __cdecl FUN_00428601(undefined4 *param_1,undefined4 param_2)

{
  FUN_004179d4(param_1,param_2);
  *param_1 = &PTR_FUN_004e4fb0;
  return param_1;
}



/* @00428620 file=? name=FUN_00428620 */

void __cdecl FUN_00428620(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e4fb0;
    FUN_004179f8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042864c file=? name=FUN_0042864c */

void __cdecl FUN_0042864c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e52e4;
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428678 file=munga/watcher.cpp name=FUN_00428678 */

undefined4 * __cdecl FUN_00428678(undefined4 *param_1,int *param_2,int param_3)

{
  int *piVar1;
  undefined4 *puVar2;
  int iVar3;
  uint *puVar4;
  int *local_10;
  uint *local_c;
  int *local_8;
  
  FUN_0041b868(param_1,param_2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004e52e4;
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    local_8 = (int *)0x0;
  }
  else {
    local_8 = (int *)FUN_004023f4(puVar2);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00402aec(param_2,(int *)&local_8);
  iVar3 = FUN_0041f98c(param_3,(char *)local_8[2]);
  param_1[4] = iVar3;
  if (iVar3 == 0) {
    puVar4 = (uint *)FUN_00402298(0x10);
    if (puVar4 == (uint *)0x0) {
      local_c = (uint *)0x0;
    }
    else {
      local_c = FUN_00402460(puVar4,s_Entity_004e4ffc);
    }
    local_c[3] = local_c[3] + 1;
    iVar3 = FUN_004027d8((int)local_8,(int)local_c);
    if (iVar3 != 0) {
      FUN_004dbb24(&DAT_00524e20,s_AttributeWatcher__AttributeWatch_004e5003,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,(char *)local_8[2],(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004e5033,(char *)0x0);
      FUN_0040385c(s_AttributeWatcher__AttributeWatch_004e5035,
                   s_d__tesla_bt_munga_WATCHER_CPP_004e506f,0x70);
    }
    puVar4 = local_c + 3;
    *puVar4 = *puVar4 - 1;
    if (*puVar4 == 0) {
      FUN_004024d8((int *)local_c,3);
    }
    param_1[4] = param_3;
  }
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    local_10 = (int *)0x0;
  }
  else {
    local_10 = (int *)FUN_004023f4(puVar2);
  }
  local_10[3] = local_10[3] + 1;
  FUN_00402aec(param_2,(int *)&local_10);
  iVar3 = FUN_0041bfc0(param_1[4],(char *)local_10[2]);
  param_1[5] = iVar3;
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_AttributeWatcher__AttributeWatch_004e508d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,(char *)local_10[2],(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e50bd,(char *)0x0);
    FUN_0040385c(s_AttributeWatcher__AttributeWatch_004e50bf,
                 s_d__tesla_bt_munga_WATCHER_CPP_004e50f9,0x8d);
  }
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 7,4);
  param_1[6] = 0;
  piVar1 = local_10 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_10,3);
  }
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  return param_1;
}



/* @0042887c file=munga/watcher.cpp name=FUN_0042887c */

void __cdecl FUN_0042887c(int *param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  char *pcVar3;
  undefined4 local_10;
  int *local_c;
  int *local_8;
  
  FUN_00414c58(param_1);
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    local_8 = (int *)0x0;
  }
  else {
    local_8 = (int *)FUN_004023f4(puVar2);
  }
  local_8[3] = local_8[3] + 1;
  pcVar3 = (char *)FUN_00403ad0(param_2,s_subsystem_004e5117);
  if (pcVar3 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e5121,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_subsystem_004e5146,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e5150,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e5152,
                 s_d__tesla_bt_munga_WATCHER_CPP_004e5192,0xad);
  }
  FUN_00402b3c(pcVar3,(int *)&local_8);
  FUN_004029b0(param_1,(int)local_8);
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    local_c = (int *)0x0;
  }
  else {
    local_c = (int *)FUN_004023f4(puVar2);
  }
  local_c[3] = local_c[3] + 1;
  pcVar3 = (char *)FUN_00403ad0(param_2,s_attribute_004e51b0);
  if (pcVar3 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e51ba,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_004e51df,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e51e9,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e51eb,
                 s_d__tesla_bt_munga_WATCHER_CPP_004e522b,0xae);
  }
  FUN_00402b3c(pcVar3,(int *)&local_c);
  FUN_004029b0(param_1,(int)local_c);
  piVar1 = local_c + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_c,3);
  }
  local_10 = 1;
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  return;
}



/* @00428a2c file=? name=FUN_00428a2c */

undefined4 __cdecl FUN_00428a2c(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00428a40 file=? name=FUN_00428a40 */

undefined4 __cdecl FUN_00428a40(int param_1)

{
  if (*(int *)(param_1 + 0x18) != 0) {
    *(undefined4 *)(param_1 + 0x18) = 0;
    return 1;
  }
  return 0;
}



/* @00428a5c file=munga/watcher.cpp name=FUN_00428a5c */

void FUN_00428a5c(void)

{
  FUN_0040385c(s_AttributeWatcher__SendNotificati_004e5249,s_d__tesla_bt_munga_WATCHER_CPP_004e528e,
               0xda);
  return;
}



/* @00428a78 file=? name=FUN_00428a78 */

undefined4 * __cdecl
FUN_00428a78(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e54a0;
  param_1[4] = param_3;
  FUN_00428cb4(param_1 + 7,0);
  FUN_00428cb4(param_1 + 0xc,0);
  FUN_00428cb4(param_1 + 0x11,0);
  param_1[3] = param_2;
  param_1[5] = param_4;
  param_1[6] = 0;
  return param_1;
}



/* @00428ad8 file=? name=FUN_00428ad8 */

void __cdecl FUN_00428ad8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e54a0;
    FUN_00428cd3(param_1 + 0x11,2);
    FUN_00428cd3(param_1 + 0xc,2);
    FUN_00428cd3(param_1 + 7,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428b30 file=? name=FUN_00428b30 */

undefined4 FUN_00428b30(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00428b44 file=munga/host.cpp name=FUN_00428b44 */

void __cdecl FUN_00428b44(int param_1,int param_2)

{
  uint uVar1;
  
  (**(code **)(*(int *)(param_1 + 0x1c) + 4))(param_1 + 0x1c,param_2);
  uVar1 = *(uint *)(param_2 + 0x28) & 0xc;
  if (uVar1 != 0) {
    if (uVar1 == 4) {
      if ((*(byte *)(param_2 + 0x29) & 1) == 0) {
        return;
      }
      (**(code **)(*(int *)(param_1 + 0x44) + 4))(param_1 + 0x44,param_2);
      return;
    }
    if ((uVar1 != 8) && (uVar1 != 0xc)) {
      FUN_0040385c(s_Host__AddEntity___Should_never_r_004e5300,s_d__tesla_bt_munga_HOST_CPP_004e532a
                   ,0x77);
      return;
    }
  }
  if ((*(byte *)(param_2 + 0x29) & 1) != 0) {
    (**(code **)(*(int *)(param_1 + 0x30) + 4))(param_1 + 0x30,param_2);
  }
  return;
}



/* @00428bc4 file=? name=FUN_00428bc4 */

undefined4 * __cdecl FUN_00428bc4(undefined4 *param_1,int param_2)

{
  FUN_00428cff(param_1,param_2 + 0x1c);
  *param_1 = &PTR_FUN_004e544c;
  return param_1;
}



/* @00428be8 file=? name=FUN_00428be8 */

void __cdecl FUN_00428be8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e544c;
    FUN_00428d5c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428c14 file=? name=FUN_00428c14 */

undefined4 * __cdecl FUN_00428c14(undefined4 *param_1,int param_2)

{
  FUN_00428cff(param_1,param_2 + 0x30);
  *param_1 = &PTR_FUN_004e53f8;
  return param_1;
}



/* @00428c38 file=? name=FUN_00428c38 */

void __cdecl FUN_00428c38(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e53f8;
    FUN_00428d5c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428c64 file=? name=FUN_00428c64 */

undefined4 * __cdecl FUN_00428c64(undefined4 *param_1,int param_2)

{
  FUN_00428cff(param_1,param_2 + 0x44);
  *param_1 = &PTR_FUN_004e53a4;
  return param_1;
}



/* @00428c88 file=? name=FUN_00428c88 */

void __cdecl FUN_00428c88(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e53a4;
    FUN_00428d5c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428cb4 file=? name=FUN_00428cb4 */

undefined4 * __cdecl FUN_00428cb4(undefined4 *param_1,undefined4 param_2)

{
  FUN_0041827c(param_1,param_2);
  *param_1 = &PTR_FUN_004e539c;
  return param_1;
}



/* @00428cd3 file=? name=FUN_00428cd3 */

void __cdecl FUN_00428cd3(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e539c;
    FUN_004182a8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428cff file=? name=FUN_00428cff */

undefined4 * __cdecl FUN_00428cff(undefined4 *param_1,int param_2)

{
  FUN_00418398(param_1,param_2);
  *param_1 = &PTR_FUN_004e5348;
  return param_1;
}



/* @00428d1e file=? name=FUN_00428d1e */

undefined4 * __cdecl FUN_00428d1e(undefined4 *param_1,int param_2)

{
  FUN_00418398(param_1,param_2);
  *param_1 = &PTR_FUN_004e5348;
  return param_1;
}



/* @00428d3d file=? name=FUN_00428d3d */

undefined4 * __cdecl FUN_00428d3d(undefined4 *param_1,int param_2)

{
  FUN_004183c0(param_1,param_2);
  *param_1 = &PTR_FUN_004e5348;
  return param_1;
}



/* @00428d5c file=? name=FUN_00428d5c */

void __cdecl FUN_00428d5c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5348;
    FUN_004183ec(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428d88 file=? name=FUN_00428d88 */

undefined4 * __cdecl FUN_00428d88(undefined4 *param_1)

{
  FUN_0041d520(param_1,0x16,&DAT_004e54ac,2);
  *param_1 = &PTR_FUN_004e592c;
  FUN_004294c1(param_1 + 6,0,1);
  FUN_004294c1(param_1 + 0xc,0,1);
  FUN_00420e8c(param_1 + 0x13);
  FUN_004295d5(param_1 + 0x15,500,0,1);
  param_1[5] = 0;
  param_1[0x12] = 0;
  return param_1;
}



/* @00428df8 file=? name=FUN_00428df8 */

void __cdecl FUN_00428df8(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e592c;
    puVar1 = (undefined4 *)param_1[0x12];
    if (puVar1 != (undefined4 *)0x0) {
      if (puVar1 != (undefined4 *)0x0) {
        (**(code **)*puVar1)(puVar1,3);
      }
      param_1[0x12] = 0;
    }
    FUN_004295fc(param_1 + 0x15,2);
    FUN_004294e4(param_1 + 0xc,2);
    FUN_004294e4(param_1 + 6,2);
    FUN_0041d554(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00428e68 file=? name=FUN_00428e68 */

undefined4 __cdecl FUN_00428e68(int param_1)

{
  int iVar1;
  
  iVar1 = FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e54b4);
  if (iVar1 == 0) {
    return 0;
  }
  return 1;
}



/* @00428ea0 file=? name=FUN_00428ea0 */

void __cdecl FUN_00428ea0(int param_1)

{
  int local_18 [5];
  
  if (*(int *)(param_1 + 0x14) != 0) {
    FUN_00428bc4(local_18,*(int *)(param_1 + 0x14));
    FUN_00417858(local_18,local_18,1);
    FUN_00428be8(local_18,2);
  }
  return;
}



/* @00428ee0 file=? name=FUN_00428ee0 */

void __cdecl FUN_00428ee0(int param_1,int param_2)

{
  undefined4 local_10;
  undefined4 local_c [2];
  
  *(int *)(param_1 + 0x14) = param_2;
  FUN_00420ebc(local_c,*(undefined4 *)(param_2 + 0xc));
  FUN_00420ef4((undefined4 *)(param_1 + 0x4c),local_c);
  local_10 = *(undefined4 *)(param_2 + 0xc);
  (**(code **)(*(int *)(param_1 + 0x30) + 8))(param_1 + 0x30,param_2,&local_10);
  return;
}



/* @00428f34 file=? name=FUN_00428f34 */

int __cdecl FUN_00428f34(int param_1)

{
  int iVar1;
  int local_14 [4];
  
  iVar1 = *(int *)(param_1 + 0x14);
  *(undefined4 *)(param_1 + 0x14) = 0;
  FUN_00420ef4((undefined4 *)(param_1 + 0x4c),(undefined4 *)&DAT_00522524);
  if (iVar1 != 0) {
    FUN_00415f30(local_14,iVar1,0xffffffff);
    FUN_004161fc((int)local_14,param_1 + 0x30);
    FUN_00415f90(local_14,2);
  }
  return iVar1;
}



/* @00428f94 file=? name=FUN_00428f94 */

void __cdecl FUN_00428f94(int param_1,int param_2)

{
  undefined4 local_c;
  undefined4 local_8;
  
  local_8 = *(undefined4 *)(param_2 + 0xc);
  (**(code **)(*(int *)(param_1 + 0x18) + 8))(param_1 + 0x18,param_2,&local_8);
  local_c = *(undefined4 *)(param_2 + 0xc);
  (**(code **)(*(int *)(param_1 + 0x30) + 8))(param_1 + 0x30,param_2,&local_c);
  return;
}



/* @00428fdc file=? name=FUN_00428fdc */

void __cdecl FUN_00428fdc(int param_1,int param_2)

{
  int local_24 [4];
  int local_14 [4];
  
  FUN_00415f30(local_14,param_2,0xffffffff);
  FUN_004161fc((int)local_14,param_1 + 0x18);
  FUN_00415f90(local_14,2);
  FUN_00415f30(local_24,param_2,0xffffffff);
  FUN_004161fc((int)local_24,param_1 + 0x30);
  FUN_00415f90(local_24,2);
  return;
}



/* @0042904c file=? name=FUN_0042904c */

undefined4 __cdecl FUN_0042904c(int param_1)

{
  return *(undefined4 *)(*(int *)(param_1 + 0x14) + 0xc);
}



/* @0042905c file=? name=FUN_0042905c */

void __cdecl FUN_0042905c(int param_1)

{
  (**(code **)(*(int *)(param_1 + 0x18) + 0xc))(param_1 + 0x18,&stack0x00000008);
  return;
}



/* @00429078 file=? name=FUN_00429078 */

int __cdecl FUN_00429078(int param_1)

{
  int iVar1;
  int local_20 [7];
  
  FUN_0042956b(local_20,param_1 + 0x18);
  do {
    iVar1 = (**(code **)(local_20[0] + 0x28))(local_20);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_004295a9(local_20,2);
      return iVar1;
    }
  } while (*(int *)(iVar1 + 0x10) != 3);
  FUN_004295a9(local_20,2);
  return iVar1;
}



/* @004290d8 file=? name=FUN_004290d8 */

int __cdecl FUN_004290d8(int param_1,int param_2)

{
  int iVar1;
  int local_20 [7];
  
  FUN_0042956b(local_20,param_1 + 0x30);
  do {
    iVar1 = (**(code **)(local_20[0] + 0x28))(local_20);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_004295a9(local_20,2);
      return iVar1;
    }
  } while (param_2 != *(int *)(iVar1 + 0x14));
  FUN_004295a9(local_20,2);
  return iVar1;
}



/* @0042913c file=? name=FUN_0042913c */

undefined4 * __cdecl FUN_0042913c(undefined4 *param_1,int param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00420f6c(param_2 + 0x4c,1);
  FUN_00420ea4(param_1,puVar1);
  return param_1;
}



/* @00429168 file=? name=FUN_00429168 */

void __cdecl FUN_00429168(int param_1,int param_2,int param_3)

{
  FUN_00428b44(*(int *)(param_1 + 0x14),param_2);
  (**(code **)(*(int *)(param_1 + 0x54) + 8))(param_1 + 0x54,param_2,param_2 + 0x184);
  FUN_00434a60(*(int **)(DAT_004efc94 + 0x30),param_2,param_3);
  return;
}



/* @004291b4 file=munga/hostmgr.cpp name=FUN_004291b4 */

void FUN_004291b4(void)

{
  FUN_0040385c(s_HostManager__NotifyOfReplacement_004e5586,s_d__tesla_bt_munga_HOSTMGR_CPP_004e55ca,
               0x1ce);
  return;
}



/* @004291d0 file=? name=FUN_004291d0 */

void __cdecl FUN_004291d0(undefined4 param_1,int param_2)

{
  FUN_00434cdc(*(int *)(DAT_004efc94 + 0x30),param_2);
  return;
}



/* @004291ec file=? name=FUN_004291ec */

undefined4 __cdecl FUN_004291ec(int param_1)

{
  bool bVar1;
  undefined4 *puVar2;
  int iVar3;
  
  if (*(int *)(param_1 + 0x48) == 0) {
    puVar2 = (undefined4 *)FUN_00402298(0x1c);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar2 = FUN_0042956b(puVar2,param_1 + 0x30);
    }
    *(undefined4 **)(param_1 + 0x48) = puVar2;
  }
  bVar1 = false;
  do {
    iVar3 = (**(code **)(**(int **)(param_1 + 0x48) + 0x30))(*(int **)(param_1 + 0x48));
    if (iVar3 == 0) {
      (**(code **)(**(int **)(param_1 + 0x48) + 4))(*(int **)(param_1 + 0x48));
      iVar3 = (**(code **)(**(int **)(param_1 + 0x48) + 0x30))(*(int **)(param_1 + 0x48));
    }
    if (*(int *)(iVar3 + 0x10) == 0) {
      bVar1 = true;
    }
    else {
      (**(code **)(**(int **)(param_1 + 0x48) + 0xc))(*(int **)(param_1 + 0x48));
    }
  } while (!bVar1);
  (**(code **)(**(int **)(param_1 + 0x48) + 0xc))(*(int **)(param_1 + 0x48));
  return *(undefined4 *)(iVar3 + 0xc);
}



/* @00429274 file=munga/hostmgr.cpp name=FUN_00429274 */

void FUN_00429274(void)

{
  FUN_0040385c(s_HostManager__EntityTransferOwner_004e55e8,s_d__tesla_bt_munga_HOSTMGR_CPP_004e5629,
               0x270);
  return;
}



/* @00429290 file=munga/hostmgr.cpp name=FUN_00429290 */

void FUN_00429290(void)

{
  FUN_0040385c(s_HostManager__EntityNewOwnershipH_004e5647,s_d__tesla_bt_munga_HOSTMGR_CPP_004e5683,
               0x290);
  return;
}



/* @004292ac file=? name=FUN_004292ac */

undefined4 * __cdecl FUN_004292ac(undefined4 *param_1,int param_2)

{
  FUN_00428bc4(param_1,*(int *)(param_2 + 0x14));
  *param_1 = &PTR_FUN_004e58d8;
  return param_1;
}



/* @004292d0 file=? name=FUN_004292d0 */

void __cdecl FUN_004292d0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e58d8;
    FUN_00428be8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004292fc file=? name=FUN_004292fc */

undefined4 * __cdecl FUN_004292fc(undefined4 *param_1,int param_2)

{
  FUN_00428c14(param_1,*(int *)(param_2 + 0x14));
  *param_1 = &PTR_FUN_004e5884;
  return param_1;
}



/* @00429320 file=? name=FUN_00429320 */

void __cdecl FUN_00429320(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5884;
    FUN_00428c38(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042934c file=? name=FUN_0042934c */

undefined4 * __cdecl FUN_0042934c(undefined4 *param_1,int param_2)

{
  FUN_00428c64(param_1,*(int *)(param_2 + 0x14));
  *param_1 = &PTR_FUN_004e5830;
  return param_1;
}



/* @00429370 file=? name=FUN_00429370 */

void __cdecl FUN_00429370(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5830;
    FUN_00428c88(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042939c file=? name=FUN_0042939c */

undefined4 * __cdecl FUN_0042939c(undefined4 *param_1,int param_2)

{
  FUN_0042956b(param_1,param_2 + 0x18);
  *param_1 = &PTR_FUN_004e57d4;
  return param_1;
}



/* @004293c0 file=? name=FUN_004293c0 */

void __cdecl FUN_004293c0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e57d4;
    FUN_004295a9(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004293ec file=? name=FUN_004293ec */

undefined4 * __cdecl FUN_004293ec(undefined4 *param_1,int param_2)

{
  FUN_0042956b(param_1,param_2 + 0x30);
  *param_1 = &PTR_FUN_004e5778;
  return param_1;
}



/* @00429410 file=? name=FUN_00429410 */

void __cdecl FUN_00429410(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5778;
    FUN_004295a9(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004294c1 file=? name=FUN_004294c1 */

undefined4 * __cdecl FUN_004294c1(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_00419184(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e575c;
  return param_1;
}



/* @004294e4 file=? name=FUN_004294e4 */

void __cdecl FUN_004294e4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e575c;
    FUN_004191b4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00429510 file=? name=FUN_00429510 */

undefined4 __cdecl FUN_00429510(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *(int *)(param_2 + 0x14)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*(int *)(param_2 + 0x14) <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @0042953f file=? name=FUN_0042953f */

undefined4 __cdecl FUN_0042953f(undefined4 param_1,int *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *param_2) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*param_2 <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @0042956b file=? name=FUN_0042956b */

undefined4 * __cdecl FUN_0042956b(undefined4 *param_1,int param_2)

{
  FUN_004194d8(param_1,param_2);
  *param_1 = &PTR_FUN_004e5700;
  return param_1;
}



/* @0042958a file=? name=FUN_0042958a */

undefined4 * __cdecl FUN_0042958a(undefined4 *param_1,int param_2)

{
  FUN_004194d8(param_1,param_2);
  *param_1 = &PTR_FUN_004e5700;
  return param_1;
}



/* @004295a9 file=? name=FUN_004295a9 */

void __cdecl FUN_004295a9(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5700;
    FUN_0041951c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004295d5 file=? name=FUN_004295d5 */

undefined4 * __cdecl
FUN_004295d5(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  FUN_00419774(param_1,param_2,param_3,param_4);
  *param_1 = &PTR_FUN_004e56e8;
  return param_1;
}



/* @004295fc file=? name=FUN_004295fc */

void __cdecl FUN_004295fc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e56e8;
    FUN_004197d4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00429628 file=? name=FUN_00429628 */

undefined4 * __cdecl FUN_00429628(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0042973b();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00429671(puVar1,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 0xc));
  }
  return puVar1;
}



/* @00429657 file=? name=FUN_00429657 */

int __cdecl FUN_00429657(int param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_00421094(param_2);
  return iVar1 % *(int *)(param_1 + 0x14);
}



/* @00429671 file=? name=FUN_00429671 */

undefined4 * __cdecl FUN_00429671(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_004186ac(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e56cc;
  return param_1;
}



/* @00429694 file=? name=FUN_00429694 */

void __cdecl FUN_00429694(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e56cc;
    FUN_004186dc(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_0042978b(param_1);
    }
  }
  return;
}



/* @004296c0 file=? name=FUN_004296c0 */

undefined4 __cdecl FUN_004296c0(undefined4 param_1,int param_2,int param_3)

{
  bool bVar1;
  int iVar2;
  undefined4 uVar3;
  undefined3 extraout_var;
  
  iVar2 = FUN_0042104c((int *)(param_2 + 0x1c),(int *)(param_3 + 0x1c));
  if (iVar2 == 0) {
    bVar1 = FUN_00420fec((int *)(param_2 + 0x1c),(int *)(param_3 + 0x1c));
    if (CONCAT31(extraout_var,bVar1) == 0) {
      uVar3 = 0xffffffff;
    }
    else {
      uVar3 = 1;
    }
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}



/* @004296ff file=? name=FUN_004296ff */

undefined4 __cdecl FUN_004296ff(undefined4 param_1,int *param_2,int param_3)

{
  bool bVar1;
  int iVar2;
  undefined4 uVar3;
  undefined3 extraout_var;
  
  iVar2 = FUN_0042104c(param_2,(int *)(param_3 + 0x1c));
  if (iVar2 == 0) {
    bVar1 = FUN_00420fec(param_2,(int *)(param_3 + 0x1c));
    if (CONCAT31(extraout_var,bVar1) == 0) {
      uVar3 = 0xffffffff;
    }
    else {
      uVar3 = 1;
    }
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}



/* @0042973b file=? name=FUN_0042973b */

void FUN_0042973b(void)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004e56c8;
  DAT_004e56c8 = DAT_004e56c8 + 1;
  puVar2 = DAT_004e56c4;
  if ((iVar1 == 0) && (puVar2 = (undefined4 *)FUN_00402298(0x28), puVar2 != (undefined4 *)0x0)) {
    FUN_00402b98(puVar2,0x18,100,100,s_VChainOf_004e56a1);
  }
  DAT_004e56c4 = puVar2;
  FUN_00402f74((int)DAT_004e56c4);
  return;
}



/* @0042978b file=? name=FUN_0042978b */

void __cdecl FUN_0042978b(undefined4 *param_1)

{
  FUN_00402f98((int)DAT_004e56c4,param_1);
  DAT_004e56c8 = DAT_004e56c8 + -1;
  if (DAT_004e56c8 == 0) {
    if (DAT_004e56c4 != (int *)0x0) {
      FUN_00402c28(DAT_004e56c4,0);
      FUN_004022d0(DAT_004e56c4);
    }
    DAT_004e56c4 = (int *)0x0;
  }
  return;
}



/* @004297d6 file=? name=FUN_004297d6 */

undefined4 * __cdecl FUN_004297d6(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0042989e();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00429836(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @00429806 file=? name=FUN_00429806 */

undefined4 * __cdecl FUN_00429806(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0041d485();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041d42e(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @00429836 file=? name=FUN_00429836 */

undefined4 * __cdecl
FUN_00429836(undefined4 *param_1,undefined4 param_2,int param_3,undefined4 *param_4)

{
  FUN_004185bc(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e594c;
  FUN_00420e8c(param_1 + 7);
  FUN_00420ef4(param_1 + 7,param_4);
  return param_1;
}



/* @00429872 file=? name=FUN_00429872 */

void __cdecl FUN_00429872(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e594c;
    FUN_004185ec(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004298ee(param_1);
    }
  }
  return;
}



/* @0042989e file=? name=FUN_0042989e */

void FUN_0042989e(void)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004e5948;
  DAT_004e5948 = DAT_004e5948 + 1;
  puVar2 = DAT_004e5944;
  if ((iVar1 == 0) && (puVar2 = (undefined4 *)FUN_00402298(0x28), puVar2 != (undefined4 *)0x0)) {
    FUN_00402b98(puVar2,0x24,100,100,s_VChainLinkOf_004e56b7);
  }
  DAT_004e5944 = puVar2;
  FUN_00402f74((int)DAT_004e5944);
  return;
}



/* @004298ee file=? name=FUN_004298ee */

void __cdecl FUN_004298ee(undefined4 *param_1)

{
  FUN_00402f98((int)DAT_004e5944,param_1);
  DAT_004e5948 = DAT_004e5948 + -1;
  if (DAT_004e5948 == 0) {
    if (DAT_004e5944 != (int *)0x0) {
      FUN_00402c28(DAT_004e5944,0);
      FUN_004022d0(DAT_004e5944);
    }
    DAT_004e5944 = (int *)0x0;
  }
  return;
}



/* @0042995c file=? name=FUN_0042995c */

void __cdecl
FUN_0042995c(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  *param_1 = 0x18;
  param_1[1] = 1;
  param_1[2] = 1;
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = param_4;
  return;
}



/* @0042998c file=? name=FUN_0042998c */

void __cdecl FUN_0042998c(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  *param_1 = 0x14;
  param_1[1] = 7;
  param_1[2] = 1;
  param_1[3] = param_2;
  param_1[4] = param_3;
  return;
}



/* @004299b4 file=? name=FUN_004299b4 */

void __cdecl FUN_004299b4(undefined4 *param_1,undefined4 param_2)

{
  *param_1 = 0x10;
  param_1[1] = 0xb;
  param_1[2] = 1;
  param_1[3] = param_2;
  return;
}



/* @004299d8 file=? name=FUN_004299d8 */

void __cdecl
FUN_004299d8(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5)

{
  *param_1 = 0x1c;
  param_1[1] = 0xe;
  param_1[2] = 1;
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = param_4;
  param_1[6] = param_5;
  return;
}



/* @00429a0c file=? name=FUN_00429a0c */

undefined4 * __cdecl FUN_00429a0c(undefined4 *param_1,int *param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  int iVar3;
  int *local_8;
  
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e5ac8;
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    iVar3 = 0;
  }
  else {
    iVar3 = FUN_004023f4(puVar2);
  }
  param_1[9] = iVar3;
  piVar1 = (int *)(param_1[9] + 0xc);
  *piVar1 = *piVar1 + 1;
  param_1[4] = 0;
  param_1[3] = 0;
  param_1[6] = 0;
  param_1[5] = 0;
  param_1[7] = 0;
  param_1[8] = 0;
  FUN_00402a4c((int *)&local_8,param_1 + 9,param_2);
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  param_1[10] = 0;
  return param_1;
}



/* @00429a9c file=? name=FUN_00429a9c */

undefined4 * __cdecl FUN_00429a9c(undefined4 *param_1,int *param_2,int *param_3)

{
  int *piVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  int *local_8;
  
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e5ac8;
  puVar3 = (undefined4 *)FUN_00402298(0x10);
  if (puVar3 == (undefined4 *)0x0) {
    iVar4 = 0;
  }
  else {
    iVar4 = FUN_004023f4(puVar3);
  }
  param_1[9] = iVar4;
  piVar1 = (int *)(param_1[9] + 0xc);
  *piVar1 = *piVar1 + 1;
  FUN_00402a4c((int *)&local_8,param_1 + 9,param_2);
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  iVar4 = FUN_00406ff8(*(int *)(DAT_004efc94 + 0x68),*(char **)(*param_3 + 8),0xf,-1);
  if (iVar4 == 0) {
    param_1[4] = 0;
    param_1[3] = 0;
    param_1[6] = 0;
    param_1[5] = 0;
    param_1[7] = 0;
    param_1[8] = 0;
    param_1[10] = 0;
  }
  else {
    iVar2 = *(int *)(iVar4 + 4);
    *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 1;
    if (iVar2 == 0) {
      FUN_00406cd0(iVar4);
    }
    puVar3 = *(undefined4 **)(iVar4 + 0x3c);
    param_1[7] = *puVar3;
    param_1[8] = puVar3[1];
    param_1[10] = puVar3[6];
    param_1[4] = puVar3[2];
    param_1[3] = puVar3[3];
    param_1[6] = puVar3[4];
    param_1[5] = puVar3[5];
    *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + -1;
  }
  return param_1;
}



/* @00429b94 file=? name=FUN_00429b94 */

float10 __cdecl FUN_00429b94(int param_1,float *param_2)

{
  return -((float10)*param_2 * (float10)*(float *)(param_1 + 0x10));
}



/* @00429ba8 file=? name=FUN_00429ba8 */

void __cdecl FUN_00429ba8(int *param_1,byte param_2)

{
  int *piVar1;
  int *piVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5ac8;
    piVar2 = (int *)param_1[9];
    piVar1 = piVar2 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(piVar2,3);
    }
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00429bec file=? name=FUN_00429bec */

undefined4 __cdecl
FUN_00429bec(int param_1,char *param_2,int param_3,undefined4 param_4,float *param_5)

{
  bool bVar1;
  float *pfVar2;
  int iVar3;
  undefined3 extraout_var;
  undefined4 *puVar4;
  
  pfVar2 = param_5;
  if (param_5 == (float *)0x0) {
    pfVar2 = (float *)FUN_00402298(0x1c);
  }
  iVar3 = FUN_00404118(param_3,s_gamedata_004e5950,s_KillBonus_004e5959,pfVar2);
  if (iVar3 == 0) {
    FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_Missing_KillBonus_004e5963,(char *)0x0);
    FUN_004d9c38((int *)&DAT_00524e68);
  }
  else {
    iVar3 = FUN_00404118(param_3,s_gamedata_004e5975,s_SpecialCaseDeathPenalty_004e597e,pfVar2 + 1);
    if (iVar3 == 0) {
      FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
      FUN_004dbb24((int *)&DAT_00524e68,s_Missing_SpecialCaseDeathPenalty_004e5996,(char *)0x0);
      FUN_004d9c38((int *)&DAT_00524e68);
    }
    else {
      iVar3 = FUN_00404118(param_3,s_gamedata_004e59b6,s_DamageReceivedModifier_004e59bf,pfVar2 + 2)
      ;
      if (iVar3 == 0) {
        FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
        FUN_004dbb24((int *)&DAT_00524e68,s_Missing_DamageReceivedModifier_004e59d6,(char *)0x0);
        FUN_004d9c38((int *)&DAT_00524e68);
      }
      else {
        iVar3 = FUN_00404118(param_3,s_gamedata_004e59f5,s_DamageInflictedModifier_004e59fe,
                             pfVar2 + 3);
        if (iVar3 == 0) {
          FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
          FUN_004dbb24((int *)&DAT_00524e68,s_Missing_DamageInflictedModifier_004e5a16,(char *)0x0);
          FUN_004d9c38((int *)&DAT_00524e68);
        }
        else {
          bVar1 = FUN_004040d8(param_3,s_gamedata_004e5a36,s_ReturnFromDeath_004e5a3f,
                               (int *)(pfVar2 + 6));
          if (CONCAT31(extraout_var,bVar1) == 0) {
            FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
            FUN_004dbb24((int *)&DAT_00524e68,s_Missing_ReturnFromDeath_004e5a4f,(char *)0x0);
            FUN_004d9c38((int *)&DAT_00524e68);
          }
          else {
            iVar3 = FUN_00404118(param_3,s_gamedata_004e5a67,s_DamageBias_004e5a70,pfVar2 + 4);
            if (iVar3 == 0) {
              FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
              FUN_004dbb24((int *)&DAT_00524e68,s_Missing_DamageBias_004e5a7b,(char *)0x0);
              FUN_004d9c38((int *)&DAT_00524e68);
            }
            else {
              iVar3 = FUN_00404118(param_3,s_gamedata_004e5a8e,s_FriendlyFirePenalty_004e5a97,
                                   pfVar2 + 5);
              if (iVar3 != 0) {
                if (param_5 == (float *)0x0) {
                  puVar4 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,pfVar2,0x1c,-1);
                  FUN_004022d0((int *)pfVar2);
                  return *puVar4;
                }
                return 0;
              }
              FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
              FUN_004dbb24((int *)&DAT_00524e68,s_Missing_FriendlyFirePenalty_004e5aab,(char *)0x0);
              FUN_004d9c38((int *)&DAT_00524e68);
            }
          }
        }
      }
    }
  }
  if (param_5 == (float *)0x0) {
    FUN_004022d0((int *)pfVar2);
  }
  return 0xffffffff;
}



/* @00429e80 file=? name=FUN_00429e80 */

void __cdecl FUN_00429e80(int param_1,int param_2)

{
  *(float *)(param_1 + 0x204) = *(float *)(param_2 + 0x1c) + *(float *)(param_1 + 0x204);
  return;
}



/* @00429e9c file=? name=FUN_00429e9c */

void FUN_00429e9c(void)

{
  return;
}



/* @00429ea4 file=? name=FUN_00429ea4 */

undefined4 * __cdecl FUN_00429ea4(undefined4 *param_1,int param_2,undefined4 param_3)

{
  char cVar1;
  undefined4 *puVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  
  FUN_0041ff38(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e5bb8;
  uVar3 = 0xffffffff;
  pcVar5 = (char *)(param_2 + 0x4c);
  do {
    pcVar6 = pcVar5;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar6 = pcVar5 + 1;
    cVar1 = *pcVar5;
    pcVar5 = pcVar6;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar6 + -uVar3;
  pcVar6 = (char *)(param_1 + 0x71);
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar6 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar6 = pcVar6 + 1;
  }
  param_1[0x81] = (float)*(int *)(param_2 + 0x8c);
  puVar2 = FUN_004212b0(*(int *)(DAT_004efc94 + 0x24),s_Teams_004e5b7a);
  (**(code **)(puVar2[4] + 4))(puVar2 + 4,param_1);
  param_1[10] = param_1[10] | 0x10;
  return param_1;
}



/* @00429f30 file=? name=FUN_00429f30 */

void __cdecl FUN_00429f30(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5bb8;
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00429f5c file=? name=FUN_00429f5c */

undefined4 * __cdecl FUN_00429f5c(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x208);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00429ea4(puVar1,param_1,&DAT_004e5b04);
  }
  return puVar1;
}



/* @00429f8c file=? name=FUN_00429f8c */

undefined4 __cdecl FUN_00429f8c(undefined4 *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  uint uVar5;
  uint uVar6;
  char *pcVar7;
  
  iVar2 = FUN_00420234(param_1);
  if (iVar2 == 0) {
    uVar3 = 0;
  }
  else {
    *param_1 = 0x90;
    param_1[7] = 0x58;
    param_1[0xb] = 0xa00;
    param_1[0x13] = s_DEFUALT_004e5b80._0_4_;
    param_1[0x14] = s_DEFUALT_004e5b80._4_4_;
    pcVar4 = FUN_004d4d1c((char *)0x0,&DAT_004e5b88);
    if (pcVar4 == (char *)0x0) {
      FUN_004dbb24((int *)&DAT_00524e68,s_InitialScore_missing__004e5b8a,(char *)0x0);
      uVar3 = 0;
    }
    else {
      iVar2 = FUN_004dd1e0(pcVar4);
      param_1[0x23] = iVar2;
      pcVar4 = FUN_004d4d1c((char *)0x0,&DAT_004e5ba1);
      if (pcVar4 == (char *)0x0) {
        FUN_004dbb24((int *)&DAT_00524e68,s_teamName_missing__004e5ba3,(char *)0x0);
        uVar3 = 0;
      }
      else {
        uVar5 = 0xffffffff;
        do {
          pcVar7 = pcVar4;
          if (uVar5 == 0) break;
          uVar5 = uVar5 - 1;
          pcVar7 = pcVar4 + 1;
          cVar1 = *pcVar4;
          pcVar4 = pcVar7;
        } while (cVar1 != '\0');
        uVar5 = ~uVar5;
        pcVar4 = pcVar7 + -uVar5;
        pcVar7 = (char *)(param_1 + 0x13);
        for (uVar6 = uVar5 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {
          *(undefined4 *)pcVar7 = *(undefined4 *)pcVar4;
          pcVar4 = pcVar4 + 4;
          pcVar7 = pcVar7 + 4;
        }
        uVar3 = 1;
        for (uVar5 = uVar5 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
          *pcVar7 = *pcVar4;
          pcVar4 = pcVar4 + 1;
          pcVar7 = pcVar7 + 1;
        }
      }
    }
  }
  return uVar3;
}



/* @0042a06c file=? name=FUN_0042a06c */

void __cdecl FUN_0042a06c(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e5ad4);
  return;
}



/* @0042a150 file=? name=FUN_0042a150 */

void __cdecl FUN_0042a150(int param_1,undefined4 *param_2,undefined4 *param_3,undefined4 *param_4)

{
  undefined4 uVar1;
  int *piVar2;
  int iVar3;
  uint *puVar4;
  uint local_88 [5];
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68 [2];
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c [2];
  undefined4 local_34 [2];
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  int local_c;
  undefined4 local_8;
  
  local_2c = DAT_004e0fec;
  local_28 = DAT_004e0ff0;
  local_24 = DAT_004e0ff4;
  local_20 = DAT_004e0ff8;
  local_1c = DAT_004e0ffc;
  local_18 = DAT_004e1000;
  local_14 = DAT_004e1004;
  FUN_00408440(&local_2c,param_4);
  local_8 = *(undefined4 *)(param_1 + 0x14);
  local_88[0] = 0x5c;
  local_88[1] = 3;
  local_88[2] = 1;
  FUN_00420ea4(local_88 + 3,(undefined4 *)&DAT_00522524);
  local_74 = 0;
  local_70 = 0;
  local_6c = 0x31;
  FUN_00420ea4(local_68,(undefined4 *)&DAT_00522524);
  local_60 = local_8;
  local_5c = 0x100;
  local_58 = local_2c;
  local_54 = local_28;
  local_50 = local_24;
  local_4c = local_20;
  local_48 = local_1c;
  local_44 = local_18;
  local_40 = local_14;
  FUN_00420ea4(local_3c,param_2);
  FUN_00420ea4(local_34,param_3);
  piVar2 = (int *)FUN_00414b60();
  local_c = *piVar2;
  local_10 = *(undefined4 *)(param_1 + 0x18);
  iVar3 = FUN_004dcd94();
  local_c = local_c + iVar3;
  uVar1 = *(undefined4 *)(DAT_004efc94 + 0x28);
  puVar4 = (uint *)FUN_004336f0(local_88);
  FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),3,uVar1,puVar4,local_c);
  FUN_004022d0((int *)puVar4);
  return;
}



/* @0042a2c8 file=? name=FUN_0042a2c8 */

undefined4 * __cdecl FUN_0042a2c8(undefined4 *param_1,int *param_2)

{
  int *piVar1;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e5d74;
  piVar1 = (int *)(**(code **)(*param_2 + 0x1c))(param_2,param_1 + 3,4);
  piVar1 = (int *)(**(code **)(*piVar1 + 0x1c))(piVar1,param_1 + 5,4);
  (**(code **)(*piVar1 + 0x1c))(piVar1,param_1 + 4,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 6,4);
  return param_1;
}



/* @0042a334 file=? name=FUN_0042a334 */

void __cdecl FUN_0042a334(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5d74;
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042a360 file=? name=FUN_0042a360 */

/* WARNING: Type propagation algorithm not settling */

undefined4 __cdecl FUN_0042a360(int param_1,int *param_2,int param_3,int *param_4,int *param_5)

{
  int *piVar1;
  char *pcVar2;
  int iVar3;
  char *pcVar4;
  char *pcVar5;
  bool bVar6;
  undefined4 uVar7;
  float local_18 [2];
  char *local_10;
  char *local_c;
  float local_8;
  
  iVar3 = FUN_00404118(param_3,(char *)param_4[2],s_DamageLevel_004e5bf0,&local_8);
  if (iVar3 == 0) {
    local_8 = -1.0;
  }
  (**(code **)(*param_5 + 0x20))(param_5,&local_8,4);
  iVar3 = FUN_00404088(param_3,(char *)param_4[2],s_ExplosionModelFile_004e5bfc,&local_c);
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,(char *)param_2[2],(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e5c0f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,(char *)param_4[2],(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_ExplosionModelFile__004e5c13,(char *)0x0);
    FUN_004d9c38(&DAT_00524e20);
    uVar7 = 0;
    piVar1 = param_2 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(param_2,3);
    }
    piVar1 = param_4 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(param_4,3);
    }
  }
  else {
    iVar3 = FUN_00406ff8(param_1,local_c,1,-1);
    if (iVar3 == 0) {
      FUN_004dbb24(&DAT_00524e20,(char *)param_2[2],(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_cannot_find_004e5c30,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,local_c,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_in_resource_file__004e5c3e,(char *)0x0);
      uVar7 = 0;
      piVar1 = param_2 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(param_2,3);
      }
      piVar1 = param_4 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(param_4,3);
      }
    }
    else {
      (**(code **)(*param_5 + 0x20))(param_5,iVar3,4);
      iVar3 = FUN_00404088(param_3,(char *)param_4[2],s_GraphicState_004e5c52,&local_10);
      if (iVar3 == 0) {
        local_18[1] = 0.0;
      }
      else {
        pcVar5 = s_Destroyed_004e5c5f;
        pcVar4 = local_10;
        do {
          if (*pcVar4 != *pcVar5) goto LAB_0042a548;
          bVar6 = true;
          if (*pcVar4 == '\0') break;
          pcVar2 = pcVar4 + 1;
          if (*pcVar2 != pcVar5[1]) goto LAB_0042a548;
          pcVar4 = pcVar4 + 2;
          pcVar5 = pcVar5 + 2;
          bVar6 = *pcVar2 == '\0';
        } while (!bVar6);
        if (bVar6) {
          local_18[1] = 1.4013e-45;
        }
        else {
LAB_0042a548:
          pcVar4 = &DAT_004e5c69;
          do {
            if (*local_10 != *pcVar4) goto LAB_0042a57c;
            bVar6 = true;
            if (*local_10 == '\0') break;
            pcVar5 = local_10 + 1;
            if (*pcVar5 != pcVar4[1]) goto LAB_0042a57c;
            local_10 = local_10 + 2;
            pcVar4 = pcVar4 + 2;
            bVar6 = *pcVar5 == '\0';
          } while (!bVar6);
          if (bVar6) {
            local_18[1] = 2.8026e-45;
          }
        }
      }
LAB_0042a57c:
      (**(code **)(*param_5 + 0x20))(param_5,local_18 + 1,4);
      iVar3 = FUN_00404118(param_3,(char *)param_4[2],s_TimeDelay_004e5c6e,local_18);
      if (iVar3 == 0) {
        local_18[0] = 0.0;
      }
      (**(code **)(*param_5 + 0x20))(param_5,local_18,4);
      uVar7 = 1;
      piVar1 = param_2 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(param_2,3);
      }
      piVar1 = param_4 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(param_4,3);
      }
    }
  }
  return uVar7;
}



/* @0042a5f4 file=? name=FUN_0042a5f4 */

undefined4 __cdecl FUN_0042a5f4(int param_1,float param_2,float param_3)

{
  int iVar1;
  undefined4 uVar2;
  int local_20 [7];
  
  FUN_0041f261(local_20,param_1);
  do {
    iVar1 = (**(code **)(local_20[0] + 0x28))(local_20);
    if (iVar1 == 0) {
      uVar2 = 0;
      FUN_0041f29f(local_20,2);
      return uVar2;
    }
  } while ((*(float *)(iVar1 + 0xc) <= param_2) || (param_3 < *(float *)(iVar1 + 0xc)));
  uVar2 = 1;
  FUN_0041f29f(local_20,2);
  return uVar2;
}



/* @0042a664 file=? name=FUN_0042a664 */

int __cdecl FUN_0042a664(int param_1,float param_2)

{
  int iVar1;
  int local_20 [7];
  
  FUN_0041f261(local_20,param_1);
  do {
    iVar1 = (**(code **)(local_20[0] + 0x28))(local_20);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_0041f29f(local_20,2);
      return iVar1;
    }
  } while (*(float *)(iVar1 + 0xc) <= param_2);
  FUN_0041f29f(local_20,2);
  return iVar1;
}



/* @0042a6c4 file=? name=FUN_0042a6c4 */

int __cdecl FUN_0042a6c4(int param_1,int param_2)

{
  int iVar1;
  int local_20 [7];
  
  FUN_0041f261(local_20,param_1);
  do {
    iVar1 = (**(code **)(local_20[0] + 0x28))(local_20);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_0041f29f(local_20,2);
      return iVar1;
    }
  } while (param_2 != *(int *)(iVar1 + 0x10));
  FUN_0041f29f(local_20,2);
  return iVar1;
}



/* @0042a728 file=? name=FUN_0042a728 */

void __cdecl FUN_0042a728(undefined4 param_1,int param_2,undefined4 *param_3,undefined4 *param_4)

{
  FUN_0042a150(param_2,param_3,param_4,(undefined4 *)&stack0x00000014);
  return;
}



/* @0042a748 file=? name=FUN_0042a748 */

int * __cdecl FUN_0042a748(int *param_1,int *param_2)

{
  undefined4 *puVar1;
  int local_c;
  int local_8;
  
  FUN_0042ab72(param_1,0,1);
  *param_1 = (int)&PTR_FUN_004e5d58;
  (**(code **)(*param_2 + 0x1c))(param_2,&local_8,4);
  local_c = 0;
  if (0 < local_8) {
    do {
      puVar1 = (undefined4 *)FUN_00402298(0x1c);
      if (puVar1 == (undefined4 *)0x0) {
        puVar1 = (undefined4 *)0x0;
      }
      else {
        puVar1 = FUN_0042a2c8(puVar1,param_2);
      }
      (**(code **)(*param_1 + 8))(param_1,puVar1,&local_c);
      local_c = local_c + 1;
    } while (local_c < local_8);
  }
  return param_1;
}



/* @0042a7cc file=? name=FUN_0042a7cc */

void __cdecl FUN_0042a7cc(int *param_1,byte param_2)

{
  void *this;
  int local_20 [7];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5d58;
    FUN_0041f261(local_20,(int)param_1);
    FUN_00417858(this,local_20,1);
    FUN_0041f29f(local_20,2);
    FUN_0042ab95(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042a828 file=? name=FUN_0042a828 */

undefined4 __cdecl FUN_0042a828(int param_1,int *param_2,uint param_3,int *param_4,int *param_5)

{
  undefined4 *puVar1;
  int iVar2;
  uint *puVar3;
  undefined8 uVar4;
  undefined4 uVar5;
  int *piVar6;
  int local_c;
  int *local_8;
  
  local_8 = FUN_0040485c(param_3,(char *)0x0);
  iVar2 = FUN_00403b60((int)local_8);
  if (iVar2 == 0) {
    uVar4 = FUN_004dbd4c(&DAT_00524e20,param_3);
    FUN_004dbb24((int *)uVar4,s_is_empty_or_missing_004e5c78,(char *)0x0);
    FUN_004d9c38((int *)uVar4);
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
    uVar5 = 0;
    piVar6 = param_2 + 3;
    *piVar6 = *piVar6 + -1;
    if (*piVar6 == 0) {
      FUN_004024d8(param_2,3);
    }
    piVar6 = param_4 + 3;
    *piVar6 = *piVar6 + -1;
    if (*piVar6 == 0) {
      FUN_004024d8(param_4,3);
    }
  }
  else {
    local_c = FUN_00403b60((int)local_8);
    (**(code **)(*param_5 + 0x20))(param_5,&local_c,4);
    for (puVar1 = (undefined4 *)local_8[1]; puVar1 != (undefined4 *)0x0;
        puVar1 = (undefined4 *)*puVar1) {
      piVar6 = param_5;
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        puVar3 = (uint *)0x0;
      }
      else {
        puVar3 = FUN_00402460(puVar3,(char *)(puVar1 + 2));
      }
      puVar3[3] = puVar3[3] + 1;
      param_4[3] = param_4[3] + 1;
      FUN_0042a360(param_1,param_4,param_3,(int *)puVar3,piVar6);
    }
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
    uVar5 = 1;
    piVar6 = param_2 + 3;
    *piVar6 = *piVar6 + -1;
    if (*piVar6 == 0) {
      FUN_004024d8(param_2,3);
    }
    piVar6 = param_4 + 3;
    *piVar6 = *piVar6 + -1;
    if (*piVar6 == 0) {
      FUN_004024d8(param_4,3);
    }
  }
  return uVar5;
}



/* @0042a984 file=? name=FUN_0042a984 */

undefined4 * __cdecl FUN_0042a984(undefined4 *param_1,int param_2)

{
  undefined4 uVar1;
  int iVar2;
  
  FUN_0041b838(param_1,3,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004e5d40;
  param_1[5] = param_2;
  (**(code **)(*(int *)(param_2 + 0xbc) + 4))(param_2 + 0xbc,param_1);
  uVar1 = FUN_004022b0(*(int *)(param_1[5] + 0x11c) << 2);
  param_1[4] = uVar1;
  for (iVar2 = 0; iVar2 < *(int *)(param_1[5] + 0x11c); iVar2 = iVar2 + 1) {
    *(undefined4 *)(param_1[4] + iVar2 * 4) = 0;
  }
  return param_1;
}



/* @0042a9f4 file=? name=FUN_0042a9f4 */

void __cdecl FUN_0042a9f4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5d40;
    FUN_004022e8((int *)param_1[4]);
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042aa2c file=? name=FUN_0042aa2c */

void __cdecl FUN_0042aa2c(int param_1)

{
  ushort *puVar1;
  int iVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  uint local_2c [7];
  int *local_10;
  int local_c;
  int local_8;
  
  for (iVar5 = 0; local_c = 0, iVar5 < *(int *)(*(int *)(param_1 + 0x14) + 0x11c); iVar5 = iVar5 + 1
      ) {
    iVar2 = *(int *)(*(int *)(*(int *)(param_1 + 0x14) + 0x120) + iVar5 * 4);
    local_8 = *(int *)(iVar2 + 0xd4);
    if ((*(uint *)(iVar2 + 0xb8) & 4) != 0) {
      local_c = FUN_0042a664(local_8,*(float *)(iVar2 + 0x158));
      iVar3 = FUN_0042a5f4(local_8,*(float *)(*(int *)(param_1 + 0x10) + iVar5 * 4),
                           *(float *)(iVar2 + 0x158));
      if ((iVar3 != 0) && ((*(uint *)(*(int *)(param_1 + 0x14) + 0x28) & 0xc) == 0)) {
        puVar1 = (ushort *)(*(int *)(param_1 + 0x14) + 0x18);
        *puVar1 = *puVar1 | 2;
      }
      *(undefined4 *)(*(int *)(param_1 + 0x10) + iVar5 * 4) = *(undefined4 *)(iVar2 + 0x158);
    }
    if ((*(uint *)(iVar2 + 0xb8) & 8) != 0) {
      local_c = FUN_0042a6c4(local_8,*(int *)(iVar2 + 0x78));
      if ((*(uint *)(*(int *)(param_1 + 0x14) + 0x28) & 0xc) == 0) {
        puVar1 = (ushort *)(*(int *)(param_1 + 0x14) + 0x18);
        *puVar1 = *puVar1 | 2;
      }
    }
    if (local_c != 0) {
      local_10 = *(int **)(param_1 + 0x14);
      FUN_0043663c(local_2c,(int)local_10,iVar2,*(undefined4 *)(local_c + 0x14));
      FUN_004364e4(*(int *)(DAT_004efc94 + 0x38),local_10,local_2c);
      uVar4 = *(uint *)(*(int *)(param_1 + 0x14) + 0x28) & 0xc;
      if (((uVar4 == 0) && ((*(byte *)(*(int *)(param_1 + 0x14) + 0x18) & 2) == 0)) || (uVar4 == 4))
      {
        *(undefined4 *)(iVar2 + 0xb8) = 0;
      }
    }
  }
  return;
}



/* @0042ab68 file=? name=FUN_0042ab68 */

undefined4 FUN_0042ab68(void)

{
  return 1;
}



/* @0042ab72 file=? name=FUN_0042ab72 */

undefined4 * __cdecl FUN_0042ab72(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_00419184(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e5d24;
  return param_1;
}



/* @0042ab95 file=? name=FUN_0042ab95 */

void __cdecl FUN_0042ab95(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5d24;
    FUN_004191b4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042abc1 file=? name=FUN_0042abc1 */

undefined4 __cdecl FUN_0042abc1(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *(int *)(param_2 + 0x14)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*(int *)(param_2 + 0x14) <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @0042abf0 file=? name=FUN_0042abf0 */

undefined4 __cdecl FUN_0042abf0(undefined4 param_1,int *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(int *)(param_3 + 0x14) == *param_2) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
    if (*param_2 <= *(int *)(param_3 + 0x14)) {
      uVar1 = 0xffffffff;
    }
  }
  return uVar1;
}



/* @0042ac1c file=? name=FUN_0042ac1c */

undefined4 * __cdecl FUN_0042ac1c(undefined4 *param_1,int param_2)

{
  FUN_00417d00(param_1,param_2);
  *param_1 = &PTR_FUN_004e5cd4;
  return param_1;
}



/* @0042ac3b file=? name=FUN_0042ac3b */

undefined4 * __cdecl FUN_0042ac3b(undefined4 *param_1,int param_2)

{
  FUN_00417d00(param_1,param_2);
  *param_1 = &PTR_FUN_004e5cd4;
  return param_1;
}



/* @0042ac5a file=? name=FUN_0042ac5a */

undefined4 * __cdecl FUN_0042ac5a(undefined4 *param_1,int param_2)

{
  FUN_00417d28(param_1,param_2);
  *param_1 = &PTR_FUN_004e5cd4;
  return param_1;
}



/* @0042ac79 file=? name=FUN_0042ac79 */

void __cdecl FUN_0042ac79(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e5cd4;
    FUN_00417d54(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042aca5 file=? name=FUN_0042aca5 */

undefined4 * __cdecl FUN_0042aca5(undefined4 param_1,int param_2,undefined4 *param_3)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0041d485();
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041d42e(puVar1,param_1,param_2,param_3);
  }
  return puVar1;
}



/* @0042acd8 file=? name=FUN_0042acd8 */

undefined4 * __cdecl
FUN_0042acd8(undefined4 *param_1,undefined4 param_2,undefined4 *param_3,undefined4 param_4)

{
  int *piVar1;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e61a0;
  piVar1 = FUN_004de998(param_1 + 3,4,4,1,FUN_0042ba46);
  FUN_0040aadc(param_1 + 0xe);
  param_1[0x1c] = s_camera_004e5d78._0_4_;
  *(undefined2 *)(param_1 + 0x1d) = s_camera_004e5d78._4_2_;
  *(char *)((int)param_1 + 0x76) = s_camera_004e5d78[6];
  FUN_004dd3ec((uint)piVar1,(char *)((int)param_1 + 0x76),10);
  param_1[0x1b] = piVar1;
  param_1[0x1a] = param_4;
  FUN_0042b3ac((int)param_1,param_3);
  return param_1;
}



/* @0042ad54 file=? name=FUN_0042ad54 */

undefined4 * __cdecl FUN_0042ad54(undefined4 *param_1,int param_2)

{
  int iVar1;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e61a0;
  FUN_004de998(param_1 + 3,4,4,1,FUN_0042ba46);
  FUN_0040aadc(param_1 + 0xe);
  param_1[0x1b] = *(undefined4 *)(param_2 + 8);
  FUN_0040a938(param_1 + 7,(undefined4 *)(param_2 + 0xc));
  FUN_0040ab44((float *)(param_1 + 0xe),param_1 + 7);
  param_1[0x1a] = *(undefined4 *)(param_2 + 4);
  iVar1 = 0;
  do {
    param_1[iVar1 + 3] = *(undefined4 *)(iVar1 * 4 + param_2 + 0x28);
    iVar1 = iVar1 + 1;
  } while (iVar1 < 4);
  param_1[0x1c] = s_camera_004e5d7f._0_4_;
  *(undefined2 *)(param_1 + 0x1d) = s_camera_004e5d7f._4_2_;
  *(char *)((int)param_1 + 0x76) = s_camera_004e5d7f[6];
  FUN_004dd3ec(param_1[0x1b],(char *)((int)param_1 + 0x76),10);
  return param_1;
}



/* @0042ae14 file=munga/caminst.cpp name=FUN_0042ae14 */

undefined4 * __cdecl FUN_0042ae14(undefined4 *param_1,undefined4 param_2,char *param_3)

{
  char cVar1;
  bool bVar2;
  int iVar3;
  undefined4 uVar4;
  undefined3 extraout_var;
  uint uVar5;
  uint uVar6;
  char *pcVar7;
  int *piVar8;
  char *pcVar9;
  char *local_10;
  float *local_c;
  undefined4 *local_8;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e61a0;
  piVar8 = FUN_004de998(param_1 + 3,4,4,1,FUN_0042ba46);
  local_8 = param_1 + 0xe;
  FUN_0040aadc(local_8);
  uVar5 = 0xffffffff;
  pcVar7 = param_3;
  do {
    pcVar9 = pcVar7;
    if (uVar5 == 0) break;
    uVar5 = uVar5 - 1;
    pcVar9 = pcVar7 + 1;
    cVar1 = *pcVar7;
    pcVar7 = pcVar9;
  } while (cVar1 != '\0');
  uVar5 = ~uVar5;
  pcVar7 = pcVar9 + -uVar5;
  pcVar9 = (char *)(param_1 + 0x1c);
  for (uVar6 = uVar5 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {
    *(undefined4 *)pcVar9 = *(undefined4 *)pcVar7;
    pcVar7 = pcVar7 + 4;
    pcVar9 = pcVar9 + 4;
  }
  for (uVar5 = uVar5 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
    *pcVar9 = *pcVar7;
    pcVar7 = pcVar7 + 1;
    pcVar9 = pcVar9 + 1;
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_tranx_004e5d86,(float *)(param_1 + 7));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_tranx__004e5d8c,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5d9d,s_d__tesla_bt_munga_CAMINST_CPP_004e5daa,0x69);
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_trany_004e5dc8,(float *)(param_1 + 8));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_trany__004e5dce,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5ddf,s_d__tesla_bt_munga_CAMINST_CPP_004e5dec,0x6a);
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_tranz_004e5e0a,(float *)(param_1 + 9));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_tranz__004e5e10,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5e21,s_d__tesla_bt_munga_CAMINST_CPP_004e5e2e,0x6b);
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_quatx_004e5e4c,(float *)(param_1 + 10));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_quatx__004e5e52,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5e63,s_d__tesla_bt_munga_CAMINST_CPP_004e5e70,0x72);
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_quaty_004e5e8e,(float *)(param_1 + 0xb));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_quaty__004e5e94,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5ea5,s_d__tesla_bt_munga_CAMINST_CPP_004e5eb2,0x73);
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_quatz_004e5ed0,(float *)(param_1 + 0xc));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_quatz__004e5ed6,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5ee7,s_d__tesla_bt_munga_CAMINST_CPP_004e5ef4,0x74);
  }
  iVar3 = FUN_00404118((int)piVar8,param_3,s_quatw_004e5f12,(float *)(param_1 + 0xd));
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_quatw__004e5f18,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5f29,s_d__tesla_bt_munga_CAMINST_CPP_004e5f36,0x75);
  }
  local_c = (float *)(param_1 + 0xe);
  FUN_0040ab44(local_c,param_1 + 7);
  param_1[3] = 0xc0490fdb;
  FUN_00404118((int)piVar8,param_3,s_minYawClamp_004e5f54,(float *)(param_1 + 3));
  param_1[4] = 0x40490fdb;
  FUN_00404118((int)piVar8,param_3,s_maxYawClamp_004e5f60,(float *)(param_1 + 4));
  param_1[5] = 0xbfc90fdb;
  FUN_00404118((int)piVar8,param_3,s_minPitchClamp_004e5f6c,(float *)(param_1 + 5));
  param_1[6] = 0x3fc90fdb;
  FUN_00404118((int)piVar8,param_3,s_maxPitchClamp_004e5f7a,(float *)(param_1 + 6));
  iVar3 = FUN_00404088((int)piVar8,param_3,s_cameraType_004e5f88,&local_10);
  if (iVar3 == 0) {
    param_1[0x1a] = 1;
  }
  else {
    uVar4 = FUN_0042b1fc(local_10);
    param_1[0x1a] = uVar4;
  }
  bVar2 = FUN_004040d8((int)piVar8,param_3,s_cameraID_004e5f93,param_1 + 0x1b);
  if (CONCAT31(extraout_var,bVar2) == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_cameraID__004e5f9c,(char *)0x0);
    FUN_0040385c(s_Bad_cameras__004e5fb0,s_d__tesla_bt_munga_CAMINST_CPP_004e5fbd,0xaa);
  }
  return param_1;
}



/* @0042b1d0 file=? name=FUN_0042b1d0 */

void __cdecl FUN_0042b1d0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e61a0;
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042b1fc file=? name=FUN_0042b1fc */

undefined4 __cdecl FUN_0042b1fc(char *param_1)

{
  char *pcVar1;
  char *pcVar2;
  char *pcVar3;
  bool bVar4;
  
  pcVar2 = s_DefaultCameraType_004e5fdb;
  pcVar3 = param_1;
  do {
    if (*pcVar2 != *pcVar3) goto LAB_0042b230;
    bVar4 = true;
    if (*pcVar2 == '\0') break;
    pcVar1 = pcVar2 + 1;
    if (*pcVar1 != pcVar3[1]) goto LAB_0042b230;
    pcVar2 = pcVar2 + 2;
    pcVar3 = pcVar3 + 2;
    bVar4 = *pcVar1 == '\0';
  } while (!bVar4);
  if (bVar4) {
    return 1;
  }
LAB_0042b230:
  pcVar3 = s_AlwaysSeesCameraType_004e5fed;
  do {
    if (*pcVar3 != *param_1) {
      return 0;
    }
    bVar4 = true;
    if (*pcVar3 == '\0') break;
    pcVar2 = pcVar3 + 1;
    if (*pcVar2 != param_1[1]) {
      return 0;
    }
    pcVar3 = pcVar3 + 2;
    param_1 = param_1 + 2;
    bVar4 = *pcVar2 == '\0';
  } while (!bVar4);
  if (!bVar4) {
    return 0;
  }
  return 2;
}



/* @0042b264 file=? name=FUN_0042b264 */

undefined4 * __cdecl FUN_0042b264(int param_1,undefined4 *param_2)

{
  undefined4 *puVar1;
  int iVar2;
  char *pcVar3;
  char *pcVar4;
  
  if (*(int *)(param_1 + 0x68) == 1) {
    pcVar3 = s_DefaultCameraType_004e6002;
    puVar1 = param_2;
    for (iVar2 = 4; iVar2 != 0; iVar2 = iVar2 + -1) {
      *puVar1 = *(undefined4 *)pcVar3;
      pcVar3 = pcVar3 + 4;
      puVar1 = puVar1 + 1;
    }
    *(undefined2 *)puVar1 = *(undefined2 *)pcVar3;
    puVar1 = param_2;
  }
  else {
    puVar1 = (undefined4 *)(*(int *)(param_1 + 0x68) + -2);
    if (puVar1 == (undefined4 *)0x0) {
      pcVar3 = s_AlwaysSeesCameraType_004e6014;
      pcVar4 = (char *)param_2;
      for (iVar2 = 5; iVar2 != 0; iVar2 = iVar2 + -1) {
        *(undefined4 *)pcVar4 = *(undefined4 *)pcVar3;
        pcVar3 = pcVar3 + 4;
        pcVar4 = pcVar4 + 4;
      }
      *pcVar4 = *pcVar3;
      puVar1 = param_2;
    }
  }
  return puVar1;
}



/* @0042b2a8 file=? name=FUN_0042b2a8 */

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

void __cdecl FUN_0042b2a8(int param_1,float *param_2,float *param_3)

{
  float10 fVar1;
  float local_20;
  float local_1c;
  float local_18;
  float local_10;
  float local_c;
  float local_8;
  
  FUN_00408bf8(&local_20,param_3,(float *)(param_1 + 0x38));
  local_8 = local_18 * local_18 + local_1c * local_1c + local_20 * local_20;
  fVar1 = FUN_004dcd00((double)local_8);
  if ((float10)_DAT_0042b3a8 < fVar1) {
    fVar1 = FUN_004dc8ec((double)-local_20,SUB84((double)-local_18,0),
                         (uint)((ulonglong)(double)-local_18 >> 0x20));
    fVar1 = FUN_00408110((float)fVar1);
    local_c = (float)fVar1;
    *param_2 = local_c;
    fVar1 = FUN_004dd138((double)(local_18 * local_18 + local_20 * local_20));
    local_10 = (float)fVar1;
    fVar1 = FUN_004dc8ec((double)local_1c,SUB84((double)local_10,0),
                         (uint)((ulonglong)(double)local_10 >> 0x20));
    fVar1 = FUN_00408110((float)fVar1);
    param_2[1] = (float)fVar1;
    param_2[2] = 0.0;
  }
  else {
    FUN_00409498(param_2,(undefined4 *)&DAT_004e0f98);
  }
  return;
}



/* @0042b3ac file=? name=FUN_0042b3ac */

void __cdecl FUN_0042b3ac(int param_1,undefined4 *param_2)

{
  float local_10;
  undefined4 local_c;
  
  FUN_0040954c(&local_10,(float *)(param_2 + 3));
  *(undefined4 *)(param_1 + 0x10) = 0;
  *(undefined4 *)(param_1 + 0xc) = *(undefined4 *)(param_1 + 0x10);
  *(undefined4 *)(param_1 + 0x18) = local_c;
  *(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_1 + 0x18);
  local_c = 0;
  FUN_00408440((undefined4 *)(param_1 + 0x1c),param_2);
  FUN_00409a38((float *)(param_1 + 0x28),&local_10);
  FUN_0040ab44((float *)(param_1 + 0x38),(undefined4 *)(param_1 + 0x1c));
  return;
}



/* @0042b428 file=? name=FUN_0042b428 */

void __cdecl FUN_0042b428(int param_1,undefined4 *param_2,float *param_3)

{
  float *pfVar1;
  float local_20;
  float local_1c [2];
  float local_14;
  float local_10;
  float local_8;
  
  FUN_00408440(param_2,(undefined4 *)(param_1 + 0x1c));
  FUN_0040954c(&local_14,(float *)(param_1 + 0x28));
  FUN_0042b2a8(param_1,&local_20,param_3);
  if (*(float *)(param_1 + 0xc) <= local_20) {
    if (local_20 <= *(float *)(param_1 + 0x10)) {
      pfVar1 = &local_20;
    }
    else {
      pfVar1 = (float *)(param_1 + 0x10);
    }
  }
  else {
    pfVar1 = (float *)(param_1 + 0xc);
  }
  local_8 = *pfVar1;
  local_20 = local_8;
  if (*(float *)(param_1 + 0x14) <= local_1c[0]) {
    if (local_1c[0] <= *(float *)(param_1 + 0x18)) {
      pfVar1 = local_1c;
    }
    else {
      pfVar1 = (float *)(param_1 + 0x18);
    }
  }
  else {
    pfVar1 = (float *)(param_1 + 0x14);
  }
  local_1c[0] = *pfVar1;
  local_14 = local_8 + local_14;
  local_10 = local_1c[0];
  FUN_00409a38((float *)(param_2 + 3),&local_14);
  return;
}



/* @0042b4e0 file=? name=FUN_0042b4e0 */

void __cdecl FUN_0042b4e0(int param_1,float *param_2)

{
  float local_10;
  float local_c;
  
  FUN_0042b2a8(param_1,&local_10,param_2);
  if (*(float *)(param_1 + 0xc) <= local_10) {
    if (*(float *)(param_1 + 0x10) < local_10) {
      *(float *)(param_1 + 0x10) = local_10;
    }
  }
  else {
    *(float *)(param_1 + 0xc) = local_10;
  }
  if (*(float *)(param_1 + 0x14) <= local_c) {
    if (*(float *)(param_1 + 0x18) < local_c) {
      *(float *)(param_1 + 0x18) = local_c;
    }
  }
  else {
    *(float *)(param_1 + 0x14) = local_c;
  }
  return;
}



/* @0042b550 file=? name=FUN_0042b550 */

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

undefined4 __cdecl FUN_0042b550(int param_1,float *param_2)

{
  undefined4 uVar1;
  float local_10;
  float local_c;
  
  FUN_0042b2a8(param_1,&local_10,param_2);
  if ((((local_10 < *(float *)(param_1 + 0xc) - _DAT_0042b5c0) ||
       (*(float *)(param_1 + 0x10) + _DAT_0042b5c0 < local_10)) ||
      (local_c < *(float *)(param_1 + 0x14) - _DAT_0042b5c4)) ||
     (*(float *)(param_1 + 0x18) + _DAT_0042b5c4 < local_c)) {
    uVar1 = 0;
  }
  else {
    uVar1 = 1;
  }
  return uVar1;
}



/* @0042b5d4 file=? name=FUN_0042b5d4 */

void __cdecl FUN_0042b5d4(int param_1,int param_2)

{
  char *pcVar1;
  char local_84 [128];
  
  pcVar1 = (char *)(param_1 + 0x70);
  FUN_00404298(param_2,pcVar1,s_cameraID_004e6029,*(uint *)(param_1 + 0x6c));
  FUN_0042b264(param_1,(undefined4 *)local_84);
  FUN_00404204(param_2,pcVar1,s_cameraType_004e6032,local_84);
  FUN_00404304(param_2,pcVar1,s_tranx_004e603d,*(float *)(param_1 + 0x1c));
  FUN_00404304(param_2,pcVar1,s_trany_004e6043,*(float *)(param_1 + 0x20));
  FUN_00404304(param_2,pcVar1,s_tranz_004e6049,*(float *)(param_1 + 0x24));
  FUN_00404304(param_2,pcVar1,s_quatx_004e604f,*(float *)(param_1 + 0x28));
  FUN_00404304(param_2,pcVar1,s_quaty_004e6055,*(float *)(param_1 + 0x2c));
  FUN_00404304(param_2,pcVar1,s_quatz_004e605b,*(float *)(param_1 + 0x30));
  FUN_00404304(param_2,pcVar1,s_quatw_004e6061,*(float *)(param_1 + 0x34));
  FUN_00404304(param_2,pcVar1,s_minYawClamp_004e6067,*(float *)(param_1 + 0xc));
  FUN_00404304(param_2,pcVar1,s_maxYawClamp_004e6073,*(float *)(param_1 + 0x10));
  FUN_00404304(param_2,pcVar1,s_minPitchClamp_004e607f,*(float *)(param_1 + 0x14));
  FUN_00404304(param_2,pcVar1,s_maxPitchClamp_004e608d,*(float *)(param_1 + 0x18));
  FUN_00404490(param_2,pcVar1,(char *)0x0,(char *)0x0);
  return;
}



/* @0042b6f4 file=? name=FUN_0042b6f4 */

undefined4 __cdecl FUN_0042b6f4(undefined4 *param_1,int param_2,char *param_3)

{
  bool bVar1;
  int iVar2;
  undefined4 uVar3;
  undefined3 extraout_var;
  char *local_8;
  
  iVar2 = FUN_00404118(param_2,param_3,s_tranx_004e609b,(float *)(param_1 + 3));
  if (iVar2 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_tranx__004e60a1,(char *)0x0);
    uVar3 = 0;
  }
  else {
    iVar2 = FUN_00404118(param_2,param_3,s_trany_004e60b2,(float *)(param_1 + 4));
    if (iVar2 == 0) {
      FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_missing_trany__004e60b8,(char *)0x0);
      uVar3 = 0;
    }
    else {
      iVar2 = FUN_00404118(param_2,param_3,s_tranz_004e60c9,(float *)(param_1 + 5));
      if (iVar2 == 0) {
        FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,s_missing_tranz__004e60cf,(char *)0x0);
        uVar3 = 0;
      }
      else {
        iVar2 = FUN_00404118(param_2,param_3,s_quatx_004e60e0,(float *)(param_1 + 6));
        if (iVar2 == 0) {
          FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s_missing_quatx__004e60e6,(char *)0x0);
          uVar3 = 0;
        }
        else {
          iVar2 = FUN_00404118(param_2,param_3,s_quaty_004e60f7,(float *)(param_1 + 7));
          if (iVar2 == 0) {
            FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
            FUN_004dbb24(&DAT_00524e20,s_missing_quaty__004e60fd,(char *)0x0);
            uVar3 = 0;
          }
          else {
            iVar2 = FUN_00404118(param_2,param_3,s_quatz_004e610e,(float *)(param_1 + 8));
            if (iVar2 == 0) {
              FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
              FUN_004dbb24(&DAT_00524e20,s_missing_quatz__004e6114,(char *)0x0);
              uVar3 = 0;
            }
            else {
              iVar2 = FUN_00404118(param_2,param_3,s_quatw_004e6125,(float *)(param_1 + 9));
              if (iVar2 == 0) {
                FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
                FUN_004dbb24(&DAT_00524e20,s_missing_quatw__004e612b,(char *)0x0);
                uVar3 = 0;
              }
              else {
                param_1[10] = 0xc0490fdb;
                FUN_00404118(param_2,param_3,s_minYawClamp_004e613c,(float *)(param_1 + 10));
                param_1[0xb] = 0x40490fdb;
                FUN_00404118(param_2,param_3,s_maxYawClamp_004e6148,(float *)(param_1 + 0xb));
                param_1[0xc] = 0xbfc90fdb;
                FUN_00404118(param_2,param_3,s_minPitchClamp_004e6154,(float *)(param_1 + 0xc));
                param_1[0xd] = 0x3fc90fdb;
                FUN_00404118(param_2,param_3,s_maxPitchClamp_004e6162,(float *)(param_1 + 0xd));
                iVar2 = FUN_00404088(param_2,param_3,s_cameraType_004e6170,&local_8);
                if (iVar2 == 0) {
                  param_1[1] = 1;
                }
                else {
                  uVar3 = FUN_0042b1fc(local_8);
                  param_1[1] = uVar3;
                }
                bVar1 = FUN_004040d8(param_2,param_3,s_cameraID_004e617b,param_1 + 2);
                if (CONCAT31(extraout_var,bVar1) == 0) {
                  FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
                  FUN_004dbb24(&DAT_00524e20,s_missing_cameraID__004e6184,(char *)0x0);
                  uVar3 = 0;
                }
                else {
                  *param_1 = 0x38;
                  uVar3 = 1;
                }
              }
            }
          }
        }
      }
    }
  }
  return uVar3;
}



/* @0042b9d0 file=? name=FUN_0042b9d0 */

undefined4 * __cdecl
FUN_0042b9d0(undefined4 *param_1,undefined4 param_2,undefined4 *param_3,undefined4 param_4)

{
  FUN_0042acd8(param_1,param_2,param_3,param_4);
  *param_1 = &PTR_FUN_004e6198;
  return param_1;
}



/* @0042b9f8 file=? name=FUN_0042b9f8 */

undefined4 * __cdecl FUN_0042b9f8(undefined4 *param_1,int param_2)

{
  FUN_0042ad54(param_1,param_2);
  *param_1 = &PTR_FUN_004e6198;
  return param_1;
}



/* @0042ba18 file=? name=FUN_0042ba18 */

undefined4 * __cdecl FUN_0042ba18(undefined4 *param_1,undefined4 param_2,char *param_3)

{
  FUN_0042ae14(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6198;
  return param_1;
}



/* @0042ba3c file=? name=FUN_0042ba3c */

undefined4 FUN_0042ba3c(void)

{
  return 1;
}



/* @0042ba46 file=? name=FUN_0042ba46 */

undefined4 __cdecl FUN_0042ba46(undefined4 param_1)

{
  return param_1;
}



/* @0042ba4e file=? name=FUN_0042ba4e */

void __cdecl FUN_0042ba4e(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    FUN_0042b1d0(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042ba74 file=? name=FUN_0042ba74 */

int * __cdecl FUN_0042ba74(int *param_1)

{
  undefined4 *puVar1;
  
  FUN_0042c4b7(param_1,0);
  puVar1 = (undefined4 *)FUN_00402298(0x14);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0042c521(puVar1,(int)param_1);
  }
  param_1[5] = (int)puVar1;
  FUN_0042be3c(param_1);
  return param_1;
}



/* @0042bab4 file=? name=FUN_0042bab4 */

void __cdecl FUN_0042bab4(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    FUN_0042bca4((int)param_1);
    puVar1 = (undefined4 *)param_1[5];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[5] = 0;
    FUN_0042c4d6(param_1,2);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042baf8 file=? name=FUN_0042baf8 */

int __cdecl FUN_0042baf8(int param_1)

{
  bool bVar1;
  int iVar2;
  int iVar3;
  int local_18 [5];
  
  FUN_0042c521(local_18,param_1);
  iVar3 = 0;
  do {
    bVar1 = false;
    (**(code **)(local_18[0] + 4))(local_18);
    do {
      iVar2 = (**(code **)(local_18[0] + 0x28))(local_18);
      if (iVar2 == 0) goto LAB_0042bb41;
    } while (iVar3 != *(int *)(iVar2 + 0x6c));
    bVar1 = true;
LAB_0042bb41:
    if (!bVar1) {
      FUN_0042c55f(local_18,2);
      return iVar3;
    }
    iVar3 = iVar3 + 1;
  } while( true );
}



/* @0042bb64 file=? name=FUN_0042bb64 */

void __cdecl FUN_0042bb64(int *param_1,undefined4 *param_2,int param_3)

{
  int iVar1;
  
  if (param_3 == 0) {
    iVar1 = (**(code **)(*(int *)param_1[5] + 0x30))((int *)param_1[5]);
    if (iVar1 == 0) {
      FUN_0042bbac(param_1,param_2);
    }
    else {
      FUN_0042b3ac(iVar1,param_2);
    }
  }
  else {
    FUN_0042b3ac(param_3,param_2);
  }
  return;
}



/* @0042bbac file=? name=FUN_0042bbac */

undefined4 * __cdecl FUN_0042bbac(int *param_1,undefined4 *param_2)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = FUN_0042baf8((int)param_1);
  puVar2 = (undefined4 *)FUN_00402298(0xf0);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_0042acd8(puVar2,iVar1,param_2,1);
  }
  FUN_0042bbf8(param_1,puVar2);
  return puVar2;
}



/* @0042bbf8 file=? name=FUN_0042bbf8 */

undefined4 __cdecl FUN_0042bbf8(int *param_1,undefined4 param_2)

{
  int iVar1;
  
  iVar1 = (**(code **)(*(int *)param_1[5] + 0x30))((int *)param_1[5]);
  if (iVar1 == 0) {
    (**(code **)(*param_1 + 4))(param_1,param_2);
    (**(code **)(*(int *)param_1[5] + 4))((int *)param_1[5]);
  }
  else {
    (**(code **)(*param_1 + 4))(param_1,param_2);
    (**(code **)(*(int *)param_1[5] + 0xc))((int *)param_1[5]);
  }
  return param_2;
}



/* @0042bc48 file=? name=FUN_0042bc48 */

undefined4 __cdecl FUN_0042bc48(int param_1)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  int iVar3;
  
  puVar1 = (undefined4 *)(**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14))
  ;
  if (puVar1 == (undefined4 *)0x0) {
    uVar2 = 0;
  }
  else {
    (**(code **)(**(int **)(param_1 + 0x14) + 0x48))(*(int **)(param_1 + 0x14));
    iVar3 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
    if (iVar3 == 0) {
      (**(code **)(**(int **)(param_1 + 0x14) + 4))(*(int **)(param_1 + 0x14));
    }
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    uVar2 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
  }
  return uVar2;
}



/* @0042bca4 file=? name=FUN_0042bca4 */

void __cdecl FUN_0042bca4(int param_1)

{
  int iVar1;
  
  while( true ) {
    iVar1 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
    if (iVar1 == 0) break;
    FUN_0042bc48(param_1);
  }
  return;
}



/* @0042bcc8 file=? name=FUN_0042bcc8 */

void __cdecl FUN_0042bcc8(int param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
  if (iVar1 != 0) {
    (**(code **)(**(int **)(param_1 + 0x14) + 0x28))(*(int **)(param_1 + 0x14));
    iVar1 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
    if (iVar1 == 0) {
      (**(code **)(**(int **)(param_1 + 0x14) + 4))(*(int **)(param_1 + 0x14));
    }
  }
  (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
  return;
}



/* @0042bd0c file=? name=FUN_0042bd0c */

void __cdecl FUN_0042bd0c(int param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
  if (iVar1 != 0) {
    (**(code **)(**(int **)(param_1 + 0x14) + 0x2c))(*(int **)(param_1 + 0x14));
    iVar1 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
    if (iVar1 == 0) {
      (**(code **)(**(int **)(param_1 + 0x14) + 8))(*(int **)(param_1 + 0x14));
    }
  }
  (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
  return;
}



/* @0042bd50 file=? name=FUN_0042bd50 */

int __cdecl FUN_0042bd50(int param_1,int param_2)

{
  int iVar1;
  
  (**(code **)(**(int **)(param_1 + 0x14) + 4))(*(int **)(param_1 + 0x14));
  while( true ) {
    iVar1 = (**(code **)(**(int **)(param_1 + 0x14) + 0x30))(*(int **)(param_1 + 0x14));
    if (iVar1 == 0) {
      return 0;
    }
    if (param_2 == iVar1) break;
    (**(code **)(**(int **)(param_1 + 0x14) + 0xc))(*(int **)(param_1 + 0x14));
  }
  return iVar1;
}



/* @0042bd94 file=? name=FUN_0042bd94 */

int * __cdecl FUN_0042bd94(int param_1,float *param_2)

{
  int iVar1;
  int *piVar2;
  int *piVar3;
  float local_2c;
  float local_28;
  float local_24;
  int local_20 [5];
  float local_c;
  float local_8;
  
  local_c = 1e+08;
  FUN_0042c521(local_20,param_1);
  piVar3 = (int *)0x0;
  while( true ) {
    piVar2 = (int *)(**(code **)(local_20[0] + 0x28))(local_20);
    if (piVar2 == (int *)0x0) break;
    iVar1 = (**(code **)(*piVar2 + 4))(piVar2,param_2);
    if (iVar1 != 0) {
      FUN_00408644(&local_2c,param_2,(float *)(piVar2 + 7));
      local_8 = local_24 * local_24 + local_28 * local_28 + local_2c * local_2c;
      if (local_8 < local_c) {
        piVar3 = piVar2;
        local_c = local_8;
      }
    }
  }
  FUN_0042c55f(local_20,2);
  return piVar3;
}



/* @0042be30 file=? name=FUN_0042be30 */

undefined4 FUN_0042be30(void)

{
  return 1;
}



/* @0042be3c file=? name=FUN_0042be3c */

void __cdecl FUN_0042be3c(int *param_1)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  int local_a0 [38];
  int local_8;
  
  iVar2 = *(int *)(DAT_004efc94 + 0x68);
  local_8 = FUN_00406fd4(iVar2,*(int *)(*(int *)(DAT_004efc94 + 200) + 4));
  piVar1 = param_1 + 6;
  *piVar1 = s_cameras__004e61a8._0_4_;
  param_1[7] = s_cameras__004e61a8._4_4_;
  *(char *)(param_1 + 8) = s_cameras__004e61a8[8];
  FUN_004d49b8((char *)piVar1,(char *)(local_8 + 0xc));
  iVar3 = FUN_004d4a78((char *)piVar1);
  if (0x11 < iVar3) {
    *(undefined1 *)((int)param_1 + 0x29) = 0;
  }
  FUN_004d49b8((char *)piVar1,&DAT_004e61b1);
  FUN_004da7c0(local_a0,0);
  FUN_004da5f8(local_a0,(LPCSTR)piVar1,0x23,DAT_00520540);
  if ((*(byte *)(local_a0[0] + 0xc) & 0x86) != 0) {
    local_a0[0] = 0;
  }
  if (local_a0[0] == 0) {
    FUN_004da44c(local_a0);
    FUN_0042c078(param_1,iVar2,(char *)(local_8 + 0xc));
  }
  else {
    FUN_004da44c(local_a0);
    FUN_0042bf38(param_1);
  }
  FUN_004da914(local_a0,2);
  return;
}



/* @0042bf38 file=? name=FUN_0042bf38 */

void __cdecl FUN_0042bf38(int *param_1)

{
  char cVar1;
  undefined4 *puVar2;
  int *piVar3;
  int iVar4;
  undefined4 *puVar5;
  uint uVar6;
  uint uVar7;
  char *pcVar8;
  undefined4 *unaff_EDI;
  char *pcVar9;
  char local_8c [128];
  char *local_c;
  int *local_8;
  
  piVar3 = (int *)FUN_00402298(0x20);
  if (piVar3 == (int *)0x0) {
    piVar3 = (int *)0x0;
  }
  else {
    piVar3 = FUN_00403e84(piVar3,(char *)(param_1 + 6),1);
  }
  local_8 = FUN_0040485c((int)piVar3,(char *)0x0);
  puVar2 = (undefined4 *)local_8[1];
  do {
    if (puVar2 == (undefined4 *)0x0) {
      if (local_8 != (int *)0x0) {
        (**(code **)*local_8)(local_8,3);
      }
      FUN_00403ecc(piVar3,3);
      return;
    }
    uVar6 = 0xffffffff;
    pcVar8 = (char *)(puVar2 + 2);
    do {
      pcVar9 = pcVar8;
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      pcVar9 = pcVar8 + 1;
      cVar1 = *pcVar8;
      pcVar8 = pcVar9;
    } while (cVar1 != '\0');
    uVar6 = ~uVar6;
    pcVar8 = pcVar9 + -uVar6;
    pcVar9 = local_8c;
    for (uVar7 = uVar6 >> 2; uVar7 != 0; uVar7 = uVar7 - 1) {
      *(undefined4 *)pcVar9 = *(undefined4 *)pcVar8;
      pcVar8 = pcVar8 + 4;
      pcVar9 = pcVar9 + 4;
    }
    for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {
      *pcVar9 = *pcVar8;
      pcVar8 = pcVar8 + 1;
      pcVar9 = pcVar9 + 1;
    }
    iVar4 = FUN_00404088((int)piVar3,local_8c,s_cameraType_004e61b6,&local_c);
    if (iVar4 == 0) {
      iVar4 = 1;
    }
    else {
      iVar4 = FUN_0042b1fc(local_c);
    }
    if (iVar4 == 1) {
      puVar5 = (undefined4 *)FUN_00402298(0xf0);
      if (puVar5 == (undefined4 *)0x0) {
        unaff_EDI = (undefined4 *)0x0;
      }
      else {
        unaff_EDI = FUN_0042ae14(puVar5,piVar3,local_8c);
      }
    }
    else if (iVar4 == 2) {
      puVar5 = (undefined4 *)FUN_00402298(0xf0);
      if (puVar5 == (undefined4 *)0x0) {
        unaff_EDI = (undefined4 *)0x0;
      }
      else {
        unaff_EDI = FUN_0042ba18(puVar5,piVar3,local_8c);
      }
    }
    FUN_0042bbf8(param_1,unaff_EDI);
    puVar2 = (undefined4 *)*puVar2;
  } while( true );
}



/* @0042c078 file=? name=FUN_0042c078 */

void __cdecl FUN_0042c078(int *param_1,int param_2,char *param_3)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  undefined4 *puVar4;
  undefined4 *unaff_ESI;
  undefined4 local_18 [2];
  int *local_10;
  int local_8;
  
  iVar3 = FUN_00406ff8(param_2,param_3,0x1b,-1);
  if (iVar3 != 0) {
    iVar1 = *(int *)(iVar3 + 4);
    *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;
    if (iVar1 == 0) {
      FUN_00406cd0(iVar3);
    }
    FUN_004030dc(local_18,*(undefined4 *)(iVar3 + 0x3c),*(undefined4 *)(iVar3 + 0x40),0);
    local_8 = *local_10;
    local_10 = local_10 + 1;
    while (piVar2 = local_10, iVar1 = local_8 + -1, local_8 != 0) {
      local_8 = iVar1;
      if (local_10[1] == 1) {
        puVar4 = (undefined4 *)FUN_00402298(0xf0);
        if (puVar4 == (undefined4 *)0x0) {
          unaff_ESI = (undefined4 *)0x0;
        }
        else {
          unaff_ESI = FUN_0042ad54(puVar4,(int)piVar2);
        }
      }
      else if (local_10[1] == 2) {
        puVar4 = (undefined4 *)FUN_00402298(0xf0);
        if (puVar4 == (undefined4 *)0x0) {
          unaff_ESI = (undefined4 *)0x0;
        }
        else {
          unaff_ESI = FUN_0042b9f8(puVar4,(int)piVar2);
        }
      }
      FUN_0042bbf8(param_1,unaff_ESI);
      local_10 = (int *)((int)local_10 + *piVar2);
    }
    *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + -1;
  }
  return;
}



/* @0042c150 file=munga/cammgr.cpp name=FUN_0042c150 */

void __cdecl FUN_0042c150(int param_1)

{
  int *piVar1;
  int iVar2;
  int local_18 [5];
  
  piVar1 = (int *)FUN_00402298(0x20);
  if (piVar1 == (int *)0x0) {
    piVar1 = (int *)0x0;
  }
  else {
    piVar1 = FUN_00403e84(piVar1,(char *)0x0,1);
  }
  if (piVar1 == (int *)0x0) {
    FUN_0040385c(s_Error_Opening_Camera_File_004e61c1,s_d__tesla_bt_munga_CAMMGR_CPP_004e61dc,0x274)
    ;
  }
  FUN_0042c521(local_18,param_1);
  (**(code **)(local_18[0] + 4))(local_18);
  while( true ) {
    iVar2 = (**(code **)(local_18[0] + 0x28))(local_18);
    if (iVar2 == 0) break;
    FUN_0042b5d4(iVar2,(int)piVar1);
  }
  FUN_00404d6c(piVar1,(char *)(param_1 + 0x18));
  FUN_00403ecc(piVar1,3);
  FUN_0042c55f(local_18,2);
  return;
}



/* @0042c1fc file=? name=FUN_0042c1fc */

undefined4 __cdecl FUN_0042c1fc(int param_1,char *param_2,int param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  char *pcVar5;
  undefined4 *puVar6;
  uint uVar7;
  uint uVar8;
  char *pcVar9;
  char *pcVar10;
  int *piVar11;
  char *pcVar12;
  int *piVar13;
  bool bVar14;
  undefined4 local_a0;
  int local_9c;
  int *local_98;
  char local_90 [128];
  int *local_10;
  int *local_c;
  int *local_8;
  
  iVar2 = FUN_004d4a78(param_2);
  iVar3 = FUN_004d4a78(*(char **)(param_3 + 4));
  local_8 = (int *)FUN_004022b0(iVar2 + iVar3 + 1);
  uVar7 = 0xffffffff;
  pcVar10 = *(char **)(param_3 + 4);
  do {
    pcVar12 = pcVar10;
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    pcVar12 = pcVar10 + 1;
    cVar1 = *pcVar10;
    pcVar10 = pcVar12;
  } while (cVar1 != '\0');
  uVar7 = ~uVar7;
  piVar4 = (int *)(pcVar12 + -uVar7);
  piVar11 = local_8;
  for (uVar8 = uVar7 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {
    *piVar11 = *piVar4;
    piVar4 = piVar4 + 1;
    piVar11 = piVar11 + 1;
  }
  for (uVar7 = uVar7 & 3; uVar7 != 0; uVar7 = uVar7 - 1) {
    *(char *)piVar11 = (char)*piVar4;
    piVar4 = (int *)((int)piVar4 + 1);
    piVar11 = (int *)((int)piVar11 + 1);
  }
  iVar2 = FUN_004d4a78(param_2);
  FUN_004d4a94((char *)local_8,param_2,iVar2 - 3);
  FUN_004d49b8((char *)local_8,&DAT_004e61f9);
  piVar4 = (int *)FUN_00402298(0x20);
  if (piVar4 == (int *)0x0) {
    piVar4 = (int *)0x0;
  }
  else {
    piVar4 = FUN_00403e84(piVar4,(char *)local_8,1);
  }
  if ((*(byte *)(piVar4 + 7) & 2) == 0) {
    iVar2 = piVar4[3];
  }
  else {
    iVar2 = piVar4[4];
  }
  if (iVar2 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_Missing__cam_file_004e61fd,(char *)0x0);
    FUN_004d9c38(&DAT_00524e20);
LAB_0042c2da:
    FUN_00403ecc(piVar4,3);
    FUN_004022e8(local_8);
    return 0xffffffff;
  }
  iVar2 = 0;
  local_c = FUN_0040485c((int)piVar4,(char *)0x0);
  for (puVar6 = (undefined4 *)local_c[1]; puVar6 != (undefined4 *)0x0;
      puVar6 = (undefined4 *)*puVar6) {
    iVar2 = iVar2 + 1;
  }
  local_10 = (int *)FUN_004022b0(iVar2 * 0x70);
  FUN_004030dc(&local_a0,local_10,iVar2 * 0x70,0);
  *local_98 = iVar2;
  local_98 = local_98 + 1;
  puVar6 = (undefined4 *)local_c[1];
LAB_0042c360:
  if (puVar6 != (undefined4 *)0x0) {
    do {
      piVar11 = local_98;
      uVar7 = 0xffffffff;
      pcVar10 = (char *)(puVar6 + 2);
      do {
        pcVar12 = pcVar10;
        if (uVar7 == 0) break;
        uVar7 = uVar7 - 1;
        pcVar12 = pcVar10 + 1;
        cVar1 = *pcVar10;
        pcVar10 = pcVar12;
      } while (cVar1 != '\0');
      uVar7 = ~uVar7;
      pcVar10 = pcVar12 + -uVar7;
      pcVar12 = local_90;
      for (uVar8 = uVar7 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {
        *(undefined4 *)pcVar12 = *(undefined4 *)pcVar10;
        pcVar10 = pcVar10 + 4;
        pcVar12 = pcVar12 + 4;
      }
      pcVar9 = s_CameraInfo_004e620f;
      pcVar5 = local_90;
      for (uVar7 = uVar7 & 3; uVar7 != 0; uVar7 = uVar7 - 1) {
        *pcVar12 = *pcVar10;
        pcVar10 = pcVar10 + 1;
        pcVar12 = pcVar12 + 1;
      }
      do {
        if (*pcVar5 != *pcVar9) goto LAB_0042c3bf;
        bVar14 = true;
        if (*pcVar5 == '\0') break;
        pcVar10 = pcVar5 + 1;
        if (*pcVar10 != pcVar9[1]) goto LAB_0042c3bf;
        pcVar5 = pcVar5 + 2;
        pcVar9 = pcVar9 + 2;
        bVar14 = *pcVar10 == '\0';
      } while (!bVar14);
      if (bVar14) goto code_r0x0042c3bb;
LAB_0042c3bf:
      iVar2 = FUN_0042b6f4(local_98,(int)piVar4,local_90);
      if (iVar2 == 0) {
        FUN_004022e8(local_10);
        if (local_c != (int *)0x0) {
          (**(code **)*local_c)(local_c,3);
        }
        goto LAB_0042c2da;
      }
      local_98 = (int *)((int)local_98 + *piVar11);
      puVar6 = (undefined4 *)*puVar6;
      if (puVar6 == (undefined4 *)0x0) break;
    } while( true );
  }
  uVar7 = 0xffffffff;
  pcVar10 = param_2;
  do {
    pcVar12 = pcVar10;
    if (uVar7 == 0) break;
    uVar7 = uVar7 - 1;
    pcVar12 = pcVar10 + 1;
    cVar1 = *pcVar10;
    pcVar10 = pcVar12;
  } while (cVar1 != '\0');
  uVar7 = ~uVar7;
  piVar11 = (int *)(pcVar12 + -uVar7);
  piVar13 = local_8;
  for (uVar8 = uVar7 >> 2; uVar8 != 0; uVar8 = uVar8 - 1) {
    *piVar13 = *piVar11;
    piVar11 = piVar11 + 1;
    piVar13 = piVar13 + 1;
  }
  for (uVar7 = uVar7 & 3; uVar7 != 0; uVar7 = uVar7 - 1) {
    *(char *)piVar13 = (char)*piVar11;
    piVar11 = (int *)((int)piVar11 + 1);
    piVar13 = (int *)((int)piVar13 + 1);
  }
  iVar2 = FUN_004d4a78(param_2);
  *(undefined1 *)((int)local_8 + iVar2 + -4) = 0;
  puVar6 = (undefined4 *)
           FUN_00406db4(param_1,(char *)local_8,0x1b,1,2,local_10,(int)local_98 - local_9c,-1);
  FUN_004022e8(local_10);
  FUN_004022e8(local_8);
  FUN_00403ecc(piVar4,3);
  if (local_c != (int *)0x0) {
    (**(code **)*local_c)(local_c,3);
  }
  return *puVar6;
code_r0x0042c3bb:
  puVar6 = (undefined4 *)*puVar6;
  goto LAB_0042c360;
}



/* @0042c4b7 file=? name=FUN_0042c4b7 */

undefined4 * __cdecl FUN_0042c4b7(undefined4 *param_1,undefined4 param_2)

{
  FUN_0041827c(param_1,param_2);
  *param_1 = &PTR_FUN_004e6270;
  return param_1;
}



/* @0042c4d6 file=? name=FUN_0042c4d6 */

void __cdecl FUN_0042c4d6(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6270;
    FUN_004182a8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042c502 file=? name=FUN_0042c502 */

undefined4 * __cdecl FUN_0042c502(undefined4 *param_1,int param_2)

{
  FUN_00418398(param_1,param_2);
  *param_1 = &PTR_FUN_004e621c;
  return param_1;
}



/* @0042c521 file=? name=FUN_0042c521 */

undefined4 * __cdecl FUN_0042c521(undefined4 *param_1,int param_2)

{
  FUN_00418398(param_1,param_2);
  *param_1 = &PTR_FUN_004e621c;
  return param_1;
}



/* @0042c540 file=? name=FUN_0042c540 */

undefined4 * __cdecl FUN_0042c540(undefined4 *param_1,int param_2)

{
  FUN_004183c0(param_1,param_2);
  *param_1 = &PTR_FUN_004e621c;
  return param_1;
}



/* @0042c55f file=? name=FUN_0042c55f */

void __cdecl FUN_0042c55f(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e621c;
    FUN_004183ec(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042c630 file=? name=FUN_0042c630 */

void __cdecl FUN_0042c630(int param_1,undefined4 param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)**(int **)(param_1 + 0x128);
  if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  **(undefined4 **)(param_1 + 0x128) = param_2;
  return;
}



/* @0042c660 file=? name=FUN_0042c660 */

void __cdecl FUN_0042c660(int param_1,float param_2)

{
  int iVar1;
  float local_1c [3];
  float local_10 [3];
  
  iVar1 = **(int **)(param_1 + 0x128);
  if (*(int *)(iVar1 + 0xf8) < 1) {
    FUN_00408440((undefined4 *)(param_1 + 500),&DAT_004e0f74);
    FUN_0042c764(param_1,iVar1,param_2);
    FUN_0040ab44((float *)(param_1 + 0xd0),(undefined4 *)(param_1 + 0x100));
    local_10[0] = 0.0;
    local_10[1] = 0.0;
    local_10[2] = -1.0;
    FUN_00408b98(local_1c,local_10,(float *)(param_1 + 0xd0));
    if (0 < *(int *)(iVar1 + 0xfc)) {
      FUN_0042b4e0(*(int *)(param_1 + 0x3b0),local_1c);
    }
    FUN_0042ca44(param_1,local_1c);
  }
  else {
    FUN_0042c764(param_1,iVar1,param_2);
    FUN_0042c870(param_1,iVar1,param_2);
    FUN_0042c850(param_1,iVar1);
    FUN_0042b3ac(*(int *)(param_1 + 0x3b0),(undefined4 *)(param_1 + 0x100));
  }
  FUN_0040ab44((float *)(param_1 + 0xd0),(undefined4 *)(param_1 + 0x100));
  return;
}



/* @0042c764 file=? name=FUN_0042c764 */

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

void __cdecl FUN_0042c764(int param_1,int param_2,float param_3)

{
  float fVar1;
  float local_1c;
  float local_18;
  float local_10;
  float local_c;
  float local_8;
  
  if (_DAT_0042c83c <= *(float *)(param_2 + 0xe4)) {
    if (*(float *)(param_2 + 0xe4) <= _DAT_0042c840) {
      local_8 = 0.0;
    }
    else {
      local_8 = *(float *)(param_2 + 0xe4) - _DAT_0042c840;
      local_8 = local_8 * local_8;
    }
  }
  else {
    fVar1 = *(float *)(param_2 + 0xe4) + _DAT_0042c840;
    local_8 = _DAT_0042c844 * fVar1 * fVar1;
  }
  FUN_0040954c(&local_1c,(float *)(param_1 + 0x10c));
  local_c = local_8 * _DAT_0042c848 * param_3;
  local_1c = local_c + local_1c;
  local_10 = *(float *)(param_2 + 0xe8) * _DAT_0042c848 * _DAT_0042c84c * param_3;
  local_18 = local_10 + local_18;
  FUN_00409a38((float *)(param_1 + 0x10c),&local_1c);
  return;
}



/* @0042c850 file=? name=FUN_0042c850 */

void __cdecl FUN_0042c850(int param_1,int param_2)

{
  *(float *)(param_1 + 0x104) = *(float *)(param_2 + 0xf0) + *(float *)(param_1 + 0x104);
  return;
}



/* @0042c870 file=? name=FUN_0042c870 */

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

void __cdecl FUN_0042c870(int param_1,int param_2,float param_3)

{
  float *pfVar1;
  float local_1c [3];
  float local_10 [3];
  
  *(float *)(param_1 + 0x1e4) = _DAT_0042c938 * *(float *)(param_2 + 0xec) * param_3;
  if (0 < *(int *)(param_2 + 0xf4)) {
    *(float *)(param_1 + 0x1e4) = -*(float *)(param_1 + 0x1e4);
  }
  FUN_004086d0(local_10,(float *)(param_1 + 0x1c4),(float *)(param_1 + 0x21c));
  pfVar1 = (float *)(param_1 + 0x1dc);
  FUN_00408644(local_1c,pfVar1,local_10);
  FUN_00408440(pfVar1,local_1c);
  FUN_004085ec((float *)(param_1 + 0x1c4),(float *)(param_1 + 0x1c4),pfVar1);
  FUN_00408744((float *)(param_1 + 500),(float *)(param_1 + 0x1c4),(float *)(param_1 + 0xd0));
  FUN_004085ec((float *)(param_1 + 0x100),(float *)(param_1 + 0x100),(float *)(param_1 + 500));
  return;
}



/* @0042ca20 file=? name=FUN_0042ca20 */

void __cdecl FUN_0042ca20(int param_1,float *param_2)

{
  int *piVar1;
  
  piVar1 = FUN_0042bd94(param_1 + 0x314,param_2);
  *(int **)(param_1 + 0x3b0) = piVar1;
  return;
}



/* @0042ca44 file=? name=FUN_0042ca44 */

void __cdecl FUN_0042ca44(int param_1,float *param_2)

{
  FUN_0042b428(*(int *)(param_1 + 0x3b0),(undefined4 *)(param_1 + 0x100),param_2);
  FUN_00408440((undefined4 *)(param_1 + 0x1d0),&DAT_004e0f74);
  return;
}



/* @0042ca7c file=? name=FUN_0042ca7c */

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

void __cdecl FUN_0042ca7c(int param_1,float param_2,float *param_3)

{
  float *pfVar1;
  float *pfVar2;
  int iVar3;
  float *pfVar4;
  float *pfVar5;
  float10 fVar6;
  float local_124 [3];
  float local_118 [3];
  float local_10c [12];
  float local_dc;
  float local_d8;
  undefined4 local_d4;
  float local_d0;
  float local_cc;
  undefined4 local_c8;
  float local_c4 [3];
  float local_b8 [3];
  float local_ac [3];
  float local_a0 [3];
  float local_94 [3];
  float local_88 [3];
  float local_7c;
  float local_78;
  undefined4 local_74;
  float local_70;
  float local_6c;
  float local_64;
  float local_60;
  undefined4 local_5c;
  float local_58;
  float local_54;
  undefined4 local_4c [3];
  float local_40 [4];
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  undefined4 local_20;
  undefined4 local_1c;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  FUN_0042b428(*(int *)(param_1 + 0x3b0),local_4c,param_3);
  FUN_0040954c(&local_58,local_40);
  local_8 = local_58;
  local_c = local_54;
  local_64 = local_54;
  local_60 = local_58;
  local_5c = 0;
  FUN_0040954c(&local_70,(float *)(param_1 + 0x10c));
  local_10 = local_70;
  local_14 = local_6c;
  local_7c = local_6c;
  local_78 = local_70;
  local_74 = 0;
  fVar6 = FUN_00408110(local_6c);
  local_7c = (float)fVar6;
  fVar6 = FUN_00408110(local_78);
  local_78 = (float)fVar6;
  if (local_64 - local_7c <= _DAT_0042cd38) {
    if (local_64 - local_7c < _DAT_0042cd40) {
      local_64 = _DAT_0042cd3c + local_64;
    }
  }
  else {
    local_64 = local_64 - _DAT_0042cd3c;
  }
  if (local_60 - local_78 <= _DAT_0042cd38) {
    if (local_60 - local_78 < _DAT_0042cd40) {
      local_60 = _DAT_0042cd3c + local_60;
    }
  }
  else {
    local_60 = local_60 - _DAT_0042cd3c;
  }
  FUN_00408644(local_88,&local_64,&local_7c);
  pfVar1 = (float *)(param_1 + 0x1d0);
  FUN_004086d0(local_94,pfVar1,(float *)(param_1 + 0x234));
  FUN_004086ac(local_a0,local_88,*(float *)(param_1 + 0x244));
  pfVar2 = (float *)(param_1 + 0x1e8);
  FUN_00408644(pfVar2,local_a0,local_94);
  local_18 = param_2 * param_2 * _DAT_0042cd44;
  FUN_004086ac(local_ac,pfVar2,local_18);
  FUN_004086ac(local_b8,pfVar1,param_2);
  FUN_004085ec(local_c4,local_b8,local_ac);
  FUN_004085ec(&local_d0,&local_7c,local_c4);
  local_1c = local_c8;
  local_20 = local_c8;
  local_24 = local_d0;
  local_28 = local_d0;
  local_2c = local_cc;
  local_30 = local_cc;
  local_d8 = local_d0;
  local_dc = local_cc;
  local_d4 = local_c8;
  pfVar4 = (float *)&DAT_004e107c;
  pfVar5 = local_10c;
  for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
    *pfVar5 = *pfVar4;
    pfVar4 = pfVar4 + 1;
    pfVar5 = pfVar5 + 1;
  }
  FUN_0040ad2c(local_10c,&local_dc);
  FUN_00409a70((float *)(param_1 + 0x10c),local_10c);
  FUN_004086ac(local_118,pfVar2,param_2);
  FUN_004085ec(local_124,pfVar1,local_118);
  FUN_00408440(pfVar1,local_124);
  return;
}



/* @0042cd48 file=? name=FUN_0042cd48 */

void __cdecl FUN_0042cd48(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = FUN_0042bbac((int *)(param_1 + 0x314),(undefined4 *)(param_1 + 0x100));
  *(undefined4 **)(param_1 + 0x3b0) = puVar1;
  FUN_004dbb24(&DAT_00524e20,(char *)(puVar1 + 0x1c),(char *)0x0);
  FUN_004d9c38(&DAT_00524e20);
  return;
}



/* @0042cd94 file=? name=FUN_0042cd94 */

void __cdecl FUN_0042cd94(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  float local_1c [3];
  float local_10 [3];
  
  iVar2 = FUN_0042bcc8(param_1 + 0x314);
  if (iVar2 != *(int *)(param_1 + 0x3b0)) {
    iVar2 = FUN_0042bc48(param_1 + 0x314);
    *(int *)(param_1 + 0x3b0) = iVar2;
    FUN_004dbb24(&DAT_00524e20,(char *)(iVar2 + 0x70),(char *)0x0);
    FUN_004d9c38(&DAT_00524e20);
    puVar1 = (undefined4 *)(param_1 + 0x100);
    FUN_0040a938(puVar1,(undefined4 *)(*(int *)(param_1 + 0x3b0) + 0x1c));
    FUN_0040ab44((float *)(param_1 + 0xd0),puVar1);
    local_10[0] = 0.0;
    local_10[1] = 0.0;
    local_10[2] = -1.0;
    FUN_00408b98(local_1c,local_10,(float *)(param_1 + 0xd0));
    FUN_0042ca44(param_1,local_1c);
    FUN_0040ab44((float *)(param_1 + 0xd0),puVar1);
  }
  return;
}



/* @0042ce64 file=? name=FUN_0042ce64 */

void __cdecl FUN_0042ce64(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  float local_1c [3];
  float local_10 [3];
  
  iVar2 = FUN_0042bcc8(param_1 + 0x314);
  *(int *)(param_1 + 0x3b0) = iVar2;
  FUN_004dbb24(&DAT_00524e20,(char *)(iVar2 + 0x70),(char *)0x0);
  FUN_004d9c38(&DAT_00524e20);
  puVar1 = (undefined4 *)(param_1 + 0x100);
  FUN_0040a938(puVar1,(undefined4 *)(*(int *)(param_1 + 0x3b0) + 0x1c));
  FUN_0040ab44((float *)(param_1 + 0xd0),puVar1);
  local_10[0] = 0.0;
  local_10[1] = 0.0;
  local_10[2] = -1.0;
  FUN_00408b98(local_1c,local_10,(float *)(param_1 + 0xd0));
  FUN_0042ca44(param_1,local_1c);
  FUN_0040ab44((float *)(param_1 + 0xd0),puVar1);
  return;
}



/* @0042cf20 file=? name=FUN_0042cf20 */

void __cdecl FUN_0042cf20(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  float local_1c [3];
  float local_10 [3];
  
  iVar2 = FUN_0042bd0c(param_1 + 0x314);
  *(int *)(param_1 + 0x3b0) = iVar2;
  FUN_004dbb24(&DAT_00524e20,(char *)(iVar2 + 0x70),(char *)0x0);
  FUN_004d9c38(&DAT_00524e20);
  puVar1 = (undefined4 *)(param_1 + 0x100);
  FUN_0040a938(puVar1,(undefined4 *)(*(int *)(param_1 + 0x3b0) + 0x1c));
  FUN_0040ab44((float *)(param_1 + 0xd0),puVar1);
  local_10[0] = 0.0;
  local_10[1] = 0.0;
  local_10[2] = -1.0;
  FUN_00408b98(local_1c,local_10,(float *)(param_1 + 0xd0));
  FUN_0042ca44(param_1,local_1c);
  FUN_0040ab44((float *)(param_1 + 0xd0),puVar1);
  return;
}



/* @0042cfdc file=? name=FUN_0042cfdc */

int * __cdecl FUN_0042cfdc(int *param_1,int param_2,undefined4 param_3)

{
  int iVar1;
  int *piVar2;
  float local_1c [3];
  float local_10 [3];
  
  FUN_004234f0(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004e6360;
  FUN_0042ba74(param_1 + 0xc5);
  param_1[10] = param_1[10] | 0x10;
  if ((param_1[10] & 0xcU) != 4) {
    piVar2 = param_1 + 0x40;
    param_1[0xeb] = 0;
    FUN_0040a938(piVar2,&DAT_004e0fec);
    FUN_00408440(param_1 + 0xed,&DAT_004e0f74);
    param_1[0xc0] = 0x447a0000;
    param_1[0xc1] = 0;
    param_1[0xc2] = 0;
    param_1[0x49] = 1;
    iVar1 = FUN_004022b0(4);
    param_1[0x4a] = iVar1;
    *(undefined4 *)param_1[0x4a] = 0;
    iVar1 = (**(code **)(*(int *)param_1[0xca] + 0x30))((int *)param_1[0xca]);
    param_1[0xec] = iVar1;
    if (iVar1 == 0) {
      FUN_0042cd48((int)param_1);
    }
    FUN_0040a938(piVar2,(undefined4 *)(param_1[0xec] + 0x1c));
    FUN_0040ab44((float *)(param_1 + 0x34),piVar2);
    local_10[0] = 0.0;
    local_10[1] = 0.0;
    local_10[2] = -1.0;
    FUN_00408b98(local_1c,local_10,(float *)(param_1 + 0x34));
    FUN_0042ca44((int)param_1,local_1c);
    FUN_0040ab44((float *)(param_1 + 0x34),piVar2);
    piVar2 = (int *)FUN_00414b60();
    param_1[0xc3] = *piVar2;
    param_1[0xc4] = 0;
    param_1[7] = (int)PTR_LAB_004e6310;
    param_1[8] = DAT_004e6314;
    param_1[9] = DAT_004e6318;
    FUN_0041bbd8((int)(param_1 + 0xb),0);
  }
  return param_1;
}



/* @0042d16c file=? name=FUN_0042d16c */

int * __cdecl FUN_0042d16c(int param_1)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_00402298(0x3c0);
  if (piVar1 == (int *)0x0) {
    piVar1 = (int *)0x0;
  }
  else {
    piVar1 = FUN_0042cfdc(piVar1,param_1,&DAT_004e62a8);
  }
  return piVar1;
}



/* @0042d19c file=? name=FUN_0042d19c */

void __cdecl FUN_0042d19c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6360;
    FUN_0042bab4(param_1 + 0xc5,2);
    FUN_00423c18(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042d1dc file=? name=FUN_0042d1dc */

void __cdecl FUN_0042d1dc(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e6278);
  return;
}



/* @0042d2c0 file=? name=FUN_0042d2c0 */

void __cdecl FUN_0042d2c0(int *param_1,int param_2)

{
  int iVar1;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  iVar1 = *(int *)(param_2 + 0xc);
  if (iVar1 == 0x44) {
LAB_0042d2e5:
    local_14 = 0x10;
    local_10 = 4;
    local_c = 1;
    local_8 = 1;
    (**(code **)(*param_1 + 0xc))(param_1,&local_14);
  }
  else {
    if (iVar1 != 0x4f) {
      if (iVar1 == 100) goto LAB_0042d2e5;
      if (iVar1 != 0x6f) {
        return;
      }
    }
    local_24 = 0x10;
    local_20 = 9;
    local_1c = 1;
    local_18 = 1;
    (**(code **)(*param_1 + 0xc))(param_1,&local_24);
  }
  return;
}



/* @0042d340 file=? name=FUN_0042d340 */

void __cdecl FUN_0042d340(int param_1,int param_2)

{
  int iVar1;
  undefined4 *puVar2;
  
  if (0 < *(int *)(param_2 + 0xc)) {
    iVar1 = *(int *)(param_1 + 0xd0);
    if (*(int *)(iVar1 + 0x40) != 2) {
      *(undefined **)(iVar1 + 0x1c) = PTR_FUN_004e6474;
      *(undefined4 *)(iVar1 + 0x20) = DAT_004e6478;
      *(undefined4 *)(iVar1 + 0x24) = DAT_004e647c;
      FUN_0041bbd8(iVar1 + 0x2c,2);
      FUN_004dbb24(&DAT_00524e20,(char *)(*(int *)(iVar1 + 0x3b0) + 0x70),(char *)0x0);
      FUN_004d9c38(&DAT_00524e20);
      return;
    }
    *(undefined **)(iVar1 + 0x1c) = PTR_LAB_004e6480;
    *(undefined4 *)(iVar1 + 0x20) = DAT_004e6484;
    *(undefined4 *)(iVar1 + 0x24) = DAT_004e6488;
    FUN_0041bbd8(iVar1 + 0x2c,0);
    puVar2 = (undefined4 *)FUN_00414b60();
    *(undefined4 *)(iVar1 + 0x30c) = *puVar2;
  }
  return;
}



/* @0042d3f0 file=? name=FUN_0042d3f0 */

void __cdecl FUN_0042d3f0(int param_1,int param_2)

{
  if (0 < *(int *)(param_2 + 0xc)) {
    FUN_0042ce64(*(int *)(param_1 + 0xd0));
  }
  return;
}



/* @0042d410 file=? name=FUN_0042d410 */

void __cdecl FUN_0042d410(int param_1,int param_2)

{
  if (0 < *(int *)(param_2 + 0xc)) {
    FUN_0042cf20(*(int *)(param_1 + 0xd0));
  }
  return;
}



/* @0042d430 file=? name=FUN_0042d430 */

void __cdecl FUN_0042d430(int param_1,int param_2)

{
  if (0 < *(int *)(param_2 + 0xc)) {
    FUN_0042cd48(*(int *)(param_1 + 0xd0));
  }
  return;
}



/* @0042d450 file=? name=FUN_0042d450 */

void __cdecl FUN_0042d450(int param_1,int param_2)

{
  if (0 < *(int *)(param_2 + 0xc)) {
    FUN_0042cd94(*(int *)(param_1 + 0xd0));
  }
  return;
}



/* @0042d470 file=? name=FUN_0042d470 */

void __cdecl FUN_0042d470(int param_1,int param_2)

{
  if (0 < *(int *)(param_2 + 0xc)) {
    FUN_0042c150(*(int *)(param_1 + 0xd0) + 0x314);
  }
  return;
}



/* @0042d494 file=? name=FUN_0042d494 */

undefined4 * __cdecl
FUN_0042d494(undefined4 *param_1,undefined4 param_2,undefined4 param_3,char *param_4,
            undefined4 param_5)

{
  FUN_0041c52c(param_1,param_2,param_3,param_4,param_5);
  *param_1 = &PTR_FUN_004e65d4;
  param_1[0x39] = 0;
  param_1[0x3a] = 0;
  param_1[0x3b] = 0;
  param_1[0x3c] = 0;
  param_1[0x3e] = 0;
  param_1[0x3f] = 0;
  param_1[0x3d] = 0;
  return param_1;
}



/* @0042d4f8 file=? name=FUN_0042d4f8 */

void __cdecl FUN_0042d4f8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e65d4;
    FUN_0041c648(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042d524 file=? name=FUN_0042d524 */

void __cdecl FUN_0042d524(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e63b0);
  return;
}



/* @0042d600 file=? name=FUN_0042d600 */

void __cdecl FUN_0042d600(int param_1)

{
  float fVar1;
  int *piVar2;
  float10 fVar3;
  
  if (*(int *)(param_1 + 0x40) == 2) {
    FUN_0041bbd8(param_1 + 0x2c,1);
  }
  piVar2 = (int *)FUN_00414b60();
  fVar1 = (float)*piVar2 / DAT_0052140c;
  if (*(float *)(param_1 + 0x1cc) <= fVar1 - *(float *)(param_1 + 0x1d0)) {
    FUN_0041bbd8(param_1 + 0x2c,2);
    *(float *)(param_1 + 0x1d0) = fVar1;
    if (DAT_004e0f5c == -1) {
      FUN_00407f68();
    }
    fVar3 = FUN_00408050();
    *(float *)(param_1 + 0x1cc) =
         (float)(((float10)*(float *)(param_1 + 0x1c4) - (float10)*(float *)(param_1 + 0x1c8)) *
                 fVar3 + (float10)*(float *)(param_1 + 0x1c8));
  }
  return;
}



/* @0042d698 file=? name=FUN_0042d698 */

undefined4 * __cdecl FUN_0042d698(undefined4 *param_1,int param_2,undefined4 param_3)

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  int *piVar4;
  float10 fVar5;
  
  FUN_0041ff38(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e66b0;
  param_1[7] = PTR_FUN_004e6648;
  param_1[8] = DAT_004e664c;
  param_1[9] = DAT_004e6650;
  param_1[10] = param_1[10] | 0x10;
  iVar3 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],0xf);
  iVar1 = *(int *)(iVar3 + 4);
  *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;
  if (iVar1 == 0) {
    FUN_00406cd0(iVar3);
  }
  puVar2 = *(undefined4 **)(iVar3 + 0x3c);
  param_1[0x71] = *puVar2;
  param_1[0x72] = puVar2[1];
  *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + -1;
  fVar5 = FUN_00408050();
  param_1[0x73] =
       (float)(((float10)(float)param_1[0x71] - (float10)(float)param_1[0x72]) * fVar5 +
              (float10)(float)param_1[0x72]);
  FUN_0041bbd8((int)(param_1 + 0xb),1);
  piVar4 = (int *)FUN_00414b60();
  param_1[0x74] = (float)*piVar4 / DAT_0052140c;
  return param_1;
}



/* @0042d768 file=? name=FUN_0042d768 */

undefined4 * __cdecl FUN_0042d768(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1d4);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0042d698(puVar1,param_1,&DAT_004e6604);
  }
  return puVar1;
}



/* @0042d798 file=? name=FUN_0042d798 */

undefined4 __cdecl FUN_0042d798(undefined4 *param_1)

{
  int iVar1;
  
  iVar1 = FUN_00420234(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  param_1[7] = 0x3f;
  param_1[0xb] = 0x30c;
  return 1;
}



/* @0042d7d0 file=? name=FUN_0042d7d0 */

void __cdecl FUN_0042d7d0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e66b0;
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042d7fc file=? name=FUN_0042d7fc */

undefined4 __cdecl
FUN_0042d7fc(int param_1,char *param_2,int param_3,undefined4 param_4,float *param_5)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  
  pfVar1 = param_5;
  if (param_5 == (float *)0x0) {
    pfVar1 = (float *)FUN_00402298(8);
  }
  iVar2 = FUN_00404118(param_3,s_gamedata_004e665d,s_MaxWaitTime_004e6666,pfVar1);
  if (iVar2 == 0) {
    FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_Missing_MaxWaitTime_004e6672,(char *)0x0);
    FUN_004d9c38((int *)&DAT_00524e68);
  }
  else {
    iVar2 = FUN_00404118(param_3,s_gamedata_004e6686,s_MinWaitTime_004e668f,pfVar1 + 1);
    if (iVar2 != 0) {
      if (param_5 == (float *)0x0) {
        puVar3 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,pfVar1,8,-1);
        FUN_004022d0((int *)pfVar1);
        return *puVar3;
      }
      return 0;
    }
    FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_Missing_MinWaitTime_004e669b,(char *)0x0);
    FUN_004d9c38((int *)&DAT_00524e68);
  }
  if (param_5 == (float *)0x0) {
    FUN_004022d0((int *)pfVar1);
  }
  return 0xffffffff;
}



/* @0042d8f8 file=? name=FUN_0042d8f8 */

void __cdecl FUN_0042d8f8(int param_1)

{
  FUN_0041a1a4(**(int **)(param_1 + 0xc),0x4e6618);
  return;
}



/* @0042d990 file=? name=FUN_0042d990 */

undefined4 * __cdecl
FUN_0042d990(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e6a8c;
  param_1[4] = param_2;
  param_1[3] = param_3;
  param_1[5] = param_4;
  return param_1;
}



/* @0042d9c0 file=? name=FUN_0042d9c0 */

void __cdecl FUN_0042d9c0(int param_1)

{
  *(undefined4 *)(param_1 + 500) = 0x40400000;
  FUN_0041bbd8(param_1 + 0x2c,3);
  return;
}



/* @0042d9e0 file=? name=FUN_0042d9e0 */

void __cdecl FUN_0042d9e0(int param_1)

{
  *(undefined4 *)(param_1 + 500) = 0x40400000;
  *(ushort *)(param_1 + 0x18) = *(ushort *)(param_1 + 0x18) | 1;
  FUN_0041bbd8(param_1 + 0x2c,4);
  return;
}



/* @0042da08 file=? name=FUN_0042da08 */

bool __cdecl FUN_0042da08(int param_1)

{
  return (*(uint *)(param_1 + 0x28) & 0xc) != 0;
}



/* @0042da20 file=? name=FUN_0042da20 */

void __cdecl FUN_0042da20(int param_1,int param_2)

{
  *(float *)(param_1 + 0x1c8) = *(float *)(param_2 + 0x1c) + *(float *)(param_1 + 0x1c8);
  (**(code **)(**(int **)(param_1 + 0x1fc) + 0x30))(*(int **)(param_1 + 0x1fc),param_2);
  return;
}



/* @0042da4c file=munga/player.cpp name=FUN_0042da4c */

void FUN_0042da4c(void)

{
  FUN_0040385c(s_Drop_zone_reply_should_not_be_ha_004e68ca,s_d__tesla_bt_munga_PLAYER_CPP_004e6907,
               0xd8);
  return;
}



/* @0042da68 file=? name=FUN_0042da68 */

void __cdecl
FUN_0042da68(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 iVar1;
  undefined4 *puVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c [2];
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68 [2];
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c [6];
  undefined4 local_24 [6];
  undefined4 local_c [2];
  
  if ((*(uint *)(param_1 + 0x28) & 0x8000) != 0) {
    iVar1 = DAT_004efc94[0xb];
    puVar2 = (undefined4 *)
             FUN_00406ff8(DAT_004efc94[0x1a],*(char **)(*(int *)(param_1 + 0x1f8) + 0x2c),1,-1);
    uVar4 = *puVar2;
    uVar3 = FUN_0042904c(iVar1);
    puVar2 = (undefined4 *)FUN_00420ebc(local_c,uVar3);
    local_88 = 0x7c;
    local_84 = 3;
    local_80 = 1;
    FUN_00420ea4(local_7c,puVar2);
    local_74 = 0;
    local_70 = 0;
    local_6c = 0x45;
    FUN_00420ea4(local_68,(undefined4 *)&DAT_00522524);
    local_5c = 0x1c100;
    local_58 = param_2;
    local_54 = param_3;
    local_50 = param_4;
    local_4c = param_5;
    local_48 = param_6;
    local_44 = param_7;
    local_40 = param_8;
    local_60 = uVar4;
    FUN_0040a7c0(local_3c,(undefined4 *)&DAT_004e0fd4);
    FUN_0040a7c0(local_24,(undefined4 *)&DAT_004e0fd4);
    uVar4 = (**(code **)(*DAT_004efc94 + 0x30))(DAT_004efc94,&local_88);
    *(undefined4 *)(param_1 + 0x1fc) = uVar4;
  }
  return;
}



/* @0042db80 file=? name=FUN_0042db80 */

void __cdecl FUN_0042db80(int param_1,uint *param_2)

{
  undefined4 uVar1;
  int iVar2;
  int *piVar3;
  int *unaff_EDI;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c [2];
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c [2];
  undefined4 local_34;
  undefined4 local_30;
  float local_2c;
  float local_28;
  float local_24;
  int local_20 [3];
  int local_14;
  undefined4 *local_10;
  float local_c;
  float local_8;
  
  if ((param_2[7] == *(uint *)(param_1 + 0x200)) && (*(int *)(param_1 + 0x40) != 1)) {
    iVar2 = FUN_0042104c((int *)(param_2 + 8),(int *)&DAT_00522524);
    if (iVar2 == 0) {
      unaff_EDI = (int *)(**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                                   (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 8);
    }
    else {
      iVar2 = FUN_00403ad0(*(int *)(DAT_004efc94 + 0x24) + 0x18,s_DropZones_004e6924);
      FUN_00421414(local_20,iVar2 + 0x10);
      do {
        piVar3 = (int *)(**(code **)(local_20[0] + 0x28))(local_20);
        if (piVar3 == (int *)0x0) goto LAB_0042dcb8;
        iVar2 = FUN_004d4bec((char *)(piVar3 + 0x72),&DAT_004e692e,3);
      } while (iVar2 == 0);
      FUN_00408644(&local_2c,(float *)(param_1 + 0x100),(float *)(piVar3 + 0x40));
      local_8 = local_24 * local_24 + local_28 * local_28 + local_2c * local_2c;
      unaff_EDI = piVar3;
LAB_0042dcb8:
      while (piVar3 = (int *)(**(code **)(local_20[0] + 0x28))(local_20), piVar3 != (int *)0x0) {
        iVar2 = FUN_004d4bec((char *)(piVar3 + 0x72),&DAT_004e6932,3);
        if (iVar2 != 0) {
          FUN_00408644(&local_2c,(float *)(param_1 + 0x100),(float *)(piVar3 + 0x40));
          local_c = local_24 * local_24 + local_28 * local_28 + local_2c * local_2c;
          if (local_c < local_8) {
            unaff_EDI = piVar3;
            local_8 = local_c;
          }
        }
      }
      FUN_00420ef4(param_2 + 8,unaff_EDI + 0x61);
      FUN_00421452(local_20,2);
    }
    uVar1 = *(undefined4 *)(param_1 + 0x200);
    local_10 = (undefined4 *)(param_1 + 0x184);
    local_58 = 0x2c;
    local_54 = 0x15;
    local_50 = 1;
    FUN_00420ea4(local_4c,(undefined4 *)&DAT_00522524);
    local_44 = 0;
    local_40 = 0;
    FUN_00420ea4(local_3c,local_10);
    local_34 = 0x15;
    local_30 = uVar1;
    (**(code **)(*unaff_EDI + 0xc))(unaff_EDI,&local_58);
    piVar3 = (int *)FUN_00414b60();
    local_14 = *piVar3;
    iVar2 = FUN_004dcd94();
    local_14 = local_14 + iVar2;
    FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),3,param_1,param_2,local_14);
  }
  return;
}



/* @0042df8c file=? name=FUN_0042df8c */

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

void __cdecl FUN_0042df8c(int param_1,float param_2)

{
  int iVar1;
  undefined4 local_48 [3];
  undefined4 local_3c [4];
  undefined4 local_2c [4];
  undefined4 local_1c [3];
  undefined4 local_10 [3];
  
  if (*(int *)(param_1 + 0x40) == 3) {
    *(float *)(param_1 + 500) = *(float *)(param_1 + 500) - param_2;
    if (*(float *)(param_1 + 500) <= _DAT_0042e0dc) {
      FUN_0041bbd8(param_1 + 0x2c,2);
      if (DAT_004efc94[0x22] == 4) {
        FUN_0044f5b4(local_10);
        (**(code **)(*DAT_004efc94 + 0xc))(DAT_004efc94,local_10);
      }
      else if (DAT_004efc94[0x22] == 9) {
        FUN_0044f634(local_1c);
        (**(code **)(*DAT_004efc94 + 0xc))(DAT_004efc94,local_1c);
      }
    }
  }
  else if ((*(int *)(param_1 + 0x40) == 4) &&
          (*(float *)(param_1 + 500) = *(float *)(param_1 + 500) - param_2,
          *(float *)(param_1 + 500) <= _DAT_0042e0dc)) {
    iVar1 = DAT_004efc94[0x22];
    if (iVar1 == 6) {
      FUN_0044f5d0(local_2c,0);
      (**(code **)(*DAT_004efc94 + 0xc))(DAT_004efc94,local_2c);
    }
    else if (iVar1 == 8) {
      FUN_0044f618(local_48);
      (**(code **)(*DAT_004efc94 + 0xc))(DAT_004efc94,local_48);
    }
    else if (iVar1 == 10) {
      FUN_0044f5f4(local_3c,0);
      (**(code **)(*DAT_004efc94 + 0xc))(DAT_004efc94,local_3c);
    }
  }
  return;
}



/* @0042e100 file=? name=FUN_0042e100 */

void __cdecl FUN_0042e100(int *param_1,float param_2)

{
  (**(code **)(*param_1 + 0x34))(param_1);
  FUN_0042df8c((int)param_1,param_2);
  if (param_1[0x7f] != 0) {
    FUN_0040a938(param_1 + 0x40,(undefined4 *)(param_1[0x7f] + 0x100));
    FUN_0040ab28(param_1 + 0x34,(undefined4 *)(param_1[0x7f] + 0xd0));
  }
  FUN_0042e5a0((int)param_1,param_2);
  return;
}



/* @0042e168 file=? name=FUN_0042e168 */

void __cdecl FUN_0042e168(int param_1)

{
  if (*(int *)(param_1 + 0x1fc) != 0) {
    FUN_0040a938((undefined4 *)(param_1 + 0x100),(undefined4 *)(*(int *)(param_1 + 0x1fc) + 0x100));
    FUN_0040ab28((undefined4 *)(param_1 + 0xd0),(undefined4 *)(*(int *)(param_1 + 0x1fc) + 0xd0));
  }
  return;
}



/* @0042e1ac file=? name=FUN_0042e1ac */

undefined4 FUN_0042e1ac(void)

{
  int iVar1;
  int iVar2;
  int local_3c [5];
  int local_28 [6];
  int local_10 [3];
  
  iVar1 = FUN_00403ad0(*(int *)(DAT_004efc94 + 0x24) + 0x18,s_Players_004e6940);
  if (iVar1 != 0) {
    iVar2 = 0;
    FUN_00421414(local_10,iVar1 + 0x10);
    FUN_0042e763(local_28,0,0);
    while (iVar1 = (**(code **)(local_10[0] + 0x28))(local_10), iVar1 != 0) {
      if ((*(byte *)(iVar1 + 0x29) & 0x40) == 0) {
        (**(code **)(local_28[0] + 8))(local_28,iVar1,iVar1 + 0x1c8);
        iVar2 = iVar2 + 1;
        *(undefined4 *)(iVar1 + 0x1c4) = 0;
      }
      else {
        *(undefined4 *)(iVar1 + 0x1cc) = 0xffffffff;
      }
    }
    FUN_0042e8cb(local_3c,(int)local_28);
    while( true ) {
      iVar2 = iVar2 + -1;
      iVar1 = (**(code **)(local_3c[0] + 0x28))(local_3c);
      if (iVar1 == 0) break;
      *(int *)(iVar1 + 0x1cc) = iVar2;
      if (iVar2 == 0) {
        *(undefined4 *)(iVar1 + 0x1c4) = 1;
      }
    }
    FUN_0042e909(local_3c,2);
    FUN_0042e786(local_28,2);
    FUN_00421452(local_10,2);
  }
  return 1;
}



/* @0042e2ac file=? name=FUN_0042e2ac */

void __cdecl FUN_0042e2ac(int param_1,undefined4 *param_2)

{
  FUN_0041f76c(param_1,param_2);
  *(undefined4 *)(param_1 + 0x1c8) = param_2[0xb];
  FUN_00408440((undefined4 *)(param_1 + 0x1d0),param_2 + 0xc);
  return;
}



/* @0042e2e4 file=? name=FUN_0042e2e4 */

void __cdecl FUN_0042e2e4(int param_1,int *param_2,int param_3)

{
  FUN_0041f680(param_1,param_2,param_3);
  *param_2 = 0x3c;
  param_2[0xb] = *(int *)(param_1 + 0x1c8);
  FUN_00408440(param_2 + 0xc,(undefined4 *)(param_1 + 0x1d0));
  return;
}



/* @0042e328 file=? name=FUN_0042e328 */

undefined4 * __cdecl FUN_0042e328(undefined4 *param_1,int param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  code *in_stack_0000004c;
  
  FUN_0041ff38(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6a48;
  FUN_0042e718(param_1 + 0x79,0);
  param_1[0x82] = 0;
  param_1[0x77] = 0;
  param_1[0x7e] = *(undefined4 *)(DAT_004efc94 + 200);
  puVar1 = (undefined4 *)FUN_00406ff8(*(int *)(DAT_004efc94 + 0x68),s_player_004e6948,1,-1);
  if (puVar1 != (undefined4 *)0x0) {
    param_1[0x6f] = *puVar1;
  }
  if (*(int *)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x14) + 0xc) != param_1[0x61]) {
    FUN_0042939c((undefined4 *)&stack0xffffffdc,*(int *)(DAT_004efc94 + 0x2c));
    (*in_stack_0000004c)(&stack0xffffffdc);
    FUN_004293c0((int *)&stack0xffffffdc,2);
  }
  if ((param_1[10] & 0x8000) == 0) {
    puVar1 = FUN_004212b0(*(int *)(DAT_004efc94 + 0x24),s_Players_004e694f);
    (**(code **)(puVar1[4] + 4))(puVar1 + 4);
    param_1[0x78] = *(undefined4 *)(param_2 + 0x4c);
  }
  else {
    param_1[0x78] = 0xffffffff;
  }
  param_1[10] = param_1[10] | 0x10;
  param_1[0x7f] = 0;
  if ((param_1[10] & 0xc) == 4) {
    param_1[7] = PTR_FUN_004e6814;
    param_1[8] = DAT_004e6818;
    param_1[9] = DAT_004e681c;
    param_1[0x7e] = 0;
  }
  else {
    param_1[0x7e] = *(undefined4 *)(DAT_004efc94 + 200);
    param_1[7] = PTR_LAB_004e6808;
    param_1[8] = DAT_004e680c;
    param_1[9] = DAT_004e6810;
  }
  param_1[0x73] = 0;
  param_1[0x80] = 0xfffffffe;
  param_1[0x72] = 0;
  uVar2 = (**(code **)(**(int **)(DAT_004efc94 + 0x40) + 0x18))
                    (*(int **)(DAT_004efc94 + 0x40),param_1[99]);
  param_1[0x81] = uVar2;
  param_1[0x71] = 0;
  param_1[0x7d] = 0;
  return param_1;
}



/* @0042e4f4 file=? name=FUN_0042e4f4 */

undefined4 * __cdecl FUN_0042e4f4(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x20c);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0042e328(puVar1,param_1,&DAT_004e6714);
  }
  return puVar1;
}



/* @0042e524 file=? name=FUN_0042e524 */

void __cdecl FUN_0042e524(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6a48;
    puVar1 = (undefined4 *)param_1[0x81];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0x81] = 0;
    FUN_0042e737(param_1 + 0x79,2);
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042e580 file=? name=FUN_0042e580 */

void __cdecl FUN_0042e580(int param_1,undefined4 param_2)

{
  (**(code **)(*(int *)(param_1 + 0x1e4) + 4))(param_1 + 0x1e4,param_2);
  return;
}



/* @0042e5a0 file=? name=FUN_0042e5a0 */

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

void __cdecl FUN_0042e5a0(int param_1,float param_2)

{
  undefined4 *puVar1;
  int iVar2;
  int local_10 [3];
  
  FUN_0042e954(local_10,param_1 + 0x1e4);
  *(undefined4 *)(param_1 + 0x1dc) = 0;
  while( true ) {
    iVar2 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar2 == 0) break;
    *(int *)(param_1 + 0x1dc) = iVar2;
  }
  iVar2 = *(int *)(param_1 + 0x1dc);
  if (iVar2 != 0) {
    *(float *)(iVar2 + 0x14) = *(float *)(iVar2 + 0x14) - param_2;
    puVar1 = *(undefined4 **)(param_1 + 0x1dc);
    if ((float)puVar1[5] <= _DAT_0042e630) {
      if (puVar1 != (undefined4 *)0x0) {
        (**(code **)*puVar1)(puVar1,3);
      }
      *(undefined4 *)(param_1 + 0x1dc) = 0;
    }
  }
  FUN_0042e992(local_10,2);
  return;
}



/* @0042e718 file=? name=FUN_0042e718 */

undefined4 * __cdecl FUN_0042e718(undefined4 *param_1,undefined4 param_2)

{
  FUN_00417be0(param_1,param_2);
  *param_1 = &PTR_FUN_004e6a40;
  return param_1;
}



/* @0042e737 file=? name=FUN_0042e737 */

void __cdecl FUN_0042e737(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6a40;
    FUN_00417c0c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042e763 file=? name=FUN_0042e763 */

undefined4 * __cdecl FUN_0042e763(undefined4 *param_1,undefined4 param_2,undefined4 param_3)

{
  FUN_004186ac(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6a24;
  return param_1;
}



/* @0042e786 file=? name=FUN_0042e786 */

void __cdecl FUN_0042e786(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6a24;
    FUN_004186dc(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_0042e861(param_1);
    }
  }
  return;
}



/* @0042e7b2 file=? name=FUN_0042e7b2 */

undefined4 __cdecl FUN_0042e7b2(undefined4 param_1,int param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*(float *)(param_2 + 0x1c) == *(float *)(param_3 + 0x1c)) {
    return 0;
  }
  if (*(float *)(param_2 + 0x1c) <= *(float *)(param_3 + 0x1c)) {
    uVar1 = 0xffffffff;
  }
  else {
    uVar1 = 1;
  }
  return uVar1;
}



/* @0042e7e3 file=? name=FUN_0042e7e3 */

undefined4 __cdecl FUN_0042e7e3(undefined4 param_1,float *param_2,int param_3)

{
  undefined4 uVar1;
  
  if (*param_2 == *(float *)(param_3 + 0x1c)) {
    return 0;
  }
  if (*param_2 <= *(float *)(param_3 + 0x1c)) {
    uVar1 = 0xffffffff;
  }
  else {
    uVar1 = 1;
  }
  return uVar1;
}



/* @0042e811 file=? name=FUN_0042e811 */

void FUN_0042e811(void)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004e6974;
  DAT_004e6974 = DAT_004e6974 + 1;
  puVar2 = DAT_004e6970;
  if ((iVar1 == 0) && (puVar2 = (undefined4 *)FUN_00402298(0x28), puVar2 != (undefined4 *)0x0)) {
    FUN_00402b98(puVar2,0x18,100,100,s_VChainOf_004e6957);
  }
  DAT_004e6970 = puVar2;
  FUN_00402f74((int)DAT_004e6970);
  return;
}



/* @0042e861 file=? name=FUN_0042e861 */

void __cdecl FUN_0042e861(undefined4 *param_1)

{
  FUN_00402f98((int)DAT_004e6970,param_1);
  DAT_004e6974 = DAT_004e6974 + -1;
  if (DAT_004e6974 == 0) {
    if (DAT_004e6970 != (int *)0x0) {
      FUN_00402c28(DAT_004e6970,0);
      FUN_004022d0(DAT_004e6970);
    }
    DAT_004e6970 = (int *)0x0;
  }
  return;
}



