//
// LevelEditorLayer::addToGroup from 0x1403fd340 to 0x1403fd495 (341 bytes)
//
// 4 xrefs:
// > ??> @ 0x14078b280
// > ??> @ 0x1408c663c
// > ??> @ 0x1408c6670
// > ??> @ 0x140925814
//
// 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:31:53 +0000
//
void __fastcall LevelEditorLayer::addToGroup(__int64 a1, struct cocos2d::CCObject *a2, int a3, char a4)
{
__int64 v4; // rbp
struct cocos2d::CCObject *Group; // rax
__int64 v9; // rcx
int v10; // eax
__int64 v11; // r14
struct cocos2d::CCObject *v12; // rsi
__int64 v13; // rax
__int64 v14; // rcx
struct cocos2d::CCObject *v15; // rsi
v4 = a3;
if ( a3 > 9999 )
return;
Group = GJBaseGameLayer::getGroup(a1, (unsigned int)a3);
cocos2d::CCArray::addObject(Group, a2);
v10 = 0;
if ( *((_BYTE *)a2 + 1298) )
{
if ( (int)v4 >= 0 )
v10 = v4;
v11 = v10;
v12 = *(struct cocos2d::CCObject **)(*(_QWORD *)(a1 + 3944) + 8LL * v10);
if ( v12 )
goto LABEL_12;
v12 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v9);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 3888), v12, v11);
v13 = *(_QWORD *)(a1 + 3944);
}
else
{
if ( (int)v4 >= 0 )
v10 = v4;
v11 = v10;
v12 = *(struct cocos2d::CCObject **)(*(_QWORD *)(a1 + 3920) + 8LL * v10);
if ( v12 )
goto LABEL_12;
v12 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v9);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 3880), v12, v11);
v13 = *(_QWORD *)(a1 + 3920);
}
*(_QWORD *)(v13 + 8 * v11) = v12;
LABEL_12:
cocos2d::CCArray::addObject(v12, a2);
if ( *((_BYTE *)a2 + 1261) )
{
v15 = *(struct cocos2d::CCObject **)(*(_QWORD *)(a1 + 15048) + 8 * v4);
if ( !v15 )
{
v15 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v14);
*(_QWORD *)(*(_QWORD *)(a1 + 15048) + 8 * v4) = v15;
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 15040), v15, v4);
}
if ( a4 || !cocos2d::CCArray::containsObject(v15, a2) )
cocos2d::CCArray::addObject(v15, a2);
}
*(_BYTE *)(a1 + 15666) = 1;
}