//
// GameStatsManager::isSpecialChestUnlocked from 0x1401ea4f0 to 0x1401ea5db (235 bytes)
//
// 34 xrefs:
// > FollowRewardPage::init @ 0x14013a2df
// > FollowRewardPage::init @ 0x14013a61f
// > FollowRewardPage::init @ 0x14013a95e
// > FollowRewardPage::init @ 0x14013ac80
// > FollowRewardPage::init @ 0x14013afbe
// > FollowRewardPage::init @ 0x14013b302
// > FollowRewardPage::updateRate @ 0x14013bae2
// > FollowRewardPage::updateRate @ 0x14013bba3
// > FollowRewardPage::updateRate @ 0x14013bc64
// > FollowRewardPage::updateRate @ 0x14013bd25
// > FollowRewardPage::updateRate @ 0x14013bde6
// > FollowRewardPage::updateRate @ 0x14013bea7
// > GameStatsManager::recountSpecialStats @ 0x1401e512a
// > GameStatsManager::isItemUnlocked @ 0x1401e5ac7
// > GameStatsManager::unlockSpecialChest @ 0x1401ea616
// > GauntletSelectLayer::onPlay @ 0x1401fad37
// > GauntletNode::generateNode @ 0x1401fd576
// > GJPathsLayer::onPath @ 0x1402852d4
// > GJShopLayer::showReactMessage @ 0x1402ad100
// > GJShopLayer::ccTouchBegan @ 0x1402aeb13
// > RewardsPage::init @ 0x1403cc933
// > RewardsPage::init @ 0x1403cc9b5
// > RewardsPage::init @ 0x1403cca2e
// > RewardsPage::init @ 0x1403ccaa7
// > RewardsPage::init @ 0x1403ccb20
// > RewardsPage::init @ 0x1403ccb95
// > SecretRewardsLayer::init @ 0x1403d353c
// > SecretLayer3::init @ 0x1403eada0
// > SecretLayer3::init @ 0x1403eb096
// > SecretLayer4::init @ 0x1403f0982
// > SecretLayer5::claimOnlineReward @ 0x1403f6872
// > SecretLayer5::onlineRewardStatusFinished @ 0x1403f6b19
// > SupportLayer::customSetup @ 0x1404c8c11
// > ??> @ 0x1406cc660
//
// 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
//
// Hidden C++ exception states: #wind=2
_BOOL8 __fastcall GameStatsManager::isSpecialChestUnlocked(__int64 a1, _QWORD *a2)
{
__int64 v2; // rbx
size_t v4; // r8
bool v5; // di
void *v6; // rcx
void *Block[2]; // [rsp+28h] [rbp-30h] BYREF
__m128i si128; // [rsp+38h] [rbp-20h]
v2 = (__int64)a2;
if ( a2[3] > 0xFu )
a2 = (_QWORD *)*a2;
*(_OWORD *)Block = 0;
si128 = 0;
v4 = -1;
do
++v4;
while ( *((_BYTE *)a2 + v4) );
sub_14003A930(Block, a2, v4);
v5 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 880), Block) != 0;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v6);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
sub_14003A830(v2);
return v5;
}