//
// sub_B4154 from 0xb4154 to 0xb424c (248 bytes)
//
// 2 xrefs:
// > sub_58CA8 @ 0x59458
// > sub_613C4 @ 0x615d6
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_B4154(_DWORD *a1)
{
int v2; // r4
_DWORD *v3; // r6
int v4; // r0
int v5; // r5
int v6; // r0
int (__fastcall *v7)(_DWORD *); // r1
int v8; // r0
_DWORD v10[2]; // [sp+14h] [bp-1Ch] BYREF
char v11; // [sp+1Ch] [bp-14h]
if ( a1[187] )
{
v10[0] = a1[9];
v10[1] = 23;
v11 = 0;
sub_44998((int)v10);
v2 = a1[9] + 1176;
v3 = (_DWORD *)v2;
while ( 1 )
{
v3 = (_DWORD *)*v3;
if ( v3 == (_DWORD *)v2 )
break;
v4 = sub_B3BF8((int)a1, (int)v3);
if ( v4 )
{
v5 = v4;
sub_448CC((int)v10);
return v5;
}
}
sub_448CC((int)v10);
}
v6 = a1[9];
*(_DWORD *)(v6 + 72008) = 0;
*(_WORD *)(v6 + 72012) = 0;
v7 = (int (__fastcall *)(_DWORD *))a1[177];
if ( v7 )
{
v5 = v7(a1 + 1);
if ( v5 )
return v5;
v6 = a1[9];
}
if ( *(_DWORD *)(v6 + 67172) )
{
v5 = sub_BE65C(a1 + 17, "FMOD mixer thread", sub_B4030, a1, 0, 1, 0, v6, 1);
if ( v5 )
return v5;
if ( a1[182] )
{
v8 = sub_BE65C(a1 + 92, "FMOD feeder thread", sub_B4022, a1, 1, 0, 0, a1[9], 1);
goto LABEL_16;
}
return 0;
}
if ( !a1[182] )
return 0;
v8 = sub_BE65C(a1 + 92, "FMOD mixer thread", sub_B4022, a1, 0, 0, 0, v6, 1);
LABEL_16:
v5 = v8;
if ( !v8 )
return 0;
return v5;
}