//
// sub_100586B08 from 0x100586b08 to 0x100586bbc (180 bytes)
//
// 1 xrefs:
// > sub_100586A7C @ 0x100586ac8
//
// 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:08:32 +0000
//
__int64 __fastcall sub_100586B08(__int64 a1, unsigned int a2, unsigned __int64 a3)
{
int v4; // w9
__int64 v6; // x0
int v7; // w11
__int64 result; // x0
if ( (a2 & 0x80000000) != 0 )
return 32;
v4 = *(_DWORD *)(a1 + 24);
if ( v4 && v4 <= (int)a2 )
return 32;
v6 = *(_QWORD *)(a1 + 368);
if ( (*(_DWORD *)(v6 + 404) & 1) == 0 )
return 0;
if ( *(_DWORD *)(a1 + 408) != a2 )
*(_DWORD *)(a1 + 408) = a2;
v7 = *(_DWORD *)(*(_QWORD *)(a1 + 8) + 56LL * a2 + 8) - 1;
if ( (unsigned int)v7 <= 4 )
a3 = (qword_100772480[v7] * (unsigned __int64)(unsigned int)a3) >> 3;
result = sub_1005D0A20(
v6,
(unsigned int)(*(_DWORD *)(*(_QWORD *)(a1 + 400) + 296LL * a2 + 256)
+ a3 * *(_DWORD *)(*(_QWORD *)(a1 + 8) + 56LL * a2 + 12)),
0);
if ( !(_DWORD)result )
return 0;
return result;
}