//
// sub_E18FC4 from 0xe18fc4 to 0xe190b8 (244 bytes)
//
// 3 xrefs:
// > sub_E11B04 @ 0xe11d20
// > sub_E138A4 @ 0xe13a88
// > sub_E13BAC @ 0xe13d18
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:09:42 +0000
//
__int64 **__fastcall sub_E18FC4(__int64 *a1, __int64 a2, __int64 **a3, __int64 *a4)
{
__int64 **v7; // x1
__int64 *v8; // x0
__int64 *v9; // x2
__int64 *v11; // x4
if ( !a4 )
return a3;
if ( !a3 )
{
a4[1] = 0;
*a4 = 0;
goto LABEL_7;
}
v7 = sub_E18EA8(a1, a2, a3);
v8 = v7[3];
if ( v8 != a1 )
{
if ( (__int64)v8 > (__int64)a1 )
goto LABEL_6;
if ( (__int64)v8 < (__int64)a1 )
{
LABEL_11:
a4[1] = (__int64)v7[1];
*a4 = (__int64)v7;
v7[1] = nullptr;
goto LABEL_7;
}
v9 = v7[4];
LABEL_5:
if ( a2 < (__int64)v9 )
{
LABEL_6:
*a4 = (__int64)*v7;
a4[1] = (__int64)v7;
*v7 = nullptr;
LABEL_7:
a4[3] = (__int64)a1;
a4[4] = a2;
a4[2] = 0;
return (__int64 **)a4;
}
goto LABEL_11;
}
v9 = v7[4];
if ( v9 != (__int64 *)a2 )
goto LABEL_5;
a4[3] = (__int64)v8;
a4[4] = (__int64)v9;
a4[2] = (__int64)v7;
v11 = *v7;
a4[1] = (__int64)v7[1];
*a4 = (__int64)v11;
*v7 = a4;
v7[3] = (__int64 *)-1LL;
v7[4] = (__int64 *)-1LL;
return (__int64 **)a4;
}