//
// GameStatsManager::storeEventChest from 0x7a4554 to 0x7a4650 (252 bytes)
//
// 2 xrefs:
// > GameLevelManager::onGetGJDailyLevelStateCompleted @ 0x6ff218
// > ??> @ 0x35a48
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void GameStatsManager::storeEventChest(GameStatsManager *a1, int a2, GJRewardItem *a3)
{
cocos2d::CCDictionary *m_eventChest; // x21
void *v4; // x0
unsigned int *v5; // x2
int v6; // w1
__int64 v8; // [xsp+50h] [xbp+50h] BYREF
if ( a3 )
{
m_eventChest = a1->m_eventChest;
GameStatsManager::getDailyLevelKey(a1, *(const char **)&a2, (__int64)&v8);
cocos2d::CCDictionary::setObject((int)m_eventChest, a3);
v4 = (void *)(v8 - 24);
if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v8 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v8 - 8);
*(_DWORD *)(v8 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
}
}