//
// GameStatsManager::unlockSpecialChest from 0x1402ee890 to 0x1402ee962 (210 bytes)
//
// 11 xrefs:
// > FollowRewardPage::onSpecialItem @ 0x14020e91e
// > GameStatsManager::unlockOnlineChest @ 0x1402eeb69
// > GauntletSelectLayer::onPlay @ 0x1402ffd1a
// > GJPathRewardPopup::onClaim @ 0x1403982e9
// > GJShopLayer::dialogClosed @ 0x1403b4c2f
// > SecretRewardsLayer::onSpecialItem @ 0x14056c871
// > SecretLayer3::onChest01 @ 0x140581204
// > SecretLayer3::onChest02 @ 0x140581384
// > SecretLayer4::onChest01 @ 0x140586557
// > SupportLayer::onGetReward @ 0x14066b188
// > ??> @ 0x14091e0f8
//
// This function is hookable on this platform (idp: pc, 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 11:29:56 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall GameStatsManager::unlockSpecialChest(__int64 a1, __int64 a2)
{
_QWORD *v4; // rax
__int64 v5; // rsi
__int64 v7; // [rsp+20h] [rbp-58h]
_BYTE v8[32]; // [rsp+28h] [rbp-50h] BYREF
__int64 v9; // [rsp+48h] [rbp-30h]
v9 = a2;
v4 = (_QWORD *)sub_14003F4F0((__int64)v8, a2);
if ( GameStatsManager::isSpecialChestUnlocked(a1, v4)
|| (v7 = sub_14003F4F0((__int64)v8, a2),
v5 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 368), v7),
sub_14003D310(v7),
!v5) )
{
sub_14003D310(a2);
return 0;
}
else
{
GameStatsManager::preProcessReward(a1, v5);
GameStatsManager::registerRewardsFromItem(a1, v5);
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 888), v5, a2);
sub_14003D310(a2);
return v5;
}
}