/* @0042e8ac file=? name=FUN_0042e8ac */

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

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



/* @0042e8cb file=? name=FUN_0042e8cb */

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

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



/* @0042e8ea file=? name=FUN_0042e8ea */

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

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



/* @0042e909 file=? name=FUN_0042e909 */

void __cdecl FUN_0042e909(int *param_1,byte param_2)

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



/* @0042e935 file=? name=FUN_0042e935 */

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

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



/* @0042e954 file=? name=FUN_0042e954 */

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

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



/* @0042e973 file=? name=FUN_0042e973 */

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

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



/* @0042e992 file=? name=FUN_0042e992 */

void __cdecl FUN_0042e992(int *param_1,byte param_2)

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



/* @0042e9be file=? name=FUN_0042e9be */

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

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



/* @0042e9ee file=? name=FUN_0042e9ee */

void __cdecl FUN_0042e9ee(int *param_1,byte param_2)

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



/* @0042ea14 file=? name=FUN_0042ea14 */

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

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



/* @0042ea3f file=? name=FUN_0042ea3f */

void __cdecl FUN_0042ea3f(int *param_1,byte param_2)

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



/* @0042ea6b file=? name=FUN_0042ea6b */

void FUN_0042ea6b(void)

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



/* @0042eabb file=? name=FUN_0042eabb */

void __cdecl FUN_0042eabb(undefined4 *param_1)

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



/* @0042eb38 file=? name=FUN_0042eb38 */

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

void __cdecl FUN_0042eb38(int param_1,float param_2)

{
  int iVar1;
  
  iVar1 = FUN_00417ab4(param_1 + 0x20c);
  if (iVar1 != 0) {
    iVar1 = FUN_00417ab4(param_1 + 0x20c);
    if (*(int *)(iVar1 + 400) != 0) {
      *(undefined4 *)(param_1 + 0x220) = *(undefined4 *)(*(int *)(iVar1 + 400) + 0x1e0);
    }
  }
  if ((*(int *)(DAT_004efc94 + 0x88) == 7) || (*(int *)(DAT_004efc94 + 0x88) == 6)) {
    *(undefined4 *)(param_1 + 0x224) = 0;
  }
  else if (_DAT_0042ec2c < *(float *)(DAT_004efc94 + 0x58)) {
    if (*(int *)(param_1 + 0x224) == 0) {
      *(float *)(param_1 + 0x22c) = *(float *)(param_1 + 0x22c) - param_2;
      if (*(float *)(param_1 + 0x22c) <= _DAT_0042ec30) {
        *(undefined4 *)(param_1 + 0x228) = 0;
        *(undefined4 *)(param_1 + 0x224) = 1;
      }
    }
    else {
      *(float *)(param_1 + 0x228) = param_2 + *(float *)(param_1 + 0x228);
      if (*(float *)(param_1 + 0x230) <= *(float *)(param_1 + 0x228)) {
        *(undefined4 *)(param_1 + 0x22c) = *(undefined4 *)(param_1 + 0x234);
        *(undefined4 *)(param_1 + 0x224) = 0;
      }
    }
  }
  else {
    *(undefined4 *)(param_1 + 0x224) = 1;
  }
  return;
}



/* @0042ec3a file=? name=FUN_0042ec3a */

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

void FUN_0042ec3a(void)

{
  int *piVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int unaff_EBP;
  
  piVar2 = *(int **)(unaff_EBP + 8);
  FUN_0042e100(piVar2,*(float *)(unaff_EBP + 0xc));
  FUN_0042eb38((int)piVar2,*(float *)(unaff_EBP + 0xc));
  if (((float)piVar2[0x86] <= _DAT_0042ed64) || (*(int *)(DAT_004efc94 + 0x88) != 5)) {
    iVar3 = FUN_0042efe4(0);
    if ((iVar3 != 0) && (iVar3 = *(int *)(iVar3 + 0x1fc), iVar3 != 0)) {
      piVar1 = piVar2 + 0x83;
      iVar4 = FUN_00417ab4((int)piVar1);
      if (iVar3 != iVar4) {
        FUN_00417a5c((int)piVar1);
        (**(code **)(piVar2[0x83] + 4))(piVar1,iVar3);
        piVar2[0x86] = 0x41200000;
        iVar3 = FUN_00417ab4((int)piVar1);
        *(undefined4 *)(unaff_EBP + -0x34) = 0x34;
        *(undefined4 *)(unaff_EBP + -0x30) = 0x15;
        *(undefined4 *)(unaff_EBP + -0x2c) = 1;
        FUN_00420ea4((undefined4 *)(unaff_EBP + -0x28),(undefined4 *)&DAT_00522524);
        *(undefined4 *)(unaff_EBP + -0x20) = 0;
        *(undefined4 *)(unaff_EBP + -0x1c) = 0;
        FUN_00420ea4((undefined4 *)(unaff_EBP + -0x18),(undefined4 *)(iVar3 + 0x184));
        *(undefined4 *)(unaff_EBP + -0x10) = 0;
        *(undefined4 *)(unaff_EBP + -0xc) = DAT_004e0f80;
        *(undefined4 *)(unaff_EBP + -8) = DAT_004e0f84;
        *(undefined4 *)(unaff_EBP + -4) = DAT_004e0f88;
        (**(code **)(*(int *)piVar2[0x87] + 0xc))((int *)piVar2[0x87],unaff_EBP + -0x34);
      }
    }
  }
  else {
    piVar2[0x86] = (int)((float)piVar2[0x86] - *(float *)(unaff_EBP + 0xc));
  }
  return;
}



/* @0042ed68 file=? name=FUN_0042ed68 */

void __cdecl FUN_0042ed68(int *param_1)

{
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50 [2];
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40 [2];
  uint local_38 [5];
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c [2];
  undefined4 local_14 [2];
  undefined4 local_c [2];
  
  (**(code **)(*param_1 + 0x40))
            (param_1,param_1[0x40],param_1[0x41],param_1[0x42],param_1[0x43],param_1[0x44],
             param_1[0x45],param_1[0x46]);
  FUN_00420ea4(local_c,param_1 + 0x61);
  local_38[0] = 0x24;
  local_38[1] = 0x14;
  local_38[2] = 1;
  FUN_00420ea4(local_38 + 3,(undefined4 *)&DAT_00522524);
  local_24 = 0;
  local_20 = 0;
  FUN_00420e8c(local_1c);
  FUN_00420ef4(local_1c,local_c);
  (**(code **)(*(int *)param_1[0x7f] + 0xc))((int *)param_1[0x7f],local_38);
  FUN_0041f640(param_1[0x7f],local_38);
  param_1[7] = (int)PTR_LAB_004e6b04;
  param_1[8] = DAT_004e6b08;
  param_1[9] = DAT_004e6b0c;
  param_1[0x80] = 0;
  FUN_00420ea4(local_14,(undefined4 *)(param_1[0x7f] + 0x184));
  local_5c = 0x24;
  local_58 = 0x15;
  local_54 = 1;
  FUN_00420ea4(local_50,(undefined4 *)&DAT_00522524);
  local_48 = 0;
  local_44 = 0;
  FUN_00420ea4(local_40,local_14);
  (**(code **)(*param_1 + 0xc))(param_1,&local_5c);
  return;
}



/* @0042eec8 file=? name=FUN_0042eec8 */

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

{
  FUN_0042e328(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6b4c;
  FUN_0042f121(param_1 + 0x83,param_1);
  param_1[0x87] = 0;
  param_1[10] = param_1[10] | 0x10;
  param_1[0x86] = 0xbf800000;
  if ((param_1[10] & 0xc) != 4) {
    param_1[7] = PTR_FUN_004e6b10;
    param_1[8] = DAT_004e6b14;
    param_1[9] = DAT_004e6b18;
  }
  param_1[0x88] = 0xffffffff;
  param_1[0x89] = 0;
  param_1[0x8c] = 0x41200000;
  param_1[0x8d] = 0x41700000;
  param_1[0x8a] = 0;
  param_1[0x8b] = param_1[0x8d];
  return param_1;
}



/* @0042ef74 file=? name=FUN_0042ef74 */

undefined4 * __cdecl FUN_0042ef74(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x238);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0042eec8(puVar1,param_1,&DAT_004e6ad4);
  }
  return puVar1;
}



/* @0042efa4 file=? name=FUN_0042efa4 */

void __cdecl FUN_0042efa4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6b4c;
    FUN_0042f140(param_1 + 0x83,2);
    FUN_0042e524(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042efe4 file=? name=FUN_0042efe4 */

int __cdecl FUN_0042efe4(int param_1)

{
  int iVar1;
  int local_10 [3];
  
  iVar1 = FUN_00403ad0(*(int *)(DAT_004efc94 + 0x24) + 0x18,s_Players_004e6b3c);
  if (iVar1 == 0) {
LAB_0042f05b:
    iVar1 = 0;
  }
  else {
    FUN_00421414(local_10,iVar1 + 0x10);
    do {
      iVar1 = (**(code **)(local_10[0] + 0x28))(local_10);
      if (iVar1 == 0) {
        FUN_00421452(local_10,2);
        goto LAB_0042f05b;
      }
    } while (param_1 != *(int *)(iVar1 + 0x1cc));
    FUN_00421452(local_10,2);
  }
  return iVar1;
}



/* @0042f064 file=? name=FUN_0042f064 */

void __cdecl FUN_0042f064(int param_1)

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



/* @0042f121 file=? name=FUN_0042f121 */

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

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



/* @0042f140 file=? name=FUN_0042f140 */

void __cdecl FUN_0042f140(int *param_1,byte param_2)

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



/* @0042f16c file=? name=FUN_0042f16c */

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

{
  char cVar1;
  undefined4 *puVar2;
  undefined4 extraout_EAX;
  undefined4 extraout_EAX_00;
  undefined4 extraout_EAX_01;
  undefined4 uVar3;
  uint uVar4;
  uint uVar5;
  char *pcVar6;
  int iVar7;
  char *pcVar8;
  undefined4 local_14 [2];
  undefined4 *local_c;
  
  FUN_0041ff38(param_1,(int)param_2,param_3);
  *param_1 = &PTR_FUN_004e6c60;
  param_1[10] = param_1[10] | 0x10;
  param_1[0x71] = 0;
  param_1[0x7a] = 0;
  uVar4 = 0xffffffff;
  pcVar6 = (char *)(param_2 + 0x13);
  do {
    pcVar8 = pcVar6;
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    pcVar8 = pcVar6 + 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar8;
  } while (cVar1 != '\0');
  uVar4 = ~uVar4;
  pcVar6 = pcVar8 + -uVar4;
  pcVar8 = (char *)(param_1 + 0x72);
  for (uVar5 = uVar4 >> 2; uVar5 != 0; uVar5 = uVar5 - 1) {
    *(undefined4 *)pcVar8 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar8 = pcVar8 + 4;
  }
  for (uVar4 = uVar4 & 3; uVar4 != 0; uVar4 = uVar4 - 1) {
    *pcVar8 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar8 = pcVar8 + 1;
  }
  puVar2 = FUN_004212b0(*(int *)(DAT_004efc94 + 0x24),s_DropZones_004e6c08);
  (**(code **)(puVar2[4] + 4))(puVar2 + 4,param_1);
  FUN_004030dc(local_14,param_2,*param_2,0x70);
  iVar7 = param_2[0x1b];
  param_1[0x71] = iVar7;
  FUN_004de998((int *)0x0,0x1c,iVar7,1,FUN_0042fa79);
  param_1[0x7a] = extraout_EAX;
  FUN_004de998((int *)0x0,4,param_1[0x71],1,FUN_0042fa81);
  param_1[0x7b] = extraout_EAX_00;
  FUN_004de998((int *)0x0,8,param_1[0x71],1,FUN_00420e8c);
  param_1[0x7c] = extraout_EAX_01;
  uVar3 = FUN_004022b0(param_1[0x71] << 2);
  param_1[0x7d] = uVar3;
  for (iVar7 = 0; iVar7 < (int)param_1[0x71]; iVar7 = iVar7 + 1) {
    FUN_0040a938((undefined4 *)(iVar7 * 0x1c + param_1[0x7a]),local_c);
    *(undefined4 *)(iVar7 * 4 + param_1[0x7b]) = DAT_004e17f4;
    FUN_00420ef4((undefined4 *)(iVar7 * 8 + param_1[0x7c]),(undefined4 *)&DAT_00522524);
    *(undefined4 *)(param_1[0x7d] + iVar7 * 4) = 0xfffffffd;
    local_c = local_c + 7;
  }
  return param_1;
}



/* @0042f2f8 file=? name=FUN_0042f2f8 */

undefined4 * __cdecl FUN_0042f2f8(undefined4 *param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1f8);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0042f16c(puVar1,param_1,&DAT_004e6bc0);
  }
  return puVar1;
}



/* @0042f328 file=? name=FUN_0042f328 */

void __cdecl FUN_0042f328(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6c60;
    if ((int *)param_1[0x7a] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0x7a]);
      FUN_004022e8((int *)param_1[0x7b]);
      FUN_004022e8((int *)param_1[0x7c]);
      FUN_004022e8((int *)param_1[0x7d]);
    }
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0042f38c file=? name=FUN_0042f38c */

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

undefined4 __cdecl FUN_0042f38c(int param_1,int param_2)

{
  int iVar1;
  int *piVar2;
  
  if ((*(int *)(*(int *)(param_1 + 0x1ec) + param_2 * 4) != 0) &&
     ((iVar1 = *(int *)(param_1 + 0x1ec), piVar2 = (int *)FUN_00414b60(),
      (float)(*piVar2 - *(int *)(param_2 * 4 + iVar1)) / DAT_0052140c <= _DAT_0042f400 ||
      (*(int *)(DAT_004efc94 + 0x88) != 5)))) {
    return 0;
  }
  return 1;
}



/* @0042f9bc file=? name=FUN_0042f9bc */

void __cdecl FUN_0042f9bc(int param_1)

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



/* @0042fa79 file=? name=FUN_0042fa79 */

undefined4 __cdecl FUN_0042fa79(undefined4 param_1)

{
  return param_1;
}



/* @0042fa81 file=? name=FUN_0042fa81 */

undefined4 __cdecl FUN_0042fa81(undefined4 param_1)

{
  return param_1;
}



/* @0042fa8c file=? name=FUN_0042fa8c */

void __cdecl FUN_0042fa8c(int param_1)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_00414b60();
  if (*(float *)(param_1 + 0x1c4) < (float)(*piVar1 - *(int *)(param_1 + 0x19c)) / DAT_0052140c) {
    FUN_0042061c(param_1);
  }
  return;
}



/* @0042fad0 file=? name=FUN_0042fad0 */

void __cdecl
FUN_0042fad0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 *param_4,float param_5)

{
  float *pfVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  float *pfVar5;
  float10 fVar6;
  int in_stack_00000024;
  undefined4 uVar7;
  uint uVar8;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208 [2];
  undefined4 local_200;
  undefined4 local_1fc;
  undefined4 local_1f8 [2];
  undefined4 local_1f0;
  undefined4 local_1ec;
  undefined4 local_1e8;
  undefined4 local_1e4;
  undefined4 local_1e0;
  undefined4 local_1dc;
  undefined4 local_1d8;
  undefined4 local_1d4;
  undefined4 local_1d0;
  undefined4 local_1cc;
  undefined4 local_1c8;
  undefined4 local_1c4;
  undefined4 local_1c0;
  int local_1bc;
  undefined4 local_1b8;
  undefined4 local_1b4;
  float local_1b0;
  undefined4 local_1ac;
  undefined4 local_1a8;
  float local_1a4;
  undefined4 local_1a0;
  undefined4 local_19c;
  undefined4 local_198;
  undefined4 local_194;
  undefined4 local_190;
  undefined4 local_18c;
  undefined4 local_188;
  undefined4 local_184;
  undefined4 local_180;
  undefined4 local_17c;
  undefined4 local_178;
  undefined4 local_174;
  undefined4 local_170;
  undefined4 local_16c;
  undefined4 local_168;
  undefined4 local_164;
  int local_160;
  int local_15c;
  undefined4 local_158 [6];
  float local_140;
  float local_13c;
  float local_138;
  int local_134 [4];
  int local_124;
  int local_120 [6];
  int local_108 [5];
  undefined4 local_f4 [15];
  float local_b8 [6];
  float local_a0;
  float local_9c;
  float local_98;
  float local_94;
  float local_90;
  float local_8c;
  undefined4 local_88;
  float local_84 [6];
  float local_6c [6];
  undefined4 local_54;
  undefined4 local_50;
  int *local_4c;
  int *local_48;
  int local_44;
  int local_40;
  undefined4 local_3c;
  float *local_38;
  int *local_34;
  undefined4 local_30;
  int local_2c;
  int local_28;
  float local_24;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  undefined4 *local_c;
  undefined4 *local_8;
  
  FUN_0040de40(&local_4c,10);
  local_3c = 0;
  local_48 = local_4c;
  local_40 = local_44;
  local_c = (undefined4 *)FUN_00402298(0x1c);
  if (local_c == (undefined4 *)0x0) {
    local_8 = (undefined4 *)0x0;
  }
  else {
    local_8 = FUN_00435478(local_c,*(undefined4 *)(*(int *)(param_1 + 0x1c8) + 0x194));
  }
  local_54 = 0x11;
  local_50 = 2;
  local_8c = -param_5;
  local_90 = -param_5;
  local_94 = -param_5;
  local_1c = param_5;
  local_20 = param_5;
  local_24 = param_5;
  local_a0 = param_5;
  local_9c = param_5;
  local_98 = param_5;
  local_18 = local_94;
  local_14 = local_90;
  local_10 = local_8c;
  FUN_0040d210(local_b8,&local_94,&local_a0);
  pfVar1 = local_b8;
  pfVar5 = local_84;
  for (iVar4 = 6; iVar4 != 0; iVar4 = iVar4 + -1) {
    *pfVar5 = *pfVar1;
    pfVar1 = pfVar1 + 1;
    pfVar5 = pfVar5 + 1;
  }
  pfVar1 = local_b8;
  pfVar5 = local_6c;
  for (iVar4 = 6; iVar4 != 0; iVar4 = iVar4 + -1) {
    *pfVar5 = *pfVar1;
    pfVar1 = pfVar1 + 1;
    pfVar5 = pfVar5 + 1;
  }
  FUN_0040f33c(local_f4,&local_88,(float *)(param_1 + 0x100));
  pfVar1 = (float *)FUN_0040eed8((int)local_f4,param_1,0);
  FUN_004355bc(local_108,(int)local_8);
  while (iVar4 = (**(code **)(local_108[0] + 0x28))(local_108), iVar4 != 0) {
    if ((param_1 != iVar4) && (iVar2 = FUN_0041a1a4(**(int **)(iVar4 + 0xc),0x4e4518), iVar2 != 0))
    {
      FUN_00423468(iVar4,(int)&local_4c,pfVar1);
    }
  }
  local_28 = *(int *)(DAT_004efc94 + 0x30);
  local_30 = *(undefined4 *)(param_1 + 0x194);
  local_2c = FUN_00433ed4(local_28 + 0x14);
  local_34 = *(int **)(local_2c + 0x30);
  local_38 = pfVar1;
  FUN_0040e4ac(*local_34,pfVar1,pfVar1,(int)&local_4c);
  if (local_8 != (undefined4 *)0x0) {
    (**(code **)*local_8)(local_8,3);
  }
  if (pfVar1 != (float *)0x0) {
    (**(code **)pfVar1[6])(pfVar1,3);
  }
  FUN_0043094a(local_120,0,0);
  FUN_00430b36(local_134,(int)local_120);
  for (iVar4 = 0; iVar4 < local_44 - local_40; iVar4 = iVar4 + 1) {
    local_15c = local_4c[iVar4 * 7];
    FUN_0040d28c(local_158,local_4c + iVar4 * 7 + 1);
    iVar2 = *(int *)(local_15c + 0x1c);
    if (((iVar2 != *(int *)(param_1 + 0x1c8)) && (param_1 != iVar2)) && (iVar2 != in_stack_00000024)
       ) {
      FUN_00408440(&local_140,&DAT_004e0f74);
      FUN_00408644(&local_140,(float *)(iVar2 + 0x100),(float *)(param_1 + 0x100));
      (**(code **)(local_120[0] + 8))();
    }
  }
  local_18c = *param_4;
  local_188 = param_4[1];
  local_184 = param_4[2];
  local_180 = param_4[3];
  local_17c = param_4[4];
  local_178 = param_4[5];
  local_174 = param_4[6];
  local_170 = param_4[7];
  local_16c = param_4[8];
  local_168 = param_4[9];
  local_164 = param_4[10];
  local_160 = param_4[0xb];
  (**(code **)(local_134[0] + 4))(local_134);
  while (piVar3 = (int *)(**(code **)(local_134[0] + 0x30))(local_134), piVar3 != (int *)0x0) {
    local_198 = *(undefined4 *)(local_124 + 0x1c);
    local_194 = *(undefined4 *)(local_124 + 0x20);
    local_190 = *(undefined4 *)(local_124 + 0x24);
    FUN_00408440(&local_140,&local_198);
    (**(code **)(local_134[0] + 0xc))(local_134);
    if (piVar3[0x48] != 0) {
      uVar8 = 0x3ff40000;
      uVar7 = 0;
      fVar6 = FUN_004dd138((double)(local_138 * local_138 +
                                   local_13c * local_13c + local_140 * local_140));
      FUN_004dce94((double)fVar6,uVar7,uVar8);
      local_160 = FUN_004dcd94();
      if (local_160 < 1) {
        local_160 = 1;
      }
      local_1a4 = DAT_004e0f74;
      local_1a0 = DAT_004e0f78;
      local_19c = DAT_004e0f7c;
      FUN_00408744(&local_1a4,&local_140,(float *)(param_1 + 0xd0));
      FUN_00408440(&local_184,&local_1a4);
      local_1b0 = DAT_004e0f80;
      local_1ac = DAT_004e0f84;
      local_1a8 = DAT_004e0f88;
      FUN_004085ec(&local_1b0,(float *)(param_1 + 0x100),(float *)&stack0x00000018);
      FUN_00408440(&local_16c,&local_1b0);
      FUN_0042104c(piVar3 + 0x61,&param_2);
      if (in_stack_00000024 != 0) {
        FUN_0042104c(piVar3 + 0x61,(int *)(in_stack_00000024 + 0x184));
      }
      local_214 = 100;
      local_210 = 0x12;
      local_20c = 1;
      FUN_00420ea4(local_208,(undefined4 *)&DAT_00522524);
      local_200 = 0;
      local_1fc = 0;
      FUN_00420ea4(local_1f8,&param_2);
      local_1f0 = 0xffffffff;
      local_1ec = 1;
      local_1e8 = local_18c;
      local_1e4 = local_188;
      local_1e0 = local_184;
      local_1dc = local_180;
      local_1d8 = local_17c;
      local_1d4 = local_178;
      local_1d0 = local_174;
      local_1cc = local_170;
      local_1c8 = local_16c;
      local_1c4 = local_168;
      local_1c0 = local_164;
      local_1bc = local_160;
      local_1b8 = 0xffffffff;
      local_1b4 = 1;
      (**(code **)(*piVar3 + 0xc))(piVar3,&local_214);
    }
  }
  FUN_00430b74(local_134,2);
  FUN_0043096d(local_120,2);
  FUN_004355e8(local_108,2);
  FUN_004022e8(local_4c);
  return;
}



/* @00430180 file=? name=FUN_00430180 */

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

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  
  FUN_0041ff38(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6eb8;
  FUN_00409968(param_1 + 0x43,&DAT_004e0fa4);
  iVar2 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],0xf);
  iVar4 = *(int *)(iVar2 + 4);
  *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + 1;
  if (iVar4 == 0) {
    FUN_00406cd0(iVar2);
  }
  piVar1 = *(int **)(iVar2 + 0x3c);
  uVar3 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 0x4c);
  param_1[0x72] = uVar3;
  iVar4 = FUN_00421070((int *)(param_2 + 0x54),(int *)&DAT_00522524);
  if (iVar4 == 0) {
    param_1[0x73] = 0;
  }
  else {
    uVar3 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                      (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 0x54);
    param_1[0x73] = uVar3;
  }
  FUN_00408bf8((float *)(param_1 + 0x74),(float *)(param_1 + 0x40),(float *)(param_1[0x72] + 0xd0));
  param_1[0x71] = piVar1[1];
  if (*piVar1 != 0) {
    iVar4 = FUN_00416f08();
    iVar4 = FUN_00430878(iVar4,param_1[0x72]);
    if (iVar4 != -1) {
      param_1[0x6f] = iVar4;
    }
  }
  *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + -1;
  param_1[7] = PTR_FUN_004e6cd8;
  param_1[8] = DAT_004e6cdc;
  param_1[9] = DAT_004e6ce0;
  param_1[10] = param_1[10] | 0x10;
  return param_1;
}



/* @004302ec file=? name=FUN_004302ec */

undefined4 * __cdecl FUN_004302ec(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_1 + 0x4c);
  if (iVar1 == 0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = (undefined4 *)FUN_00402298(0x1dc);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar2 = FUN_00430180(puVar2,param_1,&DAT_004e6cc4);
    }
  }
  return puVar2;
}



/* @00430340 file=? name=FUN_00430340 */

void __cdecl FUN_00430340(int *param_1,byte param_2)

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



/* @0043036c file=? name=FUN_0043036c */

void __cdecl FUN_0043036c(int param_1)

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



/* @00430388 file=munga/explode.cpp name=FUN_00430388 */

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

