//
// FMODAudioEngine::unloadAllEffects from 0x5ba94c to 0x5baadc (400 bytes)
//
// 4 xrefs:
// > PlayLayer::onQuit @ 0x5d08a0
// > EditorPauseLayer::playStep2 @ 0x78b2a8
// > EditorPauseLayer::onExitEditor @ 0x78e8dc
// > ??> @ 0x44070
//
// 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
//
void FMODAudioEngine::unloadAllEffects(FMODAudioEngine *a1)
{
__int64 i; // x24
FMOD::Sound **m_finish; // x0
const void **v4; // x23
unsigned __int64 v5; // x0
std::_Hashtable, std::__detail::_Identity, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::_Hashtable_traits>::size_type M_bucket_count; // x25
unsigned __int64 v7; // x26
unsigned __int64 v8; // x27
__int64 *v9; // x28
__int64 *v10; // x19
unsigned __int64 v11; // x0
_QWORD *v12; // x1
size_t v13; // x2
std::_Hashtable, 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>::size_type v14; // x1
__int64 *j; // x2
FMODAudioEngine::stopAllEffects(a1);
for ( i = (__int64)a1->m_fmodSounds._M_h._M_before_begin._M_nxt;
i;
i = std::_Hashtable,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>::_M_erase(
(__int64 *)&a1->m_fmodSounds,
v14,
j,
(_QWORD *)i) )
{
while ( *(_BYTE *)(i + 44) )
{
i = *(_QWORD *)i;
if ( !i )
goto LABEL_19;
}
m_finish = a1->m_removedSounds.m_finish;
if ( m_finish == a1->m_removedSounds.m_reserveEnd )
{
std::vector::_M_emplace_back_aux(
(__int64)&a1->m_removedSounds,
(_QWORD *)(i + 16));
}
else
{
if ( m_finish )
{
*m_finish = *(FMOD::Sound **)(i + 16);
m_finish = a1->m_removedSounds.m_finish;
}
a1->m_removedSounds.m_finish = m_finish + 1;
}
v4 = (const void **)(i + 8);
v5 = sub_CCD1D0(*(_QWORD *)(i + 8), *(_QWORD *)(*(_QWORD *)(i + 8) - 24LL), 3339675911LL);
M_bucket_count = a1->m_temporarySoundPaths._M_h._M_bucket_count;
v7 = v5;
v8 = v5 % M_bucket_count;
v9 = (__int64 *)a1->m_temporarySoundPaths._M_h._M_buckets[v5 % M_bucket_count];
if ( !v9 )
goto LABEL_15;
v10 = (__int64 *)*v9;
if ( v5 == *(_QWORD *)(*v9 + 16) )
goto LABEL_12;
do
{
do
{
if ( !*v10 )
goto LABEL_15;
v11 = *(_QWORD *)(*v10 + 16);
v9 = v10;
if ( v8 != v11 % M_bucket_count )
goto LABEL_15;
v10 = (__int64 *)*v10;
}
while ( v7 != v11 );
LABEL_12:
v12 = (_QWORD *)v10[1];
v13 = *((_QWORD *)*v4 - 3);
}
while ( v13 != *(v12 - 3) || memcmp(*v4, v12, v13) );
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_erase(
(__int64 *)&a1->m_temporarySoundPaths,
v7 % M_bucket_count,
v9,
(_QWORD *)*v9);
LABEL_15:
v14 = *(_QWORD *)(i + 48) % a1->m_fmodSounds._M_h._M_bucket_count;
for ( j = (__int64 *)a1->m_fmodSounds._M_h._M_buckets[v14]; i != *j; j = (__int64 *)*j )
;
}
LABEL_19:
dword_1241CC8 = 0;
}