//
// GJBaseGameLayer::addToGroupParents from 0x9bea90 to 0x9bec04 (372 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::addSpecial @ 0x7a0a18
// > ??> @ 0xa5688
//
// 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:28 +0000
//
__int64 __fastcall GJBaseGameLayer::addToGroupParents(GJBaseGameLayer *this, GameObject *a2)
{
cocos2d::CCArray *v5; // x21
int v6; // w1
unsigned int v7; // w19
__int64 *v8; // x26
__int64 i; // x19
int v10; // [xsp+64h] [xbp+64h] BYREF
if ( *((_BYTE *)a2 + 1170) )
{
v5 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(
*((cocos2d::CCDictionary **)this + 463),
*((unsigned int *)a2 + 229));
if ( v5 )
{
v6 = *((_DWORD *)a2 + 229);
*((_BYTE *)a2 + 1170) = 0;
v7 = 0;
v10 = v6;
v8 = std::__hash_table>,std::__unordered_map_hasher>,std::hash,true>,std::__unordered_map_equal>,std::equal_to,true>,std::allocator>>>::find(
(_QWORD *)this + 469,
&v10);
while ( v7 < (unsigned int)cocos2d::CCArray::count(v5) )
{
v10 = *(_DWORD *)(cocos2d::CCArray::objectAtIndex(v5, v7) + 56);
GJBaseGameLayer::setGroupParent((__int64)this, a2, v10);
if ( v8 && std::__hash_table,std::equal_to,std::allocator>::find(v8 + 3, &v10) )
{
++v7;
GJBaseGameLayer::promoteGroupParent((cocos2d::CCDictionary **)this, (cocos2d::CCDictionary **)a2, v10);
}
else
{
++v7;
}
}
if ( v8 )
{
for ( i = v8[5]; i; i = *(_QWORD *)i )
{
v10 = *(_DWORD *)(i + 16);
std::__hash_table,std::equal_to,std::allocator>::__erase_unique(
(__int64 *)this + 474,
&v10);
}
std::__hash_table>,std::__unordered_map_hasher>,std::hash,true>,std::__unordered_map_equal>,std::equal_to,true>,std::allocator>>>::erase(
(__int64 *)this + 469,
v8);
}
cocos2d::CCDictionary::removeObjectForKey(*((cocos2d::CCDictionary **)this + 463), *((unsigned int *)a2 + 229));
}
}
return _stack_chk_guard;
}