//
// GameLevelManager::getCompletedEventLevels from 0x808154 to 0x808338 (484 bytes)
//
// 3 xrefs:
// > GameLevelManager::updateUserScore @ 0x852968
// > GameLevelManager::updateUserScore @ 0x852ac8
// > ??> @ 0xbcea8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:54:46 +0000
//
__int64 __fastcall GameLevelManager::getCompletedEventLevels(cocos2d::CCDictionary **this, int a2, int a3)
{
__int64 v6; // x0
unsigned int *v7; // x1
cocos2d::CCString **v8; // x19
__int64 v9; // x0
char *v10; // x21
cocos2d::CCString *v11; // x28
cocos2d::CCString *v12; // x0
__int64 v13; // x28
const char *CString; // x0
size_t v15; // x0
const void *v16; // x0
GJGameLevel *v17; // x28
int v18; // w0
GameStatsManager *NormalPercent; // x0
GameStatsManager *v20; // x0
bool v21; // zf
unsigned int v22; // w0
unsigned int v24; // [xsp+64h] [xbp+64h]
char *v25; // [xsp+68h] [xbp+68h]
__int64 v26[2]; // [xsp+70h] [xbp+70h] BYREF
void *v27; // [xsp+80h] [xbp+80h]
v6 = cocos2d::CCDictionary::allKeys(*(this + 106));
if ( v6
&& (v7 = *(unsigned int **)(v6 + 56), *v7)
&& (v8 = *((cocos2d::CCString ***)v7 + 2),
v9 = 8LL * *v7 - 8,
v10 = (char *)v8 + v9,
v8 <= (cocos2d::CCString **)((char *)v8 + v9)) )
{
v11 = *v8;
v24 = 0;
if ( *v8 )
{
if ( (int)cocos2d::CCString::intValue(v11) > 200000 )
goto LABEL_9;
while ( 1 )
{
do
{
if ( v10 >= (char *)++v8 )
{
v11 = *v8;
if ( *v8 )
continue;
}
return v24;
}
while ( (int)cocos2d::CCString::intValue(*v8) <= 200000 );
LABEL_9:
v12 = v11;
v13 = (__int64)*(this + 106);
CString = (const char *)cocos2d::CCString::getCString(v12);
v26[0] = 0;
v25 = (char *)CString;
v26[1] = 0;
v27 = nullptr;
v15 = strlen(CString);
std::string::__init(v26, v25, v15);
v16 = (const void *)cocos2d::CCDictionary::objectForKey(v13, v26);
if ( v16 )
break;
if ( (v26[0] & 1) != 0 )
{
v17 = nullptr;
LABEL_22:
operator delete(v27);
LABEL_11:
if ( v17 )
{
v18 = *((_DWORD *)v17 + 237) - *((_DWORD *)v17 + 238);
if ( a2 <= v18 && a3 >= v18 )
{
NormalPercent = (GameStatsManager *)GJGameLevel::getNormalPercent(v17);
if ( (_DWORD)NormalPercent == 100 )
{
v20 = (GameStatsManager *)GameStatsManager::sharedState(NormalPercent);
v21 = (unsigned __int8)GameStatsManager::hasCompletedLevel(v20, v17) == 0;
v22 = v24;
if ( !v21 )
v22 = v24 + 1;
v24 = v22;
}
}
}
}
}
v17 = (GJGameLevel *)_dynamic_cast(
v16,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
if ( (v26[0] & 1) == 0 )
goto LABEL_11;
goto LABEL_22;
}
}
else
{
return 0;
}
return v24;
}