/* @00438774 file=? name=FUN_00438774 */

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

bool __cdecl FUN_00438774(undefined4 param_1,int param_2,float param_3,float *param_4)

{
  float fVar1;
  float10 fVar2;
  float10 fVar3;
  
  fVar1 = *(float *)(param_2 + 0x38);
  if (-fVar1 <= param_3) {
    if (fVar1 < param_3) {
      param_3 = fVar1;
    }
  }
  else {
    param_3 = -fVar1;
  }
  fVar3 = FUN_004dcd00((double)(fVar1 - param_3));
  fVar2 = (float10)_DAT_00438800;
  if (fVar2 < fVar3) {
    *param_4 = (_DAT_00438804 - fVar1 / (fVar1 - param_3)) * *(float *)(param_2 + 0x3c);
  }
  return fVar2 < fVar3;
}



/* @00438808 file=munga/audcmp.cpp name=FUN_00438808 */

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

{
  int *piVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  uint *puVar5;
  int local_14;
  undefined4 local_10;
  uint *local_c;
  int *local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004ea0a4;
  FUN_0043acac(param_1 + 9,0);
  param_1[0xe] = 0;
  puVar3 = (undefined4 *)FUN_00402298(0x10);
  if (puVar3 == (undefined4 *)0x0) {
    local_8 = (int *)0x0;
  }
  else {
    local_8 = (int *)FUN_004023f4(puVar3);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00402aec(param_2,(int *)&local_8);
  iVar4 = FUN_0041f98c(param_3,(char *)local_8[2]);
  if (iVar4 == 0) {
    puVar5 = (uint *)FUN_00402298(0x10);
    if (puVar5 == (uint *)0x0) {
      local_c = (uint *)0x0;
    }
    else {
      local_c = FUN_00402460(puVar5,s_Entity_004e8ca0);
    }
    local_c[3] = local_c[3] + 1;
    iVar4 = FUN_004027d8((int)local_8,(int)local_c);
    if (iVar4 != 0) {
      FUN_004dbb24(&DAT_00524e20,s_MessageWatcher__MessageWatcher___004e8ca7,(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,(char *)local_8[2],(char *)0x0);
      FUN_004dbb24(&DAT_00524e20,&DAT_004e8cd3,(char *)0x0);
      FUN_0040385c(s_MessageWatcher__MessageWatcher___004e8cd5,
                   s_d__tesla_bt_munga_AUDCMP_CPP_004e8d0b,0x5c);
    }
    puVar5 = local_c + 3;
    *puVar5 = *puVar5 - 1;
    iVar4 = param_3;
    if (*puVar5 == 0) {
      FUN_004024d8((int *)local_c,3);
    }
  }
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  FUN_0043afbc(param_2,&local_14);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xc,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  (**(code **)(param_1[9] + 4))(param_1 + 9,local_14);
  iVar2 = **(int **)(iVar4 + 0xc);
  puVar3 = FUN_00402f74(0x4e2d84);
  if (puVar3 == (undefined4 *)0x0) {
    puVar3 = (undefined4 *)0x0;
  }
  else {
    puVar3 = FUN_00419ed8(puVar3,iVar2,param_1,PTR_FUN_004e8c94,DAT_004e8c98,DAT_004e8c9c,local_10,
                          iVar4);
  }
  param_1[0xe] = puVar3;
  FUN_004206b4(param_3,param_1);
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  return param_1;
}



/* @004389fc file=? name=FUN_004389fc */

void __cdecl FUN_004389fc(int *param_1,byte param_2)

{
  undefined4 *puVar1;
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ea0a4;
    puVar1 = (undefined4 *)param_1[0xe];
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    FUN_0043accb(param_1 + 9,2);
    FUN_00436d4c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00438a48 file=munga/audcmp.cpp name=FUN_00438a48 */

void __cdecl FUN_00438a48(int *param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  char *pcVar3;
  uint *puVar4;
  float local_18;
  int local_14;
  uint *local_10;
  int local_c;
  int *local_8;
  
  FUN_00414c58(param_1);
  puVar2 = (undefined4 *)FUN_00402298(0x10);
  if (puVar2 == (undefined4 *)0x0) {
    local_8 = (int *)0x0;
  }
  else {
    local_8 = (int *)FUN_004023f4(puVar2);
  }
  local_8[3] = local_8[3] + 1;
  pcVar3 = (char *)FUN_00403ad0(param_2,s_subsystem_004e8d28);
  if (pcVar3 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8d32,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_subsystem_004e8d57,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8d61,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8d63,s_d__tesla_bt_munga_AUDCMP_CPP_004e8da3
                 ,0xa4);
  }
  FUN_00402b3c(pcVar3,(int *)&local_8);
  FUN_004029b0(param_1,(int)local_8);
  piVar1 = local_8 + 3;
  *piVar1 = *piVar1 + -1;
  if (*piVar1 == 0) {
    FUN_004024d8(local_8,3);
  }
  pcVar3 = (char *)FUN_00403ad0(param_2,s_message_ID_004e8dc0);
  if (pcVar3 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8dcb,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_message_ID_004e8df0,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8dfb,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8dfd,s_d__tesla_bt_munga_AUDCMP_CPP_004e8e3d
                 ,0xa9);
  }
  FUN_00407ae0(pcVar3,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  puVar4 = (uint *)FUN_00402298(0x10);
  if (puVar4 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar4,s_audio_component_004e8e5a);
  }
  local_10[3] = local_10[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_10);
  pcVar3 = (char *)FUN_00403ad0(param_2,s_control_ID_004e8e6a);
  if (pcVar3 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8e75,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004e8e9a,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8ea5,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8ea7,s_d__tesla_bt_munga_AUDCMP_CPP_004e8ee7
                 ,0xb1);
  }
  FUN_00407ae0(pcVar3,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar3 = (char *)FUN_00403ad0(param_2,s_control_value_004e8f04);
  if (pcVar3 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8f12,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_004e8f37,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8f45,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8f47,s_d__tesla_bt_munga_AUDCMP_CPP_004e8f87
                 ,0xb2);
  }
  FUN_00407b78(pcVar3,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  puVar4 = local_10 + 3;
  *puVar4 = *puVar4 - 1;
  if (*puVar4 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  return;
}



/* @00438d04 file=? name=FUN_00438d04 */

undefined4 __cdecl FUN_00438d04(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @00438d20 file=? name=FUN_00438d20 */

void __cdecl FUN_00438d20(int *param_1,undefined4 param_2)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = (**(code **)(*param_1 + 0x1c))(param_1,param_2);
  if (iVar1 != 0) {
    piVar2 = (int *)FUN_00417ab4((int)(param_1 + 9));
    (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0xc],param_1[0xd]);
  }
  return;
}



/* @00438d58 file=? name=FUN_00438d58 */

void FUN_00438d58(void)

{
  return;
}



/* @00438d60 file=? name=FUN_00438d60 */

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

{
  FUN_00438808(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ea084;
  return param_1;
}



/* @00438d84 file=? name=FUN_00438d84 */

void __cdecl FUN_00438d84(int *param_1,byte param_2)

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



/* @00438db0 file=? name=FUN_00438db0 */

bool __cdecl FUN_00438db0(undefined4 param_1,int param_2)

{
  return 0 < *(int *)(param_2 + 0xc);
}



/* @00438dc8 file=? name=FUN_00438dc8 */

void __cdecl FUN_00438dc8(int *param_1,byte param_2)

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



/* @00438df4 file=? name=FUN_00438df4 */

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

{
  undefined4 local_10;
  undefined4 local_c;
  int *local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004ea068;
  FUN_0043afbc(param_2,(int *)&local_8);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  FUN_004206b4(param_3,param_1);
  (**(code **)(*local_8 + 0x18))(local_8,local_c,local_10);
  return param_1;
}



/* @00438e70 file=munga/audcmp.cpp name=FUN_00438e70 */

void __cdecl FUN_00438e70(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  float local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004e8fa4);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_control_ID_004e8fb4);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8fbf,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004e8fe4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e8fef,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e8ff1,s_d__tesla_bt_munga_AUDCMP_CPP_004e9031
                 ,0x166);
  }
  FUN_00407ae0(pcVar2,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_control_value_004e904e);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e905c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_004e9081,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e908f,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9091,s_d__tesla_bt_munga_AUDCMP_CPP_004e90d1
                 ,0x167);
  }
  FUN_00407b78(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00438fec file=? name=FUN_00438fec */

void FUN_00438fec(void)

{
  return;
}



/* @00438ff4 file=? name=FUN_00438ff4 */

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

{
  int iVar1;
  int local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004ea04c;
  FUN_0043acf7(param_1 + 9,0);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_8,4);
  iVar1 = 0;
  if (0 < local_8) {
    do {
      FUN_0043afbc(param_2,&local_c);
      (**(code **)(param_1[9] + 4))(param_1 + 9,local_c);
      (**(code **)(*(int *)(local_c + 0x14) + 4))(local_c + 0x14,param_1);
      iVar1 = iVar1 + 1;
    } while (iVar1 < local_8);
  }
  FUN_004206b4(param_3,param_1);
  return param_1;
}



/* @00439094 file=? name=FUN_00439094 */

void __cdecl FUN_00439094(int *param_1,byte param_2)

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



/* @004390d0 file=munga/audcmp.cpp name=FUN_004390d0 */

void __cdecl FUN_004390d0(int *param_1,int param_2)

{
  int *piVar1;
  undefined4 *puVar2;
  bool bVar3;
  undefined3 extraout_var;
  undefined3 extraout_var_00;
  undefined4 *puVar4;
  int *local_14;
  int local_10;
  int *local_c;
  int local_8;
  
  FUN_00414c58(param_1);
  local_8 = 0;
  for (puVar2 = *(undefined4 **)(param_2 + 4); puVar2 != (undefined4 *)0x0;
      puVar2 = (undefined4 *)*puVar2) {
    bVar3 = FUN_00403c20((int)puVar2,s_audio_component_004e90ee);
    if (CONCAT31(extraout_var,bVar3) != 0) {
      local_8 = local_8 + 1;
    }
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  for (puVar2 = *(undefined4 **)(param_2 + 4); puVar2 != (undefined4 *)0x0;
      puVar2 = (undefined4 *)*puVar2) {
    bVar3 = FUN_00403c20((int)puVar2,s_audio_component_004e90fe);
    if (CONCAT31(extraout_var_00,bVar3) != 0) {
      puVar4 = (undefined4 *)FUN_00402298(0x10);
      if (puVar4 == (undefined4 *)0x0) {
        local_c = (int *)0x0;
      }
      else {
        local_c = (int *)FUN_004023f4(puVar4);
      }
      local_c[3] = local_c[3] + 1;
      FUN_00402a98((int *)&local_14,(int *)&local_c,(char *)puVar2[1]);
      piVar1 = local_14 + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_14,3);
      }
      local_10 = FUN_00417208((int)param_1,&local_c);
      if (local_10 == 0) {
        FUN_004dbb24(&DAT_00524e20,s_AudioControlSplitter__BuildFromP_004e910e,(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,(char *)local_c[2],(char *)0x0);
        FUN_004dbb24(&DAT_00524e20,&DAT_004e9144,(char *)0x0);
        FUN_0040385c(s_AudioControlSplitter__BuildFromP_004e9146,
                     s_d__tesla_bt_munga_AUDCMP_CPP_004e9186,0x1d2);
      }
      (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
      piVar1 = local_c + 3;
      *piVar1 = *piVar1 + -1;
      if (*piVar1 == 0) {
        FUN_004024d8(local_c,3);
      }
    }
  }
  return;
}



/* @00439234 file=? name=FUN_00439234 */

undefined4 __cdecl FUN_00439234(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @00439248 file=? name=FUN_00439248 */

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

{
  int *piVar1;
  int local_18 [5];
  
  FUN_0043afeb(local_18,param_1 + 0x24);
  while( true ) {
    piVar1 = (int *)(**(code **)(local_18[0] + 0x28))(local_18);
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x18))(piVar1,param_2,param_3);
  }
  FUN_0043b048(local_18,2);
  return;
}



/* @0043929c file=? name=FUN_0043929c */

void __cdecl FUN_0043929c(int *param_1,byte param_2)

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



/* @004392d8 file=? name=FUN_004392d8 */

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

{
  undefined4 local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004ea030;
  FUN_0043acac(param_1 + 9,0);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_14,4);
  FUN_00439574((int)param_1,local_8,param_3,local_c,local_10,local_14);
  return param_1;
}



/* @00439370 file=munga/audcmp.cpp name=FUN_00439370 */

void __cdecl FUN_00439370(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int local_14;
  int local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004e91a3);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_first_input_control_ID_004e91b3);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e91ca,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_first_input_control_ID_004e91ef,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9206,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9208,s_d__tesla_bt_munga_AUDCMP_CPP_004e9248
                 ,0x23d);
  }
  FUN_00407ae0(pcVar2,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_last_input_control_ID_004e9265);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e927b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_last_input_control_ID_004e92a0,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e92b6,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e92b8,s_d__tesla_bt_munga_AUDCMP_CPP_004e92f8
                 ,0x23e);
  }
  FUN_00407ae0(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_output_control_ID_004e9315);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9327,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_output_control_ID_004e934c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e935e,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9360,s_d__tesla_bt_munga_AUDCMP_CPP_004e93a0
                 ,0x23f);
  }
  FUN_00407ae0(pcVar2,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00439574 file=? name=FUN_00439574 */

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

{
  undefined4 *puVar1;
  int iVar2;
  
  *(int *)(param_1 + 0x40) = param_4;
  *(undefined4 *)(param_1 + 0x48) = param_6;
  *(int *)(param_1 + 0x44) = (param_5 - param_4) + 1;
  puVar1 = (undefined4 *)(param_1 + 0x30);
  for (iVar2 = 0; iVar2 < *(int *)(param_1 + 0x44); iVar2 = iVar2 + 1) {
    *puVar1 = 0;
    puVar1 = puVar1 + 1;
  }
  (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  FUN_004206b4(param_3,param_1);
  return;
}



/* @004395dc file=? name=FUN_004395dc */

undefined4 __cdecl FUN_004395dc(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @004395f0 file=? name=FUN_004395f0 */

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

{
  int iVar1;
  float *pfVar2;
  int *piVar3;
  float local_8;
  
  iVar1 = param_2 - *(int *)(param_1 + 0x40);
  if ((-1 < iVar1) && (iVar1 < *(int *)(param_1 + 0x44))) {
    *(undefined4 *)(param_1 + 0x30 + iVar1 * 4) = param_3;
    local_8 = 0.0;
    pfVar2 = (float *)(param_1 + 0x30);
    for (iVar1 = 0; iVar1 < *(int *)(param_1 + 0x44); iVar1 = iVar1 + 1) {
      local_8 = *pfVar2 + local_8;
      pfVar2 = pfVar2 + 1;
    }
    piVar3 = (int *)FUN_00417ab4(param_1 + 0x24);
    (**(code **)(*piVar3 + 0x18))(piVar3,*(undefined4 *)(param_1 + 0x48),local_8);
  }
  return;
}



/* @00439650 file=? name=FUN_00439650 */

void __cdecl FUN_00439650(int *param_1,byte param_2)

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



/* @0043968c file=? name=FUN_0043968c */

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

{
  undefined4 local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004ea014;
  FUN_0043acac(param_1 + 9,0);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_14,4);
  FUN_00439928((int)param_1,local_8,param_3,local_c,local_10,local_14);
  return param_1;
}



/* @00439724 file=munga/audcmp.cpp name=FUN_00439724 */

void __cdecl FUN_00439724(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int local_14;
  int local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004e93bd);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_first_input_control_ID_004e93cd);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e93e4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_first_input_control_ID_004e9409,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9420,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9422,s_d__tesla_bt_munga_AUDCMP_CPP_004e9462
                 ,0x2df);
  }
  FUN_00407ae0(pcVar2,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_last_input_control_ID_004e947f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9495,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_last_input_control_ID_004e94ba,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e94d0,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e94d2,s_d__tesla_bt_munga_AUDCMP_CPP_004e9512
                 ,0x2e0);
  }
  FUN_00407ae0(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_output_control_ID_004e952f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9541,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_output_control_ID_004e9566,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9578,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e957a,s_d__tesla_bt_munga_AUDCMP_CPP_004e95ba
                 ,0x2e1);
  }
  FUN_00407ae0(pcVar2,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00439928 file=? name=FUN_00439928 */

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

{
  undefined4 *puVar1;
  int iVar2;
  
  *(int *)(param_1 + 0x40) = param_4;
  *(undefined4 *)(param_1 + 0x48) = param_6;
  *(int *)(param_1 + 0x44) = (param_5 - param_4) + 1;
  puVar1 = (undefined4 *)(param_1 + 0x30);
  for (iVar2 = 0; iVar2 < *(int *)(param_1 + 0x44); iVar2 = iVar2 + 1) {
    *puVar1 = 0x3f800000;
    puVar1 = puVar1 + 1;
  }
  (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  FUN_004206b4(param_3,param_1);
  return;
}



/* @00439994 file=? name=FUN_00439994 */

undefined4 __cdecl FUN_00439994(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @004399a8 file=? name=FUN_004399a8 */

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

{
  int iVar1;
  float *pfVar2;
  int *piVar3;
  float local_8;
  
  iVar1 = param_2 - *(int *)(param_1 + 0x40);
  if ((-1 < iVar1) && (iVar1 < *(int *)(param_1 + 0x44))) {
    *(undefined4 *)(param_1 + 0x30 + iVar1 * 4) = param_3;
    local_8 = 1.0;
    pfVar2 = (float *)(param_1 + 0x30);
    for (iVar1 = 0; iVar1 < *(int *)(param_1 + 0x44); iVar1 = iVar1 + 1) {
      local_8 = *pfVar2 * local_8;
      pfVar2 = pfVar2 + 1;
    }
    piVar3 = (int *)FUN_00417ab4(param_1 + 0x24);
    (**(code **)(*piVar3 + 0x18))(piVar3,*(undefined4 *)(param_1 + 0x48),local_8);
  }
  return;
}



/* @00439a0c file=? name=FUN_00439a0c */

void __cdecl FUN_00439a0c(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004e9ff8;
    FUN_0043adb5(param_1 + 0xc,2);
    FUN_0043accb(param_1 + 9,2);
    FUN_00436d4c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00439a54 file=? name=FUN_00439a54 */

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

{
  undefined4 local_14;
  undefined4 local_10;
  uint local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004e9ff8;
  FUN_0043acac(param_1 + 9,0);
  FUN_0043ad42((int)(param_1 + 0xc));
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_14,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  FUN_0043ad70(param_1 + 0xc,local_c,local_10);
  FUN_00439cc0((int)param_1,local_8,param_3,local_14);
  return param_1;
}



/* @00439b00 file=munga/audcmp.cpp name=FUN_00439b00 */

void __cdecl FUN_00439b00(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int iVar3;
  float *pfVar4;
  float local_14;
  int local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004e95d7);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_control_ID_004e95e7);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e95f2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004e9617,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9622,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9624,s_d__tesla_bt_munga_AUDCMP_CPP_004e9664
                 ,0x38b);
  }
  FUN_00407ae0(pcVar2,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_number_of_samples_004e9681);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9693,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_number_of_samples_004e96b8,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e96ca,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e96cc,s_d__tesla_bt_munga_AUDCMP_CPP_004e970c
                 ,0x38c);
  }
  FUN_00407b08(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  local_14 = 0.0;
  iVar3 = FUN_00403ad0(param_2,s_initial_fill_value_004e9729);
  if (iVar3 != 0) {
    pfVar4 = &local_14;
    pcVar2 = (char *)FUN_00403ad0(param_2,s_initial_fill_value_004e973c);
    FUN_00407b78(pcVar2,pfVar4);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00439cc0 file=? name=FUN_00439cc0 */

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

{
  *(undefined4 *)(param_1 + 0x3c) = param_4;
  (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  FUN_004206b4(param_3,param_1);
  return;
}



/* @00439d04 file=? name=FUN_00439d04 */

undefined4 __cdecl FUN_00439d04(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @00439d18 file=? name=FUN_00439d18 */

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

{
  int *piVar1;
  float10 fVar2;
  
  if (param_2 == *(int *)(param_1 + 0x3c)) {
    FUN_0043ade4((uint *)(param_1 + 0x30),param_3);
    piVar1 = (int *)FUN_00417ab4(param_1 + 0x24);
    fVar2 = FUN_0043ae47((uint *)(param_1 + 0x30));
    (**(code **)(*piVar1 + 0x18))(piVar1,*(undefined4 *)(param_1 + 0x3c),(float)fVar2);
  }
  return;
}



/* @00439d68 file=? name=FUN_00439d68 */

void __cdecl FUN_00439d68(int *param_1,byte param_2)

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



/* @00439da4 file=? name=FUN_00439da4 */

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

{
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  int local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004e9fdc;
  FUN_0043acac(param_1 + 9,0);
  FUN_0043b074(param_2,&local_8);
  FUN_0043b0a3(param_2,&local_c);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_14,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_18,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_1c,4);
  FUN_0043a130((int)param_1,local_8,param_3,local_c,local_10,local_14,local_18,local_1c);
  return param_1;
}



/* @00439e60 file=munga/audcmp.cpp name=FUN_00439e60 */

void __cdecl FUN_00439e60(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int local_1c;
  float local_18;
  float local_14;
  int local_10;
  uint *local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_source_004e974f);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_c = (uint *)0x0;
  }
  else {
    local_c = FUN_00402460(puVar1,s_audio_resource_index_004e975c);
  }
  local_c[3] = local_c[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_c);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_control_ID_004e9771);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e977c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004e97a1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e97ac,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e97ae,s_d__tesla_bt_munga_AUDCMP_CPP_004e97ee
                 ,0x41d);
  }
  FUN_00407ae0(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_min_control_value_004e980b);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e981d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_min_control_value_004e9842,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9854,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9856,s_d__tesla_bt_munga_AUDCMP_CPP_004e9896
                 ,0x41e);
  }
  FUN_00407b78(pcVar2,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_max_control_value_004e98b3);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e98c5,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_max_control_value_004e98ea,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e98fc,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e98fe,s_d__tesla_bt_munga_AUDCMP_CPP_004e993e
                 ,0x41f);
  }
  FUN_00407b78(pcVar2,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_dump_value_004e995b);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9966,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004e998b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9996,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9998,s_d__tesla_bt_munga_AUDCMP_CPP_004e99d8
                 ,0x420);
  }
  FUN_00407ae0(pcVar2,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  puVar1 = local_c + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_c,3);
  }
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043a130 file=? name=FUN_0043a130 */

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

