//
// sub_1002A8288 from 0x1002a8288 to 0x1002a83ac (292 bytes)
//
// 1 xrefs:
// > sub_1002A77D8 @ 0x1002a7c70
//
// 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:02:16 +0000
//
__int64 *__fastcall sub_1002A8288(__int64 *a1, __int64 *a2, __int64 (__fastcall **a3)(__int64 *, __int64 *))
{
__int64 *v4; // x21
__int64 *v6; // x22
__int64 *v7; // x8
int v8; // w0
__int64 v9; // x8
__int64 v11; // [xsp+8h] [xbp-28h] BYREF
v4 = a2;
v11 = *a1;
if ( ((*a3)(&v11, a2 - 1) & 1) != 0 )
{
v6 = a1;
do
++v6;
while ( ((*a3)(&v11, v6) & 1) == 0 );
}
else
{
v7 = a1 + 1;
do
{
v6 = v7;
if ( v7 >= v4 )
break;
v8 = (*a3)(&v11, v7);
v7 = v6 + 1;
}
while ( !v8 );
}
if ( v6 < v4 )
{
do
--v4;
while ( ((*a3)(&v11, v4) & 1) != 0 );
}
while ( v6 < v4 )
{
v9 = *v6;
*v6 = *v4;
*v4 = v9;
do
++v6;
while ( !(unsigned int)(*a3)(&v11, v6) );
do
--v4;
while ( ((*a3)(&v11, v4) & 1) != 0 );
}
if ( v6 - 1 != a1 )
*a1 = *(v6 - 1);
*(v6 - 1) = v11;
return v6;
}