//
// GameLevelManager::removeLevelDownloadedKeysFromDict from 0x4c6b98 to 0x4c6cfe (358 bytes)
//
// 0 xrefs:
//
// 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:32 +0000
//
int __fastcall GameLevelManager::removeLevelDownloadedKeysFromDict(GameLevelManager *this, cocos2d::CCDictionary *a2)
{
int result; // r0
int v4; // r8
int v5; // r6
size_t v6; // r0
_DWORD *v7; // lr
int v8; // r1
int v9; // r2
int v10; // r2
unsigned int v11; // r1
_DWORD *v12; // r3
int v13; // r1
int v14; // r2
int v15; // r3
int v16; // r6
_DWORD *v17; // r8
int v18; // [sp+0h] [bp-34h] BYREF
_DWORD *v19; // [sp+4h] [bp-30h]
unsigned int v20; // [sp+8h] [bp-2Ch] BYREF
int v21; // [sp+Ch] [bp-28h] BYREF
int v22; // [sp+10h] [bp-24h]
int v23; // [sp+14h] [bp-20h]
_DWORD v24[2]; // [sp+18h] [bp-1Ch] BYREF
_DWORD *v25; // [sp+20h] [bp-14h]
result = cocos2d::CCDictionary::count(a2);
if ( result )
{
v4 = *((_DWORD *)a2 + 13);
v18 = 0;
v19 = nullptr;
v20 = 0;
if ( v4 )
v5 = *(_DWORD *)(v4 + 272);
else
v5 = 0;
while ( v4 )
{
if ( atoi((const char *)v4) > 0 )
{
v21 = 0;
v22 = 0;
v23 = 0;
v6 = strlen((const char *)v4);
std::string::__init(&v21, (const void *)v4, v6);
v7 = v19;
if ( (unsigned int)v19 >= v20 )
{
v10 = -1431655765 * (((int)v19 - v18) >> 2);
v11 = v10 + 1;
if ( (unsigned int)(v10 + 1) > 0x15555555 )
sub_387FC0();
if ( (unsigned int)(-1431655765 * ((int)(v20 - v18) >> 2)) > 0xAAAAAA9 )
{
v11 = 357913941;
}
else if ( v11 < 1431655766 * ((int)(v20 - v18) >> 2) )
{
v11 = 1431655766 * ((int)(v20 - v18) >> 2);
}
std::__split_buffer::__split_buffer(v24, v11, v10, (int)&v20);
v12 = v25;
if ( v25 )
{
v13 = v22;
v14 = v23;
*v25 = v21;
v12[1] = v13;
v12[2] = v14;
v21 = 0;
v22 = 0;
v23 = 0;
}
v25 += 3;
std::vector::__swap_out_circular_buffer(&v18, v24);
std::__split_buffer::~__split_buffer((int)v24);
}
else
{
if ( v19 )
{
v8 = v22;
v9 = v23;
*v19 = v21;
v7[1] = v8;
v7[2] = v9;
v21 = 0;
v22 = 0;
v23 = 0;
}
v19 += 3;
}
std::string::~string((int)&v21);
}
if ( v5 )
v15 = *(_DWORD *)(v5 + 272);
else
v15 = 0;
v4 = v5;
v5 = v15;
}
v16 = v18;
v17 = v19;
while ( (_DWORD *)v16 != v17 )
{
std::string::basic_string(&v21, v16);
cocos2d::CCDictionary::removeObjectForKey(a2);
v16 += 12;
std::string::~string((int)&v21);
}
return std::__vector_base::~__vector_base((int)&v18);
}
return result;
}