//
// sub_1004A0DCC from 0x1004a0dcc to 0x1004a0e78 (172 bytes)
//
// 1 xrefs:
// > sub_1004A1C60 @ 0x1004a2d78
//
// 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_1004A0DCC(__int64 *a1, __int64 *a2)
{
__int64 v4; // x8
int v5; // w9
__int64 v6; // x1
__int64 v7; // x9
__int64 v8; // x9
v4 = *a2;
if ( *a2 )
{
v5 = *(_DWORD *)(v4 + 8);
if ( v5 >= 1 )
*(_DWORD *)(v4 + 8) = --v5;
if ( !v5 )
{
v6 = *(_QWORD *)(v4 + 24);
v7 = a2[1];
if ( v6 )
{
sub_1004B1970(v7 + 67784, v6, "", 0, 1);
}
else
{
*(_QWORD *)v4 = *(_QWORD *)(v7 + 67496);
*(_QWORD *)(v7 + 67496) = v4;
}
}
*a2 = 0;
*((_OWORD *)a2 + 1) = xmmword_1006488B0;
}
v8 = a1[1];
*a2 = *a1;
a2[1] = v8;
*((_OWORD *)a2 + 1) = *((_OWORD *)a1 + 1);
*(_OWORD *)a1 = 0u;
*((_OWORD *)a1 + 1) = 0u;
return 0;
}