//
// sub_9349C0 from 0x9349c0 to 0x934a04 (68 bytes)
//
// 29 xrefs:
// > RewardUnlockLayer::playDropSound @ 0x934ca8
// > sub_934CB4 @ 0x934e74
// > sub_934CB4 @ 0x934e90
// > sub_934CB4 @ 0x934ebc
// > RewardsPage::updateTimers @ 0x9352ec
// > RewardsPage::updateTimers @ 0x935318
// > RewardsPage::updateTimers @ 0x93533c
// > RewardsPage::init @ 0x936128
// > RewardsPage::init @ 0x93614c
// > RewardsPage::init @ 0x936170
// > RewardsPage::init @ 0x936194
// > RewardsPage::init @ 0x9361b8
// > RewardsPage::init @ 0x936214
// > RewardsPage::init @ 0x9362dc
// > RewardUnlockLayer::playLabelEffect @ 0x936bf4
// > RewardUnlockLayer::playLabelEffect @ 0x936c1c
// > GJChestSprite::switchToState @ 0x9379d0
// > GJChestSprite::switchToState @ 0x9379ec
// > GJChestSprite::switchToState @ 0x937a24
// > GJChestSprite::switchToState @ 0x937a40
// > GJChestSprite::switchToState @ 0x937a5c
// > GJChestSprite::switchToState @ 0x937a88
// > RewardUnlockLayer::step2 @ 0x937c14
// > RewardUnlockLayer::init @ 0x9389d0
// > RewardUnlockLayer::init @ 0x9389ec
// > RewardUnlockLayer::init @ 0x938a08
// > RewardUnlockLayer::init @ 0x938a44
// > RewardUnlockLayer::playRewardEffect @ 0x93a158
// > RewardUnlockLayer::playRewardEffect @ 0x93a1a4
//
// 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_9349C0(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;
}