//
// sub_10008E5E0 from 0x10008e5e0 to 0x10008e6d8 (248 bytes)
//
// 8 xrefs:
// > sub_10008B0E8 @ 0x10008b3c4
// > FMODAudioEngine::preloadEffect @ 0x1001b5190
// > FMODAudioEngine::playEffectAdvanced @ 0x1001b7450
// > FMODAudioEngine::playEffectAdvanced @ 0x1001b7644
// > sub_1001B8CEC @ 0x1001b8d0c
// > sub_1001B8F6C @ 0x1001b8fe8
// > sub_1001B9B00 @ 0x1001b9b1c
// > EditorSFXManager::deserializeAll @ 0x1004c7c68
//
// 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 10:58:22 +0000
//
const void **__fastcall sub_10008E5E0(_QWORD *a1, __int64 *a2)
{
unsigned __int64 v4; // x0
int8x8_t v5; // x23
unsigned __int64 v6; // x21
uint8x8_t v7; // d0
unsigned __int64 v8; // x24
unsigned __int64 v9; // x25
const void ***v10; // x8
const void **i; // x22
unsigned __int64 v12; // x8
v4 = sub_10008E078((__int64)a1, a2);
v5 = (int8x8_t)a1[1];
if ( !*(_QWORD *)&v5 )
return nullptr;
v6 = v4;
v7 = (uint8x8_t)vcnt_s8(v5);
v7.i16[0] = vaddlv_u8(v7);
v8 = v7.u32[0];
if ( v7.u32[0] > 1uLL )
{
v9 = v4;
if ( v4 >= *(_QWORD *)&v5 )
v9 = v4 % *(_QWORD *)&v5;
}
else
{
v9 = (*(_QWORD *)&v5 - 1LL) & v4;
}
v10 = *(const void ****)(*a1 + 8 * v9);
if ( !v10 )
return nullptr;
for ( i = *v10; i; i = (const void **)*i )
{
v12 = (unsigned __int64)i[1];
if ( v6 == v12 )
{
if ( sub_10008E0B4((__int64)a1, i + 2, (const void **)a2) )
return i;
}
else
{
if ( v8 > 1 )
{
if ( v12 >= *(_QWORD *)&v5 )
v12 %= *(_QWORD *)&v5;
}
else
{
v12 &= *(_QWORD *)&v5 - 1LL;
}
if ( v12 != v9 )
return nullptr;
}
}
return i;
}