{
  char *pcVar1;
  int iVar2;
  undefined4 uVar3;
  uint *puVar4;
  undefined4 *puVar5;
  undefined8 uVar6;
  uint *local_14;
  char *local_10;
  int local_c;
  float local_8;
  
  iVar2 = FUN_00404118(param_3,s_gamedata_004e6cee,s_ExplosionDuration_004e6cf7,&local_8);
  if (iVar2 == 0) {
    uVar6 = FUN_004dbd4c((int *)&DAT_00524e68,param_3);
    FUN_004dbb24((int *)uVar6,s_missing_ExplosionDuration_004e6d09,(char *)0x0);
    FUN_004d9c38((int *)uVar6);
    uVar3 = 0xffffffff;
  }
  else {
    iVar2 = FUN_00404088(param_3,s_gamedata_004e6d25,s_ExplosionResourceTable_004e6d2e,&local_10);
    pcVar1 = local_10;
    if (iVar2 == 0) {
      local_c = 0;
    }
    else {
      puVar4 = (uint *)FUN_00402298(0x10);
      if (puVar4 == (uint *)0x0) {
        local_14 = (uint *)0x0;
      }
      else {
        local_14 = FUN_00402460(puVar4,pcVar1);
      }
      local_14[3] = local_14[3] + 1;
      local_c = FUN_00416f60(&local_14);
      puVar4 = local_14 + 3;
      *puVar4 = *puVar4 - 1;
      if (*puVar4 == 0) {
        FUN_004024d8((int *)local_14,3);
      }
      if (local_c == 0) {
        FUN_004dbb24(&DAT_00524e20,s_resource_table_name____004e6d45,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,local_10,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,&DAT_004e6d5d,(char *)0x0);
        FUN_0040385c(s_Explosion__CreateModelResource___004e6d5f,
                     s_d__tesla_bt_munga_EXPLODE_CPP_004e6da1,0x23b);
      }
    }
    puVar5 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,&local_c,8,-1);
    uVar3 = *puVar5;
  }
  return uVar3;
}



/* @004304cc file=? name=FUN_004304cc */

bool __cdecl FUN_004304cc(int param_1,int param_2)

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



/* @004304ec file=? name=FUN_004304ec */

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

{
  int *piVar1;
  undefined4 *puVar2;
  int iVar3;
  undefined4 local_10;
  undefined1 local_c [4];
  int local_8;
  
  FUN_00415eb4(param_1,param_2);
  *param_1 = &PTR_FUN_004e6eb4;
  FUN_00424767(param_1 + 3,0,1);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_8,4);
  iVar3 = 0;
  if (0 < local_8) {
    do {
      piVar1 = (int *)(**(code **)(*param_2 + 0x1c))(param_2,local_c,4);
      (**(code **)(*piVar1 + 0x1c))(piVar1,&local_10,4);
      puVar2 = (undefined4 *)FUN_00402298(0x10);
      if (puVar2 == (undefined4 *)0x0) {
        puVar2 = (undefined4 *)0x0;
      }
      else {
        puVar2 = FUN_00424716(puVar2,&local_10);
      }
      (**(code **)(param_1[3] + 8))(param_1 + 3,puVar2,local_c);
      iVar3 = iVar3 + 1;
    } while (iVar3 < local_8);
  }
  return param_1;
}



/* @0043059c file=? name=FUN_0043059c */

void __cdecl FUN_0043059c(int *param_1,byte param_2)

{
  void *this;
  int local_20 [7];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6eb4;
    FUN_00424811(local_20,(int)(param_1 + 3));
    FUN_00417858(this,local_20,1);
    FUN_0042484f(local_20,2);
    FUN_0042478a(param_1 + 3,2);
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00430608 file=? name=FUN_00430608 */

void __cdecl FUN_00430608(int *param_1,int param_2)

{
  undefined4 *puVar1;
  bool bVar2;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  undefined4 *puVar3;
  uint *puVar4;
  int *piVar5;
  int iVar6;
  int iVar7;
  uint local_4c [2];
  char *local_44;
  uint local_3c [2];
  char *local_34;
  uint *local_2c;
  char *local_28;
  uint *local_24;
  char *local_20;
  int *local_1c;
  undefined4 local_18;
  int local_14;
  int *local_10;
  uint *local_c;
  int local_8;
  
  FUN_00414c58(param_1);
  local_8 = 0;
  for (puVar1 = *(undefined4 **)(param_2 + 4); puVar1 != (undefined4 *)0x0;
      puVar1 = (undefined4 *)*puVar1) {
    bVar2 = FUN_00403c20((int)puVar1,s_table_entry_004e6dbf);
    if (CONCAT31(extraout_var,bVar2) != 0) {
      local_8 = local_8 + 1;
    }
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  for (puVar1 = *(undefined4 **)(param_2 + 4); puVar1 != (undefined4 *)0x0;
      puVar1 = (undefined4 *)*puVar1) {
    bVar2 = FUN_00403c20((int)puVar1,s_table_entry_004e6dcb);
    if (CONCAT31(extraout_var_00,bVar2) != 0) {
      puVar3 = (undefined4 *)FUN_00402298(0x10);
      if (puVar3 == (undefined4 *)0x0) {
        local_c = (uint *)0x0;
      }
      else {
        local_c = (uint *)FUN_004023f4(puVar3);
      }
      local_c[3] = local_c[3] + 1;
      puVar3 = (undefined4 *)FUN_00402298(0x10);
      if (puVar3 == (undefined4 *)0x0) {
        local_10 = (int *)0x0;
      }
      else {
        local_10 = (int *)FUN_004023f4(puVar3);
      }
      local_10[3] = local_10[3] + 1;
      FUN_00402a98((int *)&local_1c,(int *)&local_c,(char *)puVar1[1]);
      piVar5 = local_1c + 3;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_004024d8(local_1c,3);
      }
      FUN_00402838(local_3c,local_c,0,(char *)0x0);
      local_20 = local_34;
      puVar4 = (uint *)FUN_00402298(0x10);
      if (puVar4 == (uint *)0x0) {
        local_24 = (uint *)0x0;
      }
      else {
        local_24 = FUN_00402460(puVar4,local_20);
      }
      local_24[3] = local_24[3] + 1;
      FUN_004024d8((int *)local_3c,2);
      local_14 = FUN_004dd1e0((char *)local_24[2]);
      puVar4 = local_24 + 3;
      *puVar4 = *puVar4 - 1;
      if (*puVar4 == 0) {
        FUN_004024d8((int *)local_24,3);
      }
      iVar7 = -1;
      iVar6 = 1;
      FUN_00402838(local_4c,local_c,1,(char *)0x0);
      local_28 = local_44;
      puVar4 = (uint *)FUN_00402298(0x10);
      if (puVar4 == (uint *)0x0) {
        local_2c = (uint *)0x0;
      }
      else {
        local_2c = FUN_00402460(puVar4,local_28);
      }
      local_2c[3] = local_2c[3] + 1;
      FUN_004024d8((int *)local_4c,2);
      puVar3 = (undefined4 *)FUN_00406ff8(param_1[6],(char *)local_2c[2],iVar6,iVar7);
      puVar4 = local_2c + 3;
      *puVar4 = *puVar4 - 1;
      if (*puVar4 == 0) {
        FUN_004024d8((int *)local_2c,3);
      }
      local_18 = *puVar3;
      piVar5 = (int *)(**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
      (**(code **)(*piVar5 + 0x20))(piVar5,&local_18,4);
      piVar5 = local_10 + 3;
      *piVar5 = *piVar5 + -1;
      if (*piVar5 == 0) {
        FUN_004024d8(local_10,3);
      }
      puVar4 = local_c + 3;
      *puVar4 = *puVar4 - 1;
      if (*puVar4 == 0) {
        FUN_004024d8((int *)local_c,3);
      }
    }
  }
  return;
}



/* @00430838 file=? name=FUN_00430838 */

undefined4 FUN_00430838(void)

{
  FUN_00415f1c();
  return 1;
}



/* @0043084c file=? name=FUN_0043084c */

undefined4 __cdecl FUN_0043084c(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = (**(code **)(*(int *)(param_1 + 0xc) + 0xc))(param_1 + 0xc,&stack0x00000008);
  if (iVar1 == 0) {
    uVar2 = 0xffffffff;
  }
  else {
    uVar2 = *(undefined4 *)(iVar1 + 0xc);
  }
  return uVar2;
}



/* @00430878 file=? name=FUN_00430878 */

void __cdecl FUN_00430878(int param_1,int param_2)

{
  FUN_0042104c((int *)(param_2 + 0x184),(int *)(*(int *)(DAT_004efc94 + 0x6c) + 0x184));
  FUN_0043084c(param_1);
  return;
}



/* @0043094a file=? name=FUN_0043094a */

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

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



/* @0043096d file=? name=FUN_0043096d */

void __cdecl FUN_0043096d(int *param_1,byte param_2)

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



/* @00430999 file=? name=FUN_00430999 */

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

{
  int iVar1;
  undefined4 uVar2;
  float *pfVar3;
  float *pfVar4;
  
  pfVar3 = (float *)(param_2 + 0x1c);
  pfVar4 = (float *)(param_3 + 0x1c);
  iVar1 = FUN_004084fc(pfVar3,pfVar4,0.0001);
  if (iVar1 == 0) {
    if (*(float *)(param_2 + 0x24) * *(float *)(param_2 + 0x24) +
        *(float *)(param_2 + 0x20) * *(float *)(param_2 + 0x20) + *pfVar3 * *pfVar3 <=
        *(float *)(param_3 + 0x24) * *(float *)(param_3 + 0x24) +
        *(float *)(param_3 + 0x20) * *(float *)(param_3 + 0x20) + *pfVar4 * *pfVar4) {
      uVar2 = 0xffffffff;
    }
    else {
      uVar2 = 1;
    }
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}



/* @00430a0c file=? name=FUN_00430a0c */

undefined4 __cdecl FUN_00430a0c(undefined4 param_1,float *param_2,int param_3)

{
  int iVar1;
  undefined4 uVar2;
  float *pfVar3;
  
  pfVar3 = (float *)(param_3 + 0x1c);
  iVar1 = FUN_004084fc(param_2,pfVar3,0.0001);
  if (iVar1 == 0) {
    if (param_2[2] * param_2[2] + param_2[1] * param_2[1] + *param_2 * *param_2 <=
        *(float *)(param_3 + 0x24) * *(float *)(param_3 + 0x24) +
        *(float *)(param_3 + 0x20) * *(float *)(param_3 + 0x20) + *pfVar3 * *pfVar3) {
      uVar2 = 0xffffffff;
    }
    else {
      uVar2 = 1;
    }
  }
  else {
    uVar2 = 0;
  }
  return uVar2;
}



/* @00430a7c file=? name=FUN_00430a7c */

void FUN_00430a7c(void)

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



/* @00430acc file=? name=FUN_00430acc */

void __cdecl FUN_00430acc(undefined4 *param_1)

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



/* @00430b17 file=? name=FUN_00430b17 */

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

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



/* @00430b36 file=? name=FUN_00430b36 */

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

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



/* @00430b55 file=? name=FUN_00430b55 */

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

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



/* @00430b74 file=? name=FUN_00430b74 */

void __cdecl FUN_00430b74(int *param_1,byte param_2)

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



/* @00430ba0 file=? name=FUN_00430ba0 */

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

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



/* @00430bd0 file=? name=FUN_00430bd0 */

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

{
  FUN_004185bc(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6ef4;
  FUN_00408440(param_1 + 7,param_4);
  return param_1;
}



/* @00430c07 file=? name=FUN_00430c07 */

void __cdecl FUN_00430c07(int *param_1,byte param_2)

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



/* @00430c33 file=? name=FUN_00430c33 */

void FUN_00430c33(void)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004e6ef0;
  DAT_004e6ef0 = DAT_004e6ef0 + 1;
  puVar2 = DAT_004e6eec;
  if ((iVar1 == 0) && (puVar2 = (undefined4 *)FUN_00402298(0x28), puVar2 != (undefined4 *)0x0)) {
    FUN_00402b98(puVar2,0x28,100,100,s_VChainLinkOf_004e6e0a);
  }
  DAT_004e6eec = puVar2;
  FUN_00402f74((int)DAT_004e6eec);
  return;
}



/* @00430c83 file=? name=FUN_00430c83 */

void __cdecl FUN_00430c83(undefined4 *param_1)

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



/* @00430cd0 file=? name=FUN_00430cd0 */

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

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  undefined4 local_4c [7];
  undefined4 local_30 [8];
  uint local_10;
  int *local_c;
  undefined4 local_8;
  
  FUN_0041ff38(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e7004;
  param_1[0x71] = *(undefined4 *)(param_2 + 0x4c);
  param_1[10] = param_1[10] | 0x10;
  iVar1 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],9);
  param_1[0x72] = 0;
  if (iVar1 != 0) {
    iVar2 = *(int *)(iVar1 + 4);
    *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + 1;
    if (iVar2 == 0) {
      FUN_00406cd0(iVar1);
    }
    local_8 = param_1[0x65];
    iVar2 = FUN_00433ed4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
    local_c = *(int **)(iVar2 + 0x30);
    puVar4 = *(undefined4 **)(iVar1 + 0x3c);
    local_10 = *(uint *)(iVar1 + 0x40) / 0x3c;
    while (local_10 != 0) {
      local_10 = local_10 - 1;
      FUN_0040f33c(local_4c,puVar4,(float *)(param_1 + 0x40));
      uVar3 = FUN_0040eed8((int)local_4c,param_1,param_1[0x72]);
      param_1[0x72] = uVar3;
      FUN_0040ea6c(local_c,param_1[0x72],local_30);
      puVar4 = puVar4 + 0xf;
    }
    *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + -1;
  }
  return param_1;
}



/* @00430ddc file=? name=FUN_00430ddc */

undefined4 __cdecl FUN_00430ddc(undefined4 *param_1)

{
  int iVar1;
  undefined4 uVar2;
  char *pcVar3;
  float10 fVar4;
  
  iVar1 = FUN_00420234(param_1);
  if (iVar1 == 0) {
    uVar2 = 0;
  }
  else {
    *param_1 = 0x50;
    param_1[7] = 0x29;
    param_1[0xb] = 0x20c;
    pcVar3 = FUN_004d4d1c((char *)0x0,&DAT_004e6fab);
    if (pcVar3 == (char *)0x0) {
      FUN_004dbb24((int *)&DAT_00524e68,s_Scale_missing__004e6fad,(char *)0x0);
      uVar2 = 0;
    }
    else {
      fVar4 = (float10)FUN_004dd1cc(pcVar3);
      uVar2 = 1;
      param_1[0x13] = (float)fVar4;
    }
  }
  return uVar2;
}



/* @00430e54 file=? name=FUN_00430e54 */

undefined4 * __cdecl FUN_00430e54(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1cc);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00430cd0(puVar1,param_1,&DAT_004e6f28);
  }
  return puVar1;
}



/* @00430e84 file=? name=FUN_00430e84 */

void __cdecl FUN_00430e84(int *param_1,byte param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e7004;
    iVar1 = param_1[0x72];
    while (iVar2 = iVar1, iVar2 != 0) {
      iVar1 = *(int *)(iVar2 + 0x28);
      if (iVar2 != 0) {
        (*(code *)**(undefined4 **)(iVar2 + 0x18))(iVar2,3);
      }
    }
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00430ed4 file=? name=FUN_00430ed4 */

void __cdecl FUN_00430ed4(int param_1)

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



/* @00430ef0 file=? name=FUN_00430ef0 */

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

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 *puVar4;
  undefined4 local_4c [7];
  undefined4 local_30 [8];
  uint local_10;
  int *local_c;
  undefined4 local_8;
  
  FUN_0041ff38(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e6fd0;
  param_1[10] = param_1[10] | 0x10;
  iVar1 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],9);
  param_1[0x71] = 0;
  if (iVar1 != 0) {
    iVar2 = *(int *)(iVar1 + 4);
    *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + 1;
    if (iVar2 == 0) {
      FUN_00406cd0(iVar1);
    }
    local_8 = param_1[0x65];
    iVar2 = FUN_00433ed4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
    local_c = *(int **)(iVar2 + 0x30);
    puVar4 = *(undefined4 **)(iVar1 + 0x3c);
    local_10 = *(uint *)(iVar1 + 0x40) / 0x3c;
    while (local_10 != 0) {
      local_10 = local_10 - 1;
      FUN_0040f33c(local_4c,puVar4,(float *)(param_1 + 0x40));
      uVar3 = FUN_0040eed8((int)local_4c,param_1,param_1[0x71]);
      param_1[0x71] = uVar3;
      FUN_0040ea6c(local_c,param_1[0x71],local_30);
      puVar4 = puVar4 + 0xf;
    }
    *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + -1;
  }
  return param_1;
}



/* @00430ff0 file=? name=FUN_00430ff0 */

undefined4 __cdecl FUN_00430ff0(undefined4 *param_1)

{
  int iVar1;
  
  iVar1 = FUN_00420234(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  param_1[7] = 0x2a;
  param_1[0xb] = 0x20c;
  return 1;
}



/* @00431028 file=? name=FUN_00431028 */

undefined4 * __cdecl FUN_00431028(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1c8);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00430ef0(puVar1,param_1,&DAT_004e6f84);
  }
  return puVar1;
}



/* @00431058 file=? name=FUN_00431058 */

void __cdecl FUN_00431058(int *param_1,byte param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e6fd0;
    iVar1 = param_1[0x71];
    while (iVar2 = iVar1, iVar2 != 0) {
      iVar1 = *(int *)(iVar2 + 0x28);
      if (iVar2 != 0) {
        (*(code *)**(undefined4 **)(iVar2 + 0x18))(iVar2,3);
      }
    }
    FUN_00420508(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004310a8 file=? name=FUN_004310a8 */

void __cdecl FUN_004310a8(int param_1)

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



/* @00431200 file=? name=FUN_00431200 */

void __cdecl FUN_00431200(int param_1,int param_2)

{
  int iVar1;
  int *piVar2;
  uint local_a4 [5];
  undefined4 local_90;
  undefined4 local_8c;
  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 [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;
  
  if (*(int *)(param_2 + 0x24) == -1) {
    *(undefined4 *)(param_2 + 0x24) = 0;
  }
  if (*(int *)(param_1 + 0x40) == 0) {
    if ((*(uint *)(param_1 + 0x28) & 0xc) != 4) {
      *(ushort *)(param_1 + 0x18) = *(ushort *)(param_1 + 0x18) | 3;
      *(uint *)(param_1 + 0x28) = *(uint *)(param_1 + 0x28) & 0xfffffffd;
    }
    FUN_0041ff08(param_1,param_2);
    for (iVar1 = 0; iVar1 < *(int *)(param_1 + 0x11c); iVar1 = iVar1 + 1) {
      if (*(int *)(*(int *)(*(int *)(param_1 + 0x120) + iVar1 * 4) + 0x24) == 1) {
        local_2c = *(undefined4 *)(param_1 + 0x100);
        local_28 = *(undefined4 *)(param_1 + 0x104);
        local_24 = *(undefined4 *)(param_1 + 0x108);
        local_20 = *(undefined4 *)(param_1 + 0x10c);
        local_1c = *(undefined4 *)(param_1 + 0x110);
        local_18 = *(undefined4 *)(param_1 + 0x114);
        local_14 = *(undefined4 *)(param_1 + 0x118);
        if ((*(int *)(param_2 + 0x2c) == 0) && (*(int *)(param_1 + 0x1cc) != -1)) {
          local_8 = *(undefined4 *)(param_1 + 0x1cc);
        }
        else {
          local_8 = *(undefined4 *)(param_1 + 0x1c8);
        }
        local_88 = 0x5c;
        local_84 = 3;
        local_80 = 1;
        FUN_00420ea4(local_7c,(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,(undefined4 *)(param_1 + 0x184));
        FUN_00420ea4(local_34,(undefined4 *)(param_1 + 0x184));
        FUN_004302ec((int)&local_88);
        local_a4[0] = 0x1c;
        local_a4[1] = 0x15;
        local_a4[2] = 1;
        FUN_00420ea4(local_a4 + 3,(undefined4 *)&DAT_00522524);
        local_90 = 0;
        local_8c = 0;
        piVar2 = (int *)FUN_00414b60();
        local_c = *piVar2;
        local_10 = *(undefined4 *)(param_1 + 0x1d4);
        iVar1 = FUN_004dcd94();
        local_c = local_c + iVar1;
        FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),3,param_1,local_a4,local_c);
        FUN_0041bbd8(param_1 + 0x2c,2);
        FUN_00431428(param_1);
        return;
      }
    }
  }
  return;
}



/* @00431428 file=? name=FUN_00431428 */

void __cdecl FUN_00431428(int param_1)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = FUN_00433ed4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
  piVar1 = *(int **)(iVar3 + 0x30);
  iVar3 = *(int *)(param_1 + 0x1c4);
  while (iVar2 = iVar3, iVar2 != 0) {
    iVar3 = *(int *)(iVar2 + 0x28);
    if ((*(uint *)(param_1 + 0x28) & 0x4000) == 0) {
      *(float *)(iVar2 + 8) = *(float *)(param_1 + 0x1d0) + *(float *)(iVar2 + 8);
      *(float *)(iVar2 + 0xc) = *(float *)(param_1 + 0x1d0) + *(float *)(iVar2 + 0xc);
    }
    else {
      FUN_0040e184(*piVar1,iVar2,(undefined4 *)iVar2);
      if (iVar2 != 0) {
        (*(code *)**(undefined4 **)(iVar2 + 0x18))(iVar2,3);
      }
    }
  }
  *(undefined4 *)(param_1 + 0x1c4) = 0;
  return;
}



/* @004314bc file=? name=FUN_004314bc */

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

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  int local_20 [6];
  int local_8;
  
  FUN_00430ef0(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e7418;
  param_1[0x76] = s_Defualt_004e7155._0_4_;
  param_1[0x77] = s_Defualt_004e7155._4_4_;
  iVar1 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],0xf);
  iVar3 = *(int *)(iVar1 + 4);
  *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + 1;
  if (iVar3 == 0) {
    FUN_00406cd0(iVar1);
  }
  puVar2 = *(undefined4 **)(iVar1 + 0x3c);
  if (puVar2[4] == 0) {
    param_1[0x74] = 0;
    param_1[10] = param_1[10] | 0x4000;
  }
  else {
    param_1[0x74] = *puVar2;
  }
  param_1[0x75] = puVar2[1];
  if (puVar2[5] != 0) {
    param_1[10] = param_1[10] | 0x8000;
  }
  param_1[0x72] = puVar2[2];
  param_1[0x73] = puVar2[3];
  *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + -1;
  local_8 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],0x14);
  iVar3 = *(int *)(local_8 + 4);
  *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + 1;
  if (iVar3 == 0) {
    FUN_00406cd0(local_8);
  }
  FUN_004032dc(local_20,*(undefined4 *)(local_8 + 0x3c),*(undefined4 *)(local_8 + 0x40),0);
  (**(code **)(local_20[0] + 0x14))(local_20,4);
  for (iVar3 = 0; iVar3 < (int)param_1[0x47]; iVar3 = iVar3 + 1) {
    puVar2 = (undefined4 *)FUN_00402298(0x160);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar2 = FUN_0041df5c(puVar2,param_1,iVar3,local_20);
    }
    *(undefined4 **)(param_1[0x48] + iVar3 * 4) = puVar2;
  }
  param_1[10] = param_1[10] | 0x10;
  *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + -1;
  FUN_00403310(local_20,2);
  return param_1;
}



/* @0043162c file=? name=FUN_0043162c */

void __cdecl FUN_0043162c(int param_1,undefined4 *param_2)

{
  FUN_0041f76c(param_1,param_2);
  if ((*(int *)(param_1 + 0x40) != *(int *)(param_1 + 0x3c)) && (*(int *)(param_1 + 0x40) == 1)) {
    FUN_00431428(param_1);
  }
  return;
}



/* @00431658 file=? name=FUN_00431658 */

undefined4 __cdecl FUN_00431658(undefined4 *param_1)

{
  int iVar1;
  
  iVar1 = FUN_00430ff0(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  *param_1 = 0x4c;
  param_1[7] = 0x5e;
  param_1[0xb] = 0xb00;
  return 1;
}



/* @00431698 file=? name=FUN_00431698 */

undefined4 * __cdecl FUN_00431698(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x218);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_004314bc(puVar1,param_1,&DAT_004e7068);
  }
  return puVar1;
}



/* @004316c8 file=? name=FUN_004316c8 */

void __cdecl FUN_004316c8(int *param_1,byte param_2)

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



/* @004316f4 file=? name=FUN_004316f4 */

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

