//
// GameLevelManager::getCompletedWeeklyLevels from 0x3c6b84 to 0x3c6c6e (234 bytes)
//
// 1 xrefs:
// > GameLevelManager::updateUserScore @ 0x3d5ee4
//
// 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::getCompletedWeeklyLevels(GameLevelManager *a1)
{
cocos2d::CCArray *v2; // r0
int *data; // r3
int v4; // r4
cocos2d::CCString **v5; // r5
cocos2d::CCString **v6; // r9
cocos2d::CCString *v7; // r2
cocos2d::CCString *v8; // t1
cocos2d::CCDictionary *m_dailyLevels; // r6
char *CString; // r0
const void *v12; // r0
GJGameLevel *v13; // r6
GameStatsManager *v14; // r0
cocos2d::CCString *v15; // [sp+4h] [bp-18h]
std::string v16; // [sp+10h] [bp-Ch] BYREF
v2 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);
if ( !v2 )
return 0;
data = (int *)v2->data;
v4 = *data;
if ( *data )
{
v5 = (cocos2d::CCString **)data[3];
v6 = &v5[v4] + 0x3FFFFFFF;
v4 = 0;
while ( v5 <= v6 )
{
v8 = *v5++;
v7 = v8;
if ( !v8 )
break;
v15 = v7;
if ( (unsigned int)(cocos2d::CCString::intValue(v7) - 100001) <= 0x1869F )
{
m_dailyLevels = a1->m_dailyLevels;
CString = (char *)cocos2d::CCString::getCString(v15);
sub_776584((int)&v16, CString);
v12 = (const void *)cocos2d::CCDictionary::objectForKey(m_dailyLevels, &v16);
if ( v12 )
v13 = (GJGameLevel *)_dynamic_cast(
v12,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
else
v13 = nullptr;
sub_774008(&v16);
if ( v13 )
{
if ( v13->m_stars.random - v13->m_stars.seed == 10 && GJGameLevel::getNormalPercent(v13) == 100 )
{
v14 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedLevel(v14, v13) )
++v4;
}
}
}
}
}
return v4;
}