//
// EditorUI::onGoToLayer from 0x1401b53f0 to 0x1401b5553 (355 bytes)
//
// 5 xrefs:
// > EditorUI::handleEditorAction @ 0x1401c37d9
// > EditorUI::init @ 0x1401abb5a
// > ??> @ 0x1408a1b40
// > ??> @ 0x1408a1b78
// > ??> @ 0x14091a198
//
// 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 11:27:57 +0000
//
unsigned int __fastcall EditorUI::onGoToLayer(__int64 a1)
{
unsigned int result; // eax
int v3; // r12d
__int64 v4; // rax
int v5; // ebx
int v6; // edi
cocos2d::CCArray *v7; // r14
int v8; // esi
unsigned int v9; // ebp
int v10; // ecx
cocos2d::CCArray *v11; // r14
unsigned int v12; // ebp
int v13; // ecx
if ( *(_QWORD *)(a1 + 1568) || (result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944))) != 0 )
{
v3 = *(__int16 *)(*(_QWORD *)(a1 + 1512) + 14866LL);
v4 = *(_QWORD *)(a1 + 1568);
if ( v4 )
{
v5 = *(__int16 *)(v4 + 1210);
v6 = *(__int16 *)(v4 + 1212);
}
else
{
v7 = *(cocos2d::CCArray **)(a1 + 944);
v6 = 0;
v8 = -1;
if ( !v7 )
goto LABEL_12;
v5 = -1;
v9 = 0;
if ( !cocos2d::CCArray::count(v7) )
goto LABEL_12;
do
{
v10 = *((__int16 *)cocos2d::CCArray::objectAtIndex(v7, v9) + 605);
if ( v5 == -1 )
{
v5 = v10;
}
else if ( v5 != v10 )
{
goto LABEL_12;
}
++v9;
}
while ( v9 < cocos2d::CCArray::count(v7) );
if ( v5 == -1 )
LABEL_12:
v5 = 0;
v11 = *(cocos2d::CCArray **)(a1 + 944);
if ( v11 )
{
v12 = 0;
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) )
{
do
{
v13 = *((__int16 *)cocos2d::CCArray::objectAtIndex(v11, v12) + 606);
if ( v8 == -1 )
{
v8 = v13;
}
else if ( v8 != v13 )
{
goto LABEL_21;
}
++v12;
}
while ( v12 < cocos2d::CCArray::count(v11) );
if ( v8 != -1 )
v6 = v8;
}
}
}
LABEL_21:
if ( v6 )
{
if ( v5 )
{
if ( v3 != v6 )
{
LABEL_26:
*(_WORD *)(*(_QWORD *)(a1 + 1512) + 14866LL) = v6;
return EditorUI::updateGroupIDLabel(a1);
}
}
else
{
LOWORD(v5) = v6;
}
}
LOWORD(v6) = v5;
goto LABEL_26;
}
return result;
}