//
// sub_F5858 from 0xf5858 to 0xf58dc (132 bytes)
//
// 5 xrefs:
// > sub_9D4B4 @ 0x9d694
// > sub_F5B9C @ 0xf5cf8
// > sub_F8C58 @ 0xf8cd4
// > sub_F9E68 @ 0xf9f90
// > sub_FA57C @ 0xfa7f0
//
// 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
//
long double __fastcall sub_F5858(__int64 a1, __int64 a2)
{
__int64 i; // x21
__int64 v4; // x1
__int64 v5; // x1
__int64 v6; // x1
long double result; // q0
if ( a2 )
{
if ( *(_QWORD *)a2 )
{
for ( i = 0; i < *(int *)(a2 + 16); ++i )
{
v4 = *(_QWORD *)(*(_QWORD *)a2 + 8 * i);
if ( v4 )
a1 = sub_F6124(a1, v4);
}
a1 = sub_F6124(a1, *(_QWORD *)a2);
}
v5 = *(_QWORD *)(a2 + 8);
if ( v5 )
a1 = sub_F6124(a1, v5);
v6 = *(_QWORD *)(a2 + 24);
if ( v6 )
sub_F6124(a1, v6);
*(_OWORD *)a2 = 0u;
*(_OWORD *)(a2 + 16) = 0u;
*(_OWORD *)&result = 0u;
}
return result;
}