{
  char *pcVar1;
  float *pfVar2;
  int iVar3;
  undefined4 uVar4;
  char *pcVar5;
  undefined4 *puVar6;
  char *pcVar7;
  float *pfVar8;
  bool bVar9;
  char *local_c;
  char *local_8;
  
  pfVar2 = param_5;
  if (param_5 == (float *)0x0) {
    pfVar2 = (float *)FUN_00402298(0x18);
  }
  iVar3 = FUN_00404118(param_3,s_gamedata_004e715d,s_DestroyedYTranslation_004e7166,pfVar2);
  if (iVar3 == 0) {
    pfVar2[4] = 0.0;
    *pfVar2 = 0.0;
  }
  else {
    pfVar2[4] = 1.4013e-45;
  }
  iVar3 = FUN_00404190(param_3,s_gamedata_004e717c,s_StoppingCollisionVolume_004e7185,pfVar2 + 5);
  if (iVar3 == 0) {
    pfVar2[5] = 0.0;
  }
  iVar3 = FUN_00404118(param_3,s_gamedata_004e719d,s_TimeDelay_004e71a6,pfVar2 + 1);
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_TimeDelay_is_missing_004e71b0,(char *)0x0);
    FUN_004d9c38(&DAT_00524e20);
    FUN_004036a0(1);
  }
  local_8 = s_Unspecified_004e71c7;
  iVar3 = FUN_00404088(param_3,s_gamedata_004e71d3,s_ExplosionModelFile_004e71dc,&local_8);
  if (iVar3 == 0) {
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_missing_ExplosionModelFile__004e71ef,(char *)0x0);
    uVar4 = 0;
  }
  else {
    pfVar8 = (float *)0x0;
    pcVar7 = s_Unspecified_004e720d;
    pcVar5 = local_8;
    do {
      bVar9 = *pcVar5 == *pcVar7;
      if (!bVar9) break;
      if (*pcVar5 == '\0') goto LAB_0043183e;
      pcVar1 = pcVar5 + 1;
      bVar9 = *pcVar1 == pcVar7[1];
      if (!bVar9) break;
      pcVar5 = pcVar5 + 2;
      pcVar7 = pcVar7 + 2;
      bVar9 = *pcVar1 == '\0';
    } while (!bVar9);
    if (!bVar9) {
      pfVar8 = (float *)FUN_00406ff8(param_1,local_8,1,-1);
    }
LAB_0043183e:
    pcVar5 = local_8;
    if (pfVar8 == (float *)0x0) {
      FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_cannot_find_004e7219,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,pcVar5,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s_in_resource_file__004e7227,(char *)0x0);
      uVar4 = 0;
    }
    else {
      if (pfVar8 != (float *)0x0) {
        pfVar2[2] = *pfVar8;
      }
      local_c = s_Unspecified_004e723b;
      FUN_00404088(param_3,s_gamedata_004e7247,s_CrunchExplosionModelFile_004e7250,&local_c);
      pfVar2[3] = -NAN;
      pcVar7 = s_Unspecified_004e7269;
      pcVar5 = local_c;
      do {
        if (*pcVar5 != *pcVar7) goto LAB_004318eb;
        bVar9 = true;
        if (*pcVar5 == '\0') break;
        pcVar1 = pcVar5 + 1;
        if (*pcVar1 != pcVar7[1]) goto LAB_004318eb;
        pcVar5 = pcVar5 + 2;
        pcVar7 = pcVar7 + 2;
        bVar9 = *pcVar1 == '\0';
      } while (!bVar9);
      if (!bVar9) {
LAB_004318eb:
        pfVar8 = (float *)FUN_00406ff8(param_1,local_c,1,-1);
        pcVar5 = local_c;
        if (pfVar8 == (float *)0x0) {
          FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s_cannot_find_004e7275,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,pcVar5,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s_in_resource_file__004e7283,(char *)0x0);
          return 0;
        }
        pfVar2[3] = *pfVar8;
      }
      if (param_5 == (float *)0x0) {
        puVar6 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,pfVar2,0x18,-1);
        FUN_004022d0((int *)pfVar2);
        uVar4 = *puVar6;
      }
      else {
        uVar4 = 0;
      }
    }
  }
  return uVar4;
}



/* @00431998 file=? name=FUN_00431998 */

