//
// SecretLayer4::onChest01 from 0x1003559d4 to 0x100355a9c (200 bytes)
//
// 1 xrefs:
// > SecretLayer4::init @ 0x100354710
//
// 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
//
void __fastcall SecretLayer4::onChest01(SecretLayer4 *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v4; // x20
GJRewardItem *v5; // x20
RewardUnlockLayer *v6; // x21
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v8; // [xsp+1Fh] [xbp-21h]
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[13].copyWithZone)(a2, 0);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))a2->__vftable[4].~CCObject)(a2, 0);
v4 = GameStatsManager::sharedState();
sub_100009900(__p, "0003");
v5 = GameStatsManager::unlockSpecialChest(v4, (__int64)__p);
if ( v8 < 0 )
operator delete(__p[0]);
if ( v5 )
{
v6 = RewardUnlockLayer::create(v5->m_rewardType, nullptr);
((void (__fastcall *)(SecretLayer4 *, RewardUnlockLayer *, __int64))a1->addChild_0)(a1, v6, 100);
RewardUnlockLayer::showCollectReward(v6, v5);
}
}