/* @0044c9d4 file=? name=FUN_0044c9d4 */

void __cdecl FUN_0044c9d4(int param_1,int param_2,undefined1 param_3)

{
  int iVar1;
  int local_10 [3];
  
  FUN_0044cbfb(local_10,param_1 + 0xc);
  while( true ) {
    iVar1 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar1 == 0) break;
    FUN_0044c7d0(iVar1,param_2,param_3);
  }
  FUN_0044cc39(local_10,2);
  return;
}



/* @0044ca72 file=? name=FUN_0044ca72 */

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

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



/* @0044ca91 file=? name=FUN_0044ca91 */

void __cdecl FUN_0044ca91(int *param_1,byte param_2)

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



/* @0044cabd file=? name=FUN_0044cabd */

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

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



/* @0044cadc file=? name=FUN_0044cadc */

void __cdecl FUN_0044cadc(int *param_1,byte param_2)

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



/* @0044cb08 file=? name=FUN_0044cb08 */

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

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



/* @0044cb27 file=? name=FUN_0044cb27 */

void __cdecl FUN_0044cb27(int *param_1,byte param_2)

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



/* @0044cb53 file=? name=FUN_0044cb53 */

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

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



/* @0044cb72 file=? name=FUN_0044cb72 */

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

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



/* @0044cb91 file=? name=FUN_0044cb91 */

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

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



/* @0044cbb0 file=? name=FUN_0044cbb0 */

void __cdecl FUN_0044cbb0(int *param_1,byte param_2)

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



/* @0044cbdc file=? name=FUN_0044cbdc */

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

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



/* @0044cbfb file=? name=FUN_0044cbfb */

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

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



/* @0044cc1a file=? name=FUN_0044cc1a */

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

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



/* @0044cc39 file=? name=FUN_0044cc39 */

void __cdecl FUN_0044cc39(int *param_1,byte param_2)

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



/* @0044cc68 file=? name=FUN_0044cc68 */

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

{
  int *piVar1;
  int iVar2;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004efc14;
  iVar2 = *param_2;
  param_1[3] = iVar2;
  piVar1 = (int *)(iVar2 + 0xc);
  *piVar1 = *piVar1 + 1;
  param_1[4] = param_3;
  return param_1;
}



/* @0044cc98 file=? name=FUN_0044cc98 */

void __cdecl FUN_0044cc98(int *param_1,byte param_2)

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



/* @0044ccdc file=? name=FUN_0044ccdc */

void __cdecl FUN_0044ccdc(int param_1,int param_2)

{
  uint *puVar1;
  undefined4 *puVar2;
  char *pcVar3;
  uint *puVar4;
  undefined4 *puVar5;
  int local_c;
  int *local_8;
  
  local_8 = FUN_00404720(param_2,s_ordinals_004ef8e4,s_bitmap_004ef8ed);
  if (local_8 != (int *)0x0) {
    puVar2 = (undefined4 *)local_8[1];
    local_c = 0;
    while (puVar2 != (undefined4 *)0x0) {
      local_c = local_c + 1;
      pcVar3 = (char *)puVar2[1];
      puVar4 = (uint *)FUN_00402298(0x10);
      if (puVar4 == (uint *)0x0) {
        puVar4 = (uint *)0x0;
      }
      else {
        puVar4 = FUN_00402460(puVar4,pcVar3);
      }
      puVar4[3] = puVar4[3] + 1;
      puVar5 = (undefined4 *)FUN_00402298(0x1c);
      if (puVar5 == (undefined4 *)0x0) {
        puVar5 = (undefined4 *)0x0;
      }
      else {
        puVar5 = FUN_004493a8(puVar5,param_2,(char *)puVar4[2]);
      }
      (**(code **)(*(int *)(param_1 + 0x98) + 8))(param_1 + 0x98,puVar5,&local_c);
      puVar2 = (undefined4 *)*puVar2;
      puVar1 = puVar4 + 3;
      *puVar1 = *puVar1 - 1;
      if (*puVar1 == 0) {
        FUN_004024d8((int *)puVar4,3);
      }
    }
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
  }
  return;
}



/* @0044cdc8 file=? name=FUN_0044cdc8 */

void __cdecl FUN_0044cdc8(int param_1,int param_2)

{
  undefined4 *puVar1;
  uint *puVar2;
  undefined4 *puVar3;
  char *local_18;
  char *local_14;
  uint *local_10;
  int local_c;
  int *local_8;
  
  local_8 = FUN_00404720(param_2,s_teams_004ef8f4,&DAT_004ef8fa);
  if (local_8 != (int *)0x0) {
    puVar1 = (undefined4 *)local_8[1];
    local_c = 0;
    while (puVar1 != (undefined4 *)0x0) {
      local_14 = (char *)puVar1[1];
      puVar2 = (uint *)FUN_00402298(0x10);
      if (puVar2 == (uint *)0x0) {
        local_10 = (uint *)0x0;
      }
      else {
        local_10 = FUN_00402460(puVar2,local_14);
      }
      local_10[3] = local_10[3] + 1;
      FUN_00404088(param_2,(char *)local_10[2],s_bitmap_004ef8ff,&local_18);
      puVar3 = (undefined4 *)FUN_00402298(0x1c);
      if (puVar3 == (undefined4 *)0x0) {
        puVar3 = (undefined4 *)0x0;
      }
      else {
        puVar3 = FUN_004493a8(puVar3,param_2,local_18);
      }
      (**(code **)(*(int *)(param_1 + 0xb0) + 8))(param_1 + 0xb0,puVar3,&local_c);
      local_c = local_c + 1;
      puVar1 = (undefined4 *)*puVar1;
      puVar2 = local_10 + 3;
      *puVar2 = *puVar2 - 1;
      if (*puVar2 == 0) {
        FUN_004024d8((int *)local_10,3);
      }
    }
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
  }
  return;
}



/* @0044cecc file=? name=FUN_0044cecc */

void __cdecl FUN_0044cecc(int param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  int *local_2c;
  undefined4 *local_28;
  int *local_24;
  int local_20;
  undefined4 *local_1c;
  int *local_18;
  undefined4 *local_14;
  int *local_10;
  int *local_c;
  int *local_8;
  
  local_8 = FUN_00404720(param_2,s_largebitmap_004ef906,s_bitmap_004ef912);
  if (local_8 != (int *)0x0) {
    puVar4 = (undefined4 *)local_8[1];
    local_c = FUN_00404720(param_2,s_smallbitmap_004ef919,s_bitmap_004ef925);
    if (local_c != (int *)0x0) {
      puVar3 = (undefined4 *)local_c[1];
      local_14 = (undefined4 *)FUN_00402298(0x10);
      if (local_14 == (undefined4 *)0x0) {
        local_10 = (int *)0x0;
      }
      else {
        local_10 = (int *)FUN_004023f4(local_14);
      }
      local_10[3] = local_10[3] + 1;
      local_1c = (undefined4 *)FUN_00402298(0x10);
      if (local_1c == (undefined4 *)0x0) {
        local_18 = (int *)0x0;
      }
      else {
        local_18 = (int *)FUN_004023f4(local_1c);
      }
      local_18[3] = local_18[3] + 1;
      local_20 = 0;
      for (; (puVar4 != (undefined4 *)0x0 && (puVar3 != (undefined4 *)0x0));
          puVar3 = (undefined4 *)*puVar3) {
        local_20 = local_20 + 1;
        FUN_00402a98((int *)&local_24,(int *)&local_10,(char *)puVar4[1]);
        piVar1 = local_24 + 3;
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_004024d8(local_24,3);
        }
        local_28 = (undefined4 *)FUN_00402298(0x1c);
        if (local_28 == (undefined4 *)0x0) {
          puVar2 = (undefined4 *)0x0;
        }
        else {
          puVar2 = FUN_004493a8(local_28,param_2,(char *)local_10[2]);
        }
        (**(code **)(*(int *)(param_1 + 0x68) + 8))(param_1 + 0x68,puVar2,&local_20);
        FUN_00402a98((int *)&local_2c,(int *)&local_18,(char *)puVar3[1]);
        piVar1 = local_2c + 3;
        *piVar1 = *piVar1 + -1;
        if (*piVar1 == 0) {
          FUN_004024d8(local_2c,3);
        }
        puVar2 = (undefined4 *)FUN_00402298(0x1c);
        if (puVar2 == (undefined4 *)0x0) {
          puVar2 = (undefined4 *)0x0;
        }
        else {
          puVar2 = FUN_004493a8(puVar2,param_2,(char *)local_18[2]);
        }
        (**(code **)(*(int *)(param_1 + 0x80) + 8))(param_1 + 0x80,puVar2,&local_20);
        puVar4 = (undefined4 *)*puVar4;
      }
      if (local_8 != (int *)0x0) {
        (**(code **)*local_8)(local_8,3);
      }
      if (local_c != (int *)0x0) {
        (**(code **)*local_c)(local_c,3);
      }
      piVar1 = local_18 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_18,3);
      }
      piVar1 = local_10 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_10,3);
      }
    }
  }
  return;
}



/* @0044d0bc file=? name=FUN_0044d0bc */

void __cdecl FUN_0044d0bc(int param_1,int param_2)

{
  undefined4 *puVar1;
  uint *puVar2;
  undefined4 *puVar3;
  char *local_18;
  char *local_14;
  uint *local_10;
  int local_c;
  int *local_8;
  
  local_8 = FUN_00404720(param_2,s_landmarks_004ef92c,s_landmark_004ef936);
  if (local_8 != (int *)0x0) {
    puVar1 = (undefined4 *)local_8[1];
    local_c = 0;
    while (puVar1 != (undefined4 *)0x0) {
      local_14 = (char *)puVar1[1];
      puVar2 = (uint *)FUN_00402298(0x10);
      if (puVar2 == (uint *)0x0) {
        local_10 = (uint *)0x0;
      }
      else {
        local_10 = FUN_00402460(puVar2,local_14);
      }
      local_10[3] = local_10[3] + 1;
      FUN_00404088(param_2,(char *)local_10[2],s_bitmap_004ef93f,&local_18);
      puVar3 = (undefined4 *)FUN_00402298(0x1c);
      if (puVar3 == (undefined4 *)0x0) {
        puVar3 = (undefined4 *)0x0;
      }
      else {
        puVar3 = FUN_004493a8(puVar3,param_2,local_18);
      }
      (**(code **)(*(int *)(param_1 + 200) + 8))(param_1 + 200,puVar3,&local_c);
      local_c = local_c + 1;
      puVar1 = (undefined4 *)*puVar1;
      puVar2 = local_10 + 3;
      *puVar2 = *puVar2 - 1;
      if (*puVar2 == 0) {
        FUN_004024d8((int *)local_10,3);
      }
    }
    if (local_8 != (int *)0x0) {
      (**(code **)*local_8)(local_8,3);
    }
  }
  return;
}



/* @0044d1c0 file=? name=FUN_0044d1c0 */

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

{
  uint *puVar1;
  char cVar2;
  bool bVar3;
  int iVar4;
  undefined4 *puVar5;
  char *pcVar6;
  undefined3 extraout_var;
  undefined4 *puVar7;
  uint uVar8;
  uint uVar9;
  char *pcVar10;
  int local_28;
  uint *local_24;
  char *local_20;
  uint *local_1c;
  int *local_18;
  char *local_14;
  char *local_10;
  char *local_c;
  char *local_8;
  
  *param_1 = &PTR_FUN_004efc0c;
  FUN_0044d884(param_1 + 3,0);
  FUN_0044d8cf(param_1 + 0x14,0,1);
  FUN_0044da50(param_1 + 0x1a,0,1);
  FUN_0044da50(param_1 + 0x20,0,1);
  FUN_0044da50(param_1 + 0x26,0,1);
  FUN_0044da50(param_1 + 0x2c,0,1);
  FUN_0044da50(param_1 + 0x32,0,1);
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0;
  param_1[0xe] = 0;
  param_1[0x10] = 0;
  iVar4 = FUN_00404088(param_2,s_mission_004ef946,&DAT_004ef94e,&local_8);
  if (iVar4 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_ERROR__no_map_in_egg__004ef952,(char *)0x0);
    FUN_004036a0(1);
  }
  param_1[0x38] = 0;
  FUN_00404118(param_2,s_mission_004ef969,s_length_004ef971,(float *)(param_1 + 0x38));
  puVar5 = (undefined4 *)FUN_00406ff8(param_3,local_8,0xe,-1);
  if (puVar5 == (undefined4 *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_ERROR__Couldn_t_find_map_in_reso_004ef978,(char *)0x0);
    FUN_004036a0(1);
  }
  param_1[1] = *puVar5;
  puVar5 = (undefined4 *)FUN_00406ff8(param_3,local_8,0x1a,-1);
  if (puVar5 == (undefined4 *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_ERROR__Couldn_t_find_existance_m_004ef9a4,(char *)0x0);
    FUN_004036a0(1);
  }
  param_1[2] = *puVar5;
  iVar4 = FUN_00404088(param_2,s_mission_004ef9da,&DAT_004ef9e2,&local_c);
  if (iVar4 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_ERROR__no_time_in_egg__004ef9e7,(char *)0x0);
    FUN_004036a0(1);
  }
  iVar4 = FUN_00404088(param_2,s_mission_004ef9ff,s_weather_004efa07,&local_10);
  if (iVar4 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_ERROR__no_weather_in_egg__004efa0f,(char *)0x0);
    FUN_004036a0(1);
  }
  iVar4 = FUN_00404088(param_2,s_mission_004efa2a,s_scenario_004efa32,&local_14);
  if (iVar4 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_ERROR__no_scenario_in_egg__004efa3b,(char *)0x0);
    FUN_004036a0(1);
  }
  iVar4 = FUN_004d4a78(local_c);
  pcVar6 = (char *)FUN_004022b0(iVar4 + 1);
  param_1[0xc] = pcVar6;
  uVar8 = 0xffffffff;
  do {
    pcVar10 = local_c;
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    pcVar10 = local_c + 1;
    cVar2 = *local_c;
    local_c = pcVar10;
  } while (cVar2 != '\0');
  uVar8 = ~uVar8;
  pcVar10 = pcVar10 + -uVar8;
  for (uVar9 = uVar8 >> 2; uVar9 != 0; uVar9 = uVar9 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar10;
    pcVar10 = pcVar10 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar8 = uVar8 & 3; uVar8 != 0; uVar8 = uVar8 - 1) {
    *pcVar6 = *pcVar10;
    pcVar10 = pcVar10 + 1;
    pcVar6 = pcVar6 + 1;
  }
  iVar4 = FUN_004d4a78(local_10);
  pcVar6 = (char *)FUN_004022b0(iVar4 + 1);
  param_1[0xd] = pcVar6;
  uVar8 = 0xffffffff;
  do {
    pcVar10 = local_10;
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    pcVar10 = local_10 + 1;
    cVar2 = *local_10;
    local_10 = pcVar10;
  } while (cVar2 != '\0');
  uVar8 = ~uVar8;
  pcVar10 = pcVar10 + -uVar8;
  for (uVar9 = uVar8 >> 2; uVar9 != 0; uVar9 = uVar9 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar10;
    pcVar10 = pcVar10 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar8 = uVar8 & 3; uVar8 != 0; uVar8 = uVar8 - 1) {
    *pcVar6 = *pcVar10;
    pcVar10 = pcVar10 + 1;
    pcVar6 = pcVar6 + 1;
  }
  iVar4 = FUN_004d4a78(local_14);
  pcVar6 = (char *)FUN_004022b0(iVar4 + 1);
  param_1[0xe] = pcVar6;
  uVar8 = 0xffffffff;
  do {
    pcVar10 = local_14;
    if (uVar8 == 0) break;
    uVar8 = uVar8 - 1;
    pcVar10 = local_14 + 1;
    cVar2 = *local_14;
    local_14 = pcVar10;
  } while (cVar2 != '\0');
  uVar8 = ~uVar8;
  pcVar10 = pcVar10 + -uVar8;
  for (uVar9 = uVar8 >> 2; uVar9 != 0; uVar9 = uVar9 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar10;
    pcVar10 = pcVar10 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar8 = uVar8 & 3; uVar8 != 0; uVar8 = uVar8 - 1) {
    *pcVar6 = *pcVar10;
    pcVar10 = pcVar10 + 1;
    pcVar6 = pcVar6 + 1;
  }
  param_1[0x12] = 0;
  local_18 = FUN_00404720(param_2,s_pilots_004efa57,s_pilot_004efa5e);
  puVar5 = (undefined4 *)local_18[1];
  while (puVar5 != (undefined4 *)0x0) {
    pcVar6 = (char *)puVar5[1];
    local_20 = pcVar6;
    local_24 = (uint *)FUN_00402298(0x10);
    if (local_24 == (uint *)0x0) {
      local_1c = (uint *)0x0;
    }
    else {
      local_1c = FUN_00402460(local_24,local_20);
    }
    local_1c[3] = local_1c[3] + 1;
    bVar3 = FUN_004040d8(param_2,pcVar6,s_hostType_004efa64,&local_28);
    if (CONCAT31(extraout_var,bVar3) == 0) {
      FUN_004dbb24(&DAT_00524e20,s_ERROR__no_host_type_in_egg__004efa6d,(char *)0x0);
      FUN_004036a0(1);
    }
    puVar7 = (undefined4 *)FUN_00402298(0x14);
    if (puVar7 == (undefined4 *)0x0) {
      puVar7 = (undefined4 *)0x0;
    }
    else {
      puVar7 = FUN_0044cc68(puVar7,(int *)&local_1c,local_28);
    }
    (**(code **)(param_1[3] + 4))(param_1 + 3,puVar7);
    param_1[0x12] = param_1[0x12] + 1;
    puVar5 = (undefined4 *)*puVar5;
    puVar1 = local_1c + 3;
    *puVar1 = *puVar1 - 1;
    if (*puVar1 == 0) {
      FUN_004024d8((int *)local_1c,3);
    }
  }
  if (local_18 != (int *)0x0) {
    (**(code **)*local_18)(local_18,3);
  }
  FUN_0044ccdc((int)param_1,param_2);
  FUN_0044cecc((int)param_1,param_2);
  param_1[0x10] = 0;
  return param_1;
}



/* @0044d5d4 file=? name=FUN_0044d5d4 */

void __cdecl FUN_0044d5d4(int *param_1,byte param_2)

{
  void *this;
  void *this_00;
  void *this_01;
  void *this_02;
  void *this_03;
  void *this_04;
  int local_90 [5];
  int local_7c [5];
  int local_68 [5];
  int local_54 [5];
  int local_40 [5];
  int local_2c [5];
  int local_18 [5];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004efc0c;
    FUN_0044db95(local_18,(int)(param_1 + 3));
    FUN_00417858(local_18,local_18,1);
    if ((int *)param_1[0xb] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0xb]);
    }
    if ((int *)param_1[10] != (int *)0x0) {
      FUN_004022e8((int *)param_1[10]);
    }
    if ((int *)param_1[8] != (int *)0x0) {
      FUN_004022e8((int *)param_1[8]);
    }
    if ((int *)param_1[9] != (int *)0x0) {
      FUN_004022e8((int *)param_1[9]);
    }
    if ((int *)param_1[0x10] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0x10]);
    }
    if ((int *)param_1[0xc] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0xc]);
    }
    if ((int *)param_1[0xd] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0xd]);
    }
    if ((int *)param_1[0xe] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0xe]);
    }
    FUN_0044dc3d(local_2c,(int)(param_1 + 0x20));
    FUN_00417858(this,local_2c,1);
    FUN_0044dc3d(local_40,(int)(param_1 + 0x1a));
    FUN_00417858(this_00,local_40,1);
    FUN_0044dc3d(local_54,(int)(param_1 + 0x26));
    FUN_00417858(this_01,local_54,1);
    FUN_0044dc3d(local_68,(int)(param_1 + 0x2c));
    FUN_00417858(this_02,local_68,1);
    FUN_0044dc3d(local_7c,(int)(param_1 + 0x32));
    FUN_00417858(this_03,local_7c,1);
    FUN_004323c7(local_90,(int)(param_1 + 0x14));
    FUN_00417858(this_04,local_90,1);
    FUN_00432405(local_90,2);
    FUN_0044dc7b(local_7c,2);
    FUN_0044dc7b(local_68,2);
    FUN_0044dc7b(local_54,2);
    FUN_0044dc7b(local_40,2);
    FUN_0044dc7b(local_2c,2);
    FUN_0044dbf2(local_18,2);
    FUN_0044da73(param_1 + 0x32,2);
    FUN_0044da73(param_1 + 0x2c,2);
    FUN_0044da73(param_1 + 0x26,2);
    FUN_0044da73(param_1 + 0x20,2);
    FUN_0044da73(param_1 + 0x1a,2);
    FUN_0044d8f2(param_1 + 0x14,2);
    FUN_0044d8a3(param_1 + 3,2);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044d820 file=? name=FUN_0044d820 */

void FUN_0044d820(void)

{
  return;
}



/* @0044d828 file=? name=FUN_0044d828 */

undefined4 FUN_0044d828(void)

{
  return 1;
}



/* @0044d834 file=? name=FUN_0044d834 */

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

{
  FUN_0044db95(param_1,param_2 + 0xc);
  *param_1 = &PTR_FUN_004efbb8;
  return param_1;
}



/* @0044d858 file=? name=FUN_0044d858 */

void __cdecl FUN_0044d858(int *param_1,byte param_2)

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



/* @0044d884 file=? name=FUN_0044d884 */

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

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



/* @0044d8a3 file=? name=FUN_0044d8a3 */

void __cdecl FUN_0044d8a3(int *param_1,byte param_2)

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



/* @0044d8cf file=? name=FUN_0044d8cf */

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

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



/* @0044d8f2 file=? name=FUN_0044d8f2 */

void __cdecl FUN_0044d8f2(int *param_1,byte param_2)

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



/* @0044d91e file=? name=FUN_0044d91e */

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

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



/* @0044d96b file=? name=FUN_0044d96b */

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

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



/* @0044d9b5 file=? name=FUN_0044d9b5 */

void FUN_0044d9b5(void)

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



/* @0044da05 file=? name=FUN_0044da05 */

void __cdecl FUN_0044da05(undefined4 *param_1)

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



/* @0044da50 file=? name=FUN_0044da50 */

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

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



/* @0044da73 file=? name=FUN_0044da73 */

void __cdecl FUN_0044da73(int *param_1,byte param_2)

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



/* @0044da9f file=? name=FUN_0044da9f */

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

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



/* @0044dace file=? name=FUN_0044dace */

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

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



/* @0044dafa file=? name=FUN_0044dafa */

void FUN_0044dafa(void)

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



/* @0044db4a file=? name=FUN_0044db4a */

void __cdecl FUN_0044db4a(undefined4 *param_1)

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



/* @0044db95 file=? name=FUN_0044db95 */

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

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



/* @0044dbb4 file=? name=FUN_0044dbb4 */

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

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



/* @0044dbd3 file=? name=FUN_0044dbd3 */

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

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



/* @0044dbf2 file=? name=FUN_0044dbf2 */

void __cdecl FUN_0044dbf2(int *param_1,byte param_2)

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



/* @0044dc1e file=? name=FUN_0044dc1e */

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

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



/* @0044dc3d file=? name=FUN_0044dc3d */

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

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



/* @0044dc5c file=? name=FUN_0044dc5c */

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

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



/* @0044dc7b file=? name=FUN_0044dc7b */

void __cdecl FUN_0044dc7b(int *param_1,byte param_2)

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



/* @0044dca7 file=? name=FUN_0044dca7 */

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

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



/* @0044dcd7 file=? name=FUN_0044dcd7 */

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

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



/* @0044dd08 file=? name=FUN_0044dd08 */

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

{
  FUN_0041b838(param_1,param_2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004efc7c;
  return param_1;
}



/* @0044dd2c file=? name=FUN_0044dd2c */

void __cdecl FUN_0044dd2c(int *param_1,byte param_2)

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



/* @0044dd58 file=? name=FUN_0044dd58 */

undefined4 * __cdecl FUN_0044dd58(undefined4 *param_1)

{
  undefined4 *puVar1;
  
  FUN_0041b838(param_1,3,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004efc64;
  FUN_0044df10(param_1 + 4,0);
  puVar1 = (undefined4 *)FUN_00402298(0x14);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00401662(puVar1,(int)(param_1 + 4));
  }
  param_1[9] = puVar1;
  return param_1;
}



/* @0044ddac file=? name=FUN_0044ddac */

void __thiscall FUN_0044ddac(void *this,int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004efc64;
    FUN_00417858(this,(int *)param_1[9],1);
    puVar1 = (undefined4 *)param_1[9];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    FUN_0044df2f(param_1 + 4,2);
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044de08 file=? name=FUN_0044de08 */

undefined4 __cdecl FUN_0044de08(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @0044de1c file=? name=FUN_0044de1c */

void __cdecl FUN_0044de1c(int param_1,undefined4 param_2)

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



/* @0044de38 file=? name=FUN_0044de38 */

void __cdecl FUN_0044de38(int param_1)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = (**(code **)(**(int **)(param_1 + 0x24) + 0x30))(*(int **)(param_1 + 0x24));
  if (iVar1 == 0) {
    (**(code **)(**(int **)(param_1 + 0x24) + 4))(*(int **)(param_1 + 0x24));
  }
  piVar2 = (int *)(**(code **)(**(int **)(param_1 + 0x24) + 0x30))(*(int **)(param_1 + 0x24));
  (**(code **)(*piVar2 + 0x14))(piVar2);
  (**(code **)(**(int **)(param_1 + 0x24) + 0xc))(*(int **)(param_1 + 0x24));
  return;
}



/* @0044df10 file=? name=FUN_0044df10 */

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

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



/* @0044df2f file=? name=FUN_0044df2f */

void __cdecl FUN_0044df2f(int *param_1,byte param_2)

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



/* @0044dfe0 file=? name=FUN_0044dfe0 */

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

{
  undefined4 uVar1;
  undefined4 *puVar2;
  
  FUN_0041d520(param_1,param_4,param_5,4);
  *param_1 = &PTR_FUN_004f03ac;
  FUN_0041b9ec(param_1 + 0x1d,0xc);
  param_1[0x15] = param_3;
  uVar1 = FUN_0041ac98(5);
  param_1[0x18] = uVar1;
  param_1[0x1a] = param_2;
  param_1[5] = 0;
  param_1[8] = 0;
  param_1[10] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  param_1[0x19] = 0;
  param_1[0xc] = 0;
  param_1[0x11] = 0;
  param_1[0x12] = 0;
  param_1[0x13] = 0;
  param_1[0x1b] = 0;
  param_1[0x32] = 0;
  puVar2 = (undefined4 *)FUN_00402298(0x24);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_00421114(puVar2);
  }
  param_1[9] = puVar2;
  puVar2 = (undefined4 *)FUN_00402298(0x6c);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_00428d88(puVar2);
  }
  param_1[0xb] = puVar2;
  puVar2 = (undefined4 *)FUN_00402298(0x1c);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_004356d4(puVar2);
  }
  param_1[0xd] = puVar2;
  puVar2 = (undefined4 *)FUN_00402298(0x24);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_00436288(puVar2);
  }
  param_1[0xe] = puVar2;
  puVar2 = (undefined4 *)FUN_00402298(0x28);
  if (puVar2 == (undefined4 *)0x0) {
    puVar2 = (undefined4 *)0x0;
  }
  else {
    puVar2 = FUN_0044dd58(puVar2);
  }
  param_1[0x19] = puVar2;
  param_1[0x1c] = 0;
  FUN_0041bbd8((int)(param_1 + 0x1d),0);
  param_1[0x32] = 0;
  param_1[0x16] = 0;
  param_1[6] = 0;
  param_1[0x33] = 0;
  puVar2 = (undefined4 *)FUN_00414b60();
  param_1[7] = *puVar2;
  return param_1;
}



/* @0044e13c file=? name=FUN_0044e13c */

int __cdecl FUN_0044e13c(int param_1)

{
  int iVar1;
  int local_14 [4];
  
  FUN_0044f0d5(local_14,param_1,0xffffffff);
  do {
    iVar1 = (**(code **)(local_14[0] + 0x28))(local_14);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_0044f13a(local_14,2);
      return iVar1;
    }
  } while (*(int *)(iVar1 + 4) != 0x4d);
  FUN_0044f13a(local_14,2);
  return iVar1;
}



/* @0044e19c file=? name=FUN_0044e19c */

float10 __cdecl FUN_0044e19c(int param_1)

{
  int iVar1;
  
  iVar1 = FUN_0044e13c(param_1);
  return (float10)*(float *)(iVar1 + 0x10);
}



/* @0044e1b0 file=? name=FUN_0044e1b0 */

void __cdecl FUN_0044e1b0(int *param_1)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = (**(code **)(*param_1 + 0x4c))(param_1);
  param_1[0xc] = iVar1;
  iVar1 = (**(code **)(*param_1 + 0x3c))(param_1);
  param_1[8] = iVar1;
  iVar1 = (**(code **)(*param_1 + 0x40))(param_1);
  param_1[10] = iVar1;
  if (iVar1 != 0) {
    FUN_0043364c();
  }
  iVar1 = (**(code **)(*param_1 + 0x5c))(param_1);
  param_1[0x14] = iVar1;
  piVar2 = (int *)(**(code **)(*param_1 + 0x50))(param_1);
  param_1[0x11] = (int)piVar2;
  if (piVar2 != (int *)0x0) {
    (**(code **)(*piVar2 + 0x48))(piVar2);
  }
  iVar1 = (**(code **)(*param_1 + 0x44))(param_1);
  param_1[0xf] = iVar1;
  iVar1 = (**(code **)(*param_1 + 0x48))(param_1);
  param_1[0x10] = iVar1;
  (**(code **)(*param_1 + 0x1c))(param_1);
  param_1[0x1c] = 1;
  FUN_0041bbd8((int)(param_1 + 0x1d),1);
  iVar1 = (**(code **)(*param_1 + 0x54))(param_1);
  param_1[0x12] = iVar1;
  iVar1 = (**(code **)(*param_1 + 0x58))(param_1);
  param_1[0x13] = iVar1;
  return;
}



/* @0044e254 file=? name=FUN_0044e254 */

void __cdecl FUN_0044e254(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f0394;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f037c;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f0364;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f034c;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f0334;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f031c;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  puVar1 = (undefined4 *)FUN_00402298(0x10);
  if (puVar1 != (undefined4 *)0x0) {
    FUN_0044dd08(puVar1,0x48);
    *puVar1 = &PTR_FUN_004f0304;
  }
  FUN_0044de1c(*(int *)(param_1 + 100),puVar1);
  return;
}



/* @0044e3c0 file=? name=FUN_0044e3c0 */

undefined4 * FUN_0044e3c0(void)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x44);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0043457c(puVar1);
  }
  return puVar1;
}



/* @0044e3e0 file=? name=FUN_0044e3e0 */

undefined4 * FUN_0044e3e0(void)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x28);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0041d5b4(puVar1,&DAT_004e3744);
  }
  return puVar1;
}



/* @0044e408 file=munga/app.cpp name=FUN_0044e408 */

undefined4 FUN_0044e408(void)

{
  FUN_0040385c(s_Application__MakeRegistry___Shou_004efe5c,s_d__tesla_bt_munga_APP_CPP_004efe90,
               0x215);
  return 0;
}



/* @0044e428 file=munga/app.cpp name=FUN_0044e428 */

undefined4 FUN_0044e428(void)

{
  FUN_0040385c(s_Application__MakeModeManager___S_004efeaa,s_d__tesla_bt_munga_APP_CPP_004efee1,
               0x221);
  return 0;
}



/* @0044e448 file=munga/app.cpp name=FUN_0044e448 */

undefined4 FUN_0044e448(void)

{
  FUN_0040385c(s_Application__MakeControlsManager_004efefb,s_d__tesla_bt_munga_APP_CPP_004eff36,
               0x22d);
  return 0;
}



/* @0044e468 file=munga/app.cpp name=FUN_0044e468 */

undefined4 FUN_0044e468(void)

{
  FUN_0040385c(s_Application__MakeIntercomManager_004eff50,s_d__tesla_bt_munga_APP_CPP_004eff8b,
               0x239);
  return 0;
}



/* @0044e488 file=? name=FUN_0044e488 */

undefined4 __cdecl FUN_0044e488(int param_1,int param_2)

{
  int *piVar1;
  undefined4 uVar2;
  
  uVar2 = 0;
  if (*(int *)(param_1 + 0x70) != 0) {
    FUN_004dcd94();
    (**(code **)(**(int **)(param_1 + 0x3c) + 0x18))(*(int **)(param_1 + 0x3c));
    if (*(int *)(param_1 + 0x88) == 1) {
      uVar2 = *(undefined4 *)(param_1 + 0x70);
    }
    else {
      FUN_00435794(*(int *)(param_1 + 0x34));
      FUN_004363ec(*(int *)(param_1 + 0x38),param_2);
      FUN_00434a08();
      FUN_0043649c(*(int *)(param_1 + 0x38));
      FUN_00436440(*(int *)(param_1 + 0x38),param_2);
      (**(code **)(**(int **)(param_1 + 0x40) + 0x24))(*(int **)(param_1 + 0x40));
      if (*(int *)(param_1 + 0x88) == 5) {
        piVar1 = (int *)FUN_00414b60();
        *(float *)(param_1 + 0x58) =
             *(float *)(*(int *)(param_1 + 200) + 0xe0) -
             (float)(*piVar1 - *(int *)(param_1 + 0x5c)) / DAT_0052140c;
      }
      *(undefined4 *)(param_1 + 0xcc) = 0;
      if ((*(int *)(param_1 + 0x70) == 0) || (DAT_004efc98 != 0)) {
        uVar2 = 0;
      }
      else {
        uVar2 = 1;
      }
    }
  }
  return uVar2;
}



/* @0044e6c0 file=? name=FUN_0044e6c0 */

void __cdecl FUN_0044e6c0(int param_1)

{
  *(undefined4 *)(param_1 + 0x70) = 0;
  FUN_004d9c70(&DAT_00524e20);
  FUN_0041bbd8(param_1 + 0x74,7);
  return;
}



/* @0044e6e8 file=? name=FUN_0044e6e8 */

undefined4 __cdecl FUN_0044e6e8(int param_1)