undefined4 FUN_00431998(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_004e7297,s_DamageZones_004e72a0,&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_004e72ac,(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__004e72d2,(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;
}



/* @0043199e file=? name=FUN_0043199e */

undefined4 FUN_0043199e(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_004e7297,s_DamageZones_004e72a0,
                       (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_004e72ac,(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__004e72d2,(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;
}



/* @00431be4 file=? name=FUN_00431be4 */

void __cdecl FUN_00431be4(int param_1,int param_2)

{
  char *pcVar1;
  undefined4 *puVar2;
  char *pcVar3;
  int iVar4;
  char *pcVar5;
  bool bVar6;
  int local_10 [3];
  
  if (*(int *)(param_1 + 0x220) == 0) {
    puVar2 = FUN_004212b0(*(int *)(DAT_004efc94 + 0x24),s_Teams_004e72fd);
    if (puVar2 != (undefined4 *)0x0) {
      FUN_00421414(local_10,(int)(puVar2 + 4));
LAB_00431c58:
      do {
        iVar4 = (**(code **)(local_10[0] + 0x28))(local_10);
        if (iVar4 == 0) goto LAB_00431c69;
        pcVar3 = (char *)(iVar4 + 0x1c4);
        pcVar5 = (char *)(param_1 + 0x224);
        do {
          if (*pcVar3 != *pcVar5) goto LAB_00431c58;
          bVar6 = true;
          if (*pcVar3 == '\0') break;
          pcVar1 = pcVar3 + 1;
          if (*pcVar1 != pcVar5[1]) goto LAB_00431c58;
          pcVar3 = pcVar3 + 2;
          pcVar5 = pcVar5 + 2;
          bVar6 = *pcVar1 == '\0';
        } while (!bVar6);
      } while (!bVar6);
      *(int *)(param_1 + 0x220) = iVar4;
LAB_00431c69:
      FUN_00421452(local_10,2);
    }
  }
  if (*(int *)(param_1 + 0x220) == 0) {
    FUN_004dbb24(&DAT_00524e20,s_TEAM_____004e7303,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,(char *)(param_1 + 0x224),(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s___was_never_found__004e730c,(char *)0x0);
    FUN_004d9c38(&DAT_00524e20);
    FUN_004dee24(0xffffffff);
  }
  if (*(int *)(param_1 + 0x40) != 1) {
    FUN_00431200(param_1,param_2);
  }
  return;
}



/* @00431cf0 file=? name=FUN_00431cf0 */

void __cdecl FUN_00431cf0(int param_1)

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



/* @00431d0c file=? name=FUN_00431d0c */

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

{
  char *pcVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  undefined4 *puVar5;
  char *pcVar6;
  int iVar7;
  uint *puVar8;
  undefined4 uVar9;
  int iVar10;
  uint uVar11;
  uint uVar12;
  char *pcVar13;
  bool bVar14;
  uint **ppuVar15;
  int local_70 [5];
  int local_5c [5];
  int local_48 [3];
  int *local_3c;
  int *local_38;
  int *local_34;
  int *local_30;
  int *local_2c;
  int *local_28;
  uint *local_24;
  uint *local_20;
  char *local_1c;
  uint *local_18;
  uint *local_14;
  uint *local_10;
  char *local_c;
  int local_8;
  
  FUN_004314bc(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e73e4;
  param_1[0x86] = 0;
  param_1[0x88] = 0;
  local_8 = *(int *)(DAT_004efc94 + 0x24);
  puVar5 = FUN_004212b0(local_8,s_Teams_004e7320);
  if (puVar5 != (undefined4 *)0x0) {
    FUN_00421414(local_48,(int)(puVar5 + 4));
LAB_00431da3:
    do {
      iVar7 = (**(code **)(local_48[0] + 0x28))(local_48);
      if (iVar7 == 0) goto LAB_00431db4;
      pcVar6 = (char *)(iVar7 + 0x1c4);
      pcVar13 = (char *)(param_2 + 0xd0);
      do {
        if (*pcVar6 != *pcVar13) goto LAB_00431da3;
        bVar14 = true;
        if (*pcVar6 == '\0') break;
        pcVar1 = pcVar6 + 1;
        if (*pcVar1 != pcVar13[1]) goto LAB_00431da3;
        pcVar6 = pcVar6 + 2;
        pcVar13 = pcVar13 + 2;
        bVar14 = *pcVar1 == '\0';
      } while (!bVar14);
    } while (!bVar14);
    param_1[0x88] = iVar7;
LAB_00431db4:
    FUN_00421452(local_48,2);
  }
  uVar11 = 0xffffffff;
  pcVar6 = (char *)(param_2 + 0xd0);
  do {
    pcVar13 = pcVar6;
    if (uVar11 == 0) break;
    uVar11 = uVar11 - 1;
    pcVar13 = pcVar6 + 1;
    cVar3 = *pcVar6;
    pcVar6 = pcVar13;
  } while (cVar3 != '\0');
  uVar11 = ~uVar11;
  pcVar6 = pcVar13 + -uVar11;
  pcVar13 = (char *)(param_1 + 0x89);
  for (uVar12 = uVar11 >> 2; uVar12 != 0; uVar12 = uVar12 - 1) {
    *(undefined4 *)pcVar13 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar13 = pcVar13 + 4;
  }
  for (uVar11 = uVar11 & 3; uVar11 != 0; uVar11 = uVar11 - 1) {
    *pcVar13 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar13 = pcVar13 + 1;
  }
  local_c = (char *)(param_2 + 0x50);
  puVar8 = (uint *)FUN_00402298(0x10);
  if (puVar8 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar8,local_c);
  }
  local_10[3] = local_10[3] + 1;
  FUN_004323c7(local_5c,*(int *)(DAT_004efc94 + 200) + 0x50);
  uVar9 = (**(code **)(local_5c[0] + 0x54))(local_5c,&local_10);
  FUN_00432405(local_5c,2);
  param_1[0x86] = uVar9;
  puVar8 = local_10 + 3;
  *puVar8 = *puVar8 - 1;
  if (*puVar8 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  if (param_1[0x86] == 0) {
    puVar5 = (undefined4 *)FUN_00402298(0x2c);
    if (puVar5 == (undefined4 *)0x0) {
      puVar5 = (undefined4 *)0x0;
    }
    else {
      local_1c = (char *)(param_2 + 0x50);
      local_24 = (uint *)FUN_00402298(0x10);
      if (local_24 == (uint *)0x0) {
        local_20 = (uint *)0x0;
      }
      else {
        local_20 = FUN_00402460(local_24,local_1c);
      }
      ppuVar15 = &local_20;
      local_20[3] = local_20[3] + 1;
      local_18 = (uint *)FUN_00402298(0x10);
      if (local_18 == (uint *)0x0) {
        local_14 = (uint *)0x0;
      }
      else {
        local_14 = FUN_00402460(local_18,s_Role__MapAssigned_004e7326);
      }
      local_14[3] = local_14[3] + 1;
      puVar5 = FUN_00429a9c(puVar5,(int *)&local_14,(int *)ppuVar15);
    }
    param_1[0x86] = puVar5;
    puVar8 = local_20 + 3;
    *puVar8 = *puVar8 - 1;
    if (*puVar8 == 0) {
      FUN_004024d8((int *)local_20,3);
    }
    puVar8 = local_14 + 3;
    *puVar8 = *puVar8 - 1;
    if (*puVar8 == 0) {
      FUN_004024d8((int *)local_14,3);
    }
    iVar7 = param_1[0x86];
    iVar4 = *(int *)(DAT_004efc94 + 200);
    local_28 = (int *)(iVar7 + 0x24);
    local_2c = (int *)*local_28;
    local_2c[3] = local_2c[3] + 1;
    FUN_004323c7(local_70,iVar4 + 0x50);
    iVar10 = (**(code **)(local_70[0] + 0x54))(local_70,&local_2c);
    FUN_00432405(local_70,2);
    uVar11 = (uint)(iVar10 == 0);
    local_30 = local_2c;
    piVar2 = local_2c + 3;
    *piVar2 = *piVar2 + -1;
    if (*piVar2 == 0) {
      FUN_004024d8(local_2c,3);
    }
    if (uVar11 != 0) {
      local_34 = (int *)(iVar7 + 0x24);
      local_38 = (int *)*local_34;
      local_38[3] = local_38[3] + 1;
      (**(code **)(*(int *)(iVar4 + 0x50) + 8))(iVar4 + 0x50,iVar7,&local_38);
      local_3c = local_38;
      piVar2 = local_38 + 3;
      *piVar2 = *piVar2 + -1;
      if (*piVar2 == 0) {
        FUN_004024d8(local_38,3);
      }
    }
  }
  puVar5 = FUN_004212b0(local_8,s_Landmarks_004e7338);
  (**(code **)(puVar5[4] + 4))(puVar5 + 4,param_1);
  return param_1;
}



/* @00432020 file=? name=FUN_00432020 */

void __cdecl FUN_00432020(int *param_1,byte param_2)

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



/* @0043204c file=? name=FUN_0043204c */

undefined4 __cdecl FUN_0043204c(undefined4 *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  uint uVar5;
  uint uVar6;
  char *pcVar7;
  
  iVar2 = FUN_00431658(param_1);
  if (iVar2 == 0) {
    uVar3 = 0;
  }
  else {
    *param_1 = 0x110;
    param_1[7] = 0x56;
    pcVar4 = FUN_004d4d1c((char *)0x0,&DAT_004e7342);
    if (pcVar4 == (char *)0x0) {
      FUN_004dbb24((int *)&DAT_00524e68,s_teamName_missing__004e7344,(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 + 0x34);
      for (uVar6 = uVar5 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {
        *(undefined4 *)pcVar7 = *(undefined4 *)pcVar4;
        pcVar4 = pcVar4 + 4;
        pcVar7 = pcVar7 + 4;
      }
      for (uVar5 = uVar5 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
        *pcVar7 = *pcVar4;
        pcVar4 = pcVar4 + 1;
        pcVar7 = pcVar7 + 1;
      }
      pcVar4 = FUN_004d4d1c((char *)0x0,&DAT_004e7357);
      if (pcVar4 == (char *)0x0) {
        FUN_004dbb24((int *)&DAT_00524e68,s_roleName_missing__004e7359,(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 + 0x14);
        for (uVar6 = uVar5 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {
          *(undefined4 *)pcVar7 = *(undefined4 *)pcVar4;
          pcVar4 = pcVar4 + 4;
          pcVar7 = pcVar7 + 4;
        }
        for (uVar5 = uVar5 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
          *pcVar7 = *pcVar4;
          pcVar4 = pcVar4 + 1;
          pcVar7 = pcVar7 + 1;
        }
        pcVar4 = FUN_004d4d1c((char *)0x0,&DAT_004e736c);
        if (pcVar4 == (char *)0x0) {
          FUN_004dbb24((int *)&DAT_00524e68,s_Landmark_Name_missing__004e736e,(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 + 0x24);
          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;
}



/* @00432190 file=? name=FUN_00432190 */

undefined4 * __cdecl FUN_00432190(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x264);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00431d0c(puVar1,param_1,&DAT_004e70f4);
  }
  return puVar1;
}



/* @004321c0 file=? name=FUN_004321c0 */

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

{
  int *piVar1;
  undefined4 *puVar2;
  undefined4 uVar3;
  
  FUN_004316f4(param_1,param_2,param_3,param_4,param_5);
  if (param_5 == (float *)0x0) {
    piVar1 = (int *)FUN_00402298(0x18);
    puVar2 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,piVar1,0x18,-1);
    FUN_004022d0(piVar1);
    uVar3 = *puVar2;
  }
  else {
    uVar3 = 0;
  }
  return uVar3;
}



/* @00432224 file=? name=FUN_00432224 */

void __cdecl FUN_00432224(int param_1)

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



/* @004323a8 file=? name=FUN_004323a8 */

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

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



/* @004323c7 file=? name=FUN_004323c7 */

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

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



/* @004323e6 file=? name=FUN_004323e6 */

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

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



/* @00432405 file=? name=FUN_00432405 */

void __cdecl FUN_00432405(int *param_1,byte param_2)

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



/* @00432450 file=? name=FUN_00432450 */

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

{
  int *piVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined4 local_1c [2];
  int *local_14;
  undefined4 *local_c;
  int local_8;
  
  FUN_00430ef0(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e7538;
  param_1[10] = param_1[10] | 0x10;
  param_1[7] = PTR_FUN_004e7490;
  param_1[8] = DAT_004e7494;
  param_1[9] = DAT_004e7498;
  local_8 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_1[0x6f],0x11);
  iVar4 = *(int *)(local_8 + 4);
  *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + 1;
  if (iVar4 == 0) {
    FUN_00406cd0(local_8);
  }
  FUN_004030dc(local_1c,*(undefined4 *)(local_8 + 0x3c),*(undefined4 *)(local_8 + 0x40),0);
  iVar4 = *local_14;
  param_1[0x49] = iVar4;
  local_14 = local_14 + 1;
  uVar2 = FUN_004022b0(iVar4 << 2);
  param_1[0x4a] = uVar2;
  for (iVar4 = 0; piVar1 = local_14, iVar4 < (int)param_1[0x49]; iVar4 = iVar4 + 1) {
    local_c = (undefined4 *)FUN_00402298(0x134);
    if (local_c == (undefined4 *)0x0) {
      puVar3 = (undefined4 *)0x0;
    }
    else {
      puVar3 = FUN_00432d2c(local_c,(int)param_1,iVar4,(char *)piVar1);
    }
    *(undefined4 **)(param_1[0x4a] + iVar4 * 4) = puVar3;
    local_14 = (int *)((int)local_14 + piVar1[9]);
  }
  *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + -1;
  return param_1;
}



/* @00432558 file=? name=FUN_00432558 */

undefined4 * __cdecl FUN_00432558(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1c8);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00432450(puVar1,param_1,&DAT_004e747c);
  }
  return puVar1;
}



/* @00432588 file=? name=FUN_00432588 */

undefined4 __cdecl FUN_00432588(undefined4 *param_1)

{
  int iVar1;
  
  iVar1 = FUN_00430ff0(param_1);
  if (iVar1 == 0) {
    return 0;
  }
  param_1[7] = 0x5f;
  param_1[0xb] = 0xb00;
  return 1;
}



/* @004325c0 file=? name=FUN_004325c0 */

void __cdecl FUN_004325c0(int *param_1,byte param_2)

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



/* @004325ec file=? name=FUN_004325ec */

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

{
  char *pcVar1;
  char cVar2;
  int iVar3;
  undefined4 uVar4;
  int *piVar5;
  int *piVar6;
  char *pcVar7;
  undefined4 *puVar8;
  uint uVar9;
  uint uVar10;
  char *pcVar11;
  bool bVar12;
  byte bVar13;
  char local_54 [32];
  int local_34 [2];
  int *local_2c;
  char *local_24;
  int *local_20;
  char *local_1c;
  int *local_18;
  uint local_14;
  int *local_10;
  int *local_c;
  char *local_8;
  
  iVar3 = FUN_00404088(param_3,s_gamedata_004e74a6,s_Subsystems_004e74af,&local_8);
  if (iVar3 == 0) {
    FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
    FUN_004dbb24((int *)&DAT_00524e68,s_is_missing__sub_file_specificati_004e74ba,(char *)0x0);
    uVar4 = 0xffffffff;
  }
  else {
    local_c = (int *)FUN_004064fc((char *)*param_4,local_8);
    piVar5 = (int *)FUN_00402298(0x20);
    if (piVar5 == (int *)0x0) {
      piVar5 = (int *)0x0;
    }
    else {
      piVar5 = FUN_00403e84(piVar5,(char *)local_c,1);
    }
    local_10 = FUN_0040485c((int)piVar5,(char *)0x0);
    if ((*(byte *)(piVar5 + 7) & 2) == 0) {
      iVar3 = piVar5[3];
    }
    else {
      iVar3 = piVar5[4];
    }
    if (iVar3 == 0) {
      FUN_004dbb24((int *)&DAT_00524e68,(char *)local_c,(char *)0x0);
      FUN_004dbb24((int *)&DAT_00524e68,s_empty_of_missing__004e74e0,(char *)0x0);
LAB_004326c3:
      FUN_004022d0(local_c);
      FUN_00403ecc(piVar5,3);
      if (local_10 != (int *)0x0) {
        (**(code **)*local_10)(local_10,3);
      }
      uVar4 = 0xffffffff;
    }
    else {
      local_14 = iVar3 * 0x48 + 4;
      local_18 = (int *)FUN_004022b0(local_14);
      FUN_004030dc(local_34,local_18,local_14,0);
      *local_2c = iVar3;
      local_2c = local_2c + 1;
      for (puVar8 = (undefined4 *)local_10[1]; puVar8 != (undefined4 *)0x0;
          puVar8 = (undefined4 *)*puVar8) {
        uVar9 = 0xffffffff;
        pcVar7 = (char *)(puVar8 + 2);
        do {
          pcVar11 = pcVar7;
          if (uVar9 == 0) break;
          uVar9 = uVar9 - 1;
          pcVar11 = pcVar7 + 1;
          cVar2 = *pcVar7;
          pcVar7 = pcVar11;
        } while (cVar2 != '\0');
        uVar9 = ~uVar9;
        pcVar7 = pcVar11 + -uVar9;
        pcVar11 = local_54;
        for (uVar10 = uVar9 >> 2; uVar10 != 0; uVar10 = uVar10 - 1) {
          *(undefined4 *)pcVar11 = *(undefined4 *)pcVar7;
          pcVar7 = pcVar7 + 4;
          pcVar11 = pcVar11 + 4;
        }
        for (uVar9 = uVar9 & 3; uVar9 != 0; uVar9 = uVar9 - 1) {
          *pcVar11 = *pcVar7;
          pcVar7 = pcVar7 + 1;
          pcVar11 = pcVar11 + 1;
        }
        iVar3 = FUN_00404088((int)piVar5,local_54,&DAT_004e74f4,&local_1c);
        if (iVar3 == 0) {
          bVar13 = 0x3a;
          FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
          piVar6 = FUN_004db92c((int *)&DAT_00524e68,bVar13);
          FUN_004dbb24(piVar6,local_54,(char *)0x0);
          FUN_004dbb24(piVar6,s_missing_Type__004e74f9,(char *)0x0);
LAB_004327c2:
          FUN_004022e8(local_18);
          goto LAB_004326c3;
        }
        pcVar11 = s_DoorClassID_004e7509;
        local_20 = local_2c;
        pcVar7 = local_1c;
        do {
          if (*pcVar7 != *pcVar11) goto LAB_00432820;
          bVar12 = true;
          if (*pcVar7 == '\0') break;
          pcVar1 = pcVar7 + 1;
          if (*pcVar1 != pcVar11[1]) goto LAB_00432820;
          pcVar7 = pcVar7 + 2;
          pcVar11 = pcVar11 + 2;
          bVar12 = *pcVar1 == '\0';
        } while (!bVar12);
        if (!bVar12) {
LAB_00432820:
          local_24 = local_1c;
          bVar13 = 0x3a;
          FUN_004dbb24((int *)&DAT_00524e68,param_2,(char *)0x0);
          piVar6 = FUN_004db92c((int *)&DAT_00524e68,bVar13);
          FUN_004dbb24(piVar6,local_54,(char *)0x0);
          FUN_004dbb24(piVar6,s_has_an_unknown_component_type_of_004e7515,(char *)0x0);
          FUN_004dbb24(piVar6,local_24,(char *)0x0);
          FUN_004d9c38(piVar6);
          goto LAB_004327c2;
        }
        iVar3 = FUN_00432fa8(param_3,param_2,local_54,(char *)local_2c,(int)piVar5,(int)param_4,
                             param_1);
        if (iVar3 == -1) goto LAB_004327c2;
        local_2c = (int *)((int)local_2c + local_20[9]);
      }
      puVar8 = (undefined4 *)FUN_00406f3c(param_1,param_2,0x11,1,0,local_34,-1);
      if (puVar8 == (undefined4 *)0x0) {
        uVar4 = 0xffffffff;
      }
      else {
        uVar4 = *puVar8;
      }
      FUN_004022d0(local_c);
      FUN_00403ecc(piVar5,3);
      if (local_10 != (int *)0x0) {
        (**(code **)*local_10)(local_10,3);
      }
      FUN_004022e8(local_18);
    }
  }
  return uVar4;
}



/* @004329d4 file=? name=FUN_004329d4 */

void __cdecl FUN_004329d4(int param_1,undefined4 *param_2,undefined2 param_3)

{
  FUN_0041c500(param_1,param_2,param_3);
  param_2[4] = *(undefined4 *)(param_1 + 0xe4);
  *param_2 = 0x14;
  return;
}



/* @00432a04 file=? name=FUN_00432a04 */

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

void __cdecl FUN_00432a04(int param_1,float param_2)

{
  float *pfVar1;
  int unaff_ESI;
  float local_8;
  
  if (param_2 <= _DAT_00432c10) {
    *(float *)(param_1 + 0x11c) = *(float *)(param_1 + 0x11c) - param_2;
    switch(*(undefined4 *)(param_1 + 0x40)) {
    case 0:
      *(undefined4 *)(param_1 + 0x11c) = *(undefined4 *)(param_1 + 0x120);
    case 3:
      while (unaff_ESI = 3, *(float *)(param_1 + 0x11c) <= _DAT_00432c14) {
        *(float *)(param_1 + 0x11c) = *(float *)(param_1 + 0x124) + *(float *)(param_1 + 0x11c);
switchD_00432a3d_caseD_4:
        unaff_ESI = 4;
        if (_DAT_00432c14 < *(float *)(param_1 + 0x11c)) {
          local_8 = 0.0;
          FUN_00408440((undefined4 *)(param_1 + 0xf8),&DAT_004e0f74);
          goto switchD_00432a3d_default;
        }
        *(float *)(param_1 + 0x11c) = *(float *)(param_1 + 0x120) + *(float *)(param_1 + 0x11c);
switchD_00432a3d_caseD_1:
        unaff_ESI = 1;
        if (_DAT_00432c14 < *(float *)(param_1 + 0x11c)) {
          local_8 = _DAT_00432c10 - *(float *)(param_1 + 0x11c) / *(float *)(param_1 + 0x120);
          pfVar1 = (float *)(param_1 + 0xf8);
          FUN_00408644(pfVar1,(float *)(param_1 + 0x110),(float *)(*(int *)(param_1 + 0xd0) + 0x100)
                      );
          FUN_004086f8(pfVar1,pfVar1,*(float *)(param_1 + 0x120));
          goto switchD_00432a3d_default;
        }
        *(float *)(param_1 + 0x11c) = *(float *)(param_1 + 0x124) + *(float *)(param_1 + 0x11c);
switchD_00432a3d_caseD_2:
        unaff_ESI = 2;
        if (_DAT_00432c14 < *(float *)(param_1 + 0x11c)) {
          local_8 = 1.0;
          FUN_00408440((undefined4 *)(param_1 + 0xf8),&DAT_004e0f74);
          goto switchD_00432a3d_default;
        }
        *(float *)(param_1 + 0x11c) = *(float *)(param_1 + 0x120) + *(float *)(param_1 + 0x11c);
      }
      local_8 = *(float *)(param_1 + 0x11c) / *(float *)(param_1 + 0x120);
      pfVar1 = (float *)(param_1 + 0xf8);
      FUN_00408644(pfVar1,(float *)(*(int *)(param_1 + 0xd0) + 0x100),(float *)(param_1 + 0x110));
      FUN_004086f8(pfVar1,pfVar1,*(float *)(param_1 + 0x120));
    default:
switchD_00432a3d_default:
      FUN_00432c18(param_1,local_8);
      FUN_0041bbd8(param_1 + 0x2c,unaff_ESI);
      break;
    case 1:
      goto switchD_00432a3d_caseD_1;
    case 2:
      goto switchD_00432a3d_caseD_2;
    case 4:
      goto switchD_00432a3d_caseD_4;
    }
  }
  return;
}



/* @00432c18 file=? name=FUN_00432c18 */

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

void __cdecl FUN_00432c18(int param_1,float param_2)

{
  float *pfVar1;
  float *pfVar2;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  if (((*(int *)(param_1 + 0x40) != *(int *)(param_1 + 0x3c)) &&
      ((*(uint *)(*(int *)(param_1 + 0xd0) + 0x28) & 0xc) == 0)) &&
     ((*(byte *)(*(int *)(param_1 + 0xd0) + 0x29) & 1) != 0)) {
    *(ushort *)(param_1 + 0x18) = *(ushort *)(param_1 + 0x18) | 1;
  }
  if (param_2 != *(float *)(param_1 + 0xe4)) {
    *(float *)(param_1 + 0xe4) = param_2;
    local_8 = *(float *)(param_1 + 0xe4);
    FUN_00408848((float *)(param_1 + 0xec),(float *)&DAT_004e0f80,_DAT_00432d28 - local_8,
                 (float *)(param_1 + 0x104),local_8);
    local_c = *(float *)(param_1 + 0xe4);
    FUN_00408848(&local_18,(float *)(*(int *)(param_1 + 0xd0) + 0x100),_DAT_00432d28 - local_c,
                 (float *)(param_1 + 0x110),local_c);
    pfVar2 = *(float **)(param_1 + 0x130);
    for (pfVar1 = *(float **)(param_1 + 300); pfVar1 != (float *)0x0; pfVar1 = (float *)pfVar1[10])
    {
      *pfVar2 = *pfVar1 + local_18;
      pfVar2[1] = pfVar1[1] + local_18;
      pfVar2[2] = pfVar1[2] + local_14;
      pfVar2[3] = pfVar1[3] + local_14;
      pfVar2[4] = pfVar1[4] + local_10;
      pfVar2[5] = pfVar1[5] + local_10;
      pfVar2 = (float *)pfVar2[10];
    }
  }
  return;
}



/* @00432d2c file=? name=FUN_00432d2c */

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

{
  undefined4 uVar1;
  undefined4 *puVar2;
  int iVar3;
  undefined4 local_9c [15];
  undefined4 local_60 [15];
  float local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  int local_8;
  
  FUN_0041c52c(param_1,param_2,param_3,param_4,&DAT_004e756c);
  *param_1 = &PTR_FUN_004e76cc;
  FUN_00408440(param_1 + 0x41,(undefined4 *)(param_4 + 0x30));
  param_1[0x48] = *(undefined4 *)(param_4 + 0x3c);
  param_1[0x49] = *(undefined4 *)(param_4 + 0x40);
  param_1[0x47] = 0;
  FUN_00408440(param_1 + 0x3b,&DAT_004e0f80);
  param_1[7] = PTR_FUN_004e75f4;
  param_1[8] = DAT_004e75f8;
  param_1[9] = DAT_004e75fc;
  FUN_0041bbd8((int)(param_1 + 0xb),0);
  param_1[0x4a] = 0;
  param_1[0x4b] = 0;
  param_1[0x4c] = 0;
  param_1[0x39] = 0xbf800000;
  FUN_00408b98((float *)(param_1 + 0x44),(float *)(param_1 + 0x41),(float *)(param_2 + 0xd0));
  local_24 = *(float *)(param_2 + 0x100);
  local_20 = *(undefined4 *)(param_2 + 0x104);
  local_1c = *(undefined4 *)(param_2 + 0x108);
  local_18 = *(undefined4 *)(param_2 + 0x10c);
  local_14 = *(undefined4 *)(param_2 + 0x110);
  local_10 = *(undefined4 *)(param_2 + 0x114);
  local_c = *(undefined4 *)(param_2 + 0x118);
  FUN_00408440(&local_24,&DAT_004e0f80);
  local_8 = FUN_00406fd4(*(int *)(DAT_004efc94 + 0x68),*(int *)(param_4 + 0x44));
  iVar3 = *(int *)(local_8 + 4);
  *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + 1;
  if (iVar3 == 0) {
    FUN_00406cd0(local_8);
  }
  puVar2 = *(undefined4 **)(local_8 + 0x3c);
  param_1[0x4a] = *(uint *)(local_8 + 0x40) / 0x3c;
  for (iVar3 = 0; iVar3 < (int)param_1[0x4a]; iVar3 = iVar3 + 1) {
    FUN_0040f33c(local_60,puVar2,(float *)(param_2 + 0x100));
    FUN_0040f33c(local_9c,puVar2,&local_24);
    uVar1 = FUN_0040eed8((int)local_9c,param_1,param_1[0x4b]);
    param_1[0x4b] = uVar1;
    uVar1 = FUN_0040eed8((int)local_60,param_1,param_1[0x4c]);
    param_1[0x4c] = uVar1;
    puVar2 = puVar2 + 0xf;
  }
  *(int *)(local_8 + 4) = *(int *)(local_8 + 4) + -1;
  FUN_00432c18((int)param_1,0.0);
  return param_1;
}



/* @00432f34 file=? name=FUN_00432f34 */

void __cdecl FUN_00432f34(int *param_1,byte param_2)

{
  int iVar1;
  int iVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e76cc;
    iVar1 = param_1[0x4b];
    while (iVar2 = iVar1, iVar2 != 0) {
      iVar1 = *(int *)(iVar2 + 0x28);
      if (iVar2 != 0) {
        (*(code *)**(undefined4 **)(iVar2 + 0x18))(iVar2,3);
      }
    }
    iVar1 = param_1[0x4c];
    while (iVar2 = iVar1, iVar2 != 0) {
      iVar1 = *(int *)(iVar2 + 0x28);
      if (iVar2 != 0) {
        (*(code *)**(undefined4 **)(iVar2 + 0x18))(iVar2,3);
      }
    }
    FUN_0041c648(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00432fa8 file=? name=FUN_00432fa8 */

undefined4 __cdecl
FUN_00432fa8(int param_1,char *param_2,char *param_3,char *param_4,int param_5,int param_6,
            int param_7)

{
  int iVar1;
  undefined4 uVar2;
  char *local_c;
  undefined4 local_8;
  
  iVar1 = FUN_0041c684(param_1,param_2,param_3,param_4,param_5,param_6);
  if (iVar1 == 0) {
    uVar2 = 0;
  }
  else {
    param_4[0x24] = 'H';
    param_4[0x25] = '\0';
    param_4[0x26] = '\0';
    param_4[0x27] = '\0';
    param_4[0x20] = '`';
    param_4[0x21] = '\0';
    param_4[0x22] = '\0';
    param_4[0x23] = '\0';
    iVar1 = FUN_00404088(param_5,param_3,s_MotionExtent_004e763f,&local_8);
    if (iVar1 == 0) {
      FUN_004dbb24((int *)&DAT_00524e68,param_3,(char *)0x0);
      FUN_004dbb24((int *)&DAT_00524e68,s_missing_MotionExtent___004e764c,(char *)0x0);
      uVar2 = 0xffffffff;
    }
    else {
      FUN_004d7f84(local_8,(byte *)s__f__f__f_004e7665);
      iVar1 = FUN_00404118(param_5,param_3,s_TravelTime_004e766e,(float *)(param_4 + 0x3c));
      if (iVar1 == 0) {
        FUN_004dbb24((int *)&DAT_00524e68,param_3,(char *)0x0);
        FUN_004dbb24((int *)&DAT_00524e68,s_missing_TravelTime__004e7679,(char *)0x0);
        uVar2 = 0xffffffff;
      }
      else {
        iVar1 = FUN_00404118(param_5,param_3,s_DeadTime_004e768f,(float *)(param_4 + 0x40));
        if (iVar1 == 0) {
          FUN_004dbb24((int *)&DAT_00524e68,param_3,(char *)0x0);
          FUN_004dbb24((int *)&DAT_00524e68,s_missing_DeadTime__004e7698,(char *)0x0);
          uVar2 = 0;
        }
        else {
          iVar1 = FUN_00404088(param_5,param_3,s_Collision_004e76ac,&local_c);
          if (iVar1 == 0) {
            FUN_004dbb24((int *)&DAT_00524e68,param_3,(char *)0x0);
            FUN_004dbb24((int *)&DAT_00524e68,s_missing_Collision__004e76b6,(char *)0x0);
            uVar2 = 0;
          }
          else {
            uVar2 = FUN_0040f7d8(local_c,param_7,param_6,0);
            *(undefined4 *)(param_4 + 0x44) = uVar2;
            uVar2 = 1;
          }
        }
      }
    }
  }
  return uVar2;
}



/* @00433138 file=? name=FUN_00433138 */

void __cdecl FUN_00433138(int param_1)

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



/* @00433220 file=? name=FUN_00433220 */

undefined4 * __cdecl FUN_00433220(undefined4 *param_1)

{
  FUN_004178cc(param_1,8);
  *param_1 = &PTR_FUN_004e3320;
  param_1[3] = &DAT_004e7748;
  *param_1 = &PTR_FUN_004e78a0;
  return param_1;
}



/* @0043324c file=? name=FUN_0043324c */

void __cdecl FUN_0043324c(int *param_1,byte param_2)

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



/* @00433278 file=? name=FUN_00433278 */

void __cdecl FUN_00433278(int param_1)

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



/* @00433294 file=? name=FUN_00433294 */

undefined4 __cdecl FUN_00433294(int *param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  
  iVar1 = (**(code **)(*param_1 + 0x14))(param_1,*(undefined4 *)(param_2 + 0x1c));
  if (iVar1 != 0) {
    uVar2 = (**(code **)(iVar1 + 0x10))(param_2);
    return uVar2;
  }
  return 0;
}



/* @004332bc file=munga/registry.cpp name=FUN_004332bc */

undefined4 FUN_004332bc(void)

{
  FUN_0040385c(s_Registry__MakeTransferedEntity___004e7764,s_d__tesla_bt_munga_REGISTRY_CPP_004e7798
               ,0xbe);
  return 0;
}



/* @004332dc file=munga/registry.cpp name=FUN_004332dc */

undefined4 FUN_004332dc(void)

{
  FUN_0040385c(s_Registry__MakeEntityReplacement___004e77b7,
               s_d__tesla_bt_munga_REGISTRY_CPP_004e77ec,0xcd);
  return 0;
}



/* @004332fc file=? name=FUN_004332fc */

undefined * __cdecl FUN_004332fc(undefined4 param_1,int param_2)

{
  if (param_2 < 0x40) {
    if (param_2 == 0x3f) {
      return &DAT_004e6604;
    }
    if (param_2 < 0x31) {
      if (param_2 == 0x30) {
        return &DAT_004e6bc0;
      }
      if (param_2 == 0x10) {
        return &DAT_004e3d40;
      }
      if (param_2 == 0x29) {
        return &DAT_004e6f28;
      }
      if (param_2 == 0x2a) {
        return &DAT_004e6f84;
      }
    }
    else {
      if (param_2 == 0x31) {
        return &DAT_004e6cc4;
      }
      if (param_2 == 0x32) {
        return &DAT_004e6714;
      }
    }
  }
  else if (param_2 < 0x59) {
    if (param_2 == 0x58) {
      return &DAT_004e5b04;
    }
    if (param_2 == 0x45) {
      return &DAT_004e62a8;
    }
    if (param_2 == 0x46) {
      return &DAT_004e6ad4;
    }
    if (param_2 == 0x56) {
      return &DAT_004e70f4;
    }
  }
  else {
    if (param_2 == 0x5e) {
      return &DAT_004e7068;
    }
    if (param_2 == 0x5f) {
      return &DAT_004e747c;
    }
  }
  return (undefined *)0x0;
}



/* @004333b0 file=? name=FUN_004333b0 */

undefined4 * __cdecl FUN_004333b0(undefined4 param_1,int param_2)

{
  char *pcVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  undefined4 *puVar5;
  char *pcVar6;
  uint uVar7;
  bool bVar8;
  undefined4 local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98 [2];
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84 [2];
  undefined4 local_7c;
  uint local_78;
  undefined4 local_74;
  undefined4 local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48 [2];
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34 [2];
  undefined4 local_2c;
  uint local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  pcVar6 = s_camera_004e780b;
  uVar7 = 0x5100;
  pcVar4 = *(char **)(param_2 + 0x2c);
  do {
    if (*pcVar4 != *pcVar6) goto LAB_004333ef;
    bVar8 = true;
    if (*pcVar4 == '\0') break;
    pcVar1 = pcVar4 + 1;
    if (*pcVar1 != pcVar6[1]) goto LAB_004333ef;
    pcVar4 = pcVar4 + 2;
    pcVar6 = pcVar6 + 2;
    bVar8 = *pcVar1 == '\0';
  } while (!bVar8);
  if (bVar8) {
    uVar7 = 0xd100;
  }
LAB_004333ef:
  iVar2 = *(int *)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x14) + 0x10);
  if (iVar2 == 0) {
    uVar3 = *(undefined4 *)(param_2 + 0x4c);
    local_54 = 0x50;
    local_50 = 3;
    local_4c = 1;
    FUN_00420ea4(local_48,(undefined4 *)&DAT_00522524);
    local_40 = 0;
    local_3c = 0;
    local_38 = 0x32;
    FUN_00420ea4(local_34,(undefined4 *)&DAT_00522524);
    local_2c = 0xffffffff;
    local_24 = DAT_004e0fec;
    local_20 = DAT_004e0ff0;
    local_1c = DAT_004e0ff4;
    local_18 = DAT_004e0ff8;
    local_14 = DAT_004e0ffc;
    local_10 = DAT_004e1000;
    local_c = DAT_004e1004;
    local_28 = uVar7;
    local_8 = uVar3;
    puVar5 = (undefined4 *)FUN_00402298(0x20c);
    if (puVar5 == (undefined4 *)0x0) {
      puVar5 = (undefined4 *)0x0;
    }
    else {
      puVar5 = FUN_0042e328(puVar5,(int)&local_54,&DAT_004e6714);
    }
  }
  else if (iVar2 - 1U < 2) {
    uVar3 = *(undefined4 *)(param_2 + 0x4c);
    local_a4 = 0x50;
    local_a0 = 3;
    local_9c = 1;
    FUN_00420ea4(local_98,(undefined4 *)&DAT_00522524);
    local_90 = 0;
    local_8c = 0;
    local_88 = 0x46;
    FUN_00420ea4(local_84,(undefined4 *)&DAT_00522524);
    local_7c = 0xffffffff;
    local_74 = DAT_004e0fec;
    local_70 = DAT_004e0ff0;
    local_6c = DAT_004e0ff4;
    local_68 = DAT_004e0ff8;
    local_64 = DAT_004e0ffc;
    local_60 = DAT_004e1000;
    local_5c = DAT_004e1004;
    local_78 = uVar7 | 0x9100;
    local_58 = uVar3;
    puVar5 = (undefined4 *)FUN_00402298(0x238);
    if (puVar5 == (undefined4 *)0x0) {
      puVar5 = (undefined4 *)0x0;
    }
    else {
      puVar5 = FUN_0042eec8(puVar5,(int)&local_a4,&DAT_004e6ad4);
    }
  }
  else {
    puVar5 = (undefined4 *)0x0;
  }
  return puVar5;
}



/* @004335b8 file=? name=FUN_004335b8 */

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

{
  undefined4 local_14 [2];
  int local_c;
  
  FUN_004030dc(local_14,param_2,*param_2,0);
  local_c = local_c + 0xc;
  FUN_00433294(param_1,local_c);
  return;
}



/* @004335f0 file=? name=FUN_004335f0 */

undefined4 __cdecl FUN_004335f0(undefined4 param_1,int param_2)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  int local_2c [10];
  
  FUN_0043377c(local_2c);
  (**(code **)(local_2c[0] + 0x28))(local_2c,param_1,param_2);
  puVar1 = (undefined4 *)
           FUN_00406f3c(param_2,s_RegistryStaticObjectStream_004e7812,0x1c,1,0,local_2c,-1);
  uVar2 = *puVar1;
  FUN_00433798(local_2c,2);
  return uVar2;
}



/* @0043364c file=? name=FUN_0043364c */

void FUN_0043364c(void)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int local_30 [10];
  uint local_8;
  
  iVar4 = 0;
  iVar1 = *(int *)(DAT_004efc94 + 0x68);
  local_8 = *(uint *)(iVar1 + 0x18);
  if (local_8 < 0x80000000) {
    do {
      iVar3 = FUN_00406fd4(iVar1,iVar4);
      if ((iVar3 != 0) && (*(int *)(iVar3 + 8) == 0x1c)) {
        iVar2 = *(int *)(iVar3 + 4);
        *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;
        if (iVar2 == 0) {
          FUN_00406cd0(iVar3);
        }
        FUN_0043375c(local_30,iVar3);
        (**(code **)(local_30[0] + 0x24))(local_30);
        *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + -1;
        FUN_00433798(local_30,2);
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 <= (int)local_8);
  }
  FUN_0040717c(iVar1);
  return;
}



/* @004336d4 file=? name=FUN_004336d4 */

void __cdecl FUN_004336d4(undefined4 *param_1,undefined4 param_2)

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



/* @004336f0 file=? name=FUN_004336f0 */

undefined4 __cdecl FUN_004336f0(uint *param_1)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  uint uVar3;
  undefined4 local_14 [2];
  undefined4 *local_c;
  
  uVar3 = *param_1 + 0xc;
  uVar1 = FUN_004022b0(uVar3);
  FUN_004030dc(local_14,uVar1,uVar3,0);
  puVar2 = (undefined4 *)FUN_004022c8(0xc,local_c);
  if (puVar2 == (undefined4 *)0x0) {
    uVar1 = 0;
  }
  else {
    uVar1 = FUN_004336d4(puVar2,uVar3);
  }
  local_c = (undefined4 *)((int)local_c + 0xc);
  FUN_004d4918(local_c,param_1,*param_1);
  return uVar1;
}



/* @0043375c file=? name=FUN_0043375c */

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

{
  FUN_00416fdc(param_1,param_2);
  *param_1 = &PTR_FUN_004e7864;
  return param_1;
}



/* @0043377c file=? name=FUN_0043377c */

undefined4 * __cdecl FUN_0043377c(undefined4 *param_1)

{
  FUN_00416f88(param_1);
  *param_1 = &PTR_FUN_004e7864;
  return param_1;
}



/* @00433798 file=? name=FUN_00433798 */

void __cdecl FUN_00433798(int *param_1,byte param_2)

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



/* @004337c4 file=? name=FUN_004337c4 */

undefined8 __cdecl FUN_004337c4(int param_1)

{
  undefined8 uVar1;
  
  uVar1 = FUN_00417034(param_1);
  return CONCAT44((int)((ulonglong)uVar1 >> 0x20),1);
}



/* @004337d8 file=? name=FUN_004337d8 */

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

{
  undefined4 *puVar1;
  
  if (param_2 == 0x47) {
    puVar1 = (undefined4 *)FUN_00402298(0x24);
    if (puVar1 == (undefined4 *)0x0) {
      puVar1 = (undefined4 *)0x0;
    }
    else {
      puVar1 = FUN_004304ec(puVar1,param_1);
    }
  }
  else {
    puVar1 = (undefined4 *)FUN_0041639c();
  }
  return puVar1;
}



/* @00433818 file=? name=FUN_00433818 */

void __cdecl FUN_00433818(undefined4 param_1,int param_2)

{
  if (*(int *)(param_2 + 4) == 0x47) {
    FUN_004170cc(param_1,param_2);
  }
  return;
}



/* @0043383c file=? name=FUN_0043383c */

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

{
  if (param_3 == 0x47) {
    FUN_00430608(param_1,param_2);
  }
  else {
    FUN_00416db0();
  }
  return;
}



/* @00433874 file=? name=FUN_00433874 */

void __cdecl FUN_00433874(undefined4 param_1,int param_2,undefined4 param_3,undefined4 param_4)

{
  if (param_2 == 0x47) {
    FUN_004171f0(param_1,param_3,param_4);
  }
  return;
}



/* @00433920 file=? name=FUN_00433920 */

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

{
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e79d0;
  FUN_00434183(param_1 + 3,param_2,param_1);
  return param_1;
}



/* @00433950 file=? name=FUN_00433950 */

void __cdecl FUN_00433950(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e79d0;
    FUN_004341a7(param_1 + 3,2);
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043398c file=? name=FUN_0043398c */

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

{
  FUN_00433920(param_1,param_2);
  *param_1 = &PTR_FUN_004e79cc;
  param_1[0xb] = *param_3;
  param_1[0xc] = param_3[1];
  param_1[0xd] = param_3[2];
  param_1[0xe] = param_3[3];
  param_1[0xf] = param_3[4];
  param_1[0x13] = param_3[8];
  FUN_00408440(param_1 + 0x10,param_3 + 5);
  return param_1;
}



/* @004339ec file=? name=FUN_004339ec */

void __cdecl FUN_004339ec(int *param_1,byte param_2)

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



/* @00433a18 file=? name=FUN_00433a18 */

undefined4 FUN_00433a18(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00433a2c file=? name=FUN_00433a2c */

undefined4 * __cdecl
FUN_00433a2c(undefined4 *param_1,undefined4 *param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6)

{
  FUN_00433920(param_1,param_2);
  *param_1 = &PTR_FUN_004e79c8;
  param_1[0xb] = param_3;
  param_1[0xc] = param_4;
  param_1[0xd] = param_5;
  param_1[0xe] = 0;
  param_1[0xf] = param_6;
  return param_1;
}



/* @00433a68 file=? name=FUN_00433a68 */

void __cdecl FUN_00433a68(int *param_1,byte param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e79c8;
    piVar1 = (int *)param_1[0xc];
    if (piVar1 != (int *)0x0) {
      FUN_0040eabc(piVar1);
      FUN_004022d0(piVar1);
    }
    param_1[0xc] = 0;
    puVar2 = (undefined4 *)param_1[0xd];
    if (puVar2 != (undefined4 *)0x0) {
      (**(code **)*puVar2)(puVar2,3);
    }
    param_1[0xd] = 0;
    piVar1 = (int *)param_1[0xf];
    if (piVar1 != (int *)0x0) {
      FUN_0040eabc(piVar1);
      FUN_004022d0(piVar1);
    }
    param_1[0xf] = 0;
    if ((int *)param_1[0xe] != (int *)0x0) {
      FUN_00434a48(*(undefined4 *)(DAT_004efc94 + 0x30),(int *)param_1[0xe]);
      puVar2 = (undefined4 *)param_1[0xe];
      param_1[0xe] = 0;
      if (puVar2 != (undefined4 *)0x0) {
        (**(code **)*puVar2)(puVar2,3);
      }
    }
    FUN_00433950(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00433b14 file=? name=FUN_00433b14 */

undefined4 FUN_00433b14(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00433b3c file=? name=FUN_00433b3c */

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

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e79bc;
  FUN_004341d4(param_1 + 3,0);
  (**(code **)(param_1[3] + 4))(param_1 + 3,param_2);
  return param_1;
}



/* @00433b78 file=? name=FUN_00433b78 */

void __cdecl FUN_00433b78(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e79bc;
    FUN_00417a5c((int)(param_1 + 3));
    FUN_004341f3(param_1 + 3,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00433bbc file=? name=FUN_00433bbc */

undefined4 FUN_00433bbc(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00433bd0 file=? name=FUN_00433bd0 */

undefined4 * __cdecl FUN_00433bd0(undefined4 *param_1)

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e79b0;
  return param_1;
}



/* @00433bf0 file=? name=FUN_00433bf0 */

void __cdecl FUN_00433bf0(int *param_1,byte param_2)

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



/* @00433c1c file=? name=FUN_00433c1c */

undefined4 * __cdecl FUN_00433c1c(undefined4 *param_1)

{
  FUN_00433bd0(param_1);
  *param_1 = &PTR_FUN_004e79a4;
  FUN_004341d4(param_1 + 3,0);
  return param_1;
}



/* @00433c44 file=? name=FUN_00433c44 */

void __cdecl FUN_00433c44(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e79a4;
    puVar1 = (undefined4 *)FUN_00417ab4((int)(param_1 + 3));
    if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
    FUN_004341f3(param_1 + 3,2);
    FUN_00433bf0(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00433ca0 file=? name=FUN_00433ca0 */

undefined4 FUN_00433ca0(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00433cb4 file=? name=FUN_00433cb4 */

undefined4 * __cdecl FUN_00433cb4(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  int *piVar4;
  undefined4 *puVar5;
  undefined4 local_8c [6];
  int local_74 [4];
  undefined4 local_64 [9];
  undefined4 local_40 [6];
  int local_28 [4];
  undefined4 *local_18;
  int *local_14;
  undefined4 local_10;
  int local_c;
  undefined4 *local_8;
  
  puVar2 = (undefined4 *)FUN_00417ab4(param_1 + 0xc);
  if (puVar2 == (undefined4 *)0x0) {
    local_c = *(int *)(DAT_004efc94 + 0x68);
    iVar3 = FUN_00406ff8(local_c,s_EnvironmentZone_004e78bc,0x17,-1);
    if (iVar3 != 0) {
      iVar1 = *(int *)(iVar3 + 4);
      *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;
      if (iVar1 == 0) {
        FUN_00406cd0(iVar3);
      }
      FUN_004030dc(local_28,*(undefined4 *)(iVar3 + 0x3c),*(undefined4 *)(iVar3 + 0x40),0);
      piVar4 = (int *)(**(code **)(local_28[0] + 0x1c))(local_28,local_40,0x18);
      (**(code **)(*piVar4 + 0x1c))(piVar4,local_64,0x24);
      *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + -1;
      puVar5 = (undefined4 *)FUN_00402298(0x50);
      if (puVar5 == (undefined4 *)0x0) {
        local_8 = (undefined4 *)0x0;
      }
      else {
        local_8 = FUN_0043398c(puVar5,local_40,local_64);
      }
    }
    iVar3 = FUN_00406ff8(local_c,s_InterestZone_004e78cc,0x18,-1);
    if (iVar3 != 0) {
      iVar1 = *(int *)(iVar3 + 4);
      *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + 1;
      if (iVar1 == 0) {
        FUN_00406cd0(iVar3);
      }
      FUN_004030dc(local_74,*(undefined4 *)(iVar3 + 0x3c),*(undefined4 *)(iVar3 + 0x40),0);
      puVar2 = (undefined4 *)FUN_00402298(0x10);
      if (puVar2 == (undefined4 *)0x0) {
        local_14 = (int *)0x0;
      }
      else {
        local_14 = (int *)FUN_004023f4(puVar2);
      }
      local_14[3] = local_14[3] + 1;
      piVar4 = (int *)(**(code **)(local_74[0] + 0x1c))(local_74,local_8c,0x18);
      piVar4 = (int *)(**(code **)(*piVar4 + 0x1c))(piVar4,&local_10,4);
      FUN_00402aec(piVar4,(int *)&local_14);
      *(int *)(iVar3 + 4) = *(int *)(iVar3 + 4) + -1;
      puVar2 = (undefined4 *)FUN_00402298(4);
      if (puVar2 != (undefined4 *)0x0) {
        *puVar2 = 0;
      }
      local_18 = (undefined4 *)FUN_00402298(4);
      if (local_18 != (undefined4 *)0x0) {
        *local_18 = 0;
      }
      puVar5 = (undefined4 *)FUN_00402298(0x40);
      if (puVar5 == (undefined4 *)0x0) {
        puVar2 = (undefined4 *)0x0;
      }
      else {
        puVar2 = FUN_00433a2c(puVar5,local_8c,local_10,puVar2,local_8,local_18);
      }
      piVar4 = local_14 + 3;
      *piVar4 = *piVar4 + -1;
      if (*piVar4 == 0) {
        FUN_004024d8(local_14,3);
      }
    }
    (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar2);
  }
  puVar5 = (undefined4 *)FUN_00402298(0x18);
  if (puVar5 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_00433b3c(puVar5,puVar2);
  }
  return puVar2;
}



/* @00433eb8 file=? name=FUN_00433eb8 */

undefined4 __cdecl FUN_00433eb8(int param_1)

{
  int iVar1;
  
  iVar1 = FUN_00417ab4(param_1 + 0xc);
  return *(undefined4 *)(iVar1 + 0x2c);
}



/* @00433ed4 file=? name=FUN_00433ed4 */

void __cdecl FUN_00433ed4(int param_1)

{
  FUN_00417ab4(param_1 + 0xc);
  return;
}



/* @00433ee8 file=? name=FUN_00433ee8 */

void __cdecl FUN_00433ee8(int param_1,int param_2)

{
  int *piVar1;
  uint *puVar2;
  undefined4 *puVar3;
  int local_a4 [6];
  float local_8c [6];
  int local_74 [6];
  float local_5c [9];
  float local_38 [6];
  uint *local_20;
  int *local_1c;
  char *local_18;
  int *local_14;
  int local_10;
  uint *local_c;
  char *local_8;
  
  FUN_00404088(param_2,s_EnvironmentZone_004e78d9,s_extent_box_004e78e9,&local_8);
  FUN_0040d62c(local_8,local_38);
  FUN_00404088(param_2,s_EnvironmentZone_004e78f4,s_environment_004e7904,&local_8);
  FUN_00421658(local_8,local_5c);
  FUN_0040328c(local_74,0);
  piVar1 = (int *)(**(code **)(local_74[0] + 0x20))(local_74,local_38,0x18);
  (**(code **)(*piVar1 + 0x20))(piVar1,local_5c,0x24);
  puVar2 = (uint *)FUN_00402298(0x10);
  if (puVar2 == (uint *)0x0) {
    local_c = (uint *)0x0;
  }
  else {
    local_c = FUN_00402460(puVar2,s_EnvironmentZone_004e7910);
  }
  local_c[3] = local_c[3] + 1;
  FUN_00406f3c(param_1,(char *)local_c[2],0x17,1,0,local_74,-1);
  puVar2 = local_c + 3;
  *puVar2 = *puVar2 - 1;
  if (*puVar2 == 0) {
    FUN_004024d8((int *)local_c,3);
  }
  FUN_00403310(local_74,2);
  puVar3 = (undefined4 *)FUN_00402298(0x10);
  if (puVar3 == (undefined4 *)0x0) {
    local_14 = (int *)0x0;
  }
  else {
    local_14 = (int *)FUN_004023f4(puVar3);
  }
  local_14[3] = local_14[3] + 1;
  FUN_00404088(param_2,s_InterestZone_004e7920,s_extent_box_004e792d,&local_18);
  FUN_0040d62c(local_18,local_8c);
  FUN_00404088(param_2,s_InterestZone_004e7938,s_interest_zone_ID_004e7945,&local_18);
  FUN_00407ae0(local_18,&local_10);
  FUN_00404088(param_2,s_InterestZone_004e7956,s_map_resource_name_004e7963,&local_18);
  FUN_00402a98((int *)&local_1c,(int *)&local_14,local_18);
  piVar1 = local_1c + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_1c,3);
  }
  FUN_0040328c(local_a4,0);
  piVar1 = (int *)(**(code **)(local_a4[0] + 0x20))(local_a4,local_8c,0x18);
  (**(code **)(*piVar1 + 0x20))(piVar1,&local_10,4);
  FUN_004029b0(local_a4,(int)local_14);
  puVar2 = (uint *)FUN_00402298(0x10);
  if (puVar2 == (uint *)0x0) {
    local_20 = (uint *)0x0;
  }
  else {
    local_20 = FUN_00402460(puVar2,s_InterestZone_004e7975);
  }
  local_20[3] = local_20[3] + 1;
  FUN_00406f3c(param_1,(char *)local_20[2],0x18,1,0,local_a4,-1);
  puVar2 = local_20 + 3;
  *puVar2 = *puVar2 - 1;
  if (*puVar2 == 0) {
    FUN_004024d8((int *)local_20,3);
  }
  FUN_00403310(local_a4,2);
  piVar1 = local_14 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_14,3);
  }
  return;
}



/* @00434163 file=? name=FUN_00434163 */

int __cdecl FUN_00434163(int param_1,undefined4 param_2)

{
  FUN_0040deb0(param_1,param_2);
  *(undefined ***)(param_1 + 0x18) = &PTR_FUN_004e798c;
  return param_1;
}



/* @00434183 file=? name=FUN_00434183 */

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

{
  FUN_0040ded0(param_1,param_2,param_3);
  param_1[6] = &PTR_FUN_004e798c;
  return param_1;
}



/* @004341a7 file=? name=FUN_004341a7 */

void __cdecl FUN_004341a7(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    param_1[6] = (int)&PTR_FUN_004e798c;
    FUN_0040def8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004341d4 file=? name=FUN_004341d4 */

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

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



/* @004341f3 file=? name=FUN_004341f3 */

void __cdecl FUN_004341f3(int *param_1,byte param_2)

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



/* @00434220 file=? name=FUN_00434220 */

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

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e7b04;
  FUN_00434364(param_1 + 6,0);
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = param_4;
  return param_1;
}



/* @00434260 file=? name=FUN_00434260 */

void __cdecl FUN_00434260(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e7b04;
    puVar1 = (undefined4 *)FUN_00417ab4((int)(param_1 + 6));
    if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
    FUN_00434383(param_1 + 6,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004342bc file=? name=FUN_004342bc */

undefined4 FUN_004342bc(void)

{
  FUN_00415f1c();
  return 1;
}



/* @004342d0 file=? name=FUN_004342d0 */

void __cdecl FUN_004342d0(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = FUN_00417ab4(param_1 + 0x18);
  if (iVar1 == 0) {
    puVar2 = FUN_00433cb4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
    (**(code **)(*(int *)(param_1 + 0x18) + 4))(param_1 + 0x18,puVar2);
  }
  return;
}



/* @00434310 file=munga/intorgn.cpp name=FUN_00434310 */

void FUN_00434310(void)

{
  FUN_0040385c(s_InterestOrigin__AddInterestingEn_004e79d4,s_d__tesla_bt_munga_INTORGN_CPP_004e7a14,
               0x9b);
  return;
}



/* @0043432c file=munga/intorgn.cpp name=FUN_0043432c */

void FUN_0043432c(void)

{
  FUN_0040385c(s_InterestOrigin__RemoveUninterest_004e7a32,s_d__tesla_bt_munga_INTORGN_CPP_004e7a77,
               0xa5);
  return;
}



/* @00434348 file=munga/intorgn.cpp name=FUN_00434348 */

void FUN_00434348(void)

{
  FUN_0040385c(s_InterestOrigin__RemoveUninterest_004e7a95,s_d__tesla_bt_munga_INTORGN_CPP_004e7adc,
               0xaf);
  return;
}



/* @00434364 file=? name=FUN_00434364 */

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

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



/* @00434383 file=? name=FUN_00434383 */

void __cdecl FUN_00434383(int *param_1,byte param_2)

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



/* @004343b0 file=? name=FUN_004343b0 */

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

{
  FUN_00434220(param_1,param_2,3,1);
  *param_1 = &PTR_FUN_004e7b74;
  FUN_00428cb4(param_1 + 9,0);
  return param_1;
}



/* @004343e4 file=? name=FUN_004343e4 */

void __cdecl FUN_004343e4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e7b74;
    FUN_00428cd3(param_1 + 9,2);
    FUN_00434260(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00434420 file=? name=FUN_00434420 */

undefined4 FUN_00434420(void)

{
  FUN_004342bc();
  return 1;
}



/* @00434434 file=? name=FUN_00434434 */

void __cdecl FUN_00434434(int param_1,int param_2)

{
  int iVar1;
  
  if ((*(byte *)(param_2 + 0x29) & 1) != 0) {
    iVar1 = FUN_0041a1a4(**(int **)(param_2 + 0xc),0x4e4518);
    if (iVar1 == 0) {
      iVar1 = FUN_0041a1a4(**(int **)(param_2 + 0xc),0x4e744c);
      if (iVar1 != 0) {
        (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
      }
    }
    else if ((*(byte *)(param_2 + 0x29) & 0x80) == 0) {
      (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
    }
  }
  return;
}



/* @004344a4 file=? name=FUN_004344a4 */

void __cdecl FUN_004344a4(int param_1,int param_2)

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



/* @004344e4 file=? name=FUN_004344e4 */

void __cdecl FUN_004344e4(int param_1)

{
  int iVar1;
  int local_18 [5];
  
  FUN_00428cff(local_18,param_1 + 0x24);
  while( true ) {
    iVar1 = (**(code **)(local_18[0] + 0x30))(local_18);
    if (iVar1 == 0) break;
    (**(code **)(local_18[0] + 0x48))(local_18);
  }
  FUN_00428d5c(local_18,2);
  return;
}



/* @0043452c file=? name=FUN_0043452c */

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

{
  FUN_00428d1e(param_1,param_2 + 0x24);
  *param_1 = &PTR_FUN_004e7b20;
  return param_1;
}



/* @00434550 file=? name=FUN_00434550 */

void __cdecl FUN_00434550(int *param_1,byte param_2)

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



/* @0043457c file=? name=FUN_0043457c */

undefined4 * __cdecl FUN_0043457c(undefined4 *param_1)

{
  FUN_0041d520(param_1,0x15,&DAT_004e7b90,3);
  *param_1 = &PTR_FUN_004e8074;
  FUN_00433c1c(param_1 + 5);
  FUN_00435375(param_1 + 0xb,0);
  param_1[0x10] = 0;
  return param_1;
}



/* @004345c0 file=? name=FUN_004345c0 */

void __cdecl FUN_004345c0(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e8074;
    puVar1 = (undefined4 *)param_1[0x10];
    if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
    FUN_00435394(param_1 + 0xb,2);
    FUN_00433c44(param_1 + 5,2);
    FUN_0041d554(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00434620 file=? name=FUN_00434620 */

undefined4 __cdecl FUN_00434620(int param_1)

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



/* @00434648 file=? name=FUN_00434648 */

void __cdecl FUN_00434648(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = FUN_00433cb4(param_1 + 0x14);
  *(undefined4 **)(param_1 + 0x40) = puVar1;
  return;
}



/* @00434668 file=? name=FUN_00434668 */

void __cdecl FUN_00434668(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  int local_30 [4];
  uint local_20;
  int *local_1c;
  undefined4 local_18;
  uint local_14;
  undefined4 local_10 [2];
  int local_8;
  
  if (*(int *)(param_2 + 4) != -1) {
    local_8 = *(int *)(DAT_004efc94 + 0x68);
    iVar1 = FUN_00406fd4(local_8,*(int *)(param_2 + 4));
    iVar2 = *(int *)(iVar1 + 4);
    *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + 1;
    if (iVar2 == 0) {
      FUN_00406cd0(iVar1);
    }
    FUN_004030dc(local_30,*(undefined4 *)(iVar1 + 0x3c),*(undefined4 *)(iVar1 + 0x40),0);
    FUN_00420ebc(local_10,0xffffffff);
    local_14 = 0;
    FUN_004347ac(param_1,local_30,(float *)&DAT_004e0fec,local_10,&local_14);
    *(int *)(iVar1 + 4) = *(int *)(iVar1 + 4) + -1;
    iVar2 = FUN_00406fd4(local_8,*(int *)(param_2 + 8));
    if (iVar2 != 0) {
      iVar1 = *(int *)(iVar2 + 4);
      *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + 1;
      if (iVar1 == 0) {
        FUN_00406cd0(iVar2);
      }
      iVar1 = FUN_00417ab4(*(int *)(param_1 + 0x40) + 0xc);
      local_18 = *(undefined4 *)(iVar1 + 0x2c);
      iVar1 = FUN_00433ed4(param_1 + 0x14);
      local_1c = *(int **)(iVar1 + 0x3c);
      puVar4 = *(undefined4 **)(iVar2 + 0x3c);
      local_20 = *(uint *)(iVar2 + 0x40) / 0x18;
      while (local_20 != 0) {
        local_20 = local_20 - 1;
        puVar3 = (undefined4 *)FUN_00402298(0x1c);
        if (puVar3 == (undefined4 *)0x0) {
          puVar3 = (undefined4 *)0x0;
        }
        else {
          puVar3 = FUN_0040dac4(puVar3,puVar4);
        }
        FUN_0040ea6c(local_1c,(int)puVar3,puVar3);
        puVar4 = puVar4 + 6;
      }
      *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + -1;
      local_20 = 0xffffffff;
    }
    FUN_0040717c(local_8);
  }
  return;
}



/* @004347ac file=munga/interest.cpp name=FUN_004347ac */

void __cdecl
FUN_004347ac(undefined4 param_1,int *param_2,float *param_3,undefined4 *param_4,uint *param_5)

{
  uint uVar1;
  bool bVar2;
  uint *puVar3;
  int iVar4;
  int iVar5;
  uint *puVar6;
  int local_48 [4];
  float local_38;
  uint local_34;
  uint local_30;
  uint local_2c;
  uint local_28;
  uint local_24;
  uint local_20;
  uint *local_1c;
  float *local_18;
  int local_14;
  uint *local_10;
  int local_c;
  int local_8;
  
  (**(code **)(*param_2 + 0x1c))(param_2);
  local_c = 0;
  if (0 < local_8) {
    do {
      puVar3 = (uint *)(**(code **)*param_2)();
      if ((puVar3[2] & 4) == 0) {
        bVar2 = true;
        if ((*(byte *)((int)puVar3 + 0x2d) & 8) != 0) {
          local_14 = *(int *)(DAT_004efc94 + 0x2c);
          FUN_00420ea4((undefined4 *)&stack0xffffffa4,puVar3 + 3);
          iVar5 = FUN_004291ec(local_14);
          iVar4 = FUN_0042904c(local_14);
          if (iVar5 != iVar4) {
            bVar2 = false;
          }
        }
        if (bVar2) {
          puVar6 = (uint *)FUN_004022b0(*puVar3);
          FUN_004d4918(puVar6,puVar3,*puVar3);
          local_18 = (float *)(puVar6 + 0xc);
          FUN_004085ec(local_18,local_18,param_3);
          if (puVar6[7] == 0x56) {
            uVar1 = *param_5;
            *param_5 = *param_5 + 1;
            puVar6[0x13] = uVar1;
          }
          if ((*(byte *)((int)puVar6 + 0x2d) & 1) == 0) {
            FUN_00420f6c((int)param_4,1);
            FUN_00420ef4(puVar6 + 3,param_4);
          }
          local_1c = (uint *)FUN_004336f0(puVar6);
          FUN_004350d4(param_1,local_1c);
          FUN_004022d0((int *)local_1c);
          FUN_004022d0((int *)puVar6);
        }
        (**(code **)(*param_2 + 0x14))();
      }
      else {
        if (puVar3[1] == 3) {
          local_10 = puVar3;
          iVar4 = FUN_00406fd4(*(int *)(DAT_004efc94 + 0x68),puVar3[3]);
          iVar5 = *(int *)(iVar4 + 4);
          *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + 1;
          if (iVar5 == 0) {
            FUN_00406cd0(iVar4);
          }
          local_38 = (float)local_10[4];
          local_34 = local_10[5];
          local_30 = local_10[6];
          local_2c = local_10[7];
          local_28 = local_10[8];
          local_24 = local_10[9];
          local_20 = local_10[10];
          FUN_004085ec(&local_38,&local_38,param_3);
          FUN_004030dc(local_48,*(undefined4 *)(iVar4 + 0x3c),*(undefined4 *)(iVar4 + 0x40),0);
          FUN_004347ac(param_1,local_48,&local_38,param_4,param_5);
          *(int *)(iVar4 + 4) = *(int *)(iVar4 + 4) + -1;
        }
        else {
          FUN_0040385c(s_Unknown_message_marker_in_map_st_004e7d5c,
                       s_d__tesla_bt_munga_INTEREST_CPP_004e7d83,0x19f);
        }
        (**(code **)(*param_2 + 0x14))();
      }
      local_c = local_c + 1;
    } while (local_c < local_8);
  }
  return;
}



/* @004349e4 file=? name=FUN_004349e4 */

void __cdecl FUN_004349e4(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = *(undefined4 **)(param_1 + 0x40);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x40) = 0;
  }
  return;
}



/* @00434a08 file=? name=FUN_00434a08 */

void FUN_00434a08(void)

{
  return;
}



/* @00434a10 file=? name=FUN_00434a10 */

void __cdecl FUN_00434a10(int param_1,int *param_2)

{
  (**(code **)(*(int *)(param_1 + 0x2c) + 4))(param_1 + 0x2c,param_2);
  (**(code **)(*param_2 + 0xc))(param_2,param_2[3]);
  FUN_00435080(param_1,param_2);
  return;
}



/* @00434a48 file=? name=FUN_00434a48 */

void __cdecl FUN_00434a48(undefined4 param_1,int *param_2)

{
  FUN_00435230(param_1,param_2);
  return;
}



/* @00434a60 file=munga/interest.cpp name=FUN_00434a60 */

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

{
  uint uVar1;
  int iVar2;
  
  uVar1 = *(uint *)(param_2 + 0x28) & 0xc;
  if (uVar1 == 0) {
    FUN_00434b4c(param_1,param_2,param_3);
  }
  else if (uVar1 == 4) {
    FUN_00434c80((int)param_1,param_2);
  }
  else if (uVar1 == 8) {
    iVar2 = FUN_0042904c(*(int *)(DAT_004efc94 + 0x2c));
    if (iVar2 == *(int *)(param_2 + 0x18c)) {
      FUN_00434b4c(param_1,param_2,param_3);
    }
    else {
      FUN_00434c80((int)param_1,param_2);
    }
  }
  else if (uVar1 == 0xc) {
    if ((*(byte *)(param_2 + 0x29) & 1) == 0) {
      FUN_00434b18((int)param_1,param_2);
    }
    else {
      FUN_00434b4c(param_1,param_2,param_3);
    }
  }
  else {
    FUN_0040385c(s_InterestManager__NotifyOfEntityC_004e7da2,
                 s_d__tesla_bt_munga_INTEREST_CPP_004e7de4,0x321);
  }
  return;
}



/* @00434b18 file=? name=FUN_00434b18 */

void __cdecl FUN_00434b18(int param_1,int param_2)

{
  undefined4 uVar1;
  
  uVar1 = FUN_00433eb8(param_1 + 0x14);
  *(undefined4 *)(param_2 + 0x194) = uVar1;
  FUN_00434fe0(param_1,param_2);
  return;
}



/* @00434b4c file=? name=FUN_00434b4c */

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

{
  undefined4 uVar1;
  uint uVar2;
  
  uVar1 = FUN_00433eb8((int)(param_1 + 5));
  *(undefined4 *)(param_2 + 0x194) = uVar1;
  FUN_00420ef4((undefined4 *)(param_3 + 0xc),(undefined4 *)(param_2 + 0x184));
  *(undefined4 *)(param_3 + 0x14) = *(undefined4 *)(param_2 + 0x194);
  *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_2 + 0x18c);
  *(undefined4 *)(param_3 + 4) = 3;
  uVar2 = *(uint *)(param_2 + 0x28) & 0xc;
  if ((uVar2 == 0) || (uVar2 == 8)) {
    FUN_0041d7b0(*(int **)(DAT_004efc94 + 0x20),param_3,3);
  }
  else {
    (**(code **)(*param_1 + 0xc))(param_1,param_3);
  }
  return;
}



/* @00434be0 file=? name=FUN_00434be0 */

void __cdecl FUN_00434be0(int param_1,uint *param_2)

{
  uint uVar1;
  int *piVar2;
  int iVar3;
  
  uVar1 = FUN_0042904c(*(int *)(DAT_004efc94 + 0x2c));
  if (uVar1 == param_2[6]) {
    iVar3 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                      (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 3);
    FUN_004206e8(iVar3);
    FUN_00434fe0(param_1,iVar3);
  }
  else {
    param_2[1] = 3;
    if ((param_2[0xb] & 0xc) == 0) {
      param_2[0xb] = param_2[0xb] & 0xfffffff3 | 4;
    }
    piVar2 = (int *)FUN_004336f0(param_2);
    (**(code **)(**(int **)(DAT_004efc94 + 0x28) + 0xc))(*(int **)(DAT_004efc94 + 0x28),piVar2);
    FUN_004022d0(piVar2);
  }
  return;
}



/* @00434c80 file=? name=FUN_00434c80 */

void __cdecl FUN_00434c80(int param_1,int param_2)

{
  undefined4 local_20;
  undefined4 uStack_1c;
  
  FUN_0042904c(*(int *)(DAT_004efc94 + 0x2c));
  FUN_00420ea4(&local_20,(undefined4 *)(param_2 + 0x184));
  FUN_00434df4();
  FUN_004206e8(param_2);
  uStack_1c = 0x434cd3;
  FUN_00434fe0(param_1,param_2);
  return;
}



/* @00434cdc file=? name=FUN_00434cdc */

void __cdecl FUN_00434cdc(int param_1,int param_2)

{
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  FUN_00435030(param_1,param_2);
  if ((*(uint *)(param_2 + 0x28) & 0xc) == 0) {
    local_20 = 0x1c;
    local_1c = 4;
    local_18 = 1;
    FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
    local_c = 0;
    local_8 = 0;
    FUN_00420ef4(local_14,(undefined4 *)(param_2 + 0x184));
    local_c = *(undefined4 *)(param_2 + 0x194);
    local_8 = *(undefined4 *)(param_2 + 0x18c);
    (**(code **)(**(int **)(DAT_004efc94 + 0x20) + 0x1c))
              (*(int **)(DAT_004efc94 + 0x20),&local_20,3);
  }
  return;
}



/* @00434d70 file=? name=FUN_00434d70 */

void __cdecl FUN_00434d70(undefined4 param_1,uint *param_2)

{
  int iVar1;
  
  iVar1 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 3);
  if (iVar1 != 0) {
    param_2[1] = 9;
    FUN_004351fc(param_1,iVar1,param_2);
  }
  return;
}



/* @00434db4 file=? name=FUN_00434db4 */

void FUN_00434db4(void)

{
  return;
}



/* @00434dbc file=munga/interest.cpp name=FUN_00434dbc */

void FUN_00434dbc(void)

{
  FUN_0040385c(s_InterestManager__EntityNewIntere_004e7e03,s_d__tesla_bt_munga_INTEREST_CPP_004e7e46
               ,0x6bb);
  return;
}



/* @00434dd8 file=munga/interest.cpp name=FUN_00434dd8 */

void FUN_00434dd8(void)

{
  FUN_0040385c(s_InterestManager__LoadResourceFin_004e7e65,s_d__tesla_bt_munga_INTEREST_CPP_004e7ea7
               ,0x6f2);
  return;
}



/* @00434df4 file=? name=FUN_00434df4 */

void FUN_00434df4(void)

{
  return;
}



/* @00434dfc file=? name=FUN_00434dfc */

void FUN_00434dfc(void)

{
  return;
}



/* @00434e04 file=? name=FUN_00434e04 */

void __cdecl FUN_00434e04(undefined4 param_1,int param_2,int param_3)

{
  FUN_00420ef4((undefined4 *)(param_3 + 0xc),(undefined4 *)(param_2 + 0x184));
  *(undefined4 *)(param_3 + 0x14) = *(undefined4 *)(param_2 + 0x194);
  *(undefined4 *)(param_3 + 0x18) = *(undefined4 *)(param_2 + 0x18c);
  *(undefined4 *)(param_3 + 4) = 6;
  (**(code **)(**(int **)(DAT_004efc94 + 0x20) + 0x1c))(*(int **)(DAT_004efc94 + 0x20),param_3,3);
  return;
}



/* @00434e5c file=? name=FUN_00434e5c */

void __cdecl FUN_00434e5c(undefined4 param_1,uint *param_2)

{
  int iVar1;
  
  iVar1 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 3);
  if (iVar1 != 0) {
    param_2[1] = 0xf;
    FUN_004351b4(param_1,iVar1,param_2);
  }
  return;
}



/* @00434ea0 file=? name=FUN_00434ea0 */

void __cdecl FUN_00434ea0(undefined4 param_1,int param_2,uint *param_3)

{
  uint uVar1;
  undefined4 *puVar2;
  undefined4 uVar3;
  undefined4 local_14 [2];
  undefined4 *local_c;
  
  FUN_00420ef4(param_3 + 3,(undefined4 *)(param_2 + 0x184));
  param_3[5] = *(uint *)(param_2 + 0x194);
  param_3[6] = *(uint *)(param_2 + 0x18c);
  FUN_004030dc(local_14,&DAT_00522530,0x600,0);
  uVar1 = *param_3;
  puVar2 = (undefined4 *)FUN_004022c8(0xc,local_c);
  if (puVar2 == (undefined4 *)0x0) {
    uVar3 = 0;
  }
  else {
    uVar3 = FUN_0043525c(puVar2,uVar1 + 0xc);
  }
  local_c = (undefined4 *)((int)local_c + 0xc);
  FUN_004d4918(local_c,param_3,*param_3);
  (**(code **)(**(int **)(DAT_004efc94 + 0x20) + 0x1c))(*(int **)(DAT_004efc94 + 0x20),uVar3,3);
  return;
}



/* @00434f4c file=? name=FUN_00434f4c */

void __cdecl FUN_00434f4c(undefined4 param_1,undefined4 *param_2)

{
  uint *puVar1;
  int iVar2;
  undefined4 local_14 [2];
  uint *local_c;
  
  FUN_004030dc(local_14,param_2,*param_2,0);
  puVar1 = (uint *)((int)local_c + 0xc);
  iVar2 = (int)local_c + 0x18;
  local_c = puVar1;
  iVar2 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,iVar2);
  if (iVar2 != 0) {
    FUN_004351b4(param_1,iVar2,puVar1);
  }
  return;
}



/* @00434fa8 file=munga/interest.cpp name=FUN_00434fa8 */

void FUN_00434fa8(void)

{
  FUN_0040385c(s_InterestManager__HostInterestAre_004e7ec6,s_d__tesla_bt_munga_INTEREST_CPP_004e7f0c
               ,0x8f1);
  return;
}



/* @00434fc4 file=munga/interest.cpp name=FUN_00434fc4 */

void FUN_00434fc4(void)

{
  FUN_0040385c(s_InterestManager__InterestZoneDel_004e7f2b,s_d__tesla_bt_munga_INTEREST_CPP_004e7f6a
               ,0x915);
  return;
}



/* @00434fe0 file=? name=FUN_00434fe0 */

void __cdecl FUN_00434fe0(int param_1,undefined4 param_2)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_004353c0(local_18,param_1 + 0x2c);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x10))(piVar1,param_2);
  }
  FUN_0043541d(local_18,2);
  return;
}



/* @00435030 file=? name=FUN_00435030 */

void __cdecl FUN_00435030(int param_1,undefined4 param_2)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_004353c0(local_18,param_1 + 0x2c);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x14))(piVar1,param_2);
  }
  FUN_0043541d(local_18,2);
  return;
}



/* @00435080 file=? name=FUN_00435080 */

void __cdecl FUN_00435080(undefined4 param_1,int *param_2)

{
  int iVar1;
  int local_18 [5];
  
  FUN_004292ac(local_18,*(int *)(DAT_004efc94 + 0x2c));
  while( true ) {
    iVar1 = (**(code **)(local_18[0] + 0x28))(local_18);
    if (iVar1 == 0) break;
    (**(code **)(*param_2 + 0x10))(param_2,iVar1);
  }
  FUN_004292d0(local_18,2);
  return;
}



/* @004350d4 file=? name=FUN_004350d4 */

void __cdecl FUN_004350d4(undefined4 param_1,uint *param_2)

{
  int iVar1;
  
  iVar1 = 1;
  if (*(int *)(DAT_004efc94 + 0x88) == 5) {
    iVar1 = 3;
  }
  FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),iVar1,*(undefined4 *)(DAT_004efc94 + 0x28),param_2,
               DAT_004e17f4);
  return;
}



/* @00435120 file=munga/interest.cpp name=FUN_00435120 */

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

{
  undefined4 uVar1;
  int iVar2;
  int unaff_ESI;
  
  uVar1 = FUN_00417ab4(param_3 + 0x40);
  iVar2 = (**(code **)(*param_2 + 0x2c))(param_2,uVar1);
  if (iVar2 == 0) {
    unaff_ESI = 0;
    if (*(int *)(DAT_004efc94 + 0x88) == 5) {
      unaff_ESI = 1;
    }
  }
  else if (iVar2 == 1) {
    unaff_ESI = 0;
    if (*(int *)(DAT_004efc94 + 0x88) == 5) {
      unaff_ESI = 2;
    }
  }
  else {
    FUN_0040385c(s_Application__PostInterestEvent___004e7f89,
                 s_d__tesla_bt_munga_INTEREST_CPP_004e7fc2,0x9b1);
  }
  FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),unaff_ESI,param_3,param_4,DAT_004e17f4);
  return;
}



/* @004351b4 file=? name=FUN_004351b4 */

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

{
  int iVar1;
  
  iVar1 = 2;
  if (*(int *)(DAT_004efc94 + 0x88) == 5) {
    iVar1 = 4;
  }
  FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),iVar1,param_2,param_3,DAT_004e17f4);
  return;
}



/* @004351fc file=? name=FUN_004351fc */

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

{
  FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),3,param_2,param_3,DAT_004e17f4);
  return;
}



