//
// sub_A810C0 from 0xa810c0 to 0xa81168 (168 bytes)
//
// 9 xrefs:
// > GameStatsManager::setupIconCredits @ 0xa8cb9c
// > GameStatsManager::setupIconCredits @ 0xa8cbdc
// > GameStatsManager::setupIconCredits @ 0xa8cc9c
// > GameStatsManager::setupIconCredits @ 0xa8ccf8
// > GameStatsManager::setupIconCredits @ 0xa8cd0c
// > GameStatsManager::setupIconCredits @ 0xa8cd28
// > GameStatsManager::setupIconCredits @ 0xa8cd44
// > GameStatsManager::setupIconCredits @ 0xa8cd60
// > GameStatsManager::setupIconCredits @ 0xa8cd7c
//
// 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_A810C0(_QWORD *p)
{
__int64 v2; // x2
void *v3; // x0
unsigned int *v5; // x2
int v6; // w1
v2 = p[5];
v3 = (void *)(v2 - 24);
if ( (__int64 *)(v2 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v2 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v2 - 8);
*(_DWORD *)(v2 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v3);
}
operator delete(p);
return _stack_chk_guard;
}