{
  undefined4 *puVar1;
  
  if (*(int **)(param_1 + 0x4c) != (int *)0x0) {
    FUN_00435f6c(*(int **)(param_1 + 0x4c));
    (**(code **)(**(int **)(param_1 + 0x4c) + 0x18))(*(int **)(param_1 + 0x4c));
  }
  if (*(int **)(param_1 + 0x48) != (int *)0x0) {
    FUN_00435f6c(*(int **)(param_1 + 0x48));
    (**(code **)(**(int **)(param_1 + 0x48) + 0x18))(*(int **)(param_1 + 0x48));
  }
  if (*(int **)(param_1 + 0x44) != (int *)0x0) {
    FUN_00435f6c(*(int **)(param_1 + 0x44));
    (**(code **)(**(int **)(param_1 + 0x44) + 0x18))(*(int **)(param_1 + 0x44));
  }
  puVar1 = *(undefined4 **)(param_1 + 0x6c);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x6c) = 0;
  }
  (**(code **)(**(int **)(param_1 + 0x30) + 0x20))(*(int **)(param_1 + 0x30));
  FUN_00428ea0(*(int *)(param_1 + 0x2c));
  (**(code **)(**(int **)(param_1 + 0x20) + 0x28))(*(int **)(param_1 + 0x20));
  puVar1 = *(undefined4 **)(param_1 + 200);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 200) = 0;
  }
  *(undefined4 *)(param_1 + 0x70) = 1;
  FUN_0041bbd8(param_1 + 0x74,1);
  return 0;
}



/* @0044e7ac file=? name=FUN_0044e7ac */

void __cdecl FUN_0044e7ac(int param_1)

{
  undefined4 *puVar1;
  
  puVar1 = *(undefined4 **)(param_1 + 0x4c);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x4c) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x48);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x48) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x44);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x44) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x40);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x40) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x3c);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x3c) = 0;
  }
  if (*(int **)(param_1 + 0x50) != (int *)0x0) {
    FUN_0044c2e4(*(int **)(param_1 + 0x50),3);
    *(undefined4 *)(param_1 + 0x50) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x28);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x28) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x20);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  puVar1 = *(undefined4 **)(param_1 + 0x30);
  if (puVar1 != (undefined4 *)0x0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x30) = 0;
  }
  return;
}



/* @0044e8a0 file=? name=FUN_0044e8a0 */

void __cdecl FUN_0044e8a0(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f03ac;
    puVar1 = (undefined4 *)param_1[0x19];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0x19] = 0;
    puVar1 = (undefined4 *)param_1[0xe];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0xe] = 0;
    puVar1 = (undefined4 *)param_1[0xd];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0xd] = 0;
    puVar1 = (undefined4 *)param_1[0xb];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0xb] = 0;
    puVar1 = (undefined4 *)param_1[9];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[9] = 0;
    param_1[0x1a] = 0;
    FUN_004de8d4((int *)param_1[0x18],0x34,0,0x19,FUN_0041ac50);
    param_1[0x18] = 0;
    FUN_0041baa4(param_1 + 0x1d,2);
    FUN_0041d554(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044e970 file=? name=FUN_0044e970 */

void __cdecl FUN_0044e970(int param_1)

{
  int iVar1;
  undefined4 local_1c [6];
  
  iVar1 = FUN_00429078(*(int *)(param_1 + 0x2c));
  if (iVar1 != 0) {
    FUN_0042995c(local_1c,0,*(undefined4 *)(param_1 + 0x88),*(undefined4 *)(param_1 + 0x54));
    (**(code **)(**(int **)(param_1 + 0x20) + 0x18))
              (*(int **)(param_1 + 0x20),local_1c,5,*(undefined4 *)(iVar1 + 0xc));
  }
  return;
}



/* @0044e9c0 file=? name=FUN_0044e9c0 */

void __cdecl FUN_0044e9c0(int *param_1,undefined4 param_2)

{
  int iVar1;
  
  iVar1 = (**(code **)(*param_1 + 0x34))(param_1,param_2,param_1[0x1a]);
  param_1[0x32] = iVar1;
  param_1[0x16] = *(int *)(iVar1 + 0xe0);
  (**(code **)(*(int *)param_1[8] + 0x24))((int *)param_1[8],param_1[0x32]);
  (**(code **)(*(int *)param_1[0x32] + 4))((int *)param_1[0x32],param_2);
  (**(code **)(*(int *)param_1[0xc] + 0x18))((int *)param_1[0xc],param_1[0x32]);
  return;
}



/* @0044ea28 file=munga/app.cpp name=FUN_0044ea28 */

undefined4 FUN_0044ea28(void)

{
  FUN_0040385c(s_Application__MakeMisson___Should_004effcf,s_d__tesla_bt_munga_APP_CPP_004f0001,
               0x4cb);
  return 0;
}



/* @0044ea48 file=? name=FUN_0044ea48 */

void __cdecl FUN_0044ea48(int param_1)

{
  undefined4 uVar1;
  
  (**(code **)(**(int **)(param_1 + 0x30) + 0x1c))
            (*(int **)(param_1 + 0x30),*(undefined4 *)(param_1 + 200));
  uVar1 = (**(code **)(**(int **)(param_1 + 0x28) + 0x18))
                    (*(int **)(param_1 + 0x28),*(undefined4 *)(param_1 + 200));
  *(undefined4 *)(param_1 + 0x14) = uVar1;
  FUN_0041bbd8(param_1 + 0x74,0xb);
  return;
}



/* @0044ea8c file=? name=FUN_0044ea8c */

int __cdecl FUN_0044ea8c(int *param_1,undefined4 param_2)

{
  int *piVar1;
  int iVar2;
  uint local_10 [3];
  
  iVar2 = (**(code **)(*param_1 + 0x38))(param_1,param_2);
  param_1[0x1b] = iVar2;
  FUN_0044f034(local_10);
  FUN_0041acbc(param_1[0x18],2,param_1,local_10,DAT_004e17f4);
  piVar1 = (int *)param_1[0x11];
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 0x14))(piVar1,param_1[0x1b]);
    FUN_00435f2c((int *)param_1[0x11],param_1[0x32]);
    FUN_00435f9c(param_1[0x11]);
  }
  piVar1 = (int *)param_1[0x12];
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 0x14))(piVar1,param_1[0x1b]);
    FUN_00435f2c((int *)param_1[0x12],param_1[0x32]);
    FUN_00435f9c(param_1[0x12]);
  }
  piVar1 = (int *)param_1[0x13];
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 0x14))(piVar1,param_1[0x1b]);
    FUN_00435f2c((int *)param_1[0x13],param_1[0x32]);
    FUN_00435f9c(param_1[0x13]);
  }
  return param_1[0x1b];
}



/* @0044eb6c file=munga/app.cpp name=FUN_0044eb6c */

undefined4 FUN_0044eb6c(void)

{
  FUN_0040385c(s_Application__MakeViewpointEntity_004f001b,s_d__tesla_bt_munga_APP_CPP_004f0056,
               0x54b);
  return 0;
}



/* @0044eb8c file=munga/app.cpp name=FUN_0044eb8c */

undefined4 FUN_0044eb8c(void)

{
  FUN_0040385c(s_Application__MakeAudioRenderer___004f0070,s_d__tesla_bt_munga_APP_CPP_004f00a9,
               0x557);
  return 0;
}



/* @0044ebac file=munga/app.cpp name=FUN_0044ebac */

undefined4 FUN_0044ebac(void)

{
  FUN_0040385c(s_Application__MakeVideoRenderer___004f00c3,s_d__tesla_bt_munga_APP_CPP_004f00fc,
               0x563);
  return 0;
}



/* @0044ebcc file=munga/app.cpp name=FUN_0044ebcc */

undefined4 FUN_0044ebcc(void)

{
  FUN_0040385c(s_Application__MakeGaugeRenderer___004f0116,s_d__tesla_bt_munga_APP_CPP_004f014f,
               0x56f);
  return 0;
}



/* @0044ebec file=? name=FUN_0044ebec */

void __cdecl FUN_0044ebec(int param_1,uint *param_2)

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  uint local_14 [3];
  int local_8;
  
  uVar1 = *(int *)(param_1 + 0x88) - 2;
  if ((uVar1 < 2) || (uVar1 == 9)) {
    iVar2 = FUN_0041aff4(*(int *)(param_1 + 0x60),0);
    if (iVar2 != 0) {
      if (*(int *)(param_1 + 0x88) == 2) {
        FUN_0040717c(*(int *)(param_1 + 0x68));
      }
      FUN_0041bbd8(param_1 + 0x74,3);
      iVar2 = FUN_00429078(*(int *)(param_1 + 0x2c));
      if ((iVar2 == 0) || ((iVar2 != 0 && (*(int *)(iVar2 + 0x18) != 3)))) {
        FUN_0044f5b4(local_14);
        FUN_0041acbc(*(int *)(param_1 + 0x60),2,param_1,local_14,DAT_004e17f4);
      }
    }
    piVar3 = (int *)FUN_00414b60();
    local_8 = *piVar3;
    iVar2 = FUN_004dcd94();
    local_8 = local_8 + iVar2;
    FUN_0041acbc(*(int *)(param_1 + 0x60),2,param_1,param_2,local_8);
  }
  return;
}



/* @0044ecdc file=munga/app.cpp name=FUN_0044ecdc */

void __cdecl FUN_0044ecdc(int param_1)

{
  int iVar1;
  int *piVar2;
  undefined4 *puVar3;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  iVar1 = *(int *)(param_1 + 0x88);
  if (iVar1 == 3) {
    FUN_0041bbd8(param_1 + 0x74,4);
    piVar2 = *(int **)(param_1 + 0x14);
    local_20 = 0x1c;
    local_1c = 0x18;
    local_18 = 1;
    FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
    local_c = 0;
    local_8 = 0;
    (**(code **)(*piVar2 + 0xc))(piVar2,&local_20);
  }
  else if (iVar1 == 4) {
    FUN_0041bbd8(param_1 + 0x74,5);
    puVar3 = (undefined4 *)FUN_00414b60();
    *(undefined4 *)(param_1 + 0x5c) = *puVar3;
  }
  else if (iVar1 != 5) {
    FUN_0040385c(s_Application__RunMissionMessageHa_004f0169,s_d__tesla_bt_munga_APP_CPP_004f01a4,
                 0x609);
  }
  return;
}



/* @0044ed88 file=munga/app.cpp name=FUN_0044ed88 */

void __cdecl FUN_0044ed88(int param_1)

{
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  if (*(int *)(param_1 + 0x88) == 5) {
    local_20 = 0x1c;
    local_1c = 0x19;
    local_18 = 1;
    FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
    local_c = 0;
    local_8 = 0;
    FUN_0041bbd8(param_1 + 0x74,8);
    (**(code **)(**(int **)(param_1 + 0x14) + 0xc))(*(int **)(param_1 + 0x14),&local_20);
  }
  else if (*(int *)(param_1 + 0x88) != 8) {
    FUN_0040385c(s_Application__SuspendMissionMessa_004f01be,s_d__tesla_bt_munga_APP_CPP_004f01f8,
                 0x643);
  }
  return;
}



/* @0044ee10 file=munga/app.cpp name=FUN_0044ee10 */

void __cdecl FUN_0044ee10(int param_1)

{
  undefined4 *puVar1;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  if (*(int *)(param_1 + 0x88) == 8) {
    local_20 = 0x1c;
    local_1c = 0x18;
    local_18 = 1;
    FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
    local_c = 0;
    local_8 = 0;
    FUN_0041bbd8(param_1 + 0x74,9);
    (**(code **)(**(int **)(param_1 + 0x14) + 0xc))(*(int **)(param_1 + 0x14),&local_20);
  }
  else if (*(int *)(param_1 + 0x88) == 9) {
    FUN_0041bbd8(param_1 + 0x74,5);
    puVar1 = (undefined4 *)FUN_00414b60();
    *(undefined4 *)(param_1 + 0x5c) = *puVar1;
  }
  else {
    FUN_0040385c(s_Application__ResumeMissionMessag_004f0212,s_d__tesla_bt_munga_APP_CPP_004f024c,
                 0x679);
  }
  return;
}



/* @0044eeb4 file=? name=FUN_0044eeb4 */

void __cdecl FUN_0044eeb4(int param_1)

{
  int iVar1;
  int *piVar2;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  iVar1 = *(int *)(param_1 + 0x88);
  if (iVar1 != 6) {
    if (iVar1 == 7) {
      return;
    }
    if (iVar1 != 10) {
      FUN_0041bbd8(param_1 + 0x74,6);
      piVar2 = *(int **)(param_1 + 0x14);
      if (piVar2 != (int *)0x0) {
        (**(code **)(**(int **)(param_1 + 0x20) + 0x30))(*(int **)(param_1 + 0x20),0);
        local_20 = 0x1c;
        local_1c = 0x19;
        local_18 = 1;
        FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
        local_c = 0;
        local_8 = 0;
        (**(code **)(*piVar2 + 0xc))(piVar2,&local_20);
        return;
      }
      FUN_0044e6c0(param_1);
      return;
    }
  }
  FUN_0044e6c0(param_1);
  return;
}



/* @0044ef4c file=? name=FUN_0044ef4c */

void __cdecl FUN_0044ef4c(int param_1)

{
  int iVar1;
  int *piVar2;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14 [2];
  undefined4 local_c;
  undefined4 local_8;
  
  iVar1 = *(int *)(param_1 + 0x88);
  if (iVar1 != 6) {
    if (iVar1 == 7) {
      return;
    }
    if (iVar1 != 10) {
      FUN_0041bbd8(param_1 + 0x74,10);
      piVar2 = *(int **)(param_1 + 0x14);
      if (piVar2 != (int *)0x0) {
        local_20 = 0x1c;
        local_1c = 0x19;
        local_18 = 1;
        FUN_00420ea4(local_14,(undefined4 *)&DAT_00522524);
        local_c = 0;
        local_8 = 0;
        (**(code **)(*piVar2 + 0xc))(piVar2,&local_20);
        return;
      }
      FUN_0044e6c0(param_1);
      return;
    }
  }
  FUN_0044e6c0(param_1);
  return;
}



/* @0044efd8 file=? name=FUN_0044efd8 */

void __cdecl FUN_0044efd8(int param_1,int param_2)

{
  if ((*(int *)(param_2 + 0xc) == 0x26) && (*(int *)(param_1 + 0x88) != 7)) {
    DAT_004efc98 = 1;
    FUN_0044e6c0(param_1);
    FUN_004dbb24(&DAT_00524e20,s_Mission_stopped_by_keystroke__004f0266,(char *)0x0);
    if (*(int *)(param_1 + 0x88) == 1) {
      FUN_0041bbd8(param_1 + 0x74,6);
    }
  }
  return;
}



/* @0044f034 file=? name=FUN_0044f034 */

void __cdecl FUN_0044f034(undefined4 *param_1)

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



/* @0044f0d5 file=? name=FUN_0044f0d5 */

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

{
  FUN_00415f30(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f02bc;
  return param_1;
}



/* @0044f0f8 file=? name=FUN_0044f0f8 */

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

{
  FUN_00415f30(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f02bc;
  return param_1;
}



/* @0044f11b file=? name=FUN_0044f11b */

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

{
  FUN_00415f60(param_1,param_2);
  *param_1 = &PTR_FUN_004f02bc;
  return param_1;
}



/* @0044f13a file=? name=FUN_0044f13a */

void __cdecl FUN_0044f13a(int *param_1,byte param_2)

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



/* @0044f166 file=? name=FUN_0044f166 */

void __cdecl FUN_0044f166(int *param_1,byte param_2)

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



/* @0044f192 file=? name=FUN_0044f192 */

void __cdecl FUN_0044f192(int *param_1,byte param_2)

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



/* @0044f1be file=? name=FUN_0044f1be */

void __cdecl FUN_0044f1be(int *param_1,byte param_2)

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



/* @0044f1ea file=? name=FUN_0044f1ea */

void __cdecl FUN_0044f1ea(int *param_1,byte param_2)

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



/* @0044f216 file=? name=FUN_0044f216 */

void __cdecl FUN_0044f216(int *param_1,byte param_2)

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



/* @0044f242 file=? name=FUN_0044f242 */

void __cdecl FUN_0044f242(int *param_1,byte param_2)

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



/* @0044f26e file=? name=FUN_0044f26e */

void __cdecl FUN_0044f26e(int *param_1,byte param_2)

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



/* @0044f29c file=? name=FUN_0044f29c */

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

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

{
  FUN_004178cc(param_1,0x4d);
  *param_1 = &PTR_FUN_004f04a0;
  FUN_0044f4bc(param_1 + 5,param_1);
  param_1[4] = param_2;
  param_1[3] = _DAT_0044f2d8 / (float)param_1[4];
  return param_1;
}



/* @0044f2dc file=? name=FUN_0044f2dc */

void __cdecl FUN_0044f2dc(int *param_1,byte param_2)

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



/* @0044f318 file=? name=FUN_0044f318 */

void __cdecl FUN_0044f318(int param_1,int *param_2)

{
  (**(code **)(*(int *)(param_1 + 0x14) + 4))(param_1 + 0x14,param_2);
  DAT_004efc94 = param_2;
  (**(code **)(*param_2 + 0x18))(param_2);
  return;
}



/* @0044f344 file=munga/appmgr.cpp name=FUN_0044f344 */

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

void __cdecl FUN_0044f344(int param_1)

{
  int *piVar1;
  int iVar2;
  int local_24 [5];
  int local_10;
  undefined4 local_c;
  int local_8;
  
  FUN_0044f526(local_24,param_1 + 0x14);
  while( true ) {
    (**(code **)(local_24[0] + 4))(local_24);
    piVar1 = (int *)FUN_00414b60();
    local_8 = *piVar1;
    local_c = *(undefined4 *)(param_1 + 0xc);
    iVar2 = FUN_004dcd94();
    local_8 = local_8 + iVar2;
    if (_DAT_0044f4b8 < *(float *)(param_1 + 0xc)) {
      FUN_0040385c(s_frameDuration_has_grown__004f040c,s_d__tesla_bt_munga_APPMGR_CPP_004f0426,0x36)
      ;
    }
    while( true ) {
      DAT_004efc94 = (int *)(**(code **)(local_24[0] + 0x28))(local_24);
      if (DAT_004efc94 == (int *)0x0) break;
      iVar2 = (**(code **)(*DAT_004efc94 + 0x20))
                        (DAT_004efc94,local_8,*(undefined4 *)(param_1 + 0xc));
      if (iVar2 == 0) {
        iVar2 = (**(code **)(*DAT_004efc94 + 0x28))(DAT_004efc94);
        if (iVar2 == 0) {
          (**(code **)(*DAT_004efc94 + 0x2c))(DAT_004efc94);
          if (DAT_004efc94 != (int *)0x0) {
            (**(code **)*DAT_004efc94)(DAT_004efc94,3);
          }
        }
      }
    }
    (**(code **)(local_24[0] + 4))(local_24);
    DAT_004efc94 = (int *)(**(code **)(local_24[0] + 0x30))(local_24);
    if (DAT_004efc94 == (int *)0x0) break;
    while( true ) {
      do {
        (**(code **)(*DAT_004efc94 + 0x24))(DAT_004efc94);
        (**(code **)(local_24[0] + 0xc))(local_24);
        DAT_004efc94 = (int *)(**(code **)(local_24[0] + 0x30))(local_24);
      } while (DAT_004efc94 != (int *)0x0);
      piVar1 = (int *)FUN_00414b60();
      local_10 = *piVar1;
      if (local_8 <= local_10) break;
      (**(code **)(local_24[0] + 4))(local_24);
      DAT_004efc94 = (int *)(**(code **)(local_24[0] + 0x30))(local_24);
    }
  }
  FUN_0044f564(local_24,2);
  return;
}



/* @0044f4bc file=? name=FUN_0044f4bc */

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

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



/* @0044f4db file=? name=FUN_0044f4db */

void __cdecl FUN_0044f4db(int *param_1,byte param_2)

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



/* @0044f507 file=? name=FUN_0044f507 */

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

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



/* @0044f526 file=? name=FUN_0044f526 */

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

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



/* @0044f545 file=? name=FUN_0044f545 */

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

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



/* @0044f564 file=? name=FUN_0044f564 */

void __cdecl FUN_0044f564(int *param_1,byte param_2)

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



/* @0044f590 file=? name=FUN_0044f590 */

void __cdecl FUN_0044f590(undefined4 *param_1,undefined4 param_2)

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



/* @0044f5b4 file=? name=FUN_0044f5b4 */

void __cdecl FUN_0044f5b4(undefined4 *param_1)

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



/* @0044f5d0 file=? name=FUN_0044f5d0 */

void __cdecl FUN_0044f5d0(undefined4 *param_1,undefined4 param_2)

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



/* @0044f5f4 file=? name=FUN_0044f5f4 */

void __cdecl FUN_0044f5f4(undefined4 *param_1,undefined4 param_2)

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



/* @0044f618 file=? name=FUN_0044f618 */

void __cdecl FUN_0044f618(undefined4 *param_1)

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



/* @0044f634 file=? name=FUN_0044f634 */

void __cdecl FUN_0044f634(undefined4 *param_1)

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



/* @0044f650 file=? name=FUN_0044f650 */

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

{
  FUN_004030dc(param_1,param_2,param_3,param_4);
  *param_1 = &PTR_FUN_004f0604;
  param_1[4] = 0;
  return param_1;
}



/* @0044f67c file=? name=FUN_0044f67c */

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

{
  FUN_004030dc(param_1,*(int *)(param_2 + 4),*(undefined4 *)(param_2 + 0xc),
               *(int *)(param_2 + 8) - *(int *)(param_2 + 4));
  *param_1 = &PTR_FUN_004f0604;
  param_1[4] = *(undefined4 *)(param_2 + 0x10);
  return param_1;
}



/* @0044f6b0 file=? name=FUN_0044f6b0 */

void __cdecl FUN_0044f6b0(int *param_1,byte param_2)

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



/* @0044f6d0 file=? name=FUN_0044f6d0 */

void __cdecl FUN_0044f6d0(int *param_1,LPCSTR param_2)

{
  char *pcVar1;
  char *pcVar2;
  undefined **local_20 [6];
  char *local_8;
  
  FUN_004034b0(local_20,param_2,1);
  local_8 = (char *)(param_1[2] - param_1[1]);
  (*(code *)local_20[0][8])(local_20,&local_8,4);
  (**(code **)(*param_1 + 0xc))(param_1,0);
  pcVar2 = local_8;
  pcVar1 = (char *)(**(code **)*param_1)(param_1);
  FUN_00403614((int)local_20,pcVar1,pcVar2);
  local_20[0] = &PTR_FUN_004e09e0;
  FUN_00403564((int)local_20);
  return;
}



/* @0044f744 file=? name=FUN_0044f744 */

void __cdecl FUN_0044f744(int *param_1,LPCSTR param_2)

{
  char *pcVar1;
  undefined **local_20 [4];
  int local_10;
  char *local_8;
  
  FUN_004034b0(local_20,param_2,0);
  if (local_10 == -1) {
    param_1[4] = 0;
    local_20[0] = &PTR_FUN_004e09e0;
    FUN_00403564((int)local_20);
  }
  else {
    local_8 = (char *)0x0;
    (*(code *)local_20[0][7])(local_20,&local_8,4);
    pcVar1 = (char *)(**(code **)(*param_1 + 4))(param_1);
    if ((pcVar1 < local_8) || (local_8 == (char *)0x0)) {
      param_1[4] = 0;
    }
    else {
      FUN_004035f0((int)local_20,(char *)param_1[1],local_8);
      param_1[3] = (int)local_8;
      (**(code **)(*param_1 + 0xc))(param_1,0);
      param_1[4] = 2;
    }
    local_20[0] = &PTR_FUN_004e09e0;
    FUN_00403564((int)local_20);
  }
  return;
}



/* @0044f7f4 file=? name=FUN_0044f7f4 */

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

{
  int iVar1;
  undefined4 *puVar2;
  uint uVar3;
  uint uVar4;
  
  uVar3 = param_2[4] + 0x10;
  iVar1 = (**(code **)(*param_1 + 4))(param_1);
  if (iVar1 < (int)uVar3) {
    FUN_004dbb24(&DAT_00524e20,s_Error__Spool_file_ran_out_of_mem_004f04ac,(char *)0x0);
    FUN_004036a0(1);
  }
  uVar4 = uVar3;
  puVar2 = (undefined4 *)(**(code **)*param_1)(param_1);
  FUN_004d4918(puVar2,param_2,uVar4);
  (**(code **)(*param_1 + 0x14))(param_1,uVar3);
  return;
}



/* @0044f850 file=? name=FUN_0044f850 */

undefined4 __cdecl FUN_0044f850(int *param_1)

{
  int iVar1;
  undefined4 uVar2;
  uint uVar3;
  uint uVar4;
  
  iVar1 = (**(code **)(*param_1 + 4))(param_1);
  if (iVar1 == 0) {
    uVar2 = 0;
  }
  else {
    iVar1 = (**(code **)*param_1)(param_1);
    uVar4 = *(int *)(iVar1 + 0x10) + 0x10;
    uVar3 = (**(code **)(*param_1 + 4))(param_1);
    if (uVar3 < uVar4) {
      FUN_004dbb24(&DAT_00524e20,s_Error__Partial_packet_in_spool_f_004f04d2,(char *)0x0);
      FUN_004036a0(1);
      uVar2 = 0;
    }
    else {
      (**(code **)(*param_1 + 0x14))(param_1,uVar4);
      uVar2 = (**(code **)*param_1)(param_1);
    }
  }
  return uVar2;
}



/* @0044f8b8 file=? name=FUN_0044f8b8 */

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

{
  undefined4 uVar1;
  undefined4 *puVar2;
  int iVar3;
  
  FUN_0044f29c(param_1,param_2);
  *param_1 = &PTR_FUN_004f05f8;
  param_1[10] = param_3;
  param_1[0xd] = param_4;
  uVar1 = FUN_004022b0(param_1[10] << 2);
  param_1[0xc] = uVar1;
  uVar1 = FUN_004022b0(param_1[10] << 2);
  param_1[0xb] = uVar1;
  for (iVar3 = 0; iVar3 < (int)param_1[10]; iVar3 = iVar3 + 1) {
    uVar1 = FUN_004022b0(param_1[0xd]);
    *(undefined4 *)(param_1[0xc] + iVar3 * 4) = uVar1;
    puVar2 = (undefined4 *)FUN_00402298(0x14);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar2 = FUN_0044f650(puVar2,*(undefined4 *)(param_1[0xc] + iVar3 * 4),param_1[0xd],0);
    }
    *(undefined4 **)(param_1[0xb] + iVar3 * 4) = puVar2;
  }
  return param_1;
}



/* @0044f950 file=? name=FUN_0044f950 */

void __cdecl FUN_0044f950(int *param_1,byte param_2)

{
  int *piVar1;
  int iVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f05f8;
    for (iVar2 = 0; iVar2 < param_1[10]; iVar2 = iVar2 + 1) {
      piVar1 = *(int **)(param_1[0xb] + iVar2 * 4);
      if (piVar1 != (int *)0x0) {
        FUN_0044f6b0(piVar1,3);
      }
      FUN_004022d0(*(int **)(param_1[0xc] + iVar2 * 4));
    }
    FUN_004022d0((int *)param_1[0xb]);
    FUN_004022d0((int *)param_1[0xc]);
    FUN_0044f2dc(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044f9c4 file=munga/spooler.cpp name=FUN_0044f9c4 */

int __cdecl FUN_0044f9c4(int param_1)

{
  int iVar1;
  int iVar2;
  
  iVar2 = 0;
  while( true ) {
    if (*(int *)(param_1 + 0x28) <= iVar2) {
      FUN_0040385c(s_No_spool_files_available__004f04f8,s_d__tesla_bt_munga_SPOOLER_CPP_004f0512,
                   0xee);
      return 0;
    }
    iVar1 = *(int *)(*(int *)(param_1 + 0x2c) + iVar2 * 4);
    if (*(int *)(iVar1 + 0x10) == 0) break;
    iVar2 = iVar2 + 1;
  }
  *(undefined4 *)(iVar1 + 0x10) = 1;
  return iVar1;
}



/* @0044fa14 file=? name=FUN_0044fa14 */

undefined8 __fastcall FUN_0044fa14(undefined4 param_1,int param_2,int param_3)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  do {
    if (*(int *)(param_3 + 0x28) <= iVar2) {
      iVar2 = 0;
LAB_0044fa68:
      return CONCAT44(param_2,iVar2);
    }
    piVar1 = *(int **)(*(int *)(param_3 + 0x2c) + iVar2 * 4);
    if (piVar1[4] == 0) {
      FUN_0044f744(piVar1,s_last_spl_004f0530);
      iVar2 = *(int *)(*(int *)(param_3 + 0x2c) + iVar2 * 4);
      param_2 = *(int *)(iVar2 + 0x10);
      if (param_2 == 2) {
        *(undefined4 *)(iVar2 + 0x10) = 3;
        param_2 = *(int *)(param_3 + 0x2c);
      }
      else {
        iVar2 = 0;
      }
      goto LAB_0044fa68;
    }
    iVar2 = iVar2 + 1;
  } while( true );
}



/* @0044fa6c file=? name=FUN_0044fa6c */

void __cdecl FUN_0044fa6c(int param_1,int *param_2)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  while( true ) {
    if (*(int *)(param_1 + 0x28) <= iVar2) {
      return;
    }
    piVar1 = *(int **)(*(int *)(param_1 + 0x2c) + iVar2 * 4);
    if (param_2 == piVar1) break;
    iVar2 = iVar2 + 1;
  }
  piVar1[4] = 2;
  FUN_0044f6d0(piVar1,s_last_spl_004f0539);
  piVar1 = *(int **)(*(int *)(param_1 + 0x2c) + iVar2 * 4);
  (**(code **)(*piVar1 + 0xc))(piVar1,0);
  return;
}



/* @0044fac0 file=? name=FUN_0044fac0 */

void __cdecl FUN_0044fac0(int param_1,int *param_2)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  while( true ) {
    if (*(int *)(param_1 + 0x28) <= iVar2) {
      return;
    }
    piVar1 = *(int **)(*(int *)(param_1 + 0x2c) + iVar2 * 4);
    if (param_2 == piVar1) break;
    iVar2 = iVar2 + 1;
  }
  piVar1[4] = 0;
  (**(code **)(*piVar1 + 0xc))(piVar1,0);
  return;
}



/* @0044fafc file=? name=FUN_0044fafc */

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

{
  FUN_00415e90(param_1,0x43);
  *param_1 = &PTR_FUN_004f0744;
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = 0xffffffff;
  param_1[6] = 0xffffffff;
  param_1[7] = 0;
  param_1[8] = 0;
  return param_1;
}



/* @0044fb40 file=? name=FUN_0044fb40 */

void __cdecl FUN_0044fb40(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f0744;
    (**(code **)(*param_1 + 8))(param_1,0);
    (**(code **)(*param_1 + 4))(param_1,0xffffffff);
    FUN_00415ed8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044fb84 file=? name=FUN_0044fb84 */

undefined4 FUN_0044fb84(void)

{
  FUN_00415f1c();
  return 1;
}



/* @0044fb98 file=? name=FUN_0044fb98 */

void __cdecl FUN_0044fb98(int param_1,undefined4 param_2)

{
  uint local_20 [4];
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  local_20[2] = 1;
  local_10 = *(undefined4 *)(param_1 + 0x10);
  local_20[3] = *(undefined4 *)(param_1 + 0xc);
  local_20[0] = 0x18;
  local_20[1] = 3;
  local_c = param_2;
  local_8 = DAT_004e17f4;
  FUN_0041ad54(*(int *)(DAT_004efc94 + 0x60),2,6,local_20,DAT_004e17f4);
  return;
}



/* @0044fc00 file=? name=FUN_0044fc00 */

void __cdecl FUN_0044fc00(int param_1,undefined4 param_2)

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



/* @0044fc10 file=? name=FUN_0044fc10 */

undefined4 __cdecl FUN_0044fc10(int param_1)

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



/* @0044fc1c file=? name=FUN_0044fc1c */

void __cdecl FUN_0044fc1c(int param_1,undefined4 param_2)

{
  uint local_20 [4];
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  if (*(int *)(param_1 + 0x20) == 0) {
    local_20[2] = 1;
    local_10 = *(undefined4 *)(param_1 + 0x10);
    local_20[3] = *(undefined4 *)(param_1 + 0xc);
    local_20[0] = 0x18;
    local_20[1] = 4;
    local_c = param_2;
    local_8 = DAT_004e17f4;
    FUN_0041ad54(*(int *)(DAT_004efc94 + 0x60),2,6,local_20,DAT_004e17f4);
  }
  return;
}



/* @0044fc8c file=? name=FUN_0044fc8c */

void __cdecl FUN_0044fc8c(int param_1,undefined4 param_2)

{
  if (*(int *)(param_1 + 0x20) == 0) {
    *(undefined4 *)(param_1 + 0x1c) = param_2;
  }
  return;
}



/* @0044fca0 file=? name=FUN_0044fca0 */

undefined4 __cdecl FUN_0044fca0(int param_1)

{
  return *(undefined4 *)(param_1 + 0x1c);
}



/* @0044fcac file=? name=FUN_0044fcac */

void __cdecl FUN_0044fcac(int param_1,undefined4 param_2)

{
  uint local_20 [4];
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  local_20[2] = 1;
  local_10 = *(undefined4 *)(param_1 + 0x10);
  local_20[3] = *(undefined4 *)(param_1 + 0xc);
  local_20[0] = 0x18;
  local_20[1] = 5;
  local_c = param_2;
  local_8 = DAT_004e17f4;
  FUN_0041ad54(*(int *)(DAT_004efc94 + 0x60),2,6,local_20,DAT_004e17f4);
  return;
}



/* @0044fd14 file=? name=FUN_0044fd14 */

void __cdecl FUN_0044fd14(int *param_1,int param_2)

{
  if (param_2 == 1) {
    if (param_1[8] == 0) {
      param_1[6] = param_1[5];
    }
    if (param_1[7] == 1) {
      (**(code **)(*param_1 + 8))(param_1,0);
    }
  }
  else {
    (**(code **)(*param_1 + 4))(param_1,param_1[6]);
  }
  param_1[8] = param_2;
  return;
}



/* @0044fd58 file=? name=FUN_0044fd58 */

undefined4 __cdecl FUN_0044fd58(int param_1)

{
  return *(undefined4 *)(param_1 + 0x20);
}



/* @0044fd64 file=? name=FUN_0044fd64 */

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

{
  FUN_0041d520(param_1,0x44,param_2,6);
  *param_1 = &PTR_FUN_004f0718;
  FUN_0045005e(param_1 + 6,param_1);
  param_1[5] = 0;
  return param_1;
}



/* @0044fd9c file=? name=FUN_0044fd9c */

void __cdecl FUN_0044fd9c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f0718;
    (**(code **)(*param_1 + 0x20))(param_1);
    FUN_0045007d(param_1 + 6,2);
    FUN_0041d554(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044fde0 file=? name=FUN_0044fde0 */

void __cdecl FUN_0044fde0(int param_1)

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



/* @0044fdfc file=? name=FUN_0044fdfc */

void FUN_0044fdfc(void)

{
  return;
}



/* @0044fe04 file=? name=FUN_0044fe04 */

void __cdecl FUN_0044fe04(int param_1)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_004500c8(local_10,param_1 + 0x18);
  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_00450106(local_10,2);
  return;
}



/* @0044fe54 file=munga/icom.cpp name=FUN_0044fe54 */

void FUN_0044fe54(void)

{
  FUN_0040385c(s_IcomManager__Execute___should_no_004f066c,s_d__tesla_bt_munga_ICOM_CPP_004f06a3,
               0x166);
  return;
}



/* @0044fe70 file=? name=FUN_0044fe70 */

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

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x24);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0044fafc(puVar1,param_2,param_3);
  }
  (**(code **)(*(int *)(param_1 + 0x18) + 4))(param_1 + 0x18,puVar1);
  return puVar1;
}



