//
// GameStatsManager::isStoreItemUnlocked from 0x7a1cb0 to 0x7a1dc0 (272 bytes)
//
// 5 xrefs:
// > GameStatsManager::purchaseItem @ 0x7b42f8
// > GameStatsManager::isItemUnlocked @ 0x7b9b50
// > GJShopLayer::init @ 0x92ea48
// > GJShopLayer::onSelectItem @ 0x931094
// > ??> @ 0x3afc8
//
// 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
//
// local variable allocation has failed, the output may be wrong!
bool GameStatsManager::isStoreItemUnlocked(GameStatsManager *a1, int a2)
{
cocos2d::CCDictionary *m_purchasedItems; // x21
cocos2d::CCString *v3; // x0
char *CString; // x0
bool v5; // zf
__int64 *v6; // x0
bool v7; // w20
unsigned int *v9; // x2
int v10; // w1
std::string v11; // [xsp+40h] [xbp+40h] BYREF
m_purchasedItems = a1->m_purchasedItems;
v3 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", *(const char **)&a2);
CString = (char *)cocos2d::CCString::getCString(v3);
sub_D153B8((int)&v11, CString);
v5 = cocos2d::CCDictionary::objectForKey(m_purchasedItems, &v11) == 0;
v6 = (__int64 *)((char *)v11.m_data.m_data - 24);
v7 = !v5;
if ( v6 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)((char *)v11.m_data.m_data - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v11.m_data.m_data - 2);
*((_DWORD *)v11.m_data.m_data - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v6);
}
return v7;
}