//
// sub_773904 from 0x773904 to 0x773966 (98 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_773904(int a1)
{
int v1; // r4
void *v2; // r0
unsigned int *v4; // r2
int v5; // r3
int v6; // [sp+4h] [bp-4h] BYREF
(*(void (__fastcall **)(int *))(**(_DWORD **)(a1 + 12) + 12))(&v6);
v1 = v6;
v2 = (void *)(v6 - 12);
if ( (int *)(v6 - 12) != &dword_ACDD9C )
{
if ( &pthread_create )
{
v4 = (unsigned int *)(v6 - 4);
__dmb(0xFu);
do
v5 = __ldrex(v4);
while ( __strex(v5 - 1, v4) );
__dmb(0xFu);
}
else
{
v5 = *(_DWORD *)(v6 - 4);
*(_DWORD *)(v6 - 4) = v5 - 1;
}
if ( v5 <= 0 )
operator delete(v2);
}
return v1;
}