//
// sub_100659AD0 from 0x100659ad0 to 0x100659b7c (172 bytes)
//
// 1 xrefs:
// > sub_100643E44 @ 0x100644048
//
// 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:10:54 +0000
//
__int64 __fastcall sub_100659AD0(__int64 a1)
{
__int64 v2; // x8
__int64 v3; // x0
int v4; // w0
if ( *(_DWORD *)(a1 + 492) == -1 )
goto LABEL_11;
v2 = *(_QWORD *)(a1 + 368);
if ( !v2 )
goto LABEL_11;
if ( !*(_QWORD *)(v2 + 488) )
goto LABEL_11;
v3 = sub_1006663D4(a1);
if ( !v3 )
goto LABEL_11;
**(_QWORD **)(a1 + 256) = v3;
v4 = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)(a1 + 368) + 488LL))(
a1,
*(_QWORD *)(*(_QWORD *)(a1 + 368) + 496LL));
switch ( v4 )
{
case 0:
if ( *(_QWORD *)(a1 + 520) )
{
*(_DWORD *)(a1 + 496) = 1;
return 1;
}
goto LABEL_11;
case 2:
sub_1006521C0(a1, 2, 80);
return 0xFFFFFFFFLL;
case 3:
LABEL_11:
*(_DWORD *)(a1 + 496) = 0;
return 1;
}
return 1;
}