//
// sub_10046C4BC from 0x10046c4bc to 0x10046c590 (212 bytes)
//
// 2 xrefs:
// > sub_10046BFF0 @ 0x10046c08c
// > sub_100515DB4 @ 0x100515e50
//
// 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:05:35 +0000
//
__int64 *__fastcall sub_10046C4BC(
__int64 *result,
__int64 *a2,
__int64 *a3,
__int64 (__fastcall **a4)(__int64, __int64))
{
__int64 *v6; // x22
__int64 v8; // x23
__int64 *v9; // x24
__int64 *v10; // x26
__int64 v11; // t1
__int64 *v12; // x25
__int64 v13; // x26
__int64 v14; // t1
if ( result != a2 )
{
v6 = result + 1;
*a3 = *result;
if ( result + 1 != a2 )
{
v8 = 0;
v9 = a3;
do
{
v10 = v9;
v11 = *v9++;
result = (__int64 *)(*a4)(*v6, v11);
v12 = v9;
if ( (_DWORD)result )
{
v10[1] = *v10;
v12 = a3;
if ( v10 != a3 )
{
v13 = v8;
while ( 1 )
{
v12 = (__int64 *)((char *)a3 + v13);
result = (__int64 *)(*a4)(*v6, *(__int64 *)((char *)a3 + v13 - 8));
if ( !(_DWORD)result )
break;
*v12 = *(v12 - 1);
v13 -= 8;
if ( !v13 )
{
v12 = a3;
break;
}
}
}
}
v14 = *v6++;
*v12 = v14;
v8 += 8;
}
while ( v6 != a2 );
}
}
return result;
}