//
// sub_1004D64B8 from 0x1004d64b8 to 0x1004d657c (196 bytes)
//
// 2 xrefs:
// > sub_1004D5758 @ 0x1004d5d3c
// > sub_1004D63C8 @ 0x1004d6478
//
// 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:06:31 +0000
//
__int64 __fastcall sub_1004D64B8(__int64 a1)
{
int v2; // w21
__int64 v3; // x0
__int64 v4; // x0
__int64 result; // x0
__int64 v6; // x20
v2 = *(_DWORD *)(*(_QWORD *)(a1 + 1064) + 316LL);
v3 = *(_QWORD *)(a1 + 1072);
if ( v3 )
{
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v3 + 1056LL))(v3, v2 < 1);
sub_1004D6A28(*(_QWORD *)(a1 + 1072), *(_QWORD *)(a1 + 1088), v2 < 1);
}
if ( (*(_BYTE *)(a1 + 1104) & 1) == 0 && *(_BYTE *)(a1 + 1105) == 1 )
{
*(_BYTE *)(a1 + 1105) = 0;
v4 = *(_QWORD *)(a1 + 1080);
if ( v4 )
CCMenuItemToggler::toggle(v4, 0);
}
result = *(_QWORD *)(a1 + 1080);
if ( result )
{
if ( v2 < 1 )
v6 = *(unsigned __int8 *)(a1 + 1104);
else
v6 = 0;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)result + 1056LL))(result, v6);
return sub_1004D6A28(*(_QWORD *)(a1 + 1080), *(_QWORD *)(a1 + 1096), v6);
}
return result;
}