//
// MusicDownloadManager::getDownloadedSongs from 0x14033e5e0 to 0x14033e699 (185 bytes)
//
// 6 xrefs:
// > GJSongBrowser::customSetup @ 0x1402b76fc
// > GJSongBrowser::FLAlert_Clicked @ 0x1402b7b7c
// > MusicDownloadManager::onDownloadSongCompleted @ 0x14033eecb
// > ??> @ 0x140695000
// > ??> @ 0x140695038
// > ??> @ 0x1406d563c
//
// 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::CCArray *MusicDownloadManager::getDownloadedSongs(MusicDownloadManager *a1)
{
__int64 v2; // rax
cocos2d::CCDictionary *m_songObjects; // rdx
cocos2d::CCArray *v4; // rdi
cocos2d::CCDictElement *m_pElements; // rdx
cocos2d::CCDictElement *i; // rbx
struct cocos2d::CCObject *m_pObject; // rsi
v2 = cocos2d::CCArray::create(a1);
m_songObjects = a1->m_songObjects;
v4 = (cocos2d::CCArray *)v2;
if ( m_songObjects )
{
m_pElements = m_songObjects->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 ( MusicDownloadManager::isSongDownloaded(a1, m_pObject[5].m_unknown2) )
cocos2d::CCArray::addObject(v4, m_pObject);
m_pElements = i;
if ( !i )
break;
}
}
}
if ( cocos2d::CCArray::count(v4) > 1 )
qsort(v4->data->arr, v4->data->num, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)sub_14033C500);
return v4;
}