/* @0044283c file=? name=FUN_0044283c */

undefined4 FUN_0044283c(void)

{
  return 1;
}



/* @00442848 file=? name=FUN_00442848 */

undefined4 * __cdecl FUN_00442848(undefined4 *param_1)

{
  FUN_004178cc(param_1,0x41);
  *param_1 = &PTR_FUN_004edc60;
  FUN_00442a46(param_1 + 3,param_1);
  return param_1;
}



/* @00442874 file=? name=FUN_00442874 */

void __cdecl FUN_00442874(int *param_1,byte param_2)

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



/* @004428b0 file=? name=FUN_004428b0 */

undefined4 FUN_004428b0(void)

{
  return 1;
}



/* @004428bc file=? name=FUN_004428bc */

int __cdecl FUN_004428bc(int param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  int local_10 [3];
  
  FUN_0044316d(local_10,param_1 + 0xc);
  do {
    iVar2 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar2 == 0) {
      iVar2 = 0;
      FUN_004431ab(local_10,2);
      return iVar2;
    }
    iVar1 = FUN_004d4b58((char *)(iVar2 + 0xc),param_2);
  } while (iVar1 != 0);
  FUN_004431ab(local_10,2);
  return iVar2;
}



/* @0044292c file=? name=FUN_0044292c */

int __cdecl FUN_0044292c(int param_1,int param_2)

{
  int iVar1;
  int local_10 [3];
  
  FUN_0044316d(local_10,param_1 + 0xc);
  do {
    iVar1 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar1 == 0) {
      iVar1 = 0;
      FUN_004431ab(local_10,2);
      return iVar1;
    }
  } while (param_2 != *(int *)(iVar1 + 0x2c));
  FUN_004431ab(local_10,2);
  return iVar1;
}



/* @00442990 file=? name=FUN_00442990 */

undefined4 * __cdecl FUN_00442990(undefined4 *param_1)

{
  *param_1 = &PTR_FUN_004edc58;
  FUN_00442aa0(param_1 + 1);
  FUN_00442cdf(param_1 + 8);
  FUN_00442f1e(param_1 + 0xf);
  return param_1;
}



/* @004429c0 file=? name=FUN_004429c0 */

void __cdecl FUN_004429c0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edc58;
    (**(code **)(*param_1 + 4))(param_1);
    FUN_00442f37(param_1 + 0xf,2);
    FUN_00442cf8(param_1 + 8,2);
    FUN_00442ab9(param_1 + 1,2);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00442a14 file=? name=FUN_00442a14 */

void __cdecl FUN_00442a14(int param_1)

{
  FUN_00442c82(param_1 + 4);
  FUN_00442ec1(param_1 + 0x20);
  FUN_00443100(param_1 + 0x3c);
  return;
}



/* @00442a3c file=? name=FUN_00442a3c */

undefined4 FUN_00442a3c(void)

{
  return 1;
}



/* @00442a46 file=? name=FUN_00442a46 */

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

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



/* @00442a65 file=? name=FUN_00442a65 */

void __cdecl FUN_00442a65(int *param_1,byte param_2)

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



/* @00442a91 file=? name=FUN_00442a91 */

void FUN_00442a91(void)

{
  FUN_004428b0();
  return;
}



/* @00442aa0 file=? name=FUN_00442aa0 */

undefined4 * __cdecl FUN_00442aa0(undefined4 *param_1)

{
  FUN_00442848(param_1);
  *param_1 = &PTR_FUN_004edc44;
  return param_1;
}



/* @00442ab9 file=? name=FUN_00442ab9 */

void __cdecl FUN_00442ab9(int *param_1,byte param_2)

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



/* @00442aec file=? name=FUN_00442aec */

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

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  iVar1 = FUN_004428bc(param_1,param_2);
  if (iVar1 == 0) {
    puVar2 = FUN_00449148(param_2);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar3 = (undefined4 *)FUN_00402298(0x3c);
      if (puVar3 == (undefined4 *)0x0) {
        puVar3 = (undefined4 *)0x0;
      }
      else {
        puVar3 = FUN_004431d7(puVar3,param_2,puVar2,param_3);
      }
      (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar3);
    }
  }
  else {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    puVar2 = *(undefined4 **)(iVar1 + 0x38);
  }
  return puVar2;
}



/* @00442b5c file=? name=FUN_00442b5c */

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

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = FUN_0044292c(param_1,param_2);
  if (iVar1 == 0) {
    iVar1 = FUN_004491ac();
    if (iVar1 == 0) {
      iVar1 = 0;
    }
    else {
      puVar2 = (undefined4 *)FUN_00402298(0x3c);
      if (puVar2 == (undefined4 *)0x0) {
        puVar2 = (undefined4 *)0x0;
      }
      else {
        puVar2 = FUN_00443200(puVar2,param_2,iVar1,param_3);
      }
      (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar2);
    }
  }
  else {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    iVar1 = *(int *)(iVar1 + 0x38);
  }
  return iVar1;
}



/* @00442bcc file=? name=FUN_00442bcc */

undefined4 __cdecl FUN_00442bcc(int param_1,char *param_2)

{
  int iVar1;
  
  iVar1 = FUN_004428bc(param_1,param_2);
  if (iVar1 != 0) {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    return *(undefined4 *)(iVar1 + 0x38);
  }
  return 0;
}



/* @00442bef file=? name=FUN_00442bef */

undefined4 __cdecl FUN_00442bef(int param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_0044292c(param_1,param_2);
  if (iVar1 != 0) {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    return *(undefined4 *)(iVar1 + 0x38);
  }
  return 0;
}



/* @00442c12 file=? name=FUN_00442c12 */

void __cdecl FUN_00442c12(int param_1,char *param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_004428bc(param_1,param_2);
  if ((((puVar1 != (undefined4 *)0x0) && (puVar1[0xc] = puVar1[0xc] + -1, (int)puVar1[0xc] < 1)) &&
      (puVar1[0xd] == 0)) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @00442c4a file=? name=FUN_00442c4a */

void __cdecl FUN_00442c4a(int param_1,int param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0044292c(param_1,param_2);
  if ((((puVar1 != (undefined4 *)0x0) && (puVar1[0xc] = puVar1[0xc] + -1, (int)puVar1[0xc] < 1)) &&
      (puVar1[0xd] == 0)) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @00442c82 file=? name=FUN_00442c82 */

void __cdecl FUN_00442c82(int param_1)

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



/* @00442cd0 file=? name=FUN_00442cd0 */

void FUN_00442cd0(void)

{
  FUN_004428b0();
  return;
}



/* @00442cdf file=? name=FUN_00442cdf */

undefined4 * __cdecl FUN_00442cdf(undefined4 *param_1)

{
  FUN_00442848(param_1);
  *param_1 = &PTR_FUN_004edc38;
  return param_1;
}



/* @00442cf8 file=? name=FUN_00442cf8 */

void __cdecl FUN_00442cf8(int *param_1,byte param_2)

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



/* @00442d2b file=? name=FUN_00442d2b */

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

{
  int iVar1;
  int *piVar2;
  undefined4 *puVar3;
  
  iVar1 = FUN_004428bc(param_1,param_2);
  if (iVar1 == 0) {
    piVar2 = FUN_00449c1c(param_2);
    if (piVar2 == (int *)0x0) {
      piVar2 = (int *)0x0;
    }
    else {
      puVar3 = (undefined4 *)FUN_00402298(0x3c);
      if (puVar3 == (undefined4 *)0x0) {
        puVar3 = (undefined4 *)0x0;
      }
      else {
        puVar3 = FUN_0044327a(puVar3,param_2,piVar2,param_3);
      }
      (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar3);
    }
  }
  else {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    piVar2 = *(int **)(iVar1 + 0x38);
  }
  return piVar2;
}



/* @00442d9b file=? name=FUN_00442d9b */

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

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = FUN_0044292c(param_1,param_2);
  if (iVar1 == 0) {
    iVar1 = FUN_00449c80();
    if (iVar1 == 0) {
      iVar1 = 0;
    }
    else {
      puVar2 = (undefined4 *)FUN_00402298(0x3c);
      if (puVar2 == (undefined4 *)0x0) {
        puVar2 = (undefined4 *)0x0;
      }
      else {
        puVar2 = FUN_004432a3(puVar2,param_2,iVar1,param_3);
      }
      (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar2);
    }
  }
  else {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    iVar1 = *(int *)(iVar1 + 0x38);
  }
  return iVar1;
}



/* @00442e0b file=? name=FUN_00442e0b */

undefined4 __cdecl FUN_00442e0b(int param_1,char *param_2)

{
  int iVar1;
  
  iVar1 = FUN_004428bc(param_1,param_2);
  if (iVar1 != 0) {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    return *(undefined4 *)(iVar1 + 0x38);
  }
  return 0;
}



/* @00442e2e file=? name=FUN_00442e2e */

undefined4 __cdecl FUN_00442e2e(int param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_0044292c(param_1,param_2);
  if (iVar1 != 0) {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    return *(undefined4 *)(iVar1 + 0x38);
  }
  return 0;
}



/* @00442e51 file=? name=FUN_00442e51 */

void __cdecl FUN_00442e51(int param_1,char *param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_004428bc(param_1,param_2);
  if ((((puVar1 != (undefined4 *)0x0) && (puVar1[0xc] = puVar1[0xc] + -1, (int)puVar1[0xc] < 1)) &&
      (puVar1[0xd] == 0)) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @00442e89 file=? name=FUN_00442e89 */

void __cdecl FUN_00442e89(int param_1,int param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0044292c(param_1,param_2);
  if ((((puVar1 != (undefined4 *)0x0) && (puVar1[0xc] = puVar1[0xc] + -1, (int)puVar1[0xc] < 1)) &&
      (puVar1[0xd] == 0)) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @00442ec1 file=? name=FUN_00442ec1 */

void __cdecl FUN_00442ec1(int param_1)

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



/* @00442f0f file=? name=FUN_00442f0f */

void FUN_00442f0f(void)

{
  FUN_004428b0();
  return;
}



/* @00442f1e file=? name=FUN_00442f1e */

undefined4 * __cdecl FUN_00442f1e(undefined4 *param_1)

{
  FUN_00442848(param_1);
  *param_1 = &PTR_FUN_004edc2c;
  return param_1;
}



/* @00442f37 file=? name=FUN_00442f37 */

void __cdecl FUN_00442f37(int *param_1,byte param_2)

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



/* @00442f6a file=? name=FUN_00442f6a */

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

{
  int iVar1;
  int *piVar2;
  undefined4 *puVar3;
  
  iVar1 = FUN_004428bc(param_1,param_2);
  if (iVar1 == 0) {
    piVar2 = FUN_004498b4(param_2);
    if (piVar2 == (int *)0x0) {
      piVar2 = (int *)0x0;
    }
    else {
      puVar3 = (undefined4 *)FUN_00402298(0x3c);
      if (puVar3 == (undefined4 *)0x0) {
        puVar3 = (undefined4 *)0x0;
      }
      else {
        puVar3 = FUN_0044331a(puVar3,param_2,piVar2,param_3);
      }
      (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar3);
    }
  }
  else {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    piVar2 = *(int **)(iVar1 + 0x38);
  }
  return piVar2;
}



/* @00442fda file=? name=FUN_00442fda */

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

{
  int iVar1;
  undefined4 *puVar2;
  
  iVar1 = FUN_0044292c(param_1,param_2);
  if (iVar1 == 0) {
    iVar1 = FUN_00449918();
    if (iVar1 == 0) {
      iVar1 = 0;
    }
    else {
      puVar2 = (undefined4 *)FUN_00402298(0x3c);
      if (puVar2 == (undefined4 *)0x0) {
        puVar2 = (undefined4 *)0x0;
      }
      else {
        puVar2 = FUN_00443343(puVar2,param_2,iVar1,param_3);
      }
      (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar2);
    }
  }
  else {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    iVar1 = *(int *)(iVar1 + 0x38);
  }
  return iVar1;
}



/* @0044304a file=? name=FUN_0044304a */

undefined4 __cdecl FUN_0044304a(int param_1,char *param_2)

{
  int iVar1;
  
  iVar1 = FUN_004428bc(param_1,param_2);
  if (iVar1 != 0) {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    return *(undefined4 *)(iVar1 + 0x38);
  }
  return 0;
}



/* @0044306d file=? name=FUN_0044306d */

undefined4 __cdecl FUN_0044306d(int param_1,int param_2)

{
  int iVar1;
  
  iVar1 = FUN_0044292c(param_1,param_2);
  if (iVar1 != 0) {
    *(int *)(iVar1 + 0x30) = *(int *)(iVar1 + 0x30) + 1;
    return *(undefined4 *)(iVar1 + 0x38);
  }
  return 0;
}



/* @00443090 file=? name=FUN_00443090 */

void __cdecl FUN_00443090(int param_1,char *param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_004428bc(param_1,param_2);
  if ((((puVar1 != (undefined4 *)0x0) && (puVar1[0xc] = puVar1[0xc] + -1, (int)puVar1[0xc] < 1)) &&
      (puVar1[0xd] == 0)) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @004430c8 file=? name=FUN_004430c8 */

void __cdecl FUN_004430c8(int param_1,int param_2)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_0044292c(param_1,param_2);
  if ((((puVar1 != (undefined4 *)0x0) && (puVar1[0xc] = puVar1[0xc] + -1, (int)puVar1[0xc] < 1)) &&
      (puVar1[0xd] == 0)) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @00443100 file=? name=FUN_00443100 */

void __cdecl FUN_00443100(int param_1)

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



/* @0044314e file=? name=FUN_0044314e */

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

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



/* @0044316d file=? name=FUN_0044316d */

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

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



/* @0044318c file=? name=FUN_0044318c */

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

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



/* @004431ab file=? name=FUN_004431ab */

void __cdecl FUN_004431ab(int *param_1,byte param_2)

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



/* @004431d7 file=? name=FUN_004431d7 */

undefined4 * __cdecl
FUN_004431d7(undefined4 *param_1,char *param_2,undefined4 param_3,undefined4 param_4)

{
  FUN_00442780(param_1,param_2,param_4);
  *param_1 = &PTR_FUN_004edbd8;
  param_1[0xe] = param_3;
  return param_1;
}



/* @00443200 file=? name=FUN_00443200 */

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

{
  FUN_004427dc(param_1,param_2,param_4);
  *param_1 = &PTR_FUN_004edbd8;
  param_1[0xe] = param_3;
  return param_1;
}



/* @00443229 file=? name=FUN_00443229 */

void __cdecl FUN_00443229(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edbd8;
    puVar1 = (undefined4 *)param_1[0xe];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0xe] = 0;
    FUN_00442810(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044326b file=? name=FUN_0044326b */

void FUN_0044326b(void)

{
  FUN_0044283c();
  return;
}



/* @0044327a file=? name=FUN_0044327a */

undefined4 * __cdecl
FUN_0044327a(undefined4 *param_1,char *param_2,undefined4 param_3,undefined4 param_4)

{
  FUN_00442780(param_1,param_2,param_4);
  *param_1 = &PTR_FUN_004edbd4;
  param_1[0xe] = param_3;
  return param_1;
}



/* @004432a3 file=? name=FUN_004432a3 */

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

{
  FUN_004427dc(param_1,param_2,param_4);
  *param_1 = &PTR_FUN_004edbd4;
  param_1[0xe] = param_3;
  return param_1;
}



/* @004432cc file=? name=FUN_004432cc */

void __cdecl FUN_004432cc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edbd4;
    FUN_00449d0c((int *)param_1[0xe],3);
    param_1[0xe] = 0;
    FUN_00442810(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044330b file=? name=FUN_0044330b */

void FUN_0044330b(void)

{
  FUN_0044283c();
  return;
}



/* @0044331a file=? name=FUN_0044331a */

undefined4 * __cdecl
FUN_0044331a(undefined4 *param_1,char *param_2,undefined4 param_3,undefined4 param_4)

{
  FUN_00442780(param_1,param_2,param_4);
  *param_1 = &PTR_FUN_004edbd0;
  param_1[0xe] = param_3;
  return param_1;
}



/* @00443343 file=? name=FUN_00443343 */

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

{
  FUN_004427dc(param_1,param_2,param_4);
  *param_1 = &PTR_FUN_004edbd0;
  param_1[0xe] = param_3;
  return param_1;
}



/* @0044336c file=? name=FUN_0044336c */

void __cdecl FUN_0044336c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edbd0;
    FUN_00449994((int *)param_1[0xe],3);
    param_1[0xe] = 0;
    FUN_00442810(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004433ab file=? name=FUN_004433ab */

void FUN_004433ab(void)

{
  FUN_0044283c();
  return;
}



/* @004433bc file=? name=FUN_004433bc */

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

float10 FUN_004433bc(void)

{
  float fVar1;
  float fVar2;
  uint uVar3;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  uVar3 = FUN_004dcd94();
  local_8 = (float)(int)((uVar3 ^ (int)uVar3 >> 0x1f) - ((int)uVar3 >> 0x1f));
  uVar3 = FUN_004dcd94();
  fVar1 = (float)(int)((uVar3 ^ (int)uVar3 >> 0x1f) - ((int)uVar3 >> 0x1f));
  uVar3 = FUN_004dcd94();
  fVar2 = (float)(int)((uVar3 ^ (int)uVar3 >> 0x1f) - ((int)uVar3 >> 0x1f));
  local_c = fVar1;
  if (local_8 < fVar1) {
    local_c = local_8;
    local_8 = fVar1;
  }
  local_10 = fVar2;
  if (local_8 < fVar2) {
    local_10 = local_8;
    local_8 = fVar2;
  }
  return ((float10)local_c + (float10)local_10) * (float10)_DAT_00443470 + (float10)local_8;
}



/* @00443474 file=? name=FUN_00443474 */

undefined4 * __cdecl FUN_00443474(undefined4 *param_1)

{
  FUN_004178cc(param_1,0x37);
  *param_1 = &PTR_FUN_004edc90;
  FUN_00443edc(param_1 + 3,param_1);
  return param_1;
}



/* @004434a0 file=? name=FUN_004434a0 */

void __cdecl FUN_004434a0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edc90;
    FUN_004435ac((int)param_1);
    FUN_00443efb(param_1 + 3,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004434e4 file=? name=FUN_004434e4 */

void FUN_004434e4(void)

{
  FUN_00415f1c();
  return;
}



/* @004434f4 file=? name=FUN_004434f4 */

void __cdecl FUN_004434f4(int param_1,undefined4 param_2)

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



/* @00443510 file=? name=FUN_00443510 */

void __cdecl FUN_00443510(int param_1,int param_2)

{
  int iVar1;
  int local_10 [3];
  
  FUN_0042ac3b(local_10,param_1 + 0xc);
  do {
    iVar1 = (**(code **)(local_10[0] + 0x30))(local_10);
    if (iVar1 == 0) {
LAB_0044355d:
      FUN_0042ac79(local_10,2);
      return;
    }
    if (param_2 == iVar1) {
      (**(code **)(local_10[0] + 0x48))(local_10);
      goto LAB_0044355d;
    }
    (**(code **)(local_10[0] + 0xc))(local_10);
  } while( true );
}



/* @00443574 file=? name=FUN_00443574 */

undefined4 __cdecl FUN_00443574(int param_1)

{
  undefined4 uVar1;
  int local_10 [3];
  
  FUN_0042ac3b(local_10,param_1 + 0xc);
  uVar1 = (**(code **)(local_10[0] + 0x14))(local_10);
  FUN_0042ac79(local_10,2);
  return uVar1;
}



/* @004435ac file=? name=FUN_004435ac */

void __cdecl FUN_004435ac(int param_1)

{
  int iVar1;
  int local_10 [3];
  
  FUN_0042ac3b(local_10,param_1 + 0xc);
  while( true ) {
    iVar1 = (**(code **)(local_10[0] + 0x30))(local_10);
    if (iVar1 == 0) break;
    (**(code **)(local_10[0] + 0x48))(local_10);
  }
  FUN_0042ac79(local_10,2);
  return;
}



/* @004435f4 file=? name=FUN_004435f4 */

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

{
  int iVar1;
  int iVar2;
  int iVar3;
  int local_14 [3];
  int local_8;
  
  FUN_0042ac3b(local_14,param_1 + 0xc);
  iVar3 = 0;
LAB_00443642:
  iVar2 = (**(code **)(local_14[0] + 0x28))(local_14);
  if (iVar2 == 0) {
    FUN_0042ac79(local_14,2);
    return iVar3;
  }
  if (param_3 != 0) goto code_r0x0044361b;
  goto LAB_00443634;
code_r0x0044361b:
  local_8 = param_3;
  iVar1 = FUN_0041a1a4(**(int **)(iVar2 + 0xc),param_3);
  if (iVar1 != 0) {
LAB_00443634:
    FUN_004434f4(param_2,iVar2);
    iVar3 = iVar3 + 1;
  }
  goto LAB_00443642;
}



/* @0044366c file=? name=FUN_0044366c */

int __cdecl
FUN_0044366c(int param_1,int param_2,float param_3,undefined4 param_4,float param_5,float param_6,
            undefined4 param_7,float param_8,int param_9)

{
  int iVar1;
  int iVar2;
  float local_20 [2];
  float local_18;
  int local_14 [3];
  int local_8;
  
  FUN_0042ac3b(local_14,param_1 + 0xc);
  local_8 = 0;
LAB_004436fa:
  iVar2 = (**(code **)(local_14[0] + 0x28))(local_14);
  if (iVar2 == 0) {
    FUN_0042ac79(local_14,2);
    return local_8;
  }
  if (param_9 != 0) goto code_r0x00443696;
  goto LAB_004436ab;
code_r0x00443696:
  iVar1 = FUN_0041a1a4(**(int **)(iVar2 + 0xc),param_9);
  if (iVar1 != 0) {
LAB_004436ab:
    FUN_00408440(local_20,(undefined4 *)(iVar2 + 0x100));
    if ((((param_5 <= local_18) && (local_18 <= param_8)) && (param_3 <= local_20[0])) &&
       (local_20[0] <= param_6)) {
      FUN_004434f4(param_2,iVar2);
      local_8 = local_8 + 1;
    }
  }
  goto LAB_004436fa;
}



/* @00443728 file=? name=FUN_00443728 */

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

int __cdecl FUN_00443728(int param_1,int param_2,undefined4 param_3,float param_4,int param_5)

{
  int iVar1;
  int iVar2;
  float10 fVar3;
  undefined4 local_20 [3];
  int local_14 [3];
  int local_8;
  
  FUN_0042ac3b(local_14,param_1 + 0xc);
  local_8 = 0;
LAB_004437a8:
  iVar2 = (**(code **)(local_14[0] + 0x28))(local_14);
  if (iVar2 == 0) {
    FUN_0042ac79(local_14,2);
    return local_8;
  }
  if (param_5 != 0) goto code_r0x00443752;
  goto LAB_00443767;
code_r0x00443752:
  iVar1 = FUN_0041a1a4(**(int **)(iVar2 + 0xc),param_5);
  if (iVar1 != 0) {
LAB_00443767:
    FUN_00408440(local_20,(undefined4 *)(iVar2 + 0x100));
    fVar3 = FUN_004433bc();
    if (fVar3 - (float10)_DAT_004437d4 <= (float10)param_4) {
      FUN_004434f4(param_2,iVar2);
      local_8 = local_8 + 1;
    }
  }
  goto LAB_004437a8;
}



/* @004437d8 file=? name=FUN_004437d8 */

undefined4 * __cdecl FUN_004437d8(undefined4 *param_1)

{
  FUN_004de998(param_1 + 6,0x1c,0x1000,1,FUN_00443474);
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  return param_1;
}



/* @0044381c file=? name=FUN_0044381c */

void __cdecl FUN_0044381c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    FUN_00443998(param_1);
    FUN_004de8d4(param_1 + 6,0x1c,0x1000,1,FUN_004434a0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00443858 file=? name=FUN_00443858 */

undefined4 FUN_00443858(void)

{
  return 1;
}



/* @00443864 file=? name=FUN_00443864 */

void __cdecl FUN_00443864(float *param_1,int param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int iVar4;
  int iVar5;
  
  fVar1 = *(float *)(param_2 + 0x100);
  fVar2 = *(float *)(param_2 + 0x104);
  fVar3 = *(float *)(param_2 + 0x108);
  iVar4 = FUN_00443e94();
  iVar5 = FUN_00443e94();
  FUN_004434f4((int)(param_1 + iVar4 * 0x1c0 + iVar5 * 7 + 6),param_2);
  if (fVar1 < *param_1) {
    *param_1 = fVar1;
  }
  if (fVar2 < param_1[1]) {
    param_1[1] = fVar2;
  }
  if (fVar3 < param_1[2]) {
    param_1[2] = fVar3;
  }
  if (param_1[3] < fVar1) {
    param_1[3] = fVar1;
  }
  if (param_1[4] < fVar2) {
    param_1[4] = fVar2;
  }
  if (param_1[5] < fVar3) {
    param_1[5] = fVar3;
  }
  return;
}



/* @00443930 file=? name=FUN_00443930 */

void __cdecl FUN_00443930(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  
  iVar1 = FUN_00443e94();
  iVar2 = FUN_00443e94();
  FUN_00443510(iVar1 * 0x700 + param_1 + iVar2 * 0x1c + 0x18,param_2);
  return;
}



/* @00443998 file=? name=FUN_00443998 */

void __cdecl FUN_00443998(undefined4 *param_1)

{
  int iVar1;
  int iVar2;
  
  iVar2 = 0;
  do {
    iVar1 = 0;
    do {
      FUN_004435ac((int)(param_1 + iVar1 * 0x1c0 + iVar2 * 7 + 6));
      iVar1 = iVar1 + 1;
    } while (iVar1 < 0x40);
    iVar2 = iVar2 + 1;
  } while (iVar2 < 0x40);
  *param_1 = 0;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  return;
}



/* @004439f8 file=? name=FUN_004439f8 */

void __cdecl FUN_004439f8(int param_1)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  uint local_8;
  
  uVar4 = 0;
  local_8 = 0;
  do {
    if ((int)uVar4 < 10) {
      FUN_004dbb24(&DAT_00524e20,&DAT_004edc70,(char *)0x0);
    }
    piVar1 = FUN_004db78c(&DAT_00524e20,uVar4);
    FUN_004dbb24(piVar1,&DAT_004edc72,(char *)0x0);
    iVar3 = 0;
    do {
      uVar2 = FUN_00443574(iVar3 * 0x700 + param_1 + uVar4 * 0x1c + 0x18);
      local_8 = local_8 + uVar2;
      if ((int)uVar2 < 100) {
        FUN_004dbb24(&DAT_00524e20,&DAT_004edc74,(char *)0x0);
        if ((int)uVar2 < 10) {
          FUN_004dbb24(&DAT_00524e20,&DAT_004edc76,(char *)0x0);
        }
      }
      piVar1 = FUN_004db78c(&DAT_00524e20,uVar2);
      FUN_004dbb24(piVar1,&DAT_004edc78,(char *)0x0);
      iVar3 = iVar3 + 1;
    } while (iVar3 < 0x40);
    FUN_004dbb24(&DAT_00524e20,&DAT_004edc7a,(char *)0x0);
    uVar4 = uVar4 + 1;
  } while ((int)uVar4 < 0x40);
  FUN_004dbb24(&DAT_00524e20,s_Total__004edc7c,(char *)0x0);
  piVar1 = FUN_004db78c(&DAT_00524e20,local_8);
  FUN_004dbb24(piVar1,&DAT_004edc84,(char *)0x0);
  return;
}



/* @00443b28 file=? name=FUN_00443b28 */

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

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 local_8;
  
  iVar4 = 0;
  local_8 = 0;
  iVar3 = 0;
  iVar2 = local_8;
  do {
    do {
      iVar1 = FUN_004435f4(iVar2 * 0x700 + param_1 + iVar3 * 0x1c + 0x18,param_2,param_3);
      iVar4 = iVar4 + iVar1;
      iVar2 = iVar2 + 1;
    } while (iVar2 < 0x3f);
    iVar3 = iVar3 + 1;
    iVar2 = local_8;
  } while (iVar3 < 0x3f);
  return iVar4;
}



/* @00443ba4 file=? name=FUN_00443ba4 */

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

int __cdecl
FUN_00443ba4(int param_1,int param_2,float param_3,undefined4 param_4,float param_5,float param_6,
            undefined4 param_7,float param_8,int param_9)

{
  int iVar1;
  int iVar2;
  int iVar3;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  local_14 = 0;
  iVar2 = FUN_00443e94();
  local_10 = FUN_00443e94();
  if (iVar2 < 0) {
    iVar2 = 0;
  }
  else if (0x3f < iVar2) {
    iVar2 = 0x3f;
  }
  if (local_10 < 0) {
    local_10 = 0;
  }
  else if (0x3f < local_10) {
    local_10 = 0x3f;
  }
  local_8 = FUN_00443e94();
  local_c = FUN_00443e94();
  if (local_8 < 0) {
    local_8 = 0;
  }
  else if (0x3f < local_8) {
    local_8 = 0x3f;
  }
  if (local_c < 0) {
    local_c = 0;
  }
  else if (0x3f < local_c) {
    local_c = 0x3f;
  }
  for (; iVar1 = local_8, iVar2 < local_10; iVar2 = iVar2 + 1) {
    for (; iVar1 < local_c; iVar1 = iVar1 + 1) {
      iVar3 = FUN_0044366c(iVar1 * 0x700 + param_1 + iVar2 * 0x1c + 0x18,param_2,param_3,param_4,
                           param_5,param_6,param_7,param_8,param_9);
      local_14 = local_14 + iVar3;
    }
  }
  return local_14;
}



/* @00443e94 file=? name=FUN_00443e94 */

int FUN_00443e94(void)

{
  int iVar1;
  
  iVar1 = FUN_004dcd94();
  iVar1 = iVar1 + 0x20;
  if (iVar1 < 0) {
    iVar1 = 0;
  }
  if (0x3f < iVar1) {
    iVar1 = 0x3f;
  }
  return iVar1;
}



/* @00443edc file=? name=FUN_00443edc */

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

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



/* @00443efb file=? name=FUN_00443efb */

void __cdecl FUN_00443efb(int *param_1,byte param_2)

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



/* @00443f28 file=? name=FUN_00443f28 */

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

{
  FUN_004178cc(param_1,0x23);
  *param_1 = &PTR_FUN_004ee184;
  param_1[3] = 0;
  param_1[6] = param_2;
  param_1[5] = param_4;
  param_1[7] = param_3;
  param_1[8] = param_5;
  param_1[4] = 1;
  if (param_1[7] != 0) {
    FUN_00447fa0(param_1[7],param_1);
  }
  return param_1;
}



/* @00443f7c file=? name=FUN_00443f7c */

void __cdecl FUN_00443f7c(int *param_1,byte param_2)

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



/* @00443fa8 file=? name=FUN_00443fa8 */

undefined4 FUN_00443fa8(void)

{
  return 1;
}



/* @00443fb4 file=? name=FUN_00443fb4 */

void __cdecl FUN_00443fb4(int *param_1)

{
  char *pcVar1;
  
  pcVar1 = (char *)param_1[8];
  FUN_004dbb24(&DAT_00524e20,s_BecameActive___has_not_been_defi_004ede69,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,pcVar1,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s____About_to_call_Inactivate___004ede93,(char *)0x0);
  (**(code **)(*param_1 + 0x14))(param_1);
  return;
}



/* @00444004 file=? name=FUN_00444004 */

void FUN_00444004(void)

{
  return;
}



/* @0044400c file=? name=FUN_0044400c */

void __cdecl FUN_0044400c(int *param_1)

{
  if (param_1[7] != 0) {
    FUN_004480b0(param_1[7],param_1);
  }
  return;
}



/* @00444028 file=? name=FUN_00444028 */

undefined4 __cdecl FUN_00444028(int *param_1)

{
  char *pcVar1;
  
  pcVar1 = (char *)param_1[8];
  FUN_004dbb24(&DAT_00524e20,s_Update___has_not_been_defined_fo_004edeb2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,pcVar1,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s____About_to_call_Inactivate___004eded6,(char *)0x0);
  (**(code **)(*param_1 + 0x14))(param_1);
  return 0;
}



/* @00444078 file=? name=FUN_00444078 */

void FUN_00444078(void)

{
  return;
}



/* @00444080 file=? name=FUN_00444080 */

void FUN_00444080(void)

{
  return;
}



/* @00444088 file=? name=FUN_00444088 */

void FUN_00444088(void)

{
  return;
}



/* @00444090 file=? name=FUN_00444090 */

void FUN_00444090(void)

{
  return;
}



/* @00444098 file=? name=FUN_00444098 */

void FUN_00444098(void)

{
  return;
}



/* @004440a0 file=? name=FUN_004440a0 */

undefined4 FUN_004440a0(void)

{
  return 0;
}



/* @004440a8 file=? name=FUN_004440a8 */

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

{
  FUN_00443f28(param_1,param_2,param_3,param_4,param_5);
  *param_1 = &PTR_FUN_004ee150;
  return param_1;
}



/* @004440d4 file=? name=FUN_004440d4 */

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

{
  undefined4 *puVar1;
  
  FUN_004440a8(param_1,param_2,param_3,param_4,param_6);
  *param_1 = &PTR_FUN_004ee11c;
  if (param_3 == 0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = (undefined4 *)FUN_00447f84(param_3,param_5);
  }
  FUN_0044ad78(param_1 + 9,puVar1);
  return param_1;
}



/* @00444124 file=? name=FUN_00444124 */

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

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



/* @00444148 file=? name=FUN_00444148 */

void __cdecl FUN_00444148(int *param_1,byte param_2)

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



/* @00444174 file=? name=FUN_00444174 */

undefined4 FUN_00444174(void)

{
  return 1;
}



/* @00444180 file=munga/gauge.cpp name=FUN_00444180 */

void FUN_00444180(void)

{
  FUN_0040385c(s_GaugeConnection__Update_should_n_004edef5,s_d__tesla_bt_munga_GAUGE_CPP_004edf24,
               0xe2);
  return;
}



/* @0044419c file=? name=FUN_0044419c */

void __cdecl FUN_0044419c(int param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_GaugeConnection__004edf40,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar5 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar5 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar5;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar5 + -uVar3;
  pcVar6 = local_54;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar6 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar6 = pcVar6 + 1;
  }
  FUN_004d49b8(local_54,&DAT_004edf52);
  uVar3 = *(uint *)(param_1 + 0xc);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_parameterID__004edf56,(char *)0x0);
  piVar2 = FUN_004db78c(&DAT_00524e20,uVar3);
  FUN_004dbb24(piVar2,&DAT_004edf63,(char *)0x0);
  FUN_004d9c70(piVar2);
  return;
}



/* @00444290 file=? name=FUN_00444290 */

undefined4 FUN_00444290(void)

{
  DAT_004edd1c = DAT_004edd1c + 1;
  DAT_004edd1c = DAT_004edd1c & 3;
  DAT_004edd20 = DAT_004edd20 + 2;
  DAT_004edd24 = DAT_004edd24 + 4;
  return (&DAT_004edca8)[DAT_004edd1c];
}



/* @004442b8 file=? name=FUN_004442b8 */

undefined4 FUN_004442b8(void)

{
  DAT_004edd20 = DAT_004edd20 + 1;
  DAT_004edd20 = DAT_004edd20 & 7;
  DAT_004edd24 = DAT_004edd24 + 2;
  return (&DAT_004edcb8)[DAT_004edd20];
}



/* @004442dc file=? name=FUN_004442dc */

undefined4 FUN_004442dc(void)

{
  DAT_004edd24 = DAT_004edd24 + 1;
  DAT_004edd24 = DAT_004edd24 & 0xf;
  return (&DAT_004edcd8)[DAT_004edd24];
}



/* @004442f8 file=? name=FUN_004442f8 */

undefined4 __cdecl FUN_004442f8(int param_1)

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



/* @00444308 file=? name=FUN_00444308 */

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

{
  FUN_00443f28(param_1,param_3,param_4,param_5,param_6);
  *param_1 = &PTR_FUN_004ee0cc;
  FUN_0044494b(param_1 + 0xb,param_1);
  param_1[9] = param_2;
  param_1[10] = param_2;
  param_1[4] = 0;
  param_1[0xf] = 0;
  param_1[0x10] = 0;
  param_1[0x11] = 0;
  return param_1;
}



/* @00444360 file=? name=FUN_00444360 */

void __cdecl FUN_00444360(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ee0cc;
    (**(code **)(*param_1 + 0x3c))(param_1);
    FUN_0044496a(param_1 + 0xb,2);
    FUN_00443f7c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004443a4 file=? name=FUN_004443a4 */

void FUN_004443a4(void)

{
  FUN_00443fa8();
  return;
}



/* @004443b4 file=? name=FUN_004443b4 */

void __cdecl FUN_004443b4(int param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  undefined8 uVar7;
  char local_60 [80];
  int local_10 [3];
  
  FUN_004449b5(local_10,param_1 + 0x2c);
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_Gauge__004edf65,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar5 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar5 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar5;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar5 + -uVar3;
  pcVar6 = local_60;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar6 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar6 = pcVar6 + 1;
  }
  FUN_004d49b8(local_60,&DAT_004edf6d);
  uVar3 = *(uint *)(param_1 + 0x18);
  FUN_004dbb24(&DAT_00524e20,local_60,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_modeMask___004edf71,(char *)0x0);
  piVar2 = FUN_004db880(&DAT_00524e20,uVar3);
  FUN_004dbb24(piVar2,&DAT_004edf84,(char *)0x0);
  uVar3 = *(uint *)(param_1 + 0x1c);
  FUN_004dbb24(&DAT_00524e20,local_60,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_renderer___004edf86,(char *)0x0);
  uVar7 = FUN_004dbd4c(&DAT_00524e20,uVar3);
  FUN_004dbb24((int *)uVar7,&DAT_004edf99,(char *)0x0);
  uVar3 = *(uint *)(param_1 + 0x14);
  FUN_004dbb24(&DAT_00524e20,local_60,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_ownerID___004edf9b,(char *)0x0);
  piVar2 = FUN_004db880(&DAT_00524e20,uVar3);
  FUN_004dbb24(piVar2,&DAT_004edfae,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,local_60,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_InstanceList___004edfb0,(char *)0x0);
  FUN_004d9c70(&DAT_00524e20);
  FUN_004d49b8(local_60,&DAT_004edfc0);
  while( true ) {
    piVar2 = (int *)(**(code **)(local_10[0] + 0x28))(local_10);
    if (piVar2 == (int *)0x0) break;
    (**(code **)(*piVar2 + 4))(piVar2,local_60);
  }
  FUN_004449f3(local_10,2);
  return;
}



/* @00444588 file=? name=FUN_00444588 */

void __cdecl FUN_00444588(int param_1,undefined4 param_2)

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



/* @004445a4 file=? name=FUN_004445a4 */

void __cdecl FUN_004445a4(int param_1,int param_2)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_004449b5(local_10,param_1 + 0x2c);
  while( true ) {
    puVar1 = (undefined4 *)(**(code **)(local_10[0] + 0x28))(local_10);
    if (puVar1 == (undefined4 *)0x0) break;
    if ((param_2 == puVar1[3]) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
  }
  FUN_004449f3(local_10,2);
  return;
}



/* @00444600 file=? name=FUN_00444600 */

void __cdecl FUN_00444600(int param_1)

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



/* @00444650 file=? name=FUN_00444650 */

void __cdecl FUN_00444650(int *param_1,int param_2)

{
  if (param_2 != 0) {
    param_1[9] = 0;
    (**(code **)(*param_1 + 0x10))(param_1);
    return;
  }
  param_1[9] = param_1[10];
  (**(code **)(*param_1 + 0xc))(param_1);
  return;
}



/* @0044467c file=? name=FUN_0044467c */

undefined4 __cdecl FUN_0044467c(int *param_1,uint param_2)

{
  int *piVar1;
  undefined4 uVar2;
  int local_10 [3];
  
  uVar2 = 0;
  if ((param_1[9] & param_2) != 0) {
    FUN_004449b5(local_10,(int)(param_1 + 0xb));
    while( true ) {
      piVar1 = (int *)(**(code **)(local_10[0] + 0x28))(local_10);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 8))(piVar1);
    }
    (**(code **)(*param_1 + 0x40))(param_1);
    uVar2 = 1;
    FUN_004449f3(local_10,2);
  }
  return uVar2;
}



/* @004446e0 file=munga/gauge.cpp name=FUN_004446e0 */

void FUN_004446e0(void)

{
  FUN_0040385c(s_Gauge__Execute_not_overridden_004edfc4,s_d__tesla_bt_munga_GAUGE_CPP_004edfe2,599);
  return;
}



/* @004446fc file=? name=FUN_004446fc */

int __cdecl FUN_004446fc(int param_1)

{
  int *piVar1;
  
  piVar1 = &DAT_004edd28;
  while( true ) {
    if (*piVar1 == 0) {
      return 0;
    }
    if (*piVar1 == *(int *)(param_1 + 0x24)) break;
    piVar1 = piVar1 + 2;
  }
  return piVar1[1];
}



/* @00444720 file=? name=FUN_00444720 */

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

void __cdecl FUN_00444720(int param_1,float param_2)

{
  if (*(float *)(param_1 + 0x40) < param_2) {
    *(float *)(param_1 + 0x40) = param_2;
  }
  *(float *)(param_1 + 0x3c) = param_2 + *(float *)(param_1 + 0x3c);
  *(int *)(param_1 + 0x44) = *(int *)(param_1 + 0x44) + 1;
  if (0x4000 < *(int *)(param_1 + 0x44)) {
    *(float *)(param_1 + 0x3c) = _DAT_00444760 * *(float *)(param_1 + 0x3c);
    *(int *)(param_1 + 0x44) = *(int *)(param_1 + 0x44) >> 1;
  }
  return;
}



/* @00444818 file=? name=FUN_00444818 */

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

{
  undefined4 *puVar1;
  
  FUN_00444308(param_1,param_2,param_3,param_4,param_5,param_7);
  *param_1 = &PTR_FUN_004ee088;
  if (param_4 == 0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = (undefined4 *)FUN_00447f84(param_4,param_6);
  }
  FUN_0044ad78(param_1 + 0x12,puVar1);
  return param_1;
}



/* @00444870 file=? name=FUN_00444870 */

void __cdecl FUN_00444870(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ee088;
    FUN_0044ae0c(param_1 + 0x12,2);
    FUN_00444360(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004448ac file=? name=FUN_004448ac */

void FUN_004448ac(void)

{
  FUN_004443a4();
  return;
}



/* @004448bc file=? name=FUN_004448bc */

void __cdecl FUN_004448bc(int param_1,char *param_2)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  char *pcVar4;
  char *pcVar5;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_GraphicGauge__004ee01d,(char *)0x0);
  uVar2 = 0xffffffff;
  do {
    pcVar4 = param_2;
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    pcVar4 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar4;
  } while (cVar1 != '\0');
  uVar2 = ~uVar2;
  pcVar4 = pcVar4 + -uVar2;
  pcVar5 = local_54;
  for (uVar3 = uVar2 >> 2; uVar3 != 0; uVar3 = uVar3 - 1) {
    *(undefined4 *)pcVar5 = *(undefined4 *)pcVar4;
    pcVar4 = pcVar4 + 4;
    pcVar5 = pcVar5 + 4;
  }
  for (uVar2 = uVar2 & 3; uVar2 != 0; uVar2 = uVar2 - 1) {
    *pcVar5 = *pcVar4;
    pcVar4 = pcVar4 + 1;
    pcVar5 = pcVar5 + 1;
  }
  FUN_004d49b8(local_54,&DAT_004ee02c);
  (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48,local_54);
  FUN_004443b4(param_1,local_54);
  return;
}



/* @0044494b file=? name=FUN_0044494b */

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

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



/* @0044496a file=? name=FUN_0044496a */

void __cdecl FUN_0044496a(int *param_1,byte param_2)

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



/* @00444996 file=? name=FUN_00444996 */

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

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



/* @004449b5 file=? name=FUN_004449b5 */

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

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



/* @004449d4 file=? name=FUN_004449d4 */

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

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



/* @004449f3 file=? name=FUN_004449f3 */

void __cdecl FUN_004449f3(int *param_1,byte param_2)

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



/* @00444a1f file=? name=FUN_00444a1f */

void __cdecl FUN_00444a1f(int *param_1,byte param_2)

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



/* @00444a53 file=? name=FUN_00444a53 */

void __cdecl FUN_00444a53(int *param_1,byte param_2)

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



/* @00444a7c file=? name=FUN_00444a7c */

undefined4 * __cdecl FUN_00444a7c(undefined4 *param_1)

{
  *param_1 = &PTR_FUN_004ee2c0;
  FUN_00444f5f(param_1 + 2,0);
  FUN_00444f5f(param_1 + 6,0);
  FUN_00444f5f(param_1 + 10,0);
  param_1[1] = 0;
  return param_1;
}



/* @00444ac0 file=? name=FUN_00444ac0 */

void __cdecl FUN_00444ac0(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ee2c0;
    FUN_00444d6c((int)param_1);
    FUN_00444f7e(param_1 + 10,2);
    FUN_00444f7e(param_1 + 6,2);
    FUN_00444f7e(param_1 + 2,2);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00444b14 file=? name=FUN_00444b14 */

undefined4 FUN_00444b14(void)

{
  return 1;
}



/* @00444b20 file=? name=FUN_00444b20 */

void __cdecl FUN_00444b20(int param_1,uint param_2)

{
  int *piVar1;
  int local_10 [3];
  
  if (param_2 != *(uint *)(param_1 + 4)) {
    *(uint *)(param_1 + 4) = param_2;
    FUN_00444b8c(param_1,param_2);
    FUN_00444c0c(param_1,param_2);
  }
  FUN_00444fc9(local_10,param_1 + 0x18);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_10[0] + 0x28))(local_10);
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x10))(piVar1,0);
  }
  FUN_00445007(local_10,2);
  return;
}



/* @00444b8c file=? name=FUN_00444b8c */

void __cdecl FUN_00444b8c(int param_1,uint param_2)

{
  int *piVar1;
  int local_10 [3];
  
  FUN_00444fc9(local_10,param_1 + 0x28);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_10[0] + 0x30))(local_10);
    if (piVar1 == (int *)0x0) break;
    if ((piVar1[4] & param_2) == 0) {
      (**(code **)(local_10[0] + 0xc))(local_10);
    }
    else {
      (**(code **)(local_10[0] + 0x48))(local_10);
      (**(code **)(*(int *)(param_1 + 0x18) + 4))(param_1 + 0x18,piVar1);
      (**(code **)(*piVar1 + 0x10))(piVar1,1);
    }
  }
  FUN_00445007(local_10,2);
  return;
}



/* @00444c0c file=? name=FUN_00444c0c */

void __cdecl FUN_00444c0c(int param_1,uint param_2)

{
  int iVar1;
  int local_10 [3];
  
  FUN_00444fc9(local_10,param_1 + 0x18);
  while( true ) {
    iVar1 = (**(code **)(local_10[0] + 0x30))(local_10);
    if (iVar1 == 0) break;
    if ((*(uint *)(iVar1 + 0x10) & param_2) == 0) {
      (**(code **)(local_10[0] + 0x48))(local_10);
      (**(code **)(*(int *)(param_1 + 0x28) + 4))(param_1 + 0x28,iVar1);
    }
    else {
      (**(code **)(local_10[0] + 0xc))(local_10);
    }
  }
  FUN_00445007(local_10,2);
  return;
}



/* @00444c80 file=? name=FUN_00444c80 */

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

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



/* @00444cf0 file=? name=FUN_00444cf0 */

void __cdecl FUN_00444cf0(int param_1,int param_2)

{
  (**(code **)(*(int *)(param_1 + 8) + 4))(param_1 + 8,param_2);
  if ((*(uint *)(param_2 + 0x10) & *(uint *)(param_1 + 4)) == 0) {
    (**(code **)(*(int *)(param_1 + 0x28) + 4))(param_1 + 0x28,param_2);
  }
  else {
    (**(code **)(*(int *)(param_1 + 0x18) + 4))(param_1 + 0x18,param_2);
  }
  return;
}



/* @00444d3c file=? name=FUN_00444d3c */

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

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00444c80(param_1,param_2,param_3);
  if ((param_2 != 0) && (puVar1 != (undefined4 *)0x0)) {
    (**(code **)*puVar1)(puVar1,3);
  }
  return;
}



/* @00444d6c file=? name=FUN_00444d6c */

void __cdecl FUN_00444d6c(int param_1)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_00444fc9(local_10,param_1 + 8);
  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_00445007(local_10,2);
  return;
}



