//
// sub_E190B8 from 0xe190b8 to 0xe191e0 (296 bytes)
//
// 3 xrefs:
// > sub_E138A4 @ 0xe139f8
// > sub_E13BAC @ 0xe13c80
// > sub_E13BAC @ 0xe13d78
//
// 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_E190B8(__int64 *a1, __int64 a2, __int64 **a3, __int64 ***a4)
{
__int64 **v7; // x19
__int64 *v8; // x0
__int64 **v9; // x1
__int64 *v10; // x3
__int64 **result; // x0
__int64 *v12; // x5
__int64 *v13; // x2
__int64 *v14; // x0
if ( a3 )
{
v7 = sub_E18EA8(a1, a2, a3);
v8 = v7[3];
if ( (__int64)v8 > (__int64)a1 || (__int64)v8 >= (__int64)a1 && (__int64)v7[4] > a2 )
{
if ( !*v7 )
{
*a4 = nullptr;
return v7;
}
v7 = sub_E18EA8((__int64 *)(*v7)[3], (*v7)[4], v7);
v14 = v7[3];
if ( (__int64)v14 > (__int64)a1 || (__int64)v14 >= (__int64)a1 && a2 < (__int64)v7[4] )
{
*a4 = nullptr;
return v7;
}
}
v9 = (__int64 **)v7[2];
if ( v9 )
{
v10 = v7[1];
result = (__int64 **)v7[2];
v12 = v7[4];
v13 = *v7;
v9[3] = v7[3];
v9[4] = v12;
v9[1] = v10;
*v9 = v13;
*a4 = v7;
}
else
{
if ( *v7 )
{
result = sub_E18EA8(a1, a2, (__int64 **)*v7);
result[1] = v7[1];
}
else
{
result = (__int64 **)v7[1];
}
*a4 = v7;
}
}
else
{
*a4 = nullptr;
return nullptr;
}
return result;
}