//
// GJBaseGameLayer::setGroupParent from 0x592820 to 0x5928ba (154 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::promoteGroupParent @ 0x5928ee
// > GJBaseGameLayer::loadGroupParentsFromString @ 0x59d91e
// > GJBaseGameLayer::addToGroupParents @ 0x5a1e14
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:53:07 +0000
//
int __fastcall GJBaseGameLayer::setGroupParent(int this, GameObject *a2, cocos2d::CCInteger *a3)
{
int v4; // r7
cocos2d::CCArray *v6; // r0
cocos2d::CCObject *v7; // r4
cocos2d::CCObject *v8; // r4
unsigned int i; // r7
int v10; // r1
cocos2d::CCObject *v11; // r0
v4 = this;
if ( (int)a3 > 0 && a2 )
{
v6 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(this + 2320), (int)a3);
v7 = v6;
if ( v6 )
{
this = cocos2d::CCArray::containsObject(v6, a2);
if ( this )
return this;
}
else
{
v7 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v4 + 2320), v7, (int)a3);
}
cocos2d::CCArray::addObject(v7, a2);
v8 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(v4 + 2324),
*((_DWORD *)a2 + 195));
if ( !v8 )
{
v8 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v4 + 2324), v8, *((_DWORD *)a2 + 195));
}
for ( i = 0; i < cocos2d::CCArray::count(v8); ++i )
{
this = cocos2d::CCArray::objectAtIndex(v8, i);
if ( *(cocos2d::CCInteger **)(this + 52) == a3 )
goto LABEL_13;
}
v11 = cocos2d::CCInteger::create(a3, v10);
this = cocos2d::CCArray::addObject(v8, v11);
LABEL_13:
*((_BYTE *)a2 + 1022) = 1;
}
return this;
}