//
// GJBaseGameLayer::sortStickyGroups from 0x14032d1b0 to 0x14032d309 (345 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updateSpecialGroupData @ 0x1403140e0
// > LevelEditorLayer::init @ 0x1403eecff
// > ??> @ 0x14091f3c4
//
// 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 11:30:30 +0000
//
void __fastcall GJBaseGameLayer::sortStickyGroups(__int64 a1)
{
unsigned int v2; // esi
cocos2d::CCDictionary *i; // r14
int *v4; // rbp
__int64 v5; // rax
__int64 v6; // rcx
struct cocos2d::CCObject *v7; // rbx
__int64 v8; // rsi
__int64 j; // rbp
unsigned int v10; // ebx
cocos2d::CCArray *v11; // rsi
struct cocos2d::CCObject *v12; // rax
v2 = 0;
for ( i = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(a1);
v2 < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 3536));
++v2 )
{
v4 = (int *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 3536), v2);
v5 = v4[220];
if ( (int)v5 > 0 )
{
v7 = cocos2d::CCDictionary::objectForKey(i, v5);
if ( !v7 )
{
v7 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v6);
cocos2d::CCDictionary::setObject(i, v7, v4[220]);
}
cocos2d::CCArray::addObject(v7, (struct cocos2d::CCObject *)v4);
}
}
*(_DWORD *)(a1 + 4264) = 0;
if ( i )
{
v8 = *((_QWORD *)i + 7);
if ( v8 )
{
for ( j = *(_QWORD *)(v8 + 288); ; j = *(_QWORD *)(j + 288) )
{
++*(_DWORD *)(a1 + 4264);
v10 = 0;
v11 = *(cocos2d::CCArray **)(v8 + 264);
if ( cocos2d::CCArray::count(v11) )
{
do
{
v12 = cocos2d::CCArray::objectAtIndex(v11, v10++);
*((_DWORD *)v12 + 220) = *(_DWORD *)(a1 + 4264);
}
while ( v10 < cocos2d::CCArray::count(v11) );
}
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 4256), v11, *(unsigned int *)(a1 + 4264));
v8 = j;
if ( !j )
break;
}
}
}
}