//
// GameLevelManager::getCompletedWeeklyLevels from 0x7063d8 to 0x706600 (552 bytes)
//
// 2 xrefs:
// > GameLevelManager::updateUserScore @ 0x73761c
// > ??> @ 0x76a70
//
// 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; // x0
cocos2d::ccArray *data; // x1
cocos2d::CCString **arr; // x19
__int64 v5; // x0
char *v6; // x20
cocos2d::CCString *v7; // x28
int v8; // w26
cocos2d::CCString *v9; // x0
cocos2d::CCDictionary *m_dailyLevels; // x28
char *CString; // x0
const void *v12; // x0
GJGameLevel *v13; // x28
char *v14; // x0
GameStatsManager *v15; // x0
unsigned int *v17; // x1
int v18; // w3
std::string v19; // [xsp+80h] [xbp+80h] BYREF
v2 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);
if ( !v2 )
return 0;
data = v2->data;
if ( !data->num )
return 0;
arr = (cocos2d::CCString **)data->arr;
v5 = 8LL * data->num - 8;
v6 = (char *)arr + v5;
if ( arr > (cocos2d::CCString **)((char *)arr + v5) )
return 0;
v7 = *arr;
v8 = 0;
if ( *arr )
{
if ( (unsigned int)(cocos2d::CCString::intValue(v7) - 100001) <= 0x1869F )
goto LABEL_9;
while ( v6 >= (char *)++arr )
{
v7 = *arr;
if ( !*arr )
break;
if ( (unsigned int)(cocos2d::CCString::intValue(*arr) - 100001) <= 0x1869F )
{
LABEL_9:
v9 = v7;
m_dailyLevels = a1->m_dailyLevels;
CString = (char *)cocos2d::CCString::getCString(v9);
sub_D153B8((int)&v19, CString);
v12 = (const void *)cocos2d::CCDictionary::objectForKey(m_dailyLevels, &v19);
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;
v14 = (char *)v19.m_data.m_data - 24;
if ( (__int64 *)v19.m_data.m_data - 3 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)((char *)v19.m_data.m_data - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v19.m_data.m_data - 2);
*((_DWORD *)v19.m_data.m_data - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v14);
}
if ( v13 && v13->m_stars.random - v13->m_stars.seed == 10 && GJGameLevel::getNormalPercent(v13) == 100 )
{
v15 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedLevel(v15, v13) )
++v8;
}
}
}
}
return v8;
}