/* @00435230 file=? name=FUN_00435230 */

void __cdecl FUN_00435230(undefined4 param_1,int *param_2)

{
  (**(code **)(*param_2 + 0x18))(param_2);
  return;
}



/* @00435240 file=? name=FUN_00435240 */

void __cdecl FUN_00435240(undefined4 *param_1)

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



/* @0043525c file=? name=FUN_0043525c */

void __cdecl FUN_0043525c(undefined4 *param_1,undefined4 param_2)

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



/* @00435278 file=? name=FUN_00435278 */

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

{
  *param_1 = 0x18;
  param_1[1] = 8;
  param_1[2] = 1;
  FUN_00420e8c(param_1 + 3);
  FUN_00420ef4(param_1 + 3,param_2);
  param_1[5] = param_3;
  return param_1;
}



/* @004352b8 file=? name=FUN_004352b8 */

void __cdecl FUN_004352b8(undefined4 *param_1)

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



/* @004352d4 file=? name=FUN_004352d4 */

void __cdecl FUN_004352d4(undefined4 *param_1)

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



/* @00435375 file=? name=FUN_00435375 */

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

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



/* @00435394 file=? name=FUN_00435394 */

void __cdecl FUN_00435394(int *param_1,byte param_2)

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



/* @004353c0 file=? name=FUN_004353c0 */

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

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