{
  *(undefined4 *)(param_1 + 0x34) = param_5;
  *(undefined4 *)(param_1 + 0x38) = param_6;
  *(undefined4 *)(param_1 + 0x3c) = param_7;
  *(undefined4 *)(param_1 + 0x40) = param_8;
  *(undefined4 *)(param_1 + 0x30) = param_4;
  (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  FUN_004206b4(param_3,param_1);
  return;
}



/* @0043a18c file=? name=FUN_0043a18c */

undefined4 __cdecl FUN_0043a18c(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @0043a1a0 file=? name=FUN_0043a1a0 */

void __cdecl FUN_0043a1a0(int param_1,int param_2)

{
  int iVar1;
  undefined4 uVar2;
  
  if ((param_2 == *(int *)(param_1 + 0x34)) &&
     (iVar1 = FUN_00417ab4(param_1 + 0x24), *(int *)(iVar1 + 0x2c) == 0)) {
    FUN_00437c4c(*(int *)(param_1 + 0x30));
    uVar2 = FUN_004dcd94();
    uVar2 = FUN_00437c0c(*(int *)(param_1 + 0x30),uVar2);
    FUN_0043b9f4(iVar1,uVar2);
  }
  return;
}



/* @0043a248 file=? name=FUN_0043a248 */

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

{
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined1 local_10 [4];
  undefined4 local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004e9fc0;
  FUN_0043acac(param_1 + 9,0);
  param_1[0x10] = 0xffffffff;
  param_1[0x11] = 0xffffffff;
  local_14 = 0xffffffff;
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,local_10,4);
  local_14 = FUN_00437404();
  (**(code **)(*param_2 + 0x1c))(param_2,&local_18,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_1c,4);
  FUN_0043a528((int)param_1,local_8,param_3,local_c,&local_14,local_18,local_1c);
  return param_1;
}



/* @0043a324 file=munga/audcmp.cpp name=FUN_0043a324 */

void __cdecl FUN_0043a324(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int iVar3;
  float *pfVar4;
  float local_18;
  float local_14;
  float local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004e99f5);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_control_ID_004e9a05);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9a10,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004e9a35,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9a40,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9a42,s_d__tesla_bt_munga_AUDCMP_CPP_004e9a82
                 ,0x4d0);
  }
  FUN_00407ae0(pcVar2,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_sample_duration_004e9a9f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9aaf,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_sample_duration_004e9ad4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9ae4,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9ae6,s_d__tesla_bt_munga_AUDCMP_CPP_004e9b26
                 ,0x4d1);
  }
  FUN_00407b78(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  local_14 = 0.0;
  local_18 = 1.0;
  iVar3 = FUN_00403ad0(param_2,s_min_value_004e9b43);
  if (iVar3 != 0) {
    pfVar4 = &local_14;
    pcVar2 = (char *)FUN_00403ad0(param_2,s_min_value_004e9b4d);
    FUN_00407b78(pcVar2,pfVar4);
  }
  iVar3 = FUN_00403ad0(param_2,s_max_value_004e9b57);
  if (iVar3 != 0) {
    pfVar4 = &local_18;
    pcVar2 = (char *)FUN_00403ad0(param_2,s_max_value_004e9b61);
    FUN_00407b78(pcVar2,pfVar4);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043a528 file=? name=FUN_0043a528 */

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

{
  undefined4 local_8;
  
  *(undefined4 *)(param_1 + 0x30) = param_4;
  *(undefined4 *)(param_1 + 0x3c) = 0;
  FUN_004373e8(&local_8);
  *(undefined4 *)(param_1 + 0x40) = local_8;
  *(undefined4 *)(param_1 + 0x44) = *param_5;
  *(undefined4 *)(param_1 + 0x34) = param_6;
  *(undefined4 *)(param_1 + 0x38) = param_7;
  (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  FUN_004206b4(param_3,param_1);
  return;
}



/* @0043a59c file=? name=FUN_0043a59c */

void __cdecl FUN_0043a59c(int *param_1,byte param_2)

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



/* @0043a5d8 file=? name=FUN_0043a5d8 */

void __cdecl FUN_0043a5d8(int param_1)

{
  int local_8;
  
  FUN_00436e14(param_1);
  FUN_004373e8(&local_8);
  if (*(int *)(param_1 + 0x40) < local_8) {
    FUN_0043a628(param_1);
  }
  return;
}



/* @0043a610 file=? name=FUN_0043a610 */

void __cdecl FUN_0043a610(int param_1,int param_2)

{
  if (param_2 == 1) {
    FUN_0043a628(param_1);
  }
  return;
}



/* @0043a628 file=? name=FUN_0043a628 */

void __cdecl FUN_0043a628(int param_1)

{
  int *piVar1;
  float10 fVar2;
  int local_c;
  float local_8;
  
  fVar2 = FUN_00408050();
  local_8 = (float)fVar2;
  *(float *)(param_1 + 0x3c) =
       (*(float *)(param_1 + 0x38) - *(float *)(param_1 + 0x34)) * local_8 +
       *(float *)(param_1 + 0x34);
  FUN_004373e8(&local_c);
  piVar1 = (int *)(param_1 + 0x40);
  *piVar1 = local_c;
  *piVar1 = *piVar1 + *(int *)(param_1 + 0x44);
  piVar1 = (int *)FUN_00417ab4(param_1 + 0x24);
  (**(code **)(*piVar1 + 0x18))
            (piVar1,*(undefined4 *)(param_1 + 0x30),*(undefined4 *)(param_1 + 0x3c));
  return;
}



/* @0043a68c file=? name=FUN_0043a68c */

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

{
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004e9fa4;
  FUN_0043acac(param_1 + 9,0);
  param_1[0x10] = 0xffffffff;
  param_1[0x11] = 0xffffffff;
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_14,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_18,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_1c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_20,4);
  FUN_0043ab00((int)param_1,local_8,param_3,local_c,local_10,local_14,local_18,local_1c,local_20);
  return param_1;
}



/* @0043a770 file=munga/audcmp.cpp name=FUN_0043a770 */

void __cdecl FUN_0043a770(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int local_20;
  float local_1c;
  float local_18;
  float local_14;
  int local_10;
  int local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004e9b6b);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_control_ID_004e9b7b);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9b86,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004e9bab,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9bb6,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9bb8,s_d__tesla_bt_munga_AUDCMP_CPP_004e9bf8
                 ,0x599);
  }
  FUN_00407ae0(pcVar2,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_wave_form_004e9c15);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9c1f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_wave_form_004e9c44,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9c4e,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9c50,s_d__tesla_bt_munga_AUDCMP_CPP_004e9c90
                 ,0x59a);
  }
  FUN_00407ae0(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_period_004e9cad);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9cb4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_period_004e9cd9,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9ce0,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9ce2,s_d__tesla_bt_munga_AUDCMP_CPP_004e9d22
                 ,0x59b);
  }
  FUN_00407b78(pcVar2,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_min_value_004e9d3f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9d49,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_min_value_004e9d6e,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9d78,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9d7a,s_d__tesla_bt_munga_AUDCMP_CPP_004e9dba
                 ,0x5a0);
  }
  FUN_00407b78(pcVar2,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_max_value_004e9dd7);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9de1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_max_value_004e9e06,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9e10,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9e12,s_d__tesla_bt_munga_AUDCMP_CPP_004e9e52
                 ,0x5a1);
  }
  FUN_00407b78(pcVar2,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_dump_value_004e9e6f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9e7a,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004e9e9f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004e9eaa,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004e9eac,s_d__tesla_bt_munga_AUDCMP_CPP_004e9eec
                 ,0x5a2);
  }
  FUN_00407ae0(pcVar2,&local_20);
  (**(code **)(*param_1 + 0x20))(param_1,&local_20,4);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043ab00 file=? name=FUN_0043ab00 */

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

{
  undefined4 uVar1;
  undefined4 local_c;
  undefined4 local_8;
  
  (**(code **)(*(int *)(param_1 + 0x24) + 4))(param_1 + 0x24,param_2);
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  *(undefined4 *)(param_1 + 0x30) = param_4;
  *(undefined4 *)(param_1 + 0x34) = param_5;
  *(undefined4 *)(param_1 + 0x38) = param_7;
  *(undefined4 *)(param_1 + 0x3c) = param_8;
  local_8 = param_6;
  uVar1 = FUN_00437404();
  *(undefined4 *)(param_1 + 0x40) = uVar1;
  FUN_004373e8(&local_c);
  *(undefined4 *)(param_1 + 0x44) = local_c;
  *(undefined4 *)(param_1 + 0x48) = param_9;
  FUN_004206b4(param_3,param_1);
  return;
}



/* @0043ab88 file=? name=FUN_0043ab88 */

void __cdecl FUN_0043ab88(int *param_1,byte param_2)

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



/* @0043abc4 file=? name=FUN_0043abc4 */

void __cdecl FUN_0043abc4(int param_1)

{
  FUN_00436e14(param_1);
  FUN_0043abf4(param_1);
  return;
}



/* @0043abdc file=? name=FUN_0043abdc */

void __cdecl FUN_0043abdc(int param_1,int param_2)

{
  if (param_2 == 1) {
    FUN_0043abf4(param_1);
  }
  return;
}



/* @0043abf4 file=? name=FUN_0043abf4 */

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

void __cdecl FUN_0043abf4(int param_1)

{
  int *piVar1;
  float10 fVar2;
  float10 fVar3;
  float10 fVar4;
  int local_14;
  float local_10;
  float local_c;
  float local_8;
  
  FUN_004373e8(&local_14);
  fVar2 = FUN_00437428(&local_14,local_14);
  local_8 = (float)fVar2;
  fVar3 = FUN_00437428((int *)(param_1 + 0x44),*(int *)(param_1 + 0x44));
  fVar2 = (float10)local_8;
  fVar4 = FUN_00437428((int *)(param_1 + 0x40),*(int *)(param_1 + 0x40));
  local_8 = (float)((float10)(float)(fVar2 - fVar3) / fVar4);
  fVar2 = (float10)FUN_004dd0f4(SUB84((double)(local_8 * _DAT_0043aca0),0),
                                (int)((ulonglong)(double)(local_8 * _DAT_0043aca0) >> 0x20));
  local_c = (float)((fVar2 + (float10)_DAT_0043aca4) * (float10)_DAT_0043aca8);
  local_10 = (*(float *)(param_1 + 0x3c) - *(float *)(param_1 + 0x38)) * local_c +
             *(float *)(param_1 + 0x38);
  piVar1 = (int *)FUN_00417ab4(param_1 + 0x24);
  (**(code **)(*piVar1 + 0x18))(piVar1,*(undefined4 *)(param_1 + 0x30),local_10);
  return;
}



/* @0043acac file=? name=FUN_0043acac */

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

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



/* @0043accb file=? name=FUN_0043accb */

void __cdecl FUN_0043accb(int *param_1,byte param_2)

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



/* @0043acf7 file=? name=FUN_0043acf7 */

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

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



/* @0043ad16 file=? name=FUN_0043ad16 */

void __cdecl FUN_0043ad16(int *param_1,byte param_2)

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



/* @0043ad42 file=? name=FUN_0043ad42 */

void __cdecl FUN_0043ad42(int param_1)

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



/* @0043ad4f file=? name=FUN_0043ad4f */

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

{
  param_1[2] = 0;
  FUN_0043ad70(param_1,param_2,param_3);
  return param_1;
}



/* @0043ad70 file=? name=FUN_0043ad70 */

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

{
  uint uVar1;
  
  if ((int *)param_1[2] != (int *)0x0) {
    FUN_004022e8((int *)param_1[2]);
  }
  *param_1 = param_2;
  uVar1 = FUN_004022b0(param_2 << 2);
  param_1[2] = uVar1;
  param_1[1] = 0;
  for (uVar1 = 0; uVar1 < *param_1; uVar1 = uVar1 + 1) {
    *(undefined4 *)(param_1[2] + uVar1 * 4) = param_3;
  }
  return;
}



/* @0043adb5 file=? name=FUN_0043adb5 */

void __cdecl FUN_0043adb5(int *param_1,byte param_2)

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



/* @0043adda file=? name=FUN_0043adda */

undefined4 FUN_0043adda(void)

{
  return 1;
}



/* @0043ade4 file=? name=FUN_0043ade4 */

void __cdecl FUN_0043ade4(uint *param_1,undefined4 param_2)

{
  *(undefined4 *)(param_1[2] + param_1[1] * 4) = param_2;
  param_1[1] = param_1[1] + 1;
  if (*param_1 <= param_1[1]) {
    param_1[1] = 0;
  }
  return;
}



/* @0043ae0b file=? name=FUN_0043ae0b */

float10 __cdecl FUN_0043ae0b(uint *param_1)

{
  uint uVar1;
  float *pfVar2;
  float local_8;
  
  local_8 = 0.0;
  pfVar2 = (float *)param_1[2];
  for (uVar1 = 0; uVar1 < *param_1; uVar1 = uVar1 + 1) {
    local_8 = *pfVar2 + local_8;
    pfVar2 = pfVar2 + 1;
  }
  return (float10)local_8 / (float10)*param_1;
}



/* @0043ae47 file=? name=FUN_0043ae47 */

float10 __cdecl FUN_0043ae47(uint *param_1)

{
  uint uVar1;
  float *pfVar2;
  float local_10;
  float local_c;
  float local_8;
  
  local_c = *(float *)param_1[2];
  local_10 = *(float *)param_1[2];
  local_8 = 0.0;
  pfVar2 = (float *)param_1[2];
  for (uVar1 = 0; uVar1 < *param_1; uVar1 = uVar1 + 1) {
    local_8 = *pfVar2 + local_8;
    if (*pfVar2 < local_c) {
      local_c = *pfVar2;
    }
    if (local_10 < *pfVar2) {
      local_10 = *pfVar2;
    }
    pfVar2 = pfVar2 + 1;
  }
  return (float10)((local_8 - local_c) - local_10) / (float10)(*param_1 - 2);
}



/* @0043aed4 file=? name=FUN_0043aed4 */

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

float10 __cdecl FUN_0043aed4(uint *param_1)

{
  uint uVar1;
  float fVar2;
  float fVar3;
  uint uVar4;
  float local_1c;
  float local_c;
  float local_8;
  
  local_8 = 0.0;
  local_c = 0.0;
  uVar1 = *param_1;
  fVar2 = (float)uVar1;
  fVar3 = fVar2 * fVar2 * _DAT_0043af9c;
  fVar2 = fVar2 * _DAT_0043af9c + fVar3;
  uVar4 = param_1[1];
  local_1c = 1.0;
  do {
    local_8 = *(float *)(param_1[2] + uVar4 * 4) + local_8;
    local_c = local_1c * *(float *)(param_1[2] + uVar4 * 4) + local_c;
    local_1c = _DAT_0043afb8 + local_1c;
    uVar4 = uVar4 + 1;
    if (uVar4 == *param_1) {
      uVar4 = 0;
    }
  } while (uVar4 != param_1[1]);
  return ((float10)uVar1 * (float10)local_c - (float10)fVar2 * (float10)local_8) /
         ((float10)uVar1 *
          (float10)(float)(_DAT_0043afac * (float10)uVar1 +
                          _DAT_0043afa0 * (float10)uVar1 * (float10)uVar1 * (float10)uVar1 +
                          (float10)fVar3) - (float10)fVar2 * (float10)fVar2);
}



/* @0043afbc file=? name=FUN_0043afbc */

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

{
  int iVar1;
  undefined4 local_8;
  
  (**(code **)(*param_1 + 0x1c))(param_1,&local_8,4);
  iVar1 = FUN_004170e4((int)param_1,local_8);
  *param_2 = iVar1;
  return;
}



/* @0043afeb file=? name=FUN_0043afeb */

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

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



/* @0043b00a file=? name=FUN_0043b00a */

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

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



/* @0043b029 file=? name=FUN_0043b029 */

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

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



/* @0043b048 file=? name=FUN_0043b048 */

void __cdecl FUN_0043b048(int *param_1,byte param_2)

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



/* @0043b074 file=? name=FUN_0043b074 */

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

{
  int iVar1;
  undefined4 local_8;
  
  (**(code **)(*param_1 + 0x1c))(param_1,&local_8,4);
  iVar1 = FUN_004170e4((int)param_1,local_8);
  *param_2 = iVar1;
  return;
}



/* @0043b0a3 file=? name=FUN_0043b0a3 */

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

{
  int iVar1;
  undefined4 local_8;
  
  (**(code **)(*param_1 + 0x1c))(param_1,&local_8,4);
  iVar1 = FUN_004170e4((int)param_1,local_8);
  *param_2 = iVar1;
  return;
}



/* @0043b0d2 file=? name=FUN_0043b0d2 */

undefined4 FUN_0043b0d2(void)

{
  return 1;
}



/* @0043b0dc file=? name=FUN_0043b0dc */

undefined4 * __cdecl FUN_0043b0dc(undefined4 *param_1)

{
  undefined4 uVar1;
  
  param_1[4] = 0xffffffff;
  param_1[5] = 0xffffffff;
  *param_1 = 0x42700000;
  param_1[1] = 0;
  param_1[2] = 0;
  param_1[3] = 0;
  uVar1 = FUN_00437404();
  param_1[4] = uVar1;
  uVar1 = FUN_00437404();
  param_1[5] = uVar1;
  return param_1;
}



/* @0043b138 file=? name=FUN_0043b138 */

void __cdecl FUN_0043b138(int *param_1,byte param_2)

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



/* @0043b154 file=? name=FUN_0043b154 */

undefined4 FUN_0043b154(void)

{
  return 1;
}



/* @0043b170 file=? name=FUN_0043b170 */

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

void __cdecl FUN_0043b170(int param_1,float param_2)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  int local_14 [2];
  float local_c;
  int local_8;
  
  if (param_2 <= _DAT_0043b228) {
    if (*(int *)(param_1 + 4) == 0) {
      *(undefined4 *)(param_1 + 8) = 0;
      uVar3 = FUN_00437404();
      *(undefined4 *)(param_1 + 0x14) = uVar3;
    }
    else {
      *(undefined4 *)(param_1 + 8) = 1;
      FUN_004373e8(local_14);
      piVar1 = (int *)(param_1 + 0x14);
      *piVar1 = local_14[0];
      iVar2 = FUN_00437404();
      *piVar1 = *piVar1 + iVar2;
      *(undefined4 *)(param_1 + 4) = 0;
    }
  }
  else {
    *(undefined4 *)(param_1 + 8) = 1;
    FUN_004373e8(&local_8);
    piVar1 = (int *)(param_1 + 0x14);
    *piVar1 = local_8;
    local_c = param_2;
    iVar2 = FUN_00437404();
    *piVar1 = *piVar1 + iVar2;
  }
  return;
}



/* @0043b22c file=? name=FUN_0043b22c */

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

{
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined1 local_28 [4];
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  int local_c;
  int local_8;
  
  FUN_00436d14(param_1,param_2,&DAT_004ea124);
  *param_1 = &PTR_FUN_004ea820;
  FUN_0043b0dc(param_1 + 0xc);
  FUN_0043b0dc(param_1 + 0x12);
  param_1[0x1f] = 0xffffffff;
  local_2c = 0xffffffff;
  FUN_00437e75(param_2,&local_8);
  FUN_0043c11d(param_2,&local_c);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_14,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_18,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_1c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_20,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_24,4);
  (**(code **)(*param_2 + 0x1c))(param_2,local_28,4);
  local_2c = FUN_00437404();
  (**(code **)(*param_2 + 0x1c))(param_2,&local_30,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_34,4);
  FUN_0043b8e8((int)param_1,local_8,local_c,param_3,local_10,local_14,local_18,local_1c,local_20,
               local_24,&local_2c,local_30,local_34);
  return param_1;
}



/* @0043b37c file=munga/audsrc.cpp name=FUN_0043b37c */

void __cdecl FUN_0043b37c(int *param_1,int param_2)

