//
// FMOD::Sound::getSubSound from 0x1800a85e0 to 0x1800a8711 (305 bytes)
//
// 3 xrefs:
// > FMOD_Sound_GetSubSound @ 0x1800c66b9
// > ??> @ 0x180194348
// > ??> @ 0x1801fbb44
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:53:54 +0000
//
__int64 __fastcall FMOD::Sound::getSubSound(__int64 a1, unsigned int a2, __int64 a3)
{
int v5; // ebx
int v6; // r14d
unsigned int v7; // esi
__int64 v8; // rax
int v9; // ebx
int v10; // eax
__int64 v12; // [rsp+30h] [rbp-148h] BYREF
__int64 v13; // [rsp+38h] [rbp-140h] BYREF
_BYTE v14[256]; // [rsp+40h] [rbp-138h] BYREF
v5 = 0;
v13 = 0;
v6 = a1;
v7 = sub_1800E1460(a1, &v12, &v13);
if ( !v7 )
{
v8 = *(_QWORD *)(v12 + 264);
if ( v8 )
v5 = *(_DWORD *)(v8 + 292);
if ( !*(_DWORD *)(v12 + 272) || v5 == 15 )
{
v7 = (*(__int64 (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v12 + 120LL))(v12, a2, a3);
if ( !v7 )
goto LABEL_10;
}
else
{
v7 = 46;
}
}
if ( *((char *)off_1801AED20 + 16) < 0 )
{
v9 = sub_1800F2EC0(v14, 256, a2);
v10 = sub_1800F2F70(&v14[v9]);
sub_1800F3230(&v14[v10 + v9], (unsigned int)(256 - (v10 + v9)), a3);
sub_1800B20E0(v7, 5, v6, (unsigned int)"Sound::getSubSound", (__int64)v14);
}
LABEL_10:
if ( v13 )
sub_180102300(v13, 12);
return v7;
}