//
// sub_1005EF6F4 from 0x1005ef6f4 to 0x1005ef834 (320 bytes)
//
// 4 xrefs:
// > sub_1005EF834 @ 0x1005ef8d4
// > sub_100600B08 @ 0x100600e5c
// > sub_100600F44 @ 0x100600f8c
// > sub_100611000 @ 0x100611170
//
// 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_1005EF6F4(__int64 a1, time_t a2, int a3, __int64 a4)
{
__int64 v6; // x19
tm *v7; // x0
tm *v8; // x20
const char *v9; // x21
void *v10; // x0
tm v12; // [xsp+30h] [xbp-60h] BYREF
time_t v13; // [xsp+68h] [xbp-28h] BYREF
v6 = a1;
v13 = a2;
if ( !a1 )
{
v6 = sub_1005FBAFC(24);
if ( !v6 )
return 0;
}
v7 = sub_10058A068(&v13, &v12);
v8 = v7;
if ( !v7 )
return 0;
if ( (a3 || a4) && !(unsigned int)sub_10058A08C(&v7->tm_sec, a3, a4) )
return 0;
v9 = *(const char **)(v6 + 8);
if ( !v9 || *(_DWORD *)v6 <= 0x13u )
{
v9 = sub_100588710(20, (__int64)"a_gentm.c", 293);
if ( !v9 )
{
sub_1005E0E48(13, 216, 65, (__int64)"a_gentm.c", 295);
return 0;
}
v10 = *(void **)(v6 + 8);
if ( v10 )
sub_100588C44(v10);
*(_QWORD *)(v6 + 8) = v9;
}
sub_1005DD744(
(__int64)v9,
0x14u,
"%04d%02d%02d%02d%02d%02dZ",
v8->tm_year + 1900,
v8->tm_mon + 1,
v8->tm_mday,
v8->tm_hour,
v8->tm_min,
v8->tm_sec);
*(_DWORD *)v6 = strlen(v9);
*(_DWORD *)(v6 + 4) = 24;
return v6;
}