//
// sub_BAE484 from 0xbae484 to 0xbae62c (424 bytes)
//
// 1 xrefs:
// > sub_BB3E44 @ 0xbb40d0
//
// 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_BAE484(__int64 a1, _QWORD *a2, __int64 a3, _QWORD *a4, int *a5)
{
time_t v10; // x25
unsigned int v11; // w24
size_t v12; // x22
int v13; // w23
char *v14; // x0
char *v15; // x19
__int64 *v16; // x0
__int64 *v17; // x27
__int64 v18; // x1
_QWORD v20[2]; // [xsp+78h] [xbp+78h] BYREF
v10 = time(nullptr);
v11 = 27;
v12 = (unsigned int)(*(_DWORD *)(a3 + 24) + 48);
v13 = *(_DWORD *)(a3 + 24) + 48;
v14 = (char *)off_1231000(v12);
v15 = v14;
if ( v14 )
{
memset(v14, 0, v12);
sub_B8C278(v15 + 16, (unsigned int)(*(_DWORD *)(a3 + 24) + 32), byte_F27DB8, 0, 0, 0, 0);
sub_BB2034(10000000 * (v10 + 0x2B6109100LL), v15 + 24);
*((_QWORD *)v15 + 4) = *a2;
memcpy(v15 + 44, *(const void **)(a3 + 16), *(unsigned int *)(a3 + 24));
*((_QWORD *)v15 + 1) = *(_QWORD *)(a3 + 8);
v16 = sub_BABAD4((__int64)&off_121C6A0, a1, 16);
v17 = v16;
if ( v16 )
{
v11 = 0;
sub_BABC6C(v16);
sub_BABC90(v17, (__int64)v20);
v18 = v20[1];
*(_QWORD *)v15 = v20[0];
*((_QWORD *)v15 + 1) = v18;
*a4 = v15;
*a5 = v13;
}
else
{
off_1231008(v15);
}
}
return v11;
}