//
// GameStatsManager::isItemUnlocked from 0x41b96c to 0x41ba1c (176 bytes)
//
// 19 xrefs:
// > GameManager::isIconUnlocked @ 0x32577a
// > GameManager::isColorUnlocked @ 0x325956
// > GameManager::dataLoaded @ 0x3289d8
// > LevelPage::onSecretDoor @ 0x408afc
// > LevelSelectLayer::init @ 0x409ecc
// > GameStatsManager::isPathUnlocked @ 0x41ba32
// > GameStatsManager::isItemEnabled @ 0x41ce9c
// > GameStatsManager::recountSpecialStats @ 0x41d376
// > SongInfoLayer::onMenuMusic @ 0x42d90c
// > SongInfoLayer::onPracticeMusic @ 0x42d962
// > SongInfoLayer::init @ 0x42e2d0
// > GameOptionsLayer::onPracticeMusicSync @ 0x4b1a34
// > GameOptionsLayer::setupOptions @ 0x4b4fba
// > GauntletSelectLayer::onPlay @ 0x4d6bb6
// > SecretLayer3::onClick @ 0x4eb6e8
// > SecretLayer3::onClick @ 0x4eb80a
// > SecretLayer3::onClick @ 0x4eb930
// > GJPathSprite::updateState @ 0x58cd00
// > GJPathPage::init @ 0x58d17e
//
// 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::isItemUnlocked(GameStatsManager *a1, UnlockType a2, int a3)
{
GameStatsManager *v5; // r0
GJStoreItem *StoreItem; // r7
GameStatsManager *v7; // r0
int SecretChestForItem; // r7
GameStatsManager *v9; // r0
cocos2d::CCString *SpecialChestKeyForItem; // r4
GameStatsManager *v11; // r0
GameStatsManager *v12; // r0
GameStatsManager *v13; // r7
char *CString; // r0
stl::StringData::Internal *v15; // r2
stl::StringData::Internal *v16; // r3
char *v18; // [sp+8h] [bp-Ch] BYREF
v5 = GameStatsManager::sharedState();
StoreItem = GameStatsManager::getStoreItem(v5, a3);
if ( StoreItem
&& (v9 = GameStatsManager::sharedState(),
GameStatsManager::isStoreItemUnlocked(v9, StoreItem->m_index.random - StoreItem->m_index.seed))
|| (v7 = GameStatsManager::sharedState(),
SecretChestForItem = GameStatsManager::getSecretChestForItem(v7, a3, a2),
SecretChestForItem > 0)
&& (v11 = GameStatsManager::sharedState(), GameStatsManager::isSecretChestUnlocked(v11, SecretChestForItem)) )
{
LOBYTE(SpecialChestKeyForItem) = 1;
}
else
{
v12 = GameStatsManager::sharedState();
SpecialChestKeyForItem = GameStatsManager::getSpecialChestKeyForItem(v12, a3, a2);
if ( SpecialChestKeyForItem )
{
v13 = GameStatsManager::sharedState();
CString = (char *)cocos2d::CCString::getCString(SpecialChestKeyForItem);
sub_776584((int)&v18, CString);
LOBYTE(SpecialChestKeyForItem) = GameStatsManager::isSpecialChestUnlocked((int)v13, &v18, v15, v16);
sub_774008(&v18);
}
}
return (char)SpecialChestKeyForItem;
}