//
// sub_1006559C0 from 0x1006559c0 to 0x100655a4c (140 bytes)
//
// 2 xrefs:
// > sub_100643E44 @ 0x100644630
// > sub_100648704 @ 0x1006487ec
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:10:52 +0000
//
__int64 __fastcall sub_1006559C0(__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_1007063C8(v9, v10);
}