{
  uint *puVar1;
  char *pcVar2;
  int local_30;
  int local_2c;
  float local_28;
  int local_24;
  float local_20;
  float local_1c;
  float local_18;
  int local_14;
  int local_10;
  uint *local_c;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_resource_004ea143);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_c = (uint *)0x0;
  }
  else {
    local_c = FUN_00402460(puVar1,s_location_004ea14c);
  }
  local_c[3] = local_c[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_c);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_priority_004ea155);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea15e,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_priority_004ea183,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea18c,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea18e,s_d__tesla_bt_munga_AUDSRC_CPP_004ea1ce
                 ,0xf7);
  }
  FUN_00407ae0(pcVar2,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_mix_presence_004ea1eb);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea1f8,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_mix_presence_004ea21d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea22a,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea22c,s_d__tesla_bt_munga_AUDSRC_CPP_004ea26c
                 ,0xf8);
  }
  FUN_00407ae0(pcVar2,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_volume_mix_level_004ea289);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea29a,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_volume_mix_level_004ea2bf,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea2d0,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea2d2,s_d__tesla_bt_munga_AUDSRC_CPP_004ea312
                 ,0xf9);
  }
  FUN_00407b78(pcVar2,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_pitch_mix_offset_004ea32f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea340,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_pitch_mix_offset_004ea365,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea376,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea378,s_d__tesla_bt_munga_AUDSRC_CPP_004ea3b8
                 ,0xfa);
  }
  FUN_00407b78(pcVar2,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_brightness_mix_level_004ea3d5);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea3ea,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_brightness_mix_level_004ea40f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea424,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea426,s_d__tesla_bt_munga_AUDSRC_CPP_004ea466
                 ,0xfb);
  }
  FUN_00407b78(pcVar2,&local_20);
  (**(code **)(*param_1 + 0x20))(param_1,&local_20,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_has_compression_curve_004ea483);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea499,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_has_compression_curve_004ea4be,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea4d4,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea4d6,s_d__tesla_bt_munga_AUDSRC_CPP_004ea516
                 ,0xfc);
  }
  FUN_00407ae0(pcVar2,&local_24);
  (**(code **)(*param_1 + 0x20))(param_1,&local_24,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_compression_duration_004ea533);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea548,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_compression_duration_004ea56d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea582,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea584,s_d__tesla_bt_munga_AUDSRC_CPP_004ea5c4
                 ,0xfd);
  }
  FUN_00407b78(pcVar2,&local_28);
  (**(code **)(*param_1 + 0x20))(param_1,&local_28,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_use_brightness_scale_004ea5e1);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea5f6,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_use_brightness_scale_004ea61b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea630,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea632,s_d__tesla_bt_munga_AUDSRC_CPP_004ea672
                 ,0xfe);
  }
  FUN_00407ae0(pcVar2,&local_2c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_2c,4);
  pcVar2 = (char *)FUN_00403ad0(param_2,s_use_attack_time_scale_004ea68f);
  if (pcVar2 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea6a5,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_use_attack_time_scale_004ea6ca,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ea6e0,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ea6e2,s_d__tesla_bt_munga_AUDSRC_CPP_004ea722
                 ,0xff);
  }
  FUN_00407ae0(pcVar2,&local_30);
  (**(code **)(*param_1 + 0x20))(param_1,&local_30,4);
  puVar1 = local_c + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_c,3);
  }
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043b8e8 file=? name=FUN_0043b8e8 */

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

{
  *(undefined4 *)(param_1 + 0x24) = param_3;
  *(undefined4 *)(param_1 + 0x28) = param_2;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  *(undefined4 *)(param_1 + 0x60) = 0x3f800000;
  *(undefined4 *)(param_1 + 100) = param_13;
  *(undefined4 *)(param_1 + 0x68) = 0;
  *(undefined4 *)(param_1 + 0x6c) = param_5;
  *(undefined4 *)(param_1 + 0x70) = param_6;
  *(undefined4 *)(param_1 + 0x74) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x78) = param_10;
  *(undefined4 *)(param_1 + 0x7c) = *param_11;
  *(undefined4 *)(param_1 + 0x80) = param_7;
  *(undefined4 *)(param_1 + 0x84) = param_8;
  *(undefined4 *)(param_1 + 0x88) = param_12;
  *(undefined4 *)(param_1 + 0x8c) = param_9;
  *(undefined4 *)(param_1 + 0x90) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x94) = 0;
  *(undefined4 *)(param_1 + 0x98) = 0x3f800000;
  *(undefined4 *)(param_1 + 0x9c) = 0xffffffff;
  *(undefined4 *)(param_1 + 0xa0) = 0xffffffff;
  FUN_004206b4(param_4,param_1);
  return;
}



/* @0043b998 file=? name=FUN_0043b998 */

void __cdecl FUN_0043b998(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ea820;
    FUN_0043b138(param_1 + 0x12,2);
    FUN_0043b138(param_1 + 0xc,2);
    FUN_00436d4c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043b9e0 file=? name=FUN_0043b9e0 */

undefined4 __cdecl FUN_0043b9e0(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @0043b9f4 file=? name=FUN_0043b9f4 */

void __cdecl FUN_0043b9f4(int param_1,undefined4 param_2)

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



/* @0043ba04 file=? name=FUN_0043ba04 */

void __cdecl FUN_0043ba04(int param_1,int param_2)

{
  int local_1c;
  undefined4 local_18;
  undefined4 local_14;
  undefined4 local_10;
  undefined4 local_c;
  undefined4 local_8;
  
  if (param_2 == 2) {
    FUN_0043b0dc(&local_1c);
    *(int *)(param_1 + 0x30) = local_1c;
    *(undefined4 *)(param_1 + 0x34) = local_18;
    *(undefined4 *)(param_1 + 0x38) = local_14;
    *(undefined4 *)(param_1 + 0x3c) = local_10;
    *(undefined4 *)(param_1 + 0x40) = local_c;
    *(undefined4 *)(param_1 + 0x44) = local_8;
    FUN_0043b138(&local_1c,2);
  }
  *(int *)(param_1 + 0x2c) = param_2;
  return;
}



/* @0043ba64 file=? name=FUN_0043ba64 */

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

float10 __cdecl FUN_0043ba64(int *param_1)

{
  float10 fVar1;
  int local_14;
  int local_10;
  float local_c;
  float local_8;
  
  fVar1 = (float10)(**(code **)(*param_1 + 0x1c))(param_1);
  local_8 = (float)fVar1;
  if (param_1[0x1e] == 0) {
    fVar1 = (float10)local_8;
  }
  else {
    FUN_004373e8(&local_10);
    local_14 = local_10 - param_1[0x16];
    fVar1 = FUN_00437428(&local_14,local_14);
    local_c = (float)fVar1;
    fVar1 = FUN_00437428(param_1 + 0x1f,param_1[0x1f]);
    fVar1 = FUN_004dce94((double)((_DAT_0043bb10 / (float)fVar1) * local_c),0,0x40000000);
    fVar1 = (float10)(_DAT_0043bb10 / (_DAT_0043bb10 + (float)fVar1)) * (float10)local_8;
  }
  return fVar1;
}



/* @0043bb14 file=? name=FUN_0043bb14 */

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

float10 __cdecl FUN_0043bb14(int param_1)

{
  float fVar1;
  float fVar2;
  
  FUN_00436db0(param_1);
  fVar1 = *(float *)(param_1 + 0x90) * *(float *)(param_1 + 0x80) * *(float *)(param_1 + 0x74);
  fVar2 = _DAT_004e8634;
  if ((_DAT_004e8634 <= fVar1) && (fVar2 = fVar1, _DAT_004e8630 < fVar1)) {
    fVar2 = _DAT_004e8630;
  }
  return (float10)fVar2;
}



/* @0043bb70 file=? name=FUN_0043bb70 */

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

float10 __cdecl FUN_0043bb70(int param_1)

{
  float fVar1;
  float fVar2;
  
  fVar1 = *(float *)(param_1 + 0x98) * *(float *)(param_1 + 0x8c);
  fVar2 = _DAT_004e8640;
  if ((_DAT_004e8640 <= fVar1) && (fVar2 = fVar1, _DAT_004e863c < fVar1)) {
    fVar2 = _DAT_004e863c;
  }
  return (float10)fVar2;
}



/* @0043bbc0 file=munga/audsrc.cpp name=FUN_0043bbc0 */

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

{
  uint local_30 [10];
  undefined4 local_8;
  
  switch(param_2) {
  case 0:
  case 9:
    break;
  case 1:
    local_8 = param_3;
    local_30[5] = 0x14;
    local_30[6] = 4;
    local_30[7] = 1;
    local_30[8] = 1;
    local_30[9] = param_3;
    FUN_00442068(*(int *)(DAT_004efc94 + 0x44),param_1,local_30 + 5);
    break;
  case 2:
    local_30[0] = 0x14;
    local_30[1] = 5;
    local_30[2] = 1;
    local_30[3] = 2;
    local_30[4] = 0;
    FUN_00442068(*(int *)(DAT_004efc94 + 0x44),param_1,local_30);
    break;
  case 3:
    (**(code **)(*param_1 + 0x28))(param_1,param_3);
    break;
  case 4:
    (**(code **)(*param_1 + 0x2c))(param_1,param_3);
    break;
  case 5:
    (**(code **)(*param_1 + 0x30))(param_1,param_3);
    break;
  case 6:
    (**(code **)(*param_1 + 0x34))(param_1,param_3);
    break;
  case 7:
    (**(code **)(*param_1 + 0x38))(param_1,param_3);
    break;
  case 8:
    (**(code **)(*param_1 + 0x3c))(param_1,param_3);
    break;
  case 10:
    (**(code **)(*param_1 + 0x40))(param_1,param_3);
    break;
  case 0xb:
    FUN_004421b4(*(int *)(DAT_004efc94 + 0x44),(int)param_1);
    break;
  default:
    FUN_0040385c(s_AudioSource__ReceiveControl___Sh_004ea73f,s_d__tesla_bt_munga_AUDSRC_CPP_004ea775
                 ,0x233);
  }
  return;
}



/* @0043bd20 file=? name=FUN_0043bd20 */

void __cdecl FUN_0043bd20(int *param_1,int param_2)

{
  int local_10;
  undefined4 local_c;
  int local_8;
  
  local_c = DAT_004e862c;
  local_8 = FUN_00437404();
  if ((param_1[0xb] == 2) && (FUN_004373e8(&local_10), local_10 - param_1[0x16] <= local_8)) {
    return;
  }
  if (param_1[0xb] != 0) {
    FUN_0043be08(param_1);
  }
  param_1[0x12] = param_1[0xc];
  param_1[0x13] = param_1[0xd];
  param_1[0x14] = param_1[0xe];
  param_1[0x15] = param_1[0xf];
  param_1[0x16] = param_1[0x10];
  param_1[0x17] = param_1[0x11];
  FUN_0043b170((int)(param_1 + 0x12),*(float *)(param_2 + 0x10));
  (**(code **)(*param_1 + 0x54))(param_1);
  return;
}



/* @0043be08 file=? name=FUN_0043be08 */

void __cdecl FUN_0043be08(int *param_1)

{
  if (param_1[0xb] != 0) {
    (**(code **)(*param_1 + 0x58))(param_1);
  }
  return;
}



/* @0043be20 file=? name=FUN_0043be20 */

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

void __cdecl FUN_0043be20(int param_1,float param_2)

{
  float fVar1;
  
  fVar1 = _DAT_004e8634;
  if ((_DAT_004e8634 <= param_2) && (fVar1 = param_2, _DAT_004e8630 < param_2)) {
    fVar1 = _DAT_004e8630;
  }
  *(float *)(param_1 + 0x90) = fVar1 / (_DAT_004e8630 - _DAT_004e8634);
  return;
}



/* @0043be70 file=? name=FUN_0043be70 */

void __cdecl FUN_0043be70(int param_1,undefined4 param_2)

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



/* @0043be84 file=? name=FUN_0043be84 */

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

void __cdecl FUN_0043be84(int param_1,float param_2)

{
  float fVar1;
  
  fVar1 = _DAT_004e8640;
  if ((_DAT_004e8640 <= param_2) && (fVar1 = param_2, _DAT_004e863c < param_2)) {
    fVar1 = _DAT_004e863c;
  }
  *(float *)(param_1 + 0x98) = fVar1 / (_DAT_004e863c - _DAT_004e8640);
  return;
}



/* @0043bed4 file=? name=FUN_0043bed4 */

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

void __cdecl FUN_0043bed4(int param_1,float param_2)

{
  float fVar1;
  
  fVar1 = _DAT_004e8648;
  if ((_DAT_004e8648 <= param_2) && (fVar1 = param_2, _DAT_004e8644 < param_2)) {
    fVar1 = _DAT_004e8644;
  }
  *(float *)(param_1 + 0x60) = fVar1 / (_DAT_004e8644 - _DAT_004e8648);
  return;
}



/* @0043bf20 file=? name=FUN_0043bf20 */

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

void __cdecl FUN_0043bf20(int param_1,float param_2)

{
  float fVar1;
  
  fVar1 = _DAT_004e8648;
  if ((_DAT_004e8648 <= param_2) && (fVar1 = param_2, _DAT_004e8644 < param_2)) {
    fVar1 = _DAT_004e8644;
  }
  *(float *)(param_1 + 0x68) = fVar1 / (_DAT_004e8644 - _DAT_004e8648);
  return;
}



/* @0043bf6c file=? name=FUN_0043bf6c */

void __cdecl FUN_0043bf6c(int param_1,undefined4 param_2)

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



/* @0043bf84 file=? name=FUN_0043bf84 */

void __cdecl FUN_0043bf84(int param_1,undefined4 param_2)

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



/* @0043bfa4 file=? name=FUN_0043bfa4 */

void __cdecl FUN_0043bfa4(int param_1)

{
  undefined4 local_8;
  
  FUN_004373e8(&local_8);
  *(undefined4 *)(param_1 + 0x58) = local_8;
  return;
}



/* @0043bfc4 file=munga/audsrc.cpp name=FUN_0043bfc4 */

void FUN_0043bfc4(void)

{
  FUN_0040385c(s_AudioSource__StopImplementation___004ea792,s_d__tesla_bt_munga_AUDSRC_CPP_004ea7cc,
               0x309);
  return;
}



/* @0043bfe0 file=? name=FUN_0043bfe0 */

void __cdecl FUN_0043bfe0(int *param_1)

{
  (**(code **)(*param_1 + 0x48))(param_1);
  param_1[0x28] =
       *(int *)(*(int *)(*(int *)(DAT_004efc94 + 0x44) + 0x4c) + 4) +
       *(int *)(*(int *)(param_1[10] + 0xc) + 0x14);
  return;
}



/* @0043c014 file=? name=FUN_0043c014 */

void __cdecl FUN_0043c014(int *param_1)

{
  (**(code **)(*param_1 + 0x44))(param_1);
  param_1[0x28] = -1;
  return;
}



/* @0043c030 file=? name=FUN_0043c030 */

void __cdecl FUN_0043c030(int *param_1)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  
  iVar1 = *(int *)(DAT_004efc94 + 0x44);
  iVar2 = *(int *)(*(int *)(iVar1 + 0x4c) + 4);
  if (param_1[0x27] <= iVar2) {
    param_1[0x27] = iVar2 + 2;
    iVar1 = *(int *)(iVar1 + 0x4c);
    piVar3 = (int *)param_1[9];
    if (piVar3[0x18] <= *(int *)(iVar1 + 4)) {
      piVar3[0x18] = *(int *)(iVar1 + 4) + piVar3[0x17];
      (**(code **)(*piVar3 + 0x1c))(piVar3,iVar1);
    }
    FUN_00436e14((int)param_1);
    (**(code **)(*param_1 + 0x5c))(param_1,0);
  }
  return;
}



/* @0043c11d file=? name=FUN_0043c11d */

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

{
  int iVar1;
  undefined4 local_8;
  
  (**(code **)(*param_1 + 0x1c))(param_1,&local_8,4);
  iVar1 = FUN_004170e4((int)param_1,local_8);
  *param_2 = iVar1;
  return;
}



/* @0043c14c file=? name=FUN_0043c14c */

float10 __cdecl FUN_0043c14c(int param_1)

{
  return (float10)*(float *)(param_1 + 0x84) + (float10)*(float *)(param_1 + 0x94);
}



/* @0043c160 file=? name=FUN_0043c160 */

void FUN_0043c160(void)

{
  return;
}



/* @0043c165 file=? name=FUN_0043c165 */

void FUN_0043c165(void)

{
  return;
}



/* @0043c16a file=? name=FUN_0043c16a */

void FUN_0043c16a(void)

{
  return;
}



/* @0043c170 file=? name=FUN_0043c170 */

undefined4 * __cdecl FUN_0043c170(undefined4 *param_1)

{
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004ea9d0;
  *(undefined2 *)(param_1 + 3) = 0;
  param_1[4] = 0;
  *(undefined2 *)(param_1 + 5) = 0;
  param_1[6] = 0;
  param_1[7] = 0;
  *(undefined2 *)(param_1 + 8) = 0;
  *(undefined2 *)((int)param_1 + 0x22) = 0;
  return param_1;
}



/* @0043c1b4 file=? name=FUN_0043c1b4 */

void __cdecl FUN_0043c1b4(int *param_1,byte param_2)

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



/* @0043c1f4 file=? name=FUN_0043c1f4 */

undefined4 FUN_0043c1f4(void)

{
  FUN_00415f1c();
  return 1;
}



/* @0043c208 file=? name=FUN_0043c208 */

undefined4 __cdecl FUN_0043c208(int param_1)

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



/* @0043c214 file=? name=FUN_0043c214 */

void __cdecl FUN_0043c214(int *param_1)

{
  uint uVar1;
  short sVar2;
  
  uVar1 = FUN_0043c358(param_1);
  while (sVar2 = (short)uVar1, uVar1 = (uint)(ushort)(sVar2 - 1), 0 < sVar2) {
    FUN_0043c3c4(param_1);
  }
  return;
}



/* @0043c240 file=? name=FUN_0043c240 */

undefined4 __cdecl FUN_0043c240(int *param_1,char *param_2,short param_3)

{
  char cVar1;
  short sVar2;
  uint uVar3;
  uint uVar4;
  ushort uVar5;
  char *pcVar6;
  char *pcVar7;
  char local_2c [32];
  char *local_c;
  char local_8 [4];
  
  uVar5 = 0;
  local_c = s_expecting_004ea8a0;
  while( true ) {
    pcVar6 = local_8 + (short)uVar5;
    if (uVar5 < 4) {
      do {
        sVar2 = (**(code **)(*param_1 + 0xc))(param_1);
        if (sVar2 == -1) {
          local_c = s_EOF_while_expecting_004ea8ab;
          goto LAB_0043c2db;
        }
        *pcVar6 = (char)sVar2;
        uVar5 = uVar5 + 1;
        pcVar6 = pcVar6 + 1;
      } while ((short)uVar5 < 4);
    }
    if ((((*param_2 == local_8[0]) && (param_2[1] == local_8[1])) && (param_2[2] == local_8[2])) &&
       (param_2[3] == local_8[3])) {
      return 0;
    }
    if (param_3 == 0) break;
    local_8[0] = local_8[1];
    uVar5 = 3;
    local_8[1] = local_8[2];
    local_8[2] = local_8[3];
  }
LAB_0043c2db:
  uVar3 = 0xffffffff;
  pcVar6 = local_c;
  do {
    pcVar7 = pcVar6;
    if (uVar3 == 0) break;
    uVar3 = uVar3 - 1;
    pcVar7 = pcVar6 + 1;
    cVar1 = *pcVar6;
    pcVar6 = pcVar7;
  } while (cVar1 != '\0');
  uVar3 = ~uVar3;
  pcVar6 = pcVar7 + -uVar3;
  pcVar7 = local_2c;
  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_2c,param_2);
  FUN_0043c978(param_1,local_2c);
  return 0;
}



/* @0043c328 file=? name=FUN_0043c328 */

undefined4 __cdecl FUN_0043c328(int *param_1)

{
  undefined4 uVar1;
  
  uVar1 = (**(code **)(*param_1 + 0xc))(param_1);
  if ((short)uVar1 == -1) {
    FUN_0043c978(param_1,s_premature_EOF_004ea8c0);
  }
  param_1[6] = param_1[6] + -1;
  return uVar1;
}



/* @0043c358 file=? name=FUN_0043c358 */

undefined4 __cdecl FUN_0043c358(int *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  int iVar3;
  undefined4 uVar4;
  
  uVar1 = FUN_0043c240(param_1,&DAT_004ea8ce,(short)param_1[5]);
  if ((short)uVar1 == -1) {
    uVar2 = 0;
  }
  else {
    iVar3 = FUN_0043c908(param_1);
    param_1[6] = iVar3;
    uVar1 = FUN_0043c950(param_1);
    uVar2 = FUN_0043c950(param_1);
    uVar4 = FUN_0043c950(param_1);
    (**(code **)(*param_1 + 0x20))(param_1,uVar1,uVar2,uVar4);
    while (0 < param_1[6]) {
      FUN_0043c328(param_1);
    }
  }
  return uVar2;
}



/* @0043c3c4 file=? name=FUN_0043c3c4 */

void __cdecl FUN_0043c3c4(int *param_1)

