//
// GJBaseGameLayer::remapGroupParent from 0x5929f6 to 0x592ae2 (236 bytes)
//
// 1 xrefs:
// > EditorUI::replaceGroupID @ 0x482e78
//
// 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
//
cocos2d::CCDictionary **__fastcall GJBaseGameLayer::remapGroupParent(
cocos2d::CCDictionary **this,
GameObject *a2,
cocos2d::CCInteger *a3,
cocos2d::CCInteger *a4)
{
cocos2d::CCDictionary **v4; // r6
cocos2d::CCArray *v8; // r8
cocos2d::CCArray *v9; // r0
cocos2d::CCArray *v10; // r9
int v11; // r10
int v12; // r1
signed int i; // r8
cocos2d::CCInteger *v14; // r3
cocos2d::CCObject *v15; // r0
cocos2d::CCObject *v16; // r7
v4 = this;
if ( a2 )
{
if ( (int)a3 > 0 && (int)a4 > 0 && a3 != a4 )
{
this = (cocos2d::CCDictionary **)cocos2d::CCDictionary::objectForKey(*(this + 580), (int)a3);
v8 = (cocos2d::CCArray *)this;
if ( this )
{
this = (cocos2d::CCDictionary **)cocos2d::CCArray::containsObject((cocos2d::CCArray *)this, a2);
if ( this )
{
cocos2d::CCArray::removeObject(v8, a2, 1);
if ( !cocos2d::CCArray::count(v8) )
cocos2d::CCDictionary::removeObjectForKey(v4[580], (int)a3);
v9 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v4[581], *((_DWORD *)a2 + 195));
v10 = v9;
if ( v9 )
{
v11 = 0;
for ( i = cocos2d::CCArray::count(v9) - 1; i >= 0; --i )
{
v14 = *(cocos2d::CCInteger **)(cocos2d::CCArray::objectAtIndex(v10, i) + 52);
if ( v14 == a3 )
{
cocos2d::CCArray::removeObjectAtIndex(v10, i, 1);
}
else if ( v14 == a4 )
{
v11 = 1;
}
}
if ( !v11 )
{
v15 = cocos2d::CCInteger::create(a4, v12);
cocos2d::CCArray::addObject(v10, v15);
}
}
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v4[580], (int)a4);
if ( !v16 )
{
v16 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(v4[580], v16, (int)a4);
}
this = (cocos2d::CCDictionary **)cocos2d::CCArray::containsObject(v16, a2);
if ( !this )
return (cocos2d::CCDictionary **)cocos2d::CCArray::addObject(v16, a2);
}
}
}
}
return this;
}