//
// EditorUI::onGoToLayer from 0x10000a930 to 0x10000aae0 (432 bytes)
//
// 2 xrefs:
// > EditorUI::handleEditorAction @ 0x10060be7c
// > EditorUI::init @ 0x100007155
//
// 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:49 +0000
//
__int64 __fastcall EditorUI::onGoToLayer(_QWORD *a1)
{
__int64 v1; // rax
int v2; // ecx
int v3; // r13d
int v4; // r12d
__int16 v5; // ax
bool v6; // zf
__int16 v7; // cx
__int64 result; // rax
__int64 v9; // rbx
unsigned int v10; // r14d
int v11; // eax
__int64 v12; // rbx
unsigned int v13; // r14d
int v14; // r15d
int v15; // eax
int v16; // [rsp+14h] [rbp-2Ch]
v1 = a1[187];
if ( v1 )
{
v2 = *(__int16 *)(a1[180] + 14210LL);
}
else
{
result = sub_1007FEF90(a1[112]);
if ( !(_DWORD)result )
return result;
v1 = a1[187];
v2 = *(__int16 *)(a1[180] + 14210LL);
if ( !v1 )
{
v9 = a1[112];
v4 = 0;
if ( v9 )
{
v16 = *(__int16 *)(a1[180] + 14210LL);
if ( !(unsigned int)sub_1007FEF90(v9) )
goto LABEL_27;
v10 = 0;
v3 = -1;
do
{
v11 = *(__int16 *)(sub_1007FEFE0(v9, v10) + 1202);
if ( v3 == -1 )
{
v3 = v11;
}
else if ( v3 != v11 )
{
goto LABEL_27;
}
++v10;
}
while ( v10 < (unsigned int)sub_1007FEF90(v9) );
if ( v3 == -1 )
LABEL_27:
v3 = 0;
v12 = a1[112];
if ( v12 && (unsigned int)sub_1007FEF90(a1[112]) )
{
v13 = 0;
v14 = -1;
do
{
v15 = *(__int16 *)(sub_1007FEFE0(v12, v13) + 1204);
if ( v14 == -1 )
{
v14 = v15;
}
else if ( v14 != v15 )
{
goto LABEL_38;
}
++v13;
}
while ( v13 < (unsigned int)sub_1007FEF90(v12) );
if ( v14 != -1 )
v4 = v14;
}
LABEL_38:
v2 = v16;
}
else
{
v3 = 0;
}
goto LABEL_4;
}
}
v3 = *(__int16 *)(v1 + 1202);
v4 = *(__int16 *)(v1 + 1204);
LABEL_4:
v5 = v3;
if ( v4 )
v5 = v4;
if ( v3 )
v5 = v3;
else
v4 = 0;
v6 = v4 == v2;
v7 = v4;
if ( v6 )
v7 = v5;
if ( !v4 )
v7 = v5;
*(_WORD *)(a1[180] + 14210LL) = v7;
return EditorUI::updateGroupIDLabel(a1);
}