//
// SetGroupIDLayer::onNextFreeEditorLayer2 from 0xabb3e4 to 0xabb4d0 (236 bytes)
//
// 3 xrefs:
// > ??> @ 0x44e00
// > SetGroupIDLayer::init @ 0xabf46c
// > ??> @ 0x1541470
//
// 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 13:01:01 +0000
//
__int64 __fastcall SetGroupIDLayer::onNextFreeEditorLayer2(SetGroupIDLayer *this, cocos2d::CCObject *a2)
{
LevelEditorLayer *v3; // x0
int NextFreeEditorLayer; // w0
_QWORD *v5; // x1
_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]
v3 = *(LevelEditorLayer **)(GameManager::sharedState(_stack_chk_guard) + 552);
v9[0] = nullptr;
v9[1] = nullptr;
v10 = nullptr;
v11 = 0;
v12 = 1.0;
NextFreeEditorLayer = LevelEditorLayer::getNextFreeEditorLayer(v3, (__int64)v9);
v5 = v10;
*((_DWORD *)this + 193) = NextFreeEditorLayer;
if ( v5 )
{
do
{
v6 = (_QWORD *)*v5;
operator delete(v5);
v5 = v6;
}
while ( v6 );
}
v7 = v9[0];
v9[0] = nullptr;
if ( v7 )
operator delete(v7);
SetGroupIDLayer::updateEditorLayerID2(this);
SetGroupIDLayer::updateEditorLabel2(this);
return _stack_chk_guard;
}