//
// sub_10001EA50 from 0x10001ea50 to 0x10001eb0c (188 bytes)
//
// 1 xrefs:
// > sub_10001E8DC @ 0x10001e948
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int128 *__fastcall sub_10001EA50(__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_100017728((__int64)a1 + 40, (__n128 *)((char *)v9 + 40));
a1 = v9;
v6 = v10;
}
while ( v10 <= v7 );
return v9;
}