//
// GameLevelManager::getCompletedDailyLevels from 0x100548a20 to 0x100548c05 (485 bytes)
//
// 1 xrefs:
// > GameLevelManager::updateUserScore @ 0x100563ce3
//
// 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 12:32:00 +0000
//
__int64 __fastcall GameLevelManager::getCompletedDailyLevels(__int64 a1)
{
__int64 v1; // rax
unsigned int *v2; // rax
_QWORD *v3; // r12
unsigned __int64 v4; // r14
__int64 v5; // rbx
__int64 v6; // r14
const char *CString; // r15
size_t v8; // rax
size_t v9; // r13
char *v10; // r14
__int64 v11; // rax
size_t v12; // rbx
const void *v13; // rax
_DWORD *v14; // r15
__int64 v15; // rax
bool hasCompletedLevel; // al
__int64 v18; // [rsp+0h] [rbp-60h]
unsigned __int64 v19; // [rsp+10h] [rbp-50h]
_QWORD __dst[2]; // [rsp+18h] [rbp-48h] BYREF
void *__p; // [rsp+28h] [rbp-38h]
__int64 v22; // [rsp+30h] [rbp-30h]
v1 = cocos2d::CCDictionary::allKeys(*(_QWORD *)(a1 + 848));
v22 = 0;
if ( v1 )
{
v2 = *(unsigned int **)(v1 + 56);
if ( *v2 )
{
v3 = *((_QWORD **)v2 + 2);
v4 = (unsigned __int64)&v3[*v2 - 1];
v22 = 0;
v19 = v4;
while ( 1 )
{
v5 = *v3;
if ( !*v3 )
return v22;
if ( (int)cocos2d::CCString::intValue(*v3) <= 100000 )
break;
LABEL_4:
if ( (unsigned __int64)++v3 > v4 )
return v22;
}
v6 = *(_QWORD *)(a1 + 848);
CString = (const char *)cocos2d::CCString::getCString(v5);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
v18 = v6;
if ( v8 >= 0x17 )
{
v11 = v8 | 7;
v12 = 26;
if ( (v9 | 7) != 0x17 )
v12 = v11 + 1;
v10 = (char *)operator new(v12);
__p = v10;
__dst[0] = v12 + 1;
__dst[1] = v9;
}
else
{
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( !v8 )
{
LABEL_15:
v10[v9] = 0;
v13 = (const void *)cocos2d::CCDictionary::objectForKey(v18, (char *)__dst);
v4 = v19;
if ( v13 )
{
v14 = __dynamic_cast(
v13,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
if ( (__dst[0] & 1) == 0 )
{
LABEL_18:
if ( v14 && v14[237] - v14[238] <= 9 && v14[215] - v14[214] == 100 )
{
v15 = GameStatsManager::sharedState();
hasCompletedLevel = GameStatsManager::hasCompletedLevel(v15, (__int64)v14);
v22 = hasCompletedLevel + (unsigned int)v22;
}
goto LABEL_4;
}
}
else
{
v14 = nullptr;
if ( (__dst[0] & 1) == 0 )
goto LABEL_18;
}
operator delete(__p);
goto LABEL_18;
}
}
memmove(v10, CString, v9);
goto LABEL_15;
}
}
return v22;
}