//
// GameLevelManager::removeLevelDownloadedKeysFromDict from 0x3ce914 to 0x3cea88 (372 bytes)
//
// 0 xrefs:
//
// 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
//
void GameLevelManager::removeLevelDownloadedKeysFromDict(GameLevelManager *a1, cocos2d::CCDictionary *a2)
{
cocos2d::CCDictElement *m_pElements; // r4
cocos2d::CCDictElement *next; // r5
char *v5; // r3
unsigned int v6; // r0
unsigned int v7; // r7
_DWORD *v8; // r8
char *v9; // r1
char *v10; // r2
int v11; // r4
char *v12; // lr
_DWORD *v13; // r3
char *v14; // r4
cocos2d::CCDictElement *v15; // r3
char *v16; // r6
char *i; // r5
char *v18; // [sp+8h] [bp-24h]
char *v19; // [sp+Ch] [bp-20h]
void *v20; // [sp+14h] [bp-18h] BYREF
void *p; // [sp+18h] [bp-14h] BYREF
char *v22; // [sp+1Ch] [bp-10h]
char *v23; // [sp+20h] [bp-Ch]
if ( cocos2d::CCDictionary::count(a2) )
{
m_pElements = a2->m_pElements;
p = nullptr;
v22 = nullptr;
v23 = nullptr;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
while ( m_pElements )
{
if ( atoi((const char *)m_pElements) > 0 )
{
sub_776584((int)&v20, (char *)m_pElements);
v5 = v22;
if ( v22 == v23 )
{
v6 = std::vector::_M_check_len(&p, 1u, (int)"vector::_M_emplace_back_aux");
v7 = v6;
if ( v6 )
{
if ( v6 >= 0x40000000 )
sub_772FB4(v6);
v8 = (_DWORD *)operator new(4 * v6);
}
else
{
v8 = nullptr;
}
v9 = v22;
v10 = (char *)p;
v11 = v22 - (_BYTE *)p;
if ( (char *)v8 + v22 - (_BYTE *)p )
{
*(_DWORD *)((char *)v8 + v11) = v20;
v20 = &unk_ACDDA8;
}
v12 = v10;
v13 = v8;
while ( v12 != v9 )
{
if ( v13 )
{
*v13 = *(_DWORD *)v12;
*(_DWORD *)v12 = &unk_ACDDA8;
}
v12 += 4;
++v13;
}
v14 = (char *)v8 + (v11 & 0xFFFFFFFC) + 4;
while ( v10 != v9 )
{
v19 = v9;
v18 = v10;
sub_774008(v10);
v9 = v19;
v10 = v18 + 4;
}
if ( p )
operator delete(p);
p = v8;
v22 = v14;
v23 = (char *)&v8[v7];
}
else
{
if ( v22 )
{
*(_DWORD *)v22 = v20;
v20 = &unk_ACDDA8;
}
v22 = v5 + 4;
}
sub_774008(&v20);
}
if ( next )
v15 = (cocos2d::CCDictElement *)next->hh.next;
else
v15 = nullptr;
m_pElements = next;
next = v15;
}
v16 = v22;
for ( i = (char *)p; i != v16; i += 4 )
{
sub_775C20(&v20);
cocos2d::CCDictionary::removeObjectForKey(a2);
sub_774008(&v20);
}
std::vector::~vector(&p);
}
}