{
  short sVar1;
  bool bVar2;
  bool bVar3;
  undefined2 uVar4;
  undefined2 uVar5;
  undefined4 uVar6;
  int iVar7;
  uint uVar8;
  undefined4 uVar9;
  uint uVar10;
  uint extraout_EDX;
  undefined2 extraout_var;
  short sVar11;
  short local_8;
  
  local_8 = 0;
  bVar3 = false;
  uVar6 = FUN_0043c240(param_1,&DAT_004ea8d3,0);
  if ((short)uVar6 != -1) {
    iVar7 = FUN_0043c908(param_1);
    param_1[6] = iVar7;
    param_1[4] = 0;
    (**(code **)(*param_1 + 0x14))(param_1);
    while (0 < param_1[6]) {
      uVar8 = FUN_0043c878(param_1);
      param_1[4] = param_1[4] + uVar8;
      uVar8 = FUN_0043c328(param_1);
      sVar11 = (short)uVar8;
      if ((bVar3) && (sVar11 != 0xf7)) {
        FUN_0043c978(param_1,s_didn_t_find_expected_continuatio_004ea8d8);
      }
      if ((uVar8 & 0x80) == 0) {
        if (local_8 == 0) {
          FUN_0043c978(param_1,s_unexpected_running_status_004ea905);
        }
        bVar2 = true;
      }
      else {
        bVar2 = false;
        local_8 = sVar11;
      }
      uVar10 = (int)local_8 >> 4 & 0xf;
      sVar1 = *(short *)(&DAT_004ea880 + uVar10 * 2);
      if (sVar1 == 0) {
        if (sVar11 == 0xf0) {
          uVar10 = FUN_0043c878(param_1);
          iVar7 = param_1[6];
          FUN_0043c990((int)param_1);
          FUN_0043c9b8((int)param_1,0xf0);
          while ((int)(iVar7 - uVar10) < param_1[6]) {
            uVar8 = FUN_0043c328(param_1);
            FUN_0043c9b8((int)param_1,(char)uVar8);
          }
          if (((short)uVar8 == 0xf7) || ((short)param_1[3] == 0)) {
            FUN_0043c778(param_1);
          }
          else {
            bVar3 = true;
          }
        }
        else if (sVar11 == 0xf7) {
          uVar10 = FUN_0043c878(param_1);
          iVar7 = param_1[6];
          if (!bVar3) {
            FUN_0043c990((int)param_1);
          }
          while ((int)(iVar7 - uVar10) < param_1[6]) {
            uVar8 = FUN_0043c328(param_1);
            FUN_0043c9b8((int)param_1,(char)uVar8);
          }
          if (bVar3) {
            if ((short)uVar8 == 0xf7) {
              FUN_0043c778(param_1);
              bVar3 = false;
            }
          }
          else {
            uVar6 = FUN_0043c9a0((int)param_1);
            uVar5 = FUN_0043c9ac((int)param_1);
            (**(code **)(*param_1 + 0x44))(param_1,uVar5,uVar6);
          }
        }
        else if (sVar11 == 0xff) {
          uVar6 = FUN_0043c328(param_1);
          uVar8 = FUN_0043c878(param_1);
          iVar7 = param_1[6];
          FUN_0043c990((int)param_1);
          while ((int)(iVar7 - uVar8) < param_1[6]) {
            uVar9 = FUN_0043c328(param_1);
            FUN_0043c9b8((int)param_1,(char)uVar9);
          }
          FUN_0043c638(param_1,(short)uVar6);
        }
        else {
          FUN_0043c604(param_1);
        }
      }
      else {
        if (!bVar2) {
          uVar6 = FUN_0043c328(param_1);
          sVar11 = (short)uVar6;
          uVar10 = extraout_EDX;
        }
        uVar5 = (undefined2)(uVar10 >> 0x10);
        if (sVar1 < 2) {
          uVar4 = 0;
        }
        else {
          uVar6 = FUN_0043c328(param_1);
          uVar4 = (undefined2)uVar6;
          uVar5 = extraout_var;
        }
        FUN_0043c79c(param_1,CONCAT22(uVar5,local_8),sVar11,uVar4);
      }
    }
    (**(code **)(*param_1 + 0x18))(param_1);
  }
  return;
}



/* @0043c604 file=? name=FUN_0043c604 */

void __cdecl FUN_0043c604(int *param_1)

{
  undefined1 local_24 [32];
  
  FUN_004d7f10(local_24,s_unexpected_byte__0x_02x_004ea91f);
  FUN_0043c978(param_1,local_24);
  return;
}



/* @0043c638 file=? name=FUN_0043c638 */

void __cdecl FUN_0043c638(int *param_1,short param_2)

{
  undefined2 uVar1;
  char *pcVar2;
  int iVar3;
  undefined4 uVar4;
  undefined2 extraout_var;
  
  uVar1 = FUN_0043c9ac((int)param_1);
  pcVar2 = (char *)FUN_0043c9a0((int)param_1);
  iVar3 = (int)param_2;
  if (iVar3 < 0x55) {
    if (iVar3 == 0x54) {
      (**(code **)(*param_1 + 0x50))
                (param_1,(int)*pcVar2,(int)pcVar2[1],(int)pcVar2[2],(int)pcVar2[3],(int)pcVar2[4]);
      return;
    }
    if (iVar3 == 0) {
      uVar4 = FUN_0043c8ec(param_1,(short)*pcVar2,(short)pcVar2[1]);
      (**(code **)(*param_1 + 0x4c))(param_1,uVar4);
      return;
    }
    if (iVar3 - 1U < 0xf) {
      (**(code **)(*param_1 + 100))(param_1,CONCAT22(extraout_var,param_2),uVar1,pcVar2);
      return;
    }
    if (iVar3 == 0x2f) {
      (**(code **)(*param_1 + 0x1c))(param_1);
      return;
    }
    if (iVar3 == 0x51) {
      iVar3 = FUN_0043c8b0(param_1,0,(short)*pcVar2,(short)pcVar2[1],(short)pcVar2[2]);
      (**(code **)(*param_1 + 0x58))(param_1,iVar3);
      return;
    }
  }
  else {
    if (iVar3 == 0x58) {
      (**(code **)(*param_1 + 0x54))
                (param_1,(int)*pcVar2,(int)pcVar2[1],(int)pcVar2[2],(int)pcVar2[3]);
      return;
    }
    if (iVar3 == 0x59) {
      (**(code **)(*param_1 + 0x5c))(param_1,(int)*pcVar2,(int)pcVar2[1]);
      return;
    }
    if (iVar3 == 0x7f) {
      (**(code **)(*param_1 + 0x60))(param_1,uVar1,pcVar2);
      return;
    }
  }
  (**(code **)(*param_1 + 0x48))(param_1,param_2,uVar1,pcVar2);
  return;
}



/* @0043c778 file=? name=FUN_0043c778 */

void __cdecl FUN_0043c778(int *param_1)

{
  undefined2 uVar1;
  undefined4 uVar2;
  
  uVar2 = FUN_0043c9a0((int)param_1);
  uVar1 = FUN_0043c9ac((int)param_1);
  (**(code **)(*param_1 + 0x40))(param_1,uVar1,uVar2);
  return;
}



/* @0043c79c file=? name=FUN_0043c79c */

void __cdecl FUN_0043c79c(int *param_1,uint param_2,undefined2 param_3,undefined2 param_4)

{
  ushort uVar1;
  uint uVar2;
  
  uVar2 = param_2 & 0xffff000f;
  uVar1 = (ushort)param_2 & 0xf0;
  if (0xb0 < uVar1) {
    if (uVar1 == 0xc0) {
      (**(code **)(*param_1 + 0x38))(param_1,uVar2,param_3);
      return;
    }
    if (uVar1 != 0xd0) {
      if (uVar1 != 0xe0) {
        return;
      }
      (**(code **)(*param_1 + 0x34))(param_1,uVar2,param_3,param_4);
      return;
    }
    (**(code **)(*param_1 + 0x3c))(param_1,uVar2,param_3);
    return;
  }
  if (uVar1 == 0xb0) {
    (**(code **)(*param_1 + 0x30))(param_1,uVar2,param_3,param_4);
    return;
  }
  if (uVar1 != 0x80) {
    if (uVar1 == 0x90) {
      (**(code **)(*param_1 + 0x24))(param_1,uVar2,param_3,param_4);
      return;
    }
    if (uVar1 != 0xa0) {
      return;
    }
    (**(code **)(*param_1 + 0x2c))(param_1,uVar2,param_3,param_4);
    return;
  }
  (**(code **)(*param_1 + 0x28))(param_1,uVar2,param_3,param_4);
  return;
}



/* @0043c878 file=? name=FUN_0043c878 */

uint __cdecl FUN_0043c878(int *param_1)

{
  uint uVar1;
  uint uVar2;
  
  uVar1 = FUN_0043c328(param_1);
  uVar2 = (uint)(short)uVar1;
  if ((uVar1 & 0x80) != 0) {
    uVar2 = uVar2 & 0x7f;
    do {
      uVar1 = FUN_0043c328(param_1);
      uVar2 = uVar2 * 0x80 + ((int)(short)uVar1 & 0x7fU);
    } while ((uVar1 & 0x80) != 0);
  }
  return uVar2;
}



/* @0043c8b0 file=? name=FUN_0043c8b0 */

int __cdecl FUN_0043c8b0(undefined4 param_1,short param_2,short param_3,short param_4,short param_5)

{
  return ((((int)param_2 & 0xffU) * 0x100 + ((int)param_3 & 0xffU)) * 0x100 + ((int)param_4 & 0xffU)
         ) * 0x100 + ((int)param_5 & 0xffU);
}



/* @0043c8ec file=? name=FUN_0043c8ec */

undefined4 __cdecl FUN_0043c8ec(undefined4 param_1,undefined2 param_2,ushort param_3)

{
  undefined4 in_EAX;
  uint uVar1;
  
  uVar1 = CONCAT22((short)((uint)in_EAX >> 0x10),param_2) & 0xffff00ff;
  return CONCAT22((short)(uVar1 >> 8),(short)(uVar1 << 8) + (param_3 & 0xff));
}



/* @0043c908 file=? name=FUN_0043c908 */

void __cdecl FUN_0043c908(int *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  
  uVar1 = FUN_0043c328(param_1);
  uVar2 = FUN_0043c328(param_1);
  uVar3 = FUN_0043c328(param_1);
  uVar4 = FUN_0043c328(param_1);
  FUN_0043c8b0(param_1,(short)uVar1,(short)uVar2,(short)uVar3,(short)uVar4);
  return;
}



/* @0043c950 file=? name=FUN_0043c950 */

void __cdecl FUN_0043c950(int *param_1)

{
  undefined4 uVar1;
  undefined4 uVar2;
  
  uVar1 = FUN_0043c328(param_1);
  uVar2 = FUN_0043c328(param_1);
  FUN_0043c8ec(param_1,(short)uVar1,(ushort)uVar2);
  return;
}



/* @0043c978 file=? name=FUN_0043c978 */

void __cdecl FUN_0043c978(int *param_1,undefined4 param_2)

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



/* @0043c990 file=? name=FUN_0043c990 */

void __cdecl FUN_0043c990(int param_1)

{
  *(undefined2 *)(param_1 + 0x22) = 0;
  return;
}



/* @0043c9a0 file=? name=FUN_0043c9a0 */

undefined4 __cdecl FUN_0043c9a0(int param_1)

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



/* @0043c9ac file=? name=FUN_0043c9ac */

undefined2 __cdecl FUN_0043c9ac(int param_1)

{
  return *(undefined2 *)(param_1 + 0x22);
}



/* @0043c9b8 file=? name=FUN_0043c9b8 */

void __cdecl FUN_0043c9b8(int param_1,undefined1 param_2)

{
  short sVar1;
  
  if (*(short *)(param_1 + 0x20) <= *(short *)(param_1 + 0x22)) {
    FUN_0043c9e8(param_1);
  }
  sVar1 = *(short *)(param_1 + 0x22);
  *(short *)(param_1 + 0x22) = *(short *)(param_1 + 0x22) + 1;
  *(undefined1 *)(*(int *)(param_1 + 0x1c) + (int)sVar1) = param_2;
  return;
}



/* @0043c9e8 file=? name=FUN_0043c9e8 */

void __cdecl FUN_0043c9e8(int param_1)

{
  short sVar1;
  int *piVar2;
  undefined1 *puVar3;
  int *piVar4;
  undefined1 *puVar5;
  
  sVar1 = *(short *)(param_1 + 0x20);
  piVar2 = *(int **)(param_1 + 0x1c);
  *(short *)(param_1 + 0x20) = *(short *)(param_1 + 0x20) + 0x80;
  puVar3 = (undefined1 *)FUN_004022b0((int)*(short *)(param_1 + 0x20));
  if (piVar2 != (int *)0x0) {
    puVar5 = puVar3;
    for (piVar4 = piVar2; piVar4 != (int *)((int)sVar1 + (int)piVar2);
        piVar4 = (int *)((int)piVar4 + 1)) {
      *puVar5 = (char)*piVar4;
      puVar5 = puVar5 + 1;
    }
    FUN_004022e8(piVar2);
  }
  *(undefined1 **)(param_1 + 0x1c) = puVar3;
  return;
}



/* @0043ca48 file=munga/audmidi.cpp name=FUN_0043ca48 */

undefined4 FUN_0043ca48(void)

{
  FUN_0040385c(s_MidiParse__Mf_getc___Should_neve_004ea937,s_d__tesla_bt_munga_AUDMIDI_CPP_004ea964,
               0x2b6);
  return 0;
}



/* @0043ca68 file=munga/audmidi.cpp name=FUN_0043ca68 */

void FUN_0043ca68(void)

{
  FUN_0040385c(s_MidiParse__Mf_error___Should_nev_004ea982,s_d__tesla_bt_munga_AUDMIDI_CPP_004ea9b0,
               0x2c1);
  return;
}



/* @0043ca84 file=? name=FUN_0043ca84 */

void FUN_0043ca84(void)

{
  return;
}



/* @0043ca89 file=? name=FUN_0043ca89 */

void FUN_0043ca89(void)

{
  return;
}



/* @0043ca8e file=? name=FUN_0043ca8e */

void FUN_0043ca8e(void)

{
  return;
}



/* @0043ca93 file=? name=FUN_0043ca93 */

void FUN_0043ca93(void)

{
  return;
}



/* @0043ca98 file=? name=FUN_0043ca98 */

void FUN_0043ca98(void)

{
  return;
}



/* @0043ca9d file=? name=FUN_0043ca9d */

void FUN_0043ca9d(void)

{
  return;
}



/* @0043caa2 file=? name=FUN_0043caa2 */

void FUN_0043caa2(void)

{
  return;
}



/* @0043caa7 file=? name=FUN_0043caa7 */

void FUN_0043caa7(void)

{
  return;
}



/* @0043caac file=? name=FUN_0043caac */

void FUN_0043caac(void)

{
  return;
}



/* @0043cab1 file=? name=FUN_0043cab1 */

void FUN_0043cab1(void)

{
  return;
}



/* @0043cab6 file=? name=FUN_0043cab6 */

void FUN_0043cab6(void)

{
  return;
}



/* @0043cabb file=? name=FUN_0043cabb */

void FUN_0043cabb(void)

{
  return;
}



/* @0043cac0 file=? name=FUN_0043cac0 */

void FUN_0043cac0(void)

{
  return;
}



/* @0043cac5 file=? name=FUN_0043cac5 */

void FUN_0043cac5(void)

{
  return;
}



/* @0043caca file=? name=FUN_0043caca */

void FUN_0043caca(void)

{
  return;
}



/* @0043cacf file=? name=FUN_0043cacf */

void FUN_0043cacf(void)

{
  return;
}



/* @0043cad4 file=? name=FUN_0043cad4 */

void FUN_0043cad4(void)

{
  return;
}



/* @0043cad9 file=? name=FUN_0043cad9 */

void FUN_0043cad9(void)

{
  return;
}



/* @0043cade file=? name=FUN_0043cade */

void FUN_0043cade(void)

{
  return;
}



/* @0043cae3 file=? name=FUN_0043cae3 */

void FUN_0043cae3(void)

{
  return;
}



/* @0043cae8 file=? name=FUN_0043cae8 */

void FUN_0043cae8(void)

{
  return;
}



/* @0043caf0 file=? name=FUN_0043caf0 */

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

{
  FUN_00415e90(param_1,0x4a);
  *param_1 = &PTR_FUN_004ead64;
  param_1[3] = param_2;
  param_1[4] = param_3;
  param_1[5] = param_4;
  return param_1;
}



/* @0043cb20 file=? name=FUN_0043cb20 */

undefined4 * __cdecl FUN_0043cb20(undefined4 *param_1)

{
  FUN_00415e90(param_1,0x4a);
  *param_1 = &PTR_FUN_004ead64;
  param_1[3] = 0;
  param_1[4] = 0;
  param_1[5] = 0;
  return param_1;
}



/* @0043cb4c file=? name=FUN_0043cb4c */

void __cdecl FUN_0043cb4c(int *param_1,byte param_2)

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



/* @0043cb78 file=? name=FUN_0043cb78 */

undefined4 FUN_0043cb78(void)

{
  FUN_00415f1c();
  return 1;
}



/* @0043cb8c file=? name=FUN_0043cb8c */

void __cdecl FUN_0043cb8c(int param_1,int *param_2)

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



/* @0043cba8 file=? name=FUN_0043cba8 */

undefined4 __cdecl FUN_0043cba8(int param_1,int *param_2)

{
  if (*(int *)(param_1 + 0x10) == 1) {
    return 0;
  }
  if (*(int *)(param_1 + 0x10) != 2) {
    return 1;
  }
  FUN_0043cb8c(param_1,param_2);
  return 0;
}



/* @0043cbd8 file=? name=FUN_0043cbd8 */

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

{
  (**(code **)(*param_1 + 0x1c))(param_1,param_2 + 0xc,4);
  (**(code **)(*param_1 + 0x1c))(param_1,param_2 + 0x10,4);
  (**(code **)(*param_1 + 0x1c))(param_1,param_2 + 0x14,4);
  return param_1;
}



/* @0043cc1c file=? name=FUN_0043cc1c */

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

{
  (**(code **)(*param_1 + 0x20))(param_1,param_2 + 0xc,4);
  (**(code **)(*param_1 + 0x20))(param_1,param_2 + 0x10,4);
  (**(code **)(*param_1 + 0x20))(param_1,param_2 + 0x14,4);
  return param_1;
}



/* @0043cc60 file=? name=FUN_0043cc60 */

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

{
  int *piVar1;
  
  FUN_004dbb24(param_1,&DAT_004eaa38,(char *)0x0);
  piVar1 = FUN_004db78c(param_1,*(uint *)(param_2 + 0xc));
  FUN_004dbb24(piVar1,&DAT_004eaa3a,(char *)0x0);
  piVar1 = FUN_004db78c(param_1,*(uint *)(param_2 + 0x10));
  FUN_004dbb24(piVar1,&DAT_004eaa3c,(char *)0x0);
  FUN_004db634(param_1,(float10)*(float *)(param_2 + 0x14));
  FUN_004dbb24(param_1,&DAT_004eaa3e,(char *)0x0);
  return param_1;
}



/* @0043ccec file=? name=FUN_0043ccec */

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

{
  undefined4 *puVar1;
  undefined4 local_20;
  undefined4 local_1c;
  int local_18;
  int local_14;
  int local_10;
  undefined4 local_c;
  undefined1 local_8 [4];
  
  FUN_00436d14(param_1,param_2,&DAT_004e8698);
  *param_1 = &PTR_FUN_004ead48;
  param_1[0xb] = 0xffffffff;
  FUN_0043acac(param_1 + 0xe,0);
  FUN_0043d7c1(param_1 + 0x11,0);
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_c,4);
  FUN_0043afbc(param_2,&local_10);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_1c,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_20,4);
  (**(code **)(*param_2 + 0x1c))(param_2,&local_18,4);
  local_14 = 0;
  if (0 < local_18) {
    do {
      puVar1 = (undefined4 *)FUN_00402298(0x18);
      if (puVar1 == (undefined4 *)0x0) {
        puVar1 = (undefined4 *)0x0;
      }
      else {
        puVar1 = FUN_0043cb20(puVar1);
      }
      FUN_0043cbd8(param_2,(int)puVar1);
      (**(code **)(param_1[0x11] + 4))(param_1 + 0x11,puVar1);
      local_14 = local_14 + 1;
    } while (local_14 < local_18);
  }
  FUN_0043ce14((int)param_1,local_10,param_3,local_c,local_1c,local_20);
  return param_1;
}



/* @0043ce14 file=? name=FUN_0043ce14 */

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

{
  (**(code **)(*(int *)(param_1 + 0x38) + 4))(param_1 + 0x38,param_2);
  *(undefined4 *)(param_1 + 0x24) = param_4;
  *(undefined4 *)(param_1 + 0x28) = 0;
  *(undefined4 *)(param_1 + 0x2c) = DAT_00522b30;
  *(undefined4 *)(param_1 + 0x58) = 0;
  *(undefined4 *)(param_1 + 0x30) = param_5;
  *(undefined4 *)(param_1 + 0x34) = param_6;
  (**(code **)(*(int *)(param_2 + 0x14) + 4))(param_2 + 0x14,param_1);
  FUN_004206b4(param_3,param_1);
  return;
}



