//
// sub_10040614C from 0x10040614c to 0x100406228 (220 bytes)
//
// 1 xrefs:
// > EditorUI::toggleViewOption @ 0x100189504
//
// 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:41 +0000
//
__int64 __fastcall sub_10040614C(__int64 a1)
{
__int64 v2; // x0
__int64 result; // x0
unsigned int v4; // w20
__int64 v5; // x0
__int64 v6; // x21
v2 = GameManager::sharedState();
result = GameManager::getGameVariable(v2, "0118");
if ( *(unsigned __int8 *)(a1 + 14013) != (_DWORD)result )
{
*(_BYTE *)(a1 + 14013) = result;
result = sub_1002E757C(*(_QWORD *)(a1 + 3280));
if ( (_DWORD)result )
{
v4 = 0;
do
{
v5 = sub_1002E75A0(*(_QWORD *)(a1 + 3280), v4);
v6 = v5;
if ( *(_DWORD *)(v5 + 1248) == 2 )
sub_100429FFC(v5);
if ( (*(_BYTE *)(a1 + 14013) & 1) == 0 && (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v6 + 1728LL))(v6) )
sub_1003E7574(v6);
if ( (*(_BYTE *)(a1 + 14013) & 1) == 0 )
{
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v6 + 1736LL))(v6) )
sub_1003020A0(v6, 0.0);
}
++v4;
result = sub_1002E757C(*(_QWORD *)(a1 + 3280));
}
while ( v4 < (unsigned int)result );
}
}
return result;
}