//
// sub_F4594 from 0xf4594 to 0xf45f0 (92 bytes)
//
// 4 xrefs:
// > sub_F9B54 @ 0xf9d58
// > sub_F9E68 @ 0xfa0e0
// > sub_FA208 @ 0xfa27c
// > sub_FAF30 @ 0xfaf38
//
// 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
//
__int64 __fastcall sub_F4594(__int64 a1, _QWORD *a2)
{
__int64 v2; // x8
int v3; // w9
__int64 v4; // x11
__int64 v5; // x10
v2 = *(int *)(a1 + 32);
if ( (v2 & 0x80000000) != 0 )
return 0;
v3 = *(_DWORD *)(a1 + 28);
if ( v3 <= (int)v2 )
return 0;
if ( a2 )
{
v4 = 0;
v5 = *(int *)(*(_QWORD *)a1 + 4LL);
while ( v4 < v5 )
{
*(_QWORD *)(*(_QWORD *)(a1 + 16) + 8 * v4) = *(_QWORD *)(*(_QWORD *)(a1 + 8) + 8 * v4) + 4 * v2;
++v4;
}
*a2 = *(_QWORD *)(a1 + 16);
}
return (unsigned int)(v3 - v2);
}