//
// EditorUI::onAssignNewGroupID from 0x10001a140 to 0x10001a263 (291 bytes)
//
// 0 xrefs:
//
// 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 12:18:56 +0000
//
__int64 __fastcall EditorUI::onAssignNewGroupID(_QWORD *a1)
{
__int64 v2; // rdi
__int64 v3; // r14
__int64 result; // rax
__int64 v5; // rdi
__int64 v6; // rsi
unsigned int NextFreeGroupID; // r15d
_QWORD *v8; // rdi
_QWORD *v9; // r12
void *v10; // rdi
__int64 v11; // rdx
unsigned int v12; // r12d
__int64 v13; // r13
void *v14[2]; // [rsp+0h] [rbp-50h] BYREF
void *__p[2]; // [rsp+10h] [rbp-40h]
int v16; // [rsp+20h] [rbp-30h]
v2 = a1[187];
if ( v2 )
{
v3 = sub_1007FE9A0(v2);
result = sub_1007FEF90(v3);
if ( !(_DWORD)result )
return result;
}
else
{
v3 = a1[112];
result = sub_1007FEF90(v3);
if ( !(_DWORD)result )
return result;
}
v5 = a1[180];
*(_OWORD *)__p = 0;
*(_OWORD *)v14 = 0;
v16 = 1065353216;
v6 = (__int64)v14;
NextFreeGroupID = LevelEditorLayer::getNextFreeGroupID(v5, v14);
v8 = __p[0];
if ( __p[0] )
{
do
{
v9 = (_QWORD *)*v8;
operator delete(v8);
v8 = v9;
}
while ( v9 );
}
v10 = v14[0];
v14[0] = nullptr;
if ( v10 )
operator delete(v10);
if ( (unsigned int)sub_1007FEF90(v3) )
{
v12 = 0;
do
{
v13 = sub_1007FEFE0(v3, v12);
v6 = NextFreeGroupID;
if ( (*(unsigned int (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v13 + 1600LL))(v13, NextFreeGroupID) == 1 )
{
v6 = v13;
(*(void (__fastcall **)(_QWORD, __int64, _QWORD, _QWORD))(*(_QWORD *)a1[180] + 1352LL))(
a1[180],
v13,
NextFreeGroupID,
0);
}
++v12;
}
while ( v12 < (unsigned int)sub_1007FEF90(v3) );
}
return EditorUI::updateObjectInfoLabel((__int64)a1, v6, v11);
}