//
// MusicDownloadManager::clearUnusedSongs from 0x10015620c to 0x1001562ac (160 bytes)
//
// 3 xrefs:
// > GJSongBrowser::FLAlert_Clicked @ 0x100266118
// > GJAccountManager::backupAccount @ 0x1003a0c30
// > LevelBrowserLayer::FLAlert_Clicked @ 0x100419714
//
// 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
//
void __fastcall MusicDownloadManager::clearUnusedSongs(MusicDownloadManager *a1)
{
GameLevelManager *v2; // x0
cocos2d::CCDictionary *AllUsedSongIDs; // x20
cocos2d::CCArray *AllSongs; // x21
__int64 v5; // x22
__int64 v6; // x23
v2 = GameLevelManager::sharedState();
AllUsedSongIDs = GameLevelManager::getAllUsedSongIDs(v2);
AllSongs = MusicDownloadManager::getAllSongs(a1);
if ( (unsigned int)sub_10024A36C(AllSongs) )
{
v5 = 0;
do
{
v6 = sub_10024A388(AllSongs, v5);
if ( !MusicDownloadManager::isSongDownloaded(a1, *(_DWORD *)(v6 + 316))
&& !cocos2d::CCDictionary::objectForKey(AllUsedSongIDs, *(int *)(v6 + 316)) )
{
MusicDownloadManager::clearSong(a1, *(_DWORD *)(v6 + 316));
}
v5 = (unsigned int)(v5 + 1);
}
while ( (unsigned int)v5 < (unsigned int)sub_10024A36C(AllSongs) );
}
}