/* @0044feb4 file=? name=FUN_0044feb4 */

void __cdecl FUN_0044feb4(int param_1,int param_2)

{
  int iVar1;
  int local_10 [3];
  
  FUN_004500c8(local_10,param_1 + 0x18);
  if (param_2 == -1) {
    while (iVar1 = (**(code **)(local_10[0] + 0x28))(local_10), iVar1 != 0) {
      FUN_0044fcac(iVar1,0);
    }
  }
  else {
    while (iVar1 = (**(code **)(local_10[0] + 0x28))(local_10), iVar1 != 0) {
      FUN_0044fcac(iVar1,1);
      FUN_0044fb98(iVar1,param_2);
    }
  }
  FUN_00450106(local_10,2);
  return;
}



/* @0044ff34 file=? name=FUN_0044ff34 */

int __cdecl FUN_0044ff34(int param_1,int param_2,int param_3)

{
  int iVar1;
  int local_10 [3];
  
  FUN_004500c8(local_10,param_1 + 0x18);
  do {
    iVar1 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_00450106(local_10,2);
      return iVar1;
    }
  } while ((param_2 != *(int *)(iVar1 + 0xc)) || (param_3 != *(int *)(iVar1 + 0x10)));
  FUN_00450106(local_10,2);
  return iVar1;
}



/* @0044ffa4 file=? name=FUN_0044ffa4 */

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

{
  int iVar1;
  int *piVar2;
  
  piVar2 = (int *)FUN_0044ff34(param_1,*(int *)(param_3 + 0xc),*(int *)(param_3 + 0x10));
  if (piVar2 != (int *)0x0) {
    iVar1 = *(int *)(param_3 + 4);
    if (iVar1 == 3) {
      (**(code **)(*piVar2 + 4))(piVar2,*(undefined4 *)(param_3 + 0x14));
      return;
    }
    if (iVar1 == 4) {
      (**(code **)(*piVar2 + 8))(piVar2,*(undefined4 *)(param_3 + 0x14));
      return;
    }
    if (iVar1 != 5) {
      return;
    }
    (**(code **)(*piVar2 + 0xc))(piVar2,*(undefined4 *)(param_3 + 0x14));
  }
  return;
}



/* @0045005e file=? name=FUN_0045005e */

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

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



/* @0045007d file=? name=FUN_0045007d */

void __cdecl FUN_0045007d(int *param_1,byte param_2)

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



/* @004500a9 file=? name=FUN_004500a9 */

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

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



/* @004500c8 file=? name=FUN_004500c8 */

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

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



/* @004500e7 file=? name=FUN_004500e7 */

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

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



/* @00450106 file=? name=FUN_00450106 */

void __cdecl FUN_00450106(int *param_1,byte param_2)

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



/* @00450134 file=? name=FUN_00450134 */

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

{
  int *piVar1;
  int iVar2;
  
  FUN_00428a78(param_1,param_2,param_3,param_4);
  *param_1 = &PTR_FUN_004f0754;
  iVar2 = *param_6;
  param_1[0x419] = iVar2;
  piVar1 = (int *)(iVar2 + 0xc);
  *piVar1 = *piVar1 + 1;
  param_1[0x418] = param_5;
  *(undefined2 *)((int)param_1 + 0x105a) = 0;
  *(undefined2 *)(param_1 + 0x417) = 0;
  *(undefined2 *)(param_1 + 0x416) = 0x1000;
  return param_1;
}



/* @00450190 file=? name=FUN_00450190 */

void __cdecl FUN_00450190(int *param_1,byte param_2)

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



/* @004501d4 file=munga_l4/l4net.cpp name=FUN_004501d4 */

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

int * __cdecl FUN_004501d4(int *param_1)

{
  int *piVar1;
  char *pcVar2;
  int iVar3;
  int *piVar4;
  undefined4 extraout_ECX;
  undefined4 extraout_ECX_00;
  undefined4 extraout_ECX_01;
  uint extraout_EDX;
  uint uVar5;
  undefined8 uVar6;
  undefined4 uVar7;
  uint local_408 [256];
  int *local_8;
  
  FUN_0041d5b4(param_1,&DAT_004f0764);
  *param_1 = (int)&PTR_FUN_004f131c;
  FUN_004527b8(param_1 + 0x14,param_1);
  uVar5 = DAT_00523310;
  param_1[0x13] = 0;
  param_1[0x12] = 2;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  param_1[0xf] = 0;
  param_1[0xe] = 0;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  param_1[0xd] = 0x7fffffff;
  piVar4 = DAT_0052330c;
  if (uVar5 == 0) {
    DAT_004f0760 = (uint *)0x0;
    local_8 = DAT_0052330c;
    DAT_0052330c[3] = DAT_0052330c[3] + 1;
    pcVar2 = (char *)piVar4[2];
    piVar1 = piVar4 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(piVar4,3);
    }
    if ((pcVar2 == (char *)0x0) || (iVar3 = FUN_004d4a78(pcVar2), iVar3 == 0)) {
      FUN_004dbb24(&DAT_00524e20,s_ERROR__No_source_exists_for_egg__004f0846,(char *)0x0);
      FUN_004036a0(1);
    }
    piVar4 = (int *)FUN_00402298(0x20);
    if (piVar4 == (int *)0x0) {
      piVar4 = (int *)0x0;
    }
    else {
      piVar4 = FUN_00403e84(piVar4,pcVar2,1);
    }
    param_1[8] = (int)piVar4;
    FUN_00404d6c((undefined4 *)param_1[8],s_last_egg_004f0868);
    param_1[0x10] = 0;
    local_408[0] = 0x400;
    local_408[1] = 3;
    local_408[2] = 1;
    local_408[3] = 0xffffffff;
    local_408[4] = 10;
    local_408[5] = 10;
    FUN_004d4918(local_408 + 6,(undefined4 *)s_local_egg_004f0871,10);
    FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),2,param_1,local_408,DAT_004e17f4);
    return param_1;
  }
  uVar7 = 0xff10;
  DAT_004f0760 = (uint *)FUN_00402298(0xff10);
  DAT_00522b88 = (int)DAT_004f0760 + 6;
  DAT_00522b84 = (int)DAT_004f0760 + 10;
  DAT_00522b8c = (short)(uVar5 & 0xffff000f);
  DAT_00522b8e = (undefined2)(uVar5 >> 4);
  uVar6 = FUN_0047d0b0(uVar7,uVar5 & 0xffff000f);
  DAT_00522b92 = DAT_00522b8c + 6;
  DAT_00522b94 = DAT_00522b8c + 10;
  FUN_0047d14d(extraout_ECX,(int)((ulonglong)uVar6 >> 0x20));
  _DAT_00522b90 = (undefined2)DAT_004f0760[1];
  uVar5 = *DAT_004f0760;
  uVar7 = extraout_ECX_00;
  DAT_00522b98 = uVar5;
  if (uVar5 != 0xb) {
    FUN_004dbb24(&DAT_00524e20,s_Netnub_version_004f087b,(char *)0x0);
    piVar4 = FUN_004db78c(&DAT_00524e20,uVar5);
    FUN_004dbb24(piVar4,s___code_version_004f088b,(char *)0x0);
    piVar4 = FUN_004db78c(piVar4,0xb);
    FUN_004d9c38(piVar4);
    FUN_0040385c(s_MUNGA_was_compiled_with_an_old_v_004f089b,
                 s_d__tesla_bt_munga_l4_L4NET_CPP_004f08ce,0x10a);
    uVar7 = extraout_ECX_01;
    uVar5 = extraout_EDX;
  }
  iVar3 = FUN_004521d0(uVar7,uVar5);
  param_1[6] = iVar3;
  if (iVar3 == 0) {
    FUN_0040385c(s_Unable_to_initialize_the_network_004f08ed,
                 s_d__tesla_bt_munga_l4_L4NET_CPP_004f090e,0x113);
  }
  (**(code **)(*param_1 + 0x30))(param_1,0);
  return param_1;
}



/* @0045046c file=? name=FUN_0045046c */

void __cdecl FUN_0045046c(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  uint *puVar3;
  uint *local_c;
  uint local_8;
  
  if (DAT_004f0760 != 0) {
    *(undefined4 *)(param_1 + 0x48) = 2;
    *(undefined4 *)(param_1 + 0x38) = 0;
    *(undefined4 *)(param_1 + 0x40) = 1;
    *(undefined4 *)(param_1 + 0x30) = 0;
    *(undefined4 *)(param_1 + 0x2c) = 0;
    local_8 = FUN_00452378(param_1,4,0x5dd,0,0);
    puVar2 = (undefined4 *)FUN_00402298(0x1068);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar3 = (uint *)FUN_00402298(0x10);
      if (puVar3 == (uint *)0x0) {
        local_c = (uint *)0x0;
      }
      else {
        local_c = FUN_00402460(puVar3,s_Console_004f092d);
      }
      local_c[3] = local_c[3] + 1;
      puVar2 = FUN_00450134(puVar2,1,3,DAT_004e36ec,local_8,(int *)&local_c);
    }
    *(undefined4 **)(param_1 + 0x44) = puVar2;
    puVar3 = local_c + 3;
    *puVar3 = *puVar3 - 1;
    if (*puVar3 == 0) {
      FUN_004024d8((int *)local_c,3);
    }
    iVar1 = *(int *)(param_1 + 0x44);
    *(undefined4 *)(iVar1 + 0x18) = 2;
    FUN_00428f94(*(int *)(DAT_004efc94 + 0x2c),iVar1);
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  return;
}



/* @00450554 file=munga_l4/l4net.cpp name=FUN_00450554 */

void __cdecl FUN_00450554(int *param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  undefined4 *puVar3;
  uint uVar4;
  undefined4 uVar5;
  uint local_54 [14];
  undefined4 *local_1c;
  int *local_18;
  int *local_14;
  int *local_10;
  uint local_c;
  int local_8;
  
  param_1[0xb] = 0;
  FUN_0044d834(local_54 + 9,param_2);
  if (DAT_004f0760 == 0) {
    iVar2 = (**(code **)(local_54[9] + 0x28))(local_54 + 9);
    puVar3 = (undefined4 *)FUN_00402298(0x1068);
    if (puVar3 == (undefined4 *)0x0) {
      puVar3 = (undefined4 *)0x0;
    }
    else {
      local_10 = *(int **)(iVar2 + 0xc);
      local_10[3] = local_10[3] + 1;
      puVar3 = FUN_00450134(puVar3,1,*(undefined4 *)(iVar2 + 0x10),DAT_004e36ec,0,(int *)&local_10);
    }
    piVar1 = local_10 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(local_10,3);
    }
    FUN_00428ee0(*(int *)(DAT_004efc94 + 0x2c),(int)puVar3);
    local_54[6] = 0xc;
    local_54[7] = 10;
    local_54[8] = 1;
    FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),2,DAT_004efc94,local_54 + 6,DAT_004e17f4);
    FUN_0044d858((int *)(local_54 + 9),2);
  }
  else {
    local_8 = 0;
    param_1[0xd] = 0;
    while( true ) {
      iVar2 = (**(code **)(local_54[9] + 0x28))(local_54 + 9);
      if (iVar2 == 0) break;
      local_18 = *(int **)(iVar2 + 0xc);
      local_18[3] = local_18[3] + 1;
      local_18[3] = local_18[3] + 1;
      local_18[3] = local_18[3] + 1;
      local_14 = local_18;
      uVar4 = FUN_00452244(param_1,local_18);
      if (uVar4 == param_1[6]) {
        puVar3 = (undefined4 *)FUN_00402298(0x1068);
        if (puVar3 == (undefined4 *)0x0) {
          puVar3 = (undefined4 *)0x0;
        }
        else {
          puVar3 = FUN_00450134(puVar3,param_1[0x12],*(undefined4 *)(iVar2 + 0x10),param_1[6],0,
                                (int *)&local_14);
        }
        local_8 = 1;
        FUN_00428ee0(*(int *)(DAT_004efc94 + 0x2c),(int)puVar3);
      }
      else {
        param_1[0xd] = param_1[0xd] + 1;
        if (local_8 == 0) {
          local_c = FUN_00452378(param_1,3,0,0x5de,uVar4);
        }
        else {
          local_c = FUN_00452378(param_1,4,0x5de,0,uVar4);
        }
        local_1c = (undefined4 *)FUN_00402298(0x1068);
        if (local_1c == (undefined4 *)0x0) {
          puVar3 = (undefined4 *)0x0;
        }
        else {
          puVar3 = FUN_00450134(local_1c,param_1[0x12],*(undefined4 *)(iVar2 + 0x10),uVar4,local_c,
                                (int *)&local_14);
        }
        uVar5 = 2;
        if (local_8 == 0) {
          uVar5 = 1;
        }
        puVar3[6] = uVar5;
        FUN_00428f94(*(int *)(DAT_004efc94 + 0x2c),(int)puVar3);
      }
      param_1[0x12] = param_1[0x12] + 1;
      piVar1 = local_14 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_14,3);
      }
      piVar1 = local_18 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_18,3);
      }
    }
    if (param_1[0xe] == 0) {
      local_54[3] = 0xc;
      local_54[4] = 4;
      local_54[5] = 1;
      (**(code **)(*param_1 + 0x18))(param_1,local_54 + 3,0,*(undefined4 *)(param_1[0x11] + 0xc));
      if (param_1[0xd] <= param_1[0xb]) {
        local_54[0] = 0xc;
        local_54[1] = 10;
        local_54[2] = 1;
        FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),2,DAT_004efc94,local_54,DAT_004e17f4);
      }
    }
    else {
      FUN_0040385c(s_host_is_in_an_illegal_startup_mo_004f0935,
                   s_d__tesla_bt_munga_l4_L4NET_CPP_004f0959,0x21c);
    }
    FUN_0044d858((int *)(local_54 + 9),2);
  }
  return;
}



/* @0045084c file=? name=FUN_0045084c */

undefined4 __cdecl FUN_0045084c(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 uVar3;
  int local_20 [7];
  
  iVar1 = DAT_00523310;
  if (*(int **)(param_1 + 0x20) != (int *)0x0) {
    FUN_00403ecc(*(int **)(param_1 + 0x20),3);
    *(undefined4 *)(param_1 + 0x20) = 0;
  }
  if (iVar1 == 0) {
    puVar2 = (undefined4 *)FUN_00428f34(*(int *)(DAT_004efc94 + 0x2c));
    if (puVar2 != (undefined4 *)0x0) {
      (**(code **)*puVar2)(puVar2,3);
    }
    uVar3 = 1;
  }
  else {
    iVar1 = *(int *)(DAT_004efc94 + 0x2c);
    FUN_0042939c(local_20,iVar1);
    while( true ) {
      puVar2 = (undefined4 *)(**(code **)(local_20[0] + 0x28))(local_20);
      if (puVar2 == (undefined4 *)0x0) break;
      if (puVar2[4] != 3) {
        if (puVar2[6] != 0) {
          FUN_004524c8(puVar2[6],puVar2[4],param_1,puVar2[0x418]);
        }
        FUN_00428fdc(iVar1,(int)puVar2);
        if (puVar2 != (undefined4 *)0x0) {
          (**(code **)*puVar2)(puVar2,3);
        }
      }
    }
    puVar2 = (undefined4 *)FUN_00428f34(iVar1);
    if ((puVar2 != (undefined4 *)0x0) && (puVar2 != (undefined4 *)0x0)) {
      (**(code **)*puVar2)(puVar2,3);
    }
    *(undefined4 *)(param_1 + 0x34) = 0x7fffffff;
    *(undefined4 *)(param_1 + 0x48) = 2;
    *(undefined4 *)(param_1 + 0x38) = 0;
    *(undefined4 *)(param_1 + 0x40) = 1;
    *(undefined4 *)(param_1 + 0x30) = 0;
    *(undefined4 *)(param_1 + 0x2c) = 0;
    uVar3 = 1;
    FUN_004293c0(local_20,2);
  }
  return uVar3;
}



/* @00450960 file=? name=FUN_00450960 */

void __cdecl FUN_00450960(int *param_1,byte param_2)

{
  int iVar1;
  undefined4 *puVar2;
  int local_20 [7];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f131c;
    if (DAT_004f0760 != (int *)0x0) {
      iVar1 = *(int *)(DAT_004efc94 + 0x2c);
      FUN_0042939c(local_20,iVar1);
      while( true ) {
        puVar2 = (undefined4 *)(**(code **)(local_20[0] + 0x28))(local_20);
        if (puVar2 == (undefined4 *)0x0) break;
        if (puVar2[6] != 0) {
          FUN_004524c8(puVar2[0x418],puVar2[6],param_1,puVar2[0x418]);
        }
        FUN_00428fdc(iVar1,(int)puVar2);
        if (puVar2 != (undefined4 *)0x0) {
          (**(code **)*puVar2)(puVar2,3);
        }
      }
      FUN_004022d0(DAT_004f0760);
      DAT_004f0760 = (int *)0x0;
      FUN_004293c0(local_20,2);
    }
    FUN_004527f8(param_1 + 0x14,2);
    FUN_0041d6a8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00450a2c file=? name=FUN_00450a2c */

void __cdecl FUN_00450a2c(int param_1,int param_2)

{
  undefined4 uVar1;
  int *piVar2;
  
  if (*(int *)(param_2 + 0xc) == -1) {
    FUN_0044e9c0(DAT_004efc94,*(undefined4 *)(param_1 + 0x20));
  }
  else {
    if (*(int *)(param_2 + 0xc) == 0) {
      uVar1 = FUN_004022b0(*(uint *)(param_2 + 0x10));
      *(undefined4 *)(param_1 + 0x1c) = uVar1;
      *(undefined4 *)(param_1 + 0x24) = 0;
    }
    FUN_004d4918((undefined4 *)(*(int *)(param_1 + 0x1c) + *(int *)(param_1 + 0x24)),
                 (undefined4 *)(param_2 + 0x18),*(uint *)(param_2 + 0x14));
    *(int *)(param_1 + 0x24) = *(int *)(param_1 + 0x24) + *(int *)(param_2 + 0x14);
    if (*(int *)(param_2 + 0x10) <= *(int *)(param_1 + 0x24)) {
      piVar2 = (int *)FUN_00402298(0x20);
      if (piVar2 == (int *)0x0) {
        piVar2 = (int *)0x0;
      }
      else {
        piVar2 = FUN_00403e84(piVar2,(char *)0x0,1);
      }
      *(int **)(param_1 + 0x20) = piVar2;
      FUN_00404d00((int)piVar2,*(char **)(param_1 + 0x1c),*(int *)(param_1 + 0x24));
      FUN_00404d6c(*(undefined4 **)(param_1 + 0x20),s_last_egg_004f0978);
      *(undefined4 *)(param_1 + 0x40) = 0;
      FUN_0044e9c0(DAT_004efc94,*(undefined4 *)(param_1 + 0x20));
      FUN_004022d0(*(int **)(param_1 + 0x1c));
    }
  }
  return;
}



/* @00450b08 file=? name=FUN_00450b08 */

void __cdecl FUN_00450b08(int param_1)

{
  *(undefined4 *)(param_1 + 0x3c) = 1;
  return;
}



/* @00450b18 file=munga_l4/l4net.cpp name=FUN_00450b18 */

void __cdecl FUN_00450b18(int *param_1,int param_2)

{
  int iVar1;
  uint uVar2;
  int *piVar3;
  uint uVar4;
  uint uVar5;
  uint local_18 [3];
  int *local_c;
  int *local_8;
  
  iVar1 = FUN_0042905c(*(int *)(DAT_004efc94 + 0x2c));
  *(undefined4 *)(iVar1 + 0x18) = 3;
  iVar1 = *(int *)(iVar1 + 0x10);
  if (iVar1 == 0) {
    param_1[0xb] = param_1[0xb] + 1;
    FUN_004dbb24(&DAT_00524e20,s_Connected_to_GameMachineHost_at_004f0981,(char *)0x0);
  }
  else if (iVar1 == 1) {
    param_1[0xb] = param_1[0xb] + 1;
    FUN_004dbb24(&DAT_00524e20,s_Connected_to_CameraShipHost_at_004f09a3,(char *)0x0);
  }
  else if (iVar1 == 2) {
    param_1[0xb] = param_1[0xb] + 1;
    FUN_004dbb24(&DAT_00524e20,s_Connected_to_MissionReviewHost_a_004f09c4,(char *)0x0);
  }
  else if (iVar1 == 3) {
    param_1[0xc] = param_1[0xc] + 1;
    FUN_004dbb24(&DAT_00524e20,s_Connected_to_ConsoleHost_at_004f09e8,(char *)0x0);
  }
  else {
    FUN_0040385c(s_L4NetworkManager__HostConnectedM_004f0a06,
                 s_d__tesla_bt_munga_l4_L4NET_CPP_004f0a48,0x32d);
  }
  uVar5 = *(uint *)(param_2 + 0x10) & 0xff;
  uVar4 = *(uint *)(param_2 + 0x10) >> 8 & 0xff;
  uVar2 = *(uint *)(param_2 + 0x10) >> 0x10 & 0xff;
  local_c = FUN_004db880(&DAT_00524e20,*(uint *)(param_2 + 0x10) >> 0x18);
  FUN_004dbb24(local_c,&DAT_004f0a67,(char *)0x0);
  local_8 = FUN_004db880(local_c,uVar2);
  FUN_004dbb24(local_8,&DAT_004f0a69,(char *)0x0);
  piVar3 = FUN_004db880(local_8,uVar4);
  FUN_004dbb24(piVar3,&DAT_004f0a6b,(char *)0x0);
  piVar3 = FUN_004db880(piVar3,uVar5);
  piVar3 = FUN_004d9c38(piVar3);
  FUN_004d9c70(piVar3);
  if (param_1[0xd] <= param_1[0xb]) {
    FUN_004dbb24(&DAT_00524e20,s_All_connections_completed__004f0a6d,(char *)0x0);
    FUN_004d9c70(&DAT_00524e20);
    (**(code **)(*param_1 + 0x2c))(param_1,s_MUNGA_MARKER__All_connections_co_004f0a89);
    local_18[0] = 0xc;
    local_18[1] = 10;
    local_18[2] = 1;
    FUN_0041acbc(*(int *)(DAT_004efc94 + 0x60),2,DAT_004efc94,local_18,DAT_004e17f4);
  }
  return;
}



/* @00450cf8 file=munga_l4/l4net.cpp name=FUN_00450cf8 */

void __cdecl FUN_00450cf8(int param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  undefined4 *puVar3;
  uint *puVar4;
  uint uVar5;
  int *piVar6;
  undefined4 extraout_ECX;
  uint *local_c;
  uint local_8;
  
  puVar3 = (undefined4 *)FUN_0042905c(*(int *)(DAT_004efc94 + 0x2c));
  puVar3[6] = 0;
  uVar1 = puVar3[5];
  FUN_004524c8(extraout_ECX,*(undefined4 *)(param_2 + 0x10),param_1,*(undefined4 *)(param_2 + 0x10))
  ;
  iVar2 = puVar3[4];
  if (iVar2 == 0) {
    *(int *)(param_1 + 0x2c) = *(int *)(param_1 + 0x2c) + -1;
    FUN_004dbb24(&DAT_00524e20,s_Disconnected_from_GameMachineHos_004f0ab3,(char *)0x0);
  }
  else if (iVar2 == 1) {
    *(int *)(param_1 + 0x2c) = *(int *)(param_1 + 0x2c) + -1;
    FUN_004dbb24(&DAT_00524e20,s_Disconnected_from_CameraShipHost_004f0ada,(char *)0x0);
  }
  else if (iVar2 == 2) {
    *(int *)(param_1 + 0x2c) = *(int *)(param_1 + 0x2c) + -1;
    FUN_004dbb24(&DAT_00524e20,s_Disconnected_from_MissionReviewH_004f0b00,(char *)0x0);
  }
  else if (iVar2 == 3) {
    *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x30) + -1;
    FUN_004dbb24(&DAT_00524e20,s_Disconnected_from_ConsoleHost_at_004f0b29,(char *)0x0);
    local_8 = FUN_00452378(param_1,4,0x5dd,0,0);
    FUN_00428fdc(*(int *)(DAT_004efc94 + 0x2c),(int)puVar3);
    if (puVar3 != (undefined4 *)0x0) {
      (**(code **)*puVar3)(puVar3,3);
    }
    puVar3 = (undefined4 *)FUN_00402298(0x1068);
    if (puVar3 == (undefined4 *)0x0) {
      puVar3 = (undefined4 *)0x0;
    }
    else {
      puVar4 = (uint *)FUN_00402298(0x10);
      if (puVar4 == (uint *)0x0) {
        local_c = (uint *)0x0;
      }
      else {
        local_c = FUN_00402460(puVar4,s_Console_004f0b4c);
      }
      local_c[3] = local_c[3] + 1;
      puVar3 = FUN_00450134(puVar3,1,3,DAT_004e36ec,local_8,(int *)&local_c);
    }
    puVar4 = local_c + 3;
    *puVar4 = *puVar4 - 1;
    if (*puVar4 == 0) {
      FUN_004024d8((int *)local_c,3);
    }
    puVar3[6] = 2;
    FUN_00428f94(*(int *)(DAT_004efc94 + 0x2c),(int)puVar3);
    *(undefined4 **)(param_1 + 0x44) = puVar3;
  }
  else {
    FUN_0040385c(s_L4NetworkManager__HostDisconnect_004f0b54,
                 s_d__tesla_bt_munga_l4_L4NET_CPP_004f0b99,0x3a6);
  }
  uVar5 = uVar1 >> 0x10 & 0xff;
  piVar6 = FUN_004db880(&DAT_00524e20,uVar1 >> 0x18);
  FUN_004dbb24(piVar6,&DAT_004f0bb8,(char *)0x0);
  piVar6 = FUN_004db880(piVar6,uVar5);
  FUN_004dbb24(piVar6,&DAT_004f0bba,(char *)0x0);
  uVar5 = uVar1 & 0xff;
  piVar6 = FUN_004db880(&DAT_00524e20,uVar1 >> 8 & 0xff);
  FUN_004dbb24(piVar6,&DAT_004f0bbc,(char *)0x0);
  piVar6 = FUN_004db880(piVar6,uVar5);
  FUN_004dbb24(piVar6,&DAT_004f0bbe,(char *)0x0);
  FUN_004d9c70(&DAT_00524e20);
  return;
}



/* @00450f48 file=? name=FUN_00450f48 */

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

{
  int iVar1;
  
  if (*(int *)(param_1 + 0x7c) == 0) {
    iVar1 = FUN_00450fa8(param_1,param_2,param_3);
    if (iVar1 == 0) {
      FUN_00452870(param_1 + 0x50,param_4,param_3,param_2);
    }
  }
  else {
    FUN_00452870(param_1 + 0x50,param_4,param_3,param_2);
    FUN_004528dc(param_1 + 0x50);
  }
  return;
}



/* @00450fa8 file=munga_l4/l4net.cpp name=FUN_00450fa8 */

undefined4 __cdecl FUN_00450fa8(int param_1,uint *param_2,undefined4 param_3)

{
  undefined4 *puVar1;
  short sVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  undefined4 uVar6;
  uint uVar7;
  int *piVar8;
  undefined4 extraout_ECX;
  undefined2 extraout_var;
  uint uVar9;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 *local_10;
  uint local_c;
  undefined4 local_8;
  
  iVar3 = *(int *)(DAT_004efc94 + 0x2c);
  iVar5 = FUN_0042905c(iVar3);
  iVar4 = DAT_004f0760;
  if (*(int *)(iVar5 + 0x18) == 3) {
    iVar3 = *(int *)(iVar3 + 0x14);
    if (iVar3 == 0) {
      local_8 = 0;
    }
    else {
      local_8 = *(undefined4 *)(iVar3 + 0xc);
    }
    local_c = *param_2 + 0x10;
    if ((*param_2 < 8) || (0x63c < local_c)) {
      uVar9 = *(uint *)(iVar5 + 0x14);
      FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendMessageToN_004f0bc0,(char *)0x0);
      uVar7 = uVar9 >> 0x10 & 0xff;
      piVar8 = FUN_004db880(&DAT_00524e20,uVar9 >> 0x18);
      FUN_004dbb24(piVar8,&DAT_004f0be9,(char *)0x0);
      piVar8 = FUN_004db880(piVar8,uVar7);
      FUN_004dbb24(piVar8,&DAT_004f0beb,(char *)0x0);
      uVar7 = uVar9 & 0xff;
      piVar8 = FUN_004db880(&DAT_00524e20,uVar9 >> 8 & 0xff);
      FUN_004dbb24(piVar8,&DAT_004f0bed,(char *)0x0);
      FUN_004db880(piVar8,uVar7);
      uVar9 = local_c;
      FUN_004dbb24(&DAT_00524e20,s_Requested_to_send_a_004f0bef,(char *)0x0);
      piVar8 = FUN_004db78c(&DAT_00524e20,uVar9);
      FUN_004dbb24(piVar8,s_size_message_004f0c04,(char *)0x0);
      FUN_004d9c70(&DAT_00524e20);
      FUN_0040385c(s_L4NetworkManager__SendMessageToN_004f0c13,
                   s_d__tesla_bt_munga_l4_L4NET_CPP_004f0c52,0x4c2);
      uVar6 = 1;
    }
    else {
      puVar1 = (undefined4 *)(DAT_004f0760 + 0x10);
      *(undefined4 *)(DAT_004f0760 + 0xc) = *(undefined4 *)(iVar5 + 0x1060);
      *puVar1 = param_3;
      *(undefined4 *)(iVar4 + 0x14) = *(undefined4 *)(param_1 + 0x14);
      *(undefined4 *)(iVar4 + 0x18) = local_8;
      local_10 = (undefined4 *)FUN_00414b60();
      *(undefined4 *)(iVar4 + 0x1c) = *local_10;
      FUN_004d4918((undefined4 *)(iVar4 + 0x20),param_2,*param_2);
      iVar3 = DAT_004f0760;
      *(short *)(DAT_004f0760 + 10) = (short)local_c + 4;
      *(undefined2 *)(iVar3 + 6) = 1;
      FUN_00452100(extraout_ECX,CONCAT22(extraout_var,(short)local_c + 4));
      sVar2 = *(short *)(DAT_004f0760 + 8);
      if (sVar2 == -4) {
        uVar6 = 0;
      }
      else if (sVar2 == -3) {
        FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendMessageToN_004f0c71,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,s_Disconnect_detected_in_send_004f0c9a,(char *)0x0);
        FUN_004d9c70(&DAT_00524e20);
        local_14 = *(undefined4 *)(iVar5 + 0x1060);
        local_18 = *(undefined4 *)(iVar5 + 0xc);
        local_24 = 0x14;
        local_20 = 6;
        local_1c = 1;
        piVar8 = (int *)FUN_0041d7f0(param_1,0);
        (**(code **)(*piVar8 + 0x14))(piVar8,0,&local_24);
        uVar6 = 1;
      }
      else if (sVar2 == 0) {
        uVar6 = 1;
      }
      else {
        uVar9 = *(uint *)(iVar5 + 0x14);
        FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendMessageToN_004f0cb7,(char *)0x0);
        sVar2 = *(short *)(DAT_004f0760 + 8);
        FUN_004dbb24(&DAT_00524e20,s_Error_004f0ce0,(char *)0x0);
        piVar8 = FUN_004db78c(&DAT_00524e20,(int)sVar2);
        FUN_004dbb24(piVar8,&DAT_004f0ce7,(char *)0x0);
        uVar7 = uVar9 >> 0x10 & 0xff;
        piVar8 = FUN_004db880(&DAT_00524e20,uVar9 >> 0x18);
        FUN_004dbb24(piVar8,&DAT_004f0cec,(char *)0x0);
        piVar8 = FUN_004db880(piVar8,uVar7);
        FUN_004dbb24(piVar8,&DAT_004f0cee,(char *)0x0);
        uVar7 = uVar9 & 0xff;
        piVar8 = FUN_004db880(&DAT_00524e20,uVar9 >> 8 & 0xff);
        FUN_004dbb24(piVar8,&DAT_004f0cf0,(char *)0x0);
        piVar8 = FUN_004db880(piVar8,uVar7);
        FUN_004dbb24(piVar8,&DAT_004f0cf2,(char *)0x0);
        FUN_004d9c70(&DAT_00524e20);
        FUN_0040385c(s_NetNub_error_in_transmit_004f0cf4,s_d__tesla_bt_munga_l4_L4NET_CPP_004f0d0e,
                     0x538);
        uVar6 = 1;
      }
    }
  }
  else {
    uVar6 = 1;
  }
  return uVar6;
}



