//
// EditorUI::onGoToFreeLayer from 0x7c640c to 0x7c64f4 (232 bytes)
//
// 4 xrefs:
// > EditorUI::handleEditorAction @ 0xbd77c4
// > ??> @ 0x7df98
// > EditorUI::init @ 0x7d0be0
// > ??> @ 0x1543408
//
// 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:08 +0000
//
__int64 __fastcall EditorUI::onGoToFreeLayer(EditorUI *this, cocos2d::CCObject *a2)
{
LevelEditorLayer *v3; // x0
__int16 NextFreeEditorLayer; // w22
_QWORD *v5; // x0
_QWORD *v6; // x19
void *v7; // x0
void *v9[2]; // [xsp+30h] [xbp+30h] BYREF
void *v10; // [xsp+40h] [xbp+40h]
__int64 v11; // [xsp+48h] [xbp+48h]
float v12; // [xsp+50h] [xbp+50h]
v9[0] = nullptr;
v3 = *((LevelEditorLayer **)this + 180);
v9[1] = nullptr;
v10 = nullptr;
v11 = 0;
v12 = 1.0;
NextFreeEditorLayer = LevelEditorLayer::getNextFreeEditorLayer(v3, (__int64)v9);
v5 = v10;
if ( v10 )
{
do
{
v6 = (_QWORD *)*v5;
operator delete(v5);
v5 = v6;
}
while ( v6 );
}
v7 = v9[0];
v9[0] = nullptr;
if ( v7 )
operator delete(v7);
*(_WORD *)(*((_QWORD *)this + 180) + 14210LL) = NextFreeEditorLayer;
EditorUI::updateGroupIDLabel(this);
return _stack_chk_guard;
}