/* @0043ce78 file=? name=FUN_0043ce78 */

void __cdecl FUN_0043ce78(int *param_1,byte param_2)

{
  void *this;
  int local_18 [5];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ead48;
    FUN_0043d2d4((int)param_1);
    FUN_0043d80c(local_18,(int)(param_1 + 0x11));
    FUN_00417858(this,local_18,1);
    FUN_0043d869(local_18,2);
    FUN_0043d7e0(param_1 + 0x11,2);
    FUN_0043accb(param_1 + 0xe,2);
    FUN_00436d4c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043cef8 file=munga/audseq.cpp name=FUN_0043cef8 */

void __cdecl FUN_0043cef8(int *param_1,int param_2)

{
  char *pcVar1;
  uint *puVar2;
  int iVar3;
  undefined4 *puVar4;
  int *piVar5;
  int local_130 [11];
  undefined4 local_104;
  int local_100;
  int local_e4 [6];
  int local_cc [17];
  int local_88 [19];
  int local_3c [6];
  undefined4 local_24;
  undefined4 local_20;
  int *local_1c;
  int *local_18;
  int local_14;
  uint *local_10;
  int local_c;
  int local_8;
  
  FUN_00414c58(param_1);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_dump_value_004eaa40);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eaa4b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004eaa70,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eaa7b,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eaa7d,s_d__tesla_bt_munga_AUDSEQ_CPP_004eaabd
                 ,0x12e);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_is_looped_004eaada);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eaae4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_is_looped_004eab09,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eab13,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eab15,s_d__tesla_bt_munga_AUDSEQ_CPP_004eab55
                 ,0x12f);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  puVar2 = (uint *)FUN_00402298(0x10);
  if (puVar2 == (uint *)0x0) {
    local_10 = (uint *)0x0;
  }
  else {
    local_10 = FUN_00402460(puVar2,s_audio_component_004eab72);
  }
  local_10[3] = local_10[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_10);
  local_14 = 100;
  iVar3 = FUN_00403ad0(param_2,s_tempo_004eab82);
  if (iVar3 != 0) {
    piVar5 = &local_14;
    pcVar1 = (char *)FUN_00403ad0(param_2,s_tempo_004eab88);
    FUN_00407b30(pcVar1,piVar5);
  }
  FUN_0040328c(local_3c,0);
  puVar4 = (undefined4 *)FUN_00402298(0x10);
  if (puVar4 == (undefined4 *)0x0) {
    local_18 = (int *)0x0;
  }
  else {
    local_18 = (int *)FUN_004023f4(puVar4);
  }
  local_18[3] = local_18[3] + 1;
  pcVar1 = (char *)FUN_00403ad0(param_2,s_midi_file_004eab8e);
  FUN_00402a98((int *)&local_1c,(int *)&local_18,pcVar1);
  piVar5 = local_1c + 3;
  *piVar5 = *piVar5 + -1;
  if (*piVar5 == 0) {
    FUN_004024d8(local_1c,3);
  }
  FUN_004da66c(local_cc,0,(LPCSTR)local_18[2],0x81,DAT_00520540);
  FUN_00403164(local_3c,local_88);
  (**(code **)(local_3c[0] + 0xc))(local_3c,0);
  FUN_004da754(local_cc,2);
  piVar5 = local_18 + 3;
  *piVar5 = *piVar5 + -1;
  if (*piVar5 == 0) {
    FUN_004024d8(local_18,3);
  }
  FUN_0040328c(local_e4,0);
  FUN_0043d478(local_130);
  FUN_0043d53c(local_130,(int)local_3c,(int)local_e4,local_14);
  (**(code **)(local_e4[0] + 0xc))(local_e4,0);
  local_20 = local_104;
  local_14 = local_100;
  (**(code **)(*param_1 + 0x20))(param_1,&local_20,4);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  local_24 = FUN_0043d5a4((int)local_130);
  (**(code **)(*param_1 + 0x20))(param_1,&local_24,4);
  FUN_00403248(param_1,local_e4);
  FUN_0043d4bc(local_130,2);
  FUN_00403310(local_e4,2);
  FUN_00403310(local_3c,2);
  puVar2 = local_10 + 3;
  *puVar2 = *puVar2 - 1;
  if (*puVar2 == 0) {
    FUN_004024d8((int *)local_10,3);
  }
  return;
}



/* @0043d260 file=? name=FUN_0043d260 */

undefined4 __cdecl FUN_0043d260(int param_1)

{
  FUN_00436d88(param_1);
  return 1;
}



/* @0043d27c file=? name=FUN_0043d27c */

void __cdecl FUN_0043d27c(int param_1)

{
  undefined4 *puVar1;
  undefined4 local_8;
  
  if (*(int *)(param_1 + 0x28) != 0) {
    FUN_0043d2d4(param_1);
  }
  puVar1 = (undefined4 *)FUN_00402298(0x14);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_0043d80c(puVar1,param_1 + 0x44);
  }
  *(undefined4 **)(param_1 + 0x58) = puVar1;
  FUN_004373e8(&local_8);
  *(undefined4 *)(param_1 + 0x2c) = local_8;
  *(undefined4 *)(param_1 + 0x28) = 1;
  return;
}



/* @0043d2d4 file=? name=FUN_0043d2d4 */

void __cdecl FUN_0043d2d4(int param_1)

{
  undefined4 *puVar1;
  int *piVar2;
  int iVar3;
  
  if (*(int *)(param_1 + 0x28) != 0) {
    do {
      iVar3 = (**(code **)(**(int **)(param_1 + 0x58) + 0x28))(*(int **)(param_1 + 0x58));
      if (iVar3 == 0) break;
      piVar2 = (int *)FUN_00417ab4(param_1 + 0x38);
      iVar3 = FUN_0043cba8(iVar3,piVar2);
    } while (iVar3 != 0);
    puVar1 = *(undefined4 **)(param_1 + 0x58);
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    *(undefined4 *)(param_1 + 0x58) = 0;
    *(undefined4 *)(param_1 + 0x28) = 0;
  }
  return;
}



/* @0043d32c file=? name=FUN_0043d32c */

void __cdecl FUN_0043d32c(int param_1)

{
  bool bVar1;
  int iVar2;
  int *piVar3;
  undefined3 extraout_var;
  
  if (*(int *)(param_1 + 0x28) != 0) {
    iVar2 = (**(code **)(**(int **)(param_1 + 0x58) + 0x30))(*(int **)(param_1 + 0x58));
    while (iVar2 != 0) {
      bVar1 = FUN_0043d3ec(param_1,iVar2);
      if (CONCAT31(extraout_var,bVar1) == 0) break;
      piVar3 = (int *)FUN_00417ab4(param_1 + 0x38);
      FUN_0043cb8c(iVar2,piVar3);
      (**(code **)(**(int **)(param_1 + 0x58) + 0xc))(*(int **)(param_1 + 0x58));
      iVar2 = (**(code **)(**(int **)(param_1 + 0x58) + 0x30))(*(int **)(param_1 + 0x58));
    }
    if (iVar2 == 0) {
      FUN_0043d2d4(param_1);
      if (*(int *)(param_1 + 0x24) != 0) {
        FUN_0043d27c(param_1);
      }
    }
  }
  return;
}



/* @0043d3a4 file=? name=FUN_0043d3a4 */

void __cdecl FUN_0043d3a4(int param_1,int param_2)

{
  undefined4 uVar1;
  
  if (param_2 == 1) {
    FUN_0043d27c(param_1);
    return;
  }
  if (param_2 == 2) {
    FUN_0043d2d4(param_1);
    return;
  }
  if (param_2 == 9) {
    FUN_0043d32c(param_1);
    return;
  }
  if (param_2 == 0xc) {
    uVar1 = FUN_004dcd94();
    *(undefined4 *)(param_1 + 0x34) = uVar1;
  }
  return;
}



/* @0043d3ec file=? name=FUN_0043d3ec */

bool __cdecl FUN_0043d3ec(int param_1,int param_2)

{
  float10 fVar1;
  int local_14;
  int local_10;
  float local_c;
  int local_8;
  
  local_8 = *(int *)(param_1 + 0x2c);
  fVar1 = FUN_0043d444(param_1,param_2);
  local_c = (float)fVar1;
  local_10 = FUN_00437404();
  local_8 = local_8 + local_10;
  FUN_004373e8(&local_14);
  return local_8 <= local_14;
}



/* @0043d444 file=? name=FUN_0043d444 */

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

float10 __cdecl FUN_0043d444(int param_1,int param_2)

{
  return (float10)*(int *)(param_2 + 0xc) /
         (float10)(float)(_DAT_0043d46c *
                         (float10)*(int *)(param_1 + 0x34) * (float10)*(int *)(param_1 + 0x30));
}



/* @0043d478 file=? name=FUN_0043d478 */

undefined4 * __cdecl FUN_0043d478(undefined4 *param_1)

{
  FUN_0043c170(param_1);
  *param_1 = &PTR_FUN_004eace0;
  FUN_0043d895(param_1 + 0xd,0,0);
  param_1[9] = 0;
  param_1[10] = 0;
  param_1[0xb] = 0x78;
  param_1[0xc] = 100;
  return param_1;
}



/* @0043d4bc file=? name=FUN_0043d4bc */

void __cdecl FUN_0043d4bc(int *param_1,byte param_2)

{
  void *this;
  int local_18 [5];
  
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004eace0;
    FUN_0043d9da(local_18,(int)(param_1 + 0xd));
    FUN_00417858(this,local_18,1);
    FUN_0043da37(local_18,2);
    FUN_0043d8b8(param_1 + 0xd,2);
    FUN_0043c1b4(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043d528 file=? name=FUN_0043d528 */

undefined4 FUN_0043d528(void)

{
  FUN_0043c1f4();
  return 1;
}



/* @0043d53c file=? name=FUN_0043d53c */

void __cdecl FUN_0043d53c(int *param_1,int param_2,int param_3,int param_4)

{
  int iVar1;
  int local_18 [5];
  
  param_1[9] = param_2;
  param_1[10] = param_3;
  param_1[0xc] = param_4;
  FUN_0043c214(param_1);
  FUN_0043d9da(local_18,(int)(param_1 + 0xd));
  while( true ) {
    iVar1 = (**(code **)(local_18[0] + 0x28))(local_18);
    if (iVar1 == 0) break;
    FUN_0043cc1c((int *)param_1[10],iVar1);
  }
  FUN_0043da37(local_18,2);
  return;
}



/* @0043d5a4 file=? name=FUN_0043d5a4 */

undefined4 __cdecl FUN_0043d5a4(int param_1)

{
  undefined4 uVar1;
  int local_18 [5];
  
  FUN_0043d9da(local_18,param_1 + 0x34);
  uVar1 = (**(code **)(local_18[0] + 0x14))(local_18);
  FUN_0043da37(local_18,2);
  return uVar1;
}



/* @0043d5dc file=? name=FUN_0043d5dc */

uint __cdecl FUN_0043d5dc(int param_1)

{
  byte local_5;
  
  (**(code **)(**(int **)(param_1 + 0x24) + 0x1c))(*(int **)(param_1 + 0x24),&local_5,1);
  return (uint)local_5;
}



/* @0043d600 file=munga/audseq.cpp name=FUN_0043d600 */

void __cdecl FUN_0043d600(undefined4 param_1,char *param_2)

{
  FUN_0040385c(param_2,s_d__tesla_bt_munga_AUDSEQ_CPP_004eab98,0x2db);
  return;
}



/* @0043d61c file=? name=FUN_0043d61c */

void __cdecl FUN_0043d61c(int param_1,undefined4 param_2,undefined4 param_3,short param_4)

{
  *(int *)(param_1 + 0x2c) = (int)param_4;
  return;
}



/* @0043d62c file=? name=FUN_0043d62c */

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

void __cdecl FUN_0043d62c(int *param_1,undefined2 param_2,short param_3,undefined4 param_4)

{
  undefined4 *puVar1;
  undefined4 local_8;
  
  if ((short)param_4 == 0) {
    (**(code **)(*param_1 + 0x28))(param_1,param_2,param_3,param_4);
  }
  else {
    local_8 = FUN_0043c208((int)param_1);
    puVar1 = (undefined4 *)FUN_00402298(0x18);
    if (puVar1 == (undefined4 *)0x0) {
      puVar1 = (undefined4 *)0x0;
    }
    else {
      puVar1 = FUN_0043caf0(puVar1,local_8,8,(float)param_3);
    }
    (**(code **)(param_1[0xd] + 8))(param_1 + 0xd,puVar1,&local_8);
    puVar1 = (undefined4 *)FUN_00402298(0x18);
    if (puVar1 == (undefined4 *)0x0) {
      puVar1 = (undefined4 *)0x0;
    }
    else {
      puVar1 = FUN_0043caf0(puVar1,local_8,6,(float)(_DAT_0043d724 * (float10)(short)param_4));
    }
    (**(code **)(param_1[0xd] + 8))(param_1 + 0xd,puVar1,&local_8);
    puVar1 = (undefined4 *)FUN_00402298(0x18);
    if (puVar1 == (undefined4 *)0x0) {
      puVar1 = (undefined4 *)0x0;
    }
    else {
      puVar1 = FUN_0043caf0(puVar1,local_8,1,0);
    }
    (**(code **)(param_1[0xd] + 8))(param_1 + 0xd,puVar1,&local_8);
  }
  return;
}



/* @0043d7bc file=? name=FUN_0043d7bc */

void FUN_0043d7bc(void)

{
  return;
}



/* @0043d7c1 file=? name=FUN_0043d7c1 */

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

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



/* @0043d7e0 file=? name=FUN_0043d7e0 */

void __cdecl FUN_0043d7e0(int *param_1,byte param_2)

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



/* @0043d80c file=? name=FUN_0043d80c */

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

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



/* @0043d82b file=? name=FUN_0043d82b */

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

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



/* @0043d84a file=? name=FUN_0043d84a */

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

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



/* @0043d869 file=? name=FUN_0043d869 */

void __cdecl FUN_0043d869(int *param_1,byte param_2)

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



/* @0043d895 file=? name=FUN_0043d895 */

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

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



/* @0043d8b8 file=? name=FUN_0043d8b8 */

void __cdecl FUN_0043d8b8(int *param_1,byte param_2)

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



/* @0043d8e4 file=? name=FUN_0043d8e4 */

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

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



/* @0043d913 file=? name=FUN_0043d913 */

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

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



/* @0043d93f file=? name=FUN_0043d93f */

void FUN_0043d93f(void)

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



/* @0043d98f file=? name=FUN_0043d98f */

void __cdecl FUN_0043d98f(undefined4 *param_1)

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



/* @0043d9da file=? name=FUN_0043d9da */

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

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



/* @0043d9f9 file=? name=FUN_0043d9f9 */

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

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



/* @0043da18 file=? name=FUN_0043da18 */

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

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



/* @0043da37 file=? name=FUN_0043da37 */

void __cdecl FUN_0043da37(int *param_1,byte param_2)

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



/* @0043da63 file=? name=FUN_0043da63 */

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

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



/* @0043da93 file=? name=FUN_0043da93 */

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

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



/* @0043dabe file=? name=FUN_0043dabe */

void __cdecl FUN_0043dabe(int *param_1,byte param_2)

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



/* @0043daea file=? name=FUN_0043daea */

void FUN_0043daea(void)

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



/* @0043db3a file=? name=FUN_0043db3a */

void __cdecl FUN_0043db3a(undefined4 *param_1)

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



/* @0043db88 file=? name=FUN_0043db88 */

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

{
  int local_8;
  
  FUN_0041b868(param_1,param_2,&DAT_004e32ac);
  *param_1 = &PTR_FUN_004edad8;
  FUN_0043acac(param_1 + 4,param_1);
  FUN_0043afbc(param_2,&local_8);
  FUN_0043dbdc((int)param_1,local_8,param_3);
  return param_1;
}



/* @0043dbdc file=? name=FUN_0043dbdc */

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

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



/* @0043dc14 file=? name=FUN_0043dc14 */

void __cdecl FUN_0043dc14(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edad8;
    FUN_0043accb(param_1 + 4,2);
    FUN_0041b898(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043dc50 file=? name=FUN_0043dc50 */

void __cdecl FUN_0043dc50(int *param_1,int param_2)

{
  uint *puVar1;
  uint *local_8;
  
  FUN_00414c58(param_1);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004ead74);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043dcc0 file=? name=FUN_0043dcc0 */

undefined4 __cdecl FUN_0043dcc0(int param_1)

{
  FUN_0041b8e0(param_1);
  return 1;
}



/* @0043dcd4 file=? name=FUN_0043dcd4 */

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

{
  if (param_2 == param_1 + 4) {
    if (param_1 != (undefined4 *)0x0) {
      (**(code **)*param_1)(param_1,3);
      return;
    }
  }
  else {
    FUN_00417938();
  }
  return;
}



/* @0043dd04 file=? name=FUN_0043dd04 */

void __cdecl FUN_0043dd04(int param_1)

{
  int *piVar1;
  
  piVar1 = (int *)FUN_00417ab4(param_1 + 0x10);
  (**(code **)(*piVar1 + 0x18))(piVar1,9,0);
  return;
}



/* @0043dd24 file=? name=FUN_0043dd24 */

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

{
  FUN_0043ebd0(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004edab4;
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x18,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x19,4);
  FUN_0043f316(param_1);
  return param_1;
}



/* @0043dd74 file=? name=FUN_0043dd74 */

void __cdecl FUN_0043dd74(int *param_1,byte param_2)

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



/* @0043dda0 file=munga/audwthr.cpp name=FUN_0043dda0 */

void __cdecl FUN_0043dda0(int *param_1,int param_2)

{
  char *pcVar1;
  int local_c;
  int local_8;
  
  FUN_0043eca7(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_motion_type_004ead84);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ead90,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_motion_type_004eadb5,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eadc1,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eadc3,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eae03,0xbb);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_motion_value_004eae21);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eae2e,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_motion_value_004eae53,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eae60,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eae62,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eaea2,0xbc);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  return;
}



/* @0043ded4 file=munga/audwthr.cpp name=FUN_0043ded4 */

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

float10 __cdecl FUN_0043ded4(int param_1,float *param_2)

{
  int iVar1;
  float10 fVar2;
  
  if (*(int *)(param_1 + 0x60) == 0) {
    iVar1 = *(int *)(param_1 + 100);
    if (iVar1 == 0) {
      return (float10)*param_2;
    }
    if (iVar1 == 1) {
      return (float10)param_2[1];
    }
    if (iVar1 == 2) {
      return (float10)param_2[2];
    }
    if (iVar1 == 3) {
      fVar2 = FUN_004dd138((double)(param_2[2] * param_2[2] +
                                   param_2[1] * param_2[1] + *param_2 * *param_2));
      return fVar2;
    }
  }
  else if (*(int *)(param_1 + 0x60) == 1) {
    iVar1 = *(int *)(param_1 + 100);
    if (iVar1 == 0) {
      return (float10)param_2[3];
    }
    if (iVar1 == 1) {
      return (float10)param_2[4];
    }
    if (iVar1 == 2) {
      return (float10)param_2[5];
    }
    if (iVar1 == 3) {
      fVar2 = FUN_004dd138((double)(param_2[5] * param_2[5] +
                                   param_2[4] * param_2[4] + param_2[3] * param_2[3]));
      return fVar2;
    }
  }
  FUN_0040385c(s_AudioMotionTrigger__ExtractInter_004eaec0,s_d__tesla_bt_munga_AUDWTHR_CPP_004eaf06,
               0xe8);
  return (float10)_DAT_0043dfc8;
}



/* @0043e004 file=? name=FUN_0043e004 */

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

{
  FUN_0043f38c(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004eda90;
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x17,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x18,4);
  FUN_0043f316(param_1);
  return param_1;
}



/* @0043e054 file=? name=FUN_0043e054 */

void __cdecl FUN_0043e054(int *param_1,byte param_2)

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



/* @0043e080 file=munga/audwthr.cpp name=FUN_0043e080 */

void __cdecl FUN_0043e080(int *param_1,int param_2)

{
  char *pcVar1;
  int local_c;
  int local_8;
  
  FUN_0043f45d(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_motion_type_004eaf24);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eaf30,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_motion_type_004eaf55,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eaf61,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eaf63,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eafa3,0x150);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_motion_value_004eafc1);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eafce,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_motion_value_004eaff3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb000,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb002,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eb042,0x151);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  return;
}



/* @0043e1b4 file=munga/audwthr.cpp name=FUN_0043e1b4 */

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

float10 __cdecl FUN_0043e1b4(int param_1,float *param_2)

{
  int iVar1;
  float10 fVar2;
  
  if (*(int *)(param_1 + 0x5c) == 0) {
    iVar1 = *(int *)(param_1 + 0x60);
    if (iVar1 == 0) {
      return (float10)*param_2;
    }
    if (iVar1 == 1) {
      return (float10)param_2[1];
    }
    if (iVar1 == 2) {
      return (float10)param_2[2];
    }
    if (iVar1 == 3) {
      fVar2 = FUN_004dd138((double)(param_2[2] * param_2[2] +
                                   param_2[1] * param_2[1] + *param_2 * *param_2));
      return fVar2;
    }
  }
  else if (*(int *)(param_1 + 0x5c) == 1) {
    iVar1 = *(int *)(param_1 + 0x60);
    if (iVar1 == 0) {
      return (float10)param_2[3];
    }
    if (iVar1 == 1) {
      return (float10)param_2[4];
    }
    if (iVar1 == 2) {
      return (float10)param_2[5];
    }
    if (iVar1 == 3) {
      fVar2 = FUN_004dd138((double)(param_2[5] * param_2[5] +
                                   param_2[4] * param_2[4] + param_2[3] * param_2[3]));
      return fVar2;
    }
  }
  FUN_0040385c(s_AudioMotionScale__ExtractInteres_004eb060,s_d__tesla_bt_munga_AUDWTHR_CPP_004eb0a4,
               0x17d);
  return (float10)_DAT_0043e2a8;
}



