//
// GameLevelManager::removeLevelDownloadedKeysFromDict from 0x834d30 to 0x835050 (800 bytes)
//
// 1 xrefs:
// > ??> @ 0xfdc78
//
// This function is hookable on this platform (idp: arm, 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:55:10 +0000
//
__int64 __fastcall GameLevelManager::removeLevelDownloadedKeysFromDict(
GameLevelManager *this,
cocos2d::CCDictionary *a2)
{
__int64 v3; // x21
__int64 i; // x20
size_t v5; // x0
char *v6; // x0
__int64 v7; // x3
char *v8; // x21
char *v9; // x0
char *v11; // x20
__int64 v12; // x1
__int64 v13; // x2
unsigned __int64 v14; // x1
_QWORD *v15; // x2
__int64 v16; // x1
_QWORD *v17; // x21
_QWORD *j; // x0
void *v19; // [xsp+60h] [xbp+60h] BYREF
char *v20; // [xsp+68h] [xbp+68h]
unsigned __int64 v21; // [xsp+70h] [xbp+70h] BYREF
void *v22; // [xsp+78h] [xbp+78h] BYREF
__int64 v23; // [xsp+80h] [xbp+80h]
void *v24; // [xsp+88h] [xbp+88h]
void *v25; // [xsp+90h] [xbp+90h] BYREF
_QWORD *v26; // [xsp+98h] [xbp+98h]
_QWORD *v27; // [xsp+A0h] [xbp+A0h]
if ( !(unsigned int)cocos2d::CCDictionary::count(a2) )
return _stack_chk_guard;
v3 = *((_QWORD *)a2 + 7);
v19 = nullptr;
v20 = nullptr;
v21 = 0;
if ( !v3 )
return _stack_chk_guard;
for ( i = *(_QWORD *)(v3 + 288); ; i = *(_QWORD *)(i + 288) )
{
if ( atoi((const char *)v3) > 0 )
{
v22 = nullptr;
v23 = 0;
v24 = nullptr;
v5 = strlen((const char *)v3);
std::string::__init((__int64 *)&v22, (void *)v3, v5);
v6 = v20;
if ( (unsigned __int64)v20 >= v21 )
{
v13 = 0xAAAAAAAAAAAAAAABLL * ((v20 - (_BYTE *)v19) >> 3);
v14 = v13 + 1;
if ( (unsigned __int64)(v13 + 1) > 0xAAAAAAAAAAAAAAALL )
sub_62C7FC();
if ( 0xAAAAAAAAAAAAAAABLL * ((__int64)(v21 - (_QWORD)v19) >> 3) > 0x555555555555554LL )
{
v14 = 0xAAAAAAAAAAAAAAALL;
}
else if ( 0x5555555555555556LL * ((__int64)(v21 - (_QWORD)v19) >> 3) >= v14 )
{
v14 = 0x5555555555555556LL * ((__int64)(v21 - (_QWORD)v19) >> 3);
}
std::__split_buffer::__split_buffer((__int64 *)&v25, v14, v13, (__int64)&v21);
v15 = v27;
if ( v27 )
{
v16 = v23;
*v27 = v22;
v15[1] = v16;
v15[2] = v24;
v22 = nullptr;
v15 = v27;
v23 = 0;
v24 = nullptr;
}
v27 = v15 + 3;
std::vector::__swap_out_circular_buffer((__int64 *)&v19, &v25);
v17 = v26;
for ( j = v27; v17 != v27; j = v27 )
{
v27 = j - 3;
std::string::~string((__int64)(j - 3));
}
if ( v25 )
operator delete(v25);
}
else
{
if ( v20 )
{
v7 = v23;
*(_QWORD *)v20 = v22;
*((_QWORD *)v6 + 1) = v7;
*((_QWORD *)v6 + 2) = v24;
v6 = v20;
v22 = nullptr;
v23 = 0;
v24 = nullptr;
}
v20 = v6 + 24;
}
if ( ((unsigned __int8)v22 & 1) != 0 )
break;
}
if ( !i )
goto LABEL_20;
LABEL_11:
v3 = i;
}
operator delete(v24);
if ( i )
goto LABEL_11;
LABEL_20:
v11 = (char *)v19;
v8 = v20;
if ( v19 != v20 )
{
do
{
v22 = nullptr;
v23 = 0;
v24 = nullptr;
if ( (*v11 & 1) != 0 )
{
std::string::__init((__int64 *)&v22, *((void **)v11 + 2), *((_QWORD *)v11 + 1));
}
else
{
v12 = *((_QWORD *)v11 + 1);
v22 = *(void **)v11;
v23 = v12;
v24 = *((void **)v11 + 2);
}
cocos2d::CCDictionary::removeObjectForKey(a2, &v22);
if ( ((unsigned __int8)v22 & 1) != 0 )
operator delete(v24);
v11 += 24;
}
while ( v8 != v11 );
v8 = (char *)v19;
}
if ( v8 )
{
v9 = v20;
if ( v20 != v8 )
{
do
{
v20 = v9 - 24;
std::string::~string((__int64)(v9 - 24));
v9 = v20;
}
while ( v20 != v8 );
v8 = (char *)v19;
}
operator delete(v8);
}
return _stack_chk_guard;
}