//
// FMOD::ExpandingPool::getBlockAndIndex from 0x10055bb78 to 0x10055bc38 (192 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 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 11:08:01 +0000
//
__int64 __fastcall FMOD::ExpandingPool::getBlockAndIndex(
__int64 a1,
unsigned __int64 a2,
unsigned __int64 a3,
__int64 **a4,
_DWORD *a5)
{
unsigned __int64 v5; // x10
__int64 *v6; // x8
unsigned __int64 v7; // x12
unsigned __int64 v8; // x12
unsigned __int64 v9; // x9
__int64 result; // x0
v5 = (*(_DWORD *)(a1 + 28) + 167) & (unsigned int)-*(_DWORD *)(a1 + 28);
v6 = *(__int64 **)(a1 + 8);
while ( 1 )
{
if ( a2 )
{
v7 = *(_QWORD *)v6[6];
if ( v7 <= a2 && (unsigned int)(*((_DWORD *)v6 + 8) * v5) + v7 > a2 )
{
v9 = (a2 - v7) / v5;
if ( (_DWORD)v9 != -1 )
goto LABEL_10;
return 30;
}
}
if ( a3 )
{
v8 = v6[5];
if ( v8 <= a3 && v8 + 24LL * *((int *)v6 + 8) > a3 )
break;
}
v6 = (__int64 *)*v6;
if ( v6 == *(__int64 **)(a1 + 8) )
return 30;
}
v9 = 0xAAAAAAAAAAAAAAABLL * ((__int64)(a3 - v8) >> 3);
if ( (_DWORD)v9 == -1 )
return 30;
LABEL_10:
if ( a4 )
*a4 = v6;
result = 0;
if ( a5 )
*a5 = v9;
return result;
}