//
// GameLevelManager::cleanupDailyLevels from 0x4ae1ac to 0x4ae2de (306 bytes)
//
// 1 xrefs:
// > GameLevelManager::encodeDataTo @ 0x4ae328
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:50:00 +0000
//
unsigned int __fastcall GameLevelManager::cleanupDailyLevels(cocos2d::CCDictionary **this)
{
unsigned int v2; // r4
int v3; // r11
cocos2d::CCArray *v4; // r7
unsigned int result; // r0
int v6; // r0
cocos2d::CCString *v7; // r0
const char *CString; // r0
int v9; // r10
const char *v10; // r9
size_t v11; // r0
int v12; // r10
int v13; // r1
int v14; // r3
int v15; // r1
int v16; // r1
int v17; // r1
cocos2d::CCDictionary *v18; // r3
size_t v19; // r0
int v20; // [sp+0h] [bp-24h]
int v21; // [sp+4h] [bp-20h]
cocos2d::CCDictionary *v22; // [sp+Ch] [bp-18h]
int v23; // [sp+10h] [bp-14h] BYREF
int v24; // [sp+14h] [bp-10h]
int v25; // [sp+18h] [bp-Ch]
v2 = 0;
v3 = 0;
v21 = 0;
v20 = 0;
v4 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(*(this + 147));
while ( 1 )
{
result = cocos2d::CCArray::count(v4);
if ( v2 >= result )
return result;
v6 = cocos2d::CCArray::count(v4);
v7 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v4, ~v2 + v6);
CString = (const char *)cocos2d::CCString::getCString(v7);
v23 = 0;
v24 = 0;
v25 = 0;
v9 = (int)*(this + 147);
v10 = CString;
v11 = strlen(CString);
std::string::__init(&v23, v10, v11);
v12 = cocos2d::CCDictionary::objectForKey(v9, &v23);
std::string::~string((int)&v23);
if ( GameLevelManager::isPastDailyCopy((GameLevelManager *)this, (GJGameLevel *)v12) )
goto LABEL_15;
v13 = *(_DWORD *)(v12 + 748);
v14 = *(_DWORD *)(v12 + 744) - v13;
if ( v14 > 100000 )
{
if ( v14 <= 200000 )
{
if ( v14 >= v21 )
{
v21 = *(_DWORD *)(v12 + 744) - v13;
goto LABEL_15;
}
}
else if ( v14 >= v3 )
{
v3 = *(_DWORD *)(v12 + 744) - v13;
goto LABEL_15;
}
}
else if ( v14 >= v20 )
{
v20 = *(_DWORD *)(v12 + 744) - v13;
goto LABEL_15;
}
v15 = *(_DWORD *)(v12 + 692);
*(_BYTE *)(v12 + 917) = 1;
*(_BYTE *)(v12 + 916) = 1;
if ( *(_DWORD *)(v12 + 688) - v15 <= 0 )
{
v16 = *(unsigned __int8 *)(v12 + 1148);
if ( (v16 & 1) != 0 )
v17 = *(_DWORD *)(v12 + 1152);
else
v17 = v16 >> 1;
if ( !v17 )
{
v18 = *(this + 147);
v23 = 0;
v24 = 0;
v22 = v18;
v25 = 0;
v19 = strlen(v10);
std::string::__init(&v23, v10, v19);
cocos2d::CCDictionary::removeObjectForKey(v22);
std::string::~string((int)&v23);
}
}
LABEL_15:
++v2;
}
}