//
// sub_10049AA24 from 0x10049aa24 to 0x10049aab8 (148 bytes)
//
// 2 xrefs:
// > ??> @ 0x100828078
// > ??> @ 0x100828110
//
// 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_10049AA24(__int64 a1, char a2, int a3)
{
__int64 v4; // x20
int v5; // w8
__int16 v6; // w8
if ( (a2 & 1) == 0 )
{
v5 = -1;
goto LABEL_6;
}
if ( !a3 )
{
if ( (unsigned int)(*(_DWORD *)(a1 + 716) + 1) > 1 )
return 0;
v6 = atomic_load((unsigned int *)(a1 + 100));
if ( (v6 & 0x100) != 0 )
{
LABEL_10:
*(_DWORD *)(a1 + 716) = 0;
return 0;
}
v5 = *(_DWORD *)(*(_QWORD *)(a1 + 168) + 69864LL) + 1;
LABEL_6:
*(_DWORD *)(a1 + 716) = v5;
return 0;
}
v4 = *(_QWORD *)(a1 + 168);
if ( !v4 )
goto LABEL_10;
sub_100442B5C(*(_QWORD *)(a1 + 168), 3u);
*(_DWORD *)(a1 + 716) = 0;
sub_100442B7C(v4, 3u);
return 0;
}