//
// FMODAudioEngine::updateQueuedEffects from 0x14005aef0 to 0x14005b09b (427 bytes)
//
// 4 xrefs:
// > FMODAudioEngine::update @ 0x14005543c
// > ??> @ 0x140664d48
// > ??> @ 0x140664d58
// > ??> @ 0x1406c5328
//
// 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::updateQueuedEffects(FMODAudioEngine *a1)
{
std::_List_val>>::_Nodeptr Myhead; // rax
std::_List_simple_types>::_Node *v3; // rdi
__int64 v5; // rax
__int64 v6; // rax
char *v7; // r9
std::_List_simple_types>::_Node *v8; // rbx
unsigned __int64 v9; // r8
__int64 v10; // rax
unsigned __int64 i; // rdx
__int64 v12; // rcx
std::_Simple_types>>>>::value_type *v13; // rdx
std::_List_unchecked_const_iterator>>, std::_Iterator_base0>::_Nodeptr Ptr; // rax
std::_List_val>>::_Nodeptr v15; // rax
FMOD::Sound *v16; // rdx
_BYTE v17[32]; // [rsp+30h] [rbp-48h] BYREF
int v18; // [rsp+80h] [rbp+8h] BYREF
Myhead = a1->m_soundPathToSound._List._Mypair._Myval2._Myhead;
v3 = *(std::_List_simple_types>::_Node **)Myhead;
if ( *(std::_List_val>>::_Nodeptr *)Myhead != Myhead )
{
do
{
a1->m_lastResult = FMOD::Sound::getOpenState(
*((FMOD::Sound **)v3 + 6),
(enum FMOD_OPENSTATE *)&v18,
nullptr,
nullptr,
nullptr);
if ( (v18 & 0xFFFFFFF9) == 0 && v18 != 4 )
{
v5 = sub_14003BDB0((__int64)v17, (__int64)v3 + 16);
FMODAudioEngine::storeEffect((__int64)a1, *((FMOD::Sound **)v3 + 6), v5);
v6 = sub_14003BDB0((__int64)v17, (__int64)v3 + 16);
FMODAudioEngine::queuedEffectFinishedLoading(a1, v6);
v7 = (char *)v3 + 16;
v8 = *(std::_List_simple_types>::_Node **)v3;
if ( *((_QWORD *)v3 + 5) > 0xFu )
v7 = *((char **)v3 + 2);
v9 = *((_QWORD *)v3 + 4);
v10 = 0xCBF29CE484222325uLL;
for ( i = 0; i < v9; v10 = 0x100000001B3LL * (v12 ^ v10) )
v12 = (unsigned __int8)v7[i++];
v13 = &a1->m_soundPathToSound._Vec._Mypair._Myval2._Myfirst[2 * (v10 & a1->m_soundPathToSound._Mask)];
Ptr = v13->_Ptr;
if ( v13[1]._Ptr == v3 )
{
if ( Ptr == v3 )
{
v15 = a1->m_soundPathToSound._List._Mypair._Myval2._Myhead;
v13->_Ptr = v15;
}
else
{
v15 = *((std::_List_val>>::_Nodeptr *)v3
+ 1);
}
v13[1]._Ptr = v15;
}
else if ( Ptr == v3 )
{
v13->_Ptr = v8;
}
v16 = *(FMOD::Sound **)v3;
--a1->m_soundPathToSound._List._Mypair._Myval2._Mysize;
**((_QWORD **)v3 + 1) = v16;
*(_QWORD *)&v16[8] = *((_QWORD *)v3 + 1);
sub_14003A830((__int64)v3 + 16);
j_j_free(v3);
}
else
{
v8 = *(std::_List_simple_types>::_Node **)v3;
}
v3 = v8;
}
while ( v8 != a1->m_soundPathToSound._List._Mypair._Myval2._Myhead );
}
}