//
// GameLevelManager::getCompletedEventLevels from 0x1402204e0 to 0x1402206f3 (531 bytes)
//
// 3 xrefs:
// > GameLevelManager::updateUserScore @ 0x140236c9a
// > GameLevelManager::updateUserScore @ 0x14023703d
// > ??> @ 0x14091bb6c
//
// This function is hookable on this platform (idp: pc, 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 11:28:24 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall GameLevelManager::getCompletedEventLevels(__int64 a1, int a2, int a3)
{
unsigned int v6; // esi
struct cocos2d::CCArray *v7; // rax
unsigned int *v8; // rdi
__int64 v9; // rax
cocos2d::CCString **v10; // rdi
cocos2d::CCString **i; // rbp
cocos2d::CCString *v12; // rbx
const char *CString; // rax
size_t v14; // r8
__int64 v15; // rax
_DWORD *v16; // rbx
void *v17; // rcx
int v18; // eax
__int64 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(*(cocos2d::CCDictionary **)(a1 + 944));
if ( v7 )
{
v8 = *((unsigned int **)v7 + 7);
v9 = *v8;
if ( (_DWORD)v9 )
{
v10 = *((cocos2d::CCString ***)v8 + 2);
for ( i = &v10[v9 - 1]; v10 <= i; ++v10 )
{
v12 = *v10;
if ( !*v10 )
break;
if ( (int)cocos2d::CCString::intValue(*v10) > 200000 )
{
CString = cocos2d::CCString::getCString(v12);
v22 = 0;
v23 = 0;
v24 = 0;
v14 = -1;
do
++v14;
while ( CString[v14] );
sub_14003D230(&v22, CString, v14);
v15 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 944), &v22);
v16 = (_DWORD *)_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 )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v17);
}
v23 = 0;
v24 = 15;
LOBYTE(v22) = 0;
if ( v16 )
{
v18 = v16[255] - v16[256];
if ( v18 >= a2 && v18 <= a3 && v16[233] - v16[232] == 100 )
{
v19 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v21 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v19 = qword_14090BFE0;
}
if ( (unsigned __int8)GameStatsManager::hasCompletedLevel(v19, v16) )
++v6;
}
}
}
}
}
}
return v6;
}