//
// GJBaseGameLayer::processQueuedAudioTriggers from 0x9e010c to 0x9e01d8 (204 bytes)
//
// 4 xrefs:
// > PlayLayer::startMusic @ 0x710e38
// > LevelEditorLayer::onPlaytest @ 0x796750
// > EditorUI::onPlayback @ 0x7c299c
// > ??> @ 0x65c68
//
// 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:58:54 +0000
//
__int64 __fastcall GJBaseGameLayer::processQueuedAudioTriggers(__int64 this)
{
SFXTriggerGameObject **v1; // x19
SFXTriggerGameObject **v2; // x21
GJBaseGameLayer *v3; // x20
SFXTriggerGameObject *v4; // x1
int v5; // w2
__int64 v6; // x2
__int64 v7; // x1
*(_BYTE *)(this + 1983) = 0;
v1 = *(SFXTriggerGameObject ***)(this + 1984);
v2 = *(SFXTriggerGameObject ***)(this + 1992);
if ( v1 != v2 )
{
v3 = (GJBaseGameLayer *)this;
while ( 1 )
{
v4 = *v1;
v5 = *((_DWORD *)*v1 + 257);
if ( v5 == 3602 )
break;
if ( v5 > 3602 )
{
if ( v5 == 3603 )
{
this = GJBaseGameLayer::activateSFXEditTrigger(v3, v4);
}
else if ( v5 == 3605 )
{
this = GJBaseGameLayer::activateSongEditTrigger(v3, v4);
}
goto LABEL_6;
}
if ( v5 == 1934 )
{
++v1;
this = GJBaseGameLayer::activateSongTrigger(v3, v4);
if ( v2 == v1 )
{
LABEL_11:
v6 = *((_QWORD *)v3 + 248);
v7 = *((_QWORD *)v3 + 249);
if ( v7 != v6 )
{
this = v7 + 8 * ~((unsigned __int64)(v7 - 8 - v6) >> 3);
*((_QWORD *)v3 + 249) = this;
}
return this;
}
}
else
{
LABEL_6:
if ( v2 == ++v1 )
goto LABEL_11;
}
}
this = GJBaseGameLayer::activateSFXTrigger(v3, v4);
goto LABEL_6;
}
return this;
}