//
// GameLevelManager::getAllUsedSongIDs from 0x701030 to 0x70114c (284 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::clearUnusedSongs @ 0x8300b8
// > ??> @ 0xb8938
//
// 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 *GameLevelManager::getAllUsedSongIDs(GameLevelManager *a1)
{
cocos2d::CCDictionary *v2; // x22
cocos2d::CCDictionary *m_onlineLevels; // x0
cocos2d::CCDictElement *m_pElements; // x0
cocos2d::CCDictElement *i; // x19
cocos2d::CCObject *m_pObject; // x20
intptr_t m_uID; // x1
cocos2d::CCArray *m_localLevels; // x21
unsigned int v9; // w19
bool v10; // cf
unsigned int v11; // w1
cocos2d::CCArray *j; // x0
__int64 v13; // x20
intptr_t v14; // x1
cocos2d::CCNode *v16; // x0
cocos2d::CCNode *v17; // x0
v2 = cocos2d::CCDictionary::create();
m_onlineLevels = a1->m_onlineLevels;
if ( m_onlineLevels )
{
m_pElements = m_onlineLevels->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
m_pObject = m_pElements->m_pObject;
if ( !BYTE1(m_pObject[14].m_uOrderOfArrival) )
{
m_uID = (int)m_pObject[8].m_uID;
if ( (int)m_uID > 0 && !cocos2d::CCDictionary::objectForKey(v2, m_uID) )
{
v17 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v2, v17, (int)m_pObject[8].m_uID);
}
}
if ( !i )
break;
m_pElements = i;
}
}
}
m_localLevels = LocalLevelManager::sharedState()->m_localLevels;
v9 = 0;
v10 = (unsigned int)cocos2d::CCArray::count(m_localLevels) == 0;
v11 = 0;
for ( j = m_localLevels; !v10; j = m_localLevels )
{
v13 = cocos2d::CCArray::objectAtIndex(j, v11);
if ( *(_BYTE *)(v13 + 833)
|| (v14 = *(int *)(v13 + 456), (int)v14 <= 0)
|| cocos2d::CCDictionary::objectForKey(v2, v14) )
{
++v9;
}
else
{
v16 = cocos2d::CCNode::create();
++v9;
cocos2d::CCDictionary::setObject(v2, v16, *(int *)(v13 + 456));
}
v10 = v9 >= (unsigned int)cocos2d::CCArray::count(m_localLevels);
v11 = v9;
}
return v2;
}