//
// GameLevelManager::getAllUsedSongIDs from 0x1000ac22c to 0x1000ac324 (248 bytes)
//
// 1 xrefs:
// > MusicDownloadManager::clearUnusedSongs @ 0x100156228
//
// 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
//
cocos2d::CCDictionary *__fastcall GameLevelManager::getAllUsedSongIDs(GameLevelManager *a1)
{
cocos2d::CCDictionary *v2; // x19
cocos2d::CCDictionary *m_onlineLevels; // x8
cocos2d::CCDictElement *m_pElements; // x20
cocos2d::CCObject *m_pObject; // x21
intptr_t m_unknown2; // x1
cocos2d::CCNode *v7; // x0
cocos2d::CCArray *m_localLevels; // x20
__int64 v9; // x21
__int64 v10; // x0
__int64 v11; // x22
intptr_t v12; // x1
cocos2d::CCNode *v13; // x0
v2 = cocos2d::CCDictionary::create();
m_onlineLevels = a1->m_onlineLevels;
if ( m_onlineLevels )
{
m_pElements = m_onlineLevels->m_pElements;
while ( m_pElements )
{
while ( 1 )
{
m_pObject = m_pElements->m_pObject;
m_pElements = (cocos2d::CCDictElement *)m_pElements->hh.next;
if ( (m_pObject[17].m_unknown2 & 0x100) == 0 )
{
m_unknown2 = (unsigned int)m_pObject[10].m_unknown2;
if ( (int)m_unknown2 >= 1 && !cocos2d::CCDictionary::objectForKey(v2, m_unknown2) )
break;
}
if ( !m_pElements )
goto LABEL_9;
}
v7 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v2, v7, m_pObject[10].m_unknown2);
}
}
LABEL_9:
m_localLevels = LocalLevelManager::sharedState()->m_localLevels;
if ( (unsigned int)sub_10024A36C(m_localLevels) )
{
v9 = 0;
do
{
v10 = sub_10024A388(m_localLevels, v9);
if ( (*(_BYTE *)(v10 + 993) & 1) == 0 )
{
v11 = v10;
v12 = *(unsigned int *)(v10 + 600);
if ( (int)v12 >= 1 && !cocos2d::CCDictionary::objectForKey(v2, v12) )
{
v13 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v2, v13, *(int *)(v11 + 600));
}
}
v9 = (unsigned int)(v9 + 1);
}
while ( (unsigned int)v9 < (unsigned int)sub_10024A36C(m_localLevels) );
}
return v2;
}