//
// sub_10059FBC8 from 0x10059fbc8 to 0x10059fc70 (168 bytes)
//
// 0 xrefs:
//
// 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:09:01 +0000
//
__int64 __fastcall sub_10059FBC8(__int64 a1, _DWORD *a2)
{
__int64 result; // x0
int v5; // w21
unsigned __int8 v7; // [xsp+Fh] [xbp-31h] BYREF
result = sub_1005D06F0(*(_QWORD *)(a1 + 368), &v7);
if ( !(_DWORD)result )
{
v5 = 0;
while ( v7 <= 0x20u && ((1LL << v7) & 0x100002600LL) != 0 )
{
++v5;
result = sub_1005D06F0(*(_QWORD *)(a1 + 368), &v7);
if ( (_DWORD)result )
return result;
}
result = sub_1005D0A20(*(_QWORD *)(a1 + 368), 0xFFFFFFFFLL, 1);
if ( !(_DWORD)result )
{
result = 0;
if ( a2 )
*a2 = v5;
}
}
return result;
}