//
// sub_913E0 from 0x913e0 to 0x91448 (104 bytes)
//
// 4 xrefs:
// > sub_9167E @ 0x91740
// > sub_91750 @ 0x917ae
// > sub_91940 @ 0x91a12
// > sub_91940 @ 0x91ad8
//
// 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
//
unsigned __int64 __fastcall sub_913E0(int a1, __int64 *a2, unsigned int a3, unsigned int a4)
{
unsigned __int64 v5; // kr08_8
int v6; // r2
v5 = *a2;
v6 = *((_DWORD *)a2 + 9);
if ( (unsigned __int64)*a2 < *(_QWORD *)(a1 + 24) )
v5 = *(_QWORD *)(a1 + 24);
if ( !v6 )
v6 = 1;
if ( __PAIR64__(a4, a3) >= v5 )
return (__PAIR64__(a4, a3) - v5) / (unsigned int)v6;
else
return -(__int64)((v5 - __PAIR64__(a4, a3)) / (unsigned int)v6);
}