//
// sub_10056F400 from 0x10056f400 to 0x10056f4c8 (200 bytes)
//
// 2 xrefs:
// > sub_100560FC0 @ 0x10056107c
// > sub_10056AEA0 @ 0x10056b750
//
// 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_10056F400(__int64 a1, __int64 a2)
{
__int64 *v4; // x21
__darwin_time_t v5; // x0
__int64 v6; // x1
__int64 v7; // x8
__int64 v8; // x0
__int64 result; // x0
v4 = (__int64 *)(a1 + 35472);
v5 = sub_100548F0C();
v7 = v6 + 1000 * (a2 % 1000);
if ( (int)v7 < 1000000 )
v8 = v5 + a2 / 1000;
else
v8 = v5 + a2 / 1000 + 1;
if ( (int)v7 >= 1000000 )
LODWORD(v7) = v7 - 1000000;
if ( !*v4 && !*(_DWORD *)(a1 + 35480) )
return sub_10056C89C(a1, a2);
result = sub_100548F34(v8, v7, *v4, v4[1]);
if ( result <= 0 )
return sub_10056C89C(a1, a2);
return result;
}