//
// GJBaseGameLayer::orderSpawnObjects from 0x100141b90 to 0x100141c3b (171 bytes)
//
// 2 xrefs:
// > PlayLayer::createObjectsFromSetupFinished @ 0x1000844be
// > LevelEditorLayer::onPlaytest @ 0x1000c5e79
//
// 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:24:55 +0000
//
__int64 __fastcall GJBaseGameLayer::orderSpawnObjects(__int64 a1)
{
__int64 v1; // rax
__int64 v3; // rdi
unsigned int *v4; // rax
_QWORD *v5; // r12
unsigned __int64 v6; // r13
__int64 v7; // r15
_QWORD v9[6]; // [rsp+0h] [rbp-30h] BYREF
v9[0] = v1;
cocos2d::CCDictionary::removeAllObjects(*(_QWORD *)(a1 + 3312));
v3 = *(_QWORD *)(a1 + 3304);
if ( v3 )
{
v4 = *(unsigned int **)(v3 + 56);
if ( *v4 )
{
v5 = *((_QWORD **)v4 + 2);
v6 = (unsigned __int64)&v5[*v4 - 1];
do
{
v7 = *v5;
if ( !*v5 )
break;
(*(void (__fastcall **)(_QWORD *, _QWORD))(*(_QWORD *)v7 + 1816LL))(v9, *v5);
sub_100278300(v7 + 1784, v9);
++v5;
}
while ( (unsigned __int64)v5 <= v6 );
v3 = *(_QWORD *)(a1 + 3304);
}
}
else
{
v3 = 0;
}
return LevelTools::sortChannelOrderObjects(v3, *(_QWORD *)(a1 + 3312), 0);
}