//
// sub_10013FF3C from 0x10013ff3c to 0x100140034 (248 bytes)
//
// 6 xrefs:
// > FMODAudioEngine::preloadEffect @ 0x100138658
// > FMODAudioEngine::playEffectAdvanced @ 0x10013a754
// > FMODAudioEngine::playEffectAdvanced @ 0x10013a948
// > FMODAudioEngine::preloadEffectAsync @ 0x10013be90
// > FMODAudioEngine::channelUnlinkSound @ 0x10013c16c
// > FMODAudioEngine::lengthForSound @ 0x10013ccb8
//
// 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
//
const void **__fastcall sub_10013FF3C(_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_1000B35EC((__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_1000B3628((__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;
}