/* @004353df file=? name=FUN_004353df */

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

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



/* @004353fe file=? name=FUN_004353fe */

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

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



/* @0043541d file=? name=FUN_0043541d */

void __cdecl FUN_0043541d(int *param_1,byte param_2)

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



/* @0043544c file=? name=FUN_0043544c */

undefined4 * __cdecl FUN_0043544c(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1c);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00435478(puVar1,*(undefined4 *)(param_1 + 0x194));
  }
  return puVar1;
}



/* @00435478 file=? name=FUN_00435478 */

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

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e80f4;
  FUN_00435614(param_1 + 4,0);
  param_1[3] = param_2;
  FUN_00435544((int)param_1,param_2);
  return param_1;
}



/* @004354b8 file=? name=FUN_004354b8 */

void __cdecl FUN_004354b8(int *param_1,byte param_2)

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



/* @004354f4 file=? name=FUN_004354f4 */

undefined4 FUN_004354f4(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00435508 file=? name=FUN_00435508 */

void __cdecl FUN_00435508(int param_1,int param_2)

{
  int iVar1;
  
  if (param_2 != *(int *)(param_1 + 0xc)) {
    *(int *)(param_1 + 0xc) = param_2;
    iVar1 = FUN_00417ab4(param_1 + 0x10);
    if (iVar1 != 0) {
      FUN_00417a5c(param_1 + 0x10);
    }
    FUN_00435544(param_1,param_2);
  }
  return;
}



/* @00435544 file=? name=FUN_00435544 */

void __cdecl FUN_00435544(int param_1,undefined4 param_2)

{
  int iVar1;
  undefined4 *puVar2;
  int *piVar3;
  
  iVar1 = FUN_00433ed4(*(int *)(DAT_004efc94 + 0x30) + 0x14);
  piVar3 = *(int **)(iVar1 + 0x38);
  if (piVar3 == (int *)0x0) {
    puVar2 = (undefined4 *)FUN_00402298(0x38);
    if (puVar2 == (undefined4 *)0x0) {
      piVar3 = (int *)0x0;
    }
    else {
      piVar3 = FUN_004343b0(puVar2,param_2);
    }
    *(int **)(iVar1 + 0x38) = piVar3;
    FUN_00434a10(*(int *)(DAT_004efc94 + 0x30),piVar3);
  }
  (**(code **)(*(int *)(param_1 + 0x10) + 4))(param_1 + 0x10,piVar3);
  return;
}



/* @004355bc file=? name=FUN_004355bc */

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

{
  int iVar1;
  
  iVar1 = FUN_00417ab4(param_2 + 0x10);
  FUN_0043452c(param_1,iVar1);
  *param_1 = &PTR_FUN_004e80a0;
  return param_1;
}



/* @004355e8 file=? name=FUN_004355e8 */

void __cdecl FUN_004355e8(int *param_1,byte param_2)

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



/* @00435614 file=? name=FUN_00435614 */

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

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



/* @00435633 file=? name=FUN_00435633 */

void __cdecl FUN_00435633(int *param_1,byte param_2)

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



/* @00435660 file=? name=FUN_00435660 */

undefined4 * __cdecl
FUN_00435660(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5)

{
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004e81a0;
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = param_4;
  param_1[6] = param_5;
  param_1[7] = 1;
  return param_1;
}



/* @0043569c file=? name=FUN_0043569c */

void __cdecl FUN_0043569c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e81a0;
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_00402f98(0x4e8100,param_1);
    }
  }
  return;
}



/* @004356d4 file=? name=FUN_004356d4 */

undefined4 * __cdecl FUN_004356d4(undefined4 *param_1)

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004e8194;
  FUN_004359a8(param_1 + 3,0);
  return param_1;
}



/* @00435700 file=? name=FUN_00435700 */

void __cdecl FUN_00435700(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e8194;
    FUN_00435a12(local_10,(int)(param_1 + 3));
    while( true ) {
      puVar1 = (undefined4 *)(**(code **)(local_10[0] + 0x28))(local_10);
      if (puVar1 == (undefined4 *)0x0) break;
      if (puVar1 != (undefined4 *)0x0) {
        (**(code **)*puVar1)(puVar1,3);
      }
    }
    FUN_00435a50(local_10,2);
    FUN_004359c7(param_1 + 3,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00435780 file=? name=FUN_00435780 */

undefined4 FUN_00435780(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00435794 file=? name=FUN_00435794 */

void FUN_00435794(int param_1)

{
  bool bVar1;
  int *piVar2;
  undefined4 *puVar3;
  int aiStack_38 [3];
  int aiStack_2c [5];
  int aiStack_18 [5];
  
  FUN_0042934c(aiStack_18,*(int *)(DAT_004efc94 + 0x2c));
  FUN_004292fc(aiStack_2c,*(int *)(DAT_004efc94 + 0x2c));
  while (piVar2 = (int *)(**(code **)(aiStack_18[0] + 0x28))(aiStack_18), piVar2 != (int *)0x0) {
    if (((*(byte *)(piVar2 + 10) & 2) == 0) || (piVar2[4] <= piVar2[5])) {
      bVar1 = true;
    }
    else {
      bVar1 = false;
    }
    if (bVar1) {
      FUN_0041f8d4(piVar2,&stack0x00000008);
    }
  }
  while (piVar2 = (int *)(**(code **)(aiStack_2c[0] + 0x28))(aiStack_2c), piVar2 != (int *)0x0) {
    if ((piVar2[0x66] != 0) && ((*(byte *)(piVar2 + 10) & 2) == 0)) {
      puVar3 = FUN_0041f8d4(piVar2,&stack0x00000008);
      FUN_00434db4();
      if (puVar3 != (undefined4 *)0x0) {
        FUN_00434e04(*(undefined4 *)(DAT_004efc94 + 0x30),(int)piVar2,(int)puVar3);
      }
    }
  }
  FUN_00435a12(aiStack_38,param_1 + 0xc);
  while (puVar3 = (undefined4 *)(**(code **)(aiStack_38[0] + 0x28))(aiStack_38),
        puVar3 != (undefined4 *)0x0) {
    (*(code *)puVar3[4])(puVar3[3]);
    if (puVar3[7] != 0) {
      FUN_0041c08c(puVar3[3]);
      *(uint *)(puVar3[3] + 0x28) = *(uint *)(puVar3[3] + 0x28) & 0xfffffffe;
    }
    if (puVar3 != (undefined4 *)0x0) {
      (**(code **)*puVar3)(puVar3,3);
    }
  }
  FUN_00435a50(aiStack_38,2);
  FUN_00429320(aiStack_2c,2);
  FUN_00429370(aiStack_18,2);
  return;
}



/* @0043579a file=? name=FUN_0043579a */

void FUN_0043579a(void)

{
  int iVar1;
  bool bVar2;
  int *piVar3;
  undefined4 *puVar4;
  int unaff_EBP;
  
  iVar1 = *(int *)(unaff_EBP + 8);
  FUN_0042934c((undefined4 *)(unaff_EBP + -0x14),*(int *)(DAT_004efc94 + 0x2c));
  FUN_004292fc((undefined4 *)(unaff_EBP + -0x28),*(int *)(DAT_004efc94 + 0x2c));
  while (piVar3 = (int *)(**(code **)(*(int *)(unaff_EBP + -0x14) + 0x28))(unaff_EBP + -0x14),
        piVar3 != (int *)0x0) {
    if (((*(byte *)(piVar3 + 10) & 2) == 0) || (piVar3[4] <= piVar3[5])) {
      bVar2 = true;
    }
    else {
      bVar2 = false;
    }
    if (bVar2) {
      FUN_0041f8d4(piVar3,unaff_EBP + 0xc);
    }
  }
  while (piVar3 = (int *)(**(code **)(*(int *)(unaff_EBP + -0x28) + 0x28))(unaff_EBP + -0x28),
        piVar3 != (int *)0x0) {
    if ((piVar3[0x66] != 0) && ((*(byte *)(piVar3 + 10) & 2) == 0)) {
      puVar4 = FUN_0041f8d4(piVar3,unaff_EBP + 0xc);
      FUN_00434db4();
      if (puVar4 != (undefined4 *)0x0) {
        FUN_00434e04(*(undefined4 *)(DAT_004efc94 + 0x30),(int)piVar3,(int)puVar4);
      }
    }
  }
  FUN_00435a12((undefined4 *)(unaff_EBP + -0x34),iVar1 + 0xc);
  while (puVar4 = (undefined4 *)(**(code **)(*(int *)(unaff_EBP + -0x34) + 0x28))(unaff_EBP + -0x34)
        , puVar4 != (undefined4 *)0x0) {
    (*(code *)puVar4[4])(puVar4[3]);
    if (puVar4[7] != 0) {
      FUN_0041c08c(puVar4[3]);
      *(uint *)(puVar4[3] + 0x28) = *(uint *)(puVar4[3] + 0x28) & 0xfffffffe;
    }
    if (puVar4 != (undefined4 *)0x0) {
      (**(code **)*puVar4)(puVar4,3);
    }
  }
  FUN_00435a50((int *)(unaff_EBP + -0x34),2);
  FUN_00429320((int *)(unaff_EBP + -0x28),2);
  FUN_00429370((int *)(unaff_EBP + -0x14),2);
  return;
}



/* @004358e8 file=? name=FUN_004358e8 */

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

{
  int iVar1;
  undefined4 *puVar2;
  int local_10 [3];
  
  FUN_00435a12(local_10,param_1 + 0xc);
  do {
    iVar1 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar1 == 0) goto LAB_0043592f;
  } while ((param_2 != *(int *)(iVar1 + 0xc)) || (*(int *)(iVar1 + 0x1c) == 0));
  *(undefined4 *)(iVar1 + 0x1c) = 0;
LAB_0043592f:
  puVar2 = FUN_00402f74(0x4e8100);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_00435660(puVar2,param_2,param_3,param_4,param_5);
  }
  (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar2);
  FUN_00435a50(local_10,2);
  return;
}



/* @004359a8 file=? name=FUN_004359a8 */

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

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



/* @004359c7 file=? name=FUN_004359c7 */

void __cdecl FUN_004359c7(int *param_1,byte param_2)

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



/* @004359f3 file=? name=FUN_004359f3 */

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

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



/* @00435a12 file=? name=FUN_00435a12 */

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

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



/* @00435a31 file=? name=FUN_00435a31 */

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

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



/* @00435a50 file=? name=FUN_00435a50 */

void __cdecl FUN_00435a50(int *param_1,byte param_2)

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



/* @00435a7c file=? name=FUN_00435a7c */

void __cdecl FUN_00435a7c(undefined4 *param_1)

{
  param_1[2] = 1;
  *param_1 = 0;
  param_1[1] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = 0xffffffff;
  param_1[9] = 0xffffffff;
  return;
}



/* @00435abc file=? name=FUN_00435abc */

undefined4 FUN_00435abc(void)

{
  return 1;
}



/* @00435ac8 file=? name=FUN_00435ac8 */

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

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 uVar4;
  
  pfVar1 = param_5;
  if (param_5 == (float *)0x0) {
    pfVar1 = (float *)FUN_00402298(8);
  }
  iVar2 = FUN_00404118(param_3,s_gamedata_004e81a4,s_ReticleX_004e81ad,pfVar1);
  if (iVar2 == 0) {
    *pfVar1 = 0.0;
  }
  iVar2 = FUN_00404118(param_3,s_gamedata_004e81b6,s_ReticleY_004e81bf,pfVar1 + 1);
  if (iVar2 == 0) {
    pfVar1[1] = 0.0;
  }
  if (param_5 == (float *)0x0) {
    puVar3 = (undefined4 *)FUN_00406db4(param_1,param_2,0xf,1,0,pfVar1,4,-1);
    FUN_004022d0((int *)pfVar1);
    uVar4 = *puVar3;
  }
  else {
    uVar4 = 0;
  }
  return uVar4;
}



/* @00435b64 file=? name=FUN_00435b64 */

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

{
  FUN_00434220(param_1,*(undefined4 *)(param_3 + 0x194),param_4,param_5);
  *param_1 = &PTR_FUN_004e821c;
  FUN_00428cb4(param_1 + 10,0);
  param_1[9] = param_2;
  return param_1;
}



/* @00435ba8 file=? name=FUN_00435ba8 */

void __cdecl FUN_00435ba8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e821c;
    FUN_00428cd3(param_1 + 10,2);
    FUN_00434260(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00435be4 file=? name=FUN_00435be4 */

undefined4 FUN_00435be4(void)

{
  FUN_004342bc();
  return 1;
}



/* @00435bf8 file=? name=FUN_00435bf8 */

void __cdecl FUN_00435bf8(int param_1,int *param_2)

{
  uint local_18 [5];
  
  (**(code **)(*(int *)(param_1 + 0x28) + 4))(param_1 + 0x28,param_2);
  FUN_00436544(local_18,(int)param_2);
  FUN_00435120(*(undefined4 *)(DAT_004efc94 + 0x30),param_2,*(int *)(param_1 + 0x24),local_18);
  return;
}



/* @00435c44 file=? name=FUN_00435c44 */

void __cdecl FUN_00435c44(int param_1,int param_2)

{
  int local_14 [4];
  
  (**(code **)(**(int **)(param_1 + 0x24) + 0x28))(*(int **)(param_1 + 0x24),param_2);
  FUN_00415f30(local_14,param_2,0xffffffff);
  FUN_004161fc((int)local_14,param_1 + 0x28);
  FUN_00415f90(local_14,2);
  return;
}



/* @00435c94 file=? name=FUN_00435c94 */

void __cdecl FUN_00435c94(int *param_1)

{
  int iVar1;
  int local_18 [5];
  
  FUN_00428cff(local_18,(int)(param_1 + 10));
  while( true ) {
    iVar1 = (**(code **)(local_18[0] + 0x30))(local_18);
    if (iVar1 == 0) break;
    (**(code **)(*param_1 + 0x14))(param_1,iVar1);
  }
  FUN_00428d5c(local_18,2);
  return;
}



/* @00435ce0 file=? name=FUN_00435ce0 */

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

{
  FUN_00428cff(param_1,param_2 + 0x28);
  *param_1 = &PTR_FUN_004e81c8;
  return param_1;
}



/* @00435d04 file=? name=FUN_00435d04 */

void __cdecl FUN_00435d04(int *param_1,byte param_2)

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



/* @00435d30 file=? name=FUN_00435d30 */

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

undefined4 * __cdecl
FUN_00435d30(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8)

{
  undefined4 uVar1;
  
  FUN_004178cc(param_1,param_7);
  *param_1 = &PTR_FUN_004e3320;
  param_1[3] = param_8;
  *param_1 = &PTR_FUN_004e8554;
  FUN_00436769(param_1 + 0xd,0);
  FUN_0042f121(param_1 + 0x10,0);
  param_1[4] = 0;
  param_1[5] = param_2;
  uVar1 = FUN_004dcd94();
  param_1[6] = uVar1;
  uVar1 = FUN_004dcd94();
  param_1[7] = uVar1;
  param_1[8] = param_3;
  param_1[9] = param_4;
  param_1[10] = param_5;
  param_1[0xb] = param_6;
  param_1[0xc] = DAT_004e8244;
  return param_1;
}



/* @00435df8 file=? name=FUN_00435df8 */

void __cdecl FUN_00435df8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e8554;
    (**(code **)(*param_1 + 0x18))(param_1);
    FUN_0042f140(param_1 + 0x10,2);
    FUN_00436788(param_1 + 0xd,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00435e48 file=? name=FUN_00435e48 */

undefined4 __cdecl FUN_00435e48(int param_1)

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



/* @00435e70 file=? name=FUN_00435e70 */

void __cdecl FUN_00435e70(int *param_1,int param_2)

{
  undefined4 *puVar1;
  int *piVar2;
  
  (**(code **)(*param_1 + 0x18))(param_1);
  (**(code **)(param_1[0x10] + 4))(param_1 + 0x10,param_2);
  puVar1 = (undefined4 *)FUN_00402298(0x3c);
  if (puVar1 == (undefined4 *)0x0) {
    piVar2 = (int *)0x0;
  }
  else {
    piVar2 = FUN_00435b64(puVar1,param_1,param_2,param_1[10],param_1[0xb]);
  }
  FUN_00434a10(*(int *)(DAT_004efc94 + 0x30),piVar2);
  (**(code **)(param_1[0xd] + 4))(param_1 + 0xd,piVar2);
  return;
}



/* @00435ee4 file=? name=FUN_00435ee4 */

void __cdecl FUN_00435ee4(int param_1)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_00417ab4(param_1 + 0x34);
  if (piVar1 != (int *)0x0) {
    FUN_00417a5c(param_1 + 0x40);
    FUN_00434a48(*(undefined4 *)(DAT_004efc94 + 0x30),piVar1);
    if (piVar1 != (int *)0x0) {
      (**(code **)*piVar1)(piVar1,3);
    }
  }
  return;
}



/* @00435f2c file=? name=FUN_00435f2c */

void __cdecl FUN_00435f2c(int *param_1,undefined4 param_2)

{
  int *piVar1;
  
  param_1[4] = 1;
  piVar1 = (int *)FUN_00414b60();
  param_1[7] = *piVar1;
  FUN_00436310(*(int *)(DAT_004efc94 + 0x38),param_1);
  (**(code **)(*param_1 + 0x30))(param_1,param_2);
  return;
}



/* @00435f6c file=? name=FUN_00435f6c */

void __cdecl FUN_00435f6c(int *param_1)

{
  if (param_1[4] != 0) {
    param_1[4] = 0;
    FUN_0043632c(*(int *)(DAT_004efc94 + 0x38),(int)param_1);
    (**(code **)(*param_1 + 0x34))(param_1);
  }
  return;
}



/* @00435f9c file=? name=FUN_00435f9c */

void __cdecl FUN_00435f9c(int param_1)

{
  *(undefined4 *)(param_1 + 0x10) = 2;
  return;
}



/* @00435fac file=? name=FUN_00435fac */

void __cdecl FUN_00435fac(int param_1,int param_2)

{
  int iVar1;
  int *piVar2;
  
  if ((*(int *)(param_1 + 0x10) != 0) && (*(int *)(param_1 + 0x1c) <= param_2)) {
    iVar1 = FUN_00417ab4(param_1 + 0x40);
    piVar2 = (int *)FUN_00417ab4(param_1 + 0x34);
    (**(code **)(*piVar2 + 0xc))(piVar2,*(undefined4 *)(iVar1 + 0x194));
  }
  return;
}



/* @00435ff0 file=? name=FUN_00435ff0 */

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

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

{
  int *piVar1;
  float fVar2;
  int *piVar3;
  int iVar4;
  float10 fVar5;
  int local_24 [5];
  float local_10;
  float local_c;
  float local_8;
  
  if ((param_1[4] != 0) && (param_1[7] <= param_2)) {
    piVar3 = (int *)FUN_00414b60();
    piVar1 = param_1 + 7;
    *piVar1 = *piVar3;
    *piVar1 = *piVar1 + param_1[6];
    fVar5 = FUN_00401b1c();
    local_8 = (float)fVar5;
    fVar2 = local_8 + (float)param_1[0xc];
    local_c = _DAT_004360dc;
    if ((_DAT_004360dc <= fVar2) && (local_c = fVar2, _DAT_004360e0 < fVar2)) {
      local_c = _DAT_004360e0;
    }
    iVar4 = FUN_00417ab4((int)(param_1 + 0xd));
    FUN_00435ce0(local_24,iVar4);
    (**(code **)(*param_1 + 0x2c))(param_1,param_3,local_24);
    fVar5 = FUN_00401b1c();
    while (((local_10 = (float)fVar5, local_8 < local_10 && (local_10 < local_c)) &&
           (iVar4 = (**(code **)(*param_1 + 0x1c))(param_1), iVar4 != 0))) {
      fVar5 = FUN_00401b1c();
    }
    FUN_00435d04(local_24,2);
  }
  return;
}



/* @0043610c file=? name=FUN_0043610c */

void __cdecl FUN_0043610c(int *param_1,int param_2)

{
  (**(code **)(*param_1 + 0x28))(param_1,*(undefined4 *)(param_2 + 0xc));
  return;
}



/* @00436124 file=? name=FUN_00436124 */

void __cdecl FUN_00436124(int *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  iVar1 = FUN_00436610(param_2);
  if (iVar1 != 0) {
    iVar4 = *(int *)(param_2 + 0x18);
    iVar2 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),iVar4,0xf);
    iVar3 = *(int *)(iVar2 + 4);
    *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + 1;
    if (iVar3 == 0) {
      FUN_00406cd0(iVar2);
    }
    if (**(int **)(iVar2 + 0x3c) != 0) {
      iVar3 = FUN_00416f08();
      iVar3 = FUN_00430878(iVar3,iVar1);
      if (iVar3 != -1) {
        iVar4 = iVar3;
      }
    }
    (**(code **)(*param_1 + 0x38))(param_1,iVar1,*(undefined4 *)(param_2 + 0x14),iVar4);
    *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + -1;
  }
  return;
}



