//
// GJBaseGameLayer::sortStickyGroups from 0x1000f67a0 to 0x1000f68e8 (328 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::init @ 0x1000aae89
// > GJBaseGameLayer::updateSpecialGroupData @ 0x1000f36d1
//
// 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:15 +0000
//
__int64 __fastcall GJBaseGameLayer::sortStickyGroups(__int64 a1, __int64 a2)
{
__int64 v2; // r14
__int64 result; // rax
unsigned int v4; // r15d
__int64 v5; // rax
__int64 v6; // r12
__int64 v7; // rax
__int64 v8; // r13
__int64 v9; // r12
__int64 v10; // rax
__int64 v11; // r14
unsigned int v12; // r15d
v2 = cocos2d::CCDictionary::create(a1, a2);
result = sub_1007FEF90(*(_QWORD *)(a1 + 3280));
if ( (_DWORD)result )
{
v4 = 0;
do
{
v5 = sub_1007FEFE0(*(_QWORD *)(a1 + 3280), v4);
if ( *(int *)(v5 + 872) > 0LL )
{
v6 = v5;
v7 = cocos2d::CCDictionary::objectForKey_1(v2);
if ( !v7 )
{
v8 = sub_1007FE900(v2);
cocos2d::CCDictionary::setObject_1(v2, v8, *(int *)(v6 + 872));
v7 = v8;
}
sub_1007FEBF0(v7, v6);
}
++v4;
result = sub_1007FEF90(*(_QWORD *)(a1 + 3280));
}
while ( v4 < (unsigned int)result );
}
*(_DWORD *)(a1 + 3888) = 0;
if ( v2 )
{
v9 = *(_QWORD *)(v2 + 56);
while ( v9 )
{
v10 = v9;
v9 = *(_QWORD *)(v9 + 288);
++*(_DWORD *)(a1 + 3888);
v11 = *(_QWORD *)(v10 + 264);
if ( (unsigned int)sub_1007FEF90(v11) )
{
v12 = 0;
do
*(_DWORD *)(sub_1007FEFE0(v11, v12++) + 872) = *(_DWORD *)(a1 + 3888);
while ( v12 < (unsigned int)sub_1007FEF90(v11) );
}
result = cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 3880), v11, *(unsigned int *)(a1 + 3888));
}
}
return result;
}