//
// GJBaseGameLayer::setGroupParent from 0x9a33fc to 0x9a3544 (328 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::promoteGroupParent @ 0x9a35a0
// > GJBaseGameLayer::loadGroupParentsFromString @ 0x9b3128
// > GJBaseGameLayer::addToGroupParents @ 0x9beb74
// > ??> @ 0xcd1b0
//
// 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:08 +0000
//
__int64 __fastcall GJBaseGameLayer::setGroupParent(__int64 this, GameObject *a2, int a3)
{
__int64 v3; // x23
__int64 v4; // x19
cocos2d::CCArray *v7; // x0
cocos2d::CCObject *v8; // x20
cocos2d::CCObject *v9; // x20
unsigned int i; // w19
cocos2d::CCObject *v11; // x19
if ( a3 > 0 && a2 )
{
v3 = a3;
v4 = this;
v7 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(this + 3688), a3);
v8 = v7;
if ( v7 )
{
this = (unsigned __int8)cocos2d::CCArray::containsObject(v7, a2);
if ( (_BYTE)this )
return this;
}
else
{
v8 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v4 + 3688), v8, v3);
}
cocos2d::CCArray::addObject(v8, a2);
v9 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(v4 + 3696),
*((unsigned int *)a2 + 229));
if ( !v9 )
{
v9 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(v4 + 3696), v9, *((unsigned int *)a2 + 229));
}
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v9); ++i )
{
if ( a3 == *(_DWORD *)(cocos2d::CCArray::objectAtIndex(v9, i) + 56) )
goto LABEL_12;
}
v11 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCObject::CCObject(v11);
*((_DWORD *)v11 + 14) = a3;
*(_QWORD *)v11 = &off_1428350;
cocos2d::CCObject::autorelease(v11);
cocos2d::CCArray::addObject(v9, v11);
LABEL_12:
this = 1;
*((_BYTE *)a2 + 1170) = 1;
}
return this;
}