//
// sub_100585310 from 0x100585310 to 0x100585458 (328 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009ab270
//
// 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_100585310(__int64 a1, int a2)
{
_DWORD *v3; // x0
int v5; // w21
__int64 result; // x0
__int64 v7; // [xsp+0h] [xbp-30h] BYREF
int v8; // [xsp+8h] [xbp-28h]
v3 = *(_DWORD **)(a1 + 472);
if ( !v3 || !*(_QWORD *)(a1 + 32) )
return 30;
v5 = v3[14];
result = (*(__int64 (__fastcall **)(_DWORD *))(*(_QWORD *)v3 + 200LL))(v3);
if ( (_DWORD)result )
return result;
if ( (a2 & 8) != 0 && (v5 & 8) == 0 )
{
result = (*(__int64 (__fastcall **)(__int64, _QWORD, float))(*(_QWORD *)a1 + 32LL))(a1, 0, *(float *)(a1 + 48));
if ( (_DWORD)result )
return result;
(*(void (__fastcall **)(__int64, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD))(*(_QWORD *)a1 + 200LL))(
a1,
*(_QWORD *)(a1 + 64),
(unsigned int)*(__int16 *)(a1 + 58),
(unsigned int)*(__int16 *)(a1 + 56),
0,
0);
goto LABEL_14;
}
if ( ((a2 & 0x10) == 0 || (v5 & 0x10) != 0) && ((v5 ^ a2) & 0x4F00000) == 0
|| (v7 = *(_QWORD *)(a1 + 128),
v8 = *(_DWORD *)(a1 + 136),
*(float *)(a1 + 128) = *(float *)(a1 + 128) + 1.0,
result = (*(__int64 (__fastcall **)(__int64, __int64 *, __int64))(*(_QWORD *)a1 + 320LL))(a1, &v7, a1 + 140),
!(_DWORD)result) )
{
LABEL_14:
if ( (a2 & 0x40000000) == (v5 & 0x40000000) )
{
return 0;
}
else
{
if ( (a2 & 0x40000000) != 0 )
(*(void (__fastcall **)(__int64, __int64, float, float))(*(_QWORD *)a1 + 408LL))(
a1,
1,
*(float *)(a1 + 208),
*(float *)(a1 + 212));
else
*(_DWORD *)(a1 + 72) |= 4u;
return 0;
}
}
return result;
}