//
// GJBaseGameLayer::gameEventTriggered from 0x1000fd8a0 to 0x1000fdc00 (864 bytes)
//
// 41 xrefs:
// > PlayLayer::processCheckpoints @ 0x1000889c1
// > PlayLayer::resetLevel @ 0x10008d040
// > LevelEditorLayer::checkpointActivated @ 0x1000c72a9
// > GJBaseGameLayer::teleportPlayer @ 0x1000fd3e3
// > GJBaseGameLayer::gameEventTriggered @ 0x1000fdbe7
// > GJBaseGameLayer::playerWillSwitchMode @ 0x10010255c
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104dd9
// > GJBaseGameLayer::collisionCheckObjects @ 0x100105117
// > GJBaseGameLayer::collisionCheckObjects @ 0x10010535a
// > GJBaseGameLayer::collisionCheckObjects @ 0x10010554c
// > GJBaseGameLayer::bumpPlayer @ 0x100105c10
// > GJBaseGameLayer::bumpPlayer @ 0x100105c21
// > GJBaseGameLayer::gravBumpPlayer @ 0x100105e6f
// > GJBaseGameLayer::playerTouchedRing @ 0x100105eeb
// > GJBaseGameLayer::destroyObject @ 0x10010627f
// > GJBaseGameLayer::handleButton @ 0x100129049
// > PlayerObject::updateJump @ 0x1003eb695
// > PlayerObject::updateJump @ 0x1003ebab2
// > PlayerObject::updateJump @ 0x1003ebcdc
// > PlayerObject::updateJump @ 0x1003ec0f1
// > PlayerObject::updateJump @ 0x1003ec586
// > PlayerObject::updateJump @ 0x1003ec9aa
// > PlayerObject::updateJump @ 0x1003ecf91
// > PlayerObject::stopDashing @ 0x1003ef35f
// > PlayerObject::spiderTestJump @ 0x1003f07e7
// > PlayerObject::flipGravity @ 0x1003f096e
// > PlayerObject::gameEventTriggered @ 0x1003f0c3a
// > PlayerObject::postCollision @ 0x1003f3430
// > PlayerObject::postCollision @ 0x1003f3472
// > PlayerObject::postCollision @ 0x1003f3510
// > PlayerObject::postCollision @ 0x1003f3556
// > PlayerObject::postCollision @ 0x1003f35a8
// > PlayerObject::collidedWithObjectInternal @ 0x1003f6970
// > PlayerObject::collidedWithObjectInternal @ 0x1003f6b57
// > PlayerObject::hitGround @ 0x1003f8e53
// > PlayerObject::hitGround @ 0x1003f8f74
// > PlayerObject::startDashing @ 0x1003fef71
// > PlayerObject::ringJump @ 0x1004016b8
// > PlayerObject::ringJump @ 0x1004016fb
// > PlayerObject::ringJump @ 0x100401a69
// > PlayerObject::bumpPlayer @ 0x10040796d
//
// This function is hookable on this platform (idp: pc, 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:21:19 +0000
//
void __fastcall GJBaseGameLayer::gameEventTriggered(__int64 a1, signed int a2, unsigned int a3, int a4, double a5)
{
unsigned int v5; // r14d
signed int v6; // ebx
__int64 *v7; // r12
__int64 *v8; // rax
_QWORD *v9; // r15
__int64 *v10; // r13
int v11; // eax
char *v12; // r13
__int64 v13; // r15
__int64 v14; // rax
int v15; // ecx
__int64 v16; // rax
__int64 *v17; // r13
__int64 v18; // r15
int v19; // eax
__int64 *v20; // r15
__int64 v21; // rax
__int64 v22; // rax
char *v23; // r15
char *v24; // r13
int v25; // eax
char *v26; // rbx
__int64 v27; // rbx
__int64 v28; // rax
unsigned int *v29; // r15
unsigned int *i; // r13
const void *v31; // rbx
signed __int64 v32; // r12
char *v33; // r14
unsigned __int64 v36; // [rsp+18h] [rbp-68h]
__int64 *v37; // [rsp+28h] [rbp-58h]
int v38; // [rsp+28h] [rbp-58h]
void *__p[2]; // [rsp+30h] [rbp-50h] BYREF
char *v40; // [rsp+40h] [rbp-40h]
__int64 v41; // [rsp+50h] [rbp-30h]
v5 = a2;
v6 = a4 + 10000 * a3;
v36 = (unsigned __int64)(unsigned int)v6 << 32;
v7 = (__int64 *)(a1 + 1336);
v41 = a1;
v8 = *(__int64 **)(a1 + 1336);
v9 = (_QWORD *)(a1 + 1336);
v10 = (__int64 *)(a1 + 1336);
LABEL_3:
if ( v8 )
{
while ( 1 )
{
v10 = v8;
if ( *((_DWORD *)v8 + 7) > a2 )
{
LABEL_2:
v8 = (__int64 *)*v10;
v9 = v10;
goto LABEL_3;
}
if ( *((_DWORD *)v8 + 7) >= a2 )
{
v11 = *((_DWORD *)v8 + 8);
if ( v6 < v11 )
goto LABEL_2;
if ( v6 <= v11 )
break;
}
v8 = (__int64 *)v10[1];
if ( !v8 )
{
v9 = v10 + 1;
goto LABEL_10;
}
}
v15 = *(_DWORD *)(v41 + 944);
if ( *((_DWORD *)v10 + 9) == v15 )
goto LABEL_47;
}
else
{
LABEL_10:
v37 = v10;
v12 = (char *)operator new(0x28u);
*(_QWORD *)(v12 + 28) = (unsigned int)a2 | v36;
*((_DWORD *)v12 + 9) = 0;
a5 = 0.0;
*(_OWORD *)v12 = 0;
*((_QWORD *)v12 + 2) = v37;
*v9 = v12;
v13 = v41;
v14 = **(_QWORD **)(v41 + 1328);
if ( v14 )
*(_QWORD *)(v41 + 1328) = v14;
sub_10001B680(*(__int64 **)(v13 + 1336), (__int64 *)v12);
++*(_QWORD *)(v13 + 1344);
v15 = *(_DWORD *)(v13 + 944);
if ( *((_DWORD *)v12 + 9) == v15 )
goto LABEL_47;
}
v16 = *v7;
v17 = (__int64 *)(a1 + 1336);
v18 = v41;
if ( !*v7 )
goto LABEL_22;
do
{
while ( 1 )
{
v17 = (__int64 *)v16;
if ( *(_DWORD *)(v16 + 28) <= a2 )
{
if ( *(_DWORD *)(v16 + 28) < a2 )
goto LABEL_20;
v19 = *(_DWORD *)(v16 + 32);
if ( v6 >= v19 )
break;
}
v16 = *v17;
v7 = v17;
if ( !*v17 )
goto LABEL_22;
}
if ( v6 <= v19 )
goto LABEL_25;
LABEL_20:
v16 = v17[1];
}
while ( v16 );
v7 = v17 + 1;
LABEL_22:
v38 = v15;
v20 = v17;
v17 = (__int64 *)operator new(0x28u);
*(__int64 *)((char *)v17 + 28) = (unsigned int)a2 | v36;
*((_DWORD *)v17 + 9) = 0;
a5 = 0.0;
*(_OWORD *)v17 = 0;
v17[2] = (__int64)v20;
v18 = v41;
*v7 = (__int64)v17;
v21 = **(_QWORD **)(v18 + 1328);
if ( v21 )
*(_QWORD *)(v18 + 1328) = v21;
sub_10001B680(*(__int64 **)(v18 + 1336), v17);
++*(_QWORD *)(v18 + 1344);
v15 = v38;
LABEL_25:
*((_DWORD *)v17 + 9) = v15;
v22 = *(_QWORD *)(v18 + 1312);
if ( v22 )
{
while ( 1 )
{
v24 = (char *)v22;
if ( *(_DWORD *)(v22 + 32) > a2 )
goto LABEL_27;
if ( *(_DWORD *)(v22 + 32) < a2 )
{
LABEL_32:
v22 = *((_QWORD *)v24 + 1);
if ( !v22 )
{
v23 = v24 + 8;
goto LABEL_34;
}
}
else
{
v25 = *(_DWORD *)(v22 + 36);
if ( v6 >= v25 )
{
if ( v6 <= v25 )
goto LABEL_37;
goto LABEL_32;
}
LABEL_27:
v22 = *(_QWORD *)v24;
v23 = v24;
if ( !*(_QWORD *)v24 )
goto LABEL_34;
}
}
}
v23 = (char *)(v18 + 1312);
v24 = v23;
LABEL_34:
v26 = v24;
v24 = (char *)operator new(0x40u);
*((_QWORD *)v24 + 4) = (unsigned int)a2 | v36;
a5 = 0.0;
*(_OWORD *)(v24 + 40) = 0;
*((_QWORD *)v24 + 7) = 0;
*(_OWORD *)v24 = 0;
*((_QWORD *)v24 + 2) = v26;
*(_QWORD *)v23 = v24;
v27 = v41;
v28 = **(_QWORD **)(v41 + 1304);
if ( v28 )
*(_QWORD *)(v41 + 1304) = v28;
sub_10001B680(*(__int64 **)(v27 + 1312), (__int64 *)v24);
++*(_QWORD *)(v27 + 1320);
LABEL_37:
v29 = *((unsigned int **)v24 + 5);
for ( i = *((unsigned int **)v24 + 6); v29 != i; v29 += 10 )
{
if ( !*((_BYTE *)v29 + 12) )
{
*(_OWORD *)__p = 0;
v40 = nullptr;
v31 = *((const void **)v29 + 2);
v32 = *((_QWORD *)v29 + 3) - (_QWORD)v31;
if ( v32 )
{
if ( v32 < 0 )
sub_100093980();
__p[0] = operator new(v32);
__p[1] = __p[0];
v33 = (char *)__p[0] + v32;
v40 = (char *)__p[0] + v32;
memcpy(__p[0], v31, v32);
__p[1] = v33;
v5 = a2;
}
a5 = 0.0;
(*(void (__fastcall **)(__int64, _QWORD, _QWORD, void **, _QWORD, _QWORD, double))(*(_QWORD *)v41 + 1256LL))(
v41,
*v29,
0,
__p,
v29[1],
v29[2],
0.0);
if ( __p[0] )
{
__p[1] = __p[0];
operator delete(__p[0]);
}
}
}
LABEL_47:
if ( a4 )
GJBaseGameLayer::gameEventTriggered(v41, v5, a3, 0, a5);
}