//
// GameLevelManager::getCompletedEventLevels from 0x3c6d74 to 0x3c6e60 (236 bytes)
//
// 2 xrefs:
// > GameLevelManager::updateUserScore @ 0x3d5efc
// > GameLevelManager::updateUserScore @ 0x3d5fe0
//
// 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
//
int GameLevelManager::getCompletedEventLevels(GameLevelManager *a1, int a2, int a3)
{
cocos2d::CCArray *v5; // r0
int *data; // r3
int v7; // r4
cocos2d::CCString **v8; // r5
int v9; // r3
cocos2d::CCString **v10; // r10
cocos2d::CCString *v11; // r2
cocos2d::CCString *v12; // t1
cocos2d::CCDictionary *m_dailyLevels; // r8
char *CString; // r0
const void *v16; // r0
GJGameLevel *v17; // r8
int v18; // r3
GameStatsManager *v19; // r0
cocos2d::CCString *v21; // [sp+Ch] [bp-18h]
std::string v22; // [sp+18h] [bp-Ch] BYREF
v5 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);
if ( !v5 )
return 0;
data = (int *)v5->data;
v7 = *data;
if ( *data )
{
v8 = (cocos2d::CCString **)data[3];
v9 = v7 + 0x3FFFFFFF;
v7 = 0;
v10 = &v8[v9];
while ( v8 <= v10 )
{
v12 = *v8++;
v11 = v12;
if ( !v12 )
break;
v21 = v11;
if ( cocos2d::CCString::intValue(v11) > 200000 )
{
m_dailyLevels = a1->m_dailyLevels;
CString = (char *)cocos2d::CCString::getCString(v21);
sub_776584((int)&v22, CString);
v16 = (const void *)cocos2d::CCDictionary::objectForKey(m_dailyLevels, &v22);
if ( v16 )
v17 = (GJGameLevel *)_dynamic_cast(
v16,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
else
v17 = nullptr;
sub_774008(&v22);
if ( v17 )
{
v18 = v17->m_stars.random - v17->m_stars.seed;
if ( v18 >= a2 && v18 <= a3 && GJGameLevel::getNormalPercent(v17) == 100 )
{
v19 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedLevel(v19, v17) )
++v7;
}
}
}
}
}
return v7;
}