//
// GJBaseGameLayer::groupStickyObjects from 0x9a3b9c to 0x9a3cc4 (296 bytes)
//
// 3 xrefs:
// > EditorUI::onGroupSticky @ 0x7c8968
// > GJBaseGameLayer::assignNewStickyGroups @ 0x9a3d8c
// > ??> @ 0xfb938
//
// This function is hookable on this platform (idp: arm, 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:58:09 +0000
//
__int64 __fastcall GJBaseGameLayer::groupStickyObjects(cocos2d::CCDictionary **this, cocos2d::CCArray *a2)
{
cocos2d::CCArray *v4; // x0
unsigned int v5; // w1
cocos2d::CCArray *v6; // x22
unsigned int v7; // w19
unsigned int v8; // w21
bool v9; // cf
unsigned int v10; // w1
cocos2d::CCArray *v11; // x0
__int64 v12; // x0
unsigned int v13; // w19
unsigned int v14; // w1
cocos2d::CCArray *i; // x0
cocos2d::CCObject *v16; // x3
int v18; // w0
v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(a2);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity(v4, v5);
v7 = 0;
v8 = 0;
v9 = (unsigned int)cocos2d::CCArray::count(a2) == 0;
v10 = 0;
v11 = a2;
if ( v9 )
{
LABEL_6:
if ( !v8 )
goto LABEL_16;
goto LABEL_7;
}
while ( 1 )
{
v12 = cocos2d::CCArray::objectAtIndex(v11, v10);
if ( v8 )
break;
v8 = *(_DWORD *)(v12 + 872);
LABEL_4:
v9 = ++v7 >= (unsigned int)cocos2d::CCArray::count(a2);
v10 = v7;
v11 = a2;
if ( v9 )
goto LABEL_6;
}
v18 = *(_DWORD *)(v12 + 872);
if ( v18 <= 0 || v18 == v8 )
goto LABEL_4;
GJBaseGameLayer::ungroupStickyObjects(this, a2);
LABEL_16:
v8 = *((_DWORD *)this + 972) + 1;
*((_DWORD *)this + 972) = v8;
LABEL_7:
v13 = 0;
v9 = (unsigned int)cocos2d::CCArray::count(a2) == 0;
v14 = 0;
for ( i = a2; !v9; i = a2 )
{
v16 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(i, v14);
if ( ((*((_DWORD *)v16 + 257) - 747) & 0xFFFFFFFD) != 0 )
{
*((_DWORD *)v16 + 218) = v8;
cocos2d::CCArray::addObject(v6, v16);
}
v9 = ++v13 >= (unsigned int)cocos2d::CCArray::count(a2);
v14 = v13;
}
return cocos2d::CCDictionary::setObject(*(this + 485), v6, v8);
}