//
// sub_10058A700 from 0x10058a700 to 0x10058a774 (116 bytes)
//
// 3 xrefs:
// > sub_1005E8068 @ 0x1005e8074
// > sub_1005E8068 @ 0x1005e807c
// > sub_1005E8068 @ 0x1005e8084
//
// 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_10058A700(int a1)
{
__int64 result; // x0
__int64 v3; // x21
result = qword_100882CA8;
if ( qword_100882CA8 )
{
dword_100882CA0 = a1;
v3 = *(_QWORD *)(qword_100882CA8 + 48);
*(_QWORD *)(qword_100882CA8 + 48) = 0;
sub_1005DF2B0(result, sub_10058A774);
result = qword_100882CA8;
if ( a1 < 0 )
{
sub_1005DECCC(qword_100882CA8);
result = sub_1005DE9D0((void *)qword_100882CB0);
qword_100882CA8 = 0;
qword_100882CB0 = 0;
}
else
{
*(_QWORD *)(qword_100882CA8 + 48) = v3;
}
}
return result;
}