/* @004361a8 file=? name=FUN_004361a8 */

void __cdecl FUN_004361a8(int *param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_00436610(param_2);
  if (iVar1 != 0) {
    (**(code **)(*param_1 + 0x3c))(param_1,iVar1);
  }
  return;
}



/* @004361d0 file=? name=FUN_004361d0 */

void __cdecl FUN_004361d0(int *param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_00436610(param_2);
  if (iVar1 != 0) {
    (**(code **)(*param_1 + 0x40))
              (param_1,iVar1,*(undefined4 *)(param_2 + 0x14),*(undefined4 *)(param_2 + 0x18),
               *(undefined4 *)(param_2 + 0x1c));
  }
  return;
}



/* @00436204 file=? name=FUN_00436204 */

void __cdecl FUN_00436204(int *param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_00436610(param_2);
  if (iVar1 != 0) {
    (**(code **)(*param_1 + 0x44))
              (param_1,iVar1,*(undefined4 *)(param_2 + 0x14),*(undefined4 *)(param_2 + 0x18));
  }
  return;
}



/* @00436234 file=munga/renderer.cpp name=FUN_00436234 */

void FUN_00436234(void)

{
  FUN_0040385c(s_Renderer__ExecuteImplementation___004e8392,
               s_d__tesla_bt_munga_RENDERER_CPP_004e83cc,0x297);
  return;
}



/* @00436250 file=munga/renderer.cpp name=FUN_00436250 */

void FUN_00436250(void)

{
  FUN_0040385c(s_Renderer__LoadMissionImplementat_004e83eb,s_d__tesla_bt_munga_RENDERER_CPP_004e8429
               ,0x2a2);
  return;
}



/* @0043626c file=munga/renderer.cpp name=FUN_0043626c */

void FUN_0043626c(void)

{
  FUN_0040385c(s_Renderer__ShutdownImplementation_004e8448,s_d__tesla_bt_munga_RENDERER_CPP_004e8483
               ,0x2ad);
  return;
}



/* @00436288 file=? name=FUN_00436288 */

undefined4 * __cdecl FUN_00436288(undefined4 *param_1)

{
  FUN_004178cc(param_1,0x26);
  *param_1 = &PTR_FUN_004e3320;
  param_1[3] = &DAT_004e2d1c;
  *param_1 = &PTR_FUN_004e8540;
  FUN_004367b4(param_1 + 4,0);
  return param_1;
}



/* @004362c0 file=? name=FUN_004362c0 */

void __cdecl FUN_004362c0(int *param_1,byte param_2)

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



/* @004362fc file=? name=FUN_004362fc */

undefined4 __cdecl FUN_004362fc(int param_1)

{
  FUN_00419df0(param_1);
  return 1;
}



/* @00436310 file=? name=FUN_00436310 */

void __cdecl FUN_00436310(int param_1,undefined4 param_2)

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



/* @0043632c file=? name=FUN_0043632c */

void __cdecl FUN_0043632c(int param_1,int param_2)

{
  int local_18 [5];
  
  FUN_004367ff(local_18,param_1 + 0x10);
  FUN_0041781c(local_18,param_2);
  FUN_0043685c(local_18,2);
  return;
}



/* @00436368 file=? name=FUN_00436368 */

undefined4 __cdecl FUN_00436368(int param_1)

{
  int iVar1;
  undefined4 uVar2;
  int local_18 [5];
  
  FUN_004367ff(local_18,param_1 + 0x10);
  iVar1 = (**(code **)(local_18[0] + 0x30))(local_18);
  if (iVar1 == 0) {
    uVar2 = 0;
    FUN_0043685c(local_18,2);
  }
  else {
    do {
      iVar1 = (**(code **)(local_18[0] + 0x28))(local_18);
      if (iVar1 == 0) {
        uVar2 = 1;
        FUN_0043685c(local_18,2);
        return uVar2;
      }
    } while (*(int *)(iVar1 + 0x10) == 2);
    uVar2 = 0;
    FUN_0043685c(local_18,2);
  }
  return uVar2;
}



/* @004363ec file=? name=FUN_004363ec */

void __cdecl FUN_004363ec(int param_1,int param_2)

{
  int iVar1;
  int local_18 [5];
  
  FUN_004367ff(local_18,param_1 + 0x10);
  while( true ) {
    iVar1 = (**(code **)(local_18[0] + 0x28))(local_18);
    if (iVar1 == 0) break;
    FUN_00435fac(iVar1,param_2);
  }
  FUN_0043685c(local_18,2);
  return;
}



/* @00436440 file=? name=FUN_00436440 */

void __cdecl FUN_00436440(int param_1,int param_2)

{
  int *piVar1;
  int local_1c [5];
  int local_8;
  
  FUN_004367ff(local_1c,param_1 + 0x10);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_1c[0] + 0x28))(local_1c);
    if (piVar1 == (int *)0x0) break;
    local_8 = piVar1[8];
    FUN_00435ff0(piVar1,param_2,local_8);
  }
  FUN_0043685c(local_1c,2);
  return;
}



/* @0043649c file=? name=FUN_0043649c */

void __cdecl FUN_0043649c(int param_1)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_004367ff(local_18,param_1 + 0x10);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x20))(piVar1);
  }
  FUN_0043685c(local_18,2);
  return;
}



/* @004364e4 file=? name=FUN_004364e4 */

void __cdecl FUN_004364e4(int param_1,int *param_2,uint *param_3)

{
  int iVar1;
  int local_18 [5];
  
  FUN_004367ff(local_18,param_1 + 0x10);
  while( true ) {
    iVar1 = (**(code **)(local_18[0] + 0x28))(local_18);
    if (iVar1 == 0) break;
    FUN_00435120(*(undefined4 *)(DAT_004efc94 + 0x30),param_2,iVar1,param_3);
  }
  FUN_0043685c(local_18,2);
  return;
}



/* @00436544 file=? name=FUN_00436544 */

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

{
  *param_1 = 0x14;
  param_1[1] = 3;
  param_1[2] = 1;
  FUN_00420e8c(param_1 + 3);
  FUN_00420ef4(param_1 + 3,(undefined4 *)(param_2 + 0x184));
  return param_1;
}



/* @00436584 file=? name=FUN_00436584 */

void __cdecl FUN_00436584(int param_1)

{
  (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
            (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_1 + 0xc);
  return;
}



/* @004365b0 file=? name=FUN_004365b0 */

void __cdecl FUN_004365b0(undefined4 *param_1,undefined4 param_2)

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



/* @004365d4 file=? name=FUN_004365d4 */

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

{
  *param_1 = param_3;
  param_1[1] = param_2;
  param_1[2] = 1;
  FUN_00420e8c(param_1 + 3);
  FUN_00420ef4(param_1 + 3,(undefined4 *)(param_4 + 0x184));
  return param_1;
}



/* @00436610 file=? name=FUN_00436610 */

void __cdecl FUN_00436610(int param_1)

{
  (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
            (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_1 + 0xc);
  return;
}



/* @0043663c file=? name=FUN_0043663c */

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

{
  FUN_004365d4(param_1,5,0x1c,param_2);
  param_1[5] = param_3;
  param_1[6] = param_4;
  return param_1;
}



/* @00436668 file=? name=FUN_00436668 */

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

{
  FUN_004365d4(param_1,6,0x14,param_2);
  return param_1;
}



/* @00436688 file=? name=FUN_00436688 */

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

{
  FUN_004365d4(param_1,7,0x20,param_2);
  param_1[5] = param_3;
  param_1[6] = param_4;
  param_1[7] = param_5;
  return param_1;
}



/* @004366b8 file=? name=FUN_004366b8 */

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

{
  FUN_004365d4(param_1,8,0x1c,param_2);
  param_1[5] = param_3;
  param_1[6] = param_4;
  return param_1;
}



/* @00436769 file=? name=FUN_00436769 */

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

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



/* @00436788 file=? name=FUN_00436788 */

void __cdecl FUN_00436788(int *param_1,byte param_2)

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



/* @004367b4 file=? name=FUN_004367b4 */

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

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



/* @004367d3 file=? name=FUN_004367d3 */

void __cdecl FUN_004367d3(int *param_1,byte param_2)

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



/* @004367ff file=? name=FUN_004367ff */

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

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



/* @0043681e file=? name=FUN_0043681e */

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

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



/* @0043683d file=? name=FUN_0043683d */

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

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



/* @0043685c file=? name=FUN_0043685c */

void __cdecl FUN_0043685c(int *param_1,byte param_2)

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



/* @00436888 file=? name=FUN_00436888 */

undefined4 FUN_00436888(void)

{
  return 0;
}



/* @0043688f file=? name=FUN_0043688f */

undefined4 FUN_0043688f(void)

{
  return 1;
}



/* @00436899 file=? name=FUN_00436899 */

void FUN_00436899(void)

{
  return;
}



/* @0043689e file=? name=FUN_0043689e */

void FUN_0043689e(void)

{
  return;
}



/* @004368a3 file=? name=FUN_004368a3 */

void FUN_004368a3(void)

{
  return;
}



/* @004368a8 file=? name=FUN_004368a8 */

void FUN_004368a8(void)

{
  return;
}



/* @004368ad file=? name=FUN_004368ad */

void FUN_004368ad(void)

{
  return;
}



/* @004368b2 file=? name=FUN_004368b2 */

void FUN_004368b2(void)

{
  return;
}



/* @004368b8 file=? name=FUN_004368b8 */

undefined4 * __cdecl
FUN_004368b8(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6)

{
  FUN_00435d30(param_1,param_2,param_3,param_4,param_5,param_6,8,&DAT_004e82f8);
  *param_1 = &PTR_FUN_004e85e0;
  param_1[0x13] = 0;
  return param_1;
}



/* @004368f4 file=? name=FUN_004368f4 */

void __cdecl FUN_004368f4(int *param_1,byte param_2)

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



/* @00436920 file=? name=FUN_00436920 */

void __cdecl FUN_00436920(int *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  
  if (param_1[0x13] == 0) {
    iVar2 = FUN_00417ab4((int)(param_1 + 0x10));
    if (iVar2 == param_2) {
      uVar3 = 1;
    }
    else {
      uVar3 = 0;
    }
  }
  else {
    uVar3 = 0;
  }
  iVar2 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),*(int *)(param_2 + 0x1bc),10);
  if ((iVar2 != 0) &&
     (iVar1 = *(int *)(iVar2 + 4), *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + 1, iVar1 == 0)) {
    FUN_00406cd0(iVar2);
  }
  (**(code **)(*param_1 + 0x48))(param_1,param_2,iVar2,uVar3);
  if (iVar2 != 0) {
    *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + -1;
  }
  return;
}



/* @004369a0 file=? name=FUN_004369a0 */

void __cdecl FUN_004369a0(undefined4 param_1,int param_2)

{
  undefined4 *puVar1;
  int local_2c [5];
  int local_18 [5];
  
  FUN_004214f0(local_18,param_2);
  (**(code **)(local_18[0] + 8))(local_18);
  while( true ) {
    puVar1 = (undefined4 *)(**(code **)(local_18[0] + 0x2c))(local_18);
    if (puVar1 == (undefined4 *)0x0) break;
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
  }
  FUN_00421534(local_18,2);
  FUN_00421480(local_2c,param_2);
  (**(code **)(local_2c[0] + 8))(local_2c);
  while( true ) {
    puVar1 = (undefined4 *)(**(code **)(local_2c[0] + 0x2c))(local_2c);
    if (puVar1 == (undefined4 *)0x0) break;
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
  }
  FUN_004214c4(local_2c,2);
  return;
}



/* @00436a40 file=? name=FUN_00436a40 */

void FUN_00436a40(void)

{
  return;
}



/* @00436a48 file=? name=FUN_00436a48 */

void __cdecl FUN_00436a48(undefined4 param_1,int param_2)

{
  uint uVar1;
  uint uVar2;
  int *piVar3;
  byte bVar4;
  
  if (*(int *)(param_2 + 4) != 0x7d9) {
    uVar1 = *(uint *)(param_2 + 4);
    FUN_004dbb24(&DAT_00524e20,s_Entity_004e859c,(char *)0x0);
    uVar2 = *(uint *)(param_2 + 0x188);
    bVar4 = 0x3a;
    piVar3 = FUN_004db78c(&DAT_00524e20,*(uint *)(param_2 + 0x184));
    piVar3 = FUN_004db92c(piVar3,bVar4);
    piVar3 = FUN_004db78c(piVar3,uVar2);
    FUN_004dbb24(piVar3,s_class_004e85a4,(char *)0x0);
    FUN_004db78c(piVar3,uVar1);
    FUN_004dbb24(&DAT_00524e20,s_couldn_t_figure_out_how_to_MakeE_004e85ab,(char *)0x0);
  }
  return;
}



/* @00436ae0 file=? name=FUN_00436ae0 */

void FUN_00436ae0(void)

{
  return;
}



/* @00436ae8 file=? name=FUN_00436ae8 */

void FUN_00436ae8(void)

{
  return;
}



/* @00436af0 file=? name=FUN_00436af0 */

void FUN_00436af0(void)

{
  return;
}



/* @00436af8 file=? name=FUN_00436af8 */

void FUN_00436af8(void)

{
  return;
}



/* @00436b00 file=? name=FUN_00436b00 */

void __cdecl FUN_00436b00(int param_1)

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



/* @00436b1c file=? name=FUN_00436b1c */

undefined4 * __cdecl FUN_00436b1c(undefined4 *param_1)

{
  *param_1 = &PTR_FUN_004e87e4;
  FUN_0042f121(param_1 + 2,0);
  param_1[1] = 0;
  param_1[5] = 0x42c80000;
  param_1[6] = 0x3f800000;
  param_1[7] = 0x3f800000;
  param_1[8] = 0x41200000;
  param_1[9] = 0x3d4ccccd;
  param_1[10] = 0x3f000000;
  param_1[0xb] = 0x41200000;
  param_1[0xc] = 0x3d4ccccd;
  param_1[0xd] = 0x3dcccccd;
  param_1[0xe] = 0x43ac8000;
  param_1[0xf] = 0x41a00000;
  param_1[0x10] = 0x3f000000;
  param_1[0x11] = 0x3f000000;
  return param_1;
}



/* @00436b9c file=? name=FUN_00436b9c */

void __cdecl FUN_00436b9c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e87e4;
    FUN_0042f140(param_1 + 2,2);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00436bcc file=? name=FUN_00436bcc */

undefined4 FUN_00436bcc(void)

{
  return 1;
}



/* @00436bd8 file=? name=FUN_00436bd8 */

void __cdecl FUN_00436bd8(int param_1,undefined4 param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = param_1 + 8;
  iVar2 = FUN_00417ab4(iVar1);
  if (iVar2 != 0) {
    FUN_00417a5c(iVar1);
  }
  (**(code **)(*(int *)(param_1 + 8) + 4))(iVar1,param_2);
  return;
}



/* @00436c08 file=? name=FUN_00436c08 */

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

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  iVar1 = FUN_00417ab4(param_2 + 8);
  puVar3 = (undefined4 *)(iVar1 + 0xd0);
  puVar4 = param_1;
  for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
    *puVar4 = *puVar3;
    puVar3 = puVar3 + 1;
    puVar4 = puVar4 + 1;
  }
  return param_1;
}



/* @00436c38 file=? name=FUN_00436c38 */

void __cdecl FUN_00436c38(int param_1)

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



/* @00436c44 file=? name=FUN_00436c44 */

void __cdecl FUN_00436c44(int param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1 + 0x14) = param_2;
  return;
}



/* @00436c54 file=? name=FUN_00436c54 */

bool __cdecl FUN_00436c54(int param_1,float *param_2)

{
  int iVar1;
  float local_10;
  float local_c;
  float local_8;
  
  iVar1 = FUN_00417ab4(param_1 + 8);
  FUN_00408644(&local_10,(float *)(iVar1 + 0x100),param_2);
  return *(float *)(param_1 + 0x14) * *(float *)(param_1 + 0x14) <
         local_8 * local_8 + local_c * local_c + local_10 * local_10;
}



/* @00436cac file=? name=FUN_00436cac */

void __cdecl FUN_00436cac(int param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x3c) = param_2;
  *(undefined4 *)(param_1 + 0x38) = param_3;
  return;
}



/* @00436cc0 file=? name=FUN_00436cc0 */

void __cdecl FUN_00436cc0(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  *(undefined4 *)(param_1 + 0x1c) = param_2;
  *(undefined4 *)(param_1 + 0x20) = param_3;
  *(undefined4 *)(param_1 + 0x24) = param_4;
  return;
}



/* @00436cdc file=? name=FUN_00436cdc */

void __cdecl FUN_00436cdc(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4)

{
  *(undefined4 *)(param_1 + 0x28) = param_2;
  *(undefined4 *)(param_1 + 0x2c) = param_3;
  *(undefined4 *)(param_1 + 0x30) = param_4;
  return;
}



/* @00436cf8 file=? name=FUN_00436cf8 */

void __cdecl FUN_00436cf8(int param_1,undefined4 param_2,undefined4 param_3)

{
  *(undefined4 *)(param_1 + 0x40) = param_2;
  *(undefined4 *)(param_1 + 0x44) = param_3;
  return;
}



/* @00436d0c file=? name=FUN_00436d0c */

void FUN_00436d0c(void)

{
  return;
}



/* @00436d14 file=? name=FUN_00436d14 */

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

{
  FUN_0041b868(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e87c8;
  FUN_00436f51(param_1 + 5,0);
  param_1[4] = 0xffffffff;
  return param_1;
}



/* @00436d4c file=? name=FUN_00436d4c */

void __cdecl FUN_00436d4c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e87c8;
    FUN_00436f70(param_1 + 5,2);
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00436d88 file=? name=FUN_00436d88 */

undefined4 __cdecl FUN_00436d88(int param_1)

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



/* @00436db0 file=? name=FUN_00436db0 */

void __cdecl FUN_00436db0(int param_1)

{
  int iVar1;
  int *piVar2;
  int local_10 [3];
  
  iVar1 = *(int *)(*(int *)(*(int *)(DAT_004efc94 + 0x44) + 0x4c) + 4);
  if (*(int *)(param_1 + 0x10) <= iVar1) {
    *(int *)(param_1 + 0x10) = iVar1 + 2;
    FUN_00437025(local_10,param_1 + 0x14);
    while( true ) {
      piVar2 = (int *)(**(code **)(local_10[0] + 0x28))(local_10);
      if (piVar2 == (int *)0x0) break;
      (**(code **)(*piVar2 + 0x14))(piVar2);
    }
    FUN_00437082(local_10,2);
  }
  return;
}



/* @00436e14 file=? name=FUN_00436e14 */

void __cdecl FUN_00436e14(int param_1)

{
  FUN_00436db0(param_1);
  return;
}



/* @00436e24 file=munga/audio.cpp name=FUN_00436e24 */

void FUN_00436e24(void)

{
  FUN_0040385c(s_AudioComponent__ReceiveControl___004e86be,s_d__tesla_bt_munga_AUDIO_CPP_004e86f7,
               0x1b4);
  return;
}



/* @00436e40 file=? name=FUN_00436e40 */

void __cdecl FUN_00436e40(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  uint local_18 [5];
  
  FUN_00436ea4(local_18,param_2,param_3);
  FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),2,param_1,local_18,DAT_004e17f4);
  return;
}



/* @00436e88 file=? name=FUN_00436e88 */

void __cdecl FUN_00436e88(int *param_1,int param_2)

{
  (**(code **)(*param_1 + 0x18))
            (param_1,*(undefined4 *)(param_2 + 0xc),*(undefined4 *)(param_2 + 0x10));
  return;
}



/* @00436ea4 file=? name=FUN_00436ea4 */

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

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



/* @00436f51 file=? name=FUN_00436f51 */

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

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



/* @00436f70 file=? name=FUN_00436f70 */

void __cdecl FUN_00436f70(int *param_1,byte param_2)

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



/* @00436f9c file=? name=FUN_00436f9c */

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

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



/* @00436fbb file=? name=FUN_00436fbb */

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

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



/* @00436fda file=? name=FUN_00436fda */

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

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



/* @00436ff9 file=? name=FUN_00436ff9 */

void __cdecl FUN_00436ff9(int *param_1,byte param_2)

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



/* @00437025 file=? name=FUN_00437025 */

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

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



/* @00437044 file=? name=FUN_00437044 */

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

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



/* @00437063 file=? name=FUN_00437063 */

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

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



/* @00437082 file=? name=FUN_00437082 */

void __cdecl FUN_00437082(int *param_1,byte param_2)

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



/* @004370b0 file=? name=FUN_004370b0 */

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

