//
// GameStatsManager::isSpecialChestUnlocked from 0x7a58c4 to 0x7a59c4 (256 bytes)
//
// 45 xrefs:
// > GameStatsManager::getNextVideoAdReward @ 0x7a5a18
// > GameStatsManager::getNextVideoAdReward @ 0x7a5a58
// > GameStatsManager::getNextVideoAdReward @ 0x7a5a94
// > GameStatsManager::getNextVideoAdReward @ 0x7a5ad0
// > GameStatsManager::getNextVideoAdReward @ 0x7a5b0c
// > GameStatsManager::getNextVideoAdReward @ 0x7a5b48
// > GameStatsManager::getNextVideoAdReward @ 0x7a5b84
// > GameStatsManager::getNextVideoAdReward @ 0x7a5bc0
// > GameStatsManager::getNextVideoAdReward @ 0x7a5bfc
// > GameStatsManager::getNextVideoAdReward @ 0x7a5c38
// > GameStatsManager::isGauntletChestUnlocked @ 0x7b6570
// > GameStatsManager::isPathChestUnlocked @ 0x7b6810
// > GameStatsManager::isItemUnlocked @ 0x7b9c00
// > GameStatsManager::unlockSpecialChest @ 0x7bbb58
// > SupportLayer::customSetup @ 0x7ddabc
// > GauntletNode::generateNode @ 0x91b9c4
// > GJShopLayer::showReactMessage @ 0x92c4c8
// > GJShopLayer::ccTouchBegan @ 0x92fadc
// > RewardsPage::init @ 0x93571c
// > RewardsPage::init @ 0x935c4c
// > RewardsPage::init @ 0x935c80
// > RewardsPage::init @ 0x935cb8
// > RewardsPage::init @ 0x935fd4
// > RewardsPage::init @ 0x936080
// > SecretLayer3::init @ 0x945764
// > SecretLayer3::init @ 0x945978
// > SecretLayer4::init @ 0x94af18
// > FollowRewardPage::updateRate @ 0x962ffc
// > FollowRewardPage::updateRate @ 0x9630b0
// > FollowRewardPage::updateRate @ 0x96310c
// > FollowRewardPage::updateRate @ 0x963168
// > FollowRewardPage::updateRate @ 0x9631c4
// > FollowRewardPage::updateRate @ 0x963220
// > FollowRewardPage::init @ 0x963f9c
// > FollowRewardPage::init @ 0x9642f4
// > FollowRewardPage::init @ 0x9643d0
// > FollowRewardPage::init @ 0x9644ac
// > FollowRewardPage::init @ 0x964588
// > FollowRewardPage::init @ 0x964764
// > SecretRewardsLayer::init @ 0xa62d84
// > SecretRewardsLayer::init @ 0xa63bb4
// > SecretRewardsLayer::init @ 0xa63d10
// > SecretLayer5::claimOnlineReward @ 0xa92608
// > SecretLayer5::onlineRewardStatusFinished @ 0xa9296c
// > ??> @ 0xa9ad0
//
// 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
//
__int64 __fastcall GameStatsManager::isSpecialChestUnlocked(__int64 a1, char **a2)
{
cocos2d::CCDictionary *v2; // x21
bool v3; // zf
__int64 *v4; // x0
unsigned int v5; // w20
unsigned int *v7; // x2
int v8; // w1
std::string v9; // [xsp+40h] [xbp+40h] BYREF
v2 = *(cocos2d::CCDictionary **)(a1 + 840);
sub_D153B8((int)&v9, *a2);
v3 = cocos2d::CCDictionary::objectForKey(v2, &v9) == 0;
v4 = (__int64 *)((char *)v9.m_data.m_data - 24);
v5 = !v3;
if ( v4 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)((char *)v9.m_data.m_data - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9.m_data.m_data - 2);
*((_DWORD *)v9.m_data.m_data - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v4);
}
return v5;
}