//
// GameStatsManager::isItemUnlocked from 0x8e805c to 0x8e81ac (336 bytes)
//
// 22 xrefs:
// > GameManager::isIconUnlocked @ 0x7212ac
// > GameManager::isColorUnlocked @ 0x721668
// > GameManager::dataLoaded @ 0x727a70
// > LevelSelectLayer::init @ 0x8c5088
// > LevelPage::onSecretDoor @ 0x8c6c7c
// > GameStatsManager::isPathUnlocked @ 0x8e81d0
// > GameStatsManager::recountSpecialStats @ 0x8ec1b0
// > GameStatsManager::isItemEnabled @ 0x8ec980
// > SongInfoLayer::onMenuMusic @ 0x903fe0
// > SongInfoLayer::onPracticeMusic @ 0x904078
// > SongInfoLayer::init @ 0x90508c
// > GameOptionsLayer::onPracticeMusicSync @ 0xa2b8dc
// > GameOptionsLayer::setupOptions @ 0xa36014
// > GauntletSelectLayer::onPlay @ 0xa73990
// > SecretLayer3::onClick @ 0xa8cbc8
// > SecretLayer3::onClick @ 0xa8d058
// > SecretLayer3::onClick @ 0xa8d1d0
// > GJPathSprite::updateState @ 0xba5b48
// > GJPathPage::init @ 0xba62e4
// > GameSettingsLayer::valueDidChange @ 0xc06ea0
// > GameSettingsLayer::buildTabContent @ 0xc07df4
// > ??> @ 0x81070
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:56:53 +0000
//
__int64 __fastcall GameStatsManager::isItemUnlocked(__int64 a1, unsigned int a2, unsigned int a3)
{
GameStatsManager *v5; // x0
__int64 StoreItem; // x0
__int64 v7; // x20
GameStatsManager *v8; // x0
cocos2d::CCString *v9; // x20
__int64 v11; // x0
__int64 SecretChestForItem; // x0
GameStatsManager *v13; // x0
__int64 v14; // x0
GameStatsManager *SpecialChestKeyForItem; // x0
__int64 v16; // x21
const char *CString; // x0
size_t v18; // x0
const char *v19; // [xsp+38h] [xbp+38h]
char *v20; // [xsp+38h] [xbp+38h]
__int64 v21[2]; // [xsp+40h] [xbp+40h] BYREF
void *v22; // [xsp+50h] [xbp+50h]
v5 = (GameStatsManager *)GameStatsManager::sharedState(_stack_chk_guard);
StoreItem = GameStatsManager::getStoreItem(v5, a3, a2);
v7 = StoreItem;
if ( StoreItem
&& (v8 = (GameStatsManager *)GameStatsManager::sharedState((GameStatsManager *)StoreItem),
StoreItem = GameStatsManager::isStoreItemUnlocked(
v8,
(const char *)(unsigned int)(*(_DWORD *)(v7 + 316) - *(_DWORD *)(v7 + 320))),
(_BYTE)StoreItem)
|| (v11 = GameStatsManager::sharedState((GameStatsManager *)StoreItem),
SecretChestForItem = GameStatsManager::getSecretChestForItem(v11, a3, a2),
(int)SecretChestForItem > 0)
&& (v19 = (const char *)(unsigned int)SecretChestForItem,
v13 = (GameStatsManager *)GameStatsManager::sharedState((GameStatsManager *)SecretChestForItem),
SecretChestForItem = GameStatsManager::isSecretChestUnlocked(v13, v19),
(_BYTE)SecretChestForItem) )
{
LODWORD(v9) = 1;
}
else
{
v14 = GameStatsManager::sharedState((GameStatsManager *)SecretChestForItem);
SpecialChestKeyForItem = (GameStatsManager *)GameStatsManager::getSpecialChestKeyForItem(v14, a3, a2);
v9 = SpecialChestKeyForItem;
if ( SpecialChestKeyForItem )
{
v16 = GameStatsManager::sharedState(SpecialChestKeyForItem);
CString = (const char *)cocos2d::CCString::getCString(v9);
v21[0] = 0;
v20 = (char *)CString;
v21[1] = 0;
v22 = nullptr;
v18 = strlen(CString);
std::string::__init(v21, v20, v18);
LODWORD(v9) = GameStatsManager::isSpecialChestUnlocked(v16, (char *)v21);
if ( (v21[0] & 1) != 0 )
operator delete(v22);
}
}
return (unsigned int)v9;
}