{
  int iVar1;
  
  FUN_00430180(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e884c;
  FUN_0042f121(param_1 + 0x77,0);
  iVar1 = (**(code **)(*(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x54) + 0xc))
                    (*(int *)(DAT_004efc94 + 0x2c) + 0x54,param_2 + 0x5c);
  if (iVar1 == 0) {
    param_1[0x7a] = 0;
  }
  else {
    (**(code **)(param_1[0x77] + 4))(param_1 + 0x77,iVar1);
    param_1[0x7a] = *(undefined4 *)(param_2 + 100);
  }
  param_1[7] = PTR_FUN_004e8834;
  param_1[8] = DAT_004e8838;
  param_1[9] = DAT_004e883c;
  param_1[10] = param_1[10] | 0x10;
  return param_1;
}



/* @00437154 file=? name=FUN_00437154 */

void __cdecl FUN_00437154(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e884c;
    FUN_0042f140(param_1 + 0x77,2);
    FUN_00430340(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00437194 file=? name=FUN_00437194 */

undefined4 __cdecl FUN_00437194(int param_1)

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



/* @004371c8 file=? name=FUN_004371c8 */

undefined4 * __cdecl FUN_004371c8(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x1ec);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_004370b0(puVar1,param_1,&DAT_004e8820);
  }
  return puVar1;
}



/* @004371f8 file=? name=FUN_004371f8 */

void __cdecl FUN_004371f8(int param_1)

{
  int iVar1;
  
  iVar1 = FUN_00417ab4(param_1 + 0x1dc);
  if (iVar1 == 0) {
    FUN_0042061c(param_1);
  }
  else {
    FUN_00424da8(iVar1,*(int *)(param_1 + 0x1e8),(float *)(param_1 + 0xd0));
    FUN_0040a968((undefined4 *)(param_1 + 0x100),(float *)(param_1 + 0xd0));
    FUN_0040a938((undefined4 *)(param_1 + 300),(undefined4 *)(param_1 + 0x100));
    FUN_0042fa8c(param_1);
  }
  return;
}



/* @00437268 file=? name=FUN_00437268 */

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

{
  *param_1 = 0x68;
  param_1[1] = 3;
  param_1[2] = 1;
  FUN_00420ea4(param_1 + 3,(undefined4 *)&DAT_00522524);
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0x54;
  FUN_00420ea4(param_1 + 8,(undefined4 *)&DAT_00522524);
  param_1[10] = param_2;
  param_1[0xb] = 0x10c;
  param_1[0xc] = *(undefined4 *)(param_3 + 0x100);
  param_1[0xd] = *(undefined4 *)(param_3 + 0x104);
  param_1[0xe] = *(undefined4 *)(param_3 + 0x108);
  param_1[0xf] = *(undefined4 *)(param_3 + 0x10c);
  param_1[0x10] = *(undefined4 *)(param_3 + 0x110);
  param_1[0x11] = *(undefined4 *)(param_3 + 0x114);
  param_1[0x12] = *(undefined4 *)(param_3 + 0x118);
  FUN_00420ea4(param_1 + 0x13,(undefined4 *)(param_3 + 0x184));
  FUN_00420ea4(param_1 + 0x15,(undefined4 *)&DAT_00522524);
  FUN_00420ea4(param_1 + 0x17,(undefined4 *)(param_3 + 0x184));
  param_1[0x19] = param_4;
  return param_1;
}



/* @004373e8 file=? name=FUN_004373e8 */

void __cdecl FUN_004373e8(undefined4 *param_1)

{
  *param_1 = *(undefined4 *)(*(int *)(*(int *)(DAT_004efc94 + 0x44) + 0x4c) + 4);
  return;
}



/* @00437404 file=? name=FUN_00437404 */

void FUN_00437404(void)

{
  FUN_004dcd94();
  return;
}



/* @00437428 file=? name=FUN_00437428 */

float10 __cdecl FUN_00437428(undefined4 param_1,int param_2)

{
  return (float10)param_2 / (float10)*(float *)(*(int *)(DAT_004efc94 + 0x44) + 0x14);
}



/* @0043744c file=? name=FUN_0043744c */

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

{
  undefined4 uVar1;
  undefined1 local_8 [4];
  
  FUN_00415eb4(param_1,param_2);
  *param_1 = &PTR_FUN_004e8b6c;
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 3,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 4,4);
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  uVar1 = FUN_004dcd94();
  param_1[5] = uVar1;
  return param_1;
}



/* @004374c4 file=munga/audlvl.cpp name=FUN_004374c4 */

void __cdecl FUN_004374c4(int *param_1,int param_2)

{
  char *pcVar1;
  uint *puVar2;
  int iVar3;
  float *pfVar4;
  float local_14;
  uint *local_10;
  int local_c;
  int local_8;
  
  FUN_00414c58(param_1);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_voice_count_004e8880);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e888c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_voice_count_004e88b1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e88bd,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e88bf,s_d__tesla_bt_munga_AUDLVL_CPP_004e88ff
                 ,0x58);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_render_type_004e891c);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8928,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_render_type_004e894d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8959,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e895b,s_d__tesla_bt_munga_AUDLVL_CPP_004e899b
                 ,0x59);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  puVar2 = (uint *)FUN_00402298(0x10);
  if (puVar2 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar2,s_suspend_delay_004e89b8);
  }
  local_10[3] = local_10[3] + 1;
  local_14 = 0.33;
  iVar3 = FUN_00403ad0(param_2,(char *)local_10[2]);
  if (iVar3 != 0) {
    pfVar4 = &local_14;
    pcVar1 = (char *)FUN_00403ad0(param_2,(char *)local_10[2]);
    FUN_00407b78(pcVar1,pfVar4);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  puVar2 = local_10 + 3;
  *puVar2 = *puVar2 - 1;
  if (*puVar2 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  return;
}



/* @00437678 file=? name=FUN_00437678 */

void __cdecl FUN_00437678(int *param_1,byte param_2)

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



/* @004376a4 file=? name=FUN_004376a4 */

undefined4 FUN_004376a4(void)

{
  FUN_00415f1c();
  return 1;
}



/* @004376b8 file=? name=FUN_004376b8 */

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

{
  undefined4 uVar1;
  int iVar2;
  int local_2c [7];
  int local_10;
  undefined1 local_c [4];
  int local_8;
  
  FUN_004178ec(param_1,param_2);
  *param_1 = &PTR_FUN_004e8b60;
  FUN_00437c84(param_1 + 4,0,1);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_8,4);
  iVar2 = 0;
  if (0 < local_8) {
    do {
      (**(code **)(*param_2 + 0x1c))(param_2,local_c,4);
      FUN_00437ddc(param_2,&local_10);
      (**(code **)(param_1[4] + 8))(param_1 + 4,local_10,local_c);
      iVar2 = iVar2 + 1;
    } while (iVar2 < local_8);
  }
  FUN_00437e0b(local_2c,(int)(param_1 + 4));
  uVar1 = (**(code **)(local_2c[0] + 0x30))(local_2c);
  param_1[3] = uVar1;
  FUN_00437e49(local_2c,2);
  return param_1;
}



/* @00437774 file=? name=FUN_00437774 */

void __cdecl FUN_00437774(int *param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  bool bVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  undefined4 *puVar4;
  uint *puVar5;
  float *pfVar6;
  uint local_48 [2];
  char *local_40;
  uint local_38 [2];
  char *local_30;
  uint *local_28;
  char *local_24;
  uint *local_20;
  char *local_1c;
  int *local_18;
  undefined4 local_14;
  float local_10;
  uint *local_c;
  int local_8;
  
  FUN_00414c58(param_1);
  local_8 = 0;
  for (puVar2 = *(undefined4 **)(param_2 + 4); puVar2 != (undefined4 *)0x0;
      puVar2 = (undefined4 *)*puVar2) {
    bVar3 = FUN_00403c20((int)puVar2,s_audio_level_of_detail_004e89c6);
    if (CONCAT31(extraout_var,bVar3) != 0) {
      local_8 = local_8 + 1;
    }
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  for (puVar2 = *(undefined4 **)(param_2 + 4); puVar2 != (undefined4 *)0x0;
      puVar2 = (undefined4 *)*puVar2) {
    bVar3 = FUN_00403c20((int)puVar2,s_audio_level_of_detail_004e89dc);
    if (CONCAT31(extraout_var_00,bVar3) != 0) {
      puVar4 = (undefined4 *)FUN_00402298(0x10);
      if (puVar4 == (undefined4 *)0x0) {
        local_c = (uint *)0x0;
      }
      else {
        local_c = (uint *)FUN_004023f4(puVar4);
      }
      local_c[3] = local_c[3] + 1;
      FUN_00402a98((int *)&local_18,(int *)&local_c,(char *)puVar2[1]);
      piVar1 = local_18 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_18,3);
      }
      pfVar6 = &local_10;
      FUN_00402838(local_38,local_c,0,(char *)0x0);
      local_1c = local_30;
      puVar5 = (uint *)FUN_00402298(0x10);
      if (puVar5 == (uint *)0x0) {
        local_20 = (uint *)0x0;
      }
      else {
        local_20 = FUN_00402460(puVar5,local_1c);
      }
      local_20[3] = local_20[3] + 1;
      FUN_004024d8((int *)local_38,2);
      FUN_00407b78((char *)local_20[2],pfVar6);
      puVar5 = local_20 + 3;
      *puVar5 = *puVar5 - 1;
      if (*puVar5 == 0) {
        FUN_004024d8((int *)local_20,3);
      }
      (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
      FUN_00402838(local_48,local_c,1,(char *)0x0);
      local_24 = local_40;
      puVar5 = (uint *)FUN_00402298(0x10);
      if (puVar5 == (uint *)0x0) {
        local_28 = (uint *)0x0;
      }
      else {
        local_28 = FUN_00402460(puVar5,local_24);
      }
      local_28[3] = local_28[3] + 1;
      FUN_004024d8((int *)local_48,2);
      local_14 = FUN_00417208((int)param_1,&local_28);
      puVar5 = local_28 + 3;
      *puVar5 = *puVar5 - 1;
      if (*puVar5 == 0) {
        FUN_004024d8((int *)local_28,3);
      }
      (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
      puVar5 = local_c + 3;
      *puVar5 = *puVar5 - 1;
      if (*puVar5 == 0) {
        FUN_004024d8((int *)local_c,3);
      }
    }
  }
  return;
}



/* @00437968 file=? name=FUN_00437968 */

void __cdecl FUN_00437968(int *param_1,byte param_2)

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



/* @004379a4 file=? name=FUN_004379a4 */

undefined4 FUN_004379a4(void)

{
  FUN_00415f1c();
  return 1;
}



/* @004379b8 file=? name=FUN_004379b8 */

void __cdecl FUN_004379b8(int param_1,float param_2)

{
  undefined4 uVar1;
  int local_20 [4];
  int local_10;
  int local_8;
  
  FUN_00437e0b(local_20,param_1 + 0x10);
  (**(code **)(local_20[0] + 8))(local_20);
  while (param_2 < *(float *)(*(int *)(local_10 + local_8 * 4) + 0x14)) {
    (**(code **)(local_20[0] + 0x10))(local_20);
  }
  uVar1 = (**(code **)(local_20[0] + 0x30))(local_20);
  *(undefined4 *)(param_1 + 0xc) = uVar1;
  FUN_00437e49(local_20,2);
  return;
}



/* @00437a20 file=? name=FUN_00437a20 */

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

{
  int iVar1;
  int local_c;
  int local_8;
  
  FUN_004178ec(param_1,param_2);
  *param_1 = &PTR_FUN_004e8b54;
  FUN_00437d32(param_1 + 3,0,1);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_8,4);
  iVar1 = 0;
  if (0 < local_8) {
    do {
      FUN_00437e75(param_2,&local_c);
      FUN_00437bec((int)param_1,local_c);
      iVar1 = iVar1 + 1;
    } while (iVar1 < local_8);
  }
  return param_1;
}



/* @00437a98 file=? name=FUN_00437a98 */

void __cdecl FUN_00437a98(int *param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  bool bVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  undefined4 *puVar4;
  int *local_14;
  undefined4 local_10;
  int *local_c;
  int local_8;
  
  FUN_00414c58(param_1);
  local_8 = 0;
  for (puVar2 = *(undefined4 **)(param_2 + 4); puVar2 != (undefined4 *)0x0;
      puVar2 = (undefined4 *)*puVar2) {
    bVar3 = FUN_00403c20((int)puVar2,s_audio_resource_004e89f2);
    if (CONCAT31(extraout_var,bVar3) != 0) {
      local_8 = local_8 + 1;
    }
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  for (puVar2 = *(undefined4 **)(param_2 + 4); puVar2 != (undefined4 *)0x0;
      puVar2 = (undefined4 *)*puVar2) {
    bVar3 = FUN_00403c20((int)puVar2,s_audio_resource_004e8a01);
    if (CONCAT31(extraout_var_00,bVar3) != 0) {
      puVar4 = (undefined4 *)FUN_00402298(0x10);
      if (puVar4 == (undefined4 *)0x0) {
        local_c = (int *)0x0;
      }
      else {
        local_c = (int *)FUN_004023f4(puVar4);
      }
      local_c[3] = local_c[3] + 1;
      FUN_00402a98((int *)&local_14,(int *)&local_c,(char *)puVar2[1]);
      piVar1 = local_14 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_14,3);
      }
      local_10 = FUN_00417208((int)param_1,&local_c);
      (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
      piVar1 = local_c + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_c,3);
      }
    }
  }
  return;
}



/* @00437b9c file=? name=FUN_00437b9c */

void __cdecl FUN_00437b9c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e8b54;
    FUN_00437d55(param_1 + 3,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00437bd8 file=? name=FUN_00437bd8 */

undefined4 FUN_00437bd8(void)

{
  FUN_00415f1c();
  return 1;
}



/* @00437bec file=? name=FUN_00437bec */

void __cdecl FUN_00437bec(int param_1,undefined4 param_2)

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



/* @00437c0c file=? name=FUN_00437c0c */

undefined4 __cdecl FUN_00437c0c(int param_1,undefined4 param_2)

{
  undefined4 uVar1;
  int local_20 [7];
  
  FUN_00437ea4(local_20,param_1 + 0xc);
  uVar1 = (**(code **)(local_20[0] + 0x34))(local_20,param_2);
  FUN_00437ee2(local_20,2);
  return uVar1;
}



/* @00437c4c file=? name=FUN_00437c4c */

undefined4 __cdecl FUN_00437c4c(int param_1)

{
  undefined4 uVar1;
  int local_20 [7];
  
  FUN_00437ea4(local_20,param_1 + 0xc);
  uVar1 = (**(code **)(local_20[0] + 0x14))(local_20);
  FUN_00437ee2(local_20,2);
  return uVar1;
}



/* @00437c84 file=? name=FUN_00437c84 */

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

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



/* @00437ca7 file=? name=FUN_00437ca7 */

void __cdecl FUN_00437ca7(int *param_1,byte param_2)

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



/* @00437cd3 file=? name=FUN_00437cd3 */

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

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



/* @00437d04 file=? name=FUN_00437d04 */

undefined4 __cdecl FUN_00437d04(undefined4 param_1,float *param_2,int param_3)

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



/* @00437d32 file=? name=FUN_00437d32 */

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

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



/* @00437d55 file=? name=FUN_00437d55 */

void __cdecl FUN_00437d55(int *param_1,byte param_2)

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



/* @00437d81 file=? name=FUN_00437d81 */

undefined4 __cdecl FUN_00437d81(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;
}



/* @00437db0 file=? name=FUN_00437db0 */

undefined4 __cdecl FUN_00437db0(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;
}



/* @00437ddc file=? name=FUN_00437ddc */

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

{
  int iVar1;
  undefined4 local_8;
  
  (**(code **)(*param_1 + 0x1c))(param_1,&local_8,4);
  iVar1 = FUN_004170e4((int)param_1,local_8);
  *param_2 = iVar1;
  return;
}



/* @00437e0b file=? name=FUN_00437e0b */

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

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



/* @00437e2a file=? name=FUN_00437e2a */

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

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



/* @00437e49 file=? name=FUN_00437e49 */

void __cdecl FUN_00437e49(int *param_1,byte param_2)

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



/* @00437e75 file=? name=FUN_00437e75 */

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

{
  int iVar1;
  undefined4 local_8;
  
  (**(code **)(*param_1 + 0x1c))(param_1,&local_8,4);
  iVar1 = FUN_004170e4((int)param_1,local_8);
  *param_2 = iVar1;
  return;
}



/* @00437ea4 file=? name=FUN_00437ea4 */

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

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



/* @00437ec3 file=? name=FUN_00437ec3 */

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

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



/* @00437ee2 file=? name=FUN_00437ee2 */

void __cdecl FUN_00437ee2(int *param_1,byte param_2)

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



/* @00437f0e file=? name=FUN_00437f0e */

undefined4 * __cdecl FUN_00437f0e(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;
}



/* @00437f3e file=? name=FUN_00437f3e */

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

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



/* @00437f6e file=? name=FUN_00437f6e */

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

{
  FUN_004190e8(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004e8b78;
  param_1[5] = *param_4;
  return param_1;
}



/* @00437f99 file=? name=FUN_00437f99 */

void __cdecl FUN_00437f99(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e8b78;
    FUN_0041910c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_00438015(param_1);
    }
  }
  return;
}



/* @00437fc5 file=? name=FUN_00437fc5 */

void FUN_00437fc5(void)

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



/* @00438015 file=? name=FUN_00438015 */

void __cdecl FUN_00438015(undefined4 *param_1)

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



/* @00438060 file=? name=FUN_00438060 */

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

{
  undefined4 local_c;
  undefined4 local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004e8c74;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 10,0xc);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_8,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  FUN_00438124((int)param_1,param_3,local_8,local_c);
  return param_1;
}



/* @004380f8 file=? name=FUN_004380f8 */

void __cdecl FUN_004380f8(int *param_1,byte param_2)

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



/* @00438124 file=? name=FUN_00438124 */

void __cdecl FUN_00438124(int param_1,int param_2,undefined4 param_3,undefined4 param_4)

{
  *(int *)(param_1 + 0x24) = param_2;
  FUN_004206b4(param_2,param_1);
  *(undefined4 *)(param_1 + 0x34) = param_4;
  *(undefined4 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x48) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x58) = 0;
  *(undefined4 *)(param_1 + 0x4c) = 0;
  *(undefined4 *)(param_1 + 0x50) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x54) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x5c) = param_3;
  *(undefined4 *)(param_1 + 0x60) = 0xffffffff;
  return;
}



/* @00438178 file=? name=FUN_00438178 */

undefined4 __cdecl FUN_00438178(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @0043818c file=munga/audloc.cpp name=FUN_0043818c */

void __cdecl FUN_0043818c(int *param_1,int param_2)

{
  char *pcVar1;
  uint *puVar2;
  int iVar3;
  int *piVar4;
  float *pfVar5;
  float local_20 [3];
  float local_14;
  uint *local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_location_offset_004e8b7c);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8b8c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_location_offset_004e8bb1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8bc1,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8bc3,s_d__tesla_bt_munga_AUDLOC_CPP_004e8c03
                 ,0x77);
  }
  FUN_00408944(pcVar1,local_20);
  (**(code **)(*param_1 + 0x20))(param_1,local_20,0xc);
  puVar2 = (uint *)FUN_00402298(0x10);
  if (puVar2 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar2,s_update_delay_004e8c20);
  }
  local_8[3] = local_8[3] + 1;
  local_c = 2;
  iVar3 = FUN_00403ad0(param_2,(char *)local_8[2]);
  if (iVar3 != 0) {
    piVar4 = &local_c;
    pcVar1 = (char *)FUN_00403ad0(param_2,(char *)local_8[2]);
    FUN_00407b30(pcVar1,piVar4);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  puVar2 = (uint *)FUN_00402298(0x10);
  if (puVar2 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar2,s_clipping_scale_004e8c2d);
  }
  local_10[3] = local_10[3] + 1;
  local_14 = 1.0;
  iVar3 = FUN_00403ad0(param_2,(char *)local_10[2]);
  if (iVar3 != 0) {
    pfVar5 = &local_14;
    pcVar1 = (char *)FUN_00403ad0(param_2,(char *)local_10[2]);
    FUN_00407b78(pcVar1,pfVar5);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  puVar2 = local_10 + 3;
  *puVar2 = *puVar2 - 1;
  if (*puVar2 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  puVar2 = local_8 + 3;
  *puVar2 = *puVar2 - 1;
  if (*puVar2 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00438340 file=? name=FUN_00438340 */

void FUN_00438340(void)

{
  return;
}



/* @00438348 file=? name=FUN_00438348 */

bool __cdecl FUN_00438348(int param_1,int param_2)

{
  float fVar1;
  int iVar2;
  float local_14;
  float local_10;
  float local_c;
  
  iVar2 = FUN_00417ab4(param_2 + 8);
  FUN_00408644(&local_14,(float *)(iVar2 + 0x100),(float *)(*(int *)(param_1 + 0x24) + 0x100));
  fVar1 = *(float *)(param_2 + 0x14) * *(float *)(param_1 + 0x34);
  return fVar1 * fVar1 < local_c * local_c + local_10 * local_10 + local_14 * local_14;
}



/* @004383b4 file=? name=FUN_004383b4 */

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

void __cdecl FUN_004383b4(int param_1,int *param_2)

{
  bool bVar1;
  int iVar2;
  undefined3 extraout_var;
  float10 fVar3;
  float *pfVar4;
  float local_cc [3];
  float local_c0 [3];
  float local_b4;
  float local_b0;
  float local_ac;
  float local_a8 [3];
  float local_9c;
  float local_98;
  float local_94;
  float local_90 [3];
  float local_84 [3];
  float local_78 [3];
  float local_6c [12];
  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;
  int *local_c;
  int *local_8;
  
  local_8 = *(int **)(param_1 + 0x24);
  local_c = (int *)FUN_00417ab4((int)(param_2 + 2));
  if ((local_c == local_8) &&
     (iVar2 = FUN_004084fc((float *)(param_1 + 0x28),(float *)&DAT_004e0f74,0.0001), iVar2 != 0)) {
    *(undefined4 *)(param_1 + 0x38) = 1;
    FUN_00408440((undefined4 *)(param_1 + 0x3c),&DAT_004e0f74);
    *(undefined4 *)(param_1 + 0x48) = 0;
    *(undefined4 *)(param_1 + 0x58) = 0;
    *(undefined4 *)(param_1 + 0x4c) = 0;
    *(undefined4 *)(param_1 + 0x50) = 0x3f800000;
    *(undefined4 *)(param_1 + 0x54) = 0x3f800000;
    return;
  }
  *(undefined4 *)(param_1 + 0x38) = 0;
  (**(code **)(*param_2 + 4))(local_6c);
  FUN_00408744(local_78,(float *)(param_1 + 0x28),(float *)(local_8 + 0x34));
  FUN_004085ec(local_84,(float *)(local_8 + 0x40),local_78);
  FUN_00408644(local_90,local_84,(float *)(local_c + 0x40));
  FUN_0040879c((float *)(param_1 + 0x3c),local_90,local_6c);
  fVar3 = FUN_004dd138((double)(*(float *)(param_1 + 0x44) * *(float *)(param_1 + 0x44) +
                               *(float *)(param_1 + 0x40) * *(float *)(param_1 + 0x40) +
                               *(float *)(param_1 + 0x3c) * *(float *)(param_1 + 0x3c)));
  *(float *)(param_1 + 0x48) = (float)fVar3;
  local_9c = 0.0;
  local_98 = 0.0;
  local_94 = -1.0;
  local_10 = *(float *)(param_1 + 0x48);
  fVar3 = FUN_004dcd00((double)local_10);
  if ((float10)_DAT_00438768 < fVar3) {
    FUN_004087f4(&local_9c,(float *)(param_1 + 0x3c));
  }
  local_14 = *(float *)(param_1 + 0x3c);
  fVar3 = FUN_004dcd00((double)local_14);
  if (fVar3 <= (float10)_DAT_00438768) {
    local_18 = *(float *)(param_1 + 0x44);
    fVar3 = FUN_004dcd00((double)local_18);
    if (fVar3 <= (float10)_DAT_00438768) {
      *(undefined4 *)(param_1 + 0x4c) = 0;
      goto LAB_004385b4;
    }
  }
  fVar3 = FUN_004dc8ec((double)*(float *)(param_1 + 0x3c),
                       SUB84((double)*(float *)(param_1 + 0x44),0),
                       (uint)((ulonglong)(double)*(float *)(param_1 + 0x44) >> 0x20));
  local_1c = (float)fVar3;
  *(float *)(param_1 + 0x4c) = local_1c;
LAB_004385b4:
  if (*(float *)(param_1 + 0x48) <= (float)param_2[8]) {
    *(undefined4 *)(param_1 + 0x50) = 0x3f800000;
  }
  else {
    local_20 = (*(float *)(param_1 + 0x48) - (float)param_2[8]) *
               ((float)param_2[9] / *(float *)(param_1 + 0x34));
    fVar3 = FUN_004dce94((double)local_20,SUB84((double)(float)param_2[7],0),
                         (uint)((ulonglong)(double)(float)param_2[7] >> 0x20));
    local_24 = (float)(fVar3 + (float10)_DAT_0043876c);
    *(float *)(param_1 + 0x50) = _DAT_0043876c / local_24;
  }
  if (*(float *)(param_1 + 0x48) <= (float)param_2[0xb]) {
    *(undefined4 *)(param_1 + 0x54) = 0x3f800000;
  }
  else {
    local_28 = (*(float *)(param_1 + 0x48) - (float)param_2[0xb]) *
               ((float)param_2[0xc] / *(float *)(param_1 + 0x34));
    fVar3 = FUN_004dce94((double)local_28,SUB84((double)(float)param_2[10],0),
                         (uint)((ulonglong)(double)(float)param_2[10] >> 0x20));
    local_2c = (float)(fVar3 + (float10)_DAT_0043876c);
    *(float *)(param_1 + 0x54) = _DAT_0043876c / local_2c;
  }
  (**(code **)(*local_c + 0x20))(local_cc);
  pfVar4 = local_cc;
  (**(code **)(*local_8 + 0x20))();
  FUN_00408644(local_a8,local_c0,pfVar4);
  FUN_0040879c(&local_b4,local_a8,(float *)(local_c + 0x34));
  local_30 = *(float *)(param_1 + 0x48);
  fVar3 = FUN_004dcd00((double)local_30);
  if (fVar3 <= (float10)_DAT_00438768) {
    *(undefined4 *)(param_1 + 0x58) = 0;
  }
  else {
    local_38 = local_94 * local_ac + local_98 * local_b0 + local_9c * local_b4;
    local_3c = (float)param_2[6] * _DAT_00438770;
    if (*(float *)(param_1 + 0x48) < local_3c) {
      local_38 = (*(float *)(param_1 + 0x48) / local_3c) * local_38;
    }
    bVar1 = FUN_00438774(param_1,(int)param_2,local_38,&local_34);
    if (CONCAT31(extraout_var,bVar1) != 0) {
      *(float *)(param_1 + 0x58) = local_34;
    }
  }
  return;
}



