//
// sub_1000A59D0 from 0x1000a59d0 to 0x1000a5b04 (308 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x100094ca8
// > GameLevelManager::handleIt @ 0x100094ef8
//
// 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:58:33 +0000
//
__int64 (***__fastcall sub_1000A59D0(__int64 a1, const char *a2, const std::string *a3, int a4))(void)
{
const std::string *v8; // x1
__int64 v9; // x21
void *v10; // x23
__int64 (***result)(void); // x0
__int64 (**v12)(void); // x8
__int64 v13; // x0
std::string v14; // [xsp+0h] [xbp-50h] BYREF
std::allocator __a; // [xsp+1Fh] [xbp-31h] BYREF
v8 = a3;
if ( SHIBYTE(a3->__r_.__value_.__r.__words[2]) < 0 )
v8 = (const std::string *)a3->__r_.__value_.__r.__words[0];
sub_1000ADC9C(a1, v8);
std::string::basic_string(&v14, a3, 7u, 0xFFFFFFFFFFFFFFFFLL, &__a);
if ( SHIBYTE(v14.__r_.__value_.__r.__words[2]) < 0 )
{
v10 = (void *)v14.__r_.__value_.__r.__words[0];
v9 = atoi(v14.__r_.__value_.__l.__data_);
operator delete(v10);
}
else
{
v9 = atoi((const char *)&v14);
}
if ( a2[23] < 0 )
a2 = *(const char **)a2;
if ( atoi(a2) < 0 )
{
result = *(__int64 (****)(void))(a1 + 464);
if ( !result )
return result;
v12 = *result + 1;
return (__int64 (***)(void))(*v12)();
}
if ( a4 )
sub_1000B077C(a1, v9);
else
sub_1000B0850(a1, v9);
sub_1000C7830(a1, 3);
v13 = *(_QWORD *)(a1 + 1368);
if ( v13 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v13 + 24LL))(v13, 3);
if ( (a4 & 1) == 0 )
sub_1000C7830(a1, 4);
result = *(__int64 (****)(void))(a1 + 464);
if ( result )
{
v12 = *result;
return (__int64 (***)(void))(*v12)();
}
return result;
}