//
// sub_10051DBBC from 0x10051dbbc to 0x10051dc48 (140 bytes)
//
// 10 xrefs:
// > UILayer::handleAction @ 0x100051e44
// > UILayer::handleAction @ 0x100052008
// > UILayer::handleAction @ 0x1000522e8
// > PlayLayer::setupHasCompleted @ 0x10013f5e0
// > PlayLayer::togglePracticeMode @ 0x10014b4f0
// > sub_1004B7ABC @ 0x1004b7aec
// > sub_1004B7AF8 @ 0x1004b7b28
// > sub_1004B7B88 @ 0x1004b7c30
// > sub_1004B7CE4 @ 0x1004b7d14
// > DeathMarkerSettingsPopup::FLAlert_Clicked @ 0x1004b7e8c
//
// 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:07:10 +0000
//
__int64 __fastcall sub_10051DBBC(__int64 a1)
{
_BYTE *v2; // x20
__int64 v3; // x0
__int64 result; // x0
char v5; // w8
bool v6; // zf
v2 = (_BYTE *)(a1 + 12236);
v3 = GameManager::sharedState();
result = GameManager::getGameVariable(v3, "0216");
if ( (_DWORD)result && (*v2 & 1) == 0 )
{
if ( v2[308] == 1 )
{
v2[2288] = 1;
return sub_10051DC48(a1);
}
v5 = v2[2288];
v6 = *(_DWORD *)(*(_QWORD *)(a1 + 1936) + 1140LL) == 2;
v2[2288] = v6;
if ( v6 )
return sub_10051DC48(a1);
}
else
{
v5 = v2[2288];
v2[2288] = 0;
}
if ( (v5 & 1) != 0 )
return sub_10051DC48(a1);
return result;
}