//
// GameLevelManager::getCompletedEventLevels from 0x140148900 to 0x140148b04 (516 bytes)
//
// 3 xrefs:
// > GameLevelManager::updateUserScore @ 0x140156604
// > GameLevelManager::updateUserScore @ 0x140156995
// > ??> @ 0x1406ca65c
//
// 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
//
// Hidden C++ exception states: #wind=2
int GameLevelManager::getCompletedEventLevels(GameLevelManager *a1, int a2, int a3)
{
int v6; // esi
struct cocos2d::CCArray *v7; // rax
cocos2d::ccArray *data; // rdi
__int64 num; // rax
cocos2d::CCString **arr; // rdi
cocos2d::CCString **i; // rbp
cocos2d::CCString *v12; // rbx
const char *CString; // rax
size_t v14; // r8
__int64 v15; // rax
GJGameLevel *v16; // rbx
void *v17; // rcx
int v18; // eax
GameStatsManager *v19; // rcx
void *v21; // [rsp+30h] [rbp-58h]
__int128 v22; // [rsp+38h] [rbp-50h] BYREF
__int64 v23; // [rsp+48h] [rbp-40h]
unsigned __int64 v24; // [rsp+50h] [rbp-38h]
v6 = 0;
v7 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);
if ( v7 )
{
data = v7->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (cocos2d::CCString **)data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
v12 = *arr;
if ( !*arr )
break;
if ( (int)cocos2d::CCString::intValue(*arr) > 200000 )
{
CString = cocos2d::CCString::getCString(v12);
v22 = 0;
v23 = 0;
v24 = 0;
v14 = -1;
do
++v14;
while ( CString[v14] );
sub_14003A930(&v22, CString, v14);
v15 = cocos2d::CCDictionary::objectForKey(a1->m_dailyLevels, &v22);
v16 = (GJGameLevel *)_RTDynamicCast(
v15,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&GJGameLevel `RTTI Type Descriptor',
0);
if ( v24 > 0xF )
{
v17 = (void *)v22;
if ( v24 + 1 >= 0x1000 )
{
v17 = *(void **)(v22 - 8);
if ( (unsigned __int64)(v22 - (_QWORD)v17 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v17);
}
v23 = 0;
v24 = 15;
LOBYTE(v22) = 0;
if ( v16 )
{
v18 = v16->m_stars.random - v16->m_stars.seed;
if ( v18 >= a2 && v18 <= a3 && v16->m_normalPercent.random - v16->m_normalPercent.seed == 100 )
{
v19 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v21 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v19 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::hasCompletedLevel(v19, v16) )
++v6;
}
}
}
}
}
}
return v6;
}