//
// GameStatsManager::storeRewardState from 0x40e818 to 0x40e894 (124 bytes)
//
// 2 xrefs:
// > GameLevelManager::onGetGJRewardsCompleted @ 0x3c3b84
// > GameLevelManager::onGetGJRewardsCompleted @ 0x3c3bac
//
// 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 GameStatsManager::storeRewardState(int a1, intptr_t a2, int a3, int a4)
{
double v4; // d0
int v9; // r5
int v10; // r5
_DWORD v11[2]; // [sp+0h] [bp-8h] BYREF
v11[0] = a1;
v11[1] = a2;
if ( a4 <= 0 )
{
v9 = 0;
}
else
{
sub_40C1E8(a1, _stack_chk_guard, COERCE_FLOAT(&_stack_chk_guard), a4);
v9 = (int)v4 + a4;
}
sub_775C20(v11);
v10 = GJRewardItem::create(a3, v9, (int)v11);
sub_774008(v11);
*(_BYTE *)(v10 + 68) = 1;
*(_DWORD *)(v10 + 60) = a2;
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 356), (cocos2d::CCObject *)v10, a2);
}