//
// GJBaseGameLayer::processItems from 0x46f388 to 0x46f4ac (292 bytes)
//
// 1 xrefs:
// > PlayLayer::levelComplete @ 0x3137fc
//
// 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 GJBaseGameLayer::processItems(GJBaseGameLayer *a1)
{
cocos2d::CCDictionary **p_m_collectedItems; // r8
unsigned int v3; // r7
cocos2d::CCArray *v4; // r9
cocos2d::CCString *v5; // r0
char *CString; // r0
cocos2d::CCDictionary *v7; // r4
int *v8; // r4
int v9; // r0
const char *CoinKey; // r6
GameStatsManager *v11; // r0
GameStatsManager *v12; // r0
GameStatsManager *v13; // r0
const char *v14; // r1
const char *v15; // r6
GameStatsManager *v16; // r0
GameStatsManager *v17; // r0
GameStatsManager *v18; // r0
GameStatsManager *v19; // r0
std::string v20; // [sp+10h] [bp-Ch] BYREF
p_m_collectedItems = &a1->m_collectedItems;
v3 = 0;
v4 = cocos2d::CCDictionary::allKeys(a1->m_collectedItems);
while ( v3 < cocos2d::CCArray::count(v4) )
{
v5 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v4, v3);
CString = (char *)cocos2d::CCString::getCString(v5);
v7 = *p_m_collectedItems;
sub_776584((int)&v20, CString);
v8 = (int *)cocos2d::CCDictionary::objectForKey(v7, &v20);
sub_774008(&v20);
v9 = (*(int (__fastcall **)(int *))(*v8 + 892))(v8);
if ( v9 == 22 )
{
CoinKey = GJGameLevel::getCoinKey(a1->m_level, v8[400]);
v11 = GameStatsManager::sharedState();
if ( GameStatsManager::hasSecretCoin(v11, CoinKey) )
goto LABEL_14;
v12 = GameStatsManager::sharedState();
GameStatsManager::storeSecretCoin(v12, CoinKey);
v13 = GameStatsManager::sharedState();
v14 = (const char *)&aO1i2r3e45s7t89[12];
LABEL_11:
GameStatsManager::incrementStat(v13, v14);
goto LABEL_14;
}
if ( v9 == 31 )
{
v15 = GJGameLevel::getCoinKey(a1->m_level, v8[400]);
if ( a1->m_level->m_coinsVerified.random != a1->m_level->m_coinsVerified.seed )
{
v16 = GameStatsManager::sharedState();
if ( GameStatsManager::hasUserCoin(v16, v15) )
goto LABEL_14;
v17 = GameStatsManager::sharedState();
GameStatsManager::storeUserCoin(v17, v15);
v13 = GameStatsManager::sharedState();
v14 = "12";
goto LABEL_11;
}
v18 = GameStatsManager::sharedState();
if ( !GameStatsManager::hasPendingUserCoin(v18, v15) )
{
v19 = GameStatsManager::sharedState();
GameStatsManager::storePendingUserCoin(v19, v15);
}
}
LABEL_14:
++v3;
}
}