//
// EditorUI::editGroup from 0x7c0358 to 0x7c0494 (316 bytes)
//
// 4 xrefs:
// > EditorUI::handleEditorAction @ 0xbd7d74
// > ??> @ 0x959c8
// > EditorUI::init @ 0x7d061c
// > ??> @ 0x15440b8
//
// 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:06 +0000
//
__int64 __fastcall EditorUI::editGroup(EditorUI *this, cocos2d::CCObject *a2)
{
EditorBuildStats *v3; // x0
EditorSFXManager *v4; // x0
EditorSFXManager *v5; // x0
cocos2d::CCArray *v6; // x2
__int64 v7; // x22
LevelEditorLayer *v8; // x0
int NextFreeGroupID; // w20
_QWORD *v10; // x0
_QWORD *v11; // x19
void *v12; // x0
__int64 v13; // x1
void *v15[2]; // [xsp+30h] [xbp+30h] BYREF
void *v16; // [xsp+40h] [xbp+40h]
__int64 v17; // [xsp+48h] [xbp+48h]
float v18; // [xsp+50h] [xbp+50h]
if ( *((_QWORD *)this + 187) || (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
v3 = (EditorBuildStats *)(*((_QWORD *)this + 180) + 14704LL);
*((_DWORD *)v3 + 4) = *(_DWORD *)(*((_QWORD *)this + 180) + 14720LL) + 1;
v4 = (EditorSFXManager *)EditorBuildStats::noteAction(v3);
v5 = (EditorSFXManager *)EditorSFXManager::sharedState(v4);
EditorSFXManager::playAction(v5, 108, 107);
v7 = SetGroupIDLayer::create(*((SetGroupIDLayer **)this + 187), *((GameObject **)this + 112), v6);
v8 = *((LevelEditorLayer **)this + 180);
v15[0] = nullptr;
v15[1] = nullptr;
v16 = nullptr;
v17 = 0;
v18 = 1.0;
NextFreeGroupID = LevelEditorLayer::getNextFreeGroupID(v8, (__int64)v15);
v10 = v16;
if ( v16 )
{
do
{
v11 = (_QWORD *)*v10;
operator delete(v10);
v10 = v11;
}
while ( v11 );
}
v12 = v15[0];
v15[0] = nullptr;
if ( v12 )
operator delete(v12);
v13 = *(_QWORD *)v7;
*(_DWORD *)(v7 + 808) = NextFreeGroupID;
(*(void (__fastcall **)(__int64))(v13 + 1312))(v7);
}
return _stack_chk_guard;
}