//
// sub_10052F858 from 0x10052f858 to 0x10052f8e4 (140 bytes)
//
// 2 xrefs:
// > sub_10051DCDC @ 0x10051e4c8
// > sub_10052259C @ 0x100522684
//
// 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_10052F858(__int64 a1, int a2, _BYTE *a3, __int64 a4)
{
__int64 v5; // x20
__int64 v7; // x9
int v8; // w0
_BYTE *v9; // x0
__int64 v10; // x1
v5 = (unsigned int)(a4 - 4);
if ( (int)a4 < 4 )
return 0;
v7 = 64;
if ( !a2 )
v7 = 32;
if ( (*(_QWORD *)(a1 + 432) & v7) != 0 )
{
v8 = time(nullptr);
*a3 = HIBYTE(v8);
a3[1] = BYTE2(v8);
a3[2] = BYTE1(v8);
a3[3] = v8;
v9 = a3 + 4;
v10 = v5;
}
else
{
v9 = a3;
v10 = a4;
}
return sub_1005E0260(v9, v10);
}