//
// SecretLayer4::onChest01 from 0x10039c2b0 to 0x10039c34e (158 bytes)
//
// 1 xrefs:
// > SecretLayer4::init @ 0x10039aaeb
//
// 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 12:29:18 +0000
//
void __fastcall SecretLayer4::onChest01(__int64 a1, __int64 a2, __m128 a3)
{
__int64 v3; // rax
__int64 v4; // r14
char *v5; // r15
char v6; // [rsp+0h] [rbp-30h] BYREF
char v7[15]; // [rsp+1h] [rbp-2Fh] BYREF
void *__p; // [rsp+10h] [rbp-20h]
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1056LL))(a2, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 344LL))(a2, 0);
v3 = GameStatsManager::sharedState();
v6 = 8;
strcpy(v7, "0003");
v4 = GameStatsManager::unlockSpecialChest(v3, (__int64)&v6, a3);
if ( (v6 & 1) != 0 )
operator delete(__p);
if ( v4 )
{
v5 = RewardUnlockLayer::create(*(_DWORD *)(v4 + 64), 0);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v5, 100);
RewardUnlockLayer::showCollectReward((__int64)v5, v4);
}
}