//
// sub_1004B318C from 0x1004b318c to 0x1004b3250 (196 bytes)
//
// 2 xrefs:
// > sub_1004B101C @ 0x1004b1094
// > sub_1004B3250 @ 0x1004b3338
//
// 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:06:12 +0000
//
__int64 *__fastcall sub_1004B318C(__int64 *result, _QWORD *a2)
{
__int64 *v3; // x20
__int64 v4; // x8
__int64 v5; // x21
__int64 v6; // x23
__int64 v7; // x22
__int64 v8; // x0
__int128 v9; // q0
__int128 v10; // q1
__int128 v11; // q2
__int64 v12; // x8
__int64 v13; // x8
v3 = result;
v4 = a2[1];
v5 = *result;
v6 = result[1];
v7 = v4 + *result - v6;
if ( v6 != *result )
{
result = (__int64 *)(v4 + *result - v6);
do
{
sub_1000262F4(result, (double *)v5);
*(_OWORD *)(v8 + 8) = *(_OWORD *)(v5 + 8);
v9 = *(_OWORD *)(v5 + 24);
v10 = *(_OWORD *)(v5 + 40);
v11 = *(_OWORD *)(v5 + 56);
*(_QWORD *)(v8 + 72) = *(_QWORD *)(v5 + 72);
*(_OWORD *)(v8 + 56) = v11;
*(_OWORD *)(v8 + 40) = v10;
*(_OWORD *)(v8 + 24) = v9;
v5 += 80;
result = (__int64 *)(v8 + 80);
}
while ( v5 != v6 );
v5 = *v3;
}
a2[1] = v7;
*v3 = v7;
v3[1] = v5;
a2[1] = v5;
v12 = v3[1];
v3[1] = a2[2];
a2[2] = v12;
v13 = v3[2];
v3[2] = a2[3];
a2[3] = v13;
*a2 = a2[1];
return result;
}