//
// sub_E99A8 from 0xe99a8 to 0xe99b8 (16 bytes)
//
// 2 xrefs:
// > sub_E97E4 @ 0xe98ac
// > sub_E97E4 @ 0xe98b8
//
// 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_E99A8(
__int64 a1,
__int64 a2,
unsigned int a3,
unsigned int a4,
_QWORD *a5,
_QWORD *a6,
unsigned int *a7,
int *a8)
{
__int64 v8; // x0
unsigned int v9; // w10
unsigned int v10; // w8
int v11; // w9
if ( a1 )
v8 = a1 - 8;
else
v8 = 0;
v9 = *(_DWORD *)(v8 + 1572);
if ( v9 >= a4 )
v10 = a4;
else
v10 = *(_DWORD *)(v8 + 1572);
if ( v9 <= a3 )
{
*a6 = 0;
*a5 = 0;
*a8 = 0;
*a7 = 0;
return 31;
}
else
{
*a5 = *(_QWORD *)(v8 + 1576) + a3;
if ( v10 + a3 <= v9 )
{
v11 = 0;
*a7 = v10;
*a6 = 0;
}
else
{
*a7 = v9 - a3;
*a6 = *(_QWORD *)(v8 + 1576);
v11 = v10 + a3 - *(_DWORD *)(v8 + 1572);
}
*a8 = v11;
return 0;
}
}