//
// FMOD::Sound::getNumSubSounds from 0x1004bfbbc to 0x1004bfcb8 (252 bytes)
//
// 1 xrefs:
// > sub_100453094 @ 0x100453098
//
// 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
//
FMOD_RESULT __fastcall FMOD::Sound::getNumSubSounds(FMOD::Sound *a1, int *a2)
{
int v4; // w3
int v5; // w4
int v6; // w5
int v7; // w6
int v8; // w7
__int64 v9; // x21
unsigned int v10; // w8
unsigned int v11; // w8
unsigned int *v13; // [xsp+0h] [xbp-130h] BYREF
_BYTE v14[256]; // [xsp+8h] [xbp-128h] BYREF
v9 = sub_1004C3CE0(a1, &v13, 0);
if ( !(_DWORD)v9 )
{
v10 = atomic_load(v13 + 68);
if ( v10 && (v11 = atomic_load(v13 + 68), v11 != 7) )
{
v9 = 46;
}
else
{
v9 = (*(__int64 (__fastcall **)(unsigned int *, int *))(*(_QWORD *)v13 + 168LL))(v13, a2);
if ( !(_DWORD)v9 )
return (unsigned int)v9;
}
}
if ( (*((_BYTE *)off_1008524C8 + 32) & 0x80) != 0 )
{
sub_1004360AC((int)v14, 0x100u, (__int64)a2, v4, v5, v6, v7, v8);
sub_10048489C(v9, 5, (__int64)a1, (__int64)"Sound::getNumSubSounds", (__int64)v14);
}
return (unsigned int)v9;
}