//
// sub_81FAB4 from 0x81fab4 to 0x81fb0a (86 bytes)
//
// 7 xrefs:
// > sub_820BD4 @ 0x820c06
// > sub_820BD4 @ 0x820c56
// > sub_820BD4 @ 0x820c70
// > sub_820BD4 @ 0x820c8a
// > sub_820BD4 @ 0x820ca4
// > sub_820BD4 @ 0x820cbe
// > sub_820F7C @ 0x820faa
//
// 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 12:01:49 +0000
//
__int64 __fastcall sub_81FAB4(int a1, int a2, int a3, int a4)
{
double v4; // d17
int v5; // r1
int v6; // r3
int v7; // s15
double v8; // d16
v4 = 1000000.0;
v5 = a1;
v6 = a2 - a4;
if ( a1 != a3 )
v5 = a1 - a3;
v7 = v6;
if ( a1 == a3 )
{
v8 = (double)v6 / 1000000.0;
}
else
{
v8 = (double)v6;
v7 = v5;
v4 = (double)v6 / 1000000.0;
}
if ( a1 != a3 )
v8 = (double)v7 + v4;
return *(_QWORD *)&v8;
}