//
// FMODAudioEngine::updateQueuedEffects from 0x6dc220 to 0x6dc4d0 (688 bytes)
//
// 2 xrefs:
// > sub_6DC4D0 @ 0x6dc530
// > ??> @ 0xabbf8
//
// 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 12:51:34 +0000
//
__int64 __fastcall FMODAudioEngine::updateQueuedEffects(FMODAudioEngine *this)
{
FMOD::Sound *v2; // x19
FMOD::Sound **v3; // x23
__int64 *v4; // x21
FMOD::Sound *v5; // x25
__int64 v6; // x1
__int64 v7; // x1
unsigned __int64 v8; // x2
FMOD::Sound *v9; // x3
unsigned __int64 v10; // x4
unsigned __int64 v11; // x5
__int64 v12; // x7
FMOD::Sound *v13; // x25
unsigned __int64 v14; // x5
__int64 v15; // x8
FMOD::Sound **i; // x1
FMOD::Sound *v17; // x0
unsigned __int64 v18; // x0
unsigned __int64 v19; // x0
__int64 v20; // x0
FMOD::Sound *v21; // x0
unsigned __int64 v22; // x6
FMOD::Sound *v23; // x0
__int64 v25; // [xsp+50h] [xbp+50h] BYREF
__int64 v26; // [xsp+58h] [xbp+58h]
void *v27; // [xsp+60h] [xbp+60h]
v2 = *((FMOD::Sound **)this + 188);
if ( v2 )
{
v3 = (FMOD::Sound **)((char *)this + 1504);
do
{
while ( 1 )
{
v4 = (__int64 *)((char *)v2 + 16);
if ( (unsigned __int8)FMODAudioEngine::isSoundReady(this, *((FMOD::Sound **)v2 + 5)) )
break;
v2 = *(FMOD::Sound **)v2;
if ( !v2 )
return _stack_chk_guard;
}
v5 = *((FMOD::Sound **)v2 + 5);
v25 = 0;
v26 = 0;
v27 = nullptr;
if ( (*((_BYTE *)v2 + 16) & 1) != 0 )
{
std::string::__init(&v25, *((void **)v2 + 4), *((_QWORD *)v2 + 3));
}
else
{
v6 = *((_QWORD *)v2 + 3);
v25 = *v4;
v26 = v6;
v27 = *((void **)v2 + 4);
}
FMODAudioEngine::storeEffect((__int64)this, v5, (__int64)&v25);
if ( (v25 & 1) != 0 )
{
operator delete(v27);
v25 = 0;
v26 = 0;
v27 = nullptr;
if ( (*(_BYTE *)v4 & 1) == 0 )
{
LABEL_8:
v7 = *((_QWORD *)v2 + 3);
v25 = *v4;
v26 = v7;
v27 = *((void **)v2 + 4);
goto LABEL_9;
}
}
else
{
v25 = 0;
v26 = 0;
v27 = nullptr;
if ( (*(_BYTE *)v4 & 1) == 0 )
goto LABEL_8;
}
std::string::__init(&v25, *((void **)v2 + 4), *((_QWORD *)v2 + 3));
LABEL_9:
FMODAudioEngine::queuedEffectFinishedLoading((__int64)this, (__int64)&v25);
if ( (v25 & 1) != 0 )
operator delete(v27);
v8 = *((_QWORD *)this + 187);
v9 = *(FMOD::Sound **)v2;
v10 = v8 - 1;
v11 = *((_QWORD *)v2 + 1);
v12 = (v8 - 1) & v8;
v13 = *(FMOD::Sound **)v2;
if ( v12 )
v14 = v11 % v8;
else
v14 = v10 & v11;
v15 = *((_QWORD *)this + 186);
for ( i = *(FMOD::Sound ***)(v15 + 8 * v14); v2 != *i; i = (FMOD::Sound **)*i )
;
if ( i == v3
|| ((v17 = i[1], v12) ? (v18 = (unsigned __int64)v17 % v8) : (v18 = v10 & (unsigned __int64)v17), v14 != v18) )
{
if ( v9 )
{
v19 = *((_QWORD *)v9 + 1);
if ( v12 )
{
v22 = v19 / v8;
if ( v14 == v19 % v8 )
goto LABEL_27;
}
else
{
v20 = v10 & v19;
if ( v14 == v20 )
goto LABEL_28;
}
}
*(_QWORD *)(v15 + 8 * v14) = 0;
v9 = *(FMOD::Sound **)v2;
}
v21 = v9;
if ( !v9 )
goto LABEL_30;
v19 = *((_QWORD *)v9 + 1);
if ( v12 )
{
v22 = v19 / v8;
LABEL_27:
v20 = v19 - v22 * v8;
LABEL_28:
if ( v14 != v20 )
goto LABEL_29;
goto LABEL_40;
}
v20 = v10 & v19;
if ( v14 != v20 )
{
LABEL_29:
*(_QWORD *)(*((_QWORD *)this + 186) + 8 * v20) = i;
v21 = *(FMOD::Sound **)v2;
LABEL_30:
*i = v21;
*(_QWORD *)v2 = 0;
--*((_QWORD *)this + 189);
if ( (*(_BYTE *)v4 & 1) != 0 )
goto LABEL_41;
goto LABEL_31;
}
LABEL_40:
*i = v9;
*(_QWORD *)v2 = 0;
--*((_QWORD *)this + 189);
if ( (*(_BYTE *)v4 & 1) != 0 )
LABEL_41:
operator delete(*((void **)v2 + 4));
LABEL_31:
v23 = v2;
v2 = v13;
operator delete(v23);
}
while ( v13 );
}
return _stack_chk_guard;
}