//
// sub_1001E728C from 0x1001e728c to 0x1001e7314 (136 bytes)
//
// 5 xrefs:
// > sub_1001D7714 @ 0x1001d7870
// > sub_1002AD62C @ 0x1002ad63c
// > sub_1002AF03C @ 0x1002af04c
// > sub_10040DD30 @ 0x10040dd5c
// > sub_1004C9BB0 @ 0x1004c9bdc
//
// 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 11:00:33 +0000
//
__int64 *__fastcall sub_1001E728C(__int64 a1, int *a2)
{
__int64 *v2; // x0
__int64 *v3; // x11
__int64 *v4; // t1
int v5; // w9
int v6; // w10
__int64 *v7; // x8
int v8; // w12
int v9; // w11
v4 = *(__int64 **)(a1 + 8);
v2 = (__int64 *)(a1 + 8);
v3 = v4;
if ( !v4 )
return v2;
v6 = *a2;
v5 = a2[1];
v7 = v2;
do
{
v8 = *((_DWORD *)v3 + 8);
if ( v8 >= v6 )
{
if ( v6 >= v8 )
{
if ( *((_DWORD *)v3 + 9) >= v5 )
v7 = v3;
v3 += *((_DWORD *)v3 + 9) < v5;
}
else
{
v7 = v3;
}
}
else
{
++v3;
}
v3 = (__int64 *)*v3;
}
while ( v3 );
if ( v7 == v2 )
return v2;
v9 = *((_DWORD *)v7 + 8);
if ( v6 < v9 || v9 >= v6 && v5 < *((_DWORD *)v7 + 9) )
return v2;
return v7;
}