//
// FMOD::Sound::getFormat from 0x1800a7360 to 0x1800a7518 (440 bytes)
//
// 5 xrefs:
// > FMOD_Sound_GetFormat @ 0x1800c658b
// > ??> @ 0x180187160
// > ??> @ 0x180187170
// > ??> @ 0x180194348
// > ??> @ 0x1801fb964
//
// 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
//
__int64 __fastcall FMOD::Sound::getFormat(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5)
{
int v8; // r12d
unsigned int v9; // esi
int v10; // ebx
int v11; // ebx
int v12; // ebx
int v13; // ebx
int v14; // ebx
int v15; // eax
__int64 result; // rax
_DWORD *v17; // [rsp+30h] [rbp-158h] BYREF
_BYTE v18[256]; // [rsp+40h] [rbp-148h] BYREF
v8 = a1;
v9 = sub_1800E1460(a1, &v17, 0);
if ( !v9 )
{
if ( !v17[68] || v17[68] == 7 )
{
result = (*(__int64 (__fastcall **)(_DWORD *, __int64, __int64, __int64, __int64))(*(_QWORD *)v17 + 160LL))(
v17,
a2,
a3,
a4,
a5);
v9 = result;
if ( !(_DWORD)result )
return result;
}
else
{
v9 = 46;
}
}
if ( *((char *)off_1801AED20 + 16) < 0 )
{
v10 = sub_1800F3230(v18, 256, a2);
v11 = sub_1800F2F70(&v18[v10]) + v10;
v12 = sub_1800F3230(&v18[v11], (unsigned int)(256 - v11), a3) + v11;
v13 = sub_1800F2F70(&v18[v12]) + v12;
v14 = sub_1800F3020(&v18[v13], (unsigned int)(256 - v13), a4) + v13;
v15 = sub_1800F2F70(&v18[v14]);
sub_1800F3020(&v18[v15 + v14], (unsigned int)(256 - (v15 + v14)), a5);
sub_1800B20E0(v9, 5, v8, (unsigned int)"Sound::getFormat", (__int64)v18);
}
return v9;
}