/* @00444dbc file=? name=FUN_00444dbc */

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

{
  FUN_004178cc(param_1,0x23);
  *param_1 = &PTR_FUN_004ee2a8;
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = 0xffffffff;
  param_1[6] = param_4;
  param_1[7] = 0;
  FUN_00444cf0(param_1[6],(int)param_1);
  return param_1;
}



/* @00444e04 file=? name=FUN_00444e04 */

void __cdecl FUN_00444e04(int *param_1,byte param_2)

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



/* @00444e30 file=? name=FUN_00444e30 */

undefined4 FUN_00444e30(void)

{
  return 1;
}



/* @00444e3c file=? name=FUN_00444e3c */

void __cdecl FUN_00444e3c(int *param_1,int param_2)

{
  if ((param_2 != param_1[5]) &&
     (param_1[5] = param_2, (*(uint *)(param_1[6] + 4) & param_1[4]) != 0)) {
    (**(code **)(*param_1 + 0x14))(param_1);
  }
  return;
}



/* @00444e64 file=? name=FUN_00444e64 */

void __cdecl FUN_00444e64(int *param_1,int param_2)

{
  if (param_2 == 0) {
    param_1[7] = param_1[7] + -1;
    if (param_1[7] < 0) {
      param_1[7] = 0;
    }
  }
  else {
    param_1[7] = param_1[7] + 1;
  }
  if ((*(uint *)(param_1[6] + 4) & param_1[4]) != 0) {
    (**(code **)(*param_1 + 0x14))(param_1);
  }
  return;
}



/* @00444e9c file=munga/lamp.cpp name=FUN_00444e9c */

void FUN_00444e9c(void)

{
  FUN_0040385c(s_Lamp__Update_method_not_overridd_004ee1f9,s_d__tesla_bt_munga_LAMP_CPP_004ee21d,
               0x14f);
  return;
}



/* @00444eb8 file=? name=FUN_00444eb8 */

void FUN_00444eb8(void)

{
  return;
}



/* @00444ec0 file=? name=FUN_00444ec0 */

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

{
  undefined4 *puVar1;
  
  FUN_00444dbc(param_1,param_2,param_3,param_4);
  *param_1 = &PTR_FUN_004ee290;
  param_1[8] = param_5;
  if (param_5 == 0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = (undefined4 *)FUN_00447f84(param_5,param_6);
  }
  FUN_0044ad78(param_1 + 9,puVar1);
  return param_1;
}



/* @00444f14 file=? name=FUN_00444f14 */

