//
// GameLevelManager::verifyContainerOnlyHasLevels from 0x10053b160 to 0x10053b3a0 (576 bytes)
//
// 1 xrefs:
// > GameLevelManager::dataLoaded @ 0x10053b8c2
//
// 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
//
bool __fastcall GameLevelManager::verifyContainerOnlyHasLevels(GameLevelManager *a1, cocos2d::CCDictionary *a2)
{
__int128 v2; // xmm0
cocos2d::CCDictElement *m_pElements; // r14
void **v4; // rbx
cocos2d::CCObject *m_pObject; // rdi
cocos2d::CCDictElement *next; // r13
size_t v7; // rax
size_t v8; // r12
char *v9; // r13
void **v10; // r15
size_t v11; // rbx
void *v12; // rbx
void **v13; // rbx
void *v14; // r14
void *v15; // rdi
void **v17; // r15
cocos2d::CCDictElement *v18; // [rsp+0h] [rbp-80h]
void *v19[2]; // [rsp+10h] [rbp-70h] BYREF
void *v20[2]; // [rsp+20h] [rbp-60h]
int v21; // [rsp+30h] [rbp-50h]
__int128 __dst; // [rsp+40h] [rbp-40h] BYREF
void *__p; // [rsp+50h] [rbp-30h]
*(_QWORD *)&v2 = 0;
*(_OWORD *)v20 = 0;
*(_OWORD *)v19 = 0;
v21 = 1065353216;
if ( !a2 )
goto LABEL_25;
m_pElements = a2->m_pElements;
if ( !m_pElements )
goto LABEL_25;
v4 = v19;
do
{
m_pObject = m_pElements->m_pObject;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( m_pObject
&& __dynamic_cast(
m_pObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0) )
{
goto LABEL_4;
}
v7 = strlen(m_pElements->m_szKey);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(0.0);
v8 = v7;
v18 = next;
if ( v7 >= 0x17 )
{
v10 = v4;
v11 = (v7 | 7) + 1;
if ( (v7 | 7) == 0x17 )
v11 = 26;
v9 = (char *)operator new(v11);
__p = v9;
*(_QWORD *)&__dst = v11 | 1;
*((_QWORD *)&__dst + 1) = v8;
v4 = v10;
LABEL_14:
memmove(v9, m_pElements, v8);
goto LABEL_15;
}
LOBYTE(__dst) = 2 * v7;
v9 = (char *)&__dst + 1;
if ( v7 )
goto LABEL_14;
LABEL_15:
v9[v8] = 0;
sub_1005641D0(v4, &__dst, &__dst);
next = v18;
if ( (__dst & 1) != 0 )
operator delete(__p);
LABEL_4:
m_pElements = next;
}
while ( next );
v12 = v20[0];
if ( v20[0] )
{
do
{
if ( (*((_BYTE *)v12 + 16) & 1) != 0 )
{
sub_100006B70(&__dst, *((const void **)v12 + 4), *((_QWORD *)v12 + 3), *(double *)&v2);
}
else
{
__p = *((void **)v12 + 4);
v2 = *((_OWORD *)v12 + 1);
__dst = v2;
}
cocos2d::CCDictionary::removeObjectForKey_1((__int64)a2, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
v12 = *(void **)v12;
}
while ( v12 );
LABEL_25:
v13 = (void **)v20[0];
v14 = v20[1];
if ( v20[0] )
{
do
{
v17 = (void **)*v13;
if ( ((_BYTE)v13[2] & 1) != 0 )
operator delete(v13[4]);
operator delete(v13);
v13 = v17;
}
while ( v17 );
}
v15 = v19[0];
v19[0] = nullptr;
if ( v15 )
LABEL_27:
operator delete(v15);
}
else
{
v14 = v20[1];
v15 = v19[0];
v19[0] = nullptr;
if ( v15 )
goto LABEL_27;
}
return v14 == nullptr;
}