//
// FMOD::Sound::setLoopCount from 0x1800a9ab0 to 0x1800a9baf (255 bytes)
//
// 3 xrefs:
// > FMOD_Sound_SetLoopCount @ 0x1800c67a9
// > ??> @ 0x180194348
// > ??> @ 0x1801fbda8
//
// 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::setLoopCount(__int64 a1, unsigned int a2)
{
int v3; // esi
unsigned int v4; // ebx
_DWORD *v6; // [rsp+30h] [rbp-128h] BYREF
__int64 v7; // [rsp+38h] [rbp-120h] BYREF
_BYTE v8[256]; // [rsp+40h] [rbp-118h] BYREF
v7 = 0;
v3 = a1;
v4 = sub_1800E1460(a1, &v6, &v7);
if ( !v4 )
{
if ( !v6[68] || v6[68] == 7 )
{
v4 = (*(__int64 (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v6 + 296LL))(v6, a2);
if ( !v4 )
goto LABEL_8;
}
else
{
v4 = 46;
}
}
if ( *((char *)off_1801AED20 + 16) < 0 )
{
sub_1800F2EC0(v8, 256, a2);
sub_1800B20E0(v4, 5, v3, (unsigned int)"Sound::setLoopCount", (__int64)v8);
}
LABEL_8:
if ( v7 )
sub_180102300(v7, 12);
return v4;
}