//
// sub_1005F57A0 from 0x1005f57a0 to 0x1005f5860 (192 bytes)
//
// 2 xrefs:
// > sub_1005DD19C @ 0x1005dd72c
// > sub_1005F4FC0 @ 0x1005f51dc
//
// 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:09:50 +0000
//
__int64 __fastcall sub_1005F57A0(__int64 a1, __int64 a2)
{
__int64 v4; // x21
__int64 v5; // x9
int v6; // w8
bool v7; // vf
int v8; // w8
__int64 v9; // x20
v4 = a1 + 74056;
if ( a1 )
sub_100568CC4(a1, 0x12u);
v5 = *(int *)(a2 + 32);
v6 = *(_DWORD *)(v4 + 8);
v7 = __OFSUB__(v6, 1);
v8 = v6 - 1;
*(_QWORD *)(*(_QWORD *)v4 + 8 * v5) = *(_QWORD *)(*(_QWORD *)v4 + 8LL * v8);
*(_DWORD *)(*(_QWORD *)(*(_QWORD *)v4 + 8 * v5) + 32LL) = v5;
if ( v8 < 0 == v7 )
*(_DWORD *)(v4 + 8) = v8;
sub_100568CE4(a1, 0x12u);
v9 = FMOD::ExpandingPool::free(a1 + 1824, *(_QWORD *)(a2 + 16), 1u);
if ( !(_DWORD)v9 )
sub_1005D7AD8(*((_QWORD *)off_1009DA5E8 + 54), (int *)a2);
return v9;
}