//
// sub_7D7670 from 0x7d7670 to 0x7d76b4 (68 bytes)
//
// 28 xrefs:
// > AchievementBar::init @ 0x7d843c
// > AchievementBar::init @ 0x7d85dc
// > AchievementBar::init @ 0x7d85fc
// > AchievementBar::init @ 0x7d8700
// > AchievementBar::init @ 0x7d87a4
// > AchievementBar::init @ 0x7d87b0
// > AchievementBar::init @ 0x7d880c
// > AchievementBar::init @ 0x7d8828
// > AchievementBar::init @ 0x7d8860
// > AchievementBar::init @ 0x7d88bc
// > AchievementBar::init @ 0x7d88d8
// > AchievementBar::init @ 0x7d8964
// > AchievementBar::init @ 0x7d8980
// > AchievementBar::init @ 0x7d8a0c
// > AchievementBar::init @ 0x7d8a28
// > AchievementBar::init @ 0x7d8ab4
// > AchievementBar::init @ 0x7d8ad0
// > AchievementBar::init @ 0x7d8b5c
// > AchievementBar::init @ 0x7d8b78
// > AchievementBar::init @ 0x7d8c04
// > AchievementBar::init @ 0x7d8c20
// > AchievementBar::init @ 0x7d8cac
// > AchievementBar::init @ 0x7d8cc8
// > AchievementBar::init @ 0x7d8d4c
// > AchievementBar::init @ 0x7d8d68
// > AchievementBar::init @ 0x7d8dd0
// > AchievementBar::init @ 0x7d8ddc
// > AchievementBar::init @ 0x7d8e20
//
// 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_7D7670(void *p)
{
unsigned int *v1; // x3
int v2; // w2
int v3; // w2
if ( !&pthread_create )
{
v3 = *((_DWORD *)p + 4);
*((_DWORD *)p + 4) = v3 - 1;
if ( v3 > 0 )
return;
LABEL_7:
operator delete(p);
return;
}
v1 = (unsigned int *)((char *)p + 16);
do
v2 = __ldaxr(v1);
while ( __stlxr(v2 - 1, v1) );
if ( v2 <= 0 )
goto LABEL_7;
}