//
// SecretLayer3::onChest02 from 0xa8c2f8 to 0xa8c420 (296 bytes)
//
// 3 xrefs:
// > ??> @ 0x9bb48
// > SecretLayer3::init @ 0xa93258
// > ??> @ 0x1544490
//
// 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 13:00:37 +0000
//
__int64 __fastcall SecretLayer3::onChest02(SecretLayer3 *this, cocos2d::CCObject *a2)
{
GameStatsManager *v5; // x0
GameStatsManager *v6; // x21
RewardsPage *v7; // x2
unsigned int *v8; // x21
RewardUnlockLayer *v9; // x22
__int64 v10[2]; // [xsp+30h] [xbp+30h] BYREF
void *v11; // [xsp+40h] [xbp+40h]
if ( !*((_BYTE *)this + 424) )
{
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)a2 + 1056LL))(a2, 0);
v5 = (GameStatsManager *)(*(__int64 (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)a2 + 344LL))(a2, 0);
v6 = (GameStatsManager *)GameStatsManager::sharedState(v5);
v10[0] = 0;
v10[1] = 0;
v11 = nullptr;
std::string::__init(v10, "0002", 4u);
v8 = (unsigned int *)GameStatsManager::unlockSpecialChest(v6, (char *)v10);
if ( (v10[0] & 1) != 0 )
operator delete(v11);
if ( v8 )
{
v9 = (RewardUnlockLayer *)RewardUnlockLayer::create((RewardUnlockLayer *)v8[16], nullptr, v7);
(*(void (__fastcall **)(SecretLayer3 *, RewardUnlockLayer *, __int64))(*(_QWORD *)this + 464LL))(this, v9, 100);
RewardUnlockLayer::showCollectReward(v9, (GJRewardItem *)v8);
}
}
return _stack_chk_guard;
}