//
// sub_776DA0 from 0x776da0 to 0x776dee (78 bytes)
//
// 0 xrefs:
//
// 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
//
int *__fastcall sub_776DA0(int *a1)
{
int v1; // r2
void *v3; // r0
unsigned int *v5; // r2
int v6; // r3
v1 = *a1;
v3 = (void *)(*a1 - 12);
if ( v3 != &unk_ACDDAC )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v1 - 4);
__dmb(0xFu);
do
v6 = __ldrex(v5);
while ( __strex(v6 - 1, v5) );
__dmb(0xFu);
}
else
{
v6 = *(_DWORD *)(v1 - 4);
*(_DWORD *)(v1 - 4) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v3);
}
return a1;
}