//
// sub_10001F4A4 from 0x10001f4a4 to 0x10001f560 (188 bytes)
//
// 1 xrefs:
// > sub_10001F330 @ 0x10001f39c
//
// 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 10:57:22 +0000
//
__int128 *__fastcall sub_10001F4A4(__int128 *a1, unsigned int (__fastcall **a2)(__int64, __int64), __int64 a3)
{
__int64 v6; // x8
__int64 v7; // x24
__int128 *v8; // x9
__int128 *v9; // x22
__int64 v10; // x25
__int64 v11; // x26
__int128 *v12; // x23
__int128 v13; // q0
__int128 v14; // q1
v6 = 0;
v7 = (a3 - 2) / 2;
do
{
v8 = &a1[4 * v6];
v9 = v8 + 4;
v10 = (2 * v6) | 1;
v11 = 2 * v6 + 2;
if ( v11 < a3 )
{
v12 = v8 + 8;
if ( (*a2)((__int64)(v8 + 4), (__int64)(v8 + 8)) )
{
v9 = v12;
v10 = v11;
}
}
v13 = *v9;
v14 = v9[1];
*((_BYTE *)a1 + 32) = *((_BYTE *)v9 + 32);
*a1 = v13;
a1[1] = v14;
sub_10001817C((__int64)a1 + 40, (__n128 *)((char *)v9 + 40));
a1 = v9;
v6 = v10;
}
while ( v10 <= v7 );
return v9;
}