//
// GJBaseGameLayer::processItems from 0x1001e9c64 to 0x1001e9dd8 (372 bytes)
//
// 1 xrefs:
// > PlayLayer::levelComplete @ 0x10011a03c
//
// 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 GJBaseGameLayer::processItems(GJBaseGameLayer *a1)
{
cocos2d::CCArray *v2; // x20
__int64 v3; // x21
cocos2d::CCString *v4; // x0
char *CString; // x0
cocos2d::CCDictionary *m_collectedItems; // x24
int *v7; // x24
int v8; // w0
const char *v9; // x24
GJGameLevel *m_level; // x8
int random; // w25
int seed; // w26
GameStatsManager *v13; // x0
GameStatsManager *v14; // x0
const char *CoinKey; // x24
GameStatsManager *v16; // x0
GameStatsManager *v17; // x0
GameStatsManager *v18; // x0
const char *v19; // x1
GameStatsManager *v20; // x0
void *__p[2]; // [xsp+8h] [xbp-58h] BYREF
char v22; // [xsp+1Fh] [xbp-41h]
v2 = cocos2d::CCDictionary::allKeys(a1->m_collectedItems);
if ( (unsigned int)sub_10024A36C(v2) )
{
v3 = 0;
do
{
v4 = (cocos2d::CCString *)sub_10024A388(v2, v3);
CString = (char *)cocos2d::CCString::getCString(v4);
m_collectedItems = a1->m_collectedItems;
sub_100009900(__p, CString);
v7 = (int *)cocos2d::CCDictionary::objectForKey_1(m_collectedItems, __p);
if ( v22 < 0 )
operator delete(__p[0]);
v8 = (*(__int64 (__fastcall **)(int *))(*(_QWORD *)v7 + 1784LL))(v7);
if ( v8 == 22 )
{
CoinKey = GJGameLevel::getCoinKey(a1->m_level, v7[448]);
v16 = GameStatsManager::sharedState();
if ( !GameStatsManager::hasSecretCoin(v16, CoinKey) )
{
v17 = GameStatsManager::sharedState();
GameStatsManager::storeSecretCoin(v17, CoinKey);
v18 = GameStatsManager::sharedState();
v19 = "8";
LABEL_14:
GameStatsManager::incrementStat_1(v18, v19);
}
}
else if ( v8 == 31 )
{
v9 = GJGameLevel::getCoinKey(a1->m_level, v7[448]);
m_level = a1->m_level;
random = m_level->m_coinsVerified.random;
seed = m_level->m_coinsVerified.seed;
v13 = GameStatsManager::sharedState();
if ( random == seed )
{
if ( !GameStatsManager::hasPendingUserCoin(v13, v9) )
{
v14 = GameStatsManager::sharedState();
GameStatsManager::storePendingUserCoin(v14, v9);
}
goto LABEL_15;
}
if ( !GameStatsManager::hasUserCoin(v13, v9) )
{
v20 = GameStatsManager::sharedState();
GameStatsManager::storeUserCoin(v20, v9);
v18 = GameStatsManager::sharedState();
v19 = "12";
goto LABEL_14;
}
}
LABEL_15:
v3 = (unsigned int)(v3 + 1);
}
while ( (unsigned int)v3 < (unsigned int)sub_10024A36C(v2) );
}
}