//
// sub_1004B1140 from 0x1004b1140 to 0x1004b11c4 (132 bytes)
//
// 1 xrefs:
// > sub_1004AFBBC @ 0x1004afeb0
//
// 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:11 +0000
//
__int64 __fastcall sub_1004B1140(__int64 a1, __int64 a2)
{
unsigned __int64 v4; // x20
__int128 v5; // q0
__int128 v6; // q1
__int128 v7; // q2
__int64 result; // x0
v4 = *(_QWORD *)(a1 + 8);
if ( v4 >= *(_QWORD *)(a1 + 16) )
{
result = sub_1004B3250(a1, a2);
}
else
{
sub_1000262F4(*(_QWORD **)(a1 + 8), (double *)a2);
*(_OWORD *)(v4 + 8) = *(_OWORD *)(a2 + 8);
v5 = *(_OWORD *)(a2 + 24);
v6 = *(_OWORD *)(a2 + 40);
v7 = *(_OWORD *)(a2 + 56);
*(_QWORD *)(v4 + 72) = *(_QWORD *)(a2 + 72);
*(_OWORD *)(v4 + 56) = v7;
*(_OWORD *)(v4 + 40) = v6;
*(_OWORD *)(v4 + 24) = v5;
result = v4 + 80;
*(_QWORD *)(a1 + 8) = v4 + 80;
}
*(_QWORD *)(a1 + 8) = result;
return result;
}