//
// GameStatsManager::isItemEnabled from 0x7bcd80 to 0x7bcea8 (296 bytes)
//
// 9 xrefs:
// > PlayLayer::toggleMusicInPractice @ 0x5c900c
// > PlayerObject::init @ 0x63d708
// > PlayerObject::init @ 0x63d71c
// > PlayerObject::init @ 0x63d730
// > GJGarageLayer::onToggleItem @ 0x79336c
// > GJGarageLayer::setupSpecialPage @ 0x797410
// > GameOptionsLayer::onPracticeMusicSync @ 0x8d5d40
// > GameOptionsLayer::setupOptions @ 0x8dbf0c
// > ??> @ 0x5e818
//
// 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
//
bool GameStatsManager::isItemEnabled(GameStatsManager *a1, UnlockType a2, int a3)
{
bool isItemUnlocked; // w20
cocos2d::CCString *v8; // x0
bool v9; // zf
__int64 *v10; // x0
unsigned int *v11; // x2
int v12; // w1
std::string v13; // [xsp+50h] [xbp+50h] BYREF
isItemUnlocked = GameStatsManager::isItemUnlocked(a1, a2, a3);
if ( isItemUnlocked )
{
GameStatsManager::getItemKey(a1, a3, a2, (__int64)&v13);
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(a1->m_enabledItems, &v13);
v9 = !cocos2d::CCString::boolValue(v8);
v10 = (__int64 *)((char *)v13.m_data.m_data - 24);
isItemUnlocked = !v9;
if ( v10 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)((char *)v13.m_data.m_data - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v13.m_data.m_data - 2);
*((_DWORD *)v13.m_data.m_data - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v10);
}
}
return isItemUnlocked;
}