/* @0043e2e4 file=? name=FUN_0043e2e4 */

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

{
  FUN_0043f8ab(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004eda6c;
  FUN_0044001b(param_1);
  return param_1;
}



/* @0043e310 file=? name=FUN_0043e310 */

void __cdecl FUN_0043e310(int *param_1,byte param_2)

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



/* @0043e33c file=? name=FUN_0043e33c */

float10 __cdecl FUN_0043e33c(undefined4 param_1,int param_2)

{
  return (float10)*(float *)(param_2 + 4);
}



/* @0043e348 file=? name=FUN_0043e348 */

void FUN_0043e348(void)

{
  return;
}



/* @0043e350 file=? name=FUN_0043e350 */

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

{
  FUN_0044009c(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004eda48;
  FUN_004407df(param_1);
  return param_1;
}



/* @0043e37c file=? name=FUN_0043e37c */

void __cdecl FUN_0043e37c(int *param_1,byte param_2)

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



/* @0043e3a8 file=? name=FUN_0043e3a8 */

void __cdecl FUN_0043e3a8(int *param_1,int param_2)

{
  FUN_00440173(param_1,param_2);
  return;
}



/* @0043e3c8 file=? name=FUN_0043e3c8 */

float10 __cdecl FUN_0043e3c8(undefined4 param_1,float *param_2)

{
  return (float10)*param_2;
}



/* @0043e3d4 file=? name=FUN_0043e3d4 */

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

{
  FUN_00440844(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004eda28;
  FUN_004407df(param_1);
  return param_1;
}



/* @0043e400 file=? name=FUN_0043e400 */

void __cdecl FUN_0043e400(int *param_1,byte param_2)

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



/* @0043e42c file=? name=FUN_0043e42c */

void __cdecl FUN_0043e42c(int *param_1,int param_2)

{
  FUN_004408e9(param_1,param_2);
  return;
}



/* @0043e44c file=? name=FUN_0043e44c */

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

{
  FUN_00440abc(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004eda04;
  FUN_004407df(param_1);
  return param_1;
}



/* @0043e478 file=? name=FUN_0043e478 */

void __cdecl FUN_0043e478(int *param_1,byte param_2)

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



/* @0043e4a4 file=? name=FUN_0043e4a4 */

float10 __cdecl FUN_0043e4a4(undefined4 param_1,float *param_2)

{
  return (float10)*param_2;
}



/* @0043e4b0 file=? name=FUN_0043e4b0 */

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

{
  FUN_00440fdb(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004ed9e0;
  FUN_004414d8(param_1);
  return param_1;
}



/* @0043e4dc file=? name=FUN_0043e4dc */

void __cdecl FUN_0043e4dc(int *param_1,byte param_2)

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



/* @0043e508 file=? name=FUN_0043e508 */

void __cdecl FUN_0043e508(int *param_1,int param_2)

{
  FUN_0044107a(param_1,param_2);
  return;
}



/* @0043e528 file=? name=FUN_0043e528 */

undefined4 __cdecl FUN_0043e528(undefined4 param_1,undefined4 *param_2)

{
  return *param_2;
}



/* @0043e534 file=? name=FUN_0043e534 */

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

{
  FUN_00440fdb(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004ed9bc;
  FUN_004414d8(param_1);
  return param_1;
}



/* @0043e560 file=? name=FUN_0043e560 */

void __cdecl FUN_0043e560(int *param_1,byte param_2)

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



/* @0043e58c file=? name=FUN_0043e58c */

void __cdecl FUN_0043e58c(int *param_1,int param_2)

{
  FUN_0044107a(param_1,param_2);
  return;
}



/* @0043e5ac file=? name=FUN_0043e5ac */

undefined4 __cdecl FUN_0043e5ac(undefined4 param_1,undefined4 *param_2)

{
  return *param_2;
}



/* @0043e5b8 file=? name=FUN_0043e5b8 */

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

{
  FUN_0044153c(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004ed99c;
  FUN_004414d8(param_1);
  return param_1;
}



/* @0043e5e4 file=? name=FUN_0043e5e4 */

void __cdecl FUN_0043e5e4(int *param_1,byte param_2)

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



/* @0043e610 file=? name=FUN_0043e610 */

void __cdecl FUN_0043e610(int *param_1,int param_2)

{
  FUN_004415e1(param_1,param_2);
  return;
}



/* @0043e630 file=? name=FUN_0043e630 */

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

{
  FUN_0044179a(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004ed978;
  FUN_004414d8(param_1);
  return param_1;
}



/* @0043e65c file=? name=FUN_0043e65c */

void __cdecl FUN_0043e65c(int *param_1,byte param_2)

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



/* @0043e688 file=? name=FUN_0043e688 */

void __cdecl FUN_0043e688(int *param_1,int param_2)

{
  FUN_00441871(param_1,param_2);
  return;
}



/* @0043e6a8 file=? name=FUN_0043e6a8 */

float10 __cdecl FUN_0043e6a8(undefined4 param_1,int *param_2)

{
  return (float10)*param_2;
}



/* @0043e6b4 file=? name=FUN_0043e6b4 */

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

{
  FUN_0044179a(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004ed954;
  FUN_004414d8(param_1);
  return param_1;
}



/* @0043e6e0 file=? name=FUN_0043e6e0 */

void __cdecl FUN_0043e6e0(int *param_1,byte param_2)

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



/* @0043e70c file=? name=FUN_0043e70c */

void __cdecl FUN_0043e70c(int *param_1,int param_2)

{
  FUN_00441871(param_1,param_2);
  return;
}



/* @0043e72c file=? name=FUN_0043e72c */

float10 __cdecl FUN_0043e72c(undefined4 param_1,int *param_2)

{
  return (float10)*param_2;
}



/* @0043e738 file=? name=FUN_0043e738 */

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

{
  FUN_00441c8c(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed930;
  (**(code **)(*(int *)(param_1[5] + 0x18) + 4))(param_1[5] + 0x18,param_1);
  return param_1;
}



/* @0043e770 file=? name=FUN_0043e770 */

void __cdecl FUN_0043e770(int *param_1,byte param_2)

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



/* @0043e79c file=? name=FUN_0043e79c */

void __cdecl FUN_0043e79c(int *param_1)

{
  (**(code **)(*param_1 + 0x20))(param_1,param_1[0xc],param_1[0xd]);
  return;
}



/* @0043e7b8 file=munga/audwthr.cpp name=FUN_0043e7b8 */

void FUN_0043e7b8(void)

{
  FUN_0040385c(s_AudioStateWatcher__StateChanged___004eb0c2,s_d__tesla_bt_munga_AUDWTHR_CPP_004eb0fc
               ,0x3a9);
  return;
}



/* @0043e7d4 file=? name=FUN_0043e7d4 */

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

{
  FUN_0043e738(param_1,param_2,param_3);
  *param_1 = (int)&PTR_FUN_004ed90c;
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x20,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x21,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x22,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x23,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x24,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x25,4);
  FUN_00441ef5(param_1);
  return param_1;
}



/* @0043e878 file=? name=FUN_0043e878 */

void __cdecl FUN_0043e878(int *param_1,byte param_2)

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



/* @0043e8a4 file=munga/audwthr.cpp name=FUN_0043e8a4 */

/* WARNING: Type propagation algorithm not settling */

void __cdecl FUN_0043e8a4(int *param_1,int param_2)

{
  char *pcVar1;
  int iVar2;
  int *piVar3;
  int local_1c [2];
  float local_14;
  int local_10;
  int local_c;
  int local_8;
  
  FUN_00441d17(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_trigger_state_004eb11a);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb128,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_trigger_state_004eb14d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb15b,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb15d,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eb19d,0x3dd);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_inverse_trigger_004eb1bb);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb1cb,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_inverse_trigger_004eb1f0,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb200,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb202,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eb242,0x3de);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004eb260);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb26b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004eb290,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb29b,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb29d,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eb2dd,0x3df);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_004eb2fb);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb309,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_004eb32e,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb33c,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb33e,
                 s_d__tesla_bt_munga_AUDWTHR_CPP_004eb37e,0x3e0);
  }
  FUN_00407b78(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  local_1c[1] = 0;
  local_1c[0] = 0;
  iVar2 = FUN_00403ad0(param_2,s_exclude_state_004eb39c);
  if (iVar2 != 0) {
    local_1c[1] = 1;
    piVar3 = local_1c;
    pcVar1 = (char *)FUN_00403ad0(param_2,s_exclude_state_004eb3aa);
    FUN_00407ae0(pcVar1,piVar3);
  }
  (**(code **)(*param_1 + 0x20))(param_1,local_1c + 1,4);
  (**(code **)(*param_1 + 0x20))(param_1,local_1c,4);
  return;
}



/* @0043eb40 file=? name=FUN_0043eb40 */

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

{
  int *piVar1;
  
  if (((*(int *)(param_1 + 0x90) == 0) ||
      ((((*(int *)(param_1 + 0x84) != 0 || (param_3 != *(int *)(param_1 + 0x80))) ||
        (param_2 != *(int *)(param_1 + 0x94))) &&
       (((*(int *)(param_1 + 0x84) == 0 || (param_2 != *(int *)(param_1 + 0x80))) ||
        (param_3 != *(int *)(param_1 + 0x94))))))) &&
     (((*(int *)(param_1 + 0x84) == 0 && (param_3 == *(int *)(param_1 + 0x80))) ||
      ((*(int *)(param_1 + 0x84) != 0 && (param_2 == *(int *)(param_1 + 0x80))))))) {
    piVar1 = (int *)FUN_00417ab4(param_1 + 0x74);
    (**(code **)(*piVar1 + 0x18))
              (piVar1,*(undefined4 *)(param_1 + 0x88),*(undefined4 *)(param_1 + 0x8c));
  }
  return;
}



/* @0043ebd0 file=? name=FUN_0043ebd0 */

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

{
  FUN_0043f0c2(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed8e8;
  (**(code **)(*(int *)(param_1[4] + 0x80) + 4))(param_1[4] + 0x80,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x11,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x12,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x13,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x14,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x15,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x16,4);
  param_1[0x17] = 0;
  return param_1;
}



/* @0043ec7b file=? name=FUN_0043ec7b */

void __cdecl FUN_0043ec7b(int *param_1,byte param_2)

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



/* @0043eca7 file=munga/audwthr.hpp name=FUN_0043eca7 */

void __cdecl FUN_0043eca7(int *param_1,int param_2)

{
  char *pcVar1;
  float local_1c;
  float local_18;
  int local_14;
  int local_10;
  int local_c;
  float local_8;
  
  FUN_0043f14d(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_threshold_004eb3b8);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb3d2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_threshold_004eb3f7,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb411,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb413,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb453,0x16b);
  }
  FUN_00407b78(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_inverse_trigger_004eb471);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb481,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_inverse_trigger_004eb4a6,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb4b6,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb4b8,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb4f8,0x16e);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_on_004eb516);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb524,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_on_004eb549,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb557,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb559,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb599,0x171);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_off_004eb5b7);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb5c6,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_off_004eb5eb,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb5fa,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb5fc,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb63c,0x174);
  }
  FUN_00407ae0(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_on_004eb65a);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb66b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_on_004eb690,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb6a1,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb6a3,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb6e3,0x177);
  }
  FUN_00407b78(pcVar1,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_off_004eb701);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb713,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_off_004eb738,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb74a,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb74c,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb78c,0x17a);
  }
  FUN_00407b78(pcVar1,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  return;
}



/* @0043efed file=? name=FUN_0043efed */

void __cdecl FUN_0043efed(int *param_1)

{
  float fVar1;
  int *piVar2;
  float10 fVar3;
  
  fVar3 = (float10)(**(code **)(*param_1 + 0x20))(param_1,param_1 + 8);
  fVar1 = (float)fVar3;
  if (param_1[0x17] == 0) {
    if (((param_1[0x12] == 0) && ((float)param_1[0x11] < fVar1)) ||
       ((param_1[0x12] != 0 && (fVar1 < (float)param_1[0x11])))) {
      piVar2 = (int *)FUN_00417ab4((int)(param_1 + 0xe));
      (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0x13],param_1[0x15]);
      param_1[0x17] = 1;
    }
  }
  else if (((param_1[0x12] == 0) && (fVar1 <= (float)param_1[0x11])) ||
          ((param_1[0x12] != 0 && ((float)param_1[0x11] <= fVar1)))) {
    piVar2 = (int *)FUN_00417ab4((int)(param_1 + 0xe));
    (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0x14],param_1[0x16]);
    param_1[0x17] = 0;
  }
  return;
}



/* @0043f09a file=munga/audwthr.hpp name=FUN_0043f09a */

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

float10 FUN_0043f09a(void)

{
  FUN_0040385c(s_AudioTriggerOf<T>__ExtractIntere_004eb7aa,s_d__tesla_bt_munga_audwthr_hpp_004eb7ef,
               0x1bc);
  return (float10)_DAT_0043f0be;
}



/* @0043f0c2 file=? name=FUN_0043f0c2 */

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

{
  int local_8;
  
  FUN_0043f22c(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed8c8;
  FUN_0043acac(param_1 + 0xe,param_1);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(param_1[0xe] + 4))(param_1 + 0xe,local_8);
  return param_1;
}



/* @0043f113 file=? name=FUN_0043f113 */

void __cdecl FUN_0043f113(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ed8c8;
    FUN_0043accb(param_1 + 0xe,2);
    FUN_0043f200(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043f14d file=? name=FUN_0043f14d */

void __cdecl FUN_0043f14d(int *param_1,int param_2)

{
  uint *puVar1;
  uint *local_8;
  
  FUN_0043f26e(param_1,param_2);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004eb80d);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043f1bc file=? name=FUN_0043f1bc */

undefined4 __cdecl FUN_0043f1bc(int param_1)

{
  FUN_00428a2c(param_1);
  return 1;
}



/* @0043f1d0 file=? name=FUN_0043f1d0 */

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

{
  if (param_2 == param_1 + 0xe) {
    if (param_1 != (undefined4 *)0x0) {
      (**(code **)*param_1)(param_1,3);
      return;
    }
  }
  else {
    FUN_00417938();
  }
  return;
}



/* @0043f200 file=? name=FUN_0043f200 */

void __cdecl FUN_0043f200(int *param_1,byte param_2)

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



/* @0043f22c file=? name=FUN_0043f22c */

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

{
  undefined1 local_8 [4];
  
  FUN_00428678(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed8a8;
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  FUN_0043f34a((int)param_1);
  return param_1;
}



/* @0043f26e file=munga/watcher.hpp name=FUN_0043f26e */

void __cdecl FUN_0043f26e(int *param_1,int param_2)

{
  char *pcVar1;
  int local_8;
  
  FUN_0042887c(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_dump_value_004eb81d);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb828,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004eb84d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb858,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb85a,
                 s_d__tesla_bt_munga_watcher_hpp_004eb89a,0x108);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  return;
}



/* @0043f316 file=? name=FUN_0043f316 */

void __cdecl FUN_0043f316(int *param_1)

{
  FUN_0043f362(param_1);
  return;
}



/* @0043f325 file=? name=FUN_0043f325 */

void __cdecl FUN_0043f325(int *param_1)

{
  bool bVar1;
  undefined3 extraout_var;
  
  bVar1 = FUN_0040a824((byte *)(param_1 + 8),(byte *)param_1[5]);
  if (CONCAT31(extraout_var,bVar1) == 0) {
    FUN_0043f362(param_1);
  }
  return;
}



/* @0043f34a file=? name=FUN_0043f34a */

void __cdecl FUN_0043f34a(int param_1)

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



/* @0043f362 file=? name=FUN_0043f362 */

void __cdecl FUN_0043f362(int *param_1)

{
  FUN_0043f34a((int)param_1);
  param_1[6] = 1;
  if (param_1[7] != 0) {
    (**(code **)(*param_1 + 0x18))(param_1);
  }
  return;
}



/* @0043f387 file=? name=FUN_0043f387 */

void FUN_0043f387(void)

{
  return;
}



/* @0043f38c file=? name=FUN_0043f38c */

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

{
  int iVar1;
  
  FUN_0043f0c2(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed884;
  iVar1 = FUN_00417ab4((int)(param_1 + 0xe));
  (**(code **)(*(int *)(iVar1 + 0x14) + 4))(iVar1 + 0x14,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x11,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x12,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x13,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x14,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x15,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x16,4);
  return param_1;
}



/* @0043f431 file=? name=FUN_0043f431 */

void __cdecl FUN_0043f431(int *param_1,byte param_2)

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



/* @0043f45d file=munga/audwthr.hpp name=FUN_0043f45d */

void __cdecl FUN_0043f45d(int *param_1,int param_2)

{
  char *pcVar1;
  float local_1c;
  float local_18;
  float local_14;
  int local_10;
  float local_c;
  float local_8;
  
  FUN_0043f14d(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_boundary1_004eb8b8);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb8d2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_boundary1_004eb8f7,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb911,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb913,
                 s_d__tesla_bt_munga_audwthr_hpp_004eb953,0x237);
  }
  FUN_00407b78(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_boundary2_004eb971);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb98b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_boundary2_004eb9b0,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eb9ca,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eb9cc,
                 s_d__tesla_bt_munga_audwthr_hpp_004eba0c,0x23a);
  }
  FUN_00407b78(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004eba2a);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eba35,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004eba5a,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eba65,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eba67,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebaa7,0x23d);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_boundary1_004ebac5);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebadd,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_boundary1_004ebb02,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebb1a,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebb1c,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebb5c,0x240);
  }
  FUN_00407b78(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_boundary2_004ebb7a);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebb92,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_boundary2_004ebbb7,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebbcf,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebbd1,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebc11,0x243);
  }
  FUN_00407b78(pcVar1,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_exponent_004ebc2f);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebc38,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_exponent_004ebc5d,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebc66,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebc68,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebca8,0x246);
  }
  FUN_00407b78(pcVar1,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  return;
}



/* @0043f7a3 file=? name=FUN_0043f7a3 */

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

void __cdecl FUN_0043f7a3(int *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int *piVar4;
  float10 fVar5;
  
  fVar5 = (float10)(**(code **)(*param_1 + 0x20))(param_1);
  fVar1 = (float)fVar5;
  if ((float)param_1[0x12] <= (float)param_1[0x11]) {
    fVar2 = (float)param_1[0x12];
  }
  else {
    fVar2 = (float)param_1[0x11];
  }
  if ((float)param_1[0x11] <= (float)param_1[0x12]) {
    fVar3 = (float)param_1[0x12];
  }
  else {
    fVar3 = (float)param_1[0x11];
  }
  if ((fVar2 <= fVar1) && (fVar2 = fVar1, fVar3 < fVar1)) {
    fVar2 = fVar3;
  }
  if ((float)param_1[0x16] != _DAT_0043f87f) {
    FUN_004dce94((double)((fVar2 - (float)param_1[0x11]) /
                         ((float)param_1[0x12] - (float)param_1[0x11])),
                 SUB84((double)(float)param_1[0x16],0),
                 (uint)((ulonglong)(double)(float)param_1[0x16] >> 0x20));
  }
  piVar4 = (int *)FUN_00417ab4((int)(param_1 + 0xe));
  (**(code **)(*piVar4 + 0x18))();
  return;
}



/* @0043f8ab file=? name=FUN_0043f8ab */

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

{
  int iVar1;
  
  FUN_0043fdca(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed860;
  iVar1 = FUN_00417ab4((int)(param_1 + 10));
  (**(code **)(*(int *)(iVar1 + 0x14) + 4))(iVar1 + 0x14,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xf,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x11,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x12,4);
  return param_1;
}



/* @0043f950 file=? name=FUN_0043f950 */

void __cdecl FUN_0043f950(int *param_1,byte param_2)

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



/* @0043f97c file=munga/audwthr.hpp name=FUN_0043f97c */

void __cdecl FUN_0043f97c(int *param_1,int param_2)

{
  char *pcVar1;
  float local_1c;
  float local_18;
  float local_14;
  int local_10;
  float local_c;
  float local_8;
  
  FUN_0043fe55(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_boundary1_004ebd27);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebd41,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_boundary1_004ebd66,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebd80,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebd82,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebdc2,0x237);
  }
  FUN_00407b78(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_boundary2_004ebde0);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebdfa,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_boundary2_004ebe1f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebe39,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebe3b,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebe7b,0x23a);
  }
  FUN_00407b78(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004ebe99);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebea4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004ebec9,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebed4,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebed6,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebf16,0x23d);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_boundary1_004ebf34);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebf4c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_boundary1_004ebf71,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ebf89,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ebf8b,
                 s_d__tesla_bt_munga_audwthr_hpp_004ebfcb,0x240);
  }
  FUN_00407b78(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_boundary2_004ebfe9);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec001,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_boundary2_004ec026,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec03e,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec040,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec080,0x243);
  }
  FUN_00407b78(pcVar1,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_exponent_004ec09e);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec0a7,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_exponent_004ec0cc,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec0d5,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec0d7,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec117,0x246);
  }
  FUN_00407b78(pcVar1,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  return;
}



/* @0043fcc2 file=? name=FUN_0043fcc2 */

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

void __cdecl FUN_0043fcc2(int *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int *piVar4;
  float10 fVar5;
  
  fVar5 = (float10)(**(code **)(*param_1 + 0x20))(param_1);
  fVar1 = (float)fVar5;
  if ((float)param_1[0xe] <= (float)param_1[0xd]) {
    fVar2 = (float)param_1[0xe];
  }
  else {
    fVar2 = (float)param_1[0xd];
  }
  if ((float)param_1[0xd] <= (float)param_1[0xe]) {
    fVar3 = (float)param_1[0xe];
  }
  else {
    fVar3 = (float)param_1[0xd];
  }
  if ((fVar2 <= fVar1) && (fVar2 = fVar1, fVar3 < fVar1)) {
    fVar2 = fVar3;
  }
  if ((float)param_1[0x12] != _DAT_0043fd9e) {
    FUN_004dce94((double)((fVar2 - (float)param_1[0xd]) /
                         ((float)param_1[0xe] - (float)param_1[0xd])),
                 SUB84((double)(float)param_1[0x12],0),
                 (uint)((ulonglong)(double)(float)param_1[0x12] >> 0x20));
  }
  piVar4 = (int *)FUN_00417ab4((int)(param_1 + 10));
  (**(code **)(*piVar4 + 0x18))();
  return;
}



/* @0043fdca file=? name=FUN_0043fdca */

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

{
  int local_8;
  
  FUN_0043ff34(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed840;
  FUN_0043acac(param_1 + 10,param_1);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(param_1[10] + 4))(param_1 + 10,local_8);
  return param_1;
}



/* @0043fe1b file=? name=FUN_0043fe1b */

void __cdecl FUN_0043fe1b(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ed840;
    FUN_0043accb(param_1 + 10,2);
    FUN_0043ff08(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @0043fe55 file=? name=FUN_0043fe55 */

void __cdecl FUN_0043fe55(int *param_1,int param_2)

{
  uint *puVar1;
  uint *local_8;
  
  FUN_0043ff73(param_1,param_2);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004ec196);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @0043fec4 file=? name=FUN_0043fec4 */

undefined4 __cdecl FUN_0043fec4(int param_1)

{
  FUN_00428a2c(param_1);
  return 1;
}



/* @0043fed8 file=? name=FUN_0043fed8 */

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

{
  if (param_2 == param_1 + 10) {
    if (param_1 != (undefined4 *)0x0) {
      (**(code **)*param_1)(param_1,3);
      return;
    }
  }
  else {
    FUN_00417938();
  }
  return;
}



/* @0043ff08 file=? name=FUN_0043ff08 */

void __cdecl FUN_0043ff08(int *param_1,byte param_2)

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



/* @0043ff34 file=? name=FUN_0043ff34 */

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

{
  undefined1 local_8 [4];
  
  FUN_00428678(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed820;
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  FUN_00440056((int)param_1);
  return param_1;
}



/* @0043ff73 file=munga/watcher.hpp name=FUN_0043ff73 */

void __cdecl FUN_0043ff73(int *param_1,int param_2)

{
  char *pcVar1;
  int local_8;
  
  FUN_0042887c(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_dump_value_004ec1a6);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec1b1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004ec1d6,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec1e1,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec1e3,
                 s_d__tesla_bt_munga_watcher_hpp_004ec223,0x108);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  return;
}



/* @0044001b file=? name=FUN_0044001b */

void __cdecl FUN_0044001b(int *param_1)

{
  FUN_00440072(param_1);
  return;
}



/* @0044002a file=? name=FUN_0044002a */

void __cdecl FUN_0044002a(int *param_1)

{
  int iVar1;
  
  iVar1 = FUN_00408d78(param_1 + 8,(int *)param_1[5],0.0001);
  if (iVar1 == 0) {
    FUN_00440072(param_1);
  }
  return;
}



/* @00440056 file=? name=FUN_00440056 */

void __cdecl FUN_00440056(int param_1)

{
  *(undefined4 *)(param_1 + 0x20) = **(undefined4 **)(param_1 + 0x14);
  *(undefined4 *)(param_1 + 0x24) = (*(undefined4 **)(param_1 + 0x14))[1];
  return;
}



/* @00440072 file=? name=FUN_00440072 */

void __cdecl FUN_00440072(int *param_1)

{
  FUN_00440056((int)param_1);
  param_1[6] = 1;
  if (param_1[7] != 0) {
    (**(code **)(*param_1 + 0x18))(param_1);
  }
  return;
}



/* @00440097 file=? name=FUN_00440097 */

void FUN_00440097(void)

{
  return;
}



/* @0044009c file=? name=FUN_0044009c */

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

{
  FUN_0044058e(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed7fc;
  (**(code **)(*(int *)(param_1[4] + 0x80) + 4))(param_1[4] + 0x80,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xc,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xf,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x11,4);
  param_1[0x12] = 0;
  return param_1;
}



/* @00440147 file=? name=FUN_00440147 */

void __cdecl FUN_00440147(int *param_1,byte param_2)

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



/* @00440173 file=munga/audwthr.hpp name=FUN_00440173 */

void __cdecl FUN_00440173(int *param_1,int param_2)

{
  char *pcVar1;
  float local_1c;
  float local_18;
  int local_14;
  int local_10;
  int local_c;
  float local_8;
  
  FUN_00440619(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_threshold_004ec241);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec25b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_threshold_004ec280,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec29a,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec29c,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec2dc,0x16b);
  }
  FUN_00407b78(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_inverse_trigger_004ec2fa);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec30a,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_inverse_trigger_004ec32f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec33f,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec341,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec381,0x16e);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_on_004ec39f);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec3ad,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_on_004ec3d2,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec3e0,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec3e2,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec422,0x171);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_off_004ec440);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec44f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_off_004ec474,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec483,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec485,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec4c5,0x174);
  }
  FUN_00407ae0(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_on_004ec4e3);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec4f4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_on_004ec519,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec52a,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec52c,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec56c,0x177);
  }
  FUN_00407b78(pcVar1,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_off_004ec58a);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec59c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_off_004ec5c1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec5d3,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec5d5,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec615,0x17a);
  }
  FUN_00407b78(pcVar1,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  return;
}



/* @004404b9 file=? name=FUN_004404b9 */

void __cdecl FUN_004404b9(int *param_1)

{
  float fVar1;
  int *piVar2;
  float10 fVar3;
  
  fVar3 = (float10)(**(code **)(*param_1 + 0x20))(param_1,param_1 + 8);
  fVar1 = (float)fVar3;
  if (param_1[0x12] == 0) {
    if (((param_1[0xd] == 0) && ((float)param_1[0xc] < fVar1)) ||
       ((param_1[0xd] != 0 && (fVar1 < (float)param_1[0xc])))) {
      piVar2 = (int *)FUN_00417ab4((int)(param_1 + 9));
      (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0xe],param_1[0x10]);
      param_1[0x12] = 1;
    }
  }
  else if (((param_1[0xd] == 0) && (fVar1 <= (float)param_1[0xc])) ||
          ((param_1[0xd] != 0 && ((float)param_1[0xc] <= fVar1)))) {
    piVar2 = (int *)FUN_00417ab4((int)(param_1 + 9));
    (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0xf],param_1[0x11]);
    param_1[0x12] = 0;
  }
  return;
}



/* @00440566 file=munga/audwthr.hpp name=FUN_00440566 */

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

float10 FUN_00440566(void)

{
  FUN_0040385c(s_AudioTriggerOf<T>__ExtractIntere_004ec633,s_d__tesla_bt_munga_audwthr_hpp_004ec678,
               0x1bc);
  return (float10)_DAT_0044058a;
}



/* @0044058e file=? name=FUN_0044058e */

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

{
  int local_8;
  
  FUN_004406f8(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed7dc;
  FUN_0043acac(param_1 + 9,param_1);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(param_1[9] + 4))(param_1 + 9,local_8);
  return param_1;
}



/* @004405df file=? name=FUN_004405df */

void __cdecl FUN_004405df(int *param_1,byte param_2)

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



/* @00440619 file=? name=FUN_00440619 */

void __cdecl FUN_00440619(int *param_1,int param_2)

{
  uint *puVar1;
  uint *local_8;
  
  FUN_00440737(param_1,param_2);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004ec696);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00440688 file=? name=FUN_00440688 */

undefined4 __cdecl FUN_00440688(int param_1)

{
  FUN_00428a2c(param_1);
  return 1;
}



/* @0044069c file=? name=FUN_0044069c */

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

{
  if (param_2 == param_1 + 9) {
    if (param_1 != (undefined4 *)0x0) {
      (**(code **)*param_1)(param_1,3);
      return;
    }
  }
  else {
    FUN_00417938();
  }
  return;
}



/* @004406cc file=? name=FUN_004406cc */

void __cdecl FUN_004406cc(int *param_1,byte param_2)

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



/* @004406f8 file=? name=FUN_004406f8 */

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

{
  undefined1 local_8 [4];
  
  FUN_00428678(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed7bc;
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  FUN_0044080a((int)param_1);
  return param_1;
}



/* @00440737 file=munga/watcher.hpp name=FUN_00440737 */

void __cdecl FUN_00440737(int *param_1,int param_2)

{
  char *pcVar1;
  int local_8;
  
  FUN_0042887c(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_dump_value_004ec6a6);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec6b1,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004ec6d6,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec6e1,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec6e3,
                 s_d__tesla_bt_munga_watcher_hpp_004ec723,0x108);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  return;
}



/* @004407df file=? name=FUN_004407df */

void __cdecl FUN_004407df(int *param_1)

{
  FUN_0044081a(param_1);
  return;
}



/* @004407ee file=? name=FUN_004407ee */

void __cdecl FUN_004407ee(int *param_1)

{
  if ((float)param_1[8] != *(float *)param_1[5]) {
    FUN_0044081a(param_1);
  }
  return;
}



/* @0044080a file=? name=FUN_0044080a */

void __cdecl FUN_0044080a(int param_1)

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



/* @0044081a file=? name=FUN_0044081a */

void __cdecl FUN_0044081a(int *param_1)

{
  FUN_0044080a((int)param_1);
  param_1[6] = 1;
  if (param_1[7] != 0) {
    (**(code **)(*param_1 + 0x18))(param_1);
  }
  return;
}



/* @0044083f file=? name=FUN_0044083f */

void FUN_0044083f(void)

{
  return;
}



/* @00440844 file=? name=FUN_00440844 */

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

{
  FUN_0044058e(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed79c;
  (**(code **)(*(int *)(param_1[4] + 0x80) + 4))(param_1[4] + 0x80,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xf,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  param_1[0xc] = param_1[8];
  return param_1;
}



/* @004408bd file=? name=FUN_004408bd */

void __cdecl FUN_004408bd(int *param_1,byte param_2)

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



/* @004408e9 file=munga/audwthr.hpp name=FUN_004408e9 */

void __cdecl FUN_004408e9(int *param_1,int param_2)

{
  char *pcVar1;
  int iVar2;
  float *pfVar3;
  float local_10;
  float local_c;
  int local_8;
  
  FUN_00440619(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004ec741);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec74c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004ec771,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec77c,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec77e,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec7be,0x39d);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_004ec7dc);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec7ea,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_004ec80f,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec81d,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec81f,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec85f,0x3a0);
  }
  FUN_00407b78(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  local_10 = 0.0001;
  iVar2 = FUN_00403ad0(param_2,s_delta_trigger_004ec87d);
  if (iVar2 != 0) {
    pfVar3 = &local_10;
    pcVar1 = (char *)FUN_00403ad0(param_2,s_delta_trigger_004ec88b);
    FUN_00407b78(pcVar1,pfVar3);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  return;
}



/* @00440a60 file=? name=FUN_00440a60 */

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

void __cdecl FUN_00440a60(int param_1)

{
  float fVar1;
  int *piVar2;
  
  fVar1 = *(float *)(param_1 + 0x20) - *(float *)(param_1 + 0x30);
  if (fVar1 <= _DAT_00440ab8) {
    fVar1 = -fVar1;
  }
  if (*(float *)(param_1 + 0x34) <= fVar1) {
    *(float *)(param_1 + 0x30) = *(float *)(param_1 + 0x20);
    piVar2 = (int *)FUN_00417ab4(param_1 + 0x24);
    (**(code **)(*piVar2 + 0x18))
              (piVar2,*(undefined4 *)(param_1 + 0x38),*(undefined4 *)(param_1 + 0x3c));
  }
  return;
}



/* @00440abc file=? name=FUN_00440abc */

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

{
  int iVar1;
  
  FUN_0044058e(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed778;
  iVar1 = FUN_00417ab4((int)(param_1 + 9));
  (**(code **)(*(int *)(iVar1 + 0x14) + 4))(iVar1 + 0x14,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xc,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xf,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x11,4);
  return param_1;
}



/* @00440b61 file=? name=FUN_00440b61 */

void __cdecl FUN_00440b61(int *param_1,byte param_2)

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



/* @00440b8d file=munga/audwthr.hpp name=FUN_00440b8d */

void __cdecl FUN_00440b8d(int *param_1,int param_2)

{
  char *pcVar1;
  float local_1c;
  float local_18;
  float local_14;
  int local_10;
  float local_c;
  float local_8;
  
  FUN_00440619(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_boundary1_004ec899);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec8b3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_boundary1_004ec8d8,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec8f2,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec8f4,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec934,0x237);
  }
  FUN_00407b78(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_boundary2_004ec952);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec96c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_boundary2_004ec991,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ec9ab,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ec9ad,
                 s_d__tesla_bt_munga_audwthr_hpp_004ec9ed,0x23a);
  }
  FUN_00407b78(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004eca0b);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004eca16,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004eca3b,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004eca46,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004eca48,
                 s_d__tesla_bt_munga_audwthr_hpp_004eca88,0x23d);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_boundary1_004ecaa6);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecabe,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_boundary1_004ecae3,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ecafb,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecafd,
                 s_d__tesla_bt_munga_audwthr_hpp_004ecb3d,0x240);
  }
  FUN_00407b78(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_boundary2_004ecb5b);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecb73,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_boundary2_004ecb98,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ecbb0,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecbb2,
                 s_d__tesla_bt_munga_audwthr_hpp_004ecbf2,0x243);
  }
  FUN_00407b78(pcVar1,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_exponent_004ecc10);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecc19,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_exponent_004ecc3e,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ecc47,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecc49,
                 s_d__tesla_bt_munga_audwthr_hpp_004ecc89,0x246);
  }
  FUN_00407b78(pcVar1,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  return;
}



/* @00440ed3 file=? name=FUN_00440ed3 */

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

void __cdecl FUN_00440ed3(int *param_1)

{
  float fVar1;
  float fVar2;
  float fVar3;
  int *piVar4;
  float10 fVar5;
  
  fVar5 = (float10)(**(code **)(*param_1 + 0x20))(param_1);
  fVar1 = (float)fVar5;
  if ((float)param_1[0xd] <= (float)param_1[0xc]) {
    fVar2 = (float)param_1[0xd];
  }
  else {
    fVar2 = (float)param_1[0xc];
  }
  if ((float)param_1[0xc] <= (float)param_1[0xd]) {
    fVar3 = (float)param_1[0xd];
  }
  else {
    fVar3 = (float)param_1[0xc];
  }
  if ((fVar2 <= fVar1) && (fVar2 = fVar1, fVar3 < fVar1)) {
    fVar2 = fVar3;
  }
  if ((float)param_1[0x11] != _DAT_00440faf) {
    FUN_004dce94((double)((fVar2 - (float)param_1[0xc]) /
                         ((float)param_1[0xd] - (float)param_1[0xc])),
                 SUB84((double)(float)param_1[0x11],0),
                 (uint)((ulonglong)(double)(float)param_1[0x11] >> 0x20));
  }
  piVar4 = (int *)FUN_00417ab4((int)(param_1 + 9));
  (**(code **)(*piVar4 + 0x18))();
  return;
}



/* @00440fdb file=? name=FUN_00440fdb */

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

{
  FUN_00441287(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed754;
  (**(code **)(*(int *)(param_1[4] + 0x80) + 4))(param_1[4] + 0x80,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xc,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  return param_1;
}



/* @0044104e file=? name=FUN_0044104e */

void __cdecl FUN_0044104e(int *param_1,byte param_2)

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



/* @0044107a file=munga/audwthr.hpp name=FUN_0044107a */

void __cdecl FUN_0044107a(int *param_1,int param_2)

{
  char *pcVar1;
  float local_10;
  int local_c;
  int local_8;
  
  FUN_00441312(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_match_value_004ecd08);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecd1e,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_match_value_004ecd43,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ecd59,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecd5b,
                 s_d__tesla_bt_munga_audwthr_hpp_004ecd9b,0x30c);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004ecdb9);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecdc4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004ecde9,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ecdf4,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecdf6,
                 s_d__tesla_bt_munga_audwthr_hpp_004ece36,0x30f);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_004ece54);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ece62,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_004ece87,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ece95,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ece97,
                 s_d__tesla_bt_munga_audwthr_hpp_004eced7,0x312);
  }
  FUN_00407b78(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  return;
}



/* @00441231 file=? name=FUN_00441231 */

void __cdecl FUN_00441231(int *param_1)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = (**(code **)(*param_1 + 0x20))(param_1,param_1 + 8);
  if (iVar1 == param_1[0xc]) {
    piVar2 = (int *)FUN_00417ab4((int)(param_1 + 9));
    (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0xd],param_1[0xe]);
  }
  return;
}



/* @00441269 file=munga/audwthr.hpp name=FUN_00441269 */

undefined4 FUN_00441269(void)

{
  FUN_0040385c(s_AudioMatchOf<T>__ExtractInterest_004ecef5,s_d__tesla_bt_munga_audwthr_hpp_004ecf38,
               0x336);
  return 0;
}



/* @00441287 file=? name=FUN_00441287 */

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

{
  int local_8;
  
  FUN_004413f1(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed734;
  FUN_0043acac(param_1 + 9,param_1);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(param_1[9] + 4))(param_1 + 9,local_8);
  return param_1;
}



/* @004412d8 file=? name=FUN_004412d8 */

void __cdecl FUN_004412d8(int *param_1,byte param_2)

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



/* @00441312 file=? name=FUN_00441312 */

void __cdecl FUN_00441312(int *param_1,int param_2)

{
  uint *puVar1;
  uint *local_8;
  
  FUN_00441430(param_1,param_2);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004ecf56);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00441381 file=? name=FUN_00441381 */

undefined4 __cdecl FUN_00441381(int param_1)

{
  FUN_00428a2c(param_1);
  return 1;
}



/* @00441395 file=? name=FUN_00441395 */

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

{
  if (param_2 == param_1 + 9) {
    if (param_1 != (undefined4 *)0x0) {
      (**(code **)*param_1)(param_1,3);
      return;
    }
  }
  else {
    FUN_00417938();
  }
  return;
}



/* @004413c5 file=? name=FUN_004413c5 */

void __cdecl FUN_004413c5(int *param_1,byte param_2)

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



/* @004413f1 file=? name=FUN_004413f1 */

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

{
  undefined1 local_8 [4];
  
  FUN_00428678(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed714;
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  FUN_00441502((int)param_1);
  return param_1;
}



/* @00441430 file=munga/watcher.hpp name=FUN_00441430 */

void __cdecl FUN_00441430(int *param_1,int param_2)

{
  char *pcVar1;
  int local_8;
  
  FUN_0042887c(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_dump_value_004ecf66);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecf71,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004ecf96,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ecfa1,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ecfa3,
                 s_d__tesla_bt_munga_watcher_hpp_004ecfe3,0x108);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  return;
}



/* @004414d8 file=? name=FUN_004414d8 */

void __cdecl FUN_004414d8(int *param_1)

{
  FUN_00441512(param_1);
  return;
}



/* @004414e7 file=? name=FUN_004414e7 */

void __cdecl FUN_004414e7(int *param_1)

{
  if (*(int *)param_1[5] != param_1[8]) {
    FUN_00441512(param_1);
  }
  return;
}



/* @00441502 file=? name=FUN_00441502 */

void __cdecl FUN_00441502(int param_1)

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



/* @00441512 file=? name=FUN_00441512 */

void __cdecl FUN_00441512(int *param_1)

{
  FUN_00441502((int)param_1);
  param_1[6] = 1;
  if (param_1[7] != 0) {
    (**(code **)(*param_1 + 0x18))(param_1);
  }
  return;
}



/* @00441537 file=? name=FUN_00441537 */

void FUN_00441537(void)

{
  return;
}



/* @0044153c file=? name=FUN_0044153c */

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

{
  FUN_00441287(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed6f4;
  (**(code **)(*(int *)(param_1[4] + 0x80) + 4))(param_1[4] + 0x80,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xf,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  param_1[0xc] = param_1[8];
  return param_1;
}



/* @004415b5 file=? name=FUN_004415b5 */

void __cdecl FUN_004415b5(int *param_1,byte param_2)

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



/* @004415e1 file=munga/audwthr.hpp name=FUN_004415e1 */

void __cdecl FUN_004415e1(int *param_1,int param_2)

{
  char *pcVar1;
  int iVar2;
  int *piVar3;
  int local_10;
  float local_c;
  int local_8;
  
  FUN_00441312(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_004ed001);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed00c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_004ed031,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed03c,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed03e,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed07e,0x39d);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_004ed09c);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed0aa,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_004ed0cf,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed0dd,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed0df,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed11f,0x3a0);
  }
  FUN_00407b78(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  local_10 = 0;
  iVar2 = FUN_00403ad0(param_2,s_delta_trigger_004ed13d);
  if (iVar2 != 0) {
    piVar3 = &local_10;
    pcVar1 = (char *)FUN_00403ad0(param_2,s_delta_trigger_004ed14b);
    FUN_00407ae0(pcVar1,piVar3);
  }
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  return;
}



/* @00441756 file=? name=FUN_00441756 */

void __cdecl FUN_00441756(int param_1)

{
  int iVar1;
  int *piVar2;
  
  iVar1 = *(int *)(param_1 + 0x20) - *(int *)(param_1 + 0x30);
  if (iVar1 < 1) {
    iVar1 = -iVar1;
  }
  if (*(int *)(param_1 + 0x34) <= iVar1) {
    *(int *)(param_1 + 0x30) = *(int *)(param_1 + 0x20);
    piVar2 = (int *)FUN_00417ab4(param_1 + 0x24);
    (**(code **)(*piVar2 + 0x18))
              (piVar2,*(undefined4 *)(param_1 + 0x38),*(undefined4 *)(param_1 + 0x3c));
  }
  return;
}



/* @0044179a file=? name=FUN_0044179a */

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

{
  FUN_00441287(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed6d0;
  (**(code **)(*(int *)(param_1[4] + 0x80) + 4))(param_1[4] + 0x80,param_1);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xc,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xd,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xe,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0xf,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x10,4);
  (**(code **)(*param_2 + 0x1c))(param_2,param_1 + 0x11,4);
  param_1[0x12] = 0;
  return param_1;
}



/* @00441845 file=? name=FUN_00441845 */

void __cdecl FUN_00441845(int *param_1,byte param_2)

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



/* @00441871 file=munga/audwthr.hpp name=FUN_00441871 */

void __cdecl FUN_00441871(int *param_1,int param_2)

{
  char *pcVar1;
  float local_1c;
  float local_18;
  int local_14;
  int local_10;
  int local_c;
  float local_8;
  
  FUN_00441312(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_attribute_value_threshold_004ed159);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed173,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_attribute_value_threshold_004ed198,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed1b2,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed1b4,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed1f4,0x16b);
  }
  FUN_00407b78(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_inverse_trigger_004ed212);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed222,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_inverse_trigger_004ed247,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed257,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed259,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed299,0x16e);
  }
  FUN_00407ae0(pcVar1,&local_c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_c,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_on_004ed2b7);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed2c5,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_on_004ed2ea,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed2f8,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed2fa,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed33a,0x171);
  }
  FUN_00407ae0(pcVar1,&local_10);
  (**(code **)(*param_1 + 0x20))(param_1,&local_10,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_ID_off_004ed358);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed367,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_ID_off_004ed38c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed39b,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed39d,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed3dd,0x174);
  }
  FUN_00407ae0(pcVar1,&local_14);
  (**(code **)(*param_1 + 0x20))(param_1,&local_14,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_on_004ed3fb);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed40c,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_on_004ed431,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed442,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed444,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed484,0x177);
  }
  FUN_00407b78(pcVar1,&local_18);
  (**(code **)(*param_1 + 0x20))(param_1,&local_18,4);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_control_value_off_004ed4a2);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed4b4,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_control_value_off_004ed4d9,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed4eb,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed4ed,
                 s_d__tesla_bt_munga_audwthr_hpp_004ed52d,0x17a);
  }
  FUN_00407b78(pcVar1,&local_1c);
  (**(code **)(*param_1 + 0x20))(param_1,&local_1c,4);
  return;
}



/* @00441bb7 file=? name=FUN_00441bb7 */

void __cdecl FUN_00441bb7(int *param_1)

{
  float fVar1;
  int *piVar2;
  float10 fVar3;
  
  fVar3 = (float10)(**(code **)(*param_1 + 0x20))(param_1,param_1 + 8);
  fVar1 = (float)fVar3;
  if (param_1[0x12] == 0) {
    if (((param_1[0xd] == 0) && ((float)param_1[0xc] < fVar1)) ||
       ((param_1[0xd] != 0 && (fVar1 < (float)param_1[0xc])))) {
      piVar2 = (int *)FUN_00417ab4((int)(param_1 + 9));
      (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0xe],param_1[0x10]);
      param_1[0x12] = 1;
    }
  }
  else if (((param_1[0xd] == 0) && (fVar1 <= (float)param_1[0xc])) ||
          ((param_1[0xd] != 0 && ((float)param_1[0xc] <= fVar1)))) {
    piVar2 = (int *)FUN_00417ab4((int)(param_1 + 9));
    (**(code **)(*piVar2 + 0x18))(piVar2,param_1[0xf],param_1[0x11]);
    param_1[0x12] = 0;
  }
  return;
}



/* @00441c64 file=munga/audwthr.hpp name=FUN_00441c64 */

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

float10 FUN_00441c64(void)

{
  FUN_0040385c(s_AudioTriggerOf<T>__ExtractIntere_004ed54b,s_d__tesla_bt_munga_audwthr_hpp_004ed590,
               0x1bc);
  return (float10)_DAT_00441c88;
}



/* @00441c8c file=? name=FUN_00441c8c */

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

{
  int local_8;
  
  FUN_00441e04(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed6b0;
  FUN_0043acac(param_1 + 0x1d,param_1);
  FUN_0043afbc(param_2,&local_8);
  (**(code **)(param_1[0x1d] + 4))(param_1 + 0x1d,local_8);
  return param_1;
}



/* @00441cdd file=? name=FUN_00441cdd */

void __cdecl FUN_00441cdd(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ed6b0;
    FUN_0043accb(param_1 + 0x1d,2);
    FUN_00441dca(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00441d17 file=? name=FUN_00441d17 */

void __cdecl FUN_00441d17(int *param_1,int param_2)

{
  uint *puVar1;
  uint *local_8;
  
  FUN_00441e4d(param_1,param_2);
  puVar1 = (uint *)FUN_00402298(0x10);
  if (puVar1 == (uint *)0x0) {
    local_8 = (uint *)0x0;
  }
  else {
    local_8 = FUN_00402460(puVar1,s_audio_component_004ed5ae);
  }
  local_8[3] = local_8[3] + 1;
  FUN_00417240(param_1,param_2,(int *)&local_8);
  puVar1 = local_8 + 3;
  *puVar1 = *puVar1 - 1;
  if (*puVar1 == 0) {
    FUN_004024d8((int *)local_8,3);
  }
  return;
}



/* @00441d86 file=? name=FUN_00441d86 */

undefined4 __cdecl FUN_00441d86(int param_1)

{
  FUN_00428a2c(param_1);
  return 1;
}



/* @00441d9a file=? name=FUN_00441d9a */

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

{
  if (param_2 == param_1 + 0x1d) {
    if (param_1 != (undefined4 *)0x0) {
      (**(code **)*param_1)(param_1,3);
      return;
    }
  }
  else {
    FUN_00417938();
  }
  return;
}



/* @00441dca file=? name=FUN_00441dca */

void __cdecl FUN_00441dca(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004ed690;
    FUN_0041baa4(param_1 + 8,2);
    FUN_0042864c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00441e04 file=? name=FUN_00441e04 */

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

{
  undefined1 local_8 [4];
  
  FUN_00428678(param_1,param_2,param_3);
  *param_1 = &PTR_FUN_004ed690;
  FUN_0041b994(param_1 + 8);
  (**(code **)(*param_2 + 0x1c))(param_2,local_8,4);
  FUN_00441f29((int)param_1);
  return param_1;
}



/* @00441e4d file=munga/watcher.hpp name=FUN_00441e4d */

void __cdecl FUN_00441e4d(int *param_1,int param_2)

{
  char *pcVar1;
  int local_8;
  
  FUN_0042887c(param_1,param_2);
  pcVar1 = (char *)FUN_00403ad0(param_2,s_dump_value_004ed5be);
  if (pcVar1 == (char *)0x0) {
    FUN_004dbb24(&DAT_00524e20,s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed5c9,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,s_dump_value_004ed5ee,(char *)0x0);
    FUN_004dbb24(&DAT_00524e20,&DAT_004ed5f9,(char *)0x0);
    FUN_0040385c(s_DYN_MEM_STRM_WRITE_ENTRY____name_004ed5fb,
                 s_d__tesla_bt_munga_watcher_hpp_004ed63b,0x108);
  }
  FUN_00407ae0(pcVar1,&local_8);
  (**(code **)(*param_1 + 0x20))(param_1,&local_8,4);
  return;
}



/* @00441ef5 file=? name=FUN_00441ef5 */

void __cdecl FUN_00441ef5(int *param_1)

{
  FUN_00441f41(param_1);
  return;
}



/* @00441f04 file=? name=FUN_00441f04 */

void __cdecl FUN_00441f04(int *param_1)

{
  int iVar1;
  
  iVar1 = FUN_0041bba8((int)(param_1 + 8),param_1[5]);
  if (iVar1 == 0) {
    FUN_00441f41(param_1);
  }
  return;
}



/* @00441f29 file=? name=FUN_00441f29 */

void __cdecl FUN_00441f29(int param_1)

{
  FUN_0041bb88(param_1 + 0x20,*(int *)(param_1 + 0x14));
  return;
}



/* @00441f41 file=? name=FUN_00441f41 */

void __cdecl FUN_00441f41(int *param_1)

{
  FUN_00441f29((int)param_1);
  param_1[6] = 1;
  if (param_1[7] != 0) {
    (**(code **)(*param_1 + 0x18))(param_1);
  }
  return;
}



/* @00441f66 file=? name=FUN_00441f66 */

void FUN_00441f66(void)

{
  return;
}



/* @00441f6c file=? name=FUN_00441f6c */

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

{
  FUN_00435d30(param_1,param_2,DAT_004e823c,1,1,1,0x1e,&DAT_004e82f8);
  *param_1 = &PTR_FUN_004edb74;
  FUN_0044242c(param_1 + 0x14,0,0);
  param_1[0x13] = 0;
  return param_1;
}



/* @00441fb4 file=? name=FUN_00441fb4 */

void __cdecl FUN_00441fb4(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edb74;
    FUN_00436b9c((int *)param_1[0x13],3);
    FUN_0044244f(param_1 + 0x14,2);
    FUN_00435df8(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_004022d0(param_1);
    }
  }
  return;
}



/* @00441ffc file=? name=FUN_00441ffc */

void __cdecl FUN_00441ffc(int *param_1)

{
  int iVar1;
  
  iVar1 = (**(code **)(*param_1 + 0x4c))(param_1);
  param_1[0x13] = iVar1;
  return;
}



/* @00442010 file=? name=FUN_00442010 */

undefined4 __cdecl FUN_00442010(int param_1)

{
  FUN_00435e48(param_1);
  return 1;
}



/* @0044202c file=? name=FUN_0044202c */

void __cdecl FUN_0044202c(int *param_1,int param_2)

{
  (*(code *)**(undefined4 **)param_1[0x13])((undefined4 *)param_1[0x13],param_2);
  FUN_00435e70(param_1,param_2);
  return;
}



/* @00442054 file=? name=FUN_00442054 */

void __cdecl FUN_00442054(int param_1)

{
  (**(code **)(**(int **)(param_1 + 0x4c) + 8))(*(int **)(param_1 + 0x4c));
  return;
}



/* @00442068 file=? name=FUN_00442068 */

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

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

{
  bool bVar1;
  undefined3 extraout_var;
  undefined4 *puVar2;
  int iVar3;
  float10 fVar4;
  float local_c;
  float local_8;
  
  bVar1 = FUN_00438348(param_2[9],*(int *)(param_1 + 0x4c));
  if (CONCAT31(extraout_var,bVar1) == 0) {
    iVar3 = param_2[0x1b];
    fVar4 = (float10)(**(code **)(*param_2 + 0x1c))(param_2);
    local_8 = (float)fVar4;
  }
  else {
    if (*(int *)(*(int *)(param_2[10] + 0xc) + 0x10) == 0) {
      return;
    }
    iVar3 = param_2[0x1b];
    local_8 = 0.0;
  }
  if (((param_3[3] != 1) || (*(int *)(*(int *)(param_2[10] + 0xc) + 0x10) != 0)) ||
     (_DAT_004e8638 <= local_8)) {
    local_c = (_DAT_00442130 - (float)iVar3) - local_8;
    puVar2 = FUN_00402f74(0x4edaf0);
    if (puVar2 == (undefined4 *)0x0) {
      puVar2 = (undefined4 *)0x0;
    }
    else {
      puVar2 = FUN_00442330(puVar2,param_2,param_3);
    }
    (**(code **)(*(int *)(param_1 + 0x50) + 8))(param_1 + 0x50,puVar2,&local_c);
  }
  return;
}



/* @00442134 file=? name=FUN_00442134 */

undefined4 __cdecl FUN_00442134(int param_1)

{
  undefined4 *puVar1;
  int iVar2;
  int iVar3;
  undefined4 uVar4;
  int local_18 [5];
  
  FUN_00436f9c(local_18,param_1 + 0x50);
  puVar1 = (undefined4 *)(**(code **)(local_18[0] + 0x30))(local_18);
  if (puVar1 == (undefined4 *)0x0) {
    uVar4 = 0;
    FUN_00436ff9(local_18,2);
  }
  else {
    iVar3 = puVar1[3];
    iVar2 = FUN_00417ab4((int)(puVar1 + 4));
    FUN_00419bbc(iVar2,iVar3);
    if (puVar1 != (undefined4 *)0x0) {
      (**(code **)*puVar1)(puVar1,3);
    }
    uVar4 = 1;
    FUN_00436ff9(local_18,2);
  }
  return uVar4;
}



/* @004421b4 file=? name=FUN_004421b4 */

void __cdecl FUN_004421b4(int param_1,int param_2)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int local_18 [5];
  
  FUN_00436f9c(local_18,param_1 + 0x50);
  while( true ) {
    puVar3 = (undefined4 *)(**(code **)(local_18[0] + 0x28))(local_18);
    if (puVar3 == (undefined4 *)0x0) break;
    iVar1 = FUN_00417ab4((int)(puVar3 + 4));
    if (param_2 == iVar1) {
      if (*(int *)(puVar3[3] + 0xc) == 2) {
        iVar1 = puVar3[3];
        iVar2 = FUN_00417ab4((int)(puVar3 + 4));
        FUN_00419bbc(iVar2,iVar1);
        if (puVar3 != (undefined4 *)0x0) {
          (**(code **)*puVar3)(puVar3,3);
        }
      }
      else if (puVar3 != (undefined4 *)0x0) {
        (**(code **)*puVar3)(puVar3,3);
      }
    }
  }
  FUN_00436ff9(local_18,2);
  return;
}



/* @00442248 file=? name=FUN_00442248 */

undefined4 * FUN_00442248(void)

{
  undefined4 *puVar1;
  
  puVar1 = (undefined4 *)FUN_00402298(0x50);
  if (puVar1 == (undefined4 *)0x0) {
    puVar1 = (undefined4 *)0x0;
  }
  else {
    puVar1 = FUN_00436b1c(puVar1);
  }
  return puVar1;
}



/* @00442268 file=? name=FUN_00442268 */

void __cdecl FUN_00442268(int param_1,int *param_2,int param_3,int param_4)

{
  int *piVar1;
  undefined4 *puVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 local_6c [26];
  
  piVar1 = (int *)FUN_00407064(*(int *)(DAT_004efc94 + 0x68),param_4,3);
  if (piVar1 != (int *)0x0) {
    puVar2 = (undefined4 *)FUN_00407064(*(int *)(DAT_004efc94 + 0x68),*piVar1,1);
    if (puVar2 != (undefined4 *)0x0) {
      iVar4 = puVar2[1];
      puVar2[1] = puVar2[1] + 1;
      if (iVar4 == 0) {
        FUN_00406cd0((int)puVar2);
      }
      iVar4 = piVar1[1];
      piVar1[1] = piVar1[1] + 1;
      if (iVar4 == 0) {
        FUN_00406cd0((int)piVar1);
      }
      uVar3 = FUN_00417ab4(param_1 + 0x40);
      iVar4 = (**(code **)(*param_2 + 0x28))(param_2,uVar3);
      uVar3 = 4;
      if (iVar4 != 0) {
        uVar3 = 3;
      }
      iVar4 = FUN_0041dbd0(param_3,uVar3);
      FUN_00437268(local_6c,*puVar2,(int)param_2,iVar4);
      FUN_004371c8((int)local_6c);
      puVar2[1] = puVar2[1] + -1;
      piVar1[1] = piVar1[1] + -1;
    }
  }
  return;
}



/* @00442330 file=? name=FUN_00442330 */

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

{
  undefined4 uVar1;
  
  FUN_004178cc(param_1,2);
  *param_1 = &PTR_FUN_004edb68;
  FUN_004425fa(param_1 + 4,param_1);
  uVar1 = FUN_004022b0(*param_3 + 3 & 0xfffffffc);
  param_1[3] = uVar1;
  FUN_004d4918((undefined4 *)param_1[3],param_3,*param_3);
  (**(code **)(param_1[4] + 4))(param_1 + 4,param_2);
  return param_1;
}



/* @00442398 file=? name=FUN_00442398 */

void __cdecl FUN_00442398(int *param_1,byte param_2)

{
  if (param_1 != (int *)0x0) {
    *param_1 = (int)&PTR_FUN_004edb68;
    FUN_004022d0((int *)param_1[3]);
    FUN_00442619(param_1 + 4,2);
    FUN_0041790c(param_1,0);
    if ((param_2 & 1) != 0) {
      FUN_00402f98(0x4edaf0,param_1);
    }
  }
  return;
}



/* @004423e8 file=? name=FUN_004423e8 */

void __cdecl FUN_004423e8(undefined4 *param_1)

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



/* @0044242c file=? name=FUN_0044242c */

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

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



/* @0044244f file=? name=FUN_0044244f */

void __cdecl FUN_0044244f(int *param_1,byte param_2)

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



/* @0044247b file=? name=FUN_0044247b */

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

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

{
  undefined4 uVar1;
  float10 fVar2;
  
  fVar2 = FUN_004dcd00((double)(*(float *)(param_2 + 0x1c) - *(float *)(param_3 + 0x1c)));
  if ((float10)_DAT_004424eb < fVar2) {
    if (*(float *)(param_2 + 0x1c) <= *(float *)(param_3 + 0x1c)) {
      uVar1 = 0xffffffff;
    }
    else {
      uVar1 = 1;
    }
  }
  else {
    uVar1 = 0;
  }
  return uVar1;
}



/* @004425af file=? name=FUN_004425af */

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

void __cdecl FUN_004425af(undefined4 *param_1)

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



/* @004425fa file=? name=FUN_004425fa */

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

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



/* @00442619 file=? name=FUN_00442619 */

void __cdecl FUN_00442619(int *param_1,byte param_2)

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



/* @00442645 file=? name=FUN_00442645 */

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

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



/* @00442675 file=? name=FUN_00442675 */

void __cdecl FUN_00442675(int param_1)

{
  FUN_00442134(param_1);
  return;
}



/* @00442684 file=? name=FUN_00442684 */

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

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



/* @004426b9 file=? name=FUN_004426b9 */

void __cdecl FUN_004426b9(int *param_1,byte param_2)

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



/* @004426e5 file=? name=FUN_004426e5 */

void FUN_004426e5(void)

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



/* @00442735 file=? name=FUN_00442735 */

void __cdecl FUN_00442735(undefined4 *param_1)

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



/* @00442780 file=? name=FUN_00442780 */

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

{
  char cVar1;
  uint uVar2;
  uint uVar3;
  char *pcVar4;
  char *pcVar5;
  
  FUN_00415e90(param_1,0x40);
  *param_1 = &PTR_FUN_004edc6c;
  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 = (char *)(param_1 + 3);
  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;
  }
  param_1[0xb] = 0;
  param_1[0xc] = 1;
  param_1[0xd] = param_3;
  return param_1;
}



/* @004427dc file=? name=FUN_004427dc */

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

{
  FUN_00415e90(param_1,0x40);
  *param_1 = &PTR_FUN_004edc6c;
  *(undefined1 *)(param_1 + 3) = 0;
  param_1[0xb] = param_2;
  param_1[0xc] = 1;
  param_1[0xd] = param_3;
  return param_1;
}



/* @00442810 file=? name=FUN_00442810 */

void __cdecl FUN_00442810(int *param_1,byte param_2)

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



