//
// sub_1005EAFE0 from 0x1005eafe0 to 0x1005eb0f0 (272 bytes)
//
// 1 xrefs:
// > sub_1005EC4B8 @ 0x1005ec4bc
//
// 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:09:45 +0000
//
__int64 __fastcall sub_1005EAFE0(_DWORD *a1, int *a2, char a3)
{
_QWORD *v6; // x9
__int64 v8; // x20
__int64 v9; // [xsp+0h] [xbp-20h] BYREF
int v10; // [xsp+Ch] [xbp-14h] BYREF
if ( !a2 )
return 31;
if ( *(_DWORD **)(a2 + 9) != a1 )
return 34;
v6 = *((_QWORD **)a2 + 1);
*v6 = *(_QWORD *)a2;
*(_QWORD *)(*(_QWORD *)a2 + 8LL) = v6;
*(_QWORD *)a2 = a2;
*((_QWORD *)a2 + 1) = a2;
a2[6] = -1;
*((_QWORD *)a2 + 2) = 0;
if ( !a2[13] )
sub_1005D7AD8(*((_QWORD *)off_1009DA5E8 + 54), a2);
--a1[57];
if ( (a3 & 1) == 0 )
{
v10 = 0;
if ( !(*(unsigned int (__fastcall **)(_DWORD *, int *))(*(_QWORD *)a1 + 232LL))(a1, &v10) && v10 >= 1 )
{
v8 = 0;
do
{
if ( !(*(unsigned int (__fastcall **)(_DWORD *, __int64, __int64 *))(*(_QWORD *)a1 + 240LL))(a1, v8, &v9) )
*(_WORD *)(v9 + 50) = v8;
v8 = (unsigned int)(v8 + 1);
}
while ( (int)v8 < v10 );
}
}
return 0;
}