//
// GameStatsManager::addSimpleSpecialChestReward from 0x1401ea0a0 to 0x1401ea1c2 (290 bytes)
//
// 19 xrefs:
// > GameStatsManager::createSpecialChestItems @ 0x1401e847b
// > GameStatsManager::createSpecialChestItems @ 0x1401e849e
// > GameStatsManager::createSpecialChestItems @ 0x1401e84c1
// > GameStatsManager::createSpecialChestItems @ 0x1401e84e6
// > GameStatsManager::createSpecialChestItems @ 0x1401e850b
// > GameStatsManager::createSpecialChestItems @ 0x1401e8530
// > GameStatsManager::createSpecialChestItems @ 0x1401e8555
// > GameStatsManager::createSpecialChestItems @ 0x1401e8578
// > GameStatsManager::createSpecialChestItems @ 0x1401e859b
// > GameStatsManager::createSpecialChestItems @ 0x1401e85c0
// > GameStatsManager::createSpecialChestItems @ 0x1401e85e3
// > GameStatsManager::createSpecialChestItems @ 0x1401e8606
// > GameStatsManager::createSpecialChestItems @ 0x1401e863e
// > GameStatsManager::createSpecialChestItems @ 0x1401e8676
// > GameStatsManager::createSpecialChestItems @ 0x1401e86b0
// > GameStatsManager::createSpecialChestItems @ 0x1401e86e8
// > GameStatsManager::createSpecialChestItems @ 0x1401e8722
// > GameStatsManager::createSpecialChestItems @ 0x1401e875c
// > ??> @ 0x1406cc630
//
// 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
void __fastcall GameStatsManager::addSimpleSpecialChestReward(__int64 a1, __int64 a2, int a3, unsigned int a4)
{
cocos2d::CCArray *v8; // rbp
__int64 v9; // rbx
cocos2d::CCObject *v10; // rcx
cocos2d::CCObject *v11; // [rsp+20h] [rbp-68h]
__int128 v12; // [rsp+28h] [rbp-60h] BYREF
__int64 v13; // [rsp+38h] [rbp-50h]
__int64 v14; // [rsp+40h] [rbp-48h]
__int64 v15; // [rsp+48h] [rbp-40h]
v15 = a2;
v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
v11 = (cocos2d::CCObject *)operator new(0x48u);
cocos2d::CCObject::CCObject(v11);
v11->__vftable = (cocos2d::CCObject_vtbl *)&GJRewardObject::`vftable';
LODWORD(v11[1].__vftable) = 9;
v11[1].m_uID = a4;
v11[1].m_nLuaID = 1;
cocos2d::CCObject::autorelease(v11);
HIDWORD(v11[1].__vftable) = a3;
cocos2d::CCArray::addObject(v8, v11);
v12 = 0;
v13 = 0;
v14 = 15;
LOBYTE(v12) = 0;
v9 = GJRewardItem::create(0, 0, &v12);
*(_DWORD *)(v9 + 64) = 2;
if ( *(cocos2d::CCArray **)(v9 + 72) != v8 )
{
if ( v8 )
cocos2d::CCObject::retain(v8);
v10 = *(cocos2d::CCObject **)(v9 + 72);
if ( v10 )
cocos2d::CCObject::release(v10);
*(_QWORD *)(v9 + 72) = v8;
}
cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 368), v9, a2);
sub_14003A830(a2);
}