//
// sub_1002AB4FC from 0x1002ab4fc to 0x1002ab638 (316 bytes)
//
// 4 xrefs:
// > sub_1002AAE80 @ 0x1002ab350
// > sub_1002AAE80 @ 0x1002ab420
// > sub_1002AC274 @ 0x1002ac31c
// > sub_1002AC274 @ 0x1002ac404
//
// 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:17 +0000
//
__int64 __fastcall sub_1002AB4FC(
__int64 a1,
__int64 a2,
__int64 a3,
__int64 a4,
__int64 (__fastcall **a5)(__int64, __int64))
{
char v10; // w24
int v11; // w0
__int64 v12; // x0
__int64 v13; // x1
__int64 result; // x0
v10 = (*a5)(a2, a1);
v11 = (*a5)(a3, a2);
if ( (v10 & 1) != 0 )
{
if ( v11 )
{
v12 = a1;
LABEL_9:
v13 = a3;
goto LABEL_10;
}
sub_1002AC790(a1, a2);
if ( (unsigned int)(*a5)(a3, a2) )
{
v12 = a2;
goto LABEL_9;
}
}
else if ( v11 )
{
sub_1002AC790(a2, a3);
if ( (unsigned int)(*a5)(a2, a1) )
{
v12 = a1;
v13 = a2;
LABEL_10:
sub_1002AC790(v12, v13);
}
}
result = (*a5)(a4, a3);
if ( (_DWORD)result )
{
sub_1002AC790(a3, a4);
result = (*a5)(a3, a2);
if ( (_DWORD)result )
{
sub_1002AC790(a2, a3);
result = (*a5)(a2, a1);
if ( (_DWORD)result )
return sub_1002AC790(a1, a2);
}
}
return result;
}