//
// EditorUI::assignNewGroups from 0x7d1f84 to 0x7d2168 (484 bytes)
//
// 5 xrefs:
// > EditorUI::handleEditorAction @ 0xbd765c
// > EditorUI::handleEditorAction @ 0xbd7674
// > EditorCommandsPopup::onCommand @ 0xcbc0f4
// > EditorCommandsPopup::onCommand @ 0xcbc108
// > ??> @ 0x92818
//
// 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:54:16 +0000
//
__int64 __fastcall EditorUI::assignNewGroups(EditorUI *this, unsigned __int8 a2)
{
int v2; // w20
cocos2d::CCArray *v4; // x0
cocos2d::CCArray *v5; // x0
cocos2d::CCArray *v6; // x19
cocos2d::CCObject *v7; // x1
unsigned int *v8; // x1
void *v9; // x0
size_t v10; // x1
unsigned int *v11; // x1
__int64 *v12; // x21
__int64 *v13; // x25
__int64 i; // x22
LevelEditorLayer *v15; // x0
unsigned int NextFreeGroupID; // w24
_QWORD *v17; // x0
_QWORD *v18; // x19
void *v19; // x0
void *v21[2]; // [xsp+60h] [xbp+60h] BYREF
void *v22; // [xsp+70h] [xbp+70h]
__int64 v23; // [xsp+78h] [xbp+78h]
float v24; // [xsp+80h] [xbp+80h]
v2 = a2;
v4 = *((cocos2d::CCArray **)this + 187);
if ( v4 || (v4 = (cocos2d::CCArray *)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)), (_DWORD)v4) )
{
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
v6 = v5;
v7 = *((cocos2d::CCObject **)this + 187);
if ( v7 )
cocos2d::CCArray::addObject(v5, v7);
else
cocos2d::CCArray::addObjectsFromArray(v5, *((cocos2d::CCArray **)this + 112));
v8 = *((unsigned int **)v6 + 7);
v9 = *((void **)v8 + 2);
v10 = *v8;
if ( v2 )
qsort(v9, v10, 8u, (int (*)(const void *, const void *))alignYSort);
else
qsort(v9, v10, 8u, (int (*)(const void *, const void *))alignXSort);
v11 = *((unsigned int **)v6 + 7);
if ( *v11 )
{
v12 = *((__int64 **)v11 + 2);
v13 = &v12[*v11 - 1];
if ( v12 <= v13 )
{
for ( i = *v12; *v12; i = *v12 )
{
v15 = *((LevelEditorLayer **)this + 180);
v21[0] = nullptr;
v21[1] = nullptr;
v22 = nullptr;
v23 = 0;
v24 = 1.0;
NextFreeGroupID = LevelEditorLayer::getNextFreeGroupID(v15, (__int64)v21);
v17 = v22;
if ( v22 )
{
do
{
v18 = (_QWORD *)*v17;
operator delete(v17);
v17 = v18;
}
while ( v18 );
}
v19 = v21[0];
v21[0] = nullptr;
if ( v19 )
operator delete(v19);
if ( (*(unsigned int (__fastcall **)(__int64, _QWORD))(*(_QWORD *)i + 1600LL))(i, NextFreeGroupID) == 1 )
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, _QWORD))(**((_QWORD **)this + 180) + 1352LL))(
*((_QWORD *)this + 180),
i,
NextFreeGroupID,
0);
if ( v13 < ++v12 )
break;
}
}
}
EditorUI::updateObjectInfoLabel(this);
}
return _stack_chk_guard;
}