//
// sub_100585764 from 0x100585764 to 0x1005857b0 (76 bytes)
//
// 3 xrefs:
// > sub_100591E08 @ 0x1005926e0
// > sub_1005DEF18 @ 0x1005df000
// > sub_1005DF6A4 @ 0x1005df778
//
// 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_100585764(__int64 a1, unsigned int a2, __int64 a3)
{
__int64 v3; // x9
__int64 v4; // x8
if ( (a2 & 0x80000000) != 0 || !a3 || *(_DWORD *)a1 <= (signed int)a2 )
return 31;
v3 = 8LL * a2;
*(_QWORD *)(*(_QWORD *)(a1 + 24) + v3) = a3;
v4 = *(_QWORD *)(a1 + 24);
*(_QWORD *)(*(_QWORD *)(v4 + v3) + 16LL) = a1;
return (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v4 + v3) + 24LL))(*(_QWORD *)(v4 + v3));
}