//
// 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 (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:41:26 +0000
//
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);
}