//
// LevelEditorLayer::toggleLockActiveLayer from 0x1003fedc8 to 0x1003fee34 (108 bytes)
//
// 1 xrefs:
// > EditorUI::onLockLayer @ 0x100472d4c
//
// 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 11:04:37 +0000
//
__int64 __fastcall LevelEditorLayer::toggleLockActiveLayer(__int64 result)
{
unsigned __int64 v1; // x8
__int64 v2; // x9
__int64 v3; // x10
__int64 v4; // x8
__int64 v5; // x11
__int64 v6; // x11
int v7; // w9
int v8; // w8
v1 = *(unsigned __int16 *)(result + 14210);
if ( (unsigned int)(v1 - 10000) >= 0xFFFFD8F1 && *(_BYTE *)(result + 14010) == 1 )
{
v2 = *(_QWORD *)(result + 14528);
v3 = (v1 >> 3) & 0x1FF8;
v4 = 1LL << v1;
v5 = *(_QWORD *)(v2 + v3);
if ( (v5 & v4) != 0 )
v6 = v5 & ~v4;
else
v6 = v5 | v4;
*(_QWORD *)(v2 + v3) = v6;
v7 = *(_DWORD *)(result + 14552);
if ( (v6 & v4) != 0 )
v8 = v7 + 1;
else
v8 = v7 - 1;
*(_DWORD *)(result + 14552) = v8;
}
return result;
}