/* @0045134c file=? name=FUN_0045134c */

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

{
  int iVar1;
  int local_3c [3];
  int local_30 [4];
  int local_20 [7];
  
  if (*(int *)(param_1 + 0x7c) == 0) {
    FUN_0040158e(local_30,0);
    FUN_00451448(param_1,param_2,param_3,local_30);
    FUN_004015d9(local_3c,(int)local_30);
    while( true ) {
      iVar1 = (**(code **)(local_3c[0] + 0x28))(local_3c);
      if (iVar1 == 0) break;
      FUN_00452870(param_1 + 0x50,*(undefined4 *)(iVar1 + 0xc),param_3,param_2);
    }
    FUN_00401636(local_3c,2);
    FUN_004015ad(local_30,2);
  }
  else {
    FUN_0042939c(local_20,*(int *)(DAT_004efc94 + 0x2c));
    while( true ) {
      iVar1 = (**(code **)(local_20[0] + 0x28))(local_20);
      if (iVar1 == 0) break;
      if ((*(int *)(iVar1 + 0x10) != 3) && (*(int *)(iVar1 + 0x18) == 3)) {
        FUN_00452870(param_1 + 0x50,*(undefined4 *)(iVar1 + 0xc),param_3,param_2);
      }
    }
    FUN_004528dc(param_1 + 0x50);
    FUN_004293c0(local_20,2);
  }
  return;
}



/* @00451448 file=munga_l4/l4net.cpp name=FUN_00451448 */

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

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  uint uVar4;
  int *piVar5;
  undefined4 extraout_ECX;
  undefined2 extraout_var;
  int *piVar6;
  int *piVar7;
  uint uVar8;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  int local_78 [10];
  int local_50 [7];
  int *local_34;
  int *local_30;
  int *local_2c;
  int *local_28;
  short local_22;
  int local_20;
  int local_1c;
  undefined4 *local_18;
  int *local_14;
  int *local_10;
  uint local_c;
  undefined4 local_8;
  
  if (DAT_004f0760 != 0) {
    iVar2 = *(int *)(*(int *)(DAT_004efc94 + 0x2c) + 0x14);
    if (iVar2 == 0) {
      local_8 = 0;
    }
    else {
      local_8 = *(undefined4 *)(iVar2 + 0xc);
    }
    local_c = *param_2 + 0x10;
    if ((*param_2 < 8) || (0x63c < local_c)) {
      FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendBatchedMes_004f0d2d,(char *)0x0);
      uVar8 = local_c;
      FUN_004dbb24(&DAT_00524e20,s_Requested_to_send_a_004f0d5d,(char *)0x0);
      local_10 = FUN_004db78c(&DAT_00524e20,uVar8);
      FUN_004dbb24(local_10,s_size_message_004f0d72,(char *)0x0);
      FUN_004d9c70(&DAT_00524e20);
      FUN_0040385c(s_L4NetworkManager__SendBatchedMes_004f0d81,
                   s_d__tesla_bt_munga_l4_L4NET_CPP_004f0dc7,0x6b2);
    }
    else {
      local_14 = (int *)(DAT_004f0760 + 0xc);
      local_18 = (undefined4 *)(DAT_004f0760 + 0x38);
      FUN_0042939c(local_50,*(int *)(DAT_004efc94 + 0x2c));
      local_1c = 0;
      piVar6 = local_78;
      piVar7 = local_14 + 1;
      while (iVar2 = (**(code **)(local_50[0] + 0x28))(local_50), iVar2 != 0) {
        if ((*(int *)(iVar2 + 0x10) != 3) && (*(int *)(iVar2 + 0x18) == 3)) {
          if (9 < local_1c) {
            FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendBatchedMes_004f0de6,(char *)0x0);
            FUN_0040385c(s_Tried_to_send_to_too_many_destin_004f0e16,
                         s_d__tesla_bt_munga_l4_L4NET_CPP_004f0e3e,0x6e8);
            FUN_004293c0(local_50,2);
            return;
          }
          *piVar6 = iVar2;
          *piVar7 = *(int *)(iVar2 + 0x1060);
          piVar7 = piVar7 + 1;
          local_1c = local_1c + 1;
          piVar6 = piVar6 + 1;
        }
      }
      *local_14 = local_1c;
      if (local_1c == 0) {
        FUN_004293c0(local_50,2);
      }
      else {
        *local_18 = param_3;
        local_18[1] = *(undefined4 *)(param_1 + 0x14);
        local_18[2] = local_8;
        puVar3 = (undefined4 *)FUN_00414b60();
        local_18[3] = *puVar3;
        FUN_004d4918(local_18 + 4,param_2,*param_2);
        iVar2 = DAT_004f0760;
        *(short *)(DAT_004f0760 + 10) = (short)local_c + 0x2c;
        *(undefined2 *)(iVar2 + 6) = 0xf;
        FUN_00452100(extraout_ECX,CONCAT22(extraout_var,(short)local_c + 0x2c));
        if (*(short *)(DAT_004f0760 + 8) == 0) {
          FUN_004293c0(local_50,2);
        }
        else {
          piVar6 = (int *)(iVar2 + 0x10);
          local_20 = 0;
          piVar7 = local_78;
          if (0 < local_1c) {
            do {
              iVar2 = *piVar7;
              iVar1 = *piVar6;
              if (iVar1 == -4) {
                (**(code **)(*param_4 + 4))(param_4,iVar2);
              }
              else if (iVar1 == -3) {
                FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendBatchedMes_004f0e5d,(char *)0x0);
                FUN_004dbb24(&DAT_00524e20,s_Disconnect_detected_in_send_004f0e8d,(char *)0x0);
                FUN_004d9c70(&DAT_00524e20);
                local_7c = *(undefined4 *)(iVar2 + 0x1060);
                local_80 = *(undefined4 *)(iVar2 + 0xc);
                local_8c = 0x14;
                local_88 = 6;
                local_84 = 1;
                piVar5 = (int *)FUN_0041d7f0(param_1,0);
                (**(code **)(*piVar5 + 0x14))(piVar5,0,&local_8c);
              }
              else if (iVar1 != 0) {
                uVar8 = *(uint *)(iVar2 + 0x14);
                FUN_004dbb24(&DAT_00524e20,s_L4NetworkManager__SendBatchedMes_004f0eaa,(char *)0x0);
                local_22 = *(short *)(DAT_004f0760 + 8);
                FUN_004dbb24(&DAT_00524e20,s_Error_004f0eda,(char *)0x0);
                local_28 = FUN_004db78c(&DAT_00524e20,(int)local_22);
                FUN_004dbb24(local_28,&DAT_004f0ee1,(char *)0x0);
                uVar4 = uVar8 >> 0x10 & 0xff;
                local_30 = FUN_004db880(&DAT_00524e20,uVar8 >> 0x18);
                FUN_004dbb24(local_30,&DAT_004f0ee6,(char *)0x0);
                local_2c = FUN_004db880(local_30,uVar4);
                FUN_004dbb24(local_2c,&DAT_004f0ee8,(char *)0x0);
                uVar4 = uVar8 & 0xff;
                local_34 = FUN_004db880(&DAT_00524e20,uVar8 >> 8 & 0xff);
                FUN_004dbb24(local_34,&DAT_004f0eea,(char *)0x0);
                piVar5 = FUN_004db880(local_34,uVar4);
                FUN_004dbb24(piVar5,&DAT_004f0eec,(char *)0x0);
                FUN_004d9c70(&DAT_00524e20);
                FUN_0040385c(s_NetNub_error_in_transmit_004f0eee,
                             s_d__tesla_bt_munga_l4_L4NET_CPP_004f0f08,0x771);
              }
              local_20 = local_20 + 1;
              piVar6 = piVar6 + 1;
              piVar7 = piVar7 + 1;
            } while (local_20 < local_1c);
          }
          FUN_004293c0(local_50,2);
        }
      }
    }
  }
  return;
}



/* @00451894 file=? name=FUN_00451894 */

undefined4 __cdecl FUN_00451894(int param_1)

{
  if (*(int *)(param_1 + 0x7c) != 0) {
    FUN_004528dc(param_1 + 0x50);
    return 1;
  }
  return 0;
}



/* @004518b8 file=munga_l4/l4net.cpp name=FUN_004518b8 */

undefined4 __cdecl FUN_004518b8(int param_1,undefined4 *param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  int *piVar5;
  uint uVar6;
  undefined4 *puVar7;
  undefined4 uVar8;
  undefined4 local_140;
  undefined4 local_13c;
  undefined4 local_138;
  undefined4 local_134;
  undefined4 local_130;
  undefined4 local_12c;
  undefined4 local_128;
  undefined4 local_124;
  undefined4 local_120;
  int local_11c;
  undefined4 local_118;
  int local_114 [7];
  undefined4 local_f8;
  undefined4 local_f4;
  undefined4 local_f0;
  undefined4 local_ec;
  int local_e8;
  undefined4 local_e4;
  undefined4 local_e0;
  undefined4 local_dc;
  undefined4 local_d8;
  undefined4 local_d4;
  int local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  uint local_b8;
  undefined4 local_b4;
  int local_b0 [7];
  int aiStack_94 [10];
  int *local_6c;
  undefined4 local_68;
  int local_64;
  undefined4 local_60;
  int local_5c;
  int *local_58;
  undefined4 local_54;
  int local_50;
  undefined4 local_4c;
  undefined4 local_48;
  int *local_44;
  undefined4 local_40;
  uint local_3c;
  undefined4 local_38;
  int *local_34;
  int *local_30;
  int *local_2c;
  int *local_28;
  int *local_24;
  int *local_20;
  int *local_1c;
  int local_18;
  int *local_14;
  undefined4 local_10;
  int local_c;
  undefined4 *local_8;
  
  local_14 = (int *)(DAT_004f0760 + 0xc);
  local_18 = DAT_004f0760 + 0xc;
  puVar7 = (undefined4 *)(DAT_004f0760 + 0x10);
  local_8 = (undefined4 *)(DAT_004f0760 + 0x38);
  FUN_0042939c(local_b0,*(int *)(DAT_004efc94 + 0x2c));
  iVar1 = FUN_00452000(param_1,param_2,local_b0);
  if (iVar1 != 0) {
    uVar8 = 1;
    FUN_004293c0(local_b0,2);
    return uVar8;
  }
  local_c = 0;
  (**(code **)(local_b0[0] + 4))(local_b0);
  while (iVar1 = (**(code **)(local_b0[0] + 0x28))(local_b0), iVar1 != 0) {
    iVar3 = *(int *)(iVar1 + 0x18);
    if (iVar3 != 0) {
      if (iVar3 == 1) {
        local_b8 = FUN_00452318(param_1,*(undefined4 *)(iVar1 + 0x1060));
        if (local_b8 != 0) {
          uVar6 = *(uint *)(iVar1 + 0x14);
          if (uVar6 != local_b8) {
            FUN_004dbb24(&DAT_00524e20,s_Host_004f0f27,(char *)0x0);
            uVar2 = uVar6 >> 0x10 & 0xff;
            local_20 = FUN_004db880(&DAT_00524e20,uVar6 >> 0x18);
            FUN_004dbb24(local_20,&DAT_004f0f2d,(char *)0x0);
            local_1c = FUN_004db880(local_20,uVar2);
            FUN_004dbb24(local_1c,&DAT_004f0f2f,(char *)0x0);
            uVar2 = uVar6 & 0xff;
            local_24 = FUN_004db880(&DAT_00524e20,uVar6 >> 8 & 0xff);
            FUN_004dbb24(local_24,&DAT_004f0f31,(char *)0x0);
            FUN_004db880(local_24,uVar2);
            FUN_004dbb24(&DAT_00524e20,s_client_004f0f33,(char *)0x0);
            uVar6 = local_b8 >> 0x10 & 0xff;
            local_2c = FUN_004db880(&DAT_00524e20,local_b8 >> 0x18);
            FUN_004dbb24(local_2c,&DAT_004f0f3c,(char *)0x0);
            local_28 = FUN_004db880(local_2c,uVar6);
            FUN_004dbb24(local_28,&DAT_004f0f3e,(char *)0x0);
            uVar6 = local_b8 & 0xff;
            local_34 = FUN_004db880(&DAT_00524e20,local_b8 >> 8 & 0xff);
            FUN_004dbb24(local_34,&DAT_004f0f40,(char *)0x0);
            local_30 = FUN_004db880(local_34,uVar6);
            FUN_004dbb24(local_30,&DAT_004f0f42,(char *)0x0);
            FUN_0040385c(s_For_an_OPEN_the_host_MUST_match_t_004f0f44,
                         s_d__tesla_bt_munga_l4_L4NET_CPP_004f0f91,0x7fe);
          }
          local_b4 = *(undefined4 *)(iVar1 + 0x1060);
          local_bc = *(undefined4 *)(iVar1 + 0xc);
          local_c8 = 0x18;
          local_c4 = 5;
          local_c0 = 1;
          local_40 = local_bc;
          local_3c = local_b8;
          local_38 = local_b4;
          local_44 = (int *)FUN_0041d7f0(param_1,0);
          (**(code **)(*local_44 + 0x14))(local_44,0,&local_c8);
          uVar8 = 0;
          FUN_004293c0(local_b0,2);
          return uVar8;
        }
      }
      else if (iVar3 == 2) {
        iVar3 = FUN_00452318(param_1,*(undefined4 *)(iVar1 + 0x1060));
        if (iVar3 != 0) {
          local_48 = *(undefined4 *)(iVar1 + 0x1060);
          if (iVar3 == *(int *)(iVar1 + 0x14)) {
            local_cc = *(undefined4 *)(iVar1 + 0x1060);
            local_d4 = *(undefined4 *)(iVar1 + 0xc);
            local_e0 = 0x18;
            local_dc = 5;
            local_d8 = 1;
            local_d0 = iVar3;
            local_54 = local_d4;
            local_50 = iVar3;
            local_4c = local_cc;
            local_58 = (int *)FUN_0041d7f0(param_1,0);
            (**(code **)(*local_58 + 0x14))(local_58,0,&local_e0);
          }
          else if (*(int *)(iVar1 + 0x10) == 3) {
            *(int *)(iVar1 + 0x14) = iVar3;
            local_e4 = *(undefined4 *)(iVar1 + 0x1060);
            local_ec = *(undefined4 *)(iVar1 + 0xc);
            local_f8 = 0x18;
            local_f4 = 5;
            local_f0 = 1;
            local_e8 = iVar3;
            local_68 = local_ec;
            local_64 = iVar3;
            local_60 = local_e4;
            local_5c = iVar3;
            local_6c = (int *)FUN_0041d7f0(param_1,0);
            (**(code **)(*local_6c + 0x14))(local_6c,0,&local_f8);
          }
          else {
            FUN_0042939c(local_114,*(int *)(DAT_004efc94 + 0x2c));
            while (iVar4 = (**(code **)(local_114[0] + 0x28))(local_114), iVar4 != 0) {
              if ((*(int *)(iVar4 + 0x18) == 2) && (iVar3 == *(int *)(iVar4 + 0x14))) {
                *(undefined4 *)(iVar1 + 0x1060) = *(undefined4 *)(iVar4 + 0x1060);
                *(undefined4 *)(iVar4 + 0x1060) = local_48;
                local_120 = *(undefined4 *)(iVar4 + 0xc);
                local_12c = 0x18;
                local_128 = 5;
                local_124 = 1;
                local_118 = local_48;
                local_11c = iVar3;
                piVar5 = (int *)FUN_0041d7f0(param_1,0);
                (**(code **)(*piVar5 + 0x14))(piVar5,0,&local_12c);
                uVar8 = 0;
                FUN_004293c0(local_114,2);
                FUN_004293c0(local_b0,2);
                return uVar8;
              }
            }
            FUN_004293c0(local_114,2);
          }
          uVar8 = 0;
          FUN_004293c0(local_b0,2);
          return uVar8;
        }
      }
      else {
        if (iVar3 != 3) {
          FUN_0040385c(s_Host_had_illegal_connection_stat_004f0fb0,
                       s_d__tesla_bt_munga_l4_L4NET_CPP_004f0fd4,0x875);
        }
        if (0x63f < (short)(*(short *)(iVar1 + 0x1058) - *(short *)(iVar1 + 0x105c))) {
          aiStack_94[local_c] = iVar1;
          local_c = local_c + 1;
          *puVar7 = *(undefined4 *)(iVar1 + 0x1060);
          puVar7 = puVar7 + 1;
        }
      }
    }
  }
  if (local_c == 0) {
    uVar8 = 0;
    FUN_004293c0(local_b0,2);
    return uVar8;
  }
  *local_14 = local_c;
  *(undefined2 *)(DAT_004f0760 + 6) = 0x10;
  iVar1 = DAT_004f0760;
  *(undefined2 *)(DAT_004f0760 + 10) = 0x2c;
  FUN_00452100(local_c,iVar1);
  if (*(short *)(DAT_004f0760 + 8) == 0) {
    uVar8 = 0;
    FUN_004293c0(local_b0,2);
    return uVar8;
  }
  iVar1 = 0;
  if (0 < local_c) {
    do {
      iVar3 = aiStack_94[iVar1];
      uVar6 = *(uint *)(local_18 + 4 + iVar1 * 4);
      if (uVar6 != 0) {
        if (uVar6 == 0xfffffffd) {
          local_130 = *(undefined4 *)(iVar3 + 0x1060);
          local_134 = *(undefined4 *)(iVar3 + 0xc);
          local_140 = 0x14;
          local_13c = 6;
          local_138 = 1;
          piVar5 = (int *)FUN_0041d7f0(param_1,0);
          (**(code **)(*piVar5 + 0x14))(piVar5,0,&local_140);
        }
        else if ((int)uVar6 < 0) {
          FUN_004dbb24(&DAT_00524e20,s_MUNGA_reported_network_error_004f0ff3,(char *)0x0);
          piVar5 = FUN_004db78c(&DAT_00524e20,uVar6);
          FUN_004dbb24(piVar5,&DAT_004f1011,(char *)0x0);
          FUN_0040385c(s_MUNGA_network_error_004f1013,s_d__tesla_bt_munga_l4_L4NET_CPP_004f1027,
                       0x8e9);
        }
        else {
          FUN_004d4918((undefined4 *)((uint)*(ushort *)(iVar3 + 0x105c) + iVar3 + 0x58),local_8,
                       uVar6);
          *(short *)(iVar3 + 0x105c) = *(short *)(iVar3 + 0x105c) + (short)uVar6;
          local_8 = (undefined4 *)((int)local_8 + uVar6);
        }
      }
      iVar1 = iVar1 + 1;
    } while (iVar1 < local_c);
  }
  uVar8 = FUN_00452000(param_1,param_2,local_b0);
  local_10 = uVar8;
  FUN_004293c0(local_b0,2);
  return uVar8;
}



/* @00452000 file=? name=FUN_00452000 */

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

{
  short sVar1;
  int iVar2;
  short sVar3;
  short local_6;
  
  sVar1 = (**(code **)(*param_3 + 0x14))(param_3);
  local_6 = 0;
  if (0 < sVar1) {
    do {
      *(int *)(param_1 + 0x4c) = *(int *)(param_1 + 0x4c) + 1;
      iVar2 = (**(code **)(*param_3 + 0x14))(param_3);
      if (iVar2 <= *(int *)(param_1 + 0x4c)) {
        *(undefined4 *)(param_1 + 0x4c) = 0;
      }
      iVar2 = (**(code **)(*param_3 + 0x34))(param_3,*(undefined4 *)(param_1 + 0x4c));
      if (iVar2 == 0) {
        return 0;
      }
      if ((((*(int *)(param_1 + 0x40) != 1) || (*(int *)(iVar2 + 0x10) == 3)) &&
          (0x1b < *(ushort *)(iVar2 + 0x105c))) &&
         (sVar3 = *(short *)(iVar2 + 0x68) + 0x10,
         (int)sVar3 <= (int)(uint)*(ushort *)(iVar2 + 0x105c))) {
        FUN_004d4918(param_2,(undefined4 *)(iVar2 + 0x58),(int)sVar3);
        sVar1 = *(short *)(iVar2 + 0x105c) - sVar3;
        if (sVar1 != 0) {
          FUN_004d493c((undefined4 *)(iVar2 + 0x58),(undefined4 *)(sVar3 + iVar2 + 0x58),(int)sVar1)
          ;
        }
        *(short *)(iVar2 + 0x105c) = *(short *)(iVar2 + 0x105c) - sVar3;
        return 1;
      }
      local_6 = local_6 + 1;
    } while (local_6 < sVar1);
  }
  return 0;
}



/* @004520f8 file=? name=FUN_004520f8 */

void FUN_004520f8(void)

{
  return;
}



/* @00452100 file=munga_l4/l4net.cpp name=FUN_00452100 */

undefined8 __fastcall FUN_00452100(undefined4 param_1,undefined4 param_2)

{
  uint uVar1;
  int *piVar2;
  undefined4 extraout_ECX;
  undefined4 uVar3;
  undefined4 extraout_EDX;
  undefined4 extraout_EDX_00;
  undefined4 uVar4;
  undefined8 uVar5;
  undefined1 auStack_64 [12];
  undefined4 local_58;
  undefined2 local_44;
  undefined2 local_3e;
  undefined2 local_3c;
  undefined2 local_36;
  undefined2 local_34;
  uint local_30;
  undefined1 local_2c;
  undefined1 local_2b;
  undefined4 local_28;
  undefined1 *local_1c;
  int local_18;
  undefined2 local_10 [6];
  
  FUN_0047d10f(param_1,param_2);
  local_30 = 0x300;
  local_2c = DAT_00522b90;
  local_2b = 0;
  local_28 = 0;
  local_1c = auStack_64;
  FUN_004d46fc(local_10);
  local_58 = 0;
  local_3e = 0;
  local_3c = 0;
  local_44 = 0;
  local_34 = 0;
  local_36 = 0;
  FUN_004d461f(0x31,(int)&local_30,&local_30,local_10);
  uVar1 = local_30;
  uVar3 = 0;
  uVar4 = extraout_EDX;
  if (local_18 != 0) {
    FUN_004dbb24(&DAT_00524e20,s_int386x___ERROR__004f1046,(char *)0x0);
    piVar2 = FUN_004db880(&DAT_00524e20,uVar1);
    FUN_004d9c38(piVar2);
    FUN_0040385c(s_Error_calling_netnub_004f1057,s_d__tesla_bt_munga_l4_L4NET_CPP_004f106d,0x9a6);
    uVar3 = extraout_ECX;
    uVar4 = extraout_EDX_00;
  }
  uVar5 = FUN_0047d0ce(uVar3,uVar4);
  return uVar5;
}



/* @004521d0 file=? name=FUN_004521d0 */

undefined4 __fastcall FUN_004521d0(undefined4 param_1,undefined4 param_2)

{
  short sVar1;
  int iVar2;
  int *piVar3;
  
  iVar2 = DAT_004f0760;
  *(undefined2 *)(DAT_004f0760 + 6) = 0;
  *(undefined2 *)(iVar2 + 10) = 0;
  FUN_00452100(param_1,param_2);
  sVar1 = *(short *)(DAT_004f0760 + 8);
  if (sVar1 == 0) {
    return *(undefined4 *)(DAT_004f0760 + 0xc);
  }
  FUN_004dbb24(&DAT_00524e20,s_Status_not_ok__it_s_004f108c,(char *)0x0);
  piVar3 = FUN_004db78c(&DAT_00524e20,(int)sVar1);
  FUN_004dbb24(piVar3,&DAT_004f10a1,(char *)0x0);
  return 0;
}



/* @00452244 file=munga_l4/l4net.cpp name=FUN_00452244 */

undefined4 __cdecl FUN_00452244(undefined4 param_1,int *param_2)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  char *pcVar6;
  char *pcVar7;
  undefined4 uVar8;
  
  iVar3 = DAT_004f0760;
  *(undefined2 *)(DAT_004f0760 + 6) = 6;
  *(short *)(iVar3 + 10) = (short)param_2[1];
  uVar4 = 0xffffffff;
  pcVar6 = (char *)param_2[2];
  do {
    pcVar7 = pcVar6;
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    pcVar7 = pcVar6 + 1;
    cVar2 = *pcVar6;
    pcVar6 = pcVar7;
  } while (cVar2 != '\0');
  uVar4 = ~uVar4;
  pcVar6 = pcVar7 + -uVar4;
  pcVar7 = (char *)(iVar3 + 0xc);
  for (uVar5 = uVar4 >> 2; uVar5 != 0; uVar5 = uVar5 - 1) {
    *(undefined4 *)pcVar7 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar7 = pcVar7 + 4;
  }
  for (uVar5 = uVar4 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
    *pcVar7 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar7 = pcVar7 + 1;
  }
  FUN_00452100(0,uVar4);
  if (*(short *)(DAT_004f0760 + 8) != 0) {
    FUN_004dbb24(&DAT_00524e20,s_Couldn_t_resolve_004f10a3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,(char *)param_2[2],(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_to_a_net_address_004f10b5,(char *)0x0);
    FUN_0040385c(s_unresolvable_network_address_004f10c8,s_d__tesla_bt_munga_l4_L4NET_CPP_004f10e6,
                 0x9ee);
  }
  uVar8 = *(undefined4 *)(DAT_004f0760 + 0xc);
  piVar1 = param_2 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(param_2,3);
  }
  return uVar8;
}



/* @00452318 file=munga_l4/l4net.cpp name=FUN_00452318 */

undefined4 __cdecl FUN_00452318(undefined4 param_1,undefined4 param_2)

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = DAT_004f0760;
  puVar2 = (undefined4 *)(DAT_004f0760 + 0xc);
  *(undefined2 *)(DAT_004f0760 + 6) = 7;
  *(undefined2 *)(iVar1 + 10) = 4;
  *puVar2 = param_2;
  FUN_00452100(puVar2,puVar2);
  if (*(short *)(DAT_004f0760 + 8) == 0) {
    return 0;
  }
  if (*(short *)(DAT_004f0760 + 8) == 2) {
    return *puVar2;
  }
  FUN_0040385c(s_CheckSocket_returned_an_illegal_s_004f1105,
               s_d__tesla_bt_munga_l4_L4NET_CPP_004f1132,0xa17);
  return 0;
}



/* @00452378 file=munga_l4/l4net.cpp name=FUN_00452378 */

uint __cdecl
FUN_00452378(undefined4 param_1,undefined2 param_2,undefined2 param_3,undefined2 param_4,
            uint param_5)

{
  int iVar1;
  int *piVar2;
  uint *puVar3;
  uint uVar4;
  
  iVar1 = DAT_004f0760;
  puVar3 = (uint *)(DAT_004f0760 + 0xc);
  *(undefined2 *)(DAT_004f0760 + 6) = param_2;
  *(undefined2 *)(iVar1 + 10) = 0xc;
  *(undefined2 *)puVar3 = param_3;
  *(undefined2 *)(iVar1 + 0xe) = param_4;
  *(uint *)(iVar1 + 0x10) = param_5;
  *(undefined4 *)(iVar1 + 0x14) = 0;
  FUN_00452100(0,CONCAT22((short)((uint)iVar1 >> 0x10),param_4));
  if (*(short *)(DAT_004f0760 + 8) == -1) {
    uVar4 = *puVar3;
    FUN_004dbb24(&DAT_00524e20,s_NetNub_TCP_Open_Listen_error___004f1151,(char *)0x0);
    piVar2 = FUN_004db880(&DAT_00524e20,uVar4);
    FUN_004dbb24(piVar2,s_listening_for_004f1170,(char *)0x0);
    piVar2 = FUN_004db78c(&DAT_00524e20,(int)param_5 >> 0x18 & 0xff);
    FUN_004dbb24(piVar2,&DAT_004f1180,(char *)0x0);
    piVar2 = FUN_004db78c(piVar2,(int)param_5 >> 0x10 & 0xff);
    FUN_004dbb24(piVar2,&DAT_004f1182,(char *)0x0);
    piVar2 = FUN_004db78c(&DAT_00524e20,(int)param_5 >> 8 & 0xff);
    FUN_004dbb24(piVar2,&DAT_004f1184,(char *)0x0);
    piVar2 = FUN_004db78c(piVar2,param_5 & 0xff);
    FUN_004dbb24(piVar2,&DAT_004f1186,(char *)0x0);
    FUN_0040385c(s_Netnub_error_during_open_listen_004f1188,
                 s_d__tesla_bt_munga_l4_L4NET_CPP_004f11a9,0xa46);
  }
  return *puVar3;
}



/* @004524c8 file=? name=FUN_004524c8 */

undefined4 __fastcall
FUN_004524c8(undefined4 param_1,undefined4 param_2,undefined4 param_3,uint param_4)

{
  short sVar1;
  int iVar2;
  int *piVar3;
  undefined4 uVar4;
  undefined8 uVar5;
  
  iVar2 = DAT_004f0760;
  *(undefined2 *)(DAT_004f0760 + 6) = 5;
  *(undefined2 *)(iVar2 + 10) = 4;
  *(uint *)(iVar2 + 0xc) = param_4;
  uVar5 = FUN_00452100(param_1,param_2);
  uVar4 = (undefined4)uVar5;
  if (*(short *)(DAT_004f0760 + 8) != 0) {
    sVar1 = *(short *)(DAT_004f0760 + 8);
    FUN_004dbb24(&DAT_00524e20,s_NetNub_close_error_004f11c8,(char *)0x0);
    piVar3 = FUN_004db78c(&DAT_00524e20,(int)sVar1);
    FUN_004dbb24(piVar3,s_on_stream_004f11dc,(char *)0x0);
    piVar3 = FUN_004db880(piVar3,param_4);
    uVar4 = FUN_004dbb24(piVar3,&DAT_004f11e8,(char *)0x0);
  }
  return uVar4;
}



/* @0045255c file=? name=FUN_0045255c */

undefined4 __thiscall FUN_0045255c(void *this,undefined4 param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  undefined8 uVar3;
  
  uVar2 = 0;
  if (DAT_004f0760 != 0) {
    if (param_2 == 0) {
      *(undefined4 *)(DAT_004f0760 + 0xc) = 1;
    }
    else if (param_2 + -1 == 0) {
      this = (void *)0x0;
      *(undefined4 *)(DAT_004f0760 + 0xc) = 0;
    }
    iVar1 = DAT_004f0760;
    *(undefined2 *)(DAT_004f0760 + 6) = 0x11;
    *(undefined2 *)(iVar1 + 10) = 4;
    uVar3 = FUN_00452100(this,param_2 + -1);
    uVar2 = (undefined4)uVar3;
    if (*(short *)(DAT_004f0760 + 8) != 0) {
      uVar2 = FUN_004dbb24(&DAT_00524e20,s_NetNub_mode_call_failed_004f11ea,(char *)0x0);
    }
  }
  return uVar2;
}



/* @004525bc file=? name=FUN_004525bc */

undefined4 __cdecl FUN_004525bc(undefined4 param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 extraout_ECX;
  undefined4 extraout_EDX;
  undefined8 uVar4;
  
  uVar3 = 0;
  if (DAT_004f0760 != 0) {
    iVar2 = FUN_004d4a78(param_2);
    FUN_004d4918((undefined4 *)(DAT_004f0760 + 0xc),(undefined4 *)param_2,iVar2 + 1U);
    iVar1 = DAT_004f0760;
    *(undefined2 *)(DAT_004f0760 + 6) = 0xb;
    *(short *)(iVar1 + 10) = (short)(iVar2 + 1U);
    uVar4 = FUN_00452100(extraout_ECX,extraout_EDX);
    uVar3 = (undefined4)uVar4;
    if (*(short *)(DAT_004f0760 + 8) != 0) {
      uVar3 = FUN_004dbb24(&DAT_00524e20,s_NetNub_marker_text_call_failed_004f1203,(char *)0x0);
    }
  }
  return uVar3;
}



/* @00452624 file=? name=FUN_00452624 */

void __cdecl FUN_00452624(int param_1)

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



/* @00452640 file=? name=FUN_00452640 */

undefined4 * __cdecl FUN_00452640(undefined4 *param_1,undefined4 param_2,uint *param_3)

{
  undefined4 *puVar1;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004f1318;
  param_1[3] = param_2;
  puVar1 = (undefined4 *)FUN_004022b0(*param_3);
  param_1[4] = puVar1;
  FUN_004d4918(puVar1,param_3,*param_3);
  return param_1;
}



/* @00452688 file=? name=FUN_00452688 */

void __cdecl FUN_00452688(int *param_1,byte param_2)

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



/* @004526c0 file=? name=FUN_004526c0 */

undefined4 FUN_004526c0(void)

{
  return 1;
}



/* @004526cc file=? name=FUN_004526cc */

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

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



/* @00452700 file=? name=FUN_00452700 */

void __cdecl FUN_00452700(int *param_1,byte param_2)

{
  void *this;
  int local_10 [3];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f130c;
    FUN_00452b12(local_10,(int)(param_1 + 4));
    FUN_00417858(this,local_10,1);
    FUN_00452b6f(local_10,2);
    FUN_00452a3c(param_1 + 4,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0045276c file=? name=FUN_0045276c */

undefined4 FUN_0045276c(void)

{
  return 1;
}



/* @00452778 file=? name=FUN_00452778 */

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

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x14);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00452640(puVar1,param_2,param_3);
  }
  (**(code **)(*(int *)(param_1 + 0x10) + 4))(param_1 + 0x10,puVar1);
  return;
}



/* @004527b8 file=? name=FUN_004527b8 */

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

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004f1300;
  FUN_00452a68(param_1 + 4,0,1);
  param_1[3] = param_2;
  param_1[10] = 0;
  param_1[0xb] = 0;
  return param_1;
}



/* @004527f8 file=? name=FUN_004527f8 */

void __cdecl FUN_004527f8(int *param_1,byte param_2)

{
  void *this;
  int local_20 [7];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1300;
    FUN_00452b9b(local_20,(int)(param_1 + 4));
    FUN_00417858(this,local_20,1);
    FUN_00452bd9(local_20,2);
    FUN_00452a8b(param_1 + 4,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00452864 file=? name=FUN_00452864 */

undefined4 FUN_00452864(void)

{
  return 1;
}



/* @00452870 file=? name=FUN_00452870 */

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

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)(**(code **)(*(int *)(param_1 + 0x10) + 0xc))(param_1 + 0x10,&param_2);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)FUN_00402298(0x20);
    if (puVar1 == (undefined4 *)0x0) {
      puVar1 = (undefined4 *)0x0;
    }
    else {
      puVar1 = FUN_004526cc(puVar1,param_2);
    }
    (**(code **)(*(int *)(param_1 + 0x10) + 8))(param_1 + 0x10,puVar1,&param_2);
  }
  FUN_00452778((int)puVar1,param_3,param_4);
  *(int *)(param_1 + 0x2c) = *(int *)(param_1 + 0x2c) + 1;
  return;
}



/* @004528dc file=? name=FUN_004528dc */

void __cdecl FUN_004528dc(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  int local_2c [3];
  int local_20 [7];
  
  FUN_00452b9b(local_20,param_1 + 0x10);
  do {
    iVar1 = (**(code **)(local_20[0] + 0x14))(local_20);
    *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
    if (iVar1 <= *(int *)(param_1 + 0x28)) {
      *(undefined4 *)(param_1 + 0x28) = 0;
    }
    iVar1 = (**(code **)(local_20[0] + 0x34))(local_20,*(undefined4 *)(param_1 + 0x28));
    FUN_00452b12(local_2c,iVar1 + 0x10);
    puVar2 = (undefined4 *)(**(code **)(local_2c[0] + 0x30))(local_2c);
    FUN_00452b6f(local_2c,2);
  } while (puVar2 == (undefined4 *)0x0);
  iVar1 = FUN_00450fa8(*(int *)(param_1 + 0xc),(uint *)puVar2[4],puVar2[3]);
  if (iVar1 != 0) {
    if (puVar2 != (undefined4 *)0x0) {
      (**(code **)*puVar2)(puVar2,3);
    }
    *(int *)(param_1 + 0x2c) = *(int *)(param_1 + 0x2c) + -1;
  }
  FUN_00452bd9(local_20,2);
  return;
}



/* @00452a1d file=? name=FUN_00452a1d */

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

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



/* @00452a3c file=? name=FUN_00452a3c */

void __cdecl FUN_00452a3c(int *param_1,byte param_2)

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



/* @00452a68 file=? name=FUN_00452a68 */

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

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



/* @00452a8b file=? name=FUN_00452a8b */

void __cdecl FUN_00452a8b(int *param_1,byte param_2)

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



/* @00452ab7 file=? name=FUN_00452ab7 */

undefined4 __cdecl FUN_00452ab7(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;
}



/* @00452ae6 file=? name=FUN_00452ae6 */

undefined4 __cdecl FUN_00452ae6(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;
}



/* @00452b12 file=? name=FUN_00452b12 */

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

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



/* @00452b31 file=? name=FUN_00452b31 */

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

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



/* @00452b50 file=? name=FUN_00452b50 */

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

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



/* @00452b6f file=? name=FUN_00452b6f */

void __cdecl FUN_00452b6f(int *param_1,byte param_2)

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



/* @00452b9b file=? name=FUN_00452b9b */

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

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



/* @00452bba file=? name=FUN_00452bba */

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

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



/* @00452bd9 file=? name=FUN_00452bd9 */

void __cdecl FUN_00452bd9(int *param_1,byte param_2)

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



/* @00452c05 file=? name=FUN_00452c05 */

undefined4 * __cdecl FUN_00452c05(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;
}



/* @00452c38 file=? name=FUN_00452c38 */

void __cdecl FUN_00452c38(uint param_1)

{
  FUN_00401cf0(DAT_004f1ab0,param_1);
  return;
}



/* @00452c50 file=? name=FUN_00452c50 */

uint * __cdecl FUN_00452c50(int param_1,int param_2)

{
  uint *puVar1;
  
  puVar1 = FUN_00401cf0(DAT_004f1ab0,param_1 * param_2);
  FUN_004d4988(puVar1,0,param_2 * param_1);
  return puVar1;
}



/* @00452c88 file=? name=FUN_00452c88 */

void __cdecl FUN_00452c88(int *param_1)

{
  FUN_00401ec8(DAT_004f1ab0,param_1);
  return;
}



/* @00452ca0 file=? name=FUN_00452ca0 */

void FUN_00452ca0(void)

{
  FUN_00401f30(DAT_004f1ab0);
  return;
}



/* @00452cad file=? name=FUN_00452cad */

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

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



/* @00452ccc file=? name=FUN_00452ccc */

void __cdecl FUN_00452ccc(int *param_1,byte param_2)

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



/* @00452cf8 file=? name=FUN_00452cf8 */

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

{
  undefined4 uVar1;
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004f1a90;
  uVar1 = FUN_00489708();
  param_1[4] = uVar1;
  uVar1 = FUN_00489724();
  param_1[5] = uVar1;
  FUN_0048a714(param_1[4],param_3);
  FUN_0048ab0c(param_1[5],param_2);
  FUN_0048ad48(param_1[5],1);
  FUN_0048add4(param_1[5],0);
  FUN_0048ac30(param_1[5],1);
  FUN_00489e04(param_1[4],param_1[5]);
  FUN_00489ba8(param_1[4]);
  FUN_0048d5d4((undefined4 *)param_1[5]);
  FUN_0048d3e8((undefined4 *)param_1[4]);
  return param_1;
}



/* @00452da4 file=? name=FUN_00452da4 */

void __cdecl FUN_00452da4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1a90;
    FUN_0048a130(param_1[4],param_1[5]);
    FUN_00489e58(param_1[4]);
    FUN_004898f8((int *)param_1[5]);
    FUN_004898b8((int *)param_1[4]);
    param_1[4] = 0;
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00452e04 file=? name=FUN_00452e04 */

undefined4 __cdecl FUN_00452e04(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00452e18 file=? name=FUN_00452e18 */

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

{
  undefined4 *puVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1a78;
  FUN_0040aadc(param_1 + 8);
  puVar1 = FUN_00460c04(*(int *)(DAT_004efc94 + 0x48),param_4,param_5);
  param_1[7] = puVar1;
  puVar1 = (undefined4 *)FUN_0048a630(puVar1[4]);
  FUN_0040beb0(puVar1,(undefined4 *)(param_1[5] + 0xd0));
  FUN_0045fbf4(param_1[4],*(undefined4 *)(param_1[7] + 0x10));
  return param_1;
}



/* @00452e98 file=? name=FUN_00452e98 */

void __cdecl FUN_00452e98(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1a78;
    local_10 = 0;
    local_c = 0x461c4000;
    local_8 = 0;
    puVar1 = (undefined4 *)FUN_0048a630(*(int *)(param_1[7] + 0x10));
    FUN_0040c18c(puVar1,&local_10);
    FUN_0045fbf4(param_1[4],*(undefined4 *)(param_1[7] + 0x10));
    FUN_00460cb0(*(int *)(DAT_004efc94 + 0x48),param_1[7]);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00452f1c file=? name=FUN_00452f1c */

undefined4 __cdecl FUN_00452f1c(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00452f30 file=? name=FUN_00452f30 */

void __cdecl FUN_00452f30(int param_1)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  
  pfVar1 = (float *)(param_1 + 0x20);
  iVar2 = FUN_0040aff0(pfVar1,(float *)(*(int *)(param_1 + 0x14) + 0xd0));
  if (iVar2 != 0) {
    FUN_0040ab28(pfVar1,(undefined4 *)(*(int *)(param_1 + 0x14) + 0xd0));
    puVar3 = (undefined4 *)FUN_0048a630(*(int *)(*(int *)(param_1 + 0x1c) + 0x10));
    FUN_0040beb0(puVar3,pfVar1);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(*(int *)(param_1 + 0x1c) + 0x10));
  }
  return;
}



/* @00452f98 file=? name=FUN_00452f98 */

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

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  int *local_c;
  undefined4 *local_8;
  
  FUN_004530ec(param_1,param_2,0);
  *param_1 = &PTR_FUN_004f1a60;
  local_8 = (undefined4 *)FUN_00402298(0x10);
  if (local_8 == (undefined4 *)0x0) {
    iVar2 = 0;
  }
  else {
    iVar2 = FUN_004023f4(local_8);
  }
  param_1[7] = iVar2;
  piVar1 = (int *)(param_1[7] + 0xc);
  *piVar1 = *piVar1 + 1;
  if (param_4 == 1) {
    uVar3 = FUN_00460b04(*(int *)(DAT_004efc94 + 0x48),param_3);
    param_1[9] = uVar3;
    if (param_1[9] == 0) {
      iVar2 = FUN_00498448(*(char **)(*param_3 + 8),1);
      param_1[9] = iVar2;
    }
  }
  else {
    iVar2 = FUN_00498448(*(char **)(*param_3 + 8),param_4);
    param_1[9] = iVar2;
  }
  param_1[8] = param_4;
  FUN_00402a4c((int *)&local_c,param_1 + 7,param_3);
  piVar1 = local_c + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_c,3);
  }
  return param_1;
}



/* @00453068 file=? name=FUN_00453068 */

void __cdecl FUN_00453068(int *param_1,byte param_2)

{
  int *piVar1;
  int *piVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1a60;
    if (param_1[8] == 1) {
      FUN_00460b48(*(int *)(DAT_004efc94 + 0x48),param_1 + 7,param_1[9]);
    }
    param_1[9] = 0;
    piVar2 = (int *)param_1[7];
    piVar1 = piVar2 + 3;
    *piVar1 = *piVar1 + -1;
    if (*piVar1 == 0) {
      FUN_004024d8(piVar2,3);
    }
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004530d0 file=? name=FUN_004530d0 */

undefined4 __cdecl FUN_004530d0(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @004530e4 file=? name=FUN_004530e4 */

void FUN_004530e4(void)

{
  return;
}



/* @004530ec file=munga_l4/l4vidrnd.cpp name=FUN_004530ec */

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

{
  int iVar1;
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004f1a48;
  param_1[5] = param_2;
  param_1[6] = param_3;
  param_1[4] = *(undefined4 *)(DAT_004efc94 + 0x48);
  iVar1 = param_1[6];
  if (iVar1 == 0) {
    FUN_00420674(param_1[5],param_1);
  }
  else if (iVar1 == 1) {
    FUN_00420674(param_1[5],param_1);
    FUN_0045a744(param_1[4],param_1);
  }
  else if (iVar1 == 2) {
    FUN_00420674(param_1[5],param_1);
  }
  else if (iVar1 == 3) {
    FUN_00420674(param_1[5],param_1);
  }
  else {
    FUN_0040385c(s_VideoRenderable__Illegal_executi_004f1360,
                 s_d__tesla_bt_munga_l4_L4VIDRND_CP_004f1389,0x1b4);
  }
  return param_1;
}



/* @00453198 file=? name=FUN_00453198 */

void __cdecl FUN_00453198(int *param_1,byte param_2)

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



/* @004531c4 file=? name=FUN_004531c4 */

undefined4 __cdecl FUN_004531c4(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @004531d8 file=? name=FUN_004531d8 */

void FUN_004531d8(void)

{
  return;
}



/* @004531e0 file=? name=FUN_004531e0 */

undefined4 * __cdecl
FUN_004531e0(undefined4 *param_1,undefined4 param_2,undefined4 param_3,int param_4,
            undefined4 param_5,undefined4 *param_6,undefined4 param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
            undefined4 param_13)

{
  undefined4 *puVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  
  FUN_004530ec(param_1,param_2,param_3);
  puVar1 = param_1 + 0xb;
  *param_1 = &PTR_FUN_004f1a30;
  FUN_0040aadc(puVar1);
  param_1[10] = param_4;
  param_1[9] = param_5;
  FUN_0040ab28(puVar1,param_6);
  uVar2 = FUN_00489708();
  param_1[8] = uVar2;
  puVar3 = FUN_0048973c();
  param_1[7] = puVar3;
  FUN_0048b1e0((int)puVar3,param_12);
  FUN_0048b26c(param_1[7],param_7,param_8,param_9);
  FUN_0048b134(param_1[7],param_1[8]);
  FUN_0048b318(param_1[7],param_10,param_11);
  FUN_004905f0(param_1[7],param_13);
  FUN_00489cec(param_1[9],param_1[8]);
  FUN_0048a714(param_1[8],param_4);
  puVar3 = (undefined4 *)FUN_0048a630(param_1[8]);
  FUN_0040beb0(puVar3,puVar1);
  FUN_0048d478((undefined4 *)param_1[7]);
  FUN_0048d3e8((undefined4 *)param_1[8]);
  return param_1;
}



/* @004532dc file=? name=FUN_004532dc */

void __cdecl FUN_004532dc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1a30;
    FUN_004898b8((int *)param_1[8]);
    FUN_00489938((int *)param_1[7]);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0045331c file=? name=FUN_0045331c */

undefined4 __cdecl FUN_0045331c(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00453330 file=? name=FUN_00453330 */

void FUN_00453330(void)

{
  return;
}



/* @00453338 file=? name=FUN_00453338 */

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

{
  int iVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1a18;
  param_1[7] = param_4;
  param_1[8] = param_5;
  param_1[9] = param_6;
  param_1[10] = param_7;
  param_1[0xb] = 0;
  param_1[0xc] = 0;
  iVar1 = FUN_00489708();
  param_1[0xb] = iVar1;
  FUN_0048a714(iVar1,param_1[8]);
  if (param_1[7] != 0) {
    iVar1 = FUN_00489724();
    param_1[0xc] = iVar1;
    FUN_0048ab0c(iVar1,param_1[7]);
    FUN_0048ad48(param_1[0xc],param_1[9]);
    FUN_0048add4(param_1[0xc],param_1[10]);
    FUN_0048ac30(param_1[0xc],1);
    FUN_00489e04(param_1[0xb],param_1[0xc]);
    FUN_0048d5d4((undefined4 *)param_1[0xc]);
  }
  return param_1;
}



/* @004533fc file=? name=FUN_004533fc */

void __cdecl FUN_004533fc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1a18;
    if (param_1[0xc] != 0) {
      FUN_0048a130(param_1[0xb],param_1[0xc]);
      FUN_004898f8((int *)param_1[0xc]);
    }
    FUN_004898b8((int *)param_1[0xb]);
    param_1[0xb] = 0;
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00453458 file=? name=FUN_00453458 */

undefined4 __cdecl FUN_00453458(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @0045346c file=? name=FUN_0045346c */

void FUN_0045346c(void)

{
  return;
}



/* @00453474 file=? name=FUN_00453474 */

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

{
  int iVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1a00;
  param_1[7] = param_4;
  param_1[8] = param_6;
  param_1[9] = param_7;
  param_1[10] = param_5;
  iVar1 = FUN_00489724();
  param_1[0xb] = iVar1;
  FUN_0048ab0c(iVar1,param_1[7]);
  FUN_0048ad48(param_1[0xb],param_1[8]);
  FUN_0048add4(param_1[0xb],param_1[9]);
  FUN_0048ac30(param_1[0xb],param_8);
  FUN_00489e04(param_1[10],param_1[0xb]);
  FUN_0048d5d4((undefined4 *)param_1[0xb]);
  return param_1;
}



/* @00453514 file=? name=FUN_00453514 */

void __cdecl FUN_00453514(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1a00;
    FUN_0048a130(param_1[10],param_1[0xb]);
    FUN_004898f8((int *)param_1[0xb]);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0045355c file=? name=FUN_0045355c */

undefined4 __cdecl FUN_0045355c(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00453570 file=? name=FUN_00453570 */

void FUN_00453570(void)

{
  return;
}



/* @00453578 file=? name=FUN_00453578 */

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

{
  undefined4 *puVar1;
  
  FUN_00453338(param_1,param_2,param_3,param_4,param_5,param_6,param_7);
  *param_1 = &PTR_FUN_004f19e8;
  FUN_0040aadc(param_1 + 0xd);
  FUN_0040ab28(param_1 + 0xd,(undefined4 *)(param_1[5] + 0xd0));
  FUN_00489ba8(param_1[0xb]);
  puVar1 = (undefined4 *)FUN_0048a630(param_1[0xb]);
  FUN_0040beb0(puVar1,(undefined4 *)(param_1[5] + 0xd0));
  FUN_0048d3e8((undefined4 *)param_1[0xb]);
  return param_1;
}



/* @00453600 file=? name=FUN_00453600 */

void __cdecl FUN_00453600(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f19e8;
    FUN_00489e58(param_1[0xb]);
    FUN_004533fc(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00453638 file=? name=FUN_00453638 */

undefined4 __cdecl FUN_00453638(int param_1)

{
  FUN_00453458(param_1);
  return 1;
}



/* @0045364c file=? name=FUN_0045364c */

void __cdecl FUN_0045364c(int param_1)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  
  pfVar1 = (float *)(param_1 + 0x34);
  iVar2 = FUN_0040aff0(pfVar1,(float *)(*(int *)(param_1 + 0x14) + 0xd0));
  if (iVar2 != 0) {
    FUN_0040ab28(pfVar1,(undefined4 *)(*(int *)(param_1 + 0x14) + 0xd0));
    puVar3 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
    FUN_0040beb0(puVar3,pfVar1);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x2c));
  }
  FUN_0045346c();
  return;
}



/* @004536b4 file=? name=FUN_004536b4 */

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

{
  undefined4 *puVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  
  FUN_00453338(param_1,param_2,param_3,param_4,param_5,param_6,param_7);
  puVar1 = param_1 + 0xd;
  *param_1 = &PTR_FUN_004f19d0;
  FUN_0040aadc(puVar1);
  FUN_0040ab28(puVar1,param_9);
  param_1[0x1a] = 0;
  param_1[0x19] = param_8;
  uVar2 = FUN_00489708();
  param_1[0x1a] = uVar2;
  FUN_0048a714(param_1[0xb],param_1[8]);
  FUN_00489cec(param_1[0x1a],param_1[0xb]);
  FUN_00489cec(param_1[0x19],param_1[0x1a]);
  puVar3 = (undefined4 *)FUN_0048a630(param_1[0x1a]);
  FUN_0040beb0(puVar3,puVar1);
  FUN_0048d3e8((undefined4 *)param_1[0x1a]);
  return param_1;
}



/* @00453768 file=? name=FUN_00453768 */

void __cdecl FUN_00453768(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f19d0;
    FUN_0048a068(param_1[0x19],param_1[0x1a]);
    FUN_0048a068(param_1[0x1a],param_1[0xb]);
    FUN_004898b8((int *)param_1[0x1a]);
    param_1[0x1a] = 0;
    FUN_004533fc(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004537c4 file=? name=FUN_004537c4 */

undefined4 __cdecl FUN_004537c4(int param_1)

{
  FUN_00453458(param_1);
  return 1;
}



/* @004537d8 file=? name=FUN_004537d8 */

void FUN_004537d8(void)

{
  FUN_0045346c();
  return;
}



/* @004537e8 file=? name=FUN_004537e8 */

undefined4 * __cdecl
FUN_004537e8(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 *param_9,undefined4 *param_10)

{
  int iVar1;
  float local_10;
  undefined4 local_c;
  undefined4 *local_8;
  
  FUN_004536b4(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  *param_1 = &PTR_FUN_004f19b8;
  param_1[0x1b] = param_10;
  local_8 = param_10 + 1;
  param_1[0x1c] = *param_10;
  param_1[0x1d] = *local_8;
  FUN_00408328(&local_10,(float *)(param_1[0x1b] + 4));
  iVar1 = *(int *)param_1[0x1b];
  if (iVar1 == 0) {
    FUN_0048fedc(param_1[0xb],local_10,local_c);
  }
  else if (iVar1 == 1) {
    FUN_0048ff04(param_1[0xb],local_10,local_c);
  }
  else if (iVar1 == 2) {
    FUN_0048ff2c(param_1[0xb],local_10,local_c);
  }
  FUN_0048d3e8((undefined4 *)param_1[0xb]);
  return param_1;
}



/* @004538b4 file=? name=FUN_004538b4 */

void __cdecl FUN_004538b4(int *param_1,byte param_2)

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



/* @004538e0 file=? name=FUN_004538e0 */

undefined4 __cdecl FUN_004538e0(int param_1)

{
  FUN_004537c4(param_1);
  return 1;
}



/* @004538f4 file=? name=FUN_004538f4 */

void __cdecl FUN_004538f4(int param_1)

{
  int iVar1;
  float local_10;
  undefined4 local_c;
  int *local_8;
  
  iVar1 = FUN_00408d78((int *)(param_1 + 0x70),*(int **)(param_1 + 0x6c),0.0001);
  if (iVar1 == 0) {
    local_8 = *(int **)(param_1 + 0x6c) + 1;
    *(int *)(param_1 + 0x70) = **(int **)(param_1 + 0x6c);
    *(int *)(param_1 + 0x74) = *local_8;
    FUN_00408328(&local_10,(float *)(*(int *)(param_1 + 0x6c) + 4));
    iVar1 = **(int **)(param_1 + 0x6c);
    if (iVar1 == 0) {
      FUN_0048fedc(*(int *)(param_1 + 0x2c),local_10,local_c);
    }
    else if (iVar1 == 1) {
      FUN_0048ff04(*(int *)(param_1 + 0x2c),local_10,local_c);
    }
    else if (iVar1 == 2) {
      FUN_0048ff2c(*(int *)(param_1 + 0x2c),local_10,local_c);
    }
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x2c));
  }
  FUN_004537d8();
  return;
}



/* @004539b4 file=? name=FUN_004539b4 */

undefined4 * __cdecl
FUN_004539b4(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 *param_9,undefined4 *param_10)

{
  float *pfVar1;
  
  FUN_004536b4(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  *param_1 = &PTR_FUN_004f19a0;
  param_1[0x1b] = param_10;
  FUN_00408e90(param_1 + 0x1c,param_10);
  pfVar1 = (float *)FUN_0048a630(param_1[0xb]);
  FUN_0040bf58(pfVar1,(float *)(param_1 + 0x1c));
  FUN_0048d3e8((undefined4 *)param_1[0xb]);
  return param_1;
}



/* @00453a24 file=? name=FUN_00453a24 */

void __cdecl FUN_00453a24(int *param_1,byte param_2)

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



/* @00453a50 file=? name=FUN_00453a50 */

undefined4 __cdecl FUN_00453a50(int param_1)

{
  FUN_004537c4(param_1);
  return 1;
}



/* @00453a64 file=? name=FUN_00453a64 */

void __cdecl FUN_00453a64(int param_1)

{
  float *pfVar1;
  int iVar2;
  float *pfVar3;
  
  pfVar1 = (float *)(param_1 + 0x70);
  iVar2 = FUN_004091f4(pfVar1,*(float **)(param_1 + 0x6c),0.0001);
  if (iVar2 == 0) {
    FUN_00408e90(pfVar1,*(undefined4 **)(param_1 + 0x6c));
    pfVar3 = (float *)FUN_0048a630(*(int *)(param_1 + 0x2c));
    FUN_0040bf58(pfVar3,pfVar1);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x2c));
  }
  FUN_004537d8();
  return;
}



/* @00453ac4 file=? name=FUN_00453ac4 */

undefined4 * __cdecl
FUN_00453ac4(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 *param_9,undefined4 *param_10,undefined4 *param_11)

{
  undefined4 *puVar1;
  float local_34 [12];
  
  FUN_004536b4(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  *param_1 = &PTR_FUN_004f1988;
  FUN_0040aadc(local_34);
  param_1[0x1f] = param_10;
  FUN_00408e90(param_1 + 0x20,param_10);
  param_1[0x1b] = param_11;
  FUN_00408440(param_1 + 0x1c,param_11);
  puVar1 = (undefined4 *)FUN_0048a630(param_1[0xb]);
  FUN_0040b0ac((int)local_34,3,param_1 + 0x1c);
  FUN_0040ac6c(local_34,(float *)(param_1 + 0x20));
  FUN_0040beb0(puVar1,local_34);
  FUN_0048d3e8((undefined4 *)param_1[0xb]);
  return param_1;
}



/* @00453b84 file=? name=FUN_00453b84 */

void __cdecl FUN_00453b84(int *param_1,byte param_2)

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



/* @00453bb0 file=? name=FUN_00453bb0 */

undefined4 __cdecl FUN_00453bb0(int param_1)

{
  FUN_004537c4(param_1);
  return 1;
}



/* @00453bc4 file=? name=FUN_00453bc4 */

void __cdecl FUN_00453bc4(int param_1)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  float local_34 [12];
  
  pfVar1 = (float *)(param_1 + 0x80);
  iVar2 = FUN_004091f4(pfVar1,*(float **)(param_1 + 0x7c),0.0001);
  if (iVar2 != 0) {
    iVar2 = FUN_004084fc((float *)(param_1 + 0x70),*(float **)(param_1 + 0x6c),0.0001);
    if (iVar2 != 0) goto LAB_00453c74;
  }
  FUN_00408e90(pfVar1,*(undefined4 **)(param_1 + 0x7c));
  FUN_00408440((undefined4 *)(param_1 + 0x70),*(undefined4 **)(param_1 + 0x6c));
  puVar3 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
  FUN_0040aadc(local_34);
  FUN_0040b0ac((int)local_34,3,(undefined4 *)(param_1 + 0x70));
  FUN_0040ac6c(local_34,pfVar1);
  FUN_0040beb0(puVar3,local_34);
  FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x2c));
LAB_00453c74:
  FUN_004537d8();
  return;
}



/* @00453c84 file=? name=FUN_00453c84 */

undefined4 * __cdecl
FUN_00453c84(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 *param_9,undefined4 param_10,undefined4 param_11,undefined4 *param_12,
            undefined4 param_13)

{
  float *pfVar1;
  undefined4 *puVar2;
  int iVar3;
  float *pfVar4;
  float *pfVar5;
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  FUN_004536b4(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  *param_1 = &PTR_FUN_004f1970;
  param_1[0x1b] = param_10;
  param_1[0x1c] = param_11;
  param_1[0x1d] = param_12;
  param_1[0x1f] = param_13;
  param_1[0x1e] = *param_12;
  param_1[0x20] = 0;
  puVar2 = (undefined4 *)FUN_0048a630(param_1[0xb]);
  FUN_0040aadc(local_34);
  pfVar1 = (float *)param_1[0x1c];
  pfVar4 = local_34;
  pfVar5 = local_64;
  for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
    *pfVar5 = *pfVar4;
    pfVar4 = pfVar4 + 1;
    pfVar5 = pfVar5 + 1;
  }
  FUN_0040b374(local_34,local_64,pfVar1);
  pfVar1 = (float *)param_1[0x1b];
  pfVar4 = local_34;
  pfVar5 = local_94;
  for (iVar3 = 0xc; iVar3 != 0; iVar3 = iVar3 + -1) {
    *pfVar5 = *pfVar4;
    pfVar4 = pfVar4 + 1;
    pfVar5 = pfVar5 + 1;
  }
  FUN_0040b3e8(local_34,local_94,pfVar1);
  FUN_0040beb0(puVar2,local_34);
  FUN_0048d3e8((undefined4 *)param_1[0xb]);
  FUN_0048ac30(param_1[0xc],param_1[0x1e]);
  FUN_0048d5d4((undefined4 *)param_1[0xc]);
  return param_1;
}



/* @00453d84 file=? name=FUN_00453d84 */

void __cdecl FUN_00453d84(int *param_1,byte param_2)

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



/* @00453db0 file=? name=FUN_00453db0 */

undefined4 __cdecl FUN_00453db0(int param_1)

{
  FUN_004537c4(param_1);
  return 1;
}



/* @00453dc4 file=? name=FUN_00453dc4 */

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

void __cdecl FUN_00453dc4(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  float *pfVar3;
  float *pfVar4;
  float *pfVar5;
  float local_b4 [12];
  float local_84 [12];
  float local_54 [4];
  float local_44 [12];
  undefined4 local_14;
  undefined4 local_10;
  int local_c;
  undefined4 local_8;
  
  iVar2 = **(int **)(param_1 + 0x74);
  if (iVar2 != *(int *)(param_1 + 0x78)) {
    *(int *)(param_1 + 0x78) = iVar2;
    FUN_0048ac30(*(int *)(param_1 + 0x30),iVar2);
    FUN_0048d5d4(*(undefined4 **)(param_1 + 0x30));
  }
  if (*(int *)(param_1 + 0x78) != 0) {
    *(float *)(param_1 + 0x80) = *(float *)(param_1 + 0x7c) + *(float *)(param_1 + 0x80);
    if (_DAT_00453f14 < *(float *)(param_1 + 0x80)) {
      *(float *)(param_1 + 0x80) = *(float *)(param_1 + 0x80) - _DAT_00453f14;
    }
    local_14 = *(undefined4 *)(param_1 + 0x80);
    local_c = 2;
    local_10 = local_14;
    local_8 = local_14;
    puVar1 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
    FUN_0040aadc(local_44);
    FUN_0040998c(local_54,&local_c);
    FUN_0040adec(local_44,local_54);
    pfVar4 = *(float **)(param_1 + 0x70);
    pfVar3 = local_44;
    pfVar5 = local_84;
    for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
      *pfVar5 = *pfVar3;
      pfVar3 = pfVar3 + 1;
      pfVar5 = pfVar5 + 1;
    }
    FUN_0040b374(local_44,local_84,pfVar4);
    FUN_00409968(local_54,*(undefined4 **)(param_1 + 0x6c));
    pfVar4 = local_44;
    pfVar3 = local_b4;
    for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
      *pfVar3 = *pfVar4;
      pfVar4 = pfVar4 + 1;
      pfVar3 = pfVar3 + 1;
    }
    FUN_0040b3e8(local_44,local_b4,local_54);
    FUN_0040beb0(puVar1,local_44);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x2c));
  }
  FUN_004537d8();
  return;
}



/* @00453f18 file=? name=FUN_00453f18 */

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

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1958;
  if (param_3 != 2) {
    FUN_004dbb24(&DAT_00524e20,s_POVTranslocateRenderable_wants_t_004f13ab,(char *)0x0);
  }
  param_1[0x11] = param_4;
  param_1[0x10] = param_5;
  param_1[0xe] = param_6;
  param_1[0xc] = param_7;
  param_1[8] = param_8;
  param_1[7] = 0;
  param_1[9] = 0;
  param_1[10] = 0x3e4ccccd;
  iVar1 = FUN_00498448(s_tsphere_bgf_004f13e6,0);
  uVar2 = FUN_00489724();
  param_1[0xd] = uVar2;
  iVar3 = FUN_00489708();
  param_1[0xf] = iVar3;
  FUN_00489cec(param_1[0xe],iVar3);
  FUN_0048a714(param_1[0xf],param_1[0x10]);
  FUN_0048ab0c(param_1[0xd],iVar1);
  FUN_0048ad48(param_1[0xd],1);
  FUN_0048add4(param_1[0xd],0);
  FUN_0048ac30(param_1[0xd],0);
  FUN_00489e04(param_1[0xf],param_1[0xd]);
  FUN_0048d5d4((undefined4 *)param_1[0xd]);
  FUN_0048d3e8((undefined4 *)param_1[0xf]);
  (**(code **)(*(int *)(param_1[0xc] + 0x2c) + 4))(param_1[0xc] + 0x2c,param_1);
  return param_1;
}



/* @00454038 file=? name=FUN_00454038 */

void __cdecl FUN_00454038(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1958;
    FUN_0048a068(param_1[0xe],param_1[0xf]);
    FUN_0048a130(param_1[0xf],param_1[0xd]);
    FUN_004898f8((int *)param_1[0xd]);
    FUN_004898b8((int *)param_1[0xf]);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00454098 file=? name=FUN_00454098 */

undefined4 __cdecl FUN_00454098(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @004540ac file=? name=FUN_004540ac */

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

void __cdecl FUN_004540ac(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  float10 fVar3;
  float local_8c [5];
  float local_78;
  float local_64;
  float local_5c;
  float local_58;
  undefined4 local_54;
  float local_50 [5];
  float local_3c;
  float local_28;
  float local_20;
  float local_1c;
  float local_18;
  float local_14;
  float local_10;
  float local_c;
  float local_8;
  
  local_c = *(float *)(*(int *)(param_1 + 0x10) + 0x80);
  iVar1 = *(int *)(*(int *)(param_1 + 0x30) + 0x14);
  switch(*(undefined4 *)(param_1 + 0x1c)) {
  case 0:
    if (iVar1 == *(int *)(param_1 + 0x20)) {
      *(undefined4 *)(param_1 + 0x1c) = 2;
      *(float *)(param_1 + 0x2c) = local_c + _DAT_00454374;
      FUN_0048ac30(*(int *)(param_1 + 0x34),1);
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0x34));
      FUN_0045a744(*(int *)(param_1 + 0x10),param_1);
    }
    break;
  case 1:
    *(undefined4 *)(param_1 + 0x1c) = 2;
    break;
  case 2:
    local_10 = (*(float *)(param_1 + 0x2c) - local_c) * _DAT_00454374;
    if (_DAT_00454378 < local_10) {
      local_18 = local_10 * _DAT_0045437c + _DAT_00454374;
    }
    else {
      local_18 = 1.0;
      FUN_0048a8d8(*(int *)(param_1 + 0x44));
      FUN_0048d4b0(*(undefined4 **)(param_1 + 0x44));
      *(float *)(param_1 + 0x2c) = local_c;
      *(undefined4 *)(param_1 + 0x1c) = 3;
    }
    FUN_0040aadc(local_50);
    local_50[0] = local_18;
    local_3c = local_18;
    local_28 = local_18;
    puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x3c));
    FUN_0040beb0(puVar2,local_50);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x3c));
    break;
  case 3:
    if (iVar1 == *(int *)(param_1 + 0x20)) {
      local_8 = local_c - *(float *)(param_1 + 0x2c);
      fVar3 = (float10)FUN_004dd0f4(SUB84((double)(local_8 * _DAT_00454380),0),
                                    (int)((ulonglong)(double)(local_8 * _DAT_00454380) >> 0x20));
      local_1c = (float)(fVar3 * (float10)_DAT_00454384);
      fVar3 = (float10)FUN_004dc9b4(SUB84((double)(local_8 * (float)_DAT_00454388),0),
                                    (int)((ulonglong)(double)(local_8 * (float)_DAT_00454388) >>
                                         0x20));
      local_5c = (float)(fVar3 * (float10)_DAT_00454384);
      local_58 = local_1c;
      local_54 = 0;
      local_20 = local_5c;
      puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x3c));
      FUN_0040c18c(puVar2,&local_5c);
      FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x3c));
    }
    else {
      FUN_0048a890(*(int *)(param_1 + 0x44));
      FUN_0048d4b0(*(undefined4 **)(param_1 + 0x44));
      *(undefined4 *)(param_1 + 0x1c) = 4;
      *(float *)(param_1 + 0x2c) = local_c + _DAT_00454374;
    }
    break;
  case 4:
    if (iVar1 == *(int *)(param_1 + 0x20)) {
      *(undefined4 *)(param_1 + 0x1c) = 2;
      *(float *)(param_1 + 0x2c) = local_c + _DAT_00454374;
    }
    local_14 = _DAT_00454374 - (*(float *)(param_1 + 0x2c) - local_c) * _DAT_00454374;
    if (local_14 < _DAT_00454374) {
      local_18 = local_14 * _DAT_00454390 + _DAT_00454374;
    }
    else {
      FUN_0048ac30(*(int *)(param_1 + 0x34),0);
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0x34));
      *(undefined4 *)(param_1 + 0x1c) = 0;
      local_18 = 1.0;
      FUN_0045a764(*(int *)(param_1 + 0x10),param_1);
    }
    FUN_0040aadc(local_8c);
    local_8c[0] = local_18;
    local_78 = local_18;
    local_64 = local_18;
    puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x3c));
    FUN_0040beb0(puVar2,local_8c);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x3c));
  }
  return;
}



/* @00454394 file=? name=FUN_00454394 */

undefined4 * __cdecl
FUN_00454394(undefined4 *param_1,undefined4 param_2,int param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
            undefined4 param_13,undefined4 param_14)

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1940;
  if (param_3 != 2) {
    FUN_004dbb24(&DAT_00524e20,s_POVStartEndRenderable_wants_to_b_004f13f2,(char *)0x0);
  }
  param_1[0x12] = param_4;
  param_1[0x11] = param_5;
  param_1[0x10] = param_7;
  param_1[0x13] = param_6;
  param_1[7] = 0;
  param_1[10] = param_8;
  param_1[0xb] = param_9;
  param_1[0xc] = param_10;
  param_1[0xd] = param_11;
  param_1[0xe] = param_12;
  param_1[8] = param_13;
  param_1[9] = param_14;
  FUN_0045a7a8(param_1[4],1);
  (**(code **)(*(int *)(param_1[0x10] + 0x2c) + 4))(param_1[0x10] + 0x2c,param_1);
  return param_1;
}



/* @0045443c file=? name=FUN_0045443c */

void __cdecl FUN_0045443c(int *param_1,byte param_2)

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



/* @00454468 file=? name=FUN_00454468 */

undefined4 __cdecl FUN_00454468(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @0045447c file=? name=FUN_0045447c */

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

void __cdecl FUN_0045447c(int param_1)

{
  int iVar1;
  float fVar2;
  float local_c;
  
  iVar1 = *(int *)(*(int *)(param_1 + 0x40) + 0x14);
  fVar2 = *(float *)(*(int *)(param_1 + 0x10) + 0x80);
  switch(*(undefined4 *)(param_1 + 0x1c)) {
  case 0:
    FUN_0045a7a8(*(int *)(param_1 + 0x10),1);
    if (iVar1 == *(int *)(param_1 + 0x20)) {
      *(undefined4 *)(param_1 + 0x1c) = 1;
      *(float *)(param_1 + 0x3c) = fVar2 + _DAT_00454740;
      FUN_0048b6b4(*(int *)(param_1 + 0x4c),5,0x3f800000,0x3f800000,0x3f800000,0x3c23d70a,0x3d4ccccd
                  );
      FUN_0048d42c(*(undefined4 **)(param_1 + 0x4c));
      FUN_0045a744(*(int *)(param_1 + 0x10),param_1);
    }
    break;
  case 1:
    if (*(float *)(param_1 + 0x3c) <= fVar2) {
      *(float *)(param_1 + 0x3c) = fVar2 + _DAT_00454744;
      *(undefined4 *)(param_1 + 0x1c) = 2;
    }
    break;
  case 2:
    local_c = (*(float *)(param_1 + 0x3c) - fVar2) * _DAT_00454744;
    if (local_c <= _DAT_00454748) {
      local_c = 0.0;
      *(undefined4 *)(param_1 + 0x1c) = 3;
      FUN_0045a7a8(*(int *)(param_1 + 0x10),0);
      FUN_0045a764(*(int *)(param_1 + 0x10),param_1);
    }
    fVar2 = _DAT_00454744 - local_c;
    FUN_0045a954(*(int *)(param_1 + 0x10),(undefined4 *)(param_1 + 0x28),
                 (undefined4 *)(param_1 + 0x2c),(undefined4 *)(param_1 + 0x30),
                 (undefined4 *)(param_1 + 0x34),(undefined4 *)(param_1 + 0x38));
    FUN_0048b6b4(*(int *)(param_1 + 0x4c),5,
                 (_DAT_00454744 - *(float *)(param_1 + 0x28)) * local_c + *(float *)(param_1 + 0x28)
                 ,(_DAT_00454744 - *(float *)(param_1 + 0x2c)) * local_c +
                  *(float *)(param_1 + 0x2c),
                 (_DAT_00454744 - *(float *)(param_1 + 0x30)) * local_c + *(float *)(param_1 + 0x30)
                 ,*(float *)(param_1 + 0x34) * fVar2 + _DAT_00454750,
                 *(float *)(param_1 + 0x38) * fVar2 + _DAT_0045474c);
    FUN_0048d42c(*(undefined4 **)(param_1 + 0x4c));
    break;
  case 3:
    if (iVar1 == *(int *)(param_1 + 0x24)) {
      *(undefined4 *)(param_1 + 0x1c) = 4;
      *(float *)(param_1 + 0x3c) = fVar2 + _DAT_00454744;
      FUN_0045a7a8(*(int *)(param_1 + 0x10),1);
      FUN_0045a744(*(int *)(param_1 + 0x10),param_1);
    }
    break;
  case 4:
    local_c = (*(float *)(param_1 + 0x3c) - fVar2) * _DAT_00454744;
    if (local_c <= _DAT_00454748) {
      *(undefined4 *)(param_1 + 0x1c) = 0;
      local_c = 0.0;
      FUN_0045a764(*(int *)(param_1 + 0x10),param_1);
    }
    FUN_0045a954(*(int *)(param_1 + 0x10),(undefined4 *)(param_1 + 0x28),
                 (undefined4 *)(param_1 + 0x2c),(undefined4 *)(param_1 + 0x30),
                 (undefined4 *)(param_1 + 0x34),(undefined4 *)(param_1 + 0x38));
    FUN_0048b6b4(*(int *)(param_1 + 0x4c),5,*(float *)(param_1 + 0x28) * local_c,
                 *(float *)(param_1 + 0x2c) * local_c,*(float *)(param_1 + 0x30) * local_c,
                 *(float *)(param_1 + 0x34) * local_c + _DAT_00454750,
                 *(float *)(param_1 + 0x38) * local_c + _DAT_0045474c);
    FUN_0048d42c(*(undefined4 **)(param_1 + 0x4c));
  }
  return;
}



/* @00454924 file=? name=FUN_00454924 */

void __cdecl FUN_00454924(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1928;
    FUN_00488ab4(param_1[0xc],0);
    FUN_0048d42c((undefined4 *)param_1[0xc]);
    FUN_00487f78((int *)param_1[0xd]);
    FUN_00487f78((int *)param_1[0xe]);
    *(undefined4 *)param_1[10] = 0;
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00454984 file=? name=FUN_00454984 */

undefined4 __cdecl FUN_00454984(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00454998 file=? name=FUN_00454998 */

void __cdecl FUN_00454998(int param_1)

{
  int iVar1;
  undefined4 local_1c [6];
  
  iVar1 = *(int *)(*(int *)(param_1 + 0x2c) + 8);
  if (iVar1 != *(int *)(param_1 + 0x24)) {
    *(int *)(param_1 + 0x24) = iVar1;
    if (iVar1 == 0) {
      FUN_00488ab4(*(int *)(param_1 + 0x30),0);
      FUN_0048d42c(*(undefined4 **)(param_1 + 0x30));
    }
    else if (iVar1 == 1) {
      FUN_00488ab4(*(int *)(param_1 + 0x30),*(undefined4 *)(param_1 + 0x34));
      FUN_0048d42c(*(undefined4 **)(param_1 + 0x30));
    }
  }
  iVar1 = FUN_0045961f((float *)(param_1 + 0x1c),*(float **)(param_1 + 0x2c),0.0001);
  if (iVar1 == 0) {
    *(undefined4 *)(param_1 + 0x1c) = **(undefined4 **)(param_1 + 0x2c);
    *(undefined4 *)(param_1 + 0x20) = (*(undefined4 **)(param_1 + 0x2c))[1];
    FUN_00487fbc(*(int *)(param_1 + 0x38),1);
    FUN_00488b80(local_1c);
    FUN_00488bac((int)local_1c,*(float *)(param_1 + 0x1c),*(float *)(param_1 + 0x20));
    FUN_00488718(*(int *)(param_1 + 0x38),local_1c);
    FUN_00488030(*(int *)(param_1 + 0x38));
    FUN_00488054(*(byte **)(param_1 + 0x38));
  }
  return;
}



/* @00454a70 file=? name=FUN_00454a70 */

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

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

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  int *piVar4;
  int local_40 [3];
  int local_34 [3];
  int local_28 [3];
  int local_1c [3];
  float local_10;
  int local_c;
  undefined4 local_8;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_LAB_004f1910;
  iVar1 = FUN_00498448(s_PNAME1_bgf_004f142a,0);
  param_1[0xe] = iVar1;
  iVar1 = FUN_00498448(s_PNAME2_bgf_004f1435,0);
  param_1[0xf] = iVar1;
  iVar1 = FUN_00498448(s_PNAME3_bgf_004f1440,0);
  param_1[0x10] = iVar1;
  iVar1 = FUN_00498448(s_PNAME4_bgf_004f144b,0);
  param_1[0x11] = iVar1;
  iVar1 = FUN_00498448(s_PNAME5_bgf_004f1456,0);
  param_1[0x12] = iVar1;
  iVar1 = FUN_00498448(s_PNAME6_bgf_004f1461,0);
  param_1[0x13] = iVar1;
  iVar1 = FUN_00498448(s_PNAME7_bgf_004f146c,0);
  param_1[0x14] = iVar1;
  iVar1 = FUN_00498448(s_PNAME8_bgf_004f1477,0);
  param_1[0x15] = iVar1;
  iVar1 = FUN_00498448(s_PLACE1_bgf_004f1482,0);
  param_1[0x1a] = iVar1;
  iVar1 = FUN_00498448(s_PLACE2_bgf_004f148d,0);
  param_1[0x1b] = iVar1;
  iVar1 = FUN_00498448(s_PLACE3_bgf_004f1498,0);
  param_1[0x1c] = iVar1;
  iVar1 = FUN_00498448(s_PLACE4_bgf_004f14a3,0);
  param_1[0x1d] = iVar1;
  iVar1 = FUN_00498448(s_PLACE5_bgf_004f14ae,0);
  param_1[0x1e] = iVar1;
  iVar1 = FUN_00498448(s_PLACE6_bgf_004f14b9,0);
  param_1[0x1f] = iVar1;
  iVar1 = FUN_00498448(s_PLACE7_bgf_004f14c4,0);
  param_1[0x20] = iVar1;
  iVar1 = FUN_00498448(s_PLACE8_bgf_004f14cf,0);
  param_1[0x21] = iVar1;
  param_1[9] = param_4;
  param_1[8] = 0xffffffff;
  uVar2 = FUN_00489708();
  param_1[0x26] = uVar2;
  uVar2 = FUN_00489724();
  param_1[0x28] = uVar2;
  FUN_00491cc4(param_1[0x26],0.2,0x3e4ccccd,0x3f800000);
  FUN_00491c58(param_1[0x26],0,0xbe19999a,0xbf000000);
  FUN_004901a0(param_1[0x26],1);
  FUN_0048fe54(param_1[0x26],7);
  FUN_00489ba8(param_1[0x26]);
  FUN_0048ab0c(param_1[0x28],param_1[0xe]);
  FUN_00489e04(param_1[0x26],param_1[0x28]);
  FUN_0048ac30(param_1[0x28],1);
  FUN_0048d5d4((undefined4 *)param_1[0x28]);
  FUN_0048d3e8((undefined4 *)param_1[0x26]);
  uVar2 = FUN_00489708();
  param_1[0x27] = uVar2;
  uVar2 = FUN_00489724();
  param_1[0x29] = uVar2;
  FUN_00489cec(param_1[0x26],param_1[0x27]);
  FUN_0048ab0c(param_1[0x29],param_1[0x1a]);
  FUN_00489e04(param_1[0x27],param_1[0x29]);
  FUN_004901a0(param_1[0x27],1);
  FUN_0048fe54(param_1[0x27],7);
  FUN_00491c58(param_1[0x27],0xbf400000,0,0);
  FUN_0048ac30(param_1[0x29],0);
  FUN_0048d5d4((undefined4 *)param_1[0x29]);
  FUN_0048d3e8((undefined4 *)param_1[0x27]);
  param_1[0xc] = param_5;
  param_1[0xd] = 0;
  local_8 = 0x3e23d70a;
  iVar1 = FUN_00489708();
  param_1[0x2a] = iVar1;
  FUN_00491cc4(iVar1,0.12,0x3df5c28f,0x3f800000);
  FUN_00491c58(param_1[0x2a],0x3e6147ae,local_8,0xbf000000);
  FUN_004901a0(param_1[0x2a],1);
  FUN_0048fe54(param_1[0x2a],7);
  FUN_00489ba8(param_1[0x2a]);
  FUN_0048d3e8((undefined4 *)param_1[0x2a]);
  param_1[10] = 0;
  param_1[0xb] = 0;
  param_1[0x2b] = 0;
  param_1[0x2c] = 0;
  param_1[0x2d] = 0;
  param_1[0x2e] = 0;
  param_1[7] = 0;
  iVar1 = *(int *)(DAT_004efc94 + 0x24);
  iVar3 = FUN_00403ad0(iVar1 + 0x18,s_Players_004f14da);
  if (iVar3 != 0) {
    FUN_00421414(local_1c,iVar3 + 0x10);
    uVar2 = (**(code **)(local_1c[0] + 0x14))(local_1c);
    param_1[7] = uVar2;
    FUN_00421452(local_1c,2);
  }
  local_c = FUN_00403ad0(iVar1 + 0x18,s_CameraPlayers_004f14e2);
  iVar1 = 0;
  if (local_c != 0) {
    FUN_00421414(local_28,local_c + 0x10);
    iVar1 = (**(code **)(local_28[0] + 0x14))(local_28);
    FUN_00421452(local_28,2);
  }
  if (param_1[7] != 0) {
    iVar1 = iVar1 + param_1[7];
    uVar2 = FUN_004022b0(iVar1 * 4);
    param_1[10] = uVar2;
    if (iVar3 != 0) {
      FUN_00421414(local_34,iVar3 + 0x10);
      while( true ) {
        iVar3 = (**(code **)(local_34[0] + 0x28))(local_34);
        if (iVar3 == 0) break;
        *(int *)(param_1[10] + -4 + *(int *)(iVar3 + 0x1e0) * 4) = iVar3 + 0x1cc;
      }
      FUN_00421452(local_34,2);
    }
    if (local_c != 0) {
      FUN_00421414(local_40,local_c + 0x10);
      while( true ) {
        iVar3 = (**(code **)(local_40[0] + 0x28))(local_40);
        if (iVar3 == 0) break;
        *(int *)(param_1[10] + -4 + *(int *)(iVar3 + 0x1e0) * 4) = iVar3 + 0x1cc;
      }
      FUN_00421452(local_40,2);
    }
    uVar2 = FUN_004022b0(iVar1 * 4);
    param_1[0xb] = uVar2;
    iVar3 = 0;
    if (0 < iVar1) {
      do {
        *(undefined4 *)(param_1[0xb] + iVar3 * 4) = 0xffffffff;
        iVar3 = iVar3 + 1;
      } while (iVar3 < iVar1);
    }
    uVar2 = FUN_004022b0(param_1[7] << 2);
    param_1[0x2b] = uVar2;
    uVar2 = FUN_004022b0(param_1[7] << 2);
    param_1[0x2c] = uVar2;
    uVar2 = FUN_004022b0(param_1[7] << 2);
    param_1[0x2d] = uVar2;
    uVar2 = FUN_004022b0(param_1[7] << 2);
    param_1[0x2e] = uVar2;
    piVar4 = param_1 + 0xe;
    for (iVar1 = 0; iVar1 < (int)param_1[7]; iVar1 = iVar1 + 1) {
      local_10 = -((float)iVar1 * (float)_DAT_004551b8);
      uVar2 = FUN_00489708();
      *(undefined4 *)(param_1[0x2b] + iVar1 * 4) = uVar2;
      uVar2 = FUN_00489724();
      *(undefined4 *)(param_1[0x2d] + iVar1 * 4) = uVar2;
      FUN_00489cec(param_1[0x2a],*(int *)(param_1[0x2b] + iVar1 * 4));
      FUN_0048ab0c(*(int *)(param_1[0x2d] + iVar1 * 4),*piVar4);
      FUN_004901a0(*(int *)(param_1[0x2b] + iVar1 * 4),1);
      FUN_0048fe54(*(int *)(param_1[0x2b] + iVar1 * 4),7);
      FUN_00491c58(*(int *)(param_1[0x2b] + iVar1 * 4),0,local_10,0);
      FUN_00489e04(*(int *)(param_1[0x2b] + iVar1 * 4),*(int *)(param_1[0x2d] + iVar1 * 4));
      FUN_0048ac30(*(int *)(param_1[0x2d] + iVar1 * 4),0);
      FUN_0048d5d4(*(undefined4 **)(param_1[0x2d] + iVar1 * 4));
      FUN_0048d3e8(*(undefined4 **)(param_1[0x2b] + iVar1 * 4));
      uVar2 = FUN_00489708();
      *(undefined4 *)(param_1[0x2c] + iVar1 * 4) = uVar2;
      uVar2 = FUN_00489724();
      *(undefined4 *)(param_1[0x2e] + iVar1 * 4) = uVar2;
      FUN_00489cec(*(int *)(param_1[0x2b] + iVar1 * 4),*(int *)(param_1[0x2c] + iVar1 * 4));
      FUN_0048ab0c(*(int *)(param_1[0x2e] + iVar1 * 4),piVar4[0xc]);
      FUN_00489e04(*(int *)(param_1[0x2c] + iVar1 * 4),*(int *)(param_1[0x2e] + iVar1 * 4));
      FUN_004901a0(*(int *)(param_1[0x2c] + iVar1 * 4),1);
      FUN_0048fe54(*(int *)(param_1[0x2c] + iVar1 * 4),7);
      FUN_00491c58(*(int *)(param_1[0x2c] + iVar1 * 4),0xbf400000,0,0);
      FUN_0048ac30(*(int *)(param_1[0x2e] + iVar1 * 4),0);
      FUN_0048d5d4(*(undefined4 **)(param_1[0x2e] + iVar1 * 4));
      FUN_0048d3e8(*(undefined4 **)(param_1[0x2c] + iVar1 * 4));
      piVar4 = piVar4 + 1;
    }
  }
  return param_1;
}



/* @004553ac file=? name=FUN_004553ac */

void __cdecl FUN_004553ac(int param_1)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  
  if ((*(int *)(param_1 + 0x1c) != 0) && (0 < **(int **)(param_1 + 0x24))) {
    iVar2 = **(int **)(param_1 + 0x24) + -1;
    if ((iVar2 != *(int *)(param_1 + 0x20)) && (*(int *)(param_1 + 0x20) = iVar2, iVar2 < 8)) {
      FUN_0048ab0c(*(int *)(param_1 + 0xa0),*(int *)(param_1 + 0x38 + iVar2 * 4));
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0xa0));
      FUN_0048ab0c(*(int *)(param_1 + 0xa4),
                   *(int *)(param_1 + 0x68 +
                           **(int **)(*(int *)(param_1 + 0x28) + *(int *)(param_1 + 0x20) * 4) * 4))
      ;
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0xa4));
    }
    piVar3 = (int *)(param_1 + 0x38);
    for (iVar2 = 0; iVar2 < *(int *)(param_1 + 0x1c); iVar2 = iVar2 + 1) {
      iVar1 = **(int **)(*(int *)(param_1 + 0x28) + iVar2 * 4);
      if (iVar1 != *(int *)(*(int *)(param_1 + 0x2c) + iVar2 * 4)) {
        *(int *)(*(int *)(param_1 + 0x2c) + iVar2 * 4) = iVar1;
        FUN_0048ab0c(*(int *)(*(int *)(param_1 + 0xb4) +
                             *(int *)(*(int *)(param_1 + 0x2c) + iVar2 * 4) * 4),*piVar3);
        FUN_0048d5d4(*(undefined4 **)
                      (*(int *)(param_1 + 0xb4) + *(int *)(*(int *)(param_1 + 0x2c) + iVar2 * 4) * 4
                      ));
      }
      piVar3 = piVar3 + 1;
    }
    if (**(int **)(param_1 + 0x30) != *(int *)(param_1 + 0x34)) {
      *(int *)(param_1 + 0x34) = **(int **)(param_1 + 0x30);
      for (iVar2 = 0; iVar2 < *(int *)(param_1 + 0x1c); iVar2 = iVar2 + 1) {
        if (*(int *)(param_1 + 0x34) == 0) {
          FUN_0048ac30(*(int *)(*(int *)(param_1 + 0xb4) + iVar2 * 4),0);
          FUN_0048ac30(*(int *)(*(int *)(param_1 + 0xb8) + iVar2 * 4),0);
        }
        else {
          FUN_0048ac30(*(int *)(*(int *)(param_1 + 0xb4) + iVar2 * 4),1);
          FUN_0048ac30(*(int *)(*(int *)(param_1 + 0xb8) + iVar2 * 4),1);
        }
        FUN_0048d5d4(*(undefined4 **)(*(int *)(param_1 + 0xb4) + iVar2 * 4));
        FUN_0048d5d4(*(undefined4 **)(*(int *)(param_1 + 0xb8) + iVar2 * 4));
      }
    }
    if ((*(int *)(DAT_004efc94 + 0x88) == 7) || (*(int *)(DAT_004efc94 + 0x88) == 6)) {
      FUN_0048ac30(*(int *)(param_1 + 0xa4),0);
      FUN_0048ac30(*(int *)(param_1 + 0xa0),0);
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0xa4));
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0xa0));
    }
  }
  return;
}



/* @00455584 file=? name=FUN_00455584 */

undefined4 __cdecl FUN_00455584(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00455598 file=? name=FUN_00455598 */

undefined4 * __cdecl
FUN_00455598(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 *param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11)

{
  int iVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f18f8;
  param_1[0xc] = param_4;
  param_1[10] = param_5;
  param_1[0xb] = param_6;
  param_1[9] = param_7;
  param_1[8] = *param_7;
  param_1[7] = param_8;
  param_1[0xd] = param_9;
  param_1[0xe] = param_10;
  param_1[0xf] = param_11;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  iVar1 = FUN_00489708();
  param_1[0x10] = iVar1;
  FUN_0048a714(iVar1,param_1[0xd]);
  iVar1 = FUN_00489724();
  param_1[0x11] = iVar1;
  FUN_0048ab0c(iVar1,param_1[0xc]);
  FUN_0048ad48(param_1[0x11],param_1[0xe]);
  FUN_0048add4(param_1[0x11],param_1[0xf]);
  FUN_0048ac30(param_1[0x11],1);
  FUN_00489e04(param_1[0x10],param_1[0x11]);
  FUN_0048d5d4((undefined4 *)param_1[0x11]);
  FUN_004904dc(param_1[0xc],param_1[10],param_1[0xb],param_1[8],param_1[7]);
  return param_1;
}



/* @00455690 file=? name=FUN_00455690 */

void __cdecl FUN_00455690(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f18f8;
    FUN_0048a130(param_1[0x10],param_1[0x11]);
    FUN_004898f8((int *)param_1[0x11]);
    FUN_004898b8((int *)param_1[0x10]);
    param_1[0x10] = 0;
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004556e8 file=? name=FUN_004556e8 */

undefined4 __cdecl FUN_004556e8(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @004556fc file=? name=FUN_004556fc */

void __cdecl FUN_004556fc(int param_1)

{
  if (*(float *)(param_1 + 0x20) != **(float **)(param_1 + 0x24)) {
    *(undefined4 *)(param_1 + 0x20) = **(undefined4 **)(param_1 + 0x24);
    FUN_004904dc(*(int *)(param_1 + 0x30),*(int *)(param_1 + 0x28),*(int *)(param_1 + 0x2c),
                 *(undefined4 *)(param_1 + 0x20),*(undefined4 *)(param_1 + 0x1c));
  }
  return;
}



/* @00455734 file=? name=FUN_00455734 */

undefined4 * __cdecl
FUN_00455734(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 *param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11)

{
  undefined4 *puVar1;
  
  FUN_00455598(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,
               param_11);
  *param_1 = &PTR_FUN_004f18e0;
  FUN_0040aadc(param_1 + 0x12);
  FUN_0040ab28(param_1 + 0x12,(undefined4 *)(param_1[5] + 0xd0));
  FUN_00489ba8(param_1[0x10]);
  puVar1 = (undefined4 *)FUN_0048a630(param_1[0x10]);
  FUN_0040beb0(puVar1,(undefined4 *)(param_1[5] + 0xd0));
  FUN_0048d3e8((undefined4 *)param_1[0x10]);
  return param_1;
}



/* @004557cc file=? name=FUN_004557cc */

void __cdecl FUN_004557cc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f18e0;
    FUN_00489e58(param_1[0x10]);
    FUN_00455690(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00455804 file=? name=FUN_00455804 */

undefined4 __cdecl FUN_00455804(int param_1)

{
  FUN_004556e8(param_1);
  return 1;
}



/* @00455818 file=? name=FUN_00455818 */

void __cdecl FUN_00455818(int param_1)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  
  pfVar1 = (float *)(param_1 + 0x48);
  iVar2 = FUN_0040aff0(pfVar1,(float *)(*(int *)(param_1 + 0x14) + 0xd0));
  if (iVar2 != 0) {
    FUN_0040ab28(pfVar1,(undefined4 *)(*(int *)(param_1 + 0x14) + 0xd0));
    puVar3 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x40));
    FUN_0040beb0(puVar3,pfVar1);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x40));
  }
  FUN_004556fc(param_1);
  return;
}



/* @00455880 file=? name=FUN_00455880 */

undefined4 * __cdecl
FUN_00455880(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 *param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11,int param_12)

{
  FUN_00455598(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,
               param_11);
  *param_1 = &PTR_FUN_004f18c8;
  FUN_00489cec(param_12,param_1[0x10]);
  FUN_0048d3e8((undefined4 *)param_1[0x10]);
  return param_1;
}



/* @004558e0 file=? name=FUN_004558e0 */

void __cdecl FUN_004558e0(int *param_1,byte param_2)

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



/* @0045590c file=? name=FUN_0045590c */

undefined4 __cdecl FUN_0045590c(int param_1)

{
  FUN_004556e8(param_1);
  return 1;
}



/* @00455920 file=? name=FUN_00455920 */

void __cdecl FUN_00455920(int param_1)

{
  FUN_004556fc(param_1);
  return;
}



/* @00455930 file=? name=FUN_00455930 */

undefined4 * __cdecl
FUN_00455930(undefined4 *param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 *param_9,undefined4 *param_10,undefined4 *param_11,undefined4 param_12,
            undefined4 param_13)

{
  undefined4 *puVar1;
  int iVar2;
  float *pfVar3;
  float *pfVar4;
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  FUN_004536b4(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9);
  *param_1 = &PTR_FUN_004f18b0;
  param_1[0x24] = 0x3c23d70a;
  param_1[0x25] = 0x3c23d70a;
  param_1[0x26] = 0x3c23d70a;
  FUN_00408440(param_1 + 0x27,param_10);
  FUN_00408440(param_1 + 0x21,param_11);
  param_1[0x1d] = param_12;
  param_1[0x1c] = 0;
  param_1[0x1e] = 0;
  param_1[0x1f] = 0;
  param_1[0x20] = 0;
  param_1[0x1b] = param_13;
  puVar1 = (undefined4 *)FUN_0048a630(param_1[0xb]);
  FUN_0040aadc(local_34);
  pfVar3 = local_34;
  pfVar4 = local_64;
  for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b374(local_34,local_64,(float *)(param_1 + 0x24));
  pfVar3 = local_34;
  pfVar4 = local_94;
  for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b42c((int)local_34,(int)local_94,(float *)(param_1 + 0x1e));
  FUN_0040beb0(puVar1,local_34);
  FUN_0048d3e8((undefined4 *)param_1[0xb]);
  return param_1;
}



/* @00455a68 file=? name=FUN_00455a68 */

void __cdecl FUN_00455a68(int *param_1,byte param_2)

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



/* @00455a94 file=? name=FUN_00455a94 */

undefined4 __cdecl FUN_00455a94(int param_1)

{
  FUN_00453458(param_1);
  return 1;
}



/* @00455aa8 file=? name=FUN_00455aa8 */

void __cdecl FUN_00455aa8(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  float *pfVar3;
  float *pfVar4;
  float *pfVar5;
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  if ((*(int **)(param_1 + 0x6c) == (int *)0x0) || (**(int **)(param_1 + 0x6c) != 0)) {
    pfVar3 = (float *)(param_1 + 0x9c);
    FUN_004085ec(pfVar3,pfVar3,(float *)(param_1 + 0x84));
    pfVar5 = (float *)(param_1 + 0x90);
    FUN_004085ec(pfVar5,pfVar5,pfVar3);
    *(float *)(param_1 + 0x70) = *(float *)(param_1 + 0x74) + *(float *)(param_1 + 0x70);
    *(float *)(param_1 + 0x7c) = *(float *)(param_1 + 0x70) + *(float *)(param_1 + 0x7c);
    puVar1 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
    FUN_0040aadc(local_34);
    pfVar3 = local_34;
    pfVar4 = local_64;
    for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
      *pfVar4 = *pfVar3;
      pfVar3 = pfVar3 + 1;
      pfVar4 = pfVar4 + 1;
    }
    FUN_0040b374(local_34,local_64,pfVar5);
    pfVar3 = local_34;
    pfVar5 = local_94;
    for (iVar2 = 0xc; iVar2 != 0; iVar2 = iVar2 + -1) {
      *pfVar5 = *pfVar3;
      pfVar3 = pfVar3 + 1;
      pfVar5 = pfVar5 + 1;
    }
    FUN_0040b42c((int)local_34,(int)local_94,(float *)(param_1 + 0x78));
    FUN_0040beb0(puVar1,local_34);
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x2c));
    FUN_004537d8();
  }
  return;
}



/* @00455b94 file=? name=FUN_00455b94 */

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

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1898;
  FUN_0041c42c(param_1 + 7,0);
  return param_1;
}



/* @00455bc8 file=? name=FUN_00455bc8 */

void __cdecl FUN_00455bc8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1898;
    FUN_0041c44b(param_1 + 7,2);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00455c04 file=? name=FUN_00455c04 */

undefined4 __cdecl FUN_00455c04(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00455c18 file=? name=FUN_00455c18 */

void __cdecl FUN_00455c18(int param_1,undefined4 param_2)

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



/* @00455c34 file=? name=FUN_00455c34 */

void __cdecl FUN_00455c34(int param_1)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_0041c477(local_18,param_1 + 0x1c);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x14))(piVar1);
  }
  FUN_0041c4d4(local_18,2);
  return;
}



/* @00455c7c file=? name=FUN_00455c7c */

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

{
  FUN_00455b94(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1880;
  param_1[0xc] = param_4;
  param_1[0xd] = *param_4;
  param_1[0xe] = param_5;
  return param_1;
}



/* @00455cb0 file=? name=FUN_00455cb0 */

void __cdecl FUN_00455cb0(int *param_1,byte param_2)

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



/* @00455cdc file=? name=FUN_00455cdc */

undefined4 __cdecl FUN_00455cdc(int param_1)

{
  FUN_00455c04(param_1);
  return 1;
}



/* @00455cf0 file=? name=FUN_00455cf0 */

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

void __cdecl FUN_00455cf0(int param_1)

{
  float fVar1;
  
  if (**(float **)(param_1 + 0x30) - *(float *)(param_1 + 0x34) <= _DAT_00455d38) {
    fVar1 = -(**(float **)(param_1 + 0x30) - *(float *)(param_1 + 0x34));
  }
  else {
    fVar1 = **(float **)(param_1 + 0x30) - *(float *)(param_1 + 0x34);
  }
  if (*(float *)(param_1 + 0x38) <= fVar1) {
    *(undefined4 *)(param_1 + 0x34) = **(undefined4 **)(param_1 + 0x30);
    FUN_00455c34(param_1);
  }
  return;
}



/* @00455d3c file=? name=FUN_00455d3c */

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

{
  FUN_00455b94(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1868;
  param_1[0xd] = param_4;
  param_1[0xc] = *(undefined4 *)(param_1[4] + 0x80);
  return param_1;
}



/* @00455d74 file=? name=FUN_00455d74 */

void __cdecl FUN_00455d74(int *param_1,byte param_2)

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



/* @00455da0 file=? name=FUN_00455da0 */

undefined4 __cdecl FUN_00455da0(int param_1)

{
  FUN_00455c04(param_1);
  return 1;
}



/* @00455db4 file=? name=FUN_00455db4 */

void __cdecl FUN_00455db4(int param_1)

{
  if (*(float *)(param_1 + 0x30) <= *(float *)(*(int *)(param_1 + 0x10) + 0x80)) {
    *(float *)(param_1 + 0x30) =
         *(float *)(*(int *)(param_1 + 0x10) + 0x80) + *(float *)(param_1 + 0x34);
    FUN_00455c34(param_1);
  }
  return;
}



/* @00455de4 file=? name=FUN_00455de4 */

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

{
  FUN_00455b94(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1850;
  FUN_0041c42c(param_1 + 0x13,0);
  param_1[0xd] = param_4;
  param_1[0xe] = param_5;
  param_1[0xc] = 1;
  param_1[0xf] = *(undefined4 *)(param_1[4] + 0x80);
  param_1[0x11] = *(undefined4 *)(param_1[4] + 0x80);
  param_1[0x10] = 0;
  param_1[0x12] = 0;
  return param_1;
}



/* @00455e4c file=? name=FUN_00455e4c */

void __cdecl FUN_00455e4c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1850;
    FUN_0041c44b(param_1 + 0x13,2);
    FUN_00455bc8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00455e88 file=? name=FUN_00455e88 */

void __cdecl FUN_00455e88(int param_1,undefined4 param_2)

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



/* @00455ea4 file=? name=FUN_00455ea4 */

undefined4 __cdecl FUN_00455ea4(int param_1)

{
  FUN_00455c04(param_1);
  return 1;
}



/* @00455eb8 file=? name=FUN_00455eb8 */

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

void __cdecl FUN_00455eb8(int param_1)

{
  int *piVar1;
  int local_48 [5];
  float local_34;
  undefined4 local_30;
  float local_2c;
  int local_28 [5];
  float local_14;
  undefined4 local_10;
  float local_c;
  float local_8;
  
  if (*(int *)(param_1 + 0x34) == 0) {
    local_8 = *(float *)(*(int *)(param_1 + 0x10) + 0x80);
    FUN_00408440(&local_14,(undefined4 *)(*(int *)(param_1 + 0x14) + 0x100));
    local_34 = local_14;
    local_30 = local_10;
    local_2c = local_c;
    FUN_00408b98(&local_14,&local_34,(float *)(*(int *)(param_1 + 0x10) + 0x50));
    if (local_c - _DAT_00456120 < _DAT_00456124) {
      if (local_c < _DAT_00456124) {
        if (local_c <= _DAT_00456124) {
          local_c = -local_c;
        }
      }
      else {
        local_c = 0.1;
      }
      if (local_14 <= _DAT_00456124) {
        local_14 = -local_14;
      }
      if ((local_14 - _DAT_00456120) / local_c <= *(float *)(*(int *)(param_1 + 0x10) + 0x11c)) {
        if (*(int *)(param_1 + 0x30) == 0) {
          *(undefined4 *)(param_1 + 0x30) = 1;
          FUN_0048a890(*(int *)(param_1 + 0x38));
          FUN_0048d4b0(*(undefined4 **)(param_1 + 0x38));
          *(undefined4 *)(param_1 + 0x40) = 0;
          *(float *)(param_1 + 0x3c) = local_8;
          *(float *)(param_1 + 0x44) = local_8;
        }
        if (_DAT_00456128 <= local_c) {
          *(undefined4 *)(param_1 + 0x48) = 0x3e800000;
        }
        else {
          *(undefined4 *)(param_1 + 0x48) = 0;
        }
      }
      else if (*(int *)(param_1 + 0x30) != 0) {
        *(undefined4 *)(param_1 + 0x30) = 0;
        FUN_0048a8d8(*(int *)(param_1 + 0x38));
        FUN_0048d4b0(*(undefined4 **)(param_1 + 0x38));
        *(undefined4 *)(param_1 + 0x40) = 0x3f800000;
        *(undefined4 *)(param_1 + 0x48) = 0x42700000;
        *(float *)(param_1 + 0x3c) = local_8 + *(float *)(param_1 + 0x40);
        *(float *)(param_1 + 0x44) = local_8 + *(float *)(param_1 + 0x48);
      }
    }
    else if (*(int *)(param_1 + 0x30) != 0) {
      *(undefined4 *)(param_1 + 0x30) = 0;
      FUN_0048a8d8(*(int *)(param_1 + 0x38));
      FUN_0048d4b0(*(undefined4 **)(param_1 + 0x38));
      *(undefined4 *)(param_1 + 0x40) = 0x3f800000;
      *(undefined4 *)(param_1 + 0x48) = 0x42700000;
      *(float *)(param_1 + 0x3c) = local_8 + *(float *)(param_1 + 0x40);
      *(float *)(param_1 + 0x44) = local_8 + *(float *)(param_1 + 0x48);
    }
    if (*(float *)(param_1 + 0x44) <= local_8) {
      *(float *)(param_1 + 0x44) = local_8 + *(float *)(param_1 + 0x48);
      FUN_0041c477(local_48,param_1 + 0x4c);
      while (piVar1 = (int *)(**(code **)(local_48[0] + 0x28))(local_48), piVar1 != (int *)0x0) {
        (**(code **)(*piVar1 + 0x14))(piVar1);
      }
      FUN_0041c4d4(local_48,2);
    }
    if (*(float *)(param_1 + 0x3c) <= local_8) {
      *(float *)(param_1 + 0x3c) = local_8 + *(float *)(param_1 + 0x40);
      FUN_00455c34(param_1);
    }
  }
  else {
    FUN_00455c34(param_1);
    FUN_0041c477(local_28,param_1 + 0x4c);
    while (piVar1 = (int *)(**(code **)(local_28[0] + 0x28))(local_28), piVar1 != (int *)0x0) {
      (**(code **)(*piVar1 + 0x14))(piVar1);
    }
    *(undefined4 *)(param_1 + 0x30) = 1;
    FUN_0041c4d4(local_28,2);
  }
  return;
}



/* @0045612c file=? name=FUN_0045612c */

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

{
  int iVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1838;
  param_1[7] = param_5;
  param_1[8] = param_4;
  param_1[9] = param_6;
  iVar1 = *param_6;
  param_1[10] = iVar1;
  if (iVar1 == param_1[7]) {
    FUN_0048ac30(param_1[8],1);
  }
  else {
    FUN_0048ac30(param_1[8],0);
  }
  FUN_0048d5d4((undefined4 *)param_1[8]);
  return param_1;
}



/* @00456198 file=? name=FUN_00456198 */

void __cdecl FUN_00456198(int *param_1,byte param_2)

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



/* @004561c4 file=? name=FUN_004561c4 */

undefined4 __cdecl FUN_004561c4(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @004561d8 file=? name=FUN_004561d8 */

void __cdecl FUN_004561d8(int param_1)

{
  int iVar1;
  
  iVar1 = **(int **)(param_1 + 0x24);
  if (iVar1 != *(int *)(param_1 + 0x28)) {
    *(int *)(param_1 + 0x28) = iVar1;
    if (iVar1 == *(int *)(param_1 + 0x1c)) {
      FUN_0048ac30(*(int *)(param_1 + 0x20),1);
    }
    else {
      FUN_0048ac30(*(int *)(param_1 + 0x20),0);
    }
    FUN_0048d5d4(*(undefined4 **)(param_1 + 0x20));
  }
  return;
}



/* @00456224 file=? name=FUN_00456224 */

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

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1820;
  param_1[9] = param_4;
  param_1[8] = param_5;
  param_1[0xb] = param_6;
  param_1[10] = param_7;
  if (param_7 == *(int *)(param_1[0xb] + 0x14)) {
    if (param_1[8] == 1) {
      param_1[7] = 1;
    }
    else {
      param_1[7] = 0;
    }
  }
  else if (param_1[8] == 1) {
    param_1[7] = 0;
  }
  else {
    param_1[7] = 1;
  }
  FUN_0048ac30(param_1[9],param_1[7]);
  FUN_0048d5d4((undefined4 *)param_1[9]);
  (**(code **)(*(int *)(param_6 + 0x2c) + 4))(param_6 + 0x2c,param_1);
  return param_1;
}



/* @004562c0 file=? name=FUN_004562c0 */

void __cdecl FUN_004562c0(int *param_1,byte param_2)

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



/* @004562ec file=? name=FUN_004562ec */

undefined4 __cdecl FUN_004562ec(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00456300 file=? name=FUN_00456300 */

void __cdecl FUN_00456300(int param_1)

{
  int iVar1;
  
  if (*(int *)(*(int *)(param_1 + 0x2c) + 0x14) == *(int *)(param_1 + 0x28)) {
    if (*(int *)(param_1 + 0x20) == 1) {
      iVar1 = 1;
    }
    else {
      iVar1 = 0;
    }
  }
  else if (*(int *)(param_1 + 0x20) == 1) {
    iVar1 = 0;
  }
  else {
    iVar1 = 1;
  }
  if (iVar1 != *(int *)(param_1 + 0x1c)) {
    *(int *)(param_1 + 0x1c) = iVar1;
    FUN_0048ac30(*(int *)(param_1 + 0x24),iVar1);
    FUN_0048d5d4(*(undefined4 **)(param_1 + 0x24));
  }
  return;
}



/* @0045635c file=? name=FUN_0045635c */

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

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

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_LAB_004f1808;
  if (param_6 == (undefined4 *)0x0) {
    param_1[9] = 1;
    param_1[8] = param_1 + 9;
    param_1[10] = 0;
  }
  else {
    param_1[8] = param_6;
    param_1[10] = *param_6;
  }
  param_1[7] = param_4;
  FUN_00408440(param_1 + 0xb,&DAT_004e0f80);
  param_1[0xf] = param_5 * _DAT_004563cc;
  return param_1;
}



/* @004563fc file=? name=FUN_004563fc */

undefined4 __cdecl FUN_004563fc(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00456410 file=? name=FUN_00456410 */

void __cdecl FUN_00456410(int param_1)

{
  float fVar1;
  undefined4 *puVar2;
  
  if (**(int **)(param_1 + 0x20) != *(int *)(param_1 + 0x28)) {
    if (*(int *)(param_1 + 0x28) == 0) {
      *(undefined4 *)(param_1 + 0x38) = *(undefined4 *)(*(int *)(param_1 + 0x10) + 0x80);
      FUN_00408440((undefined4 *)(param_1 + 0x2c),&DAT_004e0f80);
    }
    *(undefined4 *)(param_1 + 0x28) = **(undefined4 **)(param_1 + 0x20);
  }
  if (*(int *)(param_1 + 0x28) != 0) {
    fVar1 = *(float *)(*(int *)(param_1 + 0x10) + 0x80) - *(float *)(param_1 + 0x38);
    *(float *)(param_1 + 0x30) = fVar1 * fVar1 * *(float *)(param_1 + 0x3c);
    puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x1c));
    FUN_0040c18c(puVar2,(undefined4 *)(param_1 + 0x2c));
    FUN_0045fbf4(*(int *)(param_1 + 0x10),*(undefined4 *)(param_1 + 0x1c));
  }
  return;
}



/* @004564a8 file=? name=FUN_004564a8 */

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

undefined4 * __cdecl
FUN_004564a8(undefined4 *param_1,undefined4 param_2,undefined4 param_3,float param_4,float param_5)

{
  float10 fVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_LAB_004f17f0;
  param_1[7] = 0;
  fVar1 = FUN_004dcd00((double)param_5);
  param_1[8] = (uint)((float10)_DAT_00456528 < fVar1);
  param_1[9] = *(undefined4 *)(param_1[4] + 0x80);
  param_1[9] = param_4 + (float)param_1[9];
  param_1[10] = (float)param_1[9] + param_5;
  param_1[0xb] = 0;
  return param_1;
}



/* @00456558 file=? name=FUN_00456558 */

undefined4 __cdecl FUN_00456558(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @0045656c file=munga_l4/l4vidrnd.cpp name=FUN_0045656c */

void __cdecl FUN_0045656c(int param_1)

{
  float fVar1;
  
  if (*(int *)(param_1 + 0x1c) != 2) {
    fVar1 = *(float *)(*(int *)(param_1 + 0x10) + 0x80);
    if (*(int *)(param_1 + 0x1c) == 0) {
      if (*(float *)(param_1 + 0x24) < fVar1) {
        *(undefined4 *)(param_1 + 0x2c) = 1;
        if (*(int *)(param_1 + 0x20) != 0) {
          *(undefined4 *)(param_1 + 0x1c) = 1;
          return;
        }
        *(undefined4 *)(param_1 + 0x1c) = 2;
        FUN_0045a764(*(int *)(param_1 + 0x10),param_1);
        return;
      }
    }
    else if (*(int *)(param_1 + 0x1c) == 1) {
      if (*(float *)(param_1 + 0x28) < fVar1) {
        *(undefined4 *)(param_1 + 0x2c) = 0;
        *(undefined4 *)(param_1 + 0x1c) = 2;
        FUN_0045a764(*(int *)(param_1 + 0x10),param_1);
        return;
      }
    }
    else {
      FUN_0040385c(s_invalid_myState_004f14f0,s_d__tesla_bt_munga_l4_L4VIDRND_CP_004f1500,0xfb4);
    }
  }
  return;
}



/* @00456610 file=? name=FUN_00456610 */

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

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f17d8;
  if (param_6 == (undefined4 *)0x0) {
    param_1[7] = 1;
    param_1[9] = param_1 + 7;
    param_1[8] = 0;
  }
  else {
    param_1[9] = param_6;
    param_1[8] = *param_6;
  }
  param_1[0xc] = param_9;
  param_1[0xd] = param_7;
  param_1[0xe] = param_8;
  param_1[10] = param_5;
  param_1[0x10] = param_4;
  param_1[0x11] = param_1[0xd];
  return param_1;
}



/* @00456684 file=? name=FUN_00456684 */

void __cdecl FUN_00456684(int *param_1,byte param_2)

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



/* @004566b0 file=? name=FUN_004566b0 */

undefined4 __cdecl FUN_004566b0(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @004566c4 file=? name=FUN_004566c4 */

void __cdecl FUN_004566c4(int param_1)

{
  float fVar1;
  float10 fVar2;
  
  if (**(int **)(param_1 + 0x24) != *(int *)(param_1 + 0x20)) {
    if (*(int *)(param_1 + 0x20) == 0) {
      *(undefined4 *)(param_1 + 0x3c) = *(undefined4 *)(*(int *)(param_1 + 0x10) + 0x80);
      *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_1 + 0x34);
      *(undefined4 *)(param_1 + 0x2c) = *(undefined4 *)(param_1 + 0x28);
    }
    *(undefined4 *)(param_1 + 0x20) = **(undefined4 **)(param_1 + 0x24);
  }
  if ((*(int *)(param_1 + 0x20) != 0) && (0 < *(int *)(param_1 + 0x2c))) {
    fVar1 = *(float *)(*(int *)(param_1 + 0x10) + 0x80);
    if ((*(float *)(param_1 + 0x38) <= *(float *)(param_1 + 0x44)) &&
       (*(int *)(param_1 + 0x2c) = *(int *)(param_1 + 0x2c) + -1, 0 < *(int *)(param_1 + 0x2c))) {
      *(float *)(param_1 + 0x3c) = fVar1;
    }
    *(float *)(param_1 + 0x44) =
         ((fVar1 - *(float *)(param_1 + 0x3c)) *
         (*(float *)(param_1 + 0x38) - *(float *)(param_1 + 0x34))) / *(float *)(param_1 + 0x40) +
         *(float *)(param_1 + 0x34);
    if (*(int *)(param_1 + 0x30) == 1) {
      fVar2 = FUN_004dd138((double)*(float *)(param_1 + 0x44));
      *(float *)(param_1 + 0x44) = (float)fVar2;
    }
    if (*(float *)(param_1 + 0x38) < *(float *)(param_1 + 0x44)) {
      *(undefined4 *)(param_1 + 0x44) = *(undefined4 *)(param_1 + 0x38);
    }
  }
  return;
}



/* @00456778 file=? name=FUN_00456778 */

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

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f17c0;
  param_1[7] = param_4;
  param_1[9] = (uint)(*param_4 == 0);
  if (param_5 == 0) {
    param_1[8] = param_1[7];
  }
  else {
    param_1[8] = param_5;
  }
  param_1[10] = (uint)(*(int *)param_1[8] == 0);
  return param_1;
}



/* @004567d4 file=? name=FUN_004567d4 */

void __cdecl FUN_004567d4(int *param_1,byte param_2)

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



/* @00456800 file=? name=FUN_00456800 */

undefined4 __cdecl FUN_00456800(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00456814 file=? name=FUN_00456814 */

void __cdecl FUN_00456814(int param_1)

{
  if ((**(int **)(param_1 + 0x1c) != *(int *)(param_1 + 0x24)) ||
     (**(int **)(param_1 + 0x20) != *(int *)(param_1 + 0x28))) {
    *(int *)(param_1 + 0x24) = **(int **)(param_1 + 0x1c);
    *(undefined4 *)(param_1 + 0x28) = **(undefined4 **)(param_1 + 0x20);
    if ((*(int *)(param_1 + 0x24) != 0) || (*(int *)(param_1 + 0x28) != 0)) {
      FUN_0045a7a8(*(int *)(param_1 + 0x10),2);
      return;
    }
    FUN_0045a7a8(*(int *)(param_1 + 0x10),3);
  }
  return;
}



/* @00456868 file=? name=FUN_00456868 */

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

{
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f17a8;
  param_1[7] = param_4;
  param_1[8] = *param_4;
  param_1[9] = param_5;
  param_1[10] = param_6;
  FUN_00408440(param_1 + 0xb,param_7);
  return param_1;
}



/* @004568b8 file=? name=FUN_004568b8 */

void __cdecl FUN_004568b8(int *param_1,byte param_2)

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



/* @004568e4 file=? name=FUN_004568e4 */

undefined4 __cdecl FUN_004568e4(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @004568f8 file=? name=FUN_004568f8 */

void __cdecl FUN_004568f8(int param_1)

{
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  
  if (**(int **)(param_1 + 0x1c) != *(int *)(param_1 + 0x20)) {
    *(int *)(param_1 + 0x20) = **(int **)(param_1 + 0x1c);
    local_c = *(undefined4 *)(param_1 + 0x24);
    local_18 = *(undefined4 *)(param_1 + 0x2c);
    local_14 = *(undefined4 *)(param_1 + 0x30);
    local_10 = *(undefined4 *)(param_1 + 0x34);
    FUN_0048d060(0,*(int *)(param_1 + 0x28),&local_18);
  }
  return;
}



/* @0045693c file=munga_l4/l4vidrnd.cpp name=FUN_0045693c */

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

{
  int iVar1;
  undefined4 *puVar2;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1790;
  if (param_5 == (undefined4 *)0x0) {
    FUN_0040385c(s_A_pfx_was_not_defined_in_the__in_004f1522,
                 s_d__tesla_bt_munga_l4_L4VIDRND_CP_004f154a,0x10f5);
  }
  param_1[0x48] = param_4;
  param_1[0x49] = *param_4;
  param_1[0x4a] = param_6;
  FUN_00408440(param_1 + 0x4b,param_7);
  puVar2 = param_1 + 7;
  for (iVar1 = 0x41; iVar1 != 0; iVar1 = iVar1 + -1) {
    *puVar2 = *param_5;
    param_5 = param_5 + 1;
    puVar2 = puVar2 + 1;
  }
  return param_1;
}



/* @004569bc file=? name=FUN_004569bc */

void __cdecl FUN_004569bc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1790;
    FUN_0048d060(2,0,param_1 + 7);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004569f8 file=? name=FUN_004569f8 */

undefined4 __cdecl FUN_004569f8(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00456a0c file=? name=FUN_00456a0c */

void __cdecl FUN_00456a0c(int param_1)

{
  int iVar1;
  uint uVar2;
  
  iVar1 = **(int **)(param_1 + 0x120);
  if ((iVar1 != *(int *)(param_1 + 0x124)) && (*(int *)(param_1 + 0x124) = iVar1, iVar1 == 1)) {
    uVar2 = FUN_00460ae4(*(int *)(DAT_004efc94 + 0x48));
    *(uint *)(param_1 + 0x1c) = uVar2 | *(uint *)(param_1 + 0x1c) & 0xffff0000;
    FUN_0048d060(1,*(int *)(param_1 + 0x128),(undefined4 *)(param_1 + 0x1c));
  }
  return;
}



/* @00456a68 file=munga_l4/l4vidrnd.cpp name=FUN_00456a68 */

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

{
  int iVar1;
  undefined4 *puVar2;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1778;
  if (param_6 == (undefined4 *)0x0) {
    FUN_0040385c(s_A_pfx_was_not_defined_in_the__in_004f156c,
                 s_d__tesla_bt_munga_l4_L4VIDRND_CP_004f1594,0x1154);
  }
  param_1[0x48] = param_5;
  param_1[0x49] = param_4;
  param_1[0x4a] = param_7;
  FUN_00408440(param_1 + 0x4b,param_8);
  puVar2 = param_1 + 7;
  for (iVar1 = 0x41; iVar1 != 0; iVar1 = iVar1 + -1) {
    *puVar2 = *param_6;
    param_6 = param_6 + 1;
    puVar2 = puVar2 + 1;
  }
  (**(code **)(*(int *)(param_4 + 0x2c) + 4))(param_4 + 0x2c,param_1);
  return param_1;
}



/* @00456afc file=? name=FUN_00456afc */

void __cdecl FUN_00456afc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1778;
    FUN_0048d060(2,0,param_1 + 7);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00456b38 file=? name=FUN_00456b38 */

undefined4 __cdecl FUN_00456b38(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00456b4c file=? name=FUN_00456b4c */

void __cdecl FUN_00456b4c(int param_1)

{
  uint uVar1;
  
  if (*(int *)(*(int *)(param_1 + 0x124) + 0x14) == *(int *)(param_1 + 0x120)) {
    uVar1 = FUN_00460ae4(*(int *)(DAT_004efc94 + 0x48));
    *(uint *)(param_1 + 0x1c) = uVar1 | *(uint *)(param_1 + 0x1c) & 0xffff0000;
    FUN_0048d060(1,*(int *)(param_1 + 0x128),(undefined4 *)(param_1 + 0x1c));
  }
  return;
}



/* @00456ba0 file=? name=FUN_00456ba0 */

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

undefined4 * __cdecl
FUN_00456ba0(undefined4 *param_1,undefined4 param_2,int param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
            undefined4 param_13,undefined4 param_14,undefined4 param_15,undefined4 param_16,
            undefined4 param_17,undefined4 param_18,undefined4 param_19,int param_20,float param_21,
            int param_22)

{
  int iVar1;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1760;
  iVar1 = FUN_004897a0();
  param_1[7] = iVar1;
  if (param_3 == 0) {
    FUN_0048ba98(iVar1,param_4,param_5,param_6);
    FUN_0048bb54(param_1[7],param_7,param_8,param_9);
    FUN_0048bc10(param_1[7],param_10,param_11,param_12);
    FUN_0048bccc(param_1[7],param_13,param_14,param_15,param_16);
    FUN_0048bd94(param_1[7],param_17,param_18,param_19);
    if (param_20 != 0) {
      FUN_0048be50(param_1[7],param_20);
    }
    if (param_21 != _DAT_00456c98) {
      FUN_0048fe94(param_1[7],param_21);
    }
    if (param_22 != 0) {
      FUN_004902a0(param_1[7],param_22);
    }
    FUN_0048d4d4((undefined4 *)param_1[7]);
  }
  return param_1;
}



/* @00456c9c file=? name=FUN_00456c9c */

void __cdecl FUN_00456c9c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1760;
    FUN_00489a28((int *)param_1[7]);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00456cd4 file=? name=FUN_00456cd4 */

undefined4 __cdecl FUN_00456cd4(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00456ce8 file=? name=FUN_00456ce8 */

void FUN_00456ce8(void)

{
  return;
}



/* @00456cf0 file=? name=FUN_00456cf0 */

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

undefined4 * __cdecl
FUN_00456cf0(undefined4 *param_1,undefined4 param_2,int param_3,undefined4 param_4,
            undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
            undefined4 param_9,undefined4 param_10,undefined4 param_11,undefined4 param_12,
            undefined4 param_13,undefined4 param_14,undefined4 param_15,undefined4 param_16,
            undefined4 param_17,undefined4 param_18,undefined4 param_19,int param_20,float param_21,
            int param_22,undefined4 param_23,undefined4 param_24,undefined4 param_25,
            undefined4 param_26,undefined4 param_27,undefined4 param_28,undefined4 param_29,
            undefined4 param_30,undefined4 param_31,undefined4 param_32,undefined4 param_33,
            undefined4 param_34,undefined4 param_35,undefined4 param_36,undefined4 param_37,
            undefined4 param_38,undefined4 param_39,undefined4 *param_40)

{
  float fVar1;
  float fVar2;
  
  FUN_00456ba0(param_1,param_2,param_3,param_4,param_5,param_6,param_7,param_8,param_9,param_10,
               param_11,param_12,param_13,param_14,param_15,param_16,param_17,param_18,param_19,
               param_20,param_21,param_22);
  *param_1 = &PTR_LAB_004f1748;
  param_1[10] = param_4;
  param_1[0xb] = param_5;
  param_1[0xc] = param_6;
  param_1[0xd] = param_7;
  param_1[0xe] = param_8;
  param_1[0xf] = param_9;
  param_1[0x10] = param_10;
  param_1[0x11] = param_11;
  param_1[0x12] = param_12;
  param_1[0x13] = param_13;
  param_1[0x14] = param_14;
  param_1[0x15] = param_15;
  param_1[0x16] = param_16;
  param_1[0x17] = param_17;
  param_1[0x18] = param_18;
  param_1[0x19] = param_19;
  param_1[9] = param_20;
  param_1[0x1a] = param_21;
  param_1[8] = param_22;
  param_1[0x1b] = param_23;
  param_1[0x1c] = param_24;
  param_1[0x1d] = param_25;
  param_1[0x1e] = param_26;
  param_1[0x1f] = param_27;
  param_1[0x20] = param_28;
  param_1[0x21] = param_29;
  param_1[0x22] = param_30;
  param_1[0x23] = param_31;
  param_1[0x24] = param_32;
  param_1[0x25] = param_33;
  param_1[0x26] = param_34;
  param_1[0x27] = param_35;
  param_1[0x28] = param_36;
  param_1[0x29] = param_37;
  param_1[0x2a] = param_38;
  param_1[0x2b] = param_39;
  param_1[0x2c] = param_40;
  param_1[0x2d] = *param_40;
  fVar2 = _DAT_00457104 - (float)param_1[0x2d];
  fVar1 = (float)param_1[0x2d];
  param_1[0x2e] = (float)param_1[0x1b] * fVar1 + (float)param_1[10] * fVar2;
  param_1[0x2f] = (float)param_1[0x1c] * fVar1 + (float)param_1[0xb] * fVar2;
  param_1[0x30] = (float)param_1[0x1d] * fVar1 + (float)param_1[0xc] * fVar2;
  param_1[0x31] = (float)param_1[0x1e] * fVar1 + (float)param_1[0xd] * fVar2;
  param_1[0x32] = (float)param_1[0x1f] * fVar1 + (float)param_1[0xe] * fVar2;
  param_1[0x33] = (float)param_1[0x20] * fVar1 + (float)param_1[0xf] * fVar2;
  param_1[0x34] = (float)param_1[0x21] * fVar1 + (float)param_1[0x10] * fVar2;
  param_1[0x35] = (float)param_1[0x22] * fVar1 + (float)param_1[0x11] * fVar2;
  param_1[0x36] = (float)param_1[0x23] * fVar1 + (float)param_1[0x12] * fVar2;
  param_1[0x37] = (float)param_1[0x24] * fVar1 + (float)param_1[0x13] * fVar2;
  param_1[0x38] = (float)param_1[0x25] * fVar1 + (float)param_1[0x14] * fVar2;
  param_1[0x39] = (float)param_1[0x26] * fVar1 + (float)param_1[0x15] * fVar2;
  param_1[0x3a] = (float)param_1[0x27] * fVar1 + (float)param_1[0x16] * fVar2;
  param_1[0x3b] = (float)param_1[0x28] * fVar1 + (float)param_1[0x17] * fVar2;
  param_1[0x3c] = (float)param_1[0x29] * fVar1 + (float)param_1[0x18] * fVar2;
  param_1[0x3d] = (float)param_1[0x2a] * fVar1 + (float)param_1[0x19] * fVar2;
  param_1[0x3e] = (float)param_1[0x2b] * fVar1 + (float)param_1[0x1a] * fVar2;
  FUN_0048ba98(param_1[7],param_1[0x2e],param_1[0x2f],param_1[0x30]);
  FUN_0048bb54(param_1[7],param_1[0x31],param_1[0x32],param_1[0x33]);
  FUN_0048bc10(param_1[7],param_1[0x34],param_1[0x35],param_1[0x36]);
  FUN_0048bccc(param_1[7],param_1[0x37],param_1[0x38],param_1[0x39],param_1[0x3a]);
  FUN_0048bd94(param_1[7],param_1[0x3b],param_1[0x3c],param_1[0x3d]);
  if (param_1[9] != 0) {
    FUN_0048be50(param_1[7],param_1[9]);
  }
  if ((float)param_1[0x3e] != _DAT_00457108) {
    FUN_0048fe94(param_1[7],param_1[0x3e]);
  }
  if (param_1[8] != 0) {
    FUN_004902a0(param_1[7],param_1[8]);
  }
  FUN_0048d4d4((undefined4 *)param_1[7]);
  return param_1;
}



/* @00457138 file=? name=FUN_00457138 */

undefined4 __cdecl FUN_00457138(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @0045714c file=? name=FUN_0045714c */

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

void __cdecl FUN_0045714c(int param_1)

{
  float fVar1;
  float fVar2;
  
  if (*(float *)(param_1 + 0xb4) != **(float **)(param_1 + 0xb0)) {
    *(undefined4 *)(param_1 + 0xb4) = **(undefined4 **)(param_1 + 0xb0);
    fVar2 = _DAT_004573dc - *(float *)(param_1 + 0xb4);
    fVar1 = *(float *)(param_1 + 0xb4);
    *(float *)(param_1 + 0xb8) =
         *(float *)(param_1 + 0x6c) * fVar1 + *(float *)(param_1 + 0x28) * fVar2;
    *(float *)(param_1 + 0xbc) =
         *(float *)(param_1 + 0x70) * fVar1 + *(float *)(param_1 + 0x2c) * fVar2;
    *(float *)(param_1 + 0xc0) =
         *(float *)(param_1 + 0x74) * fVar1 + *(float *)(param_1 + 0x30) * fVar2;
    *(float *)(param_1 + 0xc4) =
         *(float *)(param_1 + 0x78) * fVar1 + *(float *)(param_1 + 0x34) * fVar2;
    *(float *)(param_1 + 200) =
         *(float *)(param_1 + 0x7c) * fVar1 + *(float *)(param_1 + 0x38) * fVar2;
    *(float *)(param_1 + 0xcc) =
         *(float *)(param_1 + 0x80) * fVar1 + *(float *)(param_1 + 0x3c) * fVar2;
    *(float *)(param_1 + 0xd0) =
         *(float *)(param_1 + 0x84) * fVar1 + *(float *)(param_1 + 0x40) * fVar2;
    *(float *)(param_1 + 0xd4) =
         *(float *)(param_1 + 0x88) * fVar1 + *(float *)(param_1 + 0x44) * fVar2;
    *(float *)(param_1 + 0xd8) =
         *(float *)(param_1 + 0x8c) * fVar1 + *(float *)(param_1 + 0x48) * fVar2;
    *(float *)(param_1 + 0xdc) =
         *(float *)(param_1 + 0x90) * fVar1 + *(float *)(param_1 + 0x4c) * fVar2;
    *(float *)(param_1 + 0xe0) =
         *(float *)(param_1 + 0x94) * fVar1 + *(float *)(param_1 + 0x50) * fVar2;
    *(float *)(param_1 + 0xe4) =
         *(float *)(param_1 + 0x98) * fVar1 + *(float *)(param_1 + 0x54) * fVar2;
    *(float *)(param_1 + 0xe8) =
         *(float *)(param_1 + 0x9c) * fVar1 + *(float *)(param_1 + 0x58) * fVar2;
    *(float *)(param_1 + 0xec) =
         *(float *)(param_1 + 0xa0) * fVar1 + *(float *)(param_1 + 0x5c) * fVar2;
    *(float *)(param_1 + 0xf0) =
         *(float *)(param_1 + 0xa4) * fVar1 + *(float *)(param_1 + 0x60) * fVar2;
    *(float *)(param_1 + 0xf4) =
         *(float *)(param_1 + 0xa8) * fVar1 + *(float *)(param_1 + 100) * fVar2;
    *(float *)(param_1 + 0xf8) =
         *(float *)(param_1 + 0xac) * fVar1 + *(float *)(param_1 + 0x68) * fVar2;
    FUN_0048ba98(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xb8),
                 *(undefined4 *)(param_1 + 0xbc),*(undefined4 *)(param_1 + 0xc0));
    FUN_0048bb54(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xc4),
                 *(undefined4 *)(param_1 + 200),*(undefined4 *)(param_1 + 0xcc));
    FUN_0048bc10(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xd0),
                 *(undefined4 *)(param_1 + 0xd4),*(undefined4 *)(param_1 + 0xd8));
    FUN_0048bccc(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xdc),
                 *(undefined4 *)(param_1 + 0xe0),*(undefined4 *)(param_1 + 0xe4),
                 *(undefined4 *)(param_1 + 0xe8));
    FUN_0048bd94(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xec),
                 *(undefined4 *)(param_1 + 0xf0),*(undefined4 *)(param_1 + 0xf4));
    if (*(float *)(param_1 + 0xf8) != _DAT_004573e0) {
      FUN_0048fe94(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xf8));
    }
    FUN_0048d4d4(*(undefined4 **)(param_1 + 0x1c));
  }
  return;
}



/* @004573e4 file=? name=FUN_004573e4 */

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

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

{
  float fVar1;
  float fVar2;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_LAB_004f1730;
  param_1[7] = param_4;
  param_1[8] = param_5;
  param_1[9] = *param_5;
  FUN_0048baf4(param_1[7],param_1 + 10,param_1 + 0xb,param_1 + 0xc);
  FUN_0048bbb0(param_1[7],param_1 + 0xd,param_1 + 0xe,param_1 + 0xf);
  FUN_0048bc6c(param_1[7],param_1 + 0x10,param_1 + 0x11,param_1 + 0x12);
  FUN_0048bd2c(param_1[7],param_1 + 0x13,param_1 + 0x14,param_1 + 0x15,param_1 + 0x16);
  FUN_0048bdf0(param_1[7],param_1 + 0x17,param_1 + 0x18,param_1 + 0x19);
  param_1[0x1a] = param_6 * (float)param_1[10];
  param_1[0x1b] = param_6 * (float)param_1[0xb];
  param_1[0x1c] = param_6 * (float)param_1[0xc];
  param_1[0x1d] = param_6 * (float)param_1[0xd];
  param_1[0x1e] = param_6 * (float)param_1[0xe];
  param_1[0x1f] = param_6 * (float)param_1[0xf];
  param_1[0x20] = param_6 * (float)param_1[0x10];
  param_1[0x21] = param_6 * (float)param_1[0x11];
  param_1[0x22] = param_6 * (float)param_1[0x12];
  param_1[0x23] = param_6 * (float)param_1[0x13];
  param_1[0x24] = param_6 * (float)param_1[0x14];
  param_1[0x25] = param_6 * (float)param_1[0x15];
  param_1[0x26] = param_6 * (float)param_1[0x16];
  param_1[0x27] = param_6 * (float)param_1[0x17];
  param_1[0x28] = param_6 * (float)param_1[0x18];
  param_1[0x29] = param_6 * (float)param_1[0x19];
  fVar2 = _DAT_00457740 - (float)param_1[9];
  fVar1 = (float)param_1[9];
  param_1[0x2a] = (float)param_1[0x1a] * fVar1 + (float)param_1[10] * fVar2;
  param_1[0x2b] = (float)param_1[0x1b] * fVar1 + (float)param_1[0xb] * fVar2;
  param_1[0x2c] = (float)param_1[0x1c] * fVar1 + (float)param_1[0xc] * fVar2;
  param_1[0x2d] = (float)param_1[0x1d] * fVar1 + (float)param_1[0xd] * fVar2;
  param_1[0x2e] = (float)param_1[0x1e] * fVar1 + (float)param_1[0xe] * fVar2;
  param_1[0x2f] = (float)param_1[0x1f] * fVar1 + (float)param_1[0xf] * fVar2;
  param_1[0x30] = (float)param_1[0x20] * fVar1 + (float)param_1[0x10] * fVar2;
  param_1[0x31] = (float)param_1[0x21] * fVar1 + (float)param_1[0x11] * fVar2;
  param_1[0x32] = (float)param_1[0x22] * fVar1 + (float)param_1[0x12] * fVar2;
  param_1[0x33] = (float)param_1[0x23] * fVar1 + (float)param_1[0x13] * fVar2;
  param_1[0x34] = (float)param_1[0x24] * fVar1 + (float)param_1[0x14] * fVar2;
  param_1[0x35] = (float)param_1[0x25] * fVar1 + (float)param_1[0x15] * fVar2;
  param_1[0x36] = (float)param_1[0x26] * fVar1 + (float)param_1[0x16] * fVar2;
  param_1[0x37] = (float)param_1[0x27] * fVar1 + (float)param_1[0x17] * fVar2;
  param_1[0x38] = (float)param_1[0x28] * fVar1 + (float)param_1[0x18] * fVar2;
  param_1[0x39] = (float)param_1[0x29] * fVar1 + (float)param_1[0x19] * fVar2;
  FUN_0048ba98(param_1[7],param_1[0x2a],param_1[0x2b],param_1[0x2c]);
  FUN_0048bb54(param_1[7],param_1[0x2d],param_1[0x2e],param_1[0x2f]);
  FUN_0048bc10(param_1[7],param_1[0x30],param_1[0x31],param_1[0x32]);
  FUN_0048bccc(param_1[7],param_1[0x33],param_1[0x34],param_1[0x35],param_1[0x36]);
  FUN_0048d4d4((undefined4 *)param_1[7]);
  return param_1;
}



/* @00457770 file=? name=FUN_00457770 */

undefined4 __cdecl FUN_00457770(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00457784 file=? name=FUN_00457784 */

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

void __cdecl FUN_00457784(int param_1)

{
  float fVar1;
  float fVar2;
  
  if (*(float *)(param_1 + 0x24) != **(float **)(param_1 + 0x20)) {
    *(undefined4 *)(param_1 + 0x24) = **(undefined4 **)(param_1 + 0x20);
    fVar2 = _DAT_004579a4 - *(float *)(param_1 + 0x24);
    fVar1 = *(float *)(param_1 + 0x24);
    *(float *)(param_1 + 0xa8) =
         *(float *)(param_1 + 0x68) * fVar1 + *(float *)(param_1 + 0x28) * fVar2;
    *(float *)(param_1 + 0xac) =
         *(float *)(param_1 + 0x6c) * fVar1 + *(float *)(param_1 + 0x2c) * fVar2;
    *(float *)(param_1 + 0xb0) =
         *(float *)(param_1 + 0x70) * fVar1 + *(float *)(param_1 + 0x30) * fVar2;
    *(float *)(param_1 + 0xb4) =
         *(float *)(param_1 + 0x74) * fVar1 + *(float *)(param_1 + 0x34) * fVar2;
    *(float *)(param_1 + 0xb8) =
         *(float *)(param_1 + 0x78) * fVar1 + *(float *)(param_1 + 0x38) * fVar2;
    *(float *)(param_1 + 0xbc) =
         *(float *)(param_1 + 0x7c) * fVar1 + *(float *)(param_1 + 0x3c) * fVar2;
    *(float *)(param_1 + 0xc0) =
         *(float *)(param_1 + 0x80) * fVar1 + *(float *)(param_1 + 0x40) * fVar2;
    *(float *)(param_1 + 0xc4) =
         *(float *)(param_1 + 0x84) * fVar1 + *(float *)(param_1 + 0x44) * fVar2;
    *(float *)(param_1 + 200) =
         *(float *)(param_1 + 0x88) * fVar1 + *(float *)(param_1 + 0x48) * fVar2;
    *(float *)(param_1 + 0xcc) =
         *(float *)(param_1 + 0x8c) * fVar1 + *(float *)(param_1 + 0x4c) * fVar2;
    *(float *)(param_1 + 0xd0) =
         *(float *)(param_1 + 0x90) * fVar1 + *(float *)(param_1 + 0x50) * fVar2;
    *(float *)(param_1 + 0xd4) =
         *(float *)(param_1 + 0x94) * fVar1 + *(float *)(param_1 + 0x54) * fVar2;
    *(float *)(param_1 + 0xd8) =
         *(float *)(param_1 + 0x98) * fVar1 + *(float *)(param_1 + 0x58) * fVar2;
    *(float *)(param_1 + 0xdc) =
         *(float *)(param_1 + 0x9c) * fVar1 + *(float *)(param_1 + 0x5c) * fVar2;
    *(float *)(param_1 + 0xe0) =
         *(float *)(param_1 + 0xa0) * fVar1 + *(float *)(param_1 + 0x60) * fVar2;
    *(float *)(param_1 + 0xe4) =
         *(float *)(param_1 + 0xa4) * fVar1 + *(float *)(param_1 + 100) * fVar2;
    FUN_0048ba98(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xa8),
                 *(undefined4 *)(param_1 + 0xac),*(undefined4 *)(param_1 + 0xb0));
    FUN_0048bb54(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xb4),
                 *(undefined4 *)(param_1 + 0xb8),*(undefined4 *)(param_1 + 0xbc));
    FUN_0048bc10(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xc0),
                 *(undefined4 *)(param_1 + 0xc4),*(undefined4 *)(param_1 + 200));
    FUN_0048bccc(*(int *)(param_1 + 0x1c),*(undefined4 *)(param_1 + 0xcc),
                 *(undefined4 *)(param_1 + 0xd0),*(undefined4 *)(param_1 + 0xd4),
                 *(undefined4 *)(param_1 + 0xd8));
    FUN_0048d4d4(*(undefined4 **)(param_1 + 0x1c));
  }
  return;
}



/* @004579a8 file=? name=FUN_004579a8 */

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

{
  int iVar1;
  undefined4 *puVar2;
  float *pfVar3;
  float *pfVar4;
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004f1718;
  FUN_0040aadc(param_1 + 6);
  param_1[0x16] = param_2;
  param_1[5] = param_5;
  FUN_0040ab28(param_1 + 6,param_4);
  param_1[0x12] = param_7;
  if (param_7 == (undefined4 *)0x0) {
    FUN_0040aadc(local_34);
    FUN_00408f7c((float *)(param_1 + 0x13),local_34);
  }
  else {
    FUN_00408e90(param_1 + 0x13,param_7);
  }
  iVar1 = FUN_00489708();
  param_1[4] = iVar1;
  FUN_00489cec(param_1[5],iVar1);
  FUN_0048a714(param_1[4],param_3);
  FUN_0040aadc(local_64);
  if ((float *)param_1[0x12] != (float *)0x0) {
    FUN_0040ac6c(local_64,(float *)param_1[0x12]);
  }
  pfVar3 = local_64;
  pfVar4 = local_94;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b104(local_64,local_94,(float *)(param_1 + 6));
  puVar2 = (undefined4 *)FUN_0048a630(param_1[4]);
  FUN_0040beb0(puVar2,local_64);
  FUN_0048b4ac((int)param_6,param_1[4]);
  FUN_0048d42c(param_6);
  FUN_0048d3e8((undefined4 *)param_1[4]);
  FUN_00420674(param_1[0x16],param_1);
  FUN_0045a744(*(int *)(DAT_004efc94 + 0x48),param_1);
  return param_1;
}



/* @00457af4 file=? name=FUN_00457af4 */

void __cdecl FUN_00457af4(int *param_1,byte param_2)

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



/* @00457b2c file=? name=FUN_00457b2c */

undefined4 __cdecl FUN_00457b2c(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00457b48 file=? name=FUN_00457b48 */

void __cdecl FUN_00457b48(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  float *pfVar3;
  float *pfVar4;
  float local_64 [12];
  float local_34 [12];
  
  if (*(float **)(param_1 + 0x48) != (float *)0x0) {
    iVar1 = FUN_004091f4(*(float **)(param_1 + 0x48),(float *)(param_1 + 0x4c),0.0001);
    if (iVar1 == 0) {
      FUN_00408e90((undefined4 *)(param_1 + 0x4c),*(undefined4 **)(param_1 + 0x48));
      FUN_0040aadc(local_34);
      FUN_0040ac6c(local_34,*(float **)(param_1 + 0x48));
      pfVar3 = local_34;
      pfVar4 = local_64;
      for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
        *pfVar4 = *pfVar3;
        pfVar3 = pfVar3 + 1;
        pfVar4 = pfVar4 + 1;
      }
      FUN_0040b104(local_34,local_64,(float *)(param_1 + 0x18));
      puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x10));
      FUN_0040beb0(puVar2,local_34);
      FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x10));
    }
  }
  return;
}



/* @00457bf4 file=? name=FUN_00457bf4 */

undefined4 * __cdecl
FUN_00457bf4(undefined4 *param_1,undefined4 param_2,int param_3,int param_4,undefined4 param_5,
            undefined4 param_6,undefined4 *param_7,undefined4 param_8,undefined4 *param_9)

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  puVar3 = param_1 + 8;
  *param_1 = &PTR_FUN_004f1700;
  FUN_0040aadc(puVar3);
  param_1[0x14] = param_2;
  param_1[6] = param_8;
  param_1[0x15] = param_9;
  FUN_0040ab28(puVar3,param_7);
  FUN_00408440(param_1 + 0x16,param_9);
  iVar1 = FUN_00489708();
  param_1[4] = iVar1;
  FUN_00489cec(param_1[6],iVar1);
  FUN_0048a714(param_1[4],param_3);
  iVar1 = FUN_00489708();
  param_1[5] = iVar1;
  FUN_00489cec(param_1[4],iVar1);
  FUN_0048a714(param_1[5],param_3);
  puVar2 = (undefined4 *)FUN_0048a630(param_1[4]);
  FUN_0040beb0(puVar2,puVar3);
  puVar3 = (undefined4 *)FUN_0048a630(param_1[5]);
  FUN_0040c18c(puVar3,(undefined4 *)param_1[0x15]);
  if (param_4 == 0) {
    param_1[7] = 0;
  }
  else {
    iVar1 = FUN_00489724();
    param_1[7] = iVar1;
    FUN_0048ab0c(iVar1,param_4);
    FUN_0048ad48(param_1[7],param_5);
    FUN_0048add4(param_1[7],param_6);
    FUN_0048ac30(param_1[7],1);
    FUN_00489e04(param_1[5],param_1[7]);
    FUN_0048d5d4((undefined4 *)param_1[7]);
  }
  FUN_0048d3e8((undefined4 *)param_1[4]);
  FUN_0048d3e8((undefined4 *)param_1[5]);
  FUN_00420674(param_1[0x14],param_1);
  FUN_0045a744(*(int *)(DAT_004efc94 + 0x48),param_1);
  return param_1;
}



/* @00457d74 file=? name=FUN_00457d74 */

void __cdecl FUN_00457d74(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1700;
    FUN_004898b8((int *)param_1[5]);
    FUN_004898b8((int *)param_1[4]);
    if ((int *)param_1[7] != (int *)0x0) {
      FUN_004898f8((int *)param_1[7]);
    }
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00457dc4 file=? name=FUN_00457dc4 */

void __cdecl FUN_00457dc4(int param_1)

{
  float *pfVar1;
  int iVar2;
  undefined4 *puVar3;
  
  pfVar1 = (float *)(param_1 + 0x58);
  iVar2 = FUN_004084fc(pfVar1,*(float **)(param_1 + 0x54),0.0001);
  if (iVar2 == 0) {
    FUN_00408440(pfVar1,*(undefined4 **)(param_1 + 0x54));
    puVar3 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x14));
    FUN_0040c18c(puVar3,pfVar1);
    FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x14));
  }
  return;
}



/* @00457e24 file=? name=FUN_00457e24 */

undefined4 __cdecl FUN_00457e24(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00457e40 file=? name=FUN_00457e40 */

undefined4 * __cdecl
FUN_00457e40(undefined4 *param_1,undefined4 param_2,int param_3,int param_4,undefined4 param_5,
            undefined4 param_6,undefined4 *param_7,undefined4 param_8,undefined4 *param_9,
            undefined4 *param_10)

{
  int iVar1;
  undefined4 *puVar2;
  float *pfVar3;
  float *pfVar4;
  float local_98 [12];
  float local_68 [12];
  float local_38 [12];
  float *local_8;
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004f16e8;
  param_1[0x15] = param_2;
  param_1[7] = param_8;
  param_1[0x16] = param_9;
  param_1[4] = param_10;
  FUN_0040ab28(param_1 + 9,param_7);
  FUN_00408440(param_1 + 0x17,param_9);
  param_1[5] = *param_10;
  iVar1 = FUN_00489708();
  param_1[6] = iVar1;
  FUN_00489cec(param_1[7],iVar1);
  FUN_0048a714(param_1[6],param_3);
  puVar2 = (undefined4 *)FUN_0048a630(param_1[6]);
  FUN_0040aadc(local_38);
  local_8 = (float *)(param_1 + 0x17);
  pfVar3 = local_38;
  pfVar4 = local_68;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b374(local_38,local_68,local_8);
  pfVar3 = local_38;
  pfVar4 = local_98;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b104(local_38,local_98,(float *)(param_1 + 9));
  FUN_0040beb0(puVar2,local_38);
  iVar1 = FUN_00489724();
  param_1[8] = iVar1;
  FUN_0048ab0c(iVar1,param_4);
  FUN_0048ad48(param_1[8],param_5);
  FUN_0048add4(param_1[8],param_6);
  FUN_0048ac30(param_1[8],param_1[5]);
  FUN_00489e04(param_1[6],param_1[8]);
  FUN_0048d5d4((undefined4 *)param_1[8]);
  FUN_0048d3e8((undefined4 *)param_1[6]);
  FUN_00420674(param_1[0x15],param_1);
  FUN_0045a744(*(int *)(DAT_004efc94 + 0x48),param_1);
  return param_1;
}



/* @00457fd8 file=? name=FUN_00457fd8 */

void __cdecl FUN_00457fd8(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f16e8;
    FUN_004898b8((int *)param_1[6]);
    FUN_004898f8((int *)param_1[8]);
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00458018 file=? name=FUN_00458018 */

void __cdecl FUN_00458018(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  float *pfVar3;
  float *pfVar4;
  float *pfVar5;
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  iVar1 = **(int **)(param_1 + 0x10);
  if (iVar1 != *(int *)(param_1 + 0x14)) {
    *(int *)(param_1 + 0x14) = iVar1;
    FUN_0048ac30(*(int *)(param_1 + 0x20),iVar1);
    FUN_0048d5d4(*(undefined4 **)(param_1 + 0x20));
  }
  pfVar4 = (float *)(param_1 + 0x5c);
  iVar1 = FUN_004084fc(pfVar4,*(float **)(param_1 + 0x58),0.0001);
  if (iVar1 == 0) {
    FUN_00408440(pfVar4,*(undefined4 **)(param_1 + 0x58));
    puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x18));
    FUN_0040aadc(local_34);
    pfVar3 = local_34;
    pfVar5 = local_64;
    for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
      *pfVar5 = *pfVar3;
      pfVar3 = pfVar3 + 1;
      pfVar5 = pfVar5 + 1;
    }
    FUN_0040b374(local_34,local_64,pfVar4);
    pfVar4 = local_34;
    pfVar3 = local_94;
    for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
      *pfVar3 = *pfVar4;
      pfVar4 = pfVar4 + 1;
      pfVar3 = pfVar3 + 1;
    }
    FUN_0040b104(local_34,local_94,(float *)(param_1 + 0x24));
    FUN_0040beb0(puVar2,local_34);
    FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x18));
  }
  return;
}



/* @00458108 file=? name=FUN_00458108 */

undefined4 __cdecl FUN_00458108(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @0045811c file=? name=FUN_0045811c */

undefined4 * __cdecl
FUN_0045811c(undefined4 *param_1,undefined4 param_2,int param_3,int param_4,undefined4 param_5,
            undefined4 param_6,undefined4 *param_7,undefined4 param_8,undefined4 *param_9,
            undefined4 *param_10,undefined4 *param_11)

{
  int iVar1;
  undefined4 *puVar2;
  float *pfVar3;
  float *pfVar4;
  float local_dc [12];
  float local_ac [12];
  float local_7c [12];
  float local_4c [16];
  float *local_c;
  float *local_8;
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004f16d0;
  param_1[0x15] = param_2;
  param_1[7] = param_8;
  param_1[0x16] = param_9;
  param_1[0x1b] = param_10;
  param_1[4] = param_11;
  FUN_0040ab28(param_1 + 9,param_7);
  FUN_00409968(param_1 + 0x17,param_9);
  FUN_00408440(param_1 + 0x1c,param_10);
  param_1[5] = *param_11;
  iVar1 = FUN_00489708();
  param_1[6] = iVar1;
  FUN_00489cec(param_1[7],iVar1);
  FUN_0048a714(param_1[6],param_3);
  puVar2 = (undefined4 *)FUN_0048a630(param_1[6]);
  FUN_0040aadc(local_4c);
  local_8 = (float *)(param_1 + 0x1c);
  pfVar3 = local_4c;
  pfVar4 = local_7c;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b374(local_4c,local_7c,local_8);
  local_c = (float *)(param_1 + 0x17);
  pfVar3 = local_4c;
  pfVar4 = local_ac;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b3e8(local_4c,local_ac,local_c);
  pfVar3 = local_4c;
  pfVar4 = local_dc;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar4 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar4 = pfVar4 + 1;
  }
  FUN_0040b104(local_4c,local_dc,(float *)(param_1 + 9));
  FUN_0040beb0(puVar2,local_4c);
  iVar1 = FUN_00489724();
  param_1[8] = iVar1;
  FUN_0048ab0c(iVar1,param_4);
  FUN_0048ad48(param_1[8],param_5);
  FUN_0048add4(param_1[8],param_6);
  FUN_0048ac30(param_1[8],param_1[5]);
  FUN_00489e04(param_1[6],param_1[8]);
  FUN_0048d5d4((undefined4 *)param_1[8]);
  FUN_0048d3e8((undefined4 *)param_1[6]);
  FUN_00420674(param_1[0x15],param_1);
  FUN_0045a744(*(int *)(DAT_004efc94 + 0x48),param_1);
  return param_1;
}



/* @004582fc file=? name=FUN_004582fc */

void __cdecl FUN_004582fc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f16d0;
    FUN_004898b8((int *)param_1[6]);
    FUN_004898f8((int *)param_1[8]);
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0045833c file=? name=FUN_0045833c */

void __cdecl FUN_0045833c(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  float *pfVar3;
  float *pfVar4;
  float *pfVar5;
  float local_c4 [12];
  float local_94 [12];
  float local_64 [12];
  float local_34 [12];
  
  iVar1 = **(int **)(param_1 + 0x10);
  if (iVar1 != *(int *)(param_1 + 0x14)) {
    *(int *)(param_1 + 0x14) = iVar1;
    FUN_0048ac30(*(int *)(param_1 + 0x20),iVar1);
    FUN_0048d5d4(*(undefined4 **)(param_1 + 0x20));
  }
  pfVar4 = (float *)(param_1 + 0x70);
  iVar1 = FUN_004084fc(pfVar4,*(float **)(param_1 + 0x6c),0.0001);
  if ((iVar1 != 0) &&
     (iVar1 = FUN_004d4b14((byte *)(param_1 + 0x5c),*(byte **)(param_1 + 0x58),0x10), iVar1 == 0)) {
    return;
  }
  FUN_00408440(pfVar4,*(undefined4 **)(param_1 + 0x6c));
  FUN_00409968((undefined4 *)(param_1 + 0x5c),*(undefined4 **)(param_1 + 0x58));
  puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x18));
  FUN_0040aadc(local_34);
  pfVar3 = local_34;
  pfVar5 = local_64;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar5 = *pfVar3;
    pfVar3 = pfVar3 + 1;
    pfVar5 = pfVar5 + 1;
  }
  FUN_0040b374(local_34,local_64,pfVar4);
  pfVar4 = local_34;
  pfVar3 = local_94;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar3 = *pfVar4;
    pfVar4 = pfVar4 + 1;
    pfVar3 = pfVar3 + 1;
  }
  FUN_0040b3e8(local_34,local_94,(float *)(param_1 + 0x5c));
  pfVar4 = local_34;
  pfVar3 = local_c4;
  for (iVar1 = 0xc; iVar1 != 0; iVar1 = iVar1 + -1) {
    *pfVar3 = *pfVar4;
    pfVar4 = pfVar4 + 1;
    pfVar3 = pfVar3 + 1;
  }
  FUN_0040b104(local_34,local_c4,(float *)(param_1 + 0x24));
  FUN_0040beb0(puVar2,local_34);
  FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x18));
  return;
}



/* @00458478 file=? name=FUN_00458478 */

undefined4 __cdecl FUN_00458478(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @0045848c file=? name=FUN_0045848c */

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

{
  undefined4 *puVar1;
  int iVar2;
  undefined4 *puVar3;
  
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  puVar1 = param_1 + 7;
  *param_1 = &PTR_FUN_004f16b8;
  FUN_0040aadc(puVar1);
  param_1[0x13] = param_2;
  param_1[5] = param_8;
  FUN_0040ab28(puVar1,param_7);
  iVar2 = FUN_00489708();
  param_1[4] = iVar2;
  FUN_00489cec(param_1[5],iVar2);
  FUN_0048a714(param_1[4],param_3);
  puVar3 = (undefined4 *)FUN_0048a630(param_1[4]);
  FUN_0040beb0(puVar3,puVar1);
  if (param_4 == 0) {
    param_1[6] = 0;
  }
  else {
    iVar2 = FUN_00489724();
    param_1[6] = iVar2;
    FUN_0048ab0c(iVar2,param_4);
    FUN_0048ad48(param_1[6],param_5);
    FUN_0048add4(param_1[6],param_6);
    FUN_0048ac30(param_1[6],1);
    FUN_00489e04(param_1[4],param_1[6]);
    FUN_0048d5d4((undefined4 *)param_1[6]);
  }
  FUN_0048d3e8((undefined4 *)param_1[4]);
  FUN_00420674(param_1[0x13],param_1);
  return param_1;
}



/* @00458598 file=? name=FUN_00458598 */

void __cdecl FUN_00458598(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f16b8;
    FUN_004898b8((int *)param_1[4]);
    if ((int *)param_1[6] != (int *)0x0) {
      FUN_004898f8((int *)param_1[6]);
    }
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004585dc file=? name=FUN_004585dc */

undefined4 __cdecl FUN_004585dc(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @004585f8 file=? name=FUN_004585f8 */

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

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

{
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_LAB_004f16a0;
  param_1[0xe] = param_2;
  param_1[8] = param_5;
  FUN_00408440(param_1 + 9,param_4);
  param_1[7] = param_6;
  param_1[6] = *(undefined4 *)(param_6 + 0x14);
  param_1[5] = param_7;
  param_1[4] = param_8;
  param_1[0xc] = _DAT_0045868c / (param_9 * _DAT_00458688);
  param_1[0xd] = 0;
  FUN_00420674(param_1[0xe],param_1);
  FUN_0045a744(*(int *)(DAT_004efc94 + 0x48),param_1);
  return param_1;
}



/* @004586bc file=? name=FUN_004586bc */

undefined4 __cdecl FUN_004586bc(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @004586d0 file=? name=FUN_004586d0 */

void __cdecl FUN_004586d0(int param_1)

{
  int iVar1;
  int *piVar2;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  float local_8;
  
  iVar1 = *(int *)(*(int *)(param_1 + 0x1c) + 0x14);
  if (iVar1 == *(int *)(param_1 + 0x14)) {
    if (iVar1 != *(int *)(param_1 + 0x18)) {
      *(undefined4 *)(param_1 + 0x34) = 0;
    }
    piVar2 = (int *)FUN_00414b60();
    local_8 = (float)*piVar2 / DAT_0052140c;
    if (*(float *)(param_1 + 0x34) + *(float *)(param_1 + 0x30) < local_8) {
      local_10 = *(undefined4 *)(param_1 + 0x10);
      local_1c = *(undefined4 *)(param_1 + 0x24);
      local_18 = *(undefined4 *)(param_1 + 0x28);
      local_14 = *(undefined4 *)(param_1 + 0x2c);
      FUN_0048d060(0,*(int *)(param_1 + 0x20),&local_1c);
      *(float *)(param_1 + 0x34) = local_8;
    }
  }
  *(undefined4 *)(param_1 + 0x18) = *(undefined4 *)(*(int *)(param_1 + 0x1c) + 0x14);
  return;
}



/* @00458754 file=? name=FUN_00458754 */

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

{
  FUN_0041b838(param_1,2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004f1688;
  param_1[4] = param_2;
  param_1[5] = param_5;
  FUN_00408440(param_1 + 6,param_4);
  param_1[9] = param_6;
  param_1[10] = param_7;
  param_1[0xb] = 0;
  FUN_00420674(param_1[4],param_1);
  FUN_0045a744(*(int *)(DAT_004efc94 + 0x48),param_1);
  return param_1;
}



/* @004587c8 file=? name=FUN_004587c8 */

void __cdecl FUN_004587c8(int *param_1,byte param_2)

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



/* @004587f4 file=? name=FUN_004587f4 */

undefined4 __cdecl FUN_004587f4(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00458808 file=? name=FUN_00458808 */

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

void __cdecl FUN_00458808(int param_1)

{
  int *piVar1;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  float local_8;
  
  if (**(float **)(param_1 + 0x28) == _DAT_00458890) {
    *(undefined4 *)(param_1 + 0x2c) = 0;
  }
  else {
    piVar1 = (int *)FUN_00414b60();
    local_8 = (float)*piVar1 / DAT_0052140c;
    if (_DAT_00458898 / (**(float **)(param_1 + 0x28) * _DAT_00458894) + *(float *)(param_1 + 0x2c)
        < local_8) {
      *(float *)(param_1 + 0x2c) = local_8;
      local_10 = *(undefined4 *)(param_1 + 0x24);
      local_1c = *(undefined4 *)(param_1 + 0x18);
      local_18 = *(undefined4 *)(param_1 + 0x1c);
      local_14 = *(undefined4 *)(param_1 + 0x20);
      FUN_0048d060(0,*(int *)(param_1 + 0x14),&local_1c);
    }
  }
  return;
}



/* @004589a0 file=? name=FUN_004589a0 */

void __cdecl FUN_004589a0(int *param_1,byte param_2)

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



/* @004589cc file=? name=FUN_004589cc */

undefined4 __cdecl FUN_004589cc(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @004589e0 file=? name=FUN_004589e0 */

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

void __cdecl FUN_004589e0(int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  float local_9c [5];
  float local_88;
  float local_74;
  float local_6c [5];
  float local_58;
  float local_44;
  float local_3c [5];
  float local_28;
  float local_14;
  float local_c;
  float local_8;
  
  local_8 = *(float *)(*(int *)(DAT_004efc94 + 0x48) + 0x80);
  iVar1 = *(int *)(param_1 + 0x10);
  if (iVar1 == 0) {
    if (*(int *)(*(int *)(param_1 + 0x24) + 0x14) == *(int *)(param_1 + 0x14)) {
      *(undefined4 *)(param_1 + 0x10) = 1;
      *(float *)(param_1 + 0x20) = local_8;
      local_c = local_8 - *(float *)(param_1 + 0x20);
      if (local_c < _DAT_00458c4c) {
        local_c = 0.05;
      }
      puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
      FUN_0040aadc(local_3c);
      local_3c[0] = local_c;
      local_28 = local_c;
      local_14 = local_c;
      FUN_0040b0ac((int)local_3c,3,*(undefined4 **)(param_1 + 0x38));
      FUN_0040beb0(puVar2,local_3c);
      FUN_0048ac30(*(int *)(param_1 + 0x28),1);
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0x28));
      FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x2c));
    }
  }
  else if (iVar1 == 1) {
    local_c = local_8 - *(float *)(param_1 + 0x20);
    if (local_c < _DAT_00458c4c) {
      local_c = 0.05;
    }
    if (_DAT_00458c50 <= local_c) {
      local_c = 1.0;
      *(undefined4 *)(param_1 + 0x10) = 2;
    }
    puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
    FUN_0040aadc(local_6c);
    local_6c[0] = local_c;
    local_58 = local_c;
    local_44 = local_c;
    FUN_0040b0ac((int)local_6c,3,*(undefined4 **)(param_1 + 0x38));
    FUN_0040beb0(puVar2,local_6c);
    FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x2c));
  }
  else if (iVar1 == 2) {
    if (_DAT_00458c54 <= local_8 - *(float *)(param_1 + 0x20)) {
      *(undefined4 *)(param_1 + 0x10) = 3;
      *(float *)(param_1 + 0x20) = local_8 + _DAT_00458c50;
    }
  }
  else if (iVar1 == 3) {
    local_c = *(float *)(param_1 + 0x20) - local_8;
    if (local_c < _DAT_00458c4c) {
      local_c = 0.05;
      FUN_0048ac30(*(int *)(param_1 + 0x28),0);
      FUN_0048d5d4(*(undefined4 **)(param_1 + 0x28));
      *(undefined4 *)(param_1 + 0x10) = 0;
    }
    puVar2 = (undefined4 *)FUN_0048a630(*(int *)(param_1 + 0x2c));
    FUN_0040aadc(local_9c);
    local_9c[0] = local_c;
    local_88 = local_c;
    local_74 = local_c;
    FUN_0040b0ac((int)local_9c,3,*(undefined4 **)(param_1 + 0x38));
    FUN_0040beb0(puVar2,local_9c);
    FUN_0045fbf4(*(int *)(DAT_004efc94 + 0x48),*(undefined4 *)(param_1 + 0x2c));
  }
  return;
}



/* @00458c58 file=munga_l4/l4vidrnd.cpp name=FUN_00458c58 */

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

{
  uint uVar1;
  int iVar2;
  undefined4 *puVar3;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1658;
  if (param_4 == (undefined4 *)0x0) {
    FUN_0040385c(s_A_pfx_was_not_defined_in_the__in_004f15be,
                 s_d__tesla_bt_munga_l4_L4VIDRND_CP_004f15e6,0x182a);
  }
  puVar3 = param_1 + 7;
  for (iVar2 = 0x41; iVar2 != 0; iVar2 = iVar2 + -1) {
    *puVar3 = *param_4;
    param_4 = param_4 + 1;
    puVar3 = puVar3 + 1;
  }
  uVar1 = FUN_00460ae4(param_1[4]);
  param_1[7] = uVar1 | param_1[7] & 0xffff0000;
  FUN_0048d060(1,param_5,param_1 + 7);
  return param_1;
}



/* @00458cd4 file=? name=FUN_00458cd4 */

void __cdecl FUN_00458cd4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004f1658;
    FUN_0048d060(2,0,param_1 + 7);
    FUN_00453198(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00458d10 file=? name=FUN_00458d10 */

undefined4 __cdecl FUN_00458d10(int param_1)

{
  FUN_004531c4(param_1);
  return 1;
}



/* @00458d24 file=? name=FUN_00458d24 */

void FUN_00458d24(void)

{
  return;
}



/* @00458d2c file=? name=FUN_00458d2c */

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

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  
  FUN_004530ec(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004f1640;
  param_1[0xe] = param_4;
  param_1[0xb] = param_5;
  param_1[0xf] = param_6;
  param_1[8] = param_7;
  param_1[7] = 0;
  iVar1 = FUN_00498448(s_tsphere_004f1608,0);
  uVar2 = FUN_00489724();
  param_1[0xc] = uVar2;
  iVar3 = FUN_00489708();
  param_1[0xd] = iVar3;
  FUN_00489ba8(iVar3);
  FUN_0048a714(param_1[0xd],param_1[0xe]);
  FUN_0048ab0c(param_1[0xc],iVar1);
  FUN_0048ad48(param_1[0xc],1);
  FUN_0048add4(param_1[0xc],0);
  FUN_0048ac30(param_1[0xc],0);
  FUN_00489e04(param_1[0xd],param_1[0xc]);
  FUN_0048d5d4((undefined4 *)param_1[0xc]);
  FUN_0048d3e8((undefined4 *)param_1[0xd]);
  (**(code **)(*(int *)(param_1[0xb] + 0x2c) + 4))(param_1[0xb] + 0x2c,param_1);
  return param_1;
}



/* @00458e1c file=? name=FUN_00458e1c */

void __cdecl FUN_00458e1c(int *param_1,byte param_2)

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



/* @00458e48 file=? name=FUN_00458e48 */

undefined4 __cdecl FUN_00458e48(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



