//
// GJBaseGameLayer::setGroupParent from 0x14032c3a0 to 0x14032c4ca (298 bytes)
//
// 6 xrefs:
// > GJBaseGameLayer::promoteGroupParent @ 0x14032c57f
// > GJBaseGameLayer::addToGroupParents @ 0x14032caf9
// > GJBaseGameLayer::loadGroupParentsFromString @ 0x14032cfec
// > ??> @ 0x1408b60c0
// > ??> @ 0x1408b60d0
// > ??> @ 0x14091f2c8
//
// 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::setGroupParent(__int64 a1, __int64 a2, int a3)
{
__int64 v3; // rsi
cocos2d::CCArray *v6; // rax
__int64 v7; // rcx
struct cocos2d::CCObject *v8; // rbx
__int64 v9; // rcx
struct cocos2d::CCObject *v10; // rdi
unsigned int v11; // ebx
struct cocos2d::CCObject *v12; // rax
if ( a3 > 0 )
{
v3 = a3;
if ( a2 )
{
v6 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 3968), a3);
v8 = v6;
if ( v6 )
{
if ( cocos2d::CCArray::containsObject(v6, (struct cocos2d::CCObject *)a2) )
return;
}
else
{
v8 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v7);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 3968), v8, v3);
}
cocos2d::CCArray::addObject(v8, (struct cocos2d::CCObject *)a2);
v10 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 3976), *(unsigned int *)(a2 + 924));
if ( !v10 )
{
v10 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v9);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 3976), v10, *(unsigned int *)(a2 + 924));
}
v11 = 0;
if ( cocos2d::CCArray::count(v10) )
{
while ( *((_DWORD *)cocos2d::CCArray::objectAtIndex(v10, v11) + 14) != (_DWORD)v3 )
{
if ( ++v11 >= cocos2d::CCArray::count(v10) )
goto LABEL_11;
}
}
else
{
LABEL_11:
v12 = cocos2d::CCInteger::create(v3);
cocos2d::CCArray::addObject(v10, v12);
}
*(_BYTE *)(a2 + 1178) = 1;
}
}
}