//
// LevelEditorLayer::recreateGroups from 0x795f9c to 0x796170 (468 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::onResumePlaytest @ 0x796230
// > LevelEditorLayer::onPlaytest @ 0x7965c4
// > EditorUI::dynamicGroupUpdate @ 0x7d3cd8
// > ??> @ 0xeeb58
//
// 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:53:34 +0000
//
__int64 __fastcall LevelEditorLayer::recreateGroups(cocos2d::CCArray **this)
{
__int64 v2; // x19
cocos2d::CCArray *v3; // x0
cocos2d::CCArray *v4; // x0
cocos2d::CCArray *v5; // x1
__int64 v6; // x0
__int64 v7; // x0
__int64 i; // x19
unsigned int v9; // w22
cocos2d::CCArray *AllObjects; // x23
signed int v11; // w19
__int64 v12; // x21
unsigned int v13; // w1
unsigned int GroupID; // w0
int v15; // w0
__int64 result; // x0
GJBaseGameLayer::resetMoveOptimizedValue((GJBaseGameLayer *)this);
v2 = 0;
std::__hash_table>,std::__unordered_map_hasher>,std::hash,true>,std::__unordered_map_equal>,std::equal_to,true>,std::allocator>>>::clear((__int64)(this + 500));
std::__hash_table>,std::__unordered_map_hasher>,std::hash,true>,std::__unordered_map_equal>,std::equal_to,true>,std::allocator>>>::clear((__int64)(this + 505));
cocos2d::CCArray::removeAllObjects(*(this + 411));
cocos2d::CCArray::addObject(*(this + 411), *(this + 1530));
cocos2d::CCArray::addObject(*(this + 411), *(this + 1531));
do
{
v3 = *(cocos2d::CCArray **)((char *)*(this + 452) + v2);
if ( v3 )
cocos2d::CCArray::removeAllObjects(v3);
v4 = *(cocos2d::CCArray **)((char *)*(this + 455) + v2);
if ( v4 )
cocos2d::CCArray::removeAllObjects(v4);
v5 = *(cocos2d::CCArray **)((char *)*(this + 458) + v2);
v2 += 8;
if ( v5 )
cocos2d::CCArray::removeAllObjects(v5);
}
while ( v2 != 80000 );
v6 = (__int64)*(this + 1797);
if ( v6 )
{
v7 = *(_QWORD *)(v6 + 56);
if ( v7 )
{
for ( i = *(_QWORD *)(v7 + 288); ; i = *(_QWORD *)(i + 288) )
{
cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(v7 + 264));
v7 = i;
if ( !i )
break;
}
}
}
v9 = 0;
AllObjects = (cocos2d::CCArray *)LevelEditorLayer::getAllObjects((LevelEditorLayer *)this);
if ( (unsigned int)cocos2d::CCArray::count(AllObjects) )
{
do
{
v11 = 0;
v12 = cocos2d::CCArray::objectAtIndex(AllObjects, v9);
if ( *(__int16 *)(v12 + 1168) > 0 )
{
do
{
v13 = v11++;
GroupID = GameObject::getGroupID((GameObject *)v12, v13);
(*((void (__fastcall **)(cocos2d::CCArray **, __int64, _QWORD, __int64))*this + 169))(this, v12, GroupID, 1);
}
while ( *(__int16 *)(v12 + 1168) > v11 );
}
v15 = *(_DWORD *)(v12 + 1028);
if ( v15 == 1615 )
{
++v9;
GJBaseGameLayer::addObjectCounter((GJBaseGameLayer *)this, (LabelGameObject *)v12);
}
else if ( v15 == 1816 && *(_BYTE *)(v12 + 1677) )
{
++v9;
cocos2d::CCArray::addObject(*(this + 411), (cocos2d::CCObject *)v12);
}
else
{
++v9;
}
}
while ( v9 < (unsigned int)cocos2d::CCArray::count(AllObjects) );
}
result = *((unsigned __int8 *)*(this + 409) + 454);
if ( *((_BYTE *)*(this + 409) + 454) )
return GJBaseGameLayer::sortAllGroupsX((GJBaseGameLayer *)this);
return result;
}