//
// sub_778860 from 0x778860 to 0x7788a8 (72 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
//
void __fastcall sub_778860(unsigned int *a1)
{
unsigned int *v1; // r2
int v2; // r3
if ( a1 != (unsigned int *)&unk_ACDDAC )
{
if ( &pthread_create )
{
v1 = a1 + 2;
__dmb(0xFu);
do
v2 = __ldrex(v1);
while ( __strex(v2 - 1, v1) );
__dmb(0xFu);
}
else
{
v2 = a1[2];
a1[2] = v2 - 1;
}
if ( v2 <= 0 )
operator delete(a1);
}
}