//
// GameLevelManager::getDemonLevelsString from 0x735bd8 to 0x735de0 (520 bytes)
//
// 2 xrefs:
// > GameLevelManager::updateUserScore @ 0x7375e8
// > ??> @ 0x420c0
//
// 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
//
__int64 __usercall GameLevelManager::getDemonLevelsString@(GameLevelManager *this@, __int64 a2@)
{
cocos2d::CCDictionary *m_onlineLevels; // x0
cocos2d::CCDictElement *m_pElements; // x19
cocos2d::CCDictElement *next; // x20
int v5; // w25
cocos2d::CCObject *m_pObject; // x0
GJGameLevel *v7; // x0
GJGameLevel *v8; // x19
GameStatsManager *v9; // x0
size_t v10; // x26
size_t v11; // x25
size_t v12; // x19
size_t v15; // [xsp+78h] [xbp+78h] BYREF
unsigned __int64 v16; // [xsp+80h] [xbp+80h]
char *v17; // [xsp+88h] [xbp+88h]
_BYTE v18[504]; // [xsp+90h] [xbp+90h] BYREF
m_onlineLevels = this->m_onlineLevels;
v15 = 0;
v16 = 500;
v17 = v18;
if ( !m_onlineLevels )
goto LABEL_24;
m_pElements = m_onlineLevels->m_pElements;
if ( !m_pElements )
goto LABEL_24;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
v5 = 1;
while ( 1 )
{
m_pObject = m_pElements->m_pObject;
if ( m_pObject )
{
v7 = (GJGameLevel *)_dynamic_cast(
m_pObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'GJGameLevel,
0);
v8 = v7;
if ( v7 )
{
if ( v7->m_stars.random - v7->m_stars.seed == 10 && GJGameLevel::getNormalPercent(v7) == 100 )
{
v9 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedLevel(v9, v8) )
break;
}
}
}
if ( !next )
goto LABEL_16;
LABEL_8:
m_pElements = next;
next = (cocos2d::CCDictElement *)next->hh.next;
}
if ( !v5 )
{
v10 = v15;
v11 = v15 + 1;
if ( v15 + 1 > v16 )
fmt::internal::Array::grow(&v15, v15 + 1);
v15 = v11;
v17[v10] = 44;
}
fmt::BasicWriter::FormatInt,char>>(
&v15,
v8->m_levelID.random - v8->m_levelID.seed);
v5 = 0;
if ( next )
goto LABEL_8;
LABEL_16:
if ( v5 )
{
LABEL_24:
sub_D153B8(a2, &byte_F288A0);
goto LABEL_20;
}
v12 = v15;
if ( v15 + 1 > v16 )
fmt::internal::Array::grow(&v15, v15 + 1);
v17[v12] = 0;
sub_D153B8(a2, v17);
LABEL_20:
if ( v17 != v18 && v17 )
operator delete[](v17);
return a2;
}