//
// sub_100014BD0 from 0x100014bd0 to 0x100014cb8 (232 bytes)
//
// 5 xrefs:
// > sub_1002FF784 @ 0x1002ff7d4
// > LevelEditorLayer::updateVisibility @ 0x100400328
// > LevelEditorLayer::updateVisibility @ 0x100400590
// > LevelEditorLayer::updateObjectColors @ 0x100400948
// > LevelEditorLayer::updateObjectColors @ 0x100400b3c
//
// 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 10:57:18 +0000
//
__int64 __fastcall sub_100014BD0(__int64 a1, int a2, __int64 a3, char a4)
{
unsigned __int64 v4; // x8
unsigned __int64 v5; // x9
__int64 v8; // x0
__int64 v9; // x21
__int64 v10; // x22
int v11; // w0
int v13; // [xsp+8h] [xbp-28h] BYREF
unsigned __int16 v14; // [xsp+Ch] [xbp-24h] BYREF
unsigned __int8 v15; // [xsp+Eh] [xbp-22h]
LODWORD(v4) = a2 & ~(a2 >> 31);
if ( (int)v4 >= 9999 )
v4 = 9999;
else
v4 = (unsigned int)v4;
v5 = *(_QWORD *)(*(_QWORD *)(a1 + 688) + ((v4 >> 3) & 0x7F8));
v13 = v4;
v14 = *(_WORD *)a3;
v15 = *(_BYTE *)(a3 + 2);
if ( ((v5 >> v4) & 1) != 0 )
{
v8 = sub_100019268(a1 + 368, &v13);
if ( v8 )
{
v9 = *(_QWORD *)(v8 + 24);
v10 = *(_QWORD *)(v8 + 32);
while ( 1 )
{
if ( v9 == v10 )
return v14 | (v15 << 16);
if ( (*(_BYTE *)(v9 + 56) & 1) == 0 )
break;
if ( (a4 & 1) != 0 )
goto LABEL_14;
if ( ((*(unsigned __int8 *)(v9 + 57) ^ 1) & 1) == 0 )
goto LABEL_13;
LABEL_15:
v9 += 72;
}
if ( (*(_BYTE *)(v9 + 57) & 1) != 0 )
{
LABEL_13:
if ( (a4 & 1) != 0 )
goto LABEL_15;
}
LABEL_14:
v11 = sub_10000FE5C(a1, &v14, v9);
v14 = v11;
v15 = BYTE2(v11);
goto LABEL_15;
}
}
return v14 | (v15 << 16);
}