//
// sub_1002EFAF8 from 0x1002efaf8 to 0x1002efb8c (148 bytes)
//
// 2 xrefs:
// > sub_1002EF9FC @ 0x1002efa30
// > sub_1002EF9FC @ 0x1002efa3c
//
// 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:55 +0000
//
void __fastcall sub_1002EFAF8(_QWORD *a1, unsigned __int64 a2)
{
__int64 v3; // x9
unsigned __int64 v4; // x8
bool v5; // cf
unsigned __int64 v6; // x8
__int64 v7; // x20
__int64 v8; // x21
void *v9; // x0
void *v10; // t1
v3 = a1[1];
v4 = 0xAAAAAAAAAAAAAAABLL * ((v3 - *a1) >> 3);
v5 = a2 >= v4;
v6 = a2 - v4;
if ( v6 != 0 && v5 )
{
sub_1002F02D4(a1, v6);
}
else if ( !v5 )
{
v7 = *a1 + 24 * a2;
if ( v3 != v7 )
{
v8 = a1[1];
do
{
v10 = *(void **)(v8 - 24);
v8 -= 24;
v9 = v10;
if ( v10 )
{
*(_QWORD *)(v3 - 16) = v9;
operator delete(v9);
}
v3 = v8;
}
while ( v8 != v7 );
}
a1[1] = v7;
}
}