//
// sub_1004E0A20 from 0x1004e0a20 to 0x1004e0a9f (127 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1004E0A20(__int64 a1, int a2, int a3)
{
_QWORD *v3; // rcx
unsigned __int64 v4; // rax
__int64 v5; // r8
int v6; // edx
__int64 v7; // rax
if ( a2 < 0
|| (v3 = *(_QWORD **)a1, (v4 = *(_QWORD *)(a1 + 8) - *(_QWORD *)a1) == 0)
|| a3 < 0
|| (v5 = (v3[1] - *v3) >> 3, (int)v5 <= a2)
|| (unsigned int)v5 <= a3 )
{
sub_1007CC060();
}
v6 = a3 - a2;
if ( v6 < (int)(1431655765 * ((*(_QWORD *)(a1 + 32) - *(_QWORD *)(a1 + 24)) >> 3) + 1)
|| v6 >= (int)(-1431655765 * (v4 >> 3)) )
{
sub_1007CC030();
}
v7 = (unsigned int)-v6;
if ( v6 > 0 )
v7 = (unsigned int)v6;
if ( v6 < 0 )
v3 = *(_QWORD **)(a1 + 24);
return v3[3 * v7] + 8LL * (unsigned int)a2;
}