//
// GJEffectManager::storeTriggeredID from 0x5ce548 to 0x5ce5d4 (140 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::playerTouchedTrigger @ 0x5a412e
// > GJBaseGameLayer::collisionCheckObjects @ 0x5ba974
// > GJBaseGameLayer::collisionCheckObjects @ 0x5ba9c8
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:54:01 +0000
//
_DWORD *__fastcall GJEffectManager::storeTriggeredID(GJEffectManager *this, int a2, int a3)
{
_DWORD *result; // r0
_DWORD *v7; // r3
int v8; // r2
int v9; // r2
_DWORD *v10; // r0
int v11; // r1
_DWORD *v12; // r4
_DWORD **v13; // r4
_DWORD v14[2]; // [sp+0h] [bp-8h] BYREF
v14[0] = this;
v14[1] = a2;
result = &_stack_chk_guard;
v7 = *((_DWORD **)this + 161);
if ( !v7 )
{
v13 = (_DWORD **)((char *)this + 644);
v14[0] = (char *)this + 644;
goto LABEL_8;
}
while ( 1 )
{
v8 = v7[4];
if ( a2 >= v8 )
{
if ( v8 < a2 )
goto LABEL_13;
v9 = v7[5];
if ( a3 >= v9 )
break;
}
v12 = (_DWORD *)*v7;
if ( !*v7 )
{
v14[0] = v7;
v13 = (_DWORD **)v7;
goto LABEL_8;
}
LABEL_11:
v7 = v12;
}
if ( v9 >= a3 )
{
v14[0] = v7;
v13 = (_DWORD **)v14;
goto LABEL_8;
}
LABEL_13:
v12 = (_DWORD *)v7[1];
if ( v12 )
goto LABEL_11;
v14[0] = v7;
v13 = (_DWORD **)(v7 + 1);
LABEL_8:
if ( !*v13 )
{
v10 = (_DWORD *)operator new(0x18u);
v11 = v14[0];
v10[4] = a2;
v10[5] = a3;
return std::__tree>::__insert_node_at((int **)this + 160, v11, v13, v10);
}
return result;
}