//
// GJBaseGameLayer::groupStickyObjects from 0x10013de80 to 0x10013df95 (277 bytes)
//
// 2 xrefs:
// > EditorUI::onGroupSticky @ 0x10000c8f7
// > GJBaseGameLayer::assignNewStickyGroups @ 0x10013e14f
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJBaseGameLayer::groupStickyObjects(GJBaseGameLayer *a1, cocos2d::CCArray *a2)
{
unsigned int v2; // eax
cocos2d::CCObject *v3; // r15
unsigned int v4; // r13d
unsigned int v5; // r12d
signed int v6; // eax
unsigned int v7; // r12d
__int64 v8; // rax
int v9; // ecx
v2 = sub_100720070(a2);
v3 = (cocos2d::CCObject *)sub_10071FD00(v2);
if ( !(unsigned int)sub_100720070(a2) )
goto LABEL_9;
v4 = 0;
v5 = 0;
do
{
v6 = *(_DWORD *)(sub_1007200C0(a2, v5) + 872);
if ( v4 )
{
if ( v6 > 0 && v6 != v4 )
{
GJBaseGameLayer::ungroupStickyObjects(a1, a2);
goto LABEL_9;
}
}
else
{
v4 = v6;
}
++v5;
}
while ( v5 < (unsigned int)sub_100720070(a2) );
if ( !v4 )
{
LABEL_9:
v4 = a1->m_lastUsedLinkedID + 1;
a1->m_lastUsedLinkedID = v4;
}
if ( (unsigned int)sub_100720070(a2) )
{
v7 = 0;
do
{
v8 = sub_1007200C0(a2, v7);
v9 = *(_DWORD *)(v8 + 1028);
if ( v9 != 747 && v9 != 749 )
{
*(_DWORD *)(v8 + 872) = v4;
sub_10071FCD0(v3, v8);
}
++v7;
}
while ( v7 < (unsigned int)sub_100720070(a2) );
}
cocos2d::CCDictionary::setObject(a1->m_linkedGroupDict, v3, v4);
}