//
// LevelEditorLayer::lockedLayerForObject from 0x4611ec to 0x46124a (94 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::lockedLayerForObjectString @ 0x46a16c
// > EditorUI::onCreate @ 0x4877e0
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:48:53 +0000
//
unsigned int __fastcall LevelEditorLayer::lockedLayerForObject(LevelEditorLayer *this, int a2, int a3)
{
int v3; // r4
int v4; // r5
unsigned int v5; // r1
unsigned int result; // r0
if ( !*((_DWORD *)this + 3003) )
return -1;
v3 = 9999;
if ( a2 >= 9999 )
a2 = 9999;
v4 = *((_DWORD *)this + 3000);
v5 = a2 & ~(a2 >> 31);
if ( ((1 << (v5 & 0x1F)) & *(_DWORD *)(v4 + 4 * (v5 >> 5))) != 0 )
return v5;
if ( a3 <= 9999 )
v3 = a3;
result = v3 & ~(v3 >> 31);
if ( !result )
return -1;
if ( ((1 << (result & 0x1F)) & *(_DWORD *)(v4 + 4 * (result >> 5))) == 0 )
return -1;
return result;
}