//
// sub_5AA2AC from 0x5aa2ac to 0x5aa30c (96 bytes)
//
// 7 xrefs:
// > std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[] @ 0x5b29e8
// > FMODAudioEngine::getMusicChannelID @ 0x5b31c8
// > FMODAudioEngine::getActiveMusic @ 0x5b37ec
// > FMODAudioEngine::setMusicTimeMS @ 0x5b3b64
// > FMODAudioEngine::setMusicTimeMS @ 0x5b3ba8
// > sub_5B5D28 @ 0x5b5d50
// > FMODAudioEngine::stopAndRemoveMusic @ 0x5b6294
//
// 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
//
_QWORD *__fastcall sub_5AA2AC(_QWORD *a1, __int64 a2, int *a3)
{
_QWORD *v3; // x7
_QWORD *v4; // x4
int v5; // w8
int v6; // w6
__int64 v7; // x2
v3 = *(_QWORD **)(*a1 + 8 * a2);
if ( !v3 )
return nullptr;
v4 = (_QWORD *)*v3;
v5 = *a3;
v6 = *(_DWORD *)(*v3 + 8LL);
while ( v5 != v6 )
{
v7 = *v4;
v3 = v4;
v4 = (_QWORD *)v7;
if ( v7 )
{
v6 = *(_DWORD *)(v7 + 8);
if ( a2 == (unsigned __int64)v6 % a1[1] )
continue;
}
return nullptr;
}
return v3;
}