void __cdecl FUN_00444f14(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ee290;
    FUN_0044ae0c(param_1 + 9,2);
    FUN_00444e04(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00444f50 file=? name=FUN_00444f50 */

void FUN_00444f50(void)

{
  FUN_00444e30();
  return;
}



/* @00444f5f file=? name=FUN_00444f5f */

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

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



/* @00444f7e file=? name=FUN_00444f7e */

void __cdecl FUN_00444f7e(int *param_1,byte param_2)

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



/* @00444faa file=? name=FUN_00444faa */

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

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



/* @00444fc9 file=? name=FUN_00444fc9 */

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

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



/* @00444fe8 file=? name=FUN_00444fe8 */

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

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



/* @00445007 file=? name=FUN_00445007 */

void __cdecl FUN_00445007(int *param_1,byte param_2)

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



/* @00445034 file=? name=FUN_00445034 */

undefined4 __cdecl FUN_00445034(undefined4 *param_1,char *param_2)

{
  int iVar1;
  
  for (; (char *)*param_1 != (char *)0x0; param_1 = param_1 + 2) {
    iVar1 = FUN_004d4b58(param_2,(char *)*param_1);
    if (iVar1 == 0) break;
  }
  return param_1[1];
}



/* @00445064 file=? name=FUN_00445064 */

char * __cdecl
FUN_00445064(char *param_1,undefined4 *param_2,char *param_3,undefined4 param_4,undefined4 param_5)

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  char *pcVar4;
  char *pcVar5;
  
  *(undefined4 *)(param_1 + 0x28) = *param_2;
  *param_2 = param_1;
  uVar2 = 0xffffffff;
  do {
    pcVar4 = param_3;
    if (uVar2 == 0) break;
    uVar2 = uVar2 - 1;
    pcVar4 = param_3 + 1;
    cVar1 = *param_3;
    param_3 = pcVar4;
  } while (cVar1 != '\0');
  uVar2 = ~uVar2;
  pcVar4 = pcVar4 + -uVar2;
  pcVar5 = param_1;
  for (uVar3 = uVar2 >> 2; uVar3 != 0; uVar3 = uVar3 - 1) {
    *(undefined4 *)pcVar5 = *(undefined4 *)pcVar4;
    pcVar4 = pcVar4 + 4;
    pcVar5 = pcVar5 + 4;
  }
  for (uVar2 = uVar2 & 3; uVar2 != 0; uVar2 = uVar2 - 1) {
    *pcVar5 = *pcVar4;
    pcVar4 = pcVar4 + 1;
    pcVar5 = pcVar5 + 1;
  }
  *(undefined4 *)(param_1 + 0x20) = param_4;
  *(undefined4 *)(param_1 + 0x24) = param_5;
  return param_1;
}



/* @004450b0 file=? name=FUN_004450b0 */

void __cdecl FUN_004450b0(int *param_1,byte param_2)

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



/* @004450cc file=? name=FUN_004450cc */

undefined4 FUN_004450cc(void)

{
  return 1;
}



/* @004450d8 file=? name=FUN_004450d8 */

void __cdecl FUN_004450d8(undefined4 *param_1,undefined4 param_2)

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



/* @004450ec file=? name=FUN_004450ec */

void __cdecl FUN_004450ec(int *param_1,byte param_2)

{
  int *piVar1;
  int *piVar2;
  
  if (param_1 != (int *)0x0) {
    piVar2 = (int *)*param_1;
    while (piVar2 != (int *)0x0) {
      piVar1 = (int *)piVar2[10];
      FUN_004450b0(piVar2,3);
      piVar2 = piVar1;
    }
    *param_1 = 0;
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00445128 file=? name=FUN_00445128 */

undefined4 FUN_00445128(void)

{
  return 1;
}



/* @00445134 file=munga/gaugrend.cpp name=FUN_00445134 */

void __cdecl FUN_00445134(undefined4 *param_1,char *param_2,int param_3)

{
  int iVar1;
  int *piVar2;
  char *pcVar3;
  
  pcVar3 = (char *)*param_1;
  do {
    if (pcVar3 == (char *)0x0) {
      pcVar3 = (char *)FUN_00402298(0x2c);
      if (pcVar3 != (char *)0x0) {
        FUN_00445064(pcVar3,param_1,param_2,param_3,1);
      }
      return;
    }
    iVar1 = FUN_004d4b58(param_2,pcVar3);
    if (iVar1 == 0) {
      if (*(int *)(pcVar3 + 0x24) == 0) {
        iVar1 = *(int *)(pcVar3 + 0x20);
        while (-1 < iVar1) {
          piVar2 = (int *)(iVar1 + param_1[1]);
          iVar1 = *piVar2;
          *piVar2 = param_3;
        }
        *(int *)(pcVar3 + 0x20) = param_3;
        pcVar3[0x24] = '\x01';
        pcVar3[0x25] = '\0';
        pcVar3[0x26] = '\0';
        pcVar3[0x27] = '\0';
        return;
      }
      FUN_004dbb24(&DAT_00524e20,s_label___004ee34d,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004ee355,(char *)0x0);
      FUN_0040385c(s_Already_resolved_004ee357,s_d__tesla_bt_munga_GAUGREND_CPP_004ee368,0xec);
    }
    pcVar3 = *(char **)(pcVar3 + 0x28);
  } while( true );
}



/* @00445218 file=? name=FUN_00445218 */

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

{
  undefined4 uVar1;
  int iVar2;
  char *pcVar3;
  
  pcVar3 = (char *)*param_1;
  while( true ) {
    if (pcVar3 == (char *)0x0) {
      pcVar3 = (char *)FUN_00402298(0x2c);
      if (pcVar3 != (char *)0x0) {
        FUN_00445064(pcVar3,param_1,param_2,param_3,0);
      }
      return 0xffffffff;
    }
    iVar2 = FUN_004d4b58(param_2,pcVar3);
    if (iVar2 == 0) break;
    pcVar3 = *(char **)(pcVar3 + 0x28);
  }
  if (*(int *)(pcVar3 + 0x24) != 0) {
    return *(undefined4 *)(pcVar3 + 0x20);
  }
  uVar1 = *(undefined4 *)(pcVar3 + 0x20);
  *(undefined4 *)(pcVar3 + 0x20) = param_3;
  return uVar1;
}



/* @00445280 file=? name=FUN_00445280 */

undefined4 __cdecl FUN_00445280(undefined4 *param_1,char *param_2)

{
  char *pcVar1;
  int iVar2;
  
  pcVar1 = (char *)*param_1;
  while( true ) {
    if (pcVar1 == (char *)0x0) {
      return 0xfffffffd;
    }
    iVar2 = FUN_004d4b58(param_2,pcVar1);
    if (iVar2 == 0) break;
    pcVar1 = *(char **)(pcVar1 + 0x28);
  }
  if (*(int *)(pcVar1 + 0x24) != 0) {
    return *(undefined4 *)(pcVar1 + 0x20);
  }
  return 0xfffffffe;
}



/* @004452c4 file=? name=FUN_004452c4 */

int __cdecl FUN_004452c4(int *param_1,int param_2)

{
  int iVar1;
  
  iVar1 = *param_1;
  while( true ) {
    if (iVar1 == 0) {
      return 0;
    }
    if (param_2 == *(int *)(iVar1 + 0x20)) break;
    iVar1 = *(int *)(iVar1 + 0x28);
  }
  if (*(int *)(iVar1 + 0x24) != 0) {
    return iVar1;
  }
  return 0;
}



/* @004452f0 file=? name=FUN_004452f0 */

undefined4 __cdecl FUN_004452f0(int *param_1)

{
  int iVar1;
  
  iVar1 = *param_1;
  while( true ) {
    if (iVar1 == 0) {
      return 0;
    }
    if (*(int *)(iVar1 + 0x24) == 0) break;
    iVar1 = *(int *)(iVar1 + 0x28);
  }
  return 1;
}



/* @00445314 file=? name=FUN_00445314 */

undefined4 * __cdecl FUN_00445314(undefined4 *param_1)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  int iVar3;
  
  FUN_004d9d34(param_1);
  uVar1 = FUN_004022b0(0x20000);
  param_1[0x24] = uVar1;
  iVar3 = 0;
  puVar2 = param_1 + 0x26;
  do {
    *puVar2 = 0;
    iVar3 = iVar3 + 1;
    puVar2 = puVar2 + 1;
  } while (iVar3 < 10);
  puVar2 = (undefined4 *)FUN_00402298(8);
  if (puVar2 == (undefined4 *)0x0) {
    uVar1 = 0;
  }
  else {
    uVar1 = FUN_004450d8(puVar2,param_1[0x24]);
  }
  param_1[0x21] = uVar1;
  param_1[0x22] = 0;
  param_1[0x23] = 0;
  param_1[0x25] = 0;
  return param_1;
}



/* @00445390 file=? name=FUN_00445390 */

void __cdecl FUN_00445390(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    if ((int *)param_1[0x22] != (int *)0x0) {
      FUN_004022e8((int *)param_1[0x22]);
    }
    FUN_004450ec((int *)param_1[0x21],3);
    FUN_004022e8((int *)param_1[0x24]);
    FUN_004d9e28(param_1,2);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @004453e8 file=? name=FUN_004453e8 */

undefined4 FUN_004453e8(void)

{
  return 1;
}



/* @004453f4 file=munga/gaugrend.cpp name=FUN_004453f4 */

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

int * __cdecl FUN_004453f4(int *param_1)

{
  int *piVar1;
  uint uVar2;
  undefined1 uVar3;
  int *piVar4;
  int local_c;
  
  if (param_1[0x1f] != 0) {
    param_1[0x1f] = 0;
    return param_1 + 0xf;
  }
  piVar4 = param_1 + 0xf;
  local_c = 0;
LAB_00445423:
  do {
    if ((uint)param_1[8] < (uint)param_1[9]) {
      uVar2 = (uint)*(byte *)param_1[8];
    }
    else {
      uVar2 = (**(code **)(*param_1 + 0xc))(param_1);
    }
    piVar1 = param_1 + 0xf;
    if (0x3f < (int)piVar1 - (int)piVar4) {
      FUN_0040385c(s_Token_too_large_004ee387,s_d__tesla_bt_munga_GAUGREND_CPP_004ee397,0x240);
      return (int *)0x0;
    }
    if ((int)uVar2 < 0) {
      if (piVar1 == piVar4) {
        return (int *)0x0;
      }
      *(undefined1 *)piVar4 = 0;
      return piVar1;
    }
    if (uVar2 == 10) {
      param_1[0x20] = param_1[0x20] + 1;
    }
    if (local_c == 0) {
      if ((int)uVar2 < 0xe) {
        if (((uVar2 == 0xd) || (uVar2 == 0)) || (uVar2 - 9 < 2)) {
LAB_004454cd:
          if ((uint)param_1[8] < (uint)param_1[9]) {
            param_1[8] = param_1[8] + 1;
          }
          else {
            (**(code **)(*param_1 + 0xc))(param_1);
          }
          goto LAB_00445423;
        }
      }
      else {
        if (uVar2 == 0x20) goto LAB_004454cd;
        if (uVar2 == 0x23) {
          if ((uint)param_1[8] < (uint)param_1[9]) {
            param_1[8] = param_1[8] + 1;
          }
          else {
            (**(code **)(*param_1 + 0xc))(param_1);
          }
          local_c = 2;
          goto LAB_00445423;
        }
      }
      local_c = 1;
      goto LAB_00445423;
    }
    uVar3 = (undefined1)uVar2;
    if (local_c == 1) {
      if ((int)uVar2 < 0x28) {
        if ((int)uVar2 < 0x21) {
          if (((uVar2 == 0x20) || (uVar2 == 0)) || ((uVar2 - 9 < 2 || (uVar2 - 9 == 4)))) {
            if ((uint)param_1[8] < (uint)param_1[9]) {
              param_1[8] = param_1[8] + 1;
            }
            else {
              (**(code **)(*param_1 + 0xc))(param_1);
            }
            *(undefined1 *)piVar4 = 0;
            return param_1 + 0xf;
          }
        }
        else {
          if (uVar2 == 0x22) {
            if ((uint)param_1[8] < (uint)param_1[9]) {
              param_1[8] = param_1[8] + 1;
            }
            else {
              (**(code **)(*param_1 + 0xc))(param_1);
            }
            if (piVar4 != param_1 + 0xf) {
              *(undefined1 *)piVar4 = 0;
              return param_1 + 0xf;
            }
            local_c = 3;
            goto LAB_00445423;
          }
          if (uVar2 == 0x23) {
            if ((uint)param_1[8] < (uint)param_1[9]) {
              param_1[8] = param_1[8] + 1;
            }
            else {
              (**(code **)(*param_1 + 0xc))(param_1);
            }
            local_c = 2;
            goto LAB_00445423;
          }
        }
      }
      else if ((int)uVar2 < 0x3e) {
        if ((uVar2 == 0x3d) || (((uVar2 - 0x28 < 2 || (uVar2 == 0x2c)) || (uVar2 == 0x3b)))) {
LAB_004455cf:
          if (piVar4 == param_1 + 0xf) {
            if ((uint)param_1[8] < (uint)param_1[9]) {
              param_1[8] = param_1[8] + 1;
            }
            else {
              (**(code **)(*param_1 + 0xc))(param_1);
            }
            *(undefined1 *)piVar4 = uVar3;
            piVar4 = (int *)((int)piVar4 + 1);
          }
          *(undefined1 *)piVar4 = 0;
          return param_1 + 0xf;
        }
      }
      else if ((uVar2 == 0x7b) || (uVar2 == 0x7d)) goto LAB_004455cf;
      if ((uint)param_1[8] < (uint)param_1[9]) {
        param_1[8] = param_1[8] + 1;
      }
      else {
        (**(code **)(*param_1 + 0xc))(param_1);
      }
      *(undefined1 *)piVar4 = uVar3;
      piVar4 = (int *)((int)piVar4 + 1);
      goto LAB_00445423;
    }
    if (local_c == 2) {
      if ((uint)param_1[8] < (uint)param_1[9]) {
        param_1[8] = param_1[8] + 1;
      }
      else {
        (**(code **)(*param_1 + 0xc))(param_1);
      }
      if ((uVar2 == 10) || (uVar2 == 0xd)) {
        if (piVar4 != param_1 + 0xf) {
          *(undefined1 *)piVar4 = 0;
          return param_1 + 0xf;
        }
        local_c = 0;
      }
    }
    else if (local_c == 3) {
      if ((uint)param_1[8] < (uint)param_1[9]) {
        param_1[8] = param_1[8] + 1;
      }
      else {
        (**(code **)(*param_1 + 0xc))(param_1);
      }
      if (uVar2 == 0x22) {
        *(undefined1 *)piVar4 = 0;
        return param_1 + 0xf;
      }
      *(undefined1 *)piVar4 = uVar3;
      piVar4 = (int *)((int)piVar4 + 1);
    }
  } while( true );
}



/* @004456c4 file=? name=FUN_004456c4 */

void __cdecl FUN_004456c4(int param_1)

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



/* @004456d4 file=? name=FUN_004456d4 */

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

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  int iVar4;
  bool bVar5;
  
  piVar2 = FUN_004453f4(param_1);
  iVar4 = 0;
  bVar5 = (char)*piVar2 == '-';
  if (bVar5) {
    piVar2 = (int *)((int)piVar2 + 1);
  }
  if (((char)*piVar2 == '0') && (piVar2 = (int *)((int)piVar2 + 1), *(char *)piVar2 == '\0')) {
    *param_2 = 0;
  }
  else {
    if (((char)*piVar2 == 'x') || ((char)*piVar2 == 'X')) {
      while( true ) {
        piVar2 = (int *)((int)piVar2 + 1);
        if (*(char *)piVar2 == '\0') break;
        uVar3 = FUN_004dc8c4((int)*(char *)piVar2);
        if (((&DAT_005207dd)[uVar3] & 0x10) == 0) {
          return 0;
        }
        if (0x39 < (int)uVar3) {
          uVar3 = uVar3 - 7;
        }
        iVar4 = uVar3 + iVar4 * 0x10 + -0x30;
      }
    }
    else {
      for (; cVar1 = (char)*piVar2, cVar1 != '\0'; piVar2 = (int *)((int)piVar2 + 1)) {
        if (((&DAT_005207dd)[cVar1] & 2) == 0) {
          return 0;
        }
        iVar4 = (int)cVar1 + iVar4 * 10 + -0x30;
      }
    }
    if (bVar5) {
      iVar4 = -iVar4;
    }
    *param_2 = iVar4;
  }
  return 1;
}



/* @004457a0 file=? name=FUN_004457a0 */

undefined4 __thiscall FUN_004457a0(void *this,int *param_1,float *param_2)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  bool bVar4;
  void *local_8;
  
  piVar1 = FUN_004453f4(param_1);
  bVar4 = (char)*piVar1 == '-';
  if (bVar4) {
    piVar1 = (int *)((int)piVar1 + 1);
  }
  iVar2 = FUN_004d7f84(piVar1,&DAT_004ee3e5);
  if (iVar2 < 1) {
    FUN_00445a6c((int)param_1,s_Token_not_a_scalar_value_004ee3e8);
    uVar3 = 0;
  }
  else {
    local_8 = this;
    if (bVar4) {
      local_8 = (void *)-(float)this;
    }
    *param_2 = (float)local_8;
    uVar3 = 1;
  }
  return uVar3;
}



/* @00445808 file=? name=FUN_00445808 */

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

{
  char *pcVar1;
  int *piVar2;
  undefined4 uVar3;
  int iVar4;
  char *pcVar5;
  bool bVar6;
  int local_c;
  int local_8;
  
  piVar2 = FUN_004453f4(param_1);
  pcVar5 = &DAT_004ee401;
  do {
    bVar6 = (char)*piVar2 == *pcVar5;
    if (!bVar6) break;
    if ((char)*piVar2 == '\0') goto LAB_00445851;
    pcVar1 = (char *)((int)piVar2 + 1);
    bVar6 = *pcVar1 == pcVar5[1];
    if (!bVar6) break;
    piVar2 = (int *)((int)piVar2 + 2);
    pcVar5 = pcVar5 + 2;
    bVar6 = *pcVar1 == '\0';
  } while (!bVar6);
  if (bVar6) {
LAB_00445851:
    iVar4 = FUN_004456d4(param_1,&local_c);
    if (iVar4 == 0) {
      uVar3 = 0;
    }
    else {
      piVar2 = FUN_004453f4(param_1);
      pcVar5 = &DAT_004ee425;
      do {
        bVar6 = (char)*piVar2 == *pcVar5;
        if (!bVar6) break;
        if ((char)*piVar2 == '\0') goto LAB_004458a5;
        pcVar1 = (char *)((int)piVar2 + 1);
        bVar6 = *pcVar1 == pcVar5[1];
        if (!bVar6) break;
        piVar2 = (int *)((int)piVar2 + 2);
        pcVar5 = pcVar5 + 2;
        bVar6 = *pcVar1 == '\0';
      } while (!bVar6);
      if (bVar6) {
LAB_004458a5:
        iVar4 = FUN_004456d4(param_1,&local_8);
        if (iVar4 == 0) {
          uVar3 = 0;
        }
        else {
          piVar2 = FUN_004453f4(param_1);
          pcVar5 = &DAT_004ee441;
          do {
            bVar6 = (char)*piVar2 == *pcVar5;
            if (!bVar6) break;
            if ((char)*piVar2 == '\0') goto LAB_004458f6;
            pcVar1 = (char *)((int)piVar2 + 1);
            bVar6 = *pcVar1 == pcVar5[1];
            if (!bVar6) break;
            piVar2 = (int *)((int)piVar2 + 2);
            pcVar5 = pcVar5 + 2;
            bVar6 = *pcVar1 == '\0';
          } while (!bVar6);
          if (bVar6) {
LAB_004458f6:
            uVar3 = 1;
            *param_2 = local_c;
            param_2[1] = local_8;
          }
          else {
            FUN_00445a6c((int)param_1,s_Missing_trailing_____for_2D_vect_004ee443);
            uVar3 = 0;
          }
        }
      }
      else {
        FUN_00445a6c((int)param_1,s_Missing_____for_2D_vector_004ee427);
        uVar3 = 0;
      }
    }
  }
  else {
    FUN_00445a6c((int)param_1,s_Missing_leading_____for_2D_vecto_004ee403);
    uVar3 = 0;
  }
  return uVar3;
}



/* @00445910 file=? name=FUN_00445910 */

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

{
  int *piVar1;
  uint uVar2;
  undefined4 uVar3;
  
  piVar1 = FUN_004453f4(param_1);
  if (((&DAT_005207dd)[(char)*piVar1] & 0xc) == 0) {
    FUN_00445a6c((int)param_1,s_Token_is_not_a_valid_rate_004ee466);
  }
  else {
    uVar2 = FUN_004dc8c4((int)(char)*piVar1);
    if ((0x40 < (int)uVar2) && ((int)uVar2 < 0x5b)) {
      uVar3 = FUN_004442f8(uVar2 - 0x41);
      *param_2 = uVar3;
      return 1;
    }
    FUN_00445a6c((int)param_1,s_Token_is_not_a_valid_rate_004ee480);
  }
  return 0;
}



/* @00445978 file=? name=FUN_00445978 */

uint __cdecl FUN_00445978(int *param_1,int *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint extraout_EDX;
  bool bVar4;
  bool bVar5;
  int local_8;
  
  piVar2 = FUN_004453f4(param_1);
  local_8 = 0;
  bVar4 = (char)*piVar2 == '-';
  if (bVar4) {
    piVar2 = (int *)((int)piVar2 + 1);
  }
  if (((&DAT_005207dd)[(char)*piVar2] & 0xc) == 0) {
    bVar5 = (char)*piVar2 == '0';
    if (bVar5) {
      piVar2 = (int *)((int)piVar2 + 1);
    }
    if (((char)*piVar2 == 'x') || ((char)*piVar2 == 'X')) {
      while( true ) {
        piVar2 = (int *)((int)piVar2 + 1);
        if (*(char *)piVar2 == '\0') break;
        uVar3 = FUN_004dc8c4((int)*(char *)piVar2);
        if (((&DAT_005207dd)[uVar3] & 0x10) == 0) {
          return extraout_EDX;
        }
        if (0x39 < (int)uVar3) {
          uVar3 = uVar3 - 7;
        }
        local_8 = local_8 * 0x10 + (uVar3 - 0x30);
      }
      uVar3 = 1;
    }
    else {
      for (; cVar1 = (char)*piVar2, cVar1 != '\0'; piVar2 = (int *)((int)piVar2 + 1)) {
        if (((&DAT_005207dd)[cVar1] & 2) == 0) {
          return (uint)bVar5;
        }
        local_8 = local_8 * 10 + cVar1 + -0x30;
      }
      uVar3 = 1;
    }
  }
  else {
    uVar3 = (**(code **)**(undefined4 **)(DAT_004efc94 + 0x50))
                      (*(undefined4 **)(DAT_004efc94 + 0x50),piVar2,&local_8);
  }
  if (uVar3 == 1) {
    if (bVar4) {
      local_8 = -local_8;
    }
    *param_2 = local_8;
  }
  return uVar3;
}



/* @00445a6c file=munga/gaugrend.cpp name=FUN_00445a6c */

void __cdecl FUN_00445a6c(int param_1,char *param_2)

{
  uint uVar1;
  int *piVar2;
  
  uVar1 = *(uint *)(param_1 + 0x80);
  FUN_004dbb24(&DAT_00524e20,s_Interpreter_parsing_error__004ee49a,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_in_line_004ee4b5,(char *)0x0);
  piVar2 = FUN_004db78c(&DAT_00524e20,uVar1);
  FUN_004dbb24(piVar2,&DAT_004ee4bf,(char *)0x0);
  FUN_0040385c(s_Parsing_error_004ee4c1,s_d__tesla_bt_munga_GAUGREND_CPP_004ee4cf,0x447);
  return;
}



/* @00445af0 file=? name=FUN_00445af0 */

void __cdecl FUN_00445af0(int *param_1,LPCSTR param_2,int *param_3)

{
  int *piVar1;
  int *piVar2;
  int *piVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  char *pcVar7;
  char *pcVar8;
  char local_28 [35];
  undefined1 local_5;
  
  param_1[0x23] = 0;
  piVar3 = param_3;
  while (piVar3 != (int *)0x0) {
    piVar2 = (int *)*piVar3;
    piVar3 = piVar3 + 1;
    if (*piVar2 == 0) {
      piVar3 = (int *)piVar2[3];
    }
    else {
      param_1[0x23] = param_1[0x23] + 1;
    }
  }
  piVar2 = (int *)FUN_004022b0(param_1[0x23] << 2);
  param_1[0x22] = (int)piVar2;
  piVar3 = param_3;
  while (piVar3 != (int *)0x0) {
    piVar1 = (int *)*piVar3;
    piVar3 = piVar3 + 1;
    if (*piVar1 == 0) {
      piVar3 = (int *)piVar1[3];
    }
    else {
      *piVar2 = (int)piVar1;
      piVar2 = piVar2 + 1;
    }
  }
  FUN_004d9f60((int)param_1,param_2,0x21,DAT_00520540);
  if ((short)param_1[0xc] == 0) {
    FUN_004dbb24(&DAT_00524e20,s_Cannot_open_interpreter_file___004ee4ee,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ee50d,(char *)0x0);
  }
  else {
    param_1[0x20] = 1;
    param_1[0x1f] = 0;
    while (piVar3 = FUN_004453f4(param_1), piVar3 != (int *)0x0) {
      uVar5 = 0xffffffff;
      do {
        piVar2 = piVar3;
        if (uVar5 == 0) break;
        uVar5 = uVar5 - 1;
        piVar2 = (int *)((int)piVar3 + 1);
        iVar4 = *piVar3;
        piVar3 = piVar2;
      } while ((char)iVar4 != '\0');
      uVar5 = ~uVar5;
      pcVar8 = (char *)((int)piVar2 - uVar5);
      pcVar7 = local_28;
      for (uVar6 = uVar5 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {
        *(undefined4 *)pcVar7 = *(undefined4 *)pcVar8;
        pcVar8 = pcVar8 + 4;
        pcVar7 = pcVar7 + 4;
      }
      for (uVar5 = uVar5 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
        *pcVar7 = *pcVar8;
        pcVar8 = pcVar8 + 1;
        pcVar7 = pcVar7 + 1;
      }
      pcVar8 = &DAT_004ee510;
      piVar3 = FUN_004453f4(param_1);
      iVar4 = FUN_004d4b58((char *)piVar3,pcVar8);
      if (iVar4 != 0) {
        FUN_00445a6c((int)param_1,s_Missing_____004ee512);
      }
      FUN_00445134((undefined4 *)param_1[0x21],local_28,param_1[0x25]);
      FUN_00445c94(param_1,param_3);
    }
    iVar4 = FUN_004452f0((int *)param_1[0x21]);
    if (iVar4 != 0) {
      FUN_00445a6c((int)param_1,s_Unresolved_forward_references_004ee51e);
    }
    FUN_004d9cc4(param_1);
    local_5 = 0;
    FUN_004461c8((int)param_1,&local_5,1);
  }
  return;
}



/* @00445c94 file=? name=FUN_00445c94 */

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

{
  int *piVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  int *piVar6;
  int *piVar7;
  char *pcVar8;
  bool bVar9;
  char local_3c [32];
  undefined4 local_1c;
  int local_18 [2];
  int local_10;
  int local_c;
  byte local_6 [2];
  
  do {
    piVar1 = FUN_004453f4(param_1);
    if (piVar1 == (int *)0x0) {
      FUN_00445a6c((int)param_1,s_Internal_error__NULL_token__004ee53c);
    }
    uVar3 = 0xffffffff;
    piVar6 = piVar1;
    do {
      piVar7 = piVar6;
      if (uVar3 == 0) break;
      uVar3 = uVar3 - 1;
      piVar7 = (int *)((int)piVar6 + 1);
      iVar2 = *piVar6;
      piVar6 = piVar7;
    } while ((char)iVar2 != '\0');
    uVar3 = ~uVar3;
    pcVar5 = (char *)((int)piVar7 - uVar3);
    pcVar8 = local_3c;
    for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
      *(undefined4 *)pcVar8 = *(undefined4 *)pcVar5;
      pcVar5 = pcVar5 + 4;
      pcVar8 = pcVar8 + 4;
    }
    for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
      *pcVar8 = *pcVar5;
      pcVar5 = pcVar5 + 1;
      pcVar8 = pcVar8 + 1;
    }
    iVar2 = FUN_004d4b58((char *)piVar1,&DAT_004ee558);
    if (iVar2 == 0) {
      local_6[1] = 1;
      FUN_004461c8((int)param_1,local_6 + 1,1);
      return;
    }
    if ((char)*piVar1 == '@') {
      iVar2 = FUN_004d4a78((char *)piVar1);
      if (iVar2 != 2) {
        FUN_00445a6c((int)param_1,s_Ill_formed_attribute_variable_in_004ee55a);
      }
      local_6[0] = *(char *)((int)piVar1 + 1) - 0x30;
      if (10 < local_6[0]) {
        FUN_00445a6c((int)param_1,s_Illegal_attribute_variable_index_004ee57e);
      }
      piVar1 = FUN_004453f4(param_1);
      pcVar5 = &DAT_004ee59f;
      do {
        bVar9 = (char)*piVar1 == *pcVar5;
        if (!bVar9) break;
        if ((char)*piVar1 == '\0') goto LAB_00445d8c;
        pcVar8 = (char *)((int)piVar1 + 1);
        bVar9 = *pcVar8 == pcVar5[1];
        if (!bVar9) break;
        piVar1 = (int *)((int)piVar1 + 2);
        pcVar5 = pcVar5 + 2;
        bVar9 = *pcVar8 == '\0';
      } while (!bVar9);
      if (!bVar9) {
        FUN_00445a6c((int)param_1,s_Missing_____004ee5a1);
      }
LAB_00445d8c:
      local_6[1] = 7;
      FUN_004461c8((int)param_1,local_6 + 1,1);
      FUN_004461c8((int)param_1,local_6,1);
      piVar1 = FUN_004453f4(param_1);
      FUN_0044621c((int)param_1,(char *)piVar1);
    }
    else {
      iVar2 = FUN_004d4b58((char *)piVar1,s_enable_004ee5ad);
      if (iVar2 == 0) {
        piVar1 = FUN_004453f4(param_1);
        pcVar5 = &DAT_004ee5b4;
        do {
          bVar9 = (char)*piVar1 == *pcVar5;
          if (!bVar9) break;
          if ((char)*piVar1 == '\0') goto LAB_00445e0e;
          pcVar8 = (char *)((int)piVar1 + 1);
          bVar9 = *pcVar8 == pcVar5[1];
          if (!bVar9) break;
          piVar1 = (int *)((int)piVar1 + 2);
          pcVar5 = pcVar5 + 2;
          bVar9 = *pcVar8 == '\0';
        } while (!bVar9);
        if (!bVar9) {
          FUN_00445a6c((int)param_1,s_Missing_____004ee5b6);
        }
LAB_00445e0e:
        FUN_00445978(param_1,&local_c);
        local_6[1] = 5;
        FUN_004461c8((int)param_1,local_6 + 1,1);
        FUN_004461c8((int)param_1,(undefined1 *)&local_c,4);
      }
      else {
        iVar2 = FUN_004d4b58((char *)piVar1,s_disable_004ee5c2);
        if (iVar2 == 0) {
          piVar1 = FUN_004453f4(param_1);
          pcVar5 = &DAT_004ee5ca;
          do {
            bVar9 = (char)*piVar1 == *pcVar5;
            if (!bVar9) break;
            if ((char)*piVar1 == '\0') goto LAB_00445e8c;
            pcVar8 = (char *)((int)piVar1 + 1);
            bVar9 = *pcVar8 == pcVar5[1];
            if (!bVar9) break;
            piVar1 = (int *)((int)piVar1 + 2);
            pcVar5 = pcVar5 + 2;
            bVar9 = *pcVar8 == '\0';
          } while (!bVar9);
          if (!bVar9) {
            FUN_00445a6c((int)param_1,s_Missing_____004ee5cc);
          }
LAB_00445e8c:
          FUN_00445978(param_1,&local_10);
          local_6[1] = 6;
          FUN_004461c8((int)param_1,local_6 + 1,1);
          FUN_004461c8((int)param_1,(undefined1 *)&local_10,4);
        }
        else {
          iVar2 = FUN_004d4b58((char *)piVar1,s_offset_004ee5d8);
          if (iVar2 == 0) {
            piVar1 = FUN_004453f4(param_1);
            pcVar5 = &DAT_004ee5df;
            do {
              bVar9 = (char)*piVar1 == *pcVar5;
              if (!bVar9) break;
              if ((char)*piVar1 == '\0') goto LAB_00445f0a;
              pcVar8 = (char *)((int)piVar1 + 1);
              bVar9 = *pcVar8 == pcVar5[1];
              if (!bVar9) break;
              piVar1 = (int *)((int)piVar1 + 2);
              pcVar5 = pcVar5 + 2;
              bVar9 = *pcVar8 == '\0';
            } while (!bVar9);
            if (!bVar9) {
              FUN_00445a6c((int)param_1,s_Missing_____004ee5e1);
            }
LAB_00445f0a:
            FUN_00445808(param_1,local_18);
            local_6[1] = 3;
            FUN_004461c8((int)param_1,local_6 + 1,1);
            FUN_004461c8((int)param_1,(undefined1 *)local_18,8);
          }
          else {
            iVar2 = FUN_004d4b58((char *)piVar1,&DAT_004ee5ed);
            if (iVar2 == 0) {
              piVar1 = FUN_004453f4(param_1);
              pcVar5 = &DAT_004ee5f2;
              do {
                bVar9 = (char)*piVar1 == *pcVar5;
                if (!bVar9) break;
                if ((char)*piVar1 == '\0') goto LAB_00445f88;
                pcVar8 = (char *)((int)piVar1 + 1);
                bVar9 = *pcVar8 == pcVar5[1];
                if (!bVar9) break;
                piVar1 = (int *)((int)piVar1 + 2);
                pcVar5 = pcVar5 + 2;
                bVar9 = *pcVar8 == '\0';
              } while (!bVar9);
              if (!bVar9) {
                FUN_00445a6c((int)param_1,s_Missing_____004ee5f4);
              }
LAB_00445f88:
              local_6[1] = 2;
              FUN_004461c8((int)param_1,local_6 + 1,1);
              piVar1 = FUN_004453f4(param_1);
              FUN_0044621c((int)param_1,(char *)piVar1);
            }
            else {
              piVar1 = FUN_004453f4(param_1);
              iVar2 = FUN_004d4b58((char *)piVar1,&DAT_004ee600);
              if (iVar2 == 0) {
                iVar2 = FUN_00446098(param_1,local_3c,param_2);
                if (iVar2 == 0) {
                  FUN_00445a6c((int)param_1,s_Undefined_primitive_004ee602);
                }
                pcVar5 = &DAT_004ee616;
                piVar1 = FUN_004453f4(param_1);
                iVar2 = FUN_004d4b58((char *)piVar1,pcVar5);
                if (iVar2 != 0) {
                  FUN_00445a6c((int)param_1,s_Missing_____004ee618);
                }
              }
              else {
                FUN_004456c4((int)param_1);
                local_6[1] = 4;
                FUN_004461c8((int)param_1,local_6 + 1,1);
                local_1c = FUN_00445218((undefined4 *)param_1[0x21],local_3c,param_1[0x25]);
                FUN_004461c8((int)param_1,(undefined1 *)&local_1c,4);
              }
            }
          }
        }
      }
    }
    pcVar5 = &DAT_004ee624;
    piVar1 = FUN_004453f4(param_1);
    iVar2 = FUN_004d4b58((char *)piVar1,pcVar5);
    if (iVar2 != 0) {
      FUN_00445a6c((int)param_1,s_Missing_____004ee626);
    }
  } while( true );
}



/* @00446098 file=? name=FUN_00446098 */

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

{
  undefined4 *puVar1;
  bool bVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  char *pcVar6;
  int *local_14;
  int *local_10;
  char local_5;
  
  local_5 = '\b';
  bVar2 = true;
  while( true ) {
    while( true ) {
      if (param_3 == (int *)0x0) {
        return 0;
      }
      puVar1 = (undefined4 *)*param_3;
      param_3 = param_3 + 1;
      if ((char *)*puVar1 != (char *)0x0) break;
      param_3 = (int *)puVar1[3];
    }
    iVar3 = FUN_004d4b58((char *)*puVar1,param_2);
    if (iVar3 == 0) break;
    local_5 = local_5 + '\x01';
  }
  iVar3 = 0;
  local_10 = puVar1 + 2;
  while( true ) {
    if (*local_10 == 0) {
      FUN_004461c8((int)param_1,&local_5,1);
      iVar3 = 0;
      for (local_14 = puVar1 + 2; *local_14 != 0; local_14 = local_14 + 0x11) {
        FUN_00446fdc(puVar1 + iVar3 * 0x11 + 2,(int)param_1);
        iVar3 = iVar3 + 1;
      }
      return 1;
    }
    if (bVar2) {
      bVar2 = false;
    }
    else {
      pcVar6 = &DAT_004ee632;
      piVar4 = FUN_004453f4(param_1);
      iVar5 = FUN_004d4b58((char *)piVar4,pcVar6);
      if (iVar5 != 0) {
        FUN_00445a6c((int)param_1,s_Missing_____004ee634);
        return 0;
      }
    }
    iVar5 = FUN_00446cc0(puVar1 + iVar3 * 0x11 + 2,puVar1 + iVar3 * 0x11 + 2,param_1);
    if (iVar5 == 0) break;
    iVar3 = iVar3 + 1;
    local_10 = local_10 + 0x11;
  }
  FUN_00445a6c((int)param_1,s_Wrong_or_missing_parameter_004ee640);
  return 0;
}



/* @004461c8 file=? name=FUN_004461c8 */

void __cdecl FUN_004461c8(int param_1,undefined1 *param_2,int param_3)

{
  undefined1 uVar1;
  int iVar2;
  
  for (; param_3 != 0; param_3 = param_3 + -1) {
    iVar2 = *(int *)(param_1 + 0x94);
    *(int *)(param_1 + 0x94) = *(int *)(param_1 + 0x94) + 1;
    uVar1 = *param_2;
    param_2 = param_2 + 1;
    *(undefined1 *)(*(int *)(param_1 + 0x90) + iVar2) = uVar1;
  }
  return;
}



/* @004461fc file=? name=FUN_004461fc */

int __cdecl FUN_004461fc(int param_1,int param_2)

{
  int iVar1;
  
  iVar1 = *(int *)(param_1 + 0x94);
  *(int *)(param_1 + 0x94) = *(int *)(param_1 + 0x94) + param_2;
  return *(int *)(param_1 + 0x90) + iVar1;
}



/* @0044621c file=? name=FUN_0044621c */

void __cdecl FUN_0044621c(int param_1,char *param_2)

{
  int iVar1;
  ushort local_6;
  
  iVar1 = FUN_004d4a78(param_2);
  local_6 = (short)iVar1 + 1;
  FUN_004461c8(param_1,(undefined1 *)&local_6,2);
  FUN_004461c8(param_1,param_2,(uint)local_6);
  return;
}



/* @00446258 file=? name=FUN_00446258 */

int __cdecl FUN_00446258(int param_1)

{
  int iVar1;
  ushort *puVar2;
  
  puVar2 = (ushort *)FUN_004461fc(param_1,2);
  iVar1 = *(int *)(param_1 + 0x94);
  *(int *)(param_1 + 0x94) = *(int *)(param_1 + 0x94) + (uint)*puVar2;
  return *(int *)(param_1 + 0x90) + iVar1;
}



/* @00446288 file=? name=FUN_00446288 */

void __cdecl
FUN_00446288(int param_1,char *param_2,int param_3,int param_4,int param_5,int param_6,int param_7)

{
  int iVar1;
  
  iVar1 = FUN_00445280(*(undefined4 **)(param_1 + 0x84),param_2);
  if (iVar1 < 0) {
    FUN_004dbb24(&DAT_00524e20,s_GaugeInterpreter__undefined_labe_004ee65b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ee67f,(char *)0x0);
  }
  else {
    FUN_00446310(param_1,iVar1,param_3,param_4,param_5,param_6,param_7);
  }
  return;
}



/* @00446310 file=? name=FUN_00446310 */

void __cdecl
FUN_00446310(int param_1,undefined4 param_2,int param_3,int param_4,int param_5,int param_6,
            int param_7)

{
  byte bVar1;
  undefined4 uVar2;
  uint uVar3;
  bool bVar4;
  char *pcVar5;
  int *piVar6;
  byte *pbVar7;
  int iVar8;
  undefined4 *puVar9;
  uint *puVar10;
  int local_c;
  int local_8;
  
  bVar4 = true;
  *(undefined4 *)(param_1 + 0x94) = param_2;
  local_c = param_5;
  local_8 = param_6;
  do {
    pcVar5 = (char *)FUN_004461fc(param_1,1);
    switch(*pcVar5) {
    case '\0':
    case '\x01':
      bVar4 = false;
      break;
    case '\x02':
      pcVar5 = (char *)FUN_00446258(param_1);
      pcVar5 = FUN_004464d4(param_1,pcVar5);
      iVar8 = FUN_00447f1c(param_3,pcVar5);
      if (-1 < iVar8) {
        param_4 = iVar8;
      }
      break;
    case '\x03':
      piVar6 = (int *)FUN_004461fc(param_1,8);
      local_c = param_5 + *piVar6;
      local_8 = param_6 + piVar6[1];
      break;
    case '\x04':
      puVar9 = (undefined4 *)FUN_004461fc(param_1,4);
      uVar2 = *(undefined4 *)(param_1 + 0x94);
      FUN_00446310(param_1,*puVar9,param_3,param_4,local_c,local_8,param_7);
      *(undefined4 *)(param_1 + 0x94) = uVar2;
      break;
    case '\x05':
      puVar10 = (uint *)FUN_004461fc(param_1,4);
      uVar3 = *puVar10;
      iVar8 = *(int *)(DAT_004efc94 + 0x50);
      *(undefined4 *)(iVar8 + 8) = *(undefined4 *)(iVar8 + 4);
      *(uint *)(iVar8 + 4) = *(uint *)(iVar8 + 4) | uVar3;
      break;
    case '\x06':
      puVar10 = (uint *)FUN_004461fc(param_1,4);
      uVar3 = *puVar10;
      iVar8 = *(int *)(DAT_004efc94 + 0x50);
      *(undefined4 *)(iVar8 + 8) = *(undefined4 *)(iVar8 + 4);
      *(uint *)(iVar8 + 4) = *(uint *)(iVar8 + 4) & ~uVar3;
      break;
    case '\a':
      pbVar7 = (byte *)FUN_004461fc(param_1,1);
      bVar1 = *pbVar7;
      iVar8 = FUN_00446258(param_1);
      *(int *)(param_1 + 0x98 + (uint)bVar1 * 4) = iVar8;
      break;
    default:
      FUN_004477c4(*(int *)(*(int *)(param_1 + 0x88) + (uint)(byte)(*pcVar5 - 8) * 4),param_4,
                   local_c,local_8,param_7,param_3);
    }
  } while (bVar4);
  return;
}



/* @004464d4 file=? name=FUN_004464d4 */

char * __cdecl FUN_004464d4(int param_1,char *param_2)

{
  byte bVar1;
  
  if (((*param_2 == '@') && (bVar1 = param_2[1], 0x2f < bVar1)) && (bVar1 < 0x3a)) {
    param_2 = *(char **)(param_1 + -0x28 + (uint)bVar1 * 4);
  }
  return param_2;
}



/* @004464fc file=? name=FUN_004464fc */

void __cdecl FUN_004464fc(int param_1)

{
  byte bVar1;
  undefined4 *puVar2;
  char *pcVar3;
  int *piVar4;
  byte *pbVar5;
  uint *puVar6;
  undefined *puVar7;
  uint uVar8;
  int local_1c;
  uint local_c;
  uint local_8;
  
  *(undefined4 *)(param_1 + 0x94) = 0;
  do {
    pcVar3 = (char *)FUN_004452c4(*(int **)(param_1 + 0x84),*(int *)(param_1 + 0x94));
    if (pcVar3 != (char *)0x0) {
      FUN_004dbb24(&DAT_00524e20,pcVar3,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004ee682,(char *)0x0);
    }
    uVar8 = *(uint *)(param_1 + 0x94);
    puVar7 = &LAB_004d9ca4;
    FUN_004dbb24(&DAT_00524e20,&DAT_004ee685,(char *)0x0);
    piVar4 = FUN_004dbaa8(&DAT_00524e20,puVar7);
    piVar4 = FUN_004db78c(piVar4,uVar8);
    FUN_004dbb24(piVar4,&DAT_004ee689,(char *)0x0);
    pbVar5 = (byte *)FUN_004461fc(param_1,1);
    bVar1 = *pbVar5;
    switch(bVar1) {
    case 0:
      FUN_004dbb24(&DAT_00524e20,s__________End_of_table__________004ee68b,(char *)0x0);
      break;
    case 1:
      FUN_004dbb24(&DAT_00524e20,s_return_004ee6ab,(char *)0x0);
      break;
    case 2:
      pcVar3 = (char *)FUN_00446258(param_1);
      FUN_004dbb24(&DAT_00524e20,s_setport___004ee6b3,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,pcVar3,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004ee6bd,(char *)0x0);
      break;
    case 3:
      puVar6 = (uint *)FUN_004461fc(param_1,8);
      local_c = *puVar6;
      local_8 = puVar6[1];
      puVar6 = &local_c;
      puVar7 = &LAB_004d9c84;
      FUN_004dbb24(&DAT_00524e20,s_offset_004ee6c0,(char *)0x0);
      piVar4 = FUN_004dbaa8(&DAT_00524e20,puVar7);
      piVar4 = (int *)FUN_00407f08(piVar4,puVar6);
      FUN_004dbb24(piVar4,&DAT_004ee6c8,(char *)0x0);
      break;
    case 4:
      puVar6 = (uint *)FUN_004461fc(param_1,4);
      uVar8 = *puVar6;
      FUN_004dbb24(&DAT_00524e20,s_call_0x_004ee6ca,(char *)0x0);
      piVar4 = FUN_004db78c(&DAT_00524e20,uVar8);
      FUN_004dbb24(piVar4,&DAT_004ee6d2,(char *)0x0);
      pcVar3 = (char *)FUN_004452c4(*(int **)(param_1 + 0x84),uVar8);
      if (pcVar3 == (char *)0x0) {
        FUN_004dbb24(&DAT_00524e20,s_UNDEFINED_____004ee6d5,(char *)0x0);
      }
      else {
        FUN_004dbb24(&DAT_00524e20,pcVar3,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,&DAT_004ee6e4,(char *)0x0);
      }
      break;
    case 5:
      puVar6 = (uint *)FUN_004461fc(param_1,4);
      uVar8 = *puVar6;
      FUN_004dbb24(&DAT_00524e20,s_enable_0x_004ee6e7,(char *)0x0);
      piVar4 = FUN_004db880(&DAT_00524e20,uVar8);
      FUN_004dbb24(piVar4,&DAT_004ee6f1,(char *)0x0);
      break;
    case 6:
      puVar6 = (uint *)FUN_004461fc(param_1,4);
      uVar8 = *puVar6;
      FUN_004dbb24(&DAT_00524e20,s_disable_0x_004ee6f3,(char *)0x0);
      piVar4 = FUN_004db880(&DAT_00524e20,uVar8);
      FUN_004dbb24(piVar4,&DAT_004ee6fe,(char *)0x0);
      break;
    default:
      puVar2 = *(undefined4 **)(*(int *)(param_1 + 0x88) + -0x20 + (uint)bVar1 * 4);
      FUN_004dbb24(&DAT_00524e20,(char *)*puVar2,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004ee700,(char *)0x0);
      local_1c = 0;
      for (piVar4 = puVar2 + 2; *piVar4 != 0; piVar4 = piVar4 + 0x11) {
        FUN_004472ec(puVar2 + local_1c * 0x11 + 2,param_1,s__004ee703);
        local_1c = local_1c + 1;
      }
    }
  } while (bVar1 != 0);
  return;
}



/* @00446860 file=? name=FUN_00446860 */

void __cdecl FUN_00446860(int *param_1,byte param_2)

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



/* @0044687c file=? name=FUN_0044687c */

void FUN_0044687c(void)

{
  return;
}



/* @00446884 file=? name=FUN_00446884 */

void __cdecl FUN_00446884(uint *param_1,char *param_2)

{
  float fVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  int *piVar5;
  int iVar6;
  uint uVar7;
  undefined *puVar8;
  undefined1 uVar9;
  undefined1 uVar10;
  undefined2 uVar11;
  
  uVar9 = 0x84;
  uVar10 = 0x9c;
  uVar11 = 0x4d;
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_ParameterDescription__004ee70e,(char *)0x0);
  FUN_004dbaa8(&DAT_00524e20,(undefined *)CONCAT22(uVar11,CONCAT11(uVar10,uVar9)));
  switch(*param_1) {
  case 0:
    FUN_004dbb24(&DAT_00524e20,s_empty_004ee724,(char *)0x0);
    break;
  case 1:
    FUN_004dbb24(&DAT_00524e20,s_rate__004ee72a,(char *)0x0);
    iVar6 = 0x41;
    uVar7 = 0x10000;
    do {
      if ((param_1[1] & uVar7) != 0) {
        FUN_004db92c(&DAT_00524e20,(byte)iVar6);
      }
      iVar6 = iVar6 + 1;
      uVar7 = uVar7 * 2;
    } while (iVar6 < 0x51);
    break;
  case 2:
    uVar9 = 0x84;
    uVar10 = 0x9c;
    uVar11 = 0x4d;
    uVar7 = param_1[1];
    piVar5 = FUN_004dbaa8(&DAT_00524e20,&LAB_004d9ca4);
    FUN_004dbb24(piVar5,s_modeMask__004ee730,(char *)0x0);
    piVar5 = FUN_004db880(piVar5,uVar7);
    FUN_004dbaa8(piVar5,(undefined *)CONCAT22(uVar11,CONCAT11(uVar10,uVar9)));
    break;
  case 3:
    uVar7 = param_1[1];
    FUN_004dbb24(&DAT_00524e20,s_integer__004ee73a,(char *)0x0);
    FUN_004db78c(&DAT_00524e20,uVar7);
    break;
  case 4:
    uVar9 = 0x84;
    uVar10 = 0x9c;
    uVar11 = 0x4d;
    uVar7 = param_1[1];
    puVar8 = &LAB_004d9ca4;
    FUN_004dbb24(&DAT_00524e20,s_color_0x_004ee743,(char *)0x0);
    piVar5 = FUN_004dbaa8(&DAT_00524e20,puVar8);
    piVar5 = FUN_004db78c(piVar5,uVar7);
    FUN_004dbaa8(piVar5,(undefined *)CONCAT22(uVar11,CONCAT11(uVar10,uVar9)));
    break;
  case 5:
    fVar1 = (float)param_1[1];
    FUN_004dbb24(&DAT_00524e20,s_scalar__004ee74c,(char *)0x0);
    FUN_004db634(&DAT_00524e20,(float10)fVar1);
    break;
  case 6:
    uVar7 = param_1[2];
    uVar2 = param_1[1];
    FUN_004dbb24(&DAT_00524e20,s_vector____004ee754,(char *)0x0);
    piVar5 = FUN_004db78c(&DAT_00524e20,uVar2);
    FUN_004dbb24(piVar5,&DAT_004ee75e,(char *)0x0);
    piVar5 = FUN_004db78c(piVar5,uVar7);
    FUN_004dbb24(piVar5,&DAT_004ee761,(char *)0x0);
    break;
  case 7:
    uVar7 = param_1[4];
    uVar2 = param_1[3];
    uVar3 = param_1[2];
    uVar4 = param_1[1];
    FUN_004dbb24(&DAT_00524e20,s_rectangle_____004ee763,(char *)0x0);
    piVar5 = FUN_004db78c(&DAT_00524e20,uVar4);
    FUN_004dbb24(piVar5,&DAT_004ee771,(char *)0x0);
    piVar5 = FUN_004db78c(piVar5,uVar3);
    FUN_004dbb24(piVar5,&DAT_004ee774,(char *)0x0);
    piVar5 = FUN_004db78c(piVar5,uVar2);
    FUN_004dbb24(piVar5,&DAT_004ee778,(char *)0x0);
    piVar5 = FUN_004db78c(piVar5,uVar7);
    FUN_004dbb24(piVar5,&DAT_004ee77b,(char *)0x0);
    break;
  case 8:
    if (param_1 + 1 == (uint *)0x0) {
      FUN_004dbb24(&DAT_00524e20,s_attribute_NULL_004ee77d,(char *)0x0);
    }
    else {
      FUN_004dbb24(&DAT_00524e20,s_attribute_<_004ee78d,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,(char *)(param_1 + 1),(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004ee799,(char *)0x0);
    }
    break;
  case 9:
    if (param_1 + 1 == (uint *)0x0) {
      FUN_004dbb24(&DAT_00524e20,s_string_NULL_004ee79b,(char *)0x0);
    }
    else {
      FUN_004dbb24(&DAT_00524e20,s_string_<_004ee7a8,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,(char *)(param_1 + 1),(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004ee7b1,(char *)0x0);
    }
    break;
  default:
    uVar7 = *param_1;
    FUN_004dbb24(&DAT_00524e20,s_ILLEGAL_TYPE__004ee7b3,(char *)0x0);
    FUN_004db78c(&DAT_00524e20,uVar7);
  }
  FUN_004dbb24(&DAT_00524e20,&DAT_004ee7c1,(char *)0x0);
  return;
}



/* @00446c3c file=? name=FUN_00446c3c */

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

{
  char cVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  char *pcVar7;
  char local_54 [80];
  
  uVar3 = 0xffffffff;
  do {
    pcVar6 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar6 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar6;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar6 = pcVar6 + -uVar3;
  pcVar7 = local_54;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar7 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar7 = pcVar7 + 4;
  }
  for (uVar3 = uVar3 & 3; pcVar5 = local_54, uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar7 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar7 = pcVar7 + 1;
  }
  while( true ) {
    if (*pcVar5 == '\0') {
      iVar2 = FUN_0041bfc0(param_3,local_54);
      return iVar2;
    }
    if (*pcVar5 == '/') break;
    pcVar5 = pcVar5 + 1;
  }
  *pcVar5 = '\0';
  iVar2 = FUN_0041f98c(param_3,local_54);
  if (iVar2 == 0) {
    return 0;
  }
  iVar2 = FUN_0041bfc0(iVar2,pcVar5 + 1);
  return iVar2;
}



/* @00446cc0 file=munga/gaugrend.cpp name=FUN_00446cc0 */

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

{
  char *pcVar1;
  int extraout_EAX;
  int iVar2;
  uint uVar3;
  uint uVar4;
  int *piVar5;
  uint uVar6;
  uint uVar7;
  char *pcVar8;
  undefined4 *puVar9;
  int *piVar10;
  bool bVar11;
  bool bVar12;
  bool bVar13;
  bool bVar14;
  bool bVar15;
  int local_c;
  undefined4 local_8;
  
  switch(*param_1) {
  case 0:
    FUN_0040385c(s_type____empty__004ee7c3,s_d__tesla_bt_munga_GAUGREND_CPP_004ee7d2,0x8a8);
    break;
  case 1:
    iVar2 = FUN_00445910(param_2,param_1 + 1);
    if (iVar2 != 0) {
      return 1;
    }
    break;
  case 2:
    FUN_00445978(param_2,param_1 + 1);
    if (extraout_EAX != 0) {
      return 1;
    }
    break;
  case 3:
    iVar2 = FUN_004456d4(param_2,param_1 + 1);
    if (iVar2 != 0) {
      return 1;
    }
    break;
  case 4:
    iVar2 = FUN_004456d4(param_2,param_1 + 1);
    if (((iVar2 != 0) && ((int)param_1[1] < 0x100)) && (-1 < (int)param_1[1])) {
      return 1;
    }
    break;
  case 5:
    iVar2 = FUN_004457a0(this,param_2,(float *)(param_1 + 1));
    if (iVar2 != 0) {
      return 1;
    }
    break;
  case 6:
    iVar2 = FUN_00445808(param_2,&local_c);
    if (iVar2 != 0) {
      param_1[1] = local_c;
      param_1[2] = local_8;
      return 1;
    }
    break;
  case 7:
    piVar5 = FUN_004453f4(param_2);
    pcVar8 = &DAT_004ee7f1;
    do {
      bVar11 = (char)*piVar5 == *pcVar8;
      if ((!bVar11) || (bVar11 = true, (char)*piVar5 == '\0')) break;
      pcVar1 = (char *)((int)piVar5 + 1);
      bVar11 = *pcVar1 == pcVar8[1];
      if (!bVar11) break;
      piVar5 = (int *)((int)piVar5 + 2);
      pcVar8 = pcVar8 + 2;
      bVar11 = *pcVar1 == '\0';
    } while (!bVar11);
    uVar6 = FUN_004456d4(param_2,param_1 + 1);
    piVar5 = FUN_004453f4(param_2);
    pcVar8 = &DAT_004ee7f3;
    do {
      bVar12 = (char)*piVar5 == *pcVar8;
      if ((!bVar12) || (bVar12 = true, (char)*piVar5 == '\0')) break;
      pcVar1 = (char *)((int)piVar5 + 1);
      bVar12 = *pcVar1 == pcVar8[1];
      if (!bVar12) break;
      piVar5 = (int *)((int)piVar5 + 2);
      pcVar8 = pcVar8 + 2;
      bVar12 = *pcVar1 == '\0';
    } while (!bVar12);
    uVar7 = FUN_004456d4(param_2,param_1 + 2);
    piVar5 = FUN_004453f4(param_2);
    pcVar8 = &DAT_004ee7f5;
    do {
      bVar13 = (char)*piVar5 == *pcVar8;
      if ((!bVar13) || (bVar13 = true, (char)*piVar5 == '\0')) break;
      pcVar1 = (char *)((int)piVar5 + 1);
      bVar13 = *pcVar1 == pcVar8[1];
      if (!bVar13) break;
      piVar5 = (int *)((int)piVar5 + 2);
      pcVar8 = pcVar8 + 2;
      bVar13 = *pcVar1 == '\0';
    } while (!bVar13);
    uVar3 = FUN_004456d4(param_2,param_1 + 3);
    piVar5 = FUN_004453f4(param_2);
    pcVar8 = &DAT_004ee7f7;
    do {
      bVar14 = (char)*piVar5 == *pcVar8;
      if ((!bVar14) || (bVar14 = true, (char)*piVar5 == '\0')) break;
      pcVar1 = (char *)((int)piVar5 + 1);
      bVar14 = *pcVar1 == pcVar8[1];
      if (!bVar14) break;
      piVar5 = (int *)((int)piVar5 + 2);
      pcVar8 = pcVar8 + 2;
      bVar14 = *pcVar1 == '\0';
    } while (!bVar14);
    uVar4 = FUN_004456d4(param_2,param_1 + 4);
    piVar5 = FUN_004453f4(param_2);
    pcVar8 = &DAT_004ee7f9;
    do {
      bVar15 = (char)*piVar5 == *pcVar8;
      if ((!bVar15) || (bVar15 = true, (char)*piVar5 == '\0')) break;
      pcVar1 = (char *)((int)piVar5 + 1);
      bVar15 = *pcVar1 == pcVar8[1];
      if (!bVar15) break;
      piVar5 = (int *)((int)piVar5 + 2);
      pcVar8 = pcVar8 + 2;
      bVar15 = *pcVar1 == '\0';
    } while (!bVar15);
    if ((bVar11 & uVar6 & (uint)bVar12 & uVar7 & (uint)bVar13 & uVar3 & (uint)bVar14 & uVar4 &
        (uint)bVar15) != 0) {
      return 1;
    }
    break;
  case 8:
    piVar5 = FUN_004453f4(param_2);
    uVar6 = 0xffffffff;
    do {
      piVar10 = piVar5;
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      piVar10 = (int *)((int)piVar5 + 1);
      iVar2 = *piVar5;
      piVar5 = piVar10;
    } while ((char)iVar2 != '\0');
    uVar6 = ~uVar6;
    puVar9 = (undefined4 *)((int)piVar10 - uVar6);
    for (uVar7 = uVar6 >> 2; param_1 = param_1 + 1, uVar7 != 0; uVar7 = uVar7 - 1) {
      *param_1 = *puVar9;
      puVar9 = puVar9 + 1;
    }
    for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {
      *(undefined1 *)param_1 = *(undefined1 *)puVar9;
      puVar9 = (undefined4 *)((int)puVar9 + 1);
      param_1 = (undefined4 *)((int)param_1 + 1);
    }
    return 1;
  case 9:
    piVar5 = FUN_004453f4(param_2);
    uVar6 = 0xffffffff;
    do {
      piVar10 = piVar5;
      if (uVar6 == 0) break;
      uVar6 = uVar6 - 1;
      piVar10 = (int *)((int)piVar5 + 1);
      iVar2 = *piVar5;
      piVar5 = piVar10;
    } while ((char)iVar2 != '\0');
    uVar6 = ~uVar6;
    puVar9 = (undefined4 *)((int)piVar10 - uVar6);
    for (uVar7 = uVar6 >> 2; param_1 = param_1 + 1, uVar7 != 0; uVar7 = uVar7 - 1) {
      *param_1 = *puVar9;
      puVar9 = puVar9 + 1;
    }
    for (uVar6 = uVar6 & 3; uVar6 != 0; uVar6 = uVar6 - 1) {
      *(undefined1 *)param_1 = *(undefined1 *)puVar9;
      puVar9 = (undefined4 *)((int)puVar9 + 1);
      param_1 = (undefined4 *)((int)param_1 + 1);
    }
    return 1;
  default:
    FUN_0040385c(s_Illegal_type_004ee7fb,s_d__tesla_bt_munga_GAUGREND_CPP_004ee808,0x921);
    return 0;
  }
  return 0;
}



/* @00446fdc file=munga/gaugrend.cpp name=FUN_00446fdc */

void __cdecl FUN_00446fdc(undefined4 *param_1,int param_2)

{
  switch(*param_1) {
  case 0:
    FUN_0040385c(s_type____empty__004ee827,s_d__tesla_bt_munga_GAUGREND_CPP_004ee836,0x939);
    break;
  case 1:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    break;
  case 2:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    break;
  case 3:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    break;
  case 4:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    break;
  case 5:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    break;
  case 6:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 2),4);
    break;
  case 7:
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 1),4);
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 2),4);
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 3),4);
    FUN_004461c8(param_2,(undefined1 *)(param_1 + 4),4);
    break;
  case 8:
    FUN_0044621c(param_2,(char *)(param_1 + 1));
    break;
  case 9:
    FUN_0044621c(param_2,(char *)(param_1 + 1));
    break;
  default:
    FUN_0040385c(s_Illegal_type_004ee855,s_d__tesla_bt_munga_GAUGREND_CPP_004ee862,0x96f);
  }
  return;
}



/* @00447138 file=munga/gaugrend.cpp name=FUN_00447138 */

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

{
  char cVar1;
  undefined4 *puVar2;
  char *pcVar3;
  char *pcVar4;
  uint uVar5;
  uint uVar6;
  char *pcVar7;
  
  switch(*param_1) {
  case 0:
    pcVar4 = (char *)FUN_0040385c(s_type____empty__004ee881,
                                  s_d__tesla_bt_munga_GAUGREND_CPP_004ee890,0x987);
    break;
  case 1:
    pcVar4 = (char *)FUN_004461fc(param_2,4);
    param_1[1] = *(undefined4 *)pcVar4;
    break;
  case 2:
    pcVar4 = (char *)FUN_004461fc(param_2,4);
    param_1[1] = *(undefined4 *)pcVar4;
    break;
  case 3:
    puVar2 = (undefined4 *)FUN_004461fc(param_2,4);
    pcVar4 = (char *)*puVar2;
    param_1[1] = pcVar4;
    break;
  case 4:
    pcVar4 = (char *)FUN_004461fc(param_2,4);
    param_1[1] = *(undefined4 *)pcVar4;
    break;
  case 5:
    pcVar4 = (char *)FUN_004461fc(param_2,4);
    param_1[1] = *(undefined4 *)pcVar4;
    break;
  case 6:
    puVar2 = (undefined4 *)FUN_004461fc(param_2,4);
    param_1[1] = *puVar2;
    pcVar4 = (char *)FUN_004461fc(param_2,4);
    param_1[2] = *(undefined4 *)pcVar4;
    break;
  case 7:
    puVar2 = (undefined4 *)FUN_004461fc(param_2,4);
    param_1[1] = *puVar2;
    puVar2 = (undefined4 *)FUN_004461fc(param_2,4);
    param_1[2] = *puVar2;
    puVar2 = (undefined4 *)FUN_004461fc(param_2,4);
    param_1[3] = *puVar2;
    pcVar4 = (char *)FUN_004461fc(param_2,4);
    param_1[4] = *(undefined4 *)pcVar4;
    break;
  case 8:
    pcVar4 = (char *)FUN_00446258(param_2);
    pcVar4 = FUN_004464d4(param_2,pcVar4);
    pcVar4 = (char *)FUN_00446c3c(param_1,pcVar4,param_3);
    param_1[1] = pcVar4;
    break;
  case 9:
    pcVar4 = (char *)FUN_00446258(param_2);
    pcVar3 = FUN_004464d4(param_2,pcVar4);
    pcVar4 = (char *)(param_1 + 1);
    uVar5 = 0xffffffff;
    do {
      pcVar7 = pcVar3;
      if (uVar5 == 0) break;
      uVar5 = uVar5 - 1;
      pcVar7 = pcVar3 + 1;
      cVar1 = *pcVar3;
      pcVar3 = pcVar7;
    } while (cVar1 != '\0');
    uVar5 = ~uVar5;
    pcVar3 = pcVar7 + -uVar5;
    pcVar7 = pcVar4;
    for (uVar6 = uVar5 >> 2; uVar6 != 0; uVar6 = uVar6 - 1) {
      *(undefined4 *)pcVar7 = *(undefined4 *)pcVar3;
      pcVar3 = pcVar3 + 4;
      pcVar7 = pcVar7 + 4;
    }
    for (uVar5 = uVar5 & 3; uVar5 != 0; uVar5 = uVar5 - 1) {
      *pcVar7 = *pcVar3;
      pcVar3 = pcVar3 + 1;
      pcVar7 = pcVar7 + 1;
    }
    break;
  default:
    pcVar4 = (char *)FUN_0040385c(s_Illegal_type_004ee8af,s_d__tesla_bt_munga_GAUGREND_CPP_004ee8bc,
                                  0x9e3);
  }
  return pcVar4;
}



/* @004472ec file=? name=FUN_004472ec */

void __cdecl FUN_004472ec(uint *param_1,int param_2,char *param_3)

{
  uint uVar1;
  uint *puVar2;
  undefined4 *puVar3;
  char *pcVar4;
  int *piVar5;
  undefined2 uVar6;
  undefined2 uVar7;
  uint local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  uint local_14;
  undefined4 local_10;
  float local_c;
  float local_8;
  
  FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
  switch(*param_1) {
  case 0:
    FUN_004dbb24(&DAT_00524e20,s____EMPTY____004ee8db,(char *)0x0);
    break;
  case 1:
    puVar2 = (uint *)FUN_004461fc(param_2,4);
    uVar1 = *puVar2;
    FUN_004dbb24(&DAT_00524e20,s_rate_004ee8e8,(char *)0x0);
    piVar5 = FUN_004db880(&DAT_00524e20,uVar1);
    FUN_004dbb24(piVar5,&DAT_004ee8ee,(char *)0x0);
    break;
  case 2:
    puVar3 = (undefined4 *)FUN_004461fc(param_2,4);
    uVar6 = (undefined2)*puVar3;
    uVar7 = (undefined2)((uint)*puVar3 >> 0x10);
    FUN_004dbb24(&DAT_00524e20,s_mask_004ee8f0,(char *)0x0);
    piVar5 = FUN_004db880(&DAT_00524e20,CONCAT22(uVar7,uVar6));
    FUN_004dbb24(piVar5,&DAT_004ee8f6,(char *)0x0);
    break;
  case 3:
    puVar2 = (uint *)FUN_004461fc(param_2,4);
    uVar1 = *puVar2;
    piVar5 = FUN_004dbaa8(&DAT_00524e20,&LAB_004d9c84);
    FUN_004dbb24(piVar5,&DAT_004ee8f8,(char *)0x0);
    piVar5 = FUN_004db78c(piVar5,uVar1);
    FUN_004dbb24(piVar5,&DAT_004ee8fd,(char *)0x0);
    break;
  case 4:
    puVar2 = (uint *)FUN_004461fc(param_2,4);
    uVar1 = *puVar2;
    FUN_004dbb24(&DAT_00524e20,s_color_0x_004ee8ff,(char *)0x0);
    piVar5 = FUN_004db78c(&DAT_00524e20,uVar1);
    FUN_004dbb24(piVar5,&DAT_004ee908,(char *)0x0);
    break;
  case 5:
    piVar5 = (int *)FUN_004461fc(param_2,4);
    local_c = (float)*piVar5;
    local_8 = local_c;
    piVar5 = FUN_004dbaa8(&DAT_00524e20,&LAB_004d9c84);
    FUN_004dbb24(piVar5,s_scalar_004ee90a,(char *)0x0);
    piVar5 = FUN_004db634(piVar5,(float10)local_c);
    FUN_004dbb24(piVar5,&DAT_004ee912,(char *)0x0);
    break;
  case 6:
    puVar2 = (uint *)FUN_004461fc(param_2,4);
    local_14 = *puVar2;
    puVar3 = (undefined4 *)FUN_004461fc(param_2,4);
    local_10 = *puVar3;
    puVar2 = &local_14;
    piVar5 = FUN_004dbaa8(&DAT_00524e20,&LAB_004d9c84);
    FUN_004dbb24(piVar5,s_vector_004ee914,(char *)0x0);
    piVar5 = (int *)FUN_00407f08(piVar5,puVar2);
    FUN_004dbb24(piVar5,&DAT_004ee91c,(char *)0x0);
    break;
  case 7:
    FUN_00407b9c(&local_24);
    puVar2 = (uint *)FUN_004461fc(param_2,4);
    local_24 = *puVar2;
    puVar3 = (undefined4 *)FUN_004461fc(param_2,4);
    local_20 = *puVar3;
    puVar3 = (undefined4 *)FUN_004461fc(param_2,4);
    local_1c = *puVar3;
    puVar3 = (undefined4 *)FUN_004461fc(param_2,4);
    local_18 = *puVar3;
    puVar2 = &local_24;
    piVar5 = FUN_004dbaa8(&DAT_00524e20,&LAB_004d9c84);
    FUN_004dbb24(piVar5,s_rectangle_004ee91e,(char *)0x0);
    piVar5 = (int *)FUN_00407d78(piVar5,puVar2);
    FUN_004dbb24(piVar5,&DAT_004ee929,(char *)0x0);
    break;
  case 8:
    pcVar4 = (char *)FUN_00446258(param_2);
    FUN_004dbb24(&DAT_00524e20,s_attribute___004ee92b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,pcVar4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ee937,(char *)0x0);
    break;
  case 9:
    pcVar4 = (char *)FUN_00446258(param_2);
    FUN_004dbb24(&DAT_00524e20,s_string___004ee93a,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,pcVar4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ee943,(char *)0x0);
    break;
  default:
    uVar1 = *param_1;
    FUN_004dbb24(&DAT_00524e20,s_ILLEGAL_TYPE__004ee946,(char *)0x0);
    piVar5 = FUN_004db78c(&DAT_00524e20,uVar1);
    FUN_004dbb24(piVar5,&DAT_004ee954,(char *)0x0);
  }
  return;
}



/* @004476ac file=? name=FUN_004476ac */

void __cdecl FUN_004476ac(undefined4 *param_1,char *param_2)

{
  char *pcVar1;
  int iVar2;
  int *piVar3;
  undefined8 uVar4;
  uint uVar5;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_MethodDescription__004ee958,(char *)0x0);
  pcVar1 = (char *)*param_1;
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_name___004ee96c,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,pcVar1,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,&DAT_004ee975,(char *)0x0);
  uVar5 = param_1[1];
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_execute__004ee977,(char *)0x0);
  uVar4 = FUN_004dbd4c(&DAT_00524e20,uVar5);
  FUN_004dbb24((int *)uVar4,&DAT_004ee980,(char *)0x0);
  iVar2 = 0;
  piVar3 = param_1 + 2;
  do {
    if (*piVar3 == 0) {
      return;
    }
    FUN_004d7f10(local_54,s__s_2d__004ee982);
    FUN_00446884(param_1 + iVar2 * 0x11 + 2,local_54);
    iVar2 = iVar2 + 1;
    piVar3 = piVar3 + 0x11;
  } while (iVar2 < 0x10);
  return;
}



/* @004477c4 file=? name=FUN_004477c4 */

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

{
  int *piVar1;
  int iVar2;
  
  iVar2 = 0;
  for (piVar1 = (int *)(param_1 + 8); *piVar1 != 0; piVar1 = piVar1 + 0x11) {
    FUN_00447138((undefined4 *)(iVar2 * 0x44 + param_1 + 8),*(int *)(param_6 + 0x50),param_5);
    iVar2 = iVar2 + 1;
  }
  (**(code **)(param_1 + 4))(param_2,param_3,param_4,param_5,param_6);
  return;
}



/* @00447828 file=? name=FUN_00447828 */

void __cdecl FUN_00447828(undefined4 *param_1)

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



/* @00447840 file=? name=FUN_00447840 */

void __cdecl FUN_00447840(int *param_1,float param_2)

{
  *param_1 = *param_1 + 1;
  param_1[1] = (int)(param_2 + (float)param_1[1]);
  if ((float)param_1[2] < param_2) {
    param_1[2] = (int)param_2;
  }
  return;
}



/* @00447864 file=? name=FUN_00447864 */

float10 __cdecl FUN_00447864(int *param_1)

{
  float local_8;
  
  if (*param_1 < 1) {
    local_8 = 0.0;
  }
  else {
    local_8 = (float)param_1[1] / (float)*param_1;
  }
  return (float10)local_8;
}



/* @00447890 file=? name=FUN_00447890 */

undefined4 * __cdecl FUN_00447890(undefined4 *param_1)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  float10 fVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined *puVar10;
  
  puVar10 = &DAT_004e82f8;
  uVar9 = 0x24;
  uVar8 = 1;
  uVar7 = 2;
  uVar6 = 1;
  uVar5 = DAT_004e823c;
  fVar4 = FUN_0044e19c(DAT_004efc94);
  FUN_00435d30(param_1,(float)fVar4,uVar5,uVar6,uVar7,uVar8,uVar9,puVar10);
  *param_1 = &PTR_FUN_004eeb70;
  FUN_00443474(param_1 + 0x25);
  FUN_004437d8(param_1 + 0x2c);
  param_1[0x7032] = 0;
  FUN_00448997(param_1 + 0x7036,0);
  FUN_00448997(param_1 + 0x703b,0);
  FUN_00448997(param_1 + 0x7040,0);
  param_1[0x7046] = 0;
  param_1[0x7035] = 0;
  iVar3 = 0;
  puVar1 = param_1 + 0x15;
  do {
    iVar3 = iVar3 + 1;
    *puVar1 = 0;
    puVar1 = puVar1 + 1;
  } while (iVar3 < 0x10);
  param_1[0x7049] = DAT_004ee2c8;
  DAT_004ee2c8 = param_1;
  param_1[0x7047] = 0;
  param_1[0x7048] = 0;
  param_1[0x13] = 0;
  puVar1 = (undefined4 *)FUN_00402298(0xc0);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00445314(puVar1);
  }
  param_1[0x14] = puVar1;
  param_1[0x7033] = 0;
  param_1[0x7034] = 0;
  puVar1 = (undefined4 *)FUN_00402298(0x14);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_004014d9(puVar1,(int)(param_1 + 0x703b));
  }
  param_1[0x7045] = puVar1;
  iVar3 = 0;
  puVar1 = param_1 + 0x704a;
  do {
    iVar3 = iVar3 + 1;
    *puVar1 = 0;
    puVar1 = puVar1 + 1;
  } while (iVar3 < 0x10);
  iVar3 = 0;
  do {
    iVar2 = 0;
    do {
      FUN_00447828(param_1 + iVar3 * 0xf + iVar2 * 3 + 0x705a);
      iVar2 = iVar2 + 1;
    } while (iVar2 < 5);
    iVar3 = iVar3 + 1;
  } while (iVar3 < 0x10);
  return param_1;
}



/* @00447a14 file=? name=FUN_00447a14 */

void __cdecl FUN_00447a14(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  int *piVar2;
  int *piVar3;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004eeb70;
    (**(code **)(*param_1 + 0x34))(param_1);
    FUN_00445390((int *)param_1[0x14],3);
    puVar1 = (undefined4 *)param_1[0x7033];
    if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
    puVar1 = (undefined4 *)param_1[0x7032];
    if ((puVar1 != (undefined4 *)0x0) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
    puVar1 = (undefined4 *)param_1[0x7045];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    param_1[0x7045] = 0;
    piVar2 = (int *)0x0;
    for (piVar3 = DAT_004ee2c8; piVar3 != (int *)0x0; piVar3 = (int *)piVar3[0x7049]) {
      if (param_1 == piVar3) {
        if (piVar2 == (int *)0x0) {
          DAT_004ee2c8 = (int *)param_1[0x7049];
        }
        else {
          piVar2[0x7049] = param_1[0x7049];
        }
        break;
      }
      piVar2 = piVar3;
    }
    FUN_004489b6(param_1 + 0x7040,2);
    FUN_004489b6(param_1 + 0x703b,2);
    FUN_004489b6(param_1 + 0x7036,2);
    FUN_0044381c(param_1 + 0x2c,2);
    FUN_004434a0(param_1 + 0x25,2);
    FUN_00435df8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00447b38 file=? name=FUN_00447b38 */

void FUN_00447b38(void)

{
  int *piVar1;
  
  for (piVar1 = DAT_004ee2c8; piVar1 != (int *)0x0; piVar1 = (int *)piVar1[0x7049]) {
    (**(code **)(*piVar1 + 0x48))(piVar1);
  }
  return;
}



/* @00447b58 file=? name=FUN_00447b58 */

void FUN_00447b58(void)

{
  return;
}



/* @00447b60 file=? name=FUN_00447b60 */

void __cdecl FUN_00447b60(int param_1)

{
  FUN_00435e48(param_1);
  return;
}



/* @00447b70 file=? name=FUN_00447b70 */

void __cdecl FUN_00447b70(int *param_1,int param_2)

{
  int *piVar1;
  int local_40 [5];
  int local_2c [5];
  int local_18 [5];
  
  if (param_1[0x7046] == 0) {
    FUN_004014d9(local_18,(int)(param_1 + 0x7036));
    while( true ) {
      piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x24))(piVar1,param_2);
    }
    FUN_00401517(local_18,2);
    FUN_004014d9(local_2c,(int)(param_1 + 0x703b));
    while( true ) {
      piVar1 = (int *)(**(code **)(local_2c[0] + 0x28))(local_2c);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x24))(piVar1,param_2);
    }
    FUN_00401517(local_2c,2);
    FUN_004014d9(local_40,(int)(param_1 + 0x7040));
    while( true ) {
      piVar1 = (int *)(**(code **)(local_40[0] + 0x28))(local_40);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x24))(piVar1,param_2);
    }
    FUN_00401517(local_40,2);
  }
  FUN_00435e70(param_1,param_2);
  return;
}



/* @00447c58 file=? name=FUN_00447c58 */

void __cdecl FUN_00447c58(int param_1,undefined4 param_2)

{
  int *piVar1;
  int local_40 [5];
  int local_2c [5];
  int local_18 [5];
  
  if (*(int *)(param_1 + 0x1c118) == 0) {
    FUN_004014d9(local_18,param_1 + 0x1c0d8);
    while( true ) {
      piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x28))(piVar1,param_2);
    }
    FUN_00401517(local_18,2);
    FUN_004014d9(local_2c,param_1 + 0x1c0ec);
    while( true ) {
      piVar1 = (int *)(**(code **)(local_2c[0] + 0x28))(local_2c);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x28))(piVar1,param_2);
    }
    FUN_00401517(local_2c,2);
    FUN_004014d9(local_40,param_1 + 0x1c100);
    while( true ) {
      piVar1 = (int *)(**(code **)(local_40[0] + 0x28))(local_40);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x28))(piVar1,param_2);
    }
    FUN_00401517(local_40,2);
  }
  return;
}



/* @00447d38 file=? name=FUN_00447d38 */

void __cdecl FUN_00447d38(int param_1,undefined4 param_2)

{
  int *piVar1;
  int local_40 [5];
  int local_2c [5];
  int local_18 [5];
  
  if (*(int *)(param_1 + 0x1c118) == 0) {
    FUN_004014d9(local_18,param_1 + 0x1c0d8);
    while( true ) {
      piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x2c))(piVar1,param_2);
    }
    FUN_00401517(local_18,2);
    FUN_004014d9(local_2c,param_1 + 0x1c0ec);
    while( true ) {
      piVar1 = (int *)(**(code **)(local_2c[0] + 0x28))(local_2c);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x2c))(piVar1,param_2);
    }
    FUN_00401517(local_2c,2);
    FUN_004014d9(local_40,param_1 + 0x1c100);
    while( true ) {
      piVar1 = (int *)(**(code **)(local_40[0] + 0x28))(local_40);
      if (piVar1 == (int *)0x0) break;
      (**(code **)(*piVar1 + 0x2c))(piVar1,param_2);
    }
    FUN_00401517(local_40,2);
  }
  return;
}



/* @00447e18 file=? name=FUN_00447e18 */

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

{
  FUN_00448d00(*(int **)(param_1 + 0x1c0cc),param_2,param_3,param_4,param_5);
  return;
}



/* @00447e40 file=? name=FUN_00447e40 */

void __cdecl FUN_00447e40(int param_1,int param_2,int param_3,int param_4)

{
  FUN_00448e00(*(int *)(param_1 + 0x1c0cc),param_2,param_3,param_4);
  return;
}



/* @00447e64 file=? name=FUN_00447e64 */

void FUN_00447e64(void)

{
  return;
}



/* @00447e6c file=? name=FUN_00447e6c */

void __cdecl FUN_00447e6c(int param_1)

{
  undefined4 *puVar1;
  int *piVar2;
  int iVar3;
  
  if (*(int *)(param_1 + 0x1c0cc) != 0) {
    FUN_00448cb0(*(int *)(param_1 + 0x1c0cc));
  }
  FUN_00447fc0(param_1,0);
  if (*(int *)(param_1 + 0x1c0c8) != 0) {
    FUN_00444d6c(*(int *)(param_1 + 0x1c0c8));
  }
  piVar2 = *(int **)(param_1 + 0x4c);
  if (piVar2 != (int *)0x0) {
    (**(code **)(*piVar2 + 4))(piVar2);
  }
  FUN_004435ac(param_1 + 0x94);
  FUN_00443998((undefined4 *)(param_1 + 0xb0));
  piVar2 = (int *)(param_1 + 0x54);
  iVar3 = 0;
  do {
    puVar1 = (undefined4 *)*piVar2;
    if (puVar1 != (undefined4 *)0x0) {
      if (puVar1 != (undefined4 *)0x0) {
        (**(code **)*puVar1)(puVar1,3);
      }
      *piVar2 = 0;
    }
    iVar3 = iVar3 + 1;
    piVar2 = piVar2 + 1;
  } while (iVar3 < 0x10);
  return;
}



/* @00447ef8 file=? name=FUN_00447ef8 */

void __cdecl FUN_00447ef8(int param_1)

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



/* @00447f0c file=? name=FUN_00447f0c */

void __cdecl FUN_00447f0c(int param_1)

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



/* @00447f1c file=? name=FUN_00447f1c */

int __cdecl FUN_00447f1c(int param_1,char *param_2)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  
  if (param_2 != (char *)0x0) {
    iVar3 = 0;
    piVar2 = (int *)(param_1 + 0x54);
    do {
      if ((*piVar2 != 0) && (iVar1 = FUN_004d4b58((char *)(*piVar2 + 0x18),param_2), iVar1 == 0)) {
        return iVar3;
      }
      iVar3 = iVar3 + 1;
      piVar2 = piVar2 + 1;
    } while (iVar3 < 0x10);
  }
  return -1;
}



/* @00447f60 file=? name=FUN_00447f60 */

undefined4 __cdecl FUN_00447f60(int param_1,char *param_2)

{
  int iVar1;
  
  iVar1 = FUN_00447f1c(param_1,param_2);
  if (-1 < iVar1) {
    return *(undefined4 *)(param_1 + 0x54 + iVar1 * 4);
  }
  return 0;
}



/* @00447f84 file=? name=FUN_00447f84 */

undefined4 __cdecl FUN_00447f84(int param_1,int param_2)

{
  if ((-1 < param_2) && (param_2 < 0x10)) {
    return *(undefined4 *)(param_1 + 0x54 + param_2 * 4);
  }
  return 0;
}



/* @00447fa0 file=? name=FUN_00447fa0 */

void __cdecl FUN_00447fa0(int param_1,undefined4 param_2)

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



/* @00447fc0 file=? name=FUN_00447fc0 */

void __cdecl FUN_00447fc0(int param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  int local_2c [5];
  int local_18 [5];
  
  FUN_004014d9(local_18,param_1 + 0x1c0ec);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x30))(local_18);
    if (piVar1 == (int *)0x0) break;
    if ((param_2 == 0) || (param_2 == piVar1[5])) {
      (**(code **)(*piVar1 + 0x20))(piVar1,0xffff);
      (**(code **)(local_18[0] + 0x48))(local_18);
      if (piVar1 != (int *)0x0) {
        (**(code **)*piVar1)(piVar1,3);
      }
    }
    else {
      (**(code **)(local_18[0] + 0xc))(local_18);
    }
  }
  FUN_00401517(local_18,2);
  FUN_004014d9(local_2c,param_1 + 0x1c100);
  while( true ) {
    puVar2 = (undefined4 *)(**(code **)(local_2c[0] + 0x30))(local_2c);
    if (puVar2 == (undefined4 *)0x0) break;
    if ((param_2 == 0) || (param_2 == puVar2[5])) {
      (**(code **)(local_2c[0] + 0x48))(local_2c);
      if (puVar2 != (undefined4 *)0x0) {
        (**(code **)*puVar2)(puVar2,3);
      }
    }
    else {
      (**(code **)(local_2c[0] + 0xc))(local_2c);
    }
  }
  FUN_00401517(local_2c,2);
  return;
}



/* @004480b0 file=? name=FUN_004480b0 */

void __cdecl FUN_004480b0(int param_1,int *param_2)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_004014d9(local_18,param_1 + 0x1c0ec);
  do {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x30))(local_18);
    if (piVar1 == (int *)0x0) {
LAB_0044811e:
      FUN_00401517(local_18,2);
      return;
    }
    if (piVar1 == param_2) {
      (**(code **)(local_18[0] + 0x48))(local_18);
      (**(code **)(*(int *)(param_1 + 0x1c100) + 4))(param_1 + 0x1c100,param_2);
      (**(code **)(*param_2 + 0x10))(param_2);
      goto LAB_0044811e;
    }
    (**(code **)(local_18[0] + 0xc))(local_18);
  } while( true );
}



/* @00448134 file=? name=FUN_00448134 */

undefined4 FUN_00448134(void)

{
  return 0xaaaa;
}



/* @00448140 file=? name=FUN_00448140 */

undefined4 FUN_00448140(void)

{
  return 0x8888;
}



/* @0044814c file=? name=FUN_0044814c */

undefined4 FUN_0044814c(void)

{
  return 0x8080;
}



/* @00448158 file=? name=FUN_00448158 */

undefined4 FUN_00448158(void)

{
  return 0x8000;
}



/* @00448164 file=? name=FUN_00448164 */

void __cdecl FUN_00448164(int *param_1)

{
  if ((param_1[0x7046] == 0) && (param_1[0x7034] == 0)) {
    (**(code **)(*param_1 + 0x54))(param_1);
  }
  return;
}



/* @00448188 file=? name=FUN_00448188 */

void __cdecl FUN_00448188(int param_1)

{
  uint uVar1;
  int *piVar2;
  int local_1c [5];
  uint local_8;
  
  uVar1 = *(uint *)(*(int *)(DAT_004efc94 + 0x50) + 4);
  local_8 = *(uint *)(param_1 + 0x1c0d4) ^ uVar1;
  piVar2 = *(int **)(param_1 + 0x1c0c8);
  if (piVar2 != (int *)0x0) {
    (**(code **)(*piVar2 + 4))(piVar2,uVar1);
  }
  FUN_004014d9(local_1c,param_1 + 0x1c0d8);
  while( true ) {
    piVar2 = (int *)(**(code **)(local_1c[0] + 0x30))(local_1c);
    if (piVar2 == (int *)0x0) break;
    (**(code **)(local_1c[0] + 0x48))(local_1c);
    if ((piVar2[6] & uVar1) == 0) {
      (**(code **)(*(int *)(param_1 + 0x1c100) + 4))(param_1 + 0x1c100,piVar2);
    }
    else if ((piVar2[3] == 0) || ((piVar2[6] & local_8) != 0)) {
      (**(code **)(*piVar2 + 0xc))(piVar2);
      if (piVar2[4] == 0) {
        piVar2[3] = 1;
        (**(code **)(*(int *)(param_1 + 0x1c0ec) + 4))(param_1 + 0x1c0ec,piVar2);
      }
      else {
        (**(code **)(*(int *)(param_1 + 0x1c100) + 4))(param_1 + 0x1c100,piVar2);
      }
    }
  }
  FUN_00401517(local_1c,2);
  if (uVar1 != *(uint *)(param_1 + 0x1c0d4)) {
    *(uint *)(param_1 + 0x1c0d4) = uVar1;
    FUN_00448318(param_1,uVar1,local_8);
    FUN_004483dc(param_1,uVar1);
  }
  *(undefined4 *)(param_1 + 0x1c0d0) = 1;
  (**(code **)(**(int **)(param_1 + 0x1c114) + 4))(*(int **)(param_1 + 0x1c114));
  if (*(int *)(param_1 + 0x1c11c) == 0) {
    *(undefined4 *)(param_1 + 0x1c11c) = 0x8000;
    *(undefined4 *)(param_1 + 0x1c120) = 0;
  }
  return;
}



/* @004482d4 file=? name=FUN_004482d4 */

undefined4 __fastcall FUN_004482d4(undefined4 param_1,undefined4 param_2,int *param_3)

{
  int iVar1;
  
  iVar1 = param_3[0x7034];
  if (iVar1 == 0) {
    param_2 = (**(code **)(*param_3 + 0x58))(param_3);
  }
  else if (iVar1 == 1) {
    param_2 = FUN_00448468(param_3);
  }
  else if (iVar1 == 2) {
    param_2 = (**(code **)(*param_3 + 0x58))(param_3);
  }
  return param_2;
}



/* @00448310 file=? name=FUN_00448310 */

undefined4 FUN_00448310(void)

{
  return 0;
}



/* @00448318 file=? name=FUN_00448318 */

void __cdecl FUN_00448318(int param_1,uint param_2,uint param_3)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_004014d9(local_18,param_1 + 0x1c100);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x30))(local_18);
    if (piVar1 == (int *)0x0) break;
    if ((piVar1[6] & param_2) == 0) {
      (**(code **)(local_18[0] + 0xc))(local_18);
    }
    else if ((piVar1[3] == 0) && ((piVar1[6] & param_3) != 0)) {
      (**(code **)(*piVar1 + 0xc))(piVar1);
      if (piVar1[4] == 0) {
        (**(code **)(local_18[0] + 0x48))(local_18);
        (**(code **)(*(int *)(param_1 + 0x1c0ec) + 4))(param_1 + 0x1c0ec,piVar1);
        piVar1[3] = 1;
      }
      else {
        (**(code **)(local_18[0] + 0xc))(local_18);
      }
    }
    else {
      (**(code **)(local_18[0] + 0xc))(local_18);
    }
  }
  FUN_00401517(local_18,2);
  return;
}



/* @004483dc file=? name=FUN_004483dc */

void __cdecl FUN_004483dc(int param_1,uint param_2)

{
  int *piVar1;
  int local_18 [5];
  
  FUN_004014d9(local_18,param_1 + 0x1c0ec);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x30))(local_18);
    if (piVar1 == (int *)0x0) break;
    if ((piVar1[6] & param_2) == 0) {
      piVar1[3] = 0;
      (**(code **)(local_18[0] + 0x48))(local_18);
      (**(code **)(*(int *)(param_1 + 0x1c100) + 4))(param_1 + 0x1c100,piVar1);
      (**(code **)(*piVar1 + 0x10))(piVar1);
    }
    else {
      (**(code **)(local_18[0] + 0xc))(local_18);
    }
  }
  FUN_00401517(local_18,2);
  return;
}



/* @00448468 file=? name=FUN_00448468 */

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

undefined4 __cdecl FUN_00448468(int *param_1)

{
  int *piVar1;
  int iVar2;
  float10 fVar3;
  float10 fVar4;
  float local_8;
  
  piVar1 = (int *)(**(code **)(*(int *)param_1[0x7045] + 0x28))((int *)param_1[0x7045]);
  if (piVar1 == (int *)0x0) {
    param_1[0x7047] = (uint)param_1[0x7047] >> 1;
    param_1[0x7048] = param_1[0x7048] + 1;
    param_1[0x7034] = 2;
  }
  else {
    fVar3 = (float10)(**(code **)(*param_1 + 0x5c))(param_1);
    iVar2 = (**(code **)(*piVar1 + 0x20))(piVar1,param_1[0x7047]);
    fVar4 = (float10)(**(code **)(*param_1 + 0x5c))(param_1);
    local_8 = (float)(fVar4 - (float10)(float)fVar3);
    if (local_8 < _DAT_00448534) {
      local_8 = -local_8;
    }
    if (iVar2 != 0) {
      (**(code **)(*piVar1 + 0x18))(piVar1,local_8);
    }
    iVar2 = (**(code **)(*piVar1 + 0x30))(piVar1);
    FUN_00447840(param_1 + param_1[0x7048] * 0xf + iVar2 * 3 + 0x705a,local_8);
  }
  return 1;
}



/* @00448548 file=? name=FUN_00448548 */

float10 __cdecl FUN_00448548(int param_1,int param_2,int param_3,int param_4)

{
  byte bVar1;
  int iVar2;
  int iVar3;
  float10 fVar4;
  float *local_1c;
  int local_14;
  float local_10;
  float local_c;
  float local_8;
  
  local_c = 0.0;
  local_10 = 0.0;
  iVar3 = 0;
  local_14 = 0;
  local_1c = (float *)(param_1 + 0x1c170 + param_3 * 0x3c);
  do {
    bVar1 = (&PTR_s_ABDHP_004ee2cc)[param_3][local_14];
    if (param_4 == 1) {
      local_8 = *local_1c;
    }
    else {
      fVar4 = FUN_00447864((int *)(param_3 * 0x3c + param_1 + local_14 * 0xc + 0x1c168));
      local_8 = (float)fVar4;
    }
    local_c = local_8 + local_c;
    local_10 = (float)param_2 * local_8 + local_10;
    if ((float)param_2 < local_10) {
      local_10 = (float)param_2;
    }
    iVar2 = FUN_004dcd94();
    for (; iVar3 < iVar2; iVar3 = iVar3 + 1) {
      FUN_004db92c(&DAT_00524e20,bVar1);
    }
    local_14 = local_14 + 1;
    local_1c = local_1c + 3;
  } while (local_14 < 5);
  for (; iVar3 < param_2; iVar3 = iVar3 + 1) {
    FUN_004dbb24(&DAT_00524e20,&DAT_004ee9e9,(char *)0x0);
  }
  return (float10)local_c;
}



/* @00448654 file=? name=FUN_00448654 */

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

void __cdecl FUN_00448654(int param_1)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  float10 fVar5;
  char local_8c [80];
  int local_3c [5];
  int local_28 [5];
  int *local_14;
  float local_10;
  float local_c;
  int local_8;
  
  FUN_004014d9(local_28,param_1 + 0x1c0ec);
  FUN_004dbb24(&DAT_00524e20,s_Active_name_count_avg_worst_004ee9eb,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s__________________________________004eea20,(char *)0x0);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_28[0] + 0x28))();
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x1c))();
  }
  FUN_00401517(local_28,2);
  FUN_004014d9(local_3c,param_1 + 0x1c100);
  FUN_004dbb24(&DAT_00524e20,s_Inactive_name_count_avg_worst_004eea55,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s__________________________________004eea8a,(char *)0x0);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_3c[0] + 0x28))();
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x1c))();
  }
  FUN_00401517(local_3c,2);
  local_8 = 0x28;
  FUN_004dbb24(&DAT_00524e20,s_Slot_Count_Tier_values_004eeabf,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s__Total___004eeaf4,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_____________004eeafe,(char *)0x0);
  iVar3 = 0;
  if (0 < local_8) {
    do {
      FUN_004dbb24(&DAT_00524e20,&DAT_004eeb0a,(char *)0x0);
      iVar3 = iVar3 + 1;
    } while (iVar3 < local_8);
  }
  FUN_004dbb24(&DAT_00524e20,s__________004eeb0c,(char *)0x0);
  local_14 = (int *)(param_1 + 0x1c168);
  iVar3 = 0;
  do {
    FUN_004d7f10(local_8c,s__2d___004eeb16);
    FUN_004dbb24(&DAT_00524e20,local_8c,(char *)0x0);
    iVar2 = 0;
    iVar4 = 0;
    piVar1 = local_14;
    do {
      iVar2 = iVar2 + *piVar1;
      iVar4 = iVar4 + 1;
      piVar1 = piVar1 + 3;
    } while (iVar4 < 5);
    if (iVar2 < 1) {
      FUN_004dbb24(&DAT_00524e20,s_No_samples_available_004eeb1d,(char *)0x0);
    }
    else {
      FUN_004d7f10(local_8c,&DAT_004eeb33);
      FUN_004dbb24(&DAT_00524e20,local_8c,(char *)0x0);
      fVar5 = FUN_00448548(param_1,local_8,iVar3,0);
      local_c = (float)fVar5;
      FUN_004d7f10(local_8c,s___5_2f___004eeb38);
      FUN_004dbb24(&DAT_00524e20,local_8c,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,s__Worst__004eeb42,(char *)0x0);
      fVar5 = FUN_00448548(param_1,local_8,iVar3,1);
      local_10 = (float)fVar5;
      FUN_004d7f10(local_8c,s___5_2f___004eeb4e);
      FUN_004dbb24(&DAT_00524e20,local_8c,(char *)0x0);
      iVar2 = 0;
      do {
        FUN_00447828((undefined4 *)(iVar3 * 0x3c + param_1 + iVar2 * 0xc + 0x1c168));
        iVar2 = iVar2 + 1;
      } while (iVar2 < 5);
    }
    iVar3 = iVar3 + 1;
    local_14 = local_14 + 0xf;
  } while (iVar3 < 0x10);
  return;
}



/* @00448928 file=? name=FUN_00448928 */

void __cdecl FUN_00448928(int *param_1,LPCSTR param_2,int *param_3)

{
  FUN_00445af0((int *)param_1[0x14],param_2,param_3);
  (**(code **)(*param_1 + 0x50))(param_1,s_Initialization_004eeb58,0);
  return;
}



/* @0044895c file=? name=FUN_0044895c */

void __cdecl FUN_0044895c(int param_1,char *param_2,int param_3)

{
  FUN_00446288(*(int *)(param_1 + 0x50),param_2,param_1,0,0,0,param_3);
  return;
}



/* @00448997 file=? name=FUN_00448997 */

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

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



/* @004489b6 file=? name=FUN_004489b6 */

void __cdecl FUN_004489b6(int *param_1,byte param_2)

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



/* @004489e2 file=? name=FUN_004489e2 */

void FUN_004489e2(void)

{
  return;
}



/* @004489e8 file=? name=FUN_004489e8 */

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

{
  FUN_004178cc(param_1,0x5c);
  *param_1 = &PTR_FUN_004eed7c;
  FUN_00444f5f(param_1 + 6,0);
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = param_4;
  return param_1;
}



/* @00448a28 file=? name=FUN_00448a28 */

void __cdecl FUN_00448a28(int *param_1,byte param_2)

{
  int *piVar1;
  int local_10 [3];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004eed7c;
    FUN_00444fc9(local_10,(int)(param_1 + 6));
    while( true ) {
      piVar1 = (int *)(**(code **)(local_10[0] + 0x28))(local_10);
      if (piVar1 == (int *)0x0) break;
      FUN_00444e64(piVar1,0);
    }
    FUN_00445007(local_10,2);
    FUN_00444f7e(param_1 + 6,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00448aa8 file=? name=FUN_00448aa8 */

void FUN_00448aa8(void)

{
  FUN_00415f1c();
  return;
}



/* @00448ab8 file=munga/gaugalrm.cpp name=FUN_00448ab8 */

undefined4 FUN_00448ab8(void)

{
  FUN_0040385c(s_GaugeAlarmManager__CreateGaugeAl_004eec11,s_d__tesla_bt_munga_GAUGALRM_CPP_004eec4f
               ,0x71);
  return 0;
}



/* @00448ad4 file=munga/gaugalrm.cpp name=FUN_00448ad4 */

void FUN_00448ad4(void)

{
  FUN_0040385c(s_GaugeAlarmManager__ReadGaugeAlar_004eec6e,s_d__tesla_bt_munga_GAUGALRM_CPP_004eecaa
               ,0x7e);
  return;
}



/* @00448af0 file=? name=FUN_00448af0 */

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

{
  int *piVar1;
  undefined4 *puVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  int local_14;
  int local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  local_8 = 0xffffffff;
  local_c = *(undefined4 *)(param_4 + 0x1c);
  *(uint *)(param_4 + 0x1c) = *(uint *)(param_4 + 0x1c) | 0x1f;
  piVar1 = FUN_00404720(param_4,s_gaugeAlarm_004eecc9,(char *)0x0);
  if (piVar1 != (int *)0x0) {
    local_10 = 1;
    local_14 = FUN_00403b60((int)piVar1);
    puVar2 = (undefined4 *)FUN_00402298(0x18);
    if (puVar2 == (undefined4 *)0x0) {
      piVar3 = (int *)0x0;
    }
    else {
      piVar3 = FUN_0040328c(puVar2,0);
    }
    (**(code **)(*piVar3 + 0x20))(piVar3,&local_14,4);
    puVar2 = (undefined4 *)piVar1[1];
    iVar5 = 0;
    if (0 < local_14) {
      do {
        iVar4 = (**(code **)(*param_1 + 4))(param_1,piVar3,puVar2 + 2,puVar2[1]);
        if (iVar4 == 0) {
          FUN_004dbb24(&DAT_00524e20,s_Model_file___004eecd4,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,param_3,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s___has_undefined_alarm_type___004eece1,(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,(char *)(puVar2 + 2),(char *)0x0);
          FUN_004dbb24(&DAT_00524e20,s_____resource_not_built__004eecfe,(char *)0x0);
          local_10 = 0;
          break;
        }
        puVar2 = (undefined4 *)*puVar2;
        iVar5 = iVar5 + 1;
      } while (iVar5 < local_14);
    }
    if (local_10 != 0) {
      puVar2 = (undefined4 *)FUN_00406f3c(param_2,param_3,0x1f,1,0,piVar3,-1);
      local_8 = *puVar2;
    }
    FUN_00403310(piVar3,3);
  }
  *(undefined4 *)(param_4 + 0x1c) = local_c;
  return local_8;
}



/* @00448c54 file=? name=FUN_00448c54 */

undefined4 * __cdecl FUN_00448c54(undefined4 *param_1)

{
  *param_1 = &PTR_FUN_004eed70;
  FUN_00448e72(param_1 + 1,0);
  return param_1;
}



/* @00448c74 file=? name=FUN_00448c74 */

void __cdecl FUN_00448c74(int *param_1,byte param_2)

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



/* @00448ca4 file=? name=FUN_00448ca4 */

undefined4 FUN_00448ca4(void)

{
  return 1;
}



/* @00448cb0 file=? name=FUN_00448cb0 */

void __cdecl FUN_00448cb0(int param_1)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_00448edc(local_10,param_1 + 4);
  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_00448f1a(local_10,2);
  return;
}



/* @00448d00 file=? name=FUN_00448d00 */

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

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int *piVar4;
  int local_10;
  undefined4 *local_c;
  undefined4 *local_8;
  
  iVar2 = FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_5,0x1f);
  if (iVar2 != 0) {
    iVar1 = *(int *)(iVar2 + 4);
    *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + 1;
    if (iVar1 == 0) {
      FUN_00406cd0(iVar2);
    }
    puVar3 = (undefined4 *)FUN_00402298(0x18);
    if (puVar3 == (undefined4 *)0x0) {
      piVar4 = (int *)0x0;
    }
    else {
      piVar4 = FUN_004032dc(puVar3,*(undefined4 *)(iVar2 + 0x3c),*(undefined4 *)(iVar2 + 0x40),0);
    }
    if (piVar4 != (int *)0x0) {
      local_c = (undefined4 *)FUN_00402298(0x28);
      if (local_c == (undefined4 *)0x0) {
        local_8 = (undefined4 *)0x0;
      }
      else {
        local_8 = FUN_004489e8(local_c,param_2,param_3,param_4);
      }
      (**(code **)(param_1[1] + 4))(param_1 + 1,local_8);
      (**(code **)(*piVar4 + 0x1c))(piVar4,&local_10,4);
      for (; 0 < local_10; local_10 = local_10 + -1) {
        (**(code **)(*param_1 + 8))(param_1,local_8,param_2,param_3,param_4,piVar4);
      }
      FUN_00403310(piVar4,3);
    }
    *(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + -1;
  }
  return;
}



/* @00448e00 file=? name=FUN_00448e00 */

void __cdecl FUN_00448e00(int param_1,int param_2,int param_3,int param_4)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_00448edc(local_10,param_1 + 4);
  do {
    puVar1 = (undefined4 *)(**(code **)(local_10[0] + 0x28))(local_10);
    if (puVar1 == (undefined4 *)0x0) goto LAB_00448e5d;
  } while (((param_2 != puVar1[3]) || (param_3 != puVar1[4])) || (puVar1[5] != param_4));
  if (puVar1 != (undefined4 *)0x0) {
    (**(code **)*puVar1)(puVar1,3);
  }
LAB_00448e5d:
  FUN_00448f1a(local_10,2);
  return;
}



/* @00448e72 file=? name=FUN_00448e72 */

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

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



/* @00448e91 file=? name=FUN_00448e91 */

void __cdecl FUN_00448e91(int *param_1,byte param_2)

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



/* @00448ebd file=? name=FUN_00448ebd */

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

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



/* @00448edc file=? name=FUN_00448edc */

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

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



/* @00448efb file=? name=FUN_00448efb */

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

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



/* @00448f1a file=? name=FUN_00448f1a */

void __cdecl FUN_00448f1a(int *param_1,byte param_2)

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



/* @00448f48 file=? name=FUN_00448f48 */

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

{
  uint uVar1;
  int *piVar2;
  undefined4 uVar3;
  uint uVar4;
  undefined1 *puVar5;
  int iVar6;
  char local_19;
  uint local_18;
  int local_14;
  uint local_10;
  int local_c;
  uint local_8;
  
  piVar2 = FUN_004d6f54(param_1,&DAT_004eed88);
  if (piVar2 == (int *)0x0) {
    uVar3 = 0;
  }
  else {
    uVar4 = FUN_004d71e0(param_2,0x80,1,piVar2);
    if (uVar4 == 1) {
      if ((((*param_2 == '\n') && (param_2[3] == '\b')) && (param_2[2] == '\x01')) &&
         (param_2[0x41] == '\x01')) {
        local_8 = (uint)*(ushort *)(param_2 + 0x42);
        local_c = ((uint)*(ushort *)(param_2 + 8) - (uint)*(ushort *)(param_2 + 4)) + 1;
        iVar6 = ((uint)*(ushort *)(param_2 + 10) - (uint)*(ushort *)(param_2 + 6)) + 1;
        if (param_3 == (int *)0x0) {
          FUN_004d7270(piVar2,-0x301,2);
        }
        else {
          if ((int *)*param_3 != (int *)0x0) {
            FUN_004022d0((int *)*param_3);
            *param_3 = 0;
          }
          puVar5 = (undefined1 *)FUN_004022b0(local_c * iVar6);
          *param_3 = (int)puVar5;
          for (local_14 = iVar6; iVar6 = local_c, uVar4 = local_8, 0 < local_14;
              local_14 = local_14 + -1) {
            while (local_10 = uVar4, 0 < (int)local_10) {
              uVar4 = FUN_004d744c(piVar2);
              if ((*(byte *)((int)piVar2 + 0x12) & 0x10) != 0) {
                FUN_004d6b08(piVar2);
                FUN_004022d0((int *)*param_3);
                *param_3 = 0;
                return 0;
              }
              if ((uVar4 & 0xc0) == 0xc0) {
                local_18 = uVar4 & 0x3f;
                local_10 = local_10 - local_18;
                uVar4 = FUN_004d744c(piVar2);
                while (uVar1 = local_18 - 1, local_18 != 0) {
                  local_18 = uVar1;
                  if (0 < iVar6) {
                    iVar6 = iVar6 + -1;
                    *puVar5 = (char)uVar4;
                    puVar5 = puVar5 + 1;
                  }
                }
                local_18 = 0xffffffff;
                uVar4 = local_10;
              }
              else {
                if (0 < iVar6) {
                  iVar6 = iVar6 + -1;
                  *puVar5 = (char)uVar4;
                  puVar5 = puVar5 + 1;
                }
                uVar4 = local_10 - 1;
              }
            }
          }
        }
        if (param_4 != (char *)0x0) {
          uVar4 = FUN_004d71e0(&local_19,1,1,piVar2);
          if (uVar4 != 1) {
            FUN_004d6b08(piVar2);
            return 0;
          }
          if (local_19 != '\f') {
            FUN_004d6b08(piVar2);
            return 0;
          }
          uVar4 = FUN_004d71e0(param_4,0x300,1,piVar2);
          if (uVar4 != 1) {
            FUN_004d6b08(piVar2);
            return 0;
          }
        }
        FUN_004d6b08(piVar2);
        uVar3 = 1;
      }
      else {
        FUN_004d6b08(piVar2);
        uVar3 = 0;
      }
    }
    else {
      FUN_004d6b08(piVar2);
      uVar3 = 0;
    }
  }
  return uVar3;
}



/* @00449148 file=? name=FUN_00449148 */

undefined4 * __cdecl FUN_00449148(char *param_1)

{
  undefined4 *puVar1;
  undefined4 local_54;
  undefined2 uStack_50;
  undefined1 uStack_4e;
  
  local_54 = DAT_004eed8b;
  uStack_50 = DAT_004eed8f;
  uStack_4e = DAT_004eed91;
  FUN_004d49b8((char *)&local_54,param_1);
  puVar1 = (undefined4 *)FUN_00402298(0x1c);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0044927c(puVar1,(LPCSTR)&local_54);
  }
  if (puVar1[6] == 0) {
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    puVar1 = (undefined4 *)0x0;
  }
  return puVar1;
}



/* @004491ac file=? name=FUN_004491ac */

undefined4 FUN_004491ac(void)

{
  return 0;
}



/* @004491b4 file=? name=FUN_004491b4 */

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

{
  undefined4 uVar1;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004ef674;
  param_1[5] = param_2 + 0xf >> 4;
  uVar1 = FUN_004022b0(param_1[5] * param_3 * 2);
  param_1[6] = uVar1;
  param_1[3] = param_2;
  param_1[4] = param_3;
  return param_1;
}



/* @004491fc file=? name=FUN_004491fc */

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

{
  int iVar1;
  undefined4 uVar2;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004ef674;
  param_1[5] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  if ((0 < param_2) && (0 < param_3)) {
    iVar1 = param_2 + 0xf >> 4;
    uVar2 = FUN_004022b0(iVar1 * param_3 * 2);
    param_1[6] = uVar2;
    param_1[5] = iVar1;
    param_1[3] = param_2;
    param_1[4] = param_3;
    FUN_004d4918((undefined4 *)param_1[6],param_4,iVar1 * param_3 * 2);
  }
  return param_1;
}



/* @0044927c file=? name=FUN_0044927c */

undefined4 * __cdecl FUN_0044927c(undefined4 *param_1,LPCSTR param_2)

{
  ushort uVar1;
  ushort uVar2;
  int iVar3;
  ushort uVar4;
  char local_94 [4];
  ushort local_90;
  ushort local_8e;
  ushort local_8c;
  ushort local_8a;
  int local_14;
  ushort *local_10;
  int *local_c;
  int *local_8;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004ef674;
  local_8 = (int *)0x0;
  param_1[5] = 0;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[6] = 0;
  iVar3 = FUN_00448f48(param_2,local_94,(int *)&local_8,(char *)0x0);
  if ((iVar3 == 1) && (local_8 != (int *)0x0)) {
    param_1[3] = ((uint)local_8c - (uint)local_90) + 1;
    param_1[4] = ((uint)local_8a - (uint)local_8e) + 1;
    iVar3 = param_1[3] + 0xf >> 4;
    param_1[5] = iVar3;
    local_10 = (ushort *)FUN_004022b0(iVar3 * param_1[4] * 2);
    param_1[6] = local_10;
    uVar4 = 0;
    uVar2 = 0x8000;
    local_c = local_8;
    for (local_14 = param_1[4]; 0 < local_14; local_14 = local_14 + -1) {
      for (iVar3 = param_1[3]; 0 < iVar3; iVar3 = iVar3 + -1) {
        if ((char)*local_c != '\0') {
          uVar4 = uVar4 | uVar2;
        }
        uVar1 = uVar2 >> 1;
        if (uVar2 >> 1 == 0) {
          *local_10 = uVar4;
          local_10 = local_10 + 1;
          uVar1 = 0x8000;
          uVar4 = 0;
        }
        uVar2 = uVar1;
        local_c = (int *)((int)local_c + 1);
      }
      if (uVar2 != 0x8000) {
        uVar2 = 0x8000;
        *local_10 = uVar4;
        local_10 = local_10 + 1;
        uVar4 = 0;
      }
    }
    FUN_004022d0(local_8);
  }
  return param_1;
}



/* @004493a8 file=? name=FUN_004493a8 */

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

{
  char *pcVar1;
  undefined4 *puVar2;
  bool bVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  undefined3 extraout_var_01;
  undefined4 uVar4;
  int *piVar5;
  char *pcVar6;
  uint uVar7;
  int iVar8;
  char *pcVar9;
  int iVar10;
  int iVar11;
  undefined2 *local_1c;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00415e90(param_1,1);
  *param_1 = &PTR_FUN_004ef674;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  bVar3 = FUN_004040d8(param_2,param_3,&DAT_004eed92,&local_8);
  if (((CONCAT31(extraout_var,bVar3) != 0) &&
      (bVar3 = FUN_004040d8(param_2,param_3,&DAT_004eed94,&local_c),
      CONCAT31(extraout_var_00,bVar3) != 0)) &&
     (bVar3 = FUN_004040d8(param_2,param_3,s_width_004eed96,&local_10),
     CONCAT31(extraout_var_01,bVar3) != 0)) {
    uVar4 = FUN_004022b0(local_10 * local_c * 2);
    param_1[6] = uVar4;
    param_1[3] = local_8;
    param_1[4] = local_c;
    param_1[5] = local_10;
    piVar5 = FUN_00404720(param_2,param_3,(char *)0x0);
    iVar10 = 0;
    iVar11 = 4;
    local_1c = (undefined2 *)param_1[6];
    for (puVar2 = (undefined4 *)piVar5[1]; puVar2 != (undefined4 *)0x0;
        puVar2 = (undefined4 *)*puVar2) {
      pcVar6 = (char *)(puVar2 + 2);
      if (pcVar6 != (char *)0x0) {
        pcVar9 = s_bitmap_004eed9c;
        do {
          bVar3 = *pcVar6 == *pcVar9;
          if (!bVar3) break;
          if (*pcVar6 == '\0') goto LAB_004494d6;
          pcVar1 = pcVar6 + 1;
          bVar3 = *pcVar1 == pcVar9[1];
          if (!bVar3) break;
          pcVar6 = pcVar6 + 2;
          pcVar9 = pcVar9 + 2;
          bVar3 = *pcVar1 == '\0';
        } while (!bVar3);
        if (bVar3) {
LAB_004494d6:
          for (pcVar6 = (char *)puVar2[1]; *pcVar6 != '\0'; pcVar6 = pcVar6 + 1) {
            uVar7 = FUN_004dc8c4((int)*pcVar6);
            if (0x39 < (int)uVar7) {
              uVar7 = uVar7 - 7;
            }
            iVar10 = (uVar7 - 0x30) + iVar10 * 0x10;
            iVar11 = iVar11 + -1;
            if (iVar11 < 1) {
              iVar8 = (int)local_1c - param_1[6] >> 1;
              if (iVar8 < 0) {
                iVar8 = iVar8 + (uint)(((int)local_1c - param_1[6] & 1U) != 0);
              }
              if (local_10 * local_c <= iVar8) break;
              iVar11 = 4;
              *local_1c = (short)iVar10;
              local_1c = local_1c + 1;
              iVar10 = 0;
            }
          }
        }
      }
    }
    if (piVar5 != (int *)0x0) {
      (**(code **)*piVar5)(piVar5,3);
    }
  }
  return param_1;
}



/* @00449568 file=? name=FUN_00449568 */

void __cdecl FUN_00449568(int *param_1,byte param_2)

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



/* @004495b4 file=? name=FUN_004495b4 */

undefined4 FUN_004495b4(void)

{
  return 1;
}



/* @004495c0 file=? name=FUN_004495c0 */

void __cdecl FUN_004495c0(int param_1,char *param_2)

{
  char cVar1;
  ushort uVar2;
  int *piVar3;
  uint uVar4;
  uint uVar5;
  char *pcVar6;
  char *pcVar7;
  undefined8 uVar8;
  uint *puVar9;
  char local_64 [80];
  ushort *local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_BitMap__004eeda3,(char *)0x0);
  uVar4 = 0xffffffff;
  do {
    pcVar6 = param_2;
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    pcVar6 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar6;
  } while (cVar1 != '\0');
  uVar4 = ~uVar4;
  pcVar6 = pcVar6 + -uVar4;
  pcVar7 = local_64;
  for (uVar5 = uVar4 >> 2; uVar5 != 0; uVar5 = uVar5 - 1) {
    *(undefined4 *)pcVar7 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar7 = pcVar7 + 4;
  }
  for (uVar4 = uVar4 & 3; uVar4 != 0; uVar4 = uVar4 - 1) {
    *pcVar7 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar7 = pcVar7 + 1;
  }
  FUN_004d49b8(local_64,&DAT_004eedac);
  puVar9 = (uint *)(param_1 + 0xc);
  FUN_004dbb24(&DAT_00524e20,local_64,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_Size___004eedb0,(char *)0x0);
  piVar3 = (int *)FUN_00407f08(&DAT_00524e20,puVar9);
  FUN_004dbb24(piVar3,&DAT_004eedbe,(char *)0x0);
  uVar4 = *(uint *)(param_1 + 0x14);
  FUN_004dbb24(&DAT_00524e20,local_64,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_WidthInWords__004eedc0,(char *)0x0);
  piVar3 = FUN_004db78c(&DAT_00524e20,uVar4);
  FUN_004dbb24(piVar3,&DAT_004eedce,(char *)0x0);
  uVar4 = *(uint *)(param_1 + 0x18);
  FUN_004dbb24(&DAT_00524e20,local_64,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_MapPointer___004eedd0,(char *)0x0);
  uVar8 = FUN_004dbd4c(&DAT_00524e20,uVar4);
  FUN_004dbb24((int *)uVar8,&DAT_004eedde,(char *)0x0);
  FUN_004d9c70(&DAT_00524e20);
  local_14 = *(ushort **)(param_1 + 0x18);
  if (local_14 != (ushort *)0x0) {
    for (local_c = *(int *)(param_1 + 0x10); 0 < local_c; local_c = local_c + -1) {
      FUN_004dbb24(&DAT_00524e20,local_64,(char *)0x0);
      local_10 = 0;
      for (local_8 = *(int *)(param_1 + 0x14); 0 < local_8; local_8 = local_8 + -1) {
        uVar4 = 0x8000;
        uVar2 = *local_14;
        local_14 = local_14 + 1;
        do {
          local_10 = local_10 + 1;
          if (*(int *)(param_1 + 0xc) < local_10) {
            FUN_004dbb24(&DAT_00524e20,&DAT_004eede0,(char *)0x0);
          }
          else if ((uVar4 & uVar2) == 0) {
            FUN_004dbb24(&DAT_00524e20,&DAT_004eede4,(char *)0x0);
          }
          else {
            FUN_004dbb24(&DAT_00524e20,&DAT_004eede2,(char *)0x0);
          }
          uVar4 = (int)uVar4 >> 1;
        } while (uVar4 != 0);
      }
      FUN_004dbb24(&DAT_00524e20,&DAT_004eede6,(char *)0x0);
    }
    FUN_004dbb24(&DAT_00524e20,&DAT_004eede8,(char *)0x0);
  }
  return;
}



/* @00449808 file=? name=FUN_00449808 */

void __cdecl FUN_00449808(undefined4 *param_1,byte *param_2)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  int *piVar4;
  byte bVar5;
  byte bVar6;
  undefined *puVar7;
  
  puVar7 = &LAB_004d9c84;
  bVar1 = param_2[2];
  bVar6 = 0x3a;
  bVar2 = param_2[1];
  bVar5 = 0x3a;
  bVar3 = *param_2;
  piVar4 = FUN_004dbaa8(param_1,&LAB_004d9ca4);
  piVar4 = FUN_004db78c(piVar4,(uint)bVar3);
  piVar4 = FUN_004db92c(piVar4,bVar5);
  piVar4 = FUN_004db78c(piVar4,(uint)bVar2);
  piVar4 = FUN_004db92c(piVar4,bVar6);
  piVar4 = FUN_004db78c(piVar4,(uint)bVar1);
  FUN_004dbaa8(piVar4,puVar7);
  return;
}



/* @004498a8 file=? name=FUN_004498a8 */

void __cdecl FUN_004498a8(undefined4 *param_1)

{
  *param_1 = 0;
  return;
}



/* @004498b4 file=? name=FUN_004498b4 */

int * __cdecl FUN_004498b4(char *param_1)

{
  undefined4 *puVar1;
  int *piVar2;
  undefined4 local_54;
  undefined2 uStack_50;
  undefined1 uStack_4e;
  
  local_54 = DAT_004eedea;
  uStack_50 = DAT_004eedee;
  uStack_4e = DAT_004eedf0;
  FUN_004d49b8((char *)&local_54,param_1);
  puVar1 = (undefined4 *)FUN_00402298(0x304);
  if (puVar1 == (undefined4 *)0x0) {
    piVar2 = (int *)0x0;
  }
  else {
    piVar2 = FUN_00449968(puVar1,(LPCSTR)&local_54);
  }
  if (*piVar2 == 0) {
    FUN_00449994(piVar2,3);
    piVar2 = (int *)0x0;
  }
  return piVar2;
}



/* @00449918 file=? name=FUN_00449918 */

undefined4 FUN_00449918(void)

{
  return 0;
}



/* @00449920 file=? name=FUN_00449920 */

undefined4 * __cdecl FUN_00449920(undefined4 *param_1,int param_2,undefined1 *param_3)

{
  int iVar1;
  int iVar2;
  
  iVar1 = 0;
  if (0 < param_2) {
    do {
      iVar2 = iVar1 + 1;
      *(undefined1 *)((int)param_1 + iVar1 * 3 + 4) = *param_3;
      *(undefined1 *)((int)param_1 + iVar1 * 3 + 5) = param_3[1];
      *(undefined1 *)((int)param_1 + iVar1 * 3 + 6) = param_3[2];
      iVar1 = iVar2;
      param_3 = param_3 + 3;
    } while (iVar2 < param_2);
  }
  *param_1 = 1;
  return param_1;
}



/* @00449968 file=? name=FUN_00449968 */

undefined4 * __cdecl FUN_00449968(undefined4 *param_1,LPCSTR param_2)

{
  undefined4 uVar1;
  char local_84 [128];
  
  uVar1 = FUN_00448f48(param_2,local_84,(int *)0x0,(char *)(param_1 + 1));
  *param_1 = uVar1;
  return param_1;
}



/* @00449994 file=? name=FUN_00449994 */

void __cdecl FUN_00449994(int *param_1,byte param_2)

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



/* @004499b0 file=? name=FUN_004499b0 */

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

{
  int iVar1;
  
  for (; param_2 <= param_3; param_2 = param_2 + 1) {
    iVar1 = param_2 * 3 + param_1;
    *(undefined1 *)(iVar1 + 4) = (undefined1)param_4;
    *(undefined1 *)(iVar1 + 5) = param_4._1_1_;
    *(undefined1 *)(iVar1 + 6) = param_4._2_1_;
  }
  return;
}



/* @004499e4 file=? name=FUN_004499e4 */

void __cdecl FUN_004499e4(int param_1,int param_2,int param_3,uint param_4,uint param_5)

{
  int iVar1;
  undefined1 *puVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  iVar4 = param_3 - param_2;
  if (iVar4 == 0) {
    iVar4 = param_2 * 3 + param_1;
    *(undefined1 *)(iVar4 + 4) = (undefined1)param_4;
    *(byte *)(iVar4 + 5) = param_4._1_1_;
    *(byte *)(iVar4 + 6) = param_4._2_1_;
  }
  else {
    iVar3 = (param_4 & 0xff) << 5;
    iVar5 = (uint)param_4._1_1_ << 5;
    iVar1 = (uint)param_4._2_1_ << 5;
    puVar2 = (undefined1 *)(param_1 + 4 + param_2 * 3);
    for (; param_2 <= param_3; param_2 = param_2 + 1) {
      *puVar2 = (char)(iVar3 >> 5);
      puVar2[1] = (char)(iVar5 >> 5);
      puVar2[2] = (char)(iVar1 >> 5);
      iVar3 = iVar3 + (int)(((param_5 & 0xff) - (param_4 & 0xff)) * 0x20) / iVar4;
      iVar5 = iVar5 + (int)(((param_5 >> 8 & 0xff) - (uint)param_4._1_1_) * 0x20) / iVar4;
      iVar1 = iVar1 + (int)(((param_5 >> 0x10 & 0xff) - (uint)param_4._2_1_) * 0x20) / iVar4;
      puVar2 = puVar2 + 3;
    }
  }
  return;
}



/* @00449ab4 file=? name=FUN_00449ab4 */

undefined4 FUN_00449ab4(void)

{
  return 1;
}



/* @00449ac0 file=? name=FUN_00449ac0 */

void __cdecl FUN_00449ac0(uint *param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  int iVar6;
  char *pcVar7;
  uint *puVar8;
  uint *puVar9;
  char local_78 [32];
  char local_58 [80];
  int local_8;
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_Palette8__004eedf1,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar5 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar5 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar5;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar5 + -uVar3;
  pcVar7 = local_58;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar7 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar7 = pcVar7 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar7 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar7 = pcVar7 + 1;
  }
  FUN_004d49b8(local_58,&DAT_004eedfc);
  uVar3 = *param_1;
  FUN_004dbb24(&DAT_00524e20,local_58,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_Valid___004eee00,(char *)0x0);
  piVar2 = FUN_004db78c(&DAT_00524e20,uVar3);
  FUN_004dbb24(piVar2,&DAT_004eee08,(char *)0x0);
  if (*param_1 != 0) {
    puVar9 = param_1 + 1;
    local_8 = 0;
    do {
      FUN_004d7f10(local_78,s__02X__004eee0a);
      FUN_004dbb24(&DAT_00524e20,local_58,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,local_78,(char *)0x0);
      iVar6 = 4;
      puVar8 = puVar9;
      do {
        puVar9 = (uint *)((int)puVar8 + 3);
        piVar2 = (int *)FUN_00449808(&DAT_00524e20,(byte *)puVar8);
        FUN_004dbb24(piVar2,&DAT_004eee11,(char *)0x0);
        iVar6 = iVar6 + -1;
        puVar8 = puVar9;
      } while (0 < iVar6);
      FUN_004dbb24(&DAT_00524e20,&DAT_004eee13,(char *)0x0);
      local_8 = local_8 + 4;
    } while (local_8 < 0x100);
  }
  return;
}



/* @00449c1c file=? name=FUN_00449c1c */

int * __cdecl FUN_00449c1c(char *param_1)

{
  int *piVar1;
  undefined4 local_54;
  undefined2 uStack_50;
  undefined1 uStack_4e;
  
  local_54 = DAT_004eee15;
  uStack_50 = DAT_004eee19;
  uStack_4e = DAT_004eee1b;
  FUN_004d49b8((char *)&local_54,param_1);
  piVar1 = (int *)FUN_00402298(0xc);
  if (piVar1 == (int *)0x0) {
    piVar1 = (int *)0x0;
  }
  else {
    piVar1 = FUN_00449cb0(piVar1,(LPCSTR)&local_54);
  }
  if (piVar1[2] == 0) {
    FUN_00449d0c(piVar1,3);
    piVar1 = (int *)0x0;
  }
  return piVar1;
}



/* @00449c80 file=? name=FUN_00449c80 */

undefined4 FUN_00449c80(void)

{
  return 0;
}



/* @00449c88 file=? name=FUN_00449c88 */

int * __cdecl FUN_00449c88(int *param_1,int param_2,int param_3)

{
  int iVar1;
  
  *param_1 = param_2;
  param_1[1] = param_3;
  iVar1 = FUN_004022b0(param_2 * param_3);
  param_1[2] = iVar1;
  return param_1;
}



/* @00449cb0 file=? name=FUN_00449cb0 */

int * __cdecl FUN_00449cb0(int *param_1,LPCSTR param_2)

{
  int iVar1;
  char local_84 [4];
  ushort local_80;
  ushort local_7e;
  ushort local_7c;
  ushort local_7a;
  
  param_1[2] = 0;
  iVar1 = FUN_00448f48(param_2,local_84,param_1 + 2,(char *)0x0);
  if (iVar1 == 1) {
    if (param_1[2] == 0) {
      *param_1 = 0;
      param_1[1] = 0;
    }
    else {
      *param_1 = ((uint)local_7c - (uint)local_80) + 1;
      param_1[1] = ((uint)local_7a - (uint)local_7e) + 1;
    }
  }
  return param_1;
}



/* @00449d0c file=? name=FUN_00449d0c */

void __cdecl FUN_00449d0c(int *param_1,byte param_2)

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



/* @00449d44 file=? name=FUN_00449d44 */

undefined4 FUN_00449d44(void)

{
  return 1;
}



/* @00449d50 file=? name=FUN_00449d50 */

void __cdecl FUN_00449d50(uint *param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  undefined8 uVar7;
  uint *puVar8;
  char local_78 [32];
  char local_58 [80];
  uint local_8;
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_PixelMap8__004eee1c,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar5 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar5 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar5;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar5 + -uVar3;
  pcVar6 = local_58;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar6 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar6 = pcVar6 + 1;
  }
  FUN_004d49b8(local_58,&DAT_004eee28);
  puVar8 = param_1;
  FUN_004dbb24(&DAT_00524e20,local_58,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_Size___004eee2c,(char *)0x0);
  piVar2 = (int *)FUN_00407f08(&DAT_00524e20,puVar8);
  FUN_004dbb24(piVar2,&DAT_004eee3a,(char *)0x0);
  uVar3 = param_1[2];
  FUN_004dbb24(&DAT_00524e20,local_58,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_MapPointer___004eee3c,(char *)0x0);
  uVar7 = FUN_004dbd4c(&DAT_00524e20,uVar3);
  FUN_004dbb24((int *)uVar7,&DAT_004eee4a,(char *)0x0);
  if (param_1[2] != 0) {
    for (local_8 = param_1[1]; 0 < (int)local_8; local_8 = local_8 - 1) {
      FUN_004dbb24(&DAT_00524e20,local_58,(char *)0x0);
      for (uVar3 = *param_1; 0 < (int)uVar3; uVar3 = uVar3 - 1) {
        FUN_004d7f10(local_78,s__02X_004eee4c);
        FUN_004dbb24(&DAT_00524e20,local_78,(char *)0x0);
      }
      FUN_004dbb24(&DAT_00524e20,&DAT_004eee52,(char *)0x0);
    }
  }
  return;
}



/* @00449ed0 file=? name=FUN_00449ed0 */

int * __cdecl FUN_00449ed0(int *param_1,int param_2,int param_3)

{
  int iVar1;
  
  *param_1 = param_2;
  param_1[1] = param_3;
  iVar1 = FUN_004022b0(param_2 * param_3 * 2);
  param_1[2] = iVar1;
  return param_1;
}



/* @00449efc file=munga/graph2d.cpp name=FUN_00449efc */

undefined4 * __cdecl FUN_00449efc(undefined4 *param_1)

{
  FUN_0040385c(s_PixelMap16__PixelMap16_char____U_004eee54,s_d__tesla_bt_munga_GRAPH2D_CPP_004eee82,
               0x3d0);
  param_1[2] = 0;
  *param_1 = 0;
  param_1[1] = 0;
  return param_1;
}



/* @00449f30 file=? name=FUN_00449f30 */

void __cdecl FUN_00449f30(int *param_1,byte param_2)

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



/* @00449f68 file=? name=FUN_00449f68 */

undefined4 FUN_00449f68(void)

{
  return 1;
}



/* @00449f74 file=? name=FUN_00449f74 */

void __cdecl FUN_00449f74(uint *param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  undefined8 uVar7;
  uint *puVar8;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_PixelMap16__004eeea0,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar5 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar5 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar5;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar5 + -uVar3;
  pcVar6 = local_54;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar6 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar6 = pcVar6 + 1;
  }
  FUN_004d49b8(local_54,&DAT_004eeead);
  puVar8 = param_1;
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_Size___004eeeb1,(char *)0x0);
  piVar2 = (int *)FUN_00407f08(&DAT_00524e20,puVar8);
  FUN_004dbb24(piVar2,&DAT_004eeebf,(char *)0x0);
  uVar3 = param_1[2];
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_MapPointer___004eeec1,(char *)0x0);
  uVar7 = FUN_004dbd4c(&DAT_00524e20,uVar3);
  FUN_004dbb24((int *)uVar7,&DAT_004eeecf,(char *)0x0);
  return;
}



/* @0044a078 file=? name=FUN_0044a078 */

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

{
  *param_1 = &PTR_FUN_004ef640;
  FUN_00407b9c(param_1 + 1);
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = param_2 + -1;
  param_1[4] = param_3 + -1;
  return param_1;
}



/* @0044a0ac file=? name=FUN_0044a0ac */

void __cdecl FUN_0044a0ac(int *param_1,byte param_2)

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



/* @0044a0cc file=? name=FUN_0044a0cc */

void __cdecl FUN_0044a0cc(int param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  uint *puVar5;
  char *pcVar6;
  char *pcVar7;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_GraphicsDisplay__004eeed1,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar6 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar6 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar6;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar6 = pcVar6 + -uVar3;
  pcVar7 = local_54;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar7 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar7 = pcVar7 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar7 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar7 = pcVar7 + 1;
  }
  FUN_004d49b8(local_54,&DAT_004eeee3);
  puVar5 = (uint *)(param_1 + 4);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_bounds___004eeee7,(char *)0x0);
  piVar2 = (int *)FUN_00407d78(&DAT_00524e20,puVar5);
  FUN_004dbb24(piVar2,&DAT_004eeef0,(char *)0x0);
  return;
}



/* @0044a188 file=? name=FUN_0044a188 */

undefined4 FUN_0044a188(void)

{
  return 1;
}



/* @0044a194 file=? name=FUN_0044a194 */

undefined4 FUN_0044a194(void)

{
  return 0;
}



/* @0044a19c file=? name=FUN_0044a19c */

void FUN_0044a19c(void)

{
  return;
}



/* @0044a1a4 file=munga/graph2d.cpp name=FUN_0044a1a4 */

undefined4 * __cdecl FUN_0044a1a4(undefined4 *param_1)

{
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  FUN_0040385c(s_GraphicsDisplay__TextBounds______004eeef2,s_d__tesla_bt_munga_GRAPH2D_CPP_004eef25,
               0x43f);
  FUN_00407b9c(&local_14);
  *param_1 = local_14;
  param_1[1] = local_10;
  param_1[2] = local_c;
  param_1[3] = local_8;
  return param_1;
}



/* @0044a1f0 file=munga/graph2d.cpp name=FUN_0044a1f0 */

void FUN_0044a1f0(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawPoint_not_o_004eef43,s_d__tesla_bt_munga_GRAPH2D_CPP_004eef6d,
               0x450);
  return;
}



/* @0044a20c file=munga/graph2d.cpp name=FUN_0044a20c */

void FUN_0044a20c(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawLine_not_ov_004eef8b,s_d__tesla_bt_munga_GRAPH2D_CPP_004eefb4,
               0x45f);
  return;
}



/* @0044a228 file=munga/graph2d.cpp name=FUN_0044a228 */

void FUN_0044a228(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawFilledRecta_004eefd2,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef006,
               0x46d);
  return;
}



/* @0044a244 file=munga/graph2d.cpp name=FUN_0044a244 */

void FUN_0044a244(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawText_not_ov_004ef024,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef04d,
               0x47e);
  return;
}



/* @0044a260 file=munga/graph2d.cpp name=FUN_0044a260 */

void FUN_0044a260(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawBitMap_not_o_004ef06b,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef096
               ,0x490);
  return;
}



/* @0044a27c file=munga/graph2d.cpp name=FUN_0044a27c */

void FUN_0044a27c(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawBitMapOpaqu_004ef0b4,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef0e5,
               0x4a3);
  return;
}



/* @0044a298 file=munga/graph2d.cpp name=FUN_0044a298 */

void FUN_0044a298(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawPixelMap8_n_004ef103,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef131,
               0x4b6);
  return;
}



/* @0044a2b4 file=munga/graph2d.cpp name=FUN_0044a2b4 */

void FUN_0044a2b4(void)

{
  FUN_0040385c(s_GraphicsDisplay__DrawPixelMap8Si_004ef14f,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef188,
               0x4c8);
  return;
}



/* @0044a2d0 file=? name=FUN_0044a2d0 */

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

{
  char cVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  undefined4 *puVar5;
  char *pcVar6;
  undefined4 *puVar7;
  char *pcVar8;
  
  *param_1 = &PTR_FUN_004ef610;
  FUN_00407b9c(param_1 + 1);
  if (param_2 == (undefined4 *)0x0) {
    param_1[1] = 0;
    param_1[2] = 0;
    param_1[3] = 0;
    param_1[4] = 0;
  }
  else {
    iVar2 = 4;
    puVar5 = param_2;
    puVar7 = param_1;
    while( true ) {
      puVar7 = puVar7 + 1;
      puVar5 = puVar5 + 1;
      if (iVar2 == 0) break;
      iVar2 = iVar2 + -1;
      *puVar7 = *puVar5;
    }
  }
  param_1[5] = param_2;
  uVar3 = 0xffffffff;
  do {
    pcVar6 = param_3;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar6 = param_3 + 1;
    cVar1 = *param_3;
    param_3 = pcVar6;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar6 = pcVar6 + -uVar3;
  pcVar8 = (char *)(param_1 + 6);
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar8 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar8 = pcVar8 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar8 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar8 = pcVar8 + 1;
  }
  return param_1;
}



/* @0044a348 file=? name=FUN_0044a348 */

void __cdecl FUN_0044a348(int *param_1,byte param_2)

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



/* @0044a368 file=? name=FUN_0044a368 */

undefined4 FUN_0044a368(void)

{
  return 1;
}



/* @0044a374 file=? name=FUN_0044a374 */

void __cdecl FUN_0044a374(int param_1,char *param_2)

{
  char cVar1;
  int *piVar2;
  uint uVar3;
  uint uVar4;
  char *pcVar5;
  char *pcVar6;
  undefined8 uVar7;
  uint *puVar8;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_GraphicsPort__004ef1a6,(char *)0x0);
  uVar3 = 0xffffffff;
  do {
    pcVar5 = param_2;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar5 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar5;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar5 = pcVar5 + -uVar3;
  pcVar6 = local_54;
  for (uVar4 = uVar3 >> 2; uVar4 != 0; uVar4 = uVar4 - 1) {
    *(undefined4 *)pcVar6 = *(undefined4 *)pcVar5;
    pcVar5 = pcVar5 + 4;
    pcVar6 = pcVar6 + 4;
  }
  for (uVar3 = uVar3 & 3; uVar3 != 0; uVar3 = uVar3 - 1) {
    *pcVar6 = *pcVar5;
    pcVar5 = pcVar5 + 1;
    pcVar6 = pcVar6 + 1;
  }
  FUN_004d49b8(local_54,&DAT_004ef1b5);
  puVar8 = (uint *)(param_1 + 4);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_bounds___004ef1b9,(char *)0x0);
  piVar2 = (int *)FUN_00407d78(&DAT_00524e20,puVar8);
  FUN_004dbb24(piVar2,&DAT_004ef1ca,(char *)0x0);
  uVar3 = *(uint *)(param_1 + 0x14);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_graphicsDisplay__004ef1cc,(char *)0x0);
  uVar7 = FUN_004dbd4c(&DAT_00524e20,uVar3);
  FUN_004dbb24((int *)uVar7,&DAT_004ef1dd,(char *)0x0);
  FUN_004d9c70(&DAT_00524e20);
  return;
}



/* @0044a488 file=? name=FUN_0044a488 */

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

{
  (**(code **)(**(int **)(param_2 + 0x14) + 0x10))
            (param_1,*(int **)(param_2 + 0x14),param_3,param_4,param_5,param_6);
  return param_1;
}



/* @0044a4b8 file=munga/graph2d.cpp name=FUN_0044a4b8 */

void FUN_0044a4b8(void)

{
  FUN_0040385c(s_GraphicsPort__SetColor_not_overr_004ef1df,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef205,
               0x522);
  return;
}



/* @0044a4d4 file=munga/graph2d.cpp name=FUN_0044a4d4 */

void FUN_0044a4d4(void)

{
  FUN_0040385c(s_GraphicsPort__DrawPoint_not_over_004ef223,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef24a,
               0x52d);
  return;
}



/* @0044a4f0 file=munga/graph2d.cpp name=FUN_0044a4f0 */

void FUN_0044a4f0(void)

{
  FUN_0040385c(s_GraphicsPort__DrawLine_not_overr_004ef268,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef28e,
               0x53b);
  return;
}



/* @0044a50c file=munga/graph2d.cpp name=FUN_0044a50c */

void FUN_0044a50c(void)

{
  FUN_0040385c(s_GraphicsPort__DrawFilledRectangl_004ef2ac,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef2dd,
               0x548);
  return;
}



/* @0044a528 file=munga/graph2d.cpp name=FUN_0044a528 */

void FUN_0044a528(void)

{
  FUN_0040385c(s_GraphicsPort__DrawText_not_overr_004ef2fb,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef321,
               0x558);
  return;
}



/* @0044a544 file=munga/graph2d.cpp name=FUN_0044a544 */

void FUN_0044a544(void)

{
  FUN_0040385c(s_GraphicsPort__DrawBitMap_not_ove_004ef33f,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef367,
               0x569);
  return;
}



/* @0044a560 file=munga/graph2d.cpp name=FUN_0044a560 */

void FUN_0044a560(void)

{
  FUN_0040385c(s_GraphicsPort__DrawBitMapOpaque_n_004ef385,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef3b3,
               0x57b);
  return;
}



/* @0044a57c file=munga/graph2d.cpp name=FUN_0044a57c */

void FUN_0044a57c(void)

{
  FUN_0040385c(s_GraphicsPort__DrawPixelMap8_not_o_004ef3d1,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef3fc
               ,0x58c);
  return;
}



/* @0044a598 file=munga/graph2d.cpp name=FUN_0044a598 */

void FUN_0044a598(void)

{
  FUN_0040385c(s_GraphicsPort__DrawPixelMap8Singl_004ef41a,s_d__tesla_bt_munga_GRAPH2D_CPP_004ef450,
               0x59d);
  return;
}



/* @0044a5b4 file=? name=FUN_0044a5b4 */

uint * __cdecl FUN_0044a5b4(uint *param_1)

{
  uint uVar1;
  
  *param_1 = 0x1000;
  param_1[1] = 0;
  uVar1 = FUN_004022b0(*param_1);
  param_1[2] = uVar1;
  param_1[3] = 0;
  return param_1;
}



/* @0044a5dc file=? name=FUN_0044a5dc */

void __cdecl FUN_0044a5dc(int *param_1,byte param_2)

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



/* @0044a624 file=? name=FUN_0044a624 */

undefined4 FUN_0044a624(void)

{
  return 1;
}



/* @0044a630 file=? name=FUN_0044a630 */

void __cdecl FUN_0044a630(int param_1)

{
  if (*(int *)(param_1 + 0xc) != 0) {
    FUN_0044a630(*(int *)(param_1 + 0xc));
  }
  *(undefined4 *)(param_1 + 4) = 0;
  return;
}



/* @0044a650 file=? name=FUN_0044a650 */

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

{
  int *piVar1;
  bool bVar2;
  int iVar3;
  undefined4 uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  uint uVar10;
  uint uVar11;
  uint uVar12;
  uint uVar13;
  uint uVar14;
  
  piVar1 = *(int **)(param_2 + 0x40);
  if (piVar1 == (int *)0x0) {
    FUN_0044a630((int)param_1);
  }
  else {
    bVar2 = true;
    FUN_0044aab0(param_1,0);
    FUN_0044a630((int)param_1);
    do {
      iVar3 = FUN_0044ab0c(param_1);
      switch(iVar3) {
      case 0:
        bVar2 = false;
        break;
      case 1:
        uVar6 = FUN_0044abc4(param_1);
        iVar3 = FUN_0044ab0c(param_1);
        uVar7 = FUN_0044abc4(param_1);
        uVar8 = FUN_0044abc4(param_1);
        if (param_3 != 0xffffffff) {
          uVar6 = param_3;
        }
        (**(code **)(*piVar1 + 0x10))(piVar1,uVar6,iVar3,uVar7,uVar8);
        break;
      case 2:
        uVar6 = FUN_0044abc4(param_1);
        iVar3 = FUN_0044ab0c(param_1);
        uVar7 = FUN_0044abc4(param_1);
        uVar8 = FUN_0044abc4(param_1);
        uVar9 = FUN_0044abc4(param_1);
        uVar10 = FUN_0044abc4(param_1);
        uVar4 = FUN_0044ab80(param_1);
        if (param_3 != 0xffffffff) {
          uVar6 = param_3;
        }
        (**(code **)(*piVar1 + 0x14))(piVar1,uVar6,iVar3,uVar7,uVar8,uVar9,uVar10,uVar4);
        break;
      case 3:
        uVar6 = FUN_0044abc4(param_1);
        iVar3 = FUN_0044ab0c(param_1);
        uVar7 = FUN_0044abc4(param_1);
        uVar8 = FUN_0044abc4(param_1);
        uVar9 = FUN_0044abc4(param_1);
        uVar10 = FUN_0044abc4(param_1);
        if (param_3 != 0xffffffff) {
          uVar6 = param_3;
        }
        (**(code **)(*piVar1 + 0x18))(piVar1,uVar6,iVar3,uVar7,uVar8,uVar9,uVar10);
        break;
      case 4:
        uVar6 = FUN_0044abc4(param_1);
        iVar3 = FUN_0044ab0c(param_1);
        uVar7 = FUN_0044abc4(param_1);
        uVar8 = FUN_0044abc4(param_1);
        uVar9 = FUN_0044abc4(param_1);
        uVar10 = FUN_0044ac48(param_1);
        uVar11 = FUN_0044abc4(param_1);
        uVar12 = FUN_0044abc4(param_1);
        uVar13 = FUN_0044abc4(param_1);
        uVar14 = FUN_0044abc4(param_1);
        if (param_3 != 0xffffffff) {
          uVar6 = param_3;
        }
        (**(code **)(*piVar1 + 0x20))
                  (piVar1,uVar6,iVar3,uVar7,uVar8,uVar9,uVar10,uVar11,uVar12,uVar13,uVar14);
        break;
      case 5:
        uVar6 = FUN_0044abc4(param_1);
        uVar7 = FUN_0044abc4(param_1);
        iVar3 = FUN_0044ab0c(param_1);
        uVar8 = FUN_0044abc4(param_1);
        uVar9 = FUN_0044abc4(param_1);
        uVar10 = FUN_0044abc4(param_1);
        uVar11 = FUN_0044ac48(param_1);
        uVar12 = FUN_0044abc4(param_1);
        uVar13 = FUN_0044abc4(param_1);
        uVar14 = FUN_0044abc4(param_1);
        uVar5 = FUN_0044abc4(param_1);
        if (param_3 != 0xffffffff) {
          uVar6 = param_3;
        }
        (**(code **)(*piVar1 + 0x24))
                  (piVar1,uVar6,uVar7,iVar3,uVar8,uVar9,uVar10,uVar11,uVar12,uVar13,uVar14,uVar5);
        break;
      case 6:
        iVar3 = FUN_0044ab0c(param_1);
        uVar6 = FUN_0044abc4(param_1);
        uVar7 = FUN_0044abc4(param_1);
        uVar8 = FUN_0044abc4(param_1);
        uVar9 = FUN_0044abc4(param_1);
        uVar10 = FUN_0044ac48(param_1);
        uVar11 = FUN_0044abc4(param_1);
        uVar12 = FUN_0044abc4(param_1);
        uVar13 = FUN_0044abc4(param_1);
        uVar14 = FUN_0044abc4(param_1);
        if (param_3 == 0xffffffff) {
          (**(code **)(*piVar1 + 0x28))
                    (piVar1,iVar3,uVar6,uVar7,uVar8,uVar9,uVar10,uVar11,uVar12,uVar13,uVar14);
        }
        else {
          (**(code **)(*piVar1 + 0x2c))
                    (piVar1,param_3,iVar3,uVar7,uVar8,uVar9,uVar10,uVar11,uVar12,uVar13,uVar14);
        }
        break;
      case 7:
        uVar6 = FUN_0044abc4(param_1);
        iVar3 = FUN_0044ab0c(param_1);
        uVar7 = FUN_0044abc4(param_1);
        uVar8 = FUN_0044abc4(param_1);
        uVar9 = FUN_0044abc4(param_1);
        uVar10 = FUN_0044ac48(param_1);
        uVar11 = FUN_0044abc4(param_1);
        uVar12 = FUN_0044abc4(param_1);
        uVar13 = FUN_0044abc4(param_1);
        uVar14 = FUN_0044abc4(param_1);
        if (param_3 != 0xffffffff) {
          uVar6 = param_3;
        }
        (**(code **)(*piVar1 + 0x2c))
                  (piVar1,uVar6,iVar3,uVar7,uVar8,uVar9,uVar10,uVar11,uVar12,uVar13,uVar14);
      }
    } while (bVar2);
  }
  return;
}



/* @0044aab0 file=? name=FUN_0044aab0 */

void __cdecl FUN_0044aab0(int *param_1,undefined4 param_2)

{
  int iVar1;
  uint *puVar2;
  
  if (param_1[1] < *param_1) {
    iVar1 = param_1[1];
    param_1[1] = param_1[1] + 1;
    *(char *)(param_1[2] + iVar1) = (char)param_2;
  }
  else {
    if (param_1[3] == 0) {
      puVar2 = (uint *)FUN_00402298(0x10);
      if (puVar2 == (uint *)0x0) {
        puVar2 = (uint *)0x0;
      }
      else {
        puVar2 = FUN_0044a5b4(puVar2);
      }
      param_1[3] = (int)puVar2;
    }
    FUN_0044aab0((int *)param_1[3],param_2);
  }
  return;
}



/* @0044ab0c file=munga/graph2d.cpp name=FUN_0044ab0c */

int __cdecl FUN_0044ab0c(int *param_1)

{
  int iVar1;
  
  if (param_1[1] < *param_1) {
    iVar1 = param_1[1];
    param_1[1] = param_1[1] + 1;
    return (int)*(char *)(param_1[2] + iVar1);
  }
  if (param_1[3] == 0) {
    FUN_0040385c(s_GraphicsViewRecord__GetChar___ha_004ef46e,
                 s_d__tesla_bt_munga_GRAPH2D_CPP_004ef498,0x746);
    return 0;
  }
  iVar1 = FUN_0044ab0c((int *)param_1[3]);
  return iVar1;
}



/* @0044ab58 file=? name=FUN_0044ab58 */

void __cdecl FUN_0044ab58(int *param_1,int param_2)

{
  if (param_2 != 0) {
    FUN_0044aab0(param_1,1);
    return;
  }
  FUN_0044aab0(param_1,0);
  return;
}



/* @0044ab80 file=? name=FUN_0044ab80 */

undefined4 __cdecl FUN_0044ab80(int *param_1)

{
  int iVar1;
  
  iVar1 = FUN_0044ab0c(param_1);
  if (iVar1 != 0) {
    return 1;
  }
  return 0;
}



/* @0044ab9c file=? name=FUN_0044ab9c */

void __cdecl FUN_0044ab9c(int *param_1,int param_2)

{
  FUN_0044aab0(param_1,param_2 >> 8);
  FUN_0044aab0(param_1,param_2);
  return;
}



/* @0044abc4 file=? name=FUN_0044abc4 */

uint __cdecl FUN_0044abc4(int *param_1)

{
  int iVar1;
  uint uVar2;
  
  iVar1 = FUN_0044ab0c(param_1);
  uVar2 = FUN_0044ab0c(param_1);
  uVar2 = iVar1 << 8 | uVar2 & 0xff;
  if ((iVar1 << 8 & 0x8000U) != 0) {
    uVar2 = uVar2 | 0xffff0000;
  }
  return uVar2;
}



/* @0044abf8 file=? name=FUN_0044abf8 */

void __cdecl FUN_0044abf8(int *param_1,int param_2)

{
  FUN_0044aab0(param_1,param_2 >> 0x18);
  FUN_0044aab0(param_1,param_2 >> 0x10);
  FUN_0044aab0(param_1,param_2 >> 8);
  FUN_0044aab0(param_1,param_2);
  return;
}



/* @0044ac48 file=? name=FUN_0044ac48 */

uint __cdecl FUN_0044ac48(int *param_1)

{
  int iVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  
  iVar1 = FUN_0044ab0c(param_1);
  uVar2 = FUN_0044ab0c(param_1);
  uVar3 = FUN_0044ab0c(param_1);
  uVar4 = FUN_0044ab0c(param_1);
  return iVar1 << 0x18 | (uVar2 & 0xff) << 0x10 | (uVar3 & 0xff) << 8 | uVar4 & 0xff;
}



/* @0044ac98 file=? name=FUN_0044ac98 */

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

{
  int *piVar1;
  int iVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  
  *param_1 = &PTR_FUN_004ef59c;
  piVar1 = param_1 + 1;
  FUN_00407b9c(piVar1);
  FUN_00407b9c(param_1 + 0xb);
  param_1[0x10] = param_2;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 1;
  param_1[0xf] = 0;
  if (param_2 == 0) {
    param_1[1] = 0;
    param_1[2] = 0;
    param_1[3] = 0;
    param_1[4] = 0;
    param_1[5] = param_1[1];
    param_1[6] = param_1[2];
  }
  else {
    param_1[1] = param_3;
    param_1[2] = param_4;
    param_1[3] = param_5;
    param_1[4] = param_6;
    FUN_00407de3(piVar1,piVar1,(int *)(param_1[0x10] + 4));
    FUN_00407de3(param_1 + 3,param_1 + 3,(int *)(param_1[0x10] + 4));
    param_1[5] = param_1[1];
    param_1[6] = param_1[2];
    FUN_00407cd0(piVar1,piVar1,(int *)(param_1[0x10] + 4));
  }
  puVar4 = param_1 + 0xb;
  puVar3 = param_1;
  for (iVar2 = 4; puVar3 = puVar3 + 1, iVar2 != 0; iVar2 = iVar2 + -1) {
    *puVar4 = *puVar3;
    puVar4 = puVar4 + 1;
  }
  param_1[0x11] = 0;
  return param_1;
}



/* @0044ad78 file=? name=FUN_0044ad78 */

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

{
  int iVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  *param_1 = &PTR_FUN_004ef59c;
  FUN_00407b9c(param_1 + 1);
  FUN_00407b9c(param_1 + 0xb);
  param_1[0x10] = param_2;
  param_1[7] = 0;
  param_1[8] = 0;
  param_1[9] = 0;
  param_1[10] = 1;
  param_1[0xf] = 0;
  if (param_2 == (undefined4 *)0x0) {
    param_1[1] = 0;
    param_1[2] = 0;
    param_1[3] = 0;
    param_1[4] = 0;
  }
  else {
    iVar1 = 4;
    puVar2 = param_1;
    while( true ) {
      puVar2 = puVar2 + 1;
      param_2 = param_2 + 1;
      if (iVar1 == 0) break;
      iVar1 = iVar1 + -1;
      *puVar2 = *param_2;
    }
  }
  param_1[5] = param_1[1];
  param_1[6] = param_1[2];
  puVar3 = param_1 + 0xb;
  puVar2 = param_1;
  for (iVar1 = 4; puVar2 = puVar2 + 1, iVar1 != 0; iVar1 = iVar1 + -1) {
    *puVar3 = *puVar2;
    puVar3 = puVar3 + 1;
  }
  param_1[0x11] = 0;
  return param_1;
}



/* @0044ae0c file=? name=FUN_0044ae0c */

void __cdecl FUN_0044ae0c(int *param_1,byte param_2)

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



/* @0044ae2c file=? name=FUN_0044ae2c */

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

{
  int *piVar1;
  int iVar2;
  undefined4 *puVar3;
  
  if (param_1[0x10] != 0) {
    piVar1 = param_1 + 1;
    param_1[1] = param_2;
    param_1[2] = param_3;
    param_1[3] = param_4 + -1;
    param_1[4] = param_5 + -1;
    FUN_00407de3(piVar1,piVar1,(int *)(param_1[0x10] + 4));
    FUN_00407de3(param_1 + 3,param_1 + 3,(int *)(param_1[0x10] + 4));
    param_1[5] = param_1[1];
    param_1[6] = param_1[2];
    FUN_00407cd0(piVar1,piVar1,(int *)(param_1[0x10] + 4));
    puVar3 = param_1 + 0xb;
    for (iVar2 = 4; param_1 = param_1 + 1, iVar2 != 0; iVar2 = iVar2 + -1) {
      *puVar3 = *param_1;
      puVar3 = puVar3 + 1;
    }
  }
  return;
}



/* @0044aeb0 file=? name=FUN_0044aeb0 */

undefined4 FUN_0044aeb0(void)

{
  return 1;
}



/* @0044aebc file=? name=FUN_0044aebc */

void __cdecl FUN_0044aebc(int param_1,char *param_2)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  uint uVar4;
  uint uVar5;
  char *pcVar6;
  char *pcVar7;
  undefined8 uVar8;
  uint *puVar9;
  char local_54 [80];
  
  FUN_004dbb24(&DAT_00524e20,param_2,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_GraphicsView__004ef4b6,(char *)0x0);
  uVar4 = 0xffffffff;
  do {
    pcVar6 = param_2;
    if (uVar4 == 0) break;
    uVar4 = uVar4 - 1;
    pcVar6 = param_2 + 1;
    cVar1 = *param_2;
    param_2 = pcVar6;
  } while (cVar1 != '\0');
  uVar4 = ~uVar4;
  pcVar6 = pcVar6 + -uVar4;
  pcVar7 = local_54;
  for (uVar5 = uVar4 >> 2; uVar5 != 0; uVar5 = uVar5 - 1) {
    *(undefined4 *)pcVar7 = *(undefined4 *)pcVar6;
    pcVar6 = pcVar6 + 4;
    pcVar7 = pcVar7 + 4;
  }
  for (uVar4 = uVar4 & 3; uVar4 != 0; uVar4 = uVar4 - 1) {
    *pcVar7 = *pcVar6;
    pcVar6 = pcVar6 + 1;
    pcVar7 = pcVar7 + 1;
  }
  FUN_004d49b8(local_54,&DAT_004ef4c5);
  puVar9 = (uint *)(param_1 + 4);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_areaWithinPort___004ef4c9,(char *)0x0);
  piVar3 = (int *)FUN_00407d78(&DAT_00524e20,puVar9);
  FUN_004dbb24(piVar3,&DAT_004ef4dd,(char *)0x0);
  puVar9 = (uint *)(param_1 + 0x14);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_origin___004ef4df,(char *)0x0);
  piVar3 = (int *)FUN_00407f08(&DAT_00524e20,puVar9);
  FUN_004dbb24(piVar3,&DAT_004ef4f3,(char *)0x0);
  puVar9 = (uint *)(param_1 + 0x1c);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_currentPosition___004ef4f5,(char *)0x0);
  piVar3 = (int *)FUN_00407f08(&DAT_00524e20,puVar9);
  FUN_004dbb24(piVar3,&DAT_004ef509,(char *)0x0);
  uVar4 = *(uint *)(param_1 + 0x24);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_currentFontID___004ef50b,(char *)0x0);
  piVar3 = FUN_004db78c(&DAT_00524e20,uVar4);
  FUN_004dbb24(piVar3,&DAT_004ef51f,(char *)0x0);
  uVar4 = *(uint *)(param_1 + 0x28);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_currentColor___004ef521,(char *)0x0);
  piVar3 = FUN_004db78c(&DAT_00524e20,uVar4);
  FUN_004dbb24(piVar3,&DAT_004ef535,(char *)0x0);
  puVar9 = (uint *)(param_1 + 0x2c);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_clippingRectangle___004ef537,(char *)0x0);
  piVar3 = (int *)FUN_00407d78(&DAT_00524e20,puVar9);
  FUN_004dbb24(piVar3,&DAT_004ef54b,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_currentOperation___004ef54d,(char *)0x0);
  iVar2 = *(int *)(param_1 + 0x3c);
  if (iVar2 == 0) {
    FUN_004dbb24(&DAT_00524e20,s_REPLACE_004ef56a,(char *)0x0);
  }
  else if (iVar2 == 1) {
    FUN_004dbb24(&DAT_00524e20,&DAT_004ef561,(char *)0x0);
  }
  else if (iVar2 == 2) {
    FUN_004dbb24(&DAT_00524e20,&DAT_004ef566,(char *)0x0);
  }
  else {
    uVar4 = *(uint *)(param_1 + 0x3c);
    FUN_004dbb24(&DAT_00524e20,s_Unsupported_type__004ef573,(char *)0x0);
    piVar3 = FUN_004db78c(&DAT_00524e20,uVar4);
    FUN_004dbb24(piVar3,&DAT_004ef585,(char *)0x0);
  }
  uVar4 = *(uint *)(param_1 + 0x40);
  FUN_004dbb24(&DAT_00524e20,local_54,(char *)0x0);
  FUN_004dbb24(&DAT_00524e20,s_graphicsPort___004ef587,(char *)0x0);
  uVar8 = FUN_004dbd4c(&DAT_00524e20,uVar4);
  FUN_004dbb24((int *)uVar8,&DAT_004ef598,(char *)0x0);
  return;
}



/* @0044b1e8 file=? name=FUN_0044b1e8 */

void __cdecl FUN_0044b1e8(int param_1,undefined4 param_2)

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



/* @0044b1f8 file=? name=FUN_0044b1f8 */

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

{
  int *piVar1;
  
  piVar1 = (int *)(param_1 + 0x1c);
  FUN_00407e04(piVar1,piVar1,(int *)(param_1 + 0x14));
  *(int *)(param_1 + 0x14) = param_2 + *(int *)(param_1 + 4);
  *(int *)(param_1 + 0x18) = param_3 + *(int *)(param_1 + 8);
  FUN_00407de3(piVar1,piVar1,(int *)(param_1 + 0x14));
  return;
}



/* @0044b240 file=? name=FUN_0044b240 */

void __cdecl FUN_0044b240(int param_1,undefined4 param_2)

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



/* @0044b250 file=? name=FUN_0044b250 */

void __cdecl FUN_0044b250(int param_1,undefined4 param_2)

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



/* @0044b260 file=? name=FUN_0044b260 */

void __cdecl FUN_0044b260(int param_1,int *param_2)

{
  int iVar1;
  int *piVar2;
  int local_14 [4];
  
  FUN_00407b9c(local_14);
  piVar2 = local_14;
  for (iVar1 = 4; iVar1 != 0; iVar1 = iVar1 + -1) {
    *piVar2 = *param_2;
    param_2 = param_2 + 1;
    piVar2 = piVar2 + 1;
  }
  FUN_00407de3(local_14,local_14,(int *)(param_1 + 0x14));
  FUN_00407de3(local_14 + 2,local_14 + 2,(int *)(param_1 + 0x14));
  if (*(int *)(param_1 + 0x40) == 0) {
    *(undefined4 *)(param_1 + 0x2c) = 1;
    *(undefined4 *)(param_1 + 0x34) = 0;
  }
  else {
    FUN_00407cd0((int *)(param_1 + 0x2c),(int *)(*(int *)(param_1 + 0x40) + 4),local_14);
  }
  return;
}



/* @0044b2e0 file=? name=FUN_0044b2e0 */

void __cdecl FUN_0044b2e0(undefined4 *param_1)

{
  int iVar1;
  undefined4 *puVar2;
  
  puVar2 = param_1 + 0xb;
  for (iVar1 = 4; param_1 = param_1 + 1, iVar1 != 0; iVar1 = iVar1 + -1) {
    *puVar2 = *param_1;
    puVar2 = puVar2 + 1;
  }
  return;
}



/* @0044b2fc file=? name=FUN_0044b2fc */

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

{
  *(int *)(param_1 + 0x1c) = *(int *)(param_1 + 0x14) + param_2;
  *(int *)(param_1 + 0x20) = *(int *)(param_1 + 0x18) + param_3;
  return;
}



/* @0044b318 file=? name=FUN_0044b318 */

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

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



/* @0044b32c file=? name=FUN_0044b32c */

void __cdecl FUN_0044b32c(int *param_1)

{
  int *piVar1;
  int iVar2;
  
  iVar2 = (**(code **)(*param_1 + 0x6c))(param_1,param_1[7],param_1[8]);
  piVar1 = (int *)param_1[0x10];
  if ((piVar1 != (int *)0x0) && (iVar2 == 0)) {
    (**(code **)(*piVar1 + 0x10))(piVar1,param_1[10],param_1[0xf],param_1[7],param_1[8]);
    if ((int *)param_1[0x11] != (int *)0x0) {
      FUN_0044aab0((int *)param_1[0x11],1);
      FUN_0044ab9c((int *)param_1[0x11],param_1[10]);
      FUN_0044aab0((int *)param_1[0x11],param_1[0xf]);
      FUN_0044ab9c((int *)param_1[0x11],param_1[7]);
      FUN_0044ab9c((int *)param_1[0x11],param_1[8]);
    }
  }
  return;
}



/* @0044b3c8 file=? name=FUN_0044b3c8 */

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

{
  int iVar1;
  int iVar2;
  
  iVar1 = param_1[5];
  iVar2 = param_1[6];
  FUN_0044bdfc(param_1,param_1[7],param_1[8],iVar1 + param_2,iVar2 + param_3,1);
  param_1[7] = iVar1 + param_2;
  param_1[8] = iVar2 + param_3;
  return;
}



/* @0044b428 file=? name=FUN_0044b428 */

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

{
  int iVar1;
  int iVar2;
  
  iVar1 = param_1[7];
  iVar2 = param_1[8];
  FUN_0044bdfc(param_1,param_1[7],param_1[8],iVar1 + param_2,iVar2 + param_3,1);
  param_1[7] = iVar1 + param_2;
  param_1[8] = iVar2 + param_3;
  return;
}



/* @0044b488 file=? name=FUN_0044b488 */

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

{
  int iVar1;
  int iVar2;
  
  iVar1 = param_1[5];
  iVar2 = param_1[6];
  FUN_0044bcf0(param_1,param_1[7],param_1[8],iVar1 + param_2,iVar2 + param_3);
  param_1[7] = iVar1 + param_2;
  param_1[8] = iVar2 + param_3;
  return;
}



/* @0044b4f8 file=? name=FUN_0044b4f8 */

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

{
  int iVar1;
  int iVar2;
  
  iVar2 = param_1[7] + param_2;
  iVar1 = param_1[8] + param_3;
  FUN_0044bcf0(param_1,param_1[7],param_1[8],iVar2,iVar1);
  param_1[7] = iVar2;
  param_1[8] = iVar1;
  return;
}



/* @0044b568 file=? name=FUN_0044b568 */

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

{
  int local_c;
  int local_8;
  
  local_c = param_1[7];
  local_8 = param_1[8];
  FUN_00407e04(&local_c,&local_c,param_1 + 5);
  (**(code **)(*param_1 + 0x30))(param_1,local_c,param_3);
  (**(code **)(*param_1 + 0x30))(param_1,param_2,param_3);
  (**(code **)(*param_1 + 0x30))(param_1,param_2,local_8);
  (**(code **)(*param_1 + 0x30))(param_1,local_c,local_8);
  param_1[7] = param_2;
  param_1[8] = param_3;
  return;
}



/* @0044b5e0 file=? name=FUN_0044b5e0 */

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

{
  int local_c;
  int local_8;
  
  local_c = param_1[7];
  local_8 = param_1[8];
  FUN_00407e04(&local_c,&local_c,param_1 + 5);
  (**(code **)(*param_1 + 0x34))(param_1,0,param_3);
  (**(code **)(*param_1 + 0x34))(param_1,param_2,0);
  (**(code **)(*param_1 + 0x34))(param_1,0,-param_3);
  (**(code **)(*param_1 + 0x34))(param_1,-param_2,0);
  param_1[7] = param_2 + local_c;
  param_1[8] = param_3 + local_8;
  return;
}



/* @0044b664 file=? name=FUN_0044b664 */

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

{
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00407b9c(&local_14);
  local_14 = *(int *)(param_1 + 0x1c);
  local_10 = *(int *)(param_1 + 0x20);
  local_c = *(int *)(param_1 + 0x14) + param_2;
  local_8 = *(int *)(param_1 + 0x18) + param_3;
  FUN_0044c074(param_1,local_14,local_10,local_c,local_8);
  *(int *)(param_1 + 0x1c) = local_c;
  *(int *)(param_1 + 0x20) = local_8;
  return;
}



/* @0044b6d0 file=? name=FUN_0044b6d0 */

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

{
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00407b9c(&local_14);
  local_14 = *(int *)(param_1 + 0x1c);
  local_10 = *(int *)(param_1 + 0x20);
  local_c = *(int *)(param_1 + 0x1c) + param_2;
  local_8 = *(int *)(param_1 + 0x20) + param_3;
  FUN_0044c074(param_1,local_14,local_10,local_c,local_8);
  *(int *)(param_1 + 0x1c) = local_c;
  *(int *)(param_1 + 0x20) = local_8;
  return;
}



/* @0044b73c file=? name=FUN_0044b73c */

void FUN_0044b73c(void)

{
  return;
}



/* @0044b744 file=? name=FUN_0044b744 */

void __cdecl
FUN_0044b744(int param_1,int param_2,int param_3,undefined4 param_4,undefined4 param_5,
            undefined4 param_6,undefined4 param_7)

{
  int iVar1;
  int local_1c;
  int local_18;
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00407bd0(&local_1c,param_4,param_5,param_6,param_7);
  if (param_3 != 0) {
    iVar1 = FUN_0044c174(param_1,&local_1c,&local_c,*(int *)(param_3 + 0xc),*(int *)(param_3 + 0x10)
                        );
    if (iVar1 != 0) {
      (**(code **)(**(int **)(param_1 + 0x40) + 0x20))
                (*(int **)(param_1 + 0x40),*(undefined4 *)(param_1 + 0x28),
                 *(undefined4 *)(param_1 + 0x3c),param_2,local_c,local_8,param_3,local_1c,local_18,
                 local_14,local_10);
      if (*(int **)(param_1 + 0x44) != (int *)0x0) {
        FUN_0044aab0(*(int **)(param_1 + 0x44),4);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),*(int *)(param_1 + 0x28));
        FUN_0044aab0(*(int **)(param_1 + 0x44),*(undefined4 *)(param_1 + 0x3c));
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_2);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_8);
        FUN_0044abf8(*(int **)(param_1 + 0x44),param_3);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_1c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_18);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_14);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_10);
      }
    }
  }
  return;
}



/* @0044b88c file=? name=FUN_0044b88c */

void __cdecl
FUN_0044b88c(int param_1,int param_2,int param_3,int param_4,undefined4 param_5,undefined4 param_6,
            undefined4 param_7,undefined4 param_8)

{
  int iVar1;
  int local_1c;
  int local_18;
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00407bd0(&local_1c,param_5,param_6,param_7,param_8);
  if (param_4 != 0) {
    iVar1 = FUN_0044c174(param_1,&local_1c,&local_c,*(int *)(param_4 + 0xc),*(int *)(param_4 + 0x10)
                        );
    if (iVar1 != 0) {
      (**(code **)(**(int **)(param_1 + 0x40) + 0x24))
                (*(int **)(param_1 + 0x40),*(undefined4 *)(param_1 + 0x28),param_2,
                 *(undefined4 *)(param_1 + 0x3c),param_3,local_c,local_8,param_4,local_1c,local_18,
                 local_14,local_10);
      if (*(int **)(param_1 + 0x44) != (int *)0x0) {
        FUN_0044aab0(*(int **)(param_1 + 0x44),5);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),*(int *)(param_1 + 0x28));
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_2);
        FUN_0044aab0(*(int **)(param_1 + 0x44),*(undefined4 *)(param_1 + 0x3c));
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_3);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_8);
        FUN_0044abf8(*(int **)(param_1 + 0x44),param_4);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_1c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_18);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_14);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_10);
      }
    }
  }
  return;
}



/* @0044b9e8 file=? name=FUN_0044b9e8 */

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

{
  int iVar1;
  int local_1c;
  int local_18;
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00407bd0(&local_1c,param_5,param_6,param_7,param_8);
  if (param_4 != (int *)0x0) {
    iVar1 = FUN_0044c174(param_1,&local_1c,&local_c,*param_4,param_4[1]);
    if (iVar1 != 0) {
      (**(code **)(**(int **)(param_1 + 0x40) + 0x28))
                (*(int **)(param_1 + 0x40),*(undefined4 *)(param_1 + 0x3c),param_2,param_3,local_c,
                 local_8,param_4,local_1c,local_18,local_14,local_10);
      if (*(int **)(param_1 + 0x44) != (int *)0x0) {
        FUN_0044aab0(*(int **)(param_1 + 0x44),6);
        FUN_0044aab0(*(int **)(param_1 + 0x44),*(undefined4 *)(param_1 + 0x3c));
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_2);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_3);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_8);
        FUN_0044abf8(*(int **)(param_1 + 0x44),(int)param_4);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_1c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_18);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_14);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_10);
      }
    }
  }
  return;
}



/* @0044bb30 file=? name=FUN_0044bb30 */

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

{
  int iVar1;
  int local_1c;
  int local_18;
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00407bd0(&local_1c,param_4,param_5,param_6,param_7);
  if (param_3 != (int *)0x0) {
    iVar1 = FUN_0044c174(param_1,&local_1c,&local_c,*param_3,param_3[1]);
    if (iVar1 != 0) {
      (**(code **)(**(int **)(param_1 + 0x40) + 0x2c))
                (*(int **)(param_1 + 0x40),*(undefined4 *)(param_1 + 0x28),
                 *(undefined4 *)(param_1 + 0x3c),param_2,local_c,local_8,param_3,local_1c,local_18,
                 local_14,local_10);
      if (*(int **)(param_1 + 0x44) != (int *)0x0) {
        FUN_0044aab0(*(int **)(param_1 + 0x44),7);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),*(int *)(param_1 + 0x28));
        FUN_0044aab0(*(int **)(param_1 + 0x44),*(undefined4 *)(param_1 + 0x3c));
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_2);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_8);
        FUN_0044abf8(*(int **)(param_1 + 0x44),(int)param_3);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_1c);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_18);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_14);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),local_10);
      }
    }
  }
  return;
}



/* @0044bc78 file=? name=FUN_0044bc78 */

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

{
  int *piVar1;
  
  piVar1 = *(int **)(param_1 + 0x40);
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 0xc))(piVar1,param_2,param_3);
  }
  return;
}



/* @0044bc98 file=? name=FUN_0044bc98 */

void __cdecl FUN_0044bc98(int param_1,undefined4 param_2)

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



/* @0044bca8 file=? name=FUN_0044bca8 */

void __cdecl FUN_0044bca8(int param_1)

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



/* @0044bcb8 file=? name=FUN_0044bcb8 */

uint __cdecl FUN_0044bcb8(int param_1,int param_2,int param_3)

{
  uint uVar1;
  
  uVar1 = 0;
  if (param_2 < *(int *)(param_1 + 0x2c)) {
    uVar1 = 1;
  }
  else if (*(int *)(param_1 + 0x34) < param_2) {
    uVar1 = 2;
  }
  if (param_3 < *(int *)(param_1 + 0x30)) {
    uVar1 = uVar1 | 4;
  }
  else if (*(int *)(param_1 + 0x38) < param_3) {
    uVar1 = uVar1 | 8;
  }
  return uVar1;
}



/* @0044bcf0 file=? name=FUN_0044bcf0 */

void __cdecl FUN_0044bcf0(int *param_1,int param_2,int param_3,int param_4,int param_5)

{
  FUN_0044bdfc(param_1,param_2,param_3,param_4,param_5,1);
  FUN_0044bdfc(param_1,param_2 + -1,param_3,param_4 + -1,param_5,1);
  FUN_0044bdfc(param_1,param_2,param_3 + 1,param_4,param_5 + 1,1);
  FUN_0044bdfc(param_1,param_2 + 1,param_3,param_4 + 1,param_5,1);
  FUN_0044bdfc(param_1,param_2,param_3 + -1,param_4,param_5 + -1,1);
  return;
}



/* @0044bdfc file=? name=FUN_0044bdfc */

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

{
  bool bVar1;
  bool bVar2;
  bool bVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  uint uVar7;
  uint local_8;
  
  bVar3 = false;
  bVar1 = false;
  bVar2 = false;
  if (param_1[0x10] != 0) {
    uVar4 = (**(code **)(*param_1 + 0x6c))(param_1,param_2,param_3);
    local_8 = (**(code **)(*param_1 + 0x6c))(param_1,param_4,param_5);
    while (iVar6 = param_3, iVar5 = param_2, local_8 != 0 || uVar4 != 0) {
      if ((local_8 & uVar4) != 0) {
        return;
      }
      uVar7 = uVar4;
      if (uVar4 == 0) {
        param_2 = param_4;
        param_3 = param_5;
        param_4 = iVar5;
        param_5 = iVar6;
        bVar1 = (bool)(bVar1 ^ 1);
        uVar7 = local_8;
        local_8 = uVar4;
        bVar2 = bVar3;
      }
      if ((uVar7 & 1) == 0) {
        if ((uVar7 & 2) == 0) {
          if ((uVar7 & 8) == 0) {
            if ((uVar7 & 4) != 0) {
              bVar3 = true;
              param_2 = param_2 + ((param_4 - param_2) * (param_1[0xc] - param_3)) /
                                  (param_5 - param_3);
              param_3 = param_1[0xc];
            }
          }
          else {
            param_2 = param_2 + ((param_4 - param_2) * (param_1[0xe] - param_3)) /
                                (param_5 - param_3);
            bVar3 = true;
            param_3 = param_1[0xe];
          }
        }
        else {
          iVar5 = param_1[0xd] - param_2;
          iVar6 = param_4 - param_2;
          bVar3 = true;
          param_2 = param_1[0xd];
          param_3 = param_3 + ((param_5 - param_3) * iVar5) / iVar6;
        }
      }
      else {
        iVar5 = param_1[0xb] - param_2;
        iVar6 = param_4 - param_2;
        bVar3 = true;
        param_2 = param_1[0xb];
        param_3 = param_3 + ((param_5 - param_3) * iVar5) / iVar6;
      }
      uVar4 = (**(code **)(*param_1 + 0x6c))(param_1,param_2,param_3);
    }
    if (bVar1) {
      param_2 = param_4;
      param_3 = param_5;
      param_4 = iVar5;
      param_5 = iVar6;
      bVar2 = bVar3;
    }
    if (bVar2) {
      param_6 = 1;
    }
    (**(code **)(*(int *)param_1[0x10] + 0x14))
              ((int *)param_1[0x10],param_1[10],param_1[0xf],param_2,param_3,param_4,param_5,param_6
              );
    if ((int *)param_1[0x11] != (int *)0x0) {
      FUN_0044aab0((int *)param_1[0x11],2);
      FUN_0044ab9c((int *)param_1[0x11],param_1[10]);
      FUN_0044aab0((int *)param_1[0x11],param_1[0xf]);
      FUN_0044ab9c((int *)param_1[0x11],param_2);
      FUN_0044ab9c((int *)param_1[0x11],param_3);
      FUN_0044ab9c((int *)param_1[0x11],param_4);
      FUN_0044ab9c((int *)param_1[0x11],param_5);
      FUN_0044ab58((int *)param_1[0x11],param_6);
    }
  }
  return;
}



/* @0044c074 file=? name=FUN_0044c074 */

void __cdecl FUN_0044c074(int param_1,int param_2,int param_3,int param_4,int param_5)

{
  bool bVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = param_3;
  iVar2 = param_2;
  if (*(int *)(param_1 + 0x40) != 0) {
    if (param_4 < param_2) {
      param_2 = param_4;
      param_4 = iVar2;
    }
    if (param_5 < param_3) {
      param_3 = param_5;
      param_5 = iVar3;
    }
    FUN_00407cd0(&param_2,(int *)(param_1 + 0x2c),&param_2);
    bVar1 = true;
    if ((param_2 <= param_4) && (param_3 <= param_5)) {
      bVar1 = false;
    }
    if (!bVar1) {
      (**(code **)(**(int **)(param_1 + 0x40) + 0x18))
                (*(int **)(param_1 + 0x40),*(undefined4 *)(param_1 + 0x28),
                 *(undefined4 *)(param_1 + 0x3c),param_2,param_3,param_4,param_5);
      if (*(int **)(param_1 + 0x44) != (int *)0x0) {
        FUN_0044aab0(*(int **)(param_1 + 0x44),3);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),*(int *)(param_1 + 0x28));
        FUN_0044aab0(*(int **)(param_1 + 0x44),*(undefined4 *)(param_1 + 0x3c));
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_2);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_3);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_4);
        FUN_0044ab9c(*(int **)(param_1 + 0x44),param_5);
      }
    }
  }
  return;
}



/* @0044c174 file=? name=FUN_0044c174 */

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

{
  bool bVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  int local_34 [4];
  int local_24 [4];
  int local_14;
  int local_10;
  int local_c;
  int local_8;
  
  if (*(int *)(param_1 + 0x40) != 0) {
    FUN_00407b9c(local_24);
    if (*param_2 < 0) {
      *param_2 = 0;
    }
    if (param_4 <= param_2[2]) {
      param_2[2] = param_4 + -1;
    }
    if (param_2[1] < 0) {
      param_2[1] = 0;
    }
    if (param_5 <= param_2[3]) {
      param_2[3] = param_5 + -1;
    }
    local_c = *param_2;
    local_8 = param_2[1];
    local_14 = param_2[2];
    local_10 = param_2[3];
    FUN_00407e04(&local_14,&local_14,param_2);
    local_24[0] = *(int *)(param_1 + 0x1c);
    local_24[1] = *(int *)(param_1 + 0x20);
    local_24[2] = *(int *)(param_1 + 0x1c);
    local_24[3] = *(int *)(param_1 + 0x20);
    FUN_00407de3(local_24 + 2,local_24 + 2,&local_14);
    FUN_00407b9c(local_34);
    piVar3 = local_24;
    piVar4 = local_34;
    for (iVar2 = 4; iVar2 != 0; iVar2 = iVar2 + -1) {
      *piVar4 = *piVar3;
      piVar3 = piVar3 + 1;
      piVar4 = piVar4 + 1;
    }
    FUN_00407cd0(local_24,local_34,(int *)(param_1 + 0x2c));
    bVar1 = true;
    if ((local_24[0] <= local_24[2]) && (local_24[1] <= local_24[3])) {
      bVar1 = false;
    }
    if (!bVar1) {
      *param_3 = local_24[0];
      param_3[1] = local_24[1];
      local_14 = local_24[2];
      local_10 = local_24[3];
      FUN_00407e04(&local_14,&local_14,local_24);
      *param_2 = local_c;
      param_2[1] = local_8;
      param_2[2] = local_c;
      param_2[3] = local_8;
      FUN_00407de3(param_2 + 2,param_2 + 2,&local_14);
      return 1;
    }
  }
  return 0;
}



/* @0044c2d0 file=? name=FUN_0044c2d0 */

void __cdecl FUN_0044c2d0(undefined4 *param_1,undefined4 param_2)

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



/* @0044c2e4 file=? name=FUN_0044c2e4 */

void __cdecl FUN_0044c2e4(int *param_1,byte param_2)

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



/* @0044c304 file=? name=FUN_0044c304 */

undefined4 FUN_0044c304(void)

{
  return 1;
}



/* @0044c310 file=? name=FUN_0044c310 */

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

{
  int iVar1;
  
  iVar1 = FUN_004d4b58(param_2,s_ModeAlwaysActive_004ef678);
  if (iVar1 == 0) {
    *param_3 = 0xffffffff;
    return 1;
  }
  *param_3 = 0;
  return 0;
}



/* @0044c344 file=? name=FUN_0044c344 */

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

{
  FUN_004178cc(param_1,param_2);
  *param_1 = &PTR_FUN_004ef8d4;
  FUN_0044ca72(param_1 + 4,param_1);
  param_1[3] = param_3;
  (**(code **)(param_1[4] + 4))(param_1 + 4,param_4);
  return param_1;
}



/* @0044c388 file=? name=FUN_0044c388 */

void __cdecl FUN_0044c388(int *param_1,byte param_2)

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



/* @0044c3c4 file=munga/controls.cpp name=FUN_0044c3c4 */

void FUN_0044c3c4(void)

{
  FUN_0040385c(s_ControlsInstance__Update_not_ove_004ef6cc,s_d__tesla_bt_munga_CONTROLS_CPP_004ef6f5
               ,0x3d);
  return;
}



/* @0044c3e0 file=? name=FUN_0044c3e0 */

void __cdecl FUN_0044c3e0(undefined4 *param_1)

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



/* @0044c3f8 file=? name=FUN_0044c3f8 */

undefined4 * __cdecl FUN_0044c3f8(undefined4 *param_1)

{
  FUN_004178cc(param_1,0x18);
  *param_1 = &PTR_FUN_004ef8c0;
  FUN_0044cabd(param_1 + 3,param_1);
  return param_1;
}



/* @0044c424 file=? name=FUN_0044c424 */

void __cdecl FUN_0044c424(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ef8c0;
    (**(code **)(*param_1 + 0xc))(param_1,0);
    FUN_0044cadc(param_1 + 3,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044c46c file=? name=FUN_0044c46c */

void __cdecl FUN_0044c46c(int param_1,uint param_2)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_0044cb72(local_10,param_1 + 0xc);
  while( true ) {
    puVar1 = (undefined4 *)(**(code **)(local_10[0] + 0x28))(local_10);
    if (puVar1 == (undefined4 *)0x0) break;
    puVar1[3] = puVar1[3] & ~param_2;
    if ((puVar1[3] == 0) && (puVar1 != (undefined4 *)0x0)) {
      (**(code **)*puVar1)(puVar1,3);
    }
  }
  FUN_0044cbb0(local_10,2);
  return;
}



/* @0044c4d0 file=? name=FUN_0044c4d0 */

void __cdecl FUN_0044c4d0(int param_1,undefined4 param_2,uint param_3)

{
  int *piVar1;
  int local_10 [3];
  
  FUN_0044cb72(local_10,param_1 + 0xc);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_10[0] + 0x28))(local_10);
    if (piVar1 == (int *)0x0) break;
    if ((piVar1[3] & param_3) != 0) {
      (**(code **)(*piVar1 + 0xc))(piVar1,param_2);
    }
  }
  FUN_0044cbb0(local_10,2);
  return;
}



/* @0044c52c file=? name=FUN_0044c52c */

undefined4 __cdecl FUN_0044c52c(int param_1,uint param_2)

{
  int iVar1;
  undefined4 uVar2;
  int local_10 [3];
  
  FUN_0044cb72(local_10,param_1 + 0xc);
  do {
    iVar1 = (**(code **)(local_10[0] + 0x28))(local_10);
    if (iVar1 == 0) {
      uVar2 = 0;
      FUN_0044cbb0(local_10,2);
      return uVar2;
    }
  } while ((*(uint *)(iVar1 + 0xc) & param_2) == 0);
  uVar2 = 1;
  FUN_0044cbb0(local_10,2);
  return uVar2;
}



/* @0044c594 file=? name=FUN_0044c594 */

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

{
  FUN_004178cc(param_1,param_2);
  *param_1 = &PTR_FUN_004e3320;
  param_1[3] = param_3;
  *param_1 = &PTR_FUN_004ef894;
  param_1[4] = 0;
  param_1[5] = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  param_1[8] = DAT_004ef6c4;
  DAT_004ef6c4 = param_1;
  return param_1;
}



/* @0044c5e4 file=? name=FUN_0044c5e4 */

void __cdecl FUN_0044c5e4(int *param_1,byte param_2)

{
  int *piVar1;
  int *piVar2;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ef894;
    piVar1 = (int *)0x0;
    for (piVar2 = DAT_004ef6c4; piVar2 != (int *)0x0; piVar2 = (int *)piVar2[8]) {
      if (param_1 == piVar2) {
        if (piVar1 == (int *)0x0) {
          DAT_004ef6c4 = (int *)param_1[8];
        }
        else {
          piVar1[8] = param_1[8];
        }
        break;
      }
      piVar1 = piVar2;
    }
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044c640 file=munga/controls.cpp name=FUN_0044c640 */

void FUN_0044c640(void)

{
  FUN_0040385c(s_ControlsManager__Remove_should_n_004ef724,s_d__tesla_bt_munga_CONTROLS_CPP_004ef753
               ,0x120);
  return;
}



/* @0044c65c file=munga/controls.cpp name=FUN_0044c65c */

void FUN_0044c65c(void)

{
  FUN_0040385c(s_ControlsManager__Execute_should_n_004ef772,
               s_d__tesla_bt_munga_CONTROLS_CPP_004ef7a2,0x126);
  return;
}



/* @0044c678 file=? name=FUN_0044c678 */

void __cdecl
FUN_0044c678(int param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,undefined4 param_5
            ,uint param_6,uint param_7)

{
  int iVar1;
  
  *(undefined4 *)(param_1 + 0x14) = param_3;
  *(undefined4 *)(param_1 + 0x18) = param_5;
  *(undefined4 *)(param_1 + 0x10) = param_2;
  *(undefined4 *)(param_1 + 0x1c) = param_4;
  iVar1 = *(int *)(DAT_004efc94 + 0x50);
  *(undefined4 *)(iVar1 + 8) = *(undefined4 *)(iVar1 + 4);
  *(uint *)(iVar1 + 4) = *(uint *)(iVar1 + 4) & ~param_6;
  *(undefined4 *)(iVar1 + 8) = *(undefined4 *)(iVar1 + 4);
  *(uint *)(iVar1 + 4) = *(uint *)(iVar1 + 4) | param_7;
  return;
}



/* @0044c6fc file=? name=FUN_0044c6fc */

void FUN_0044c6fc(void)

{
  return;
}



/* @0044c704 file=? name=FUN_0044c704 */

void __cdecl FUN_0044c704(int param_1)

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



/* @0044c720 file=? name=FUN_0044c720 */

void FUN_0044c720(void)

{
  int *piVar1;
  
  for (piVar1 = DAT_004ef6c4; piVar1 != (int *)0x0; piVar1 = (int *)piVar1[8]) {
    (**(code **)(*piVar1 + 0x1c))(piVar1);
  }
  return;
}



/* @0044c73c file=? name=FUN_0044c73c */

void FUN_0044c73c(void)

{
  return;
}



/* @0044c744 file=? name=FUN_0044c744 */

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

{
  FUN_004178cc(param_1,0x52);
  *param_1 = &PTR_FUN_004ef888;
  param_1[3] = DAT_004ef6c8;
  DAT_004ef6c8 = DAT_004ef6c8 + 1;
  param_1[4] = param_2;
  param_1[0xb] = param_3;
  param_1[0xd] = param_4;
  param_1[0xe] = param_5;
  param_1[0xc] = param_6;
  *(undefined1 *)(param_1 + 5) = 0;
  param_1[10] = 0;
  return param_1;
}



/* @0044c798 file=? name=FUN_0044c798 */

void __cdecl FUN_0044c798(int *param_1,byte param_2)

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



/* @0044c7c4 file=? name=FUN_0044c7c4 */

undefined4 FUN_0044c7c4(void)

{
  return 1;
}



/* @0044c7d0 file=? name=FUN_0044c7d0 */

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

{
  int iVar1;
  int iVar2;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  if (param_2 == *(int *)(param_1 + 0x2c)) {
    iVar2 = FUN_004d4a78(*(char **)(param_1 + 0x10));
    if (0x10 < iVar2) {
      iVar2 = 0x10;
    }
    if (iVar2 < *(int *)(param_1 + 0x28)) {
      *(int *)(param_1 + 0x28) = iVar2;
      *(undefined1 *)(param_1 + 0x14 + iVar2) = 0;
    }
    if (*(int *)(param_1 + 0x28) < iVar2) {
      iVar1 = *(int *)(param_1 + 0x28);
      *(int *)(param_1 + 0x28) = *(int *)(param_1 + 0x28) + 1;
      *(undefined1 *)(param_1 + 0x14 + iVar1) = param_3;
      *(undefined1 *)(param_1 + 0x14 + *(int *)(param_1 + 0x28)) = 0;
    }
    else {
      if (1 < iVar2) {
        FUN_004d493c((undefined4 *)(param_1 + 0x14),(undefined4 *)(param_1 + 0x15),iVar2 - 1);
      }
      *(undefined1 *)(param_1 + 0x13 + iVar2) = param_3;
    }
    iVar2 = FUN_004d4bec((char *)(param_1 + 0x14),*(char **)(param_1 + 0x10),iVar2);
    if (iVar2 == 0) {
      local_8 = *(undefined4 *)(param_1 + 0x30);
      local_10 = *(undefined4 *)(param_1 + 0x38);
      local_14 = 0x10;
      local_c = 1;
      (**(code **)(**(int **)(param_1 + 0x34) + 0xc))(*(int **)(param_1 + 0x34),&local_14);
      *(undefined1 *)(param_1 + 0x14) = 0;
      *(undefined4 *)(param_1 + 0x28) = 0;
    }
  }
  return;
}



/* @0044c8a0 file=? name=FUN_0044c8a0 */

undefined4 * __cdecl FUN_0044c8a0(undefined4 *param_1)

{
  FUN_004178cc(param_1,0x53);
  *param_1 = &PTR_FUN_004ef87c;
  FUN_0044cb08(param_1 + 3,param_1);
  return param_1;
}



/* @0044c8cc file=? name=FUN_0044c8cc */

void __cdecl FUN_0044c8cc(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ef87c;
    FUN_0044c970((int)param_1,0);
    FUN_0044cb27(param_1 + 3,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0044c914 file=? name=FUN_0044c914 */

undefined4 FUN_0044c914(void)

{
  return 1;
}



/* @0044c920 file=? name=FUN_0044c920 */

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

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x3c);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0044c744(puVar1,param_2,param_3,param_4,param_5,param_6);
  }
  (**(code **)(*(int *)(param_1 + 0xc) + 4))(param_1 + 0xc,puVar1);
  return puVar1[3];
}



/* @0044c970 file=? name=FUN_0044c970 */

void __cdecl FUN_0044c970(int param_1,int param_2)

{
  undefined4 *puVar1;
  int local_10 [3];
  
  FUN_0044cbfb(local_10,param_1 + 0xc);
  do {
    do {
      puVar1 = (undefined4 *)(**(code **)(local_10[0] + 0x28))(local_10);
      if (puVar1 == (undefined4 *)0x0) goto LAB_0044c9be;
    } while ((param_2 != 0) && (param_2 != puVar1[3]));
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
  } while (param_2 == 0);
LAB_0044c9be:
  FUN_0044cc39(local_10,2);
  return;
}



