//
// MusicDownloadManager::getDownloadedSongs from 0x1001d4898 to 0x1001d492c (148 bytes)
//
// 3 xrefs:
// > MusicDownloadManager::limitDownloadedSongs @ 0x1001d4a94
// > GJSongBrowser::customSetup @ 0x1003031c4
// > GJSongBrowser::FLAlert_Clicked @ 0x10030345c
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:00:24 +0000
//
__int64 __fastcall MusicDownloadManager::getDownloadedSongs(__int64 a1)
{
__int64 v2; // x19
__int64 v3; // x8
__int64 v4; // x22
__int64 v5; // x21
v2 = sub_1002E736C(a1);
v3 = *(_QWORD *)(a1 + 344);
if ( v3 )
{
v4 = *(_QWORD *)(v3 + 56);
while ( v4 )
{
v5 = *(_QWORD *)(v4 + 264);
v4 = *(_QWORD *)(v4 + 288);
if ( (unsigned int)MusicDownloadManager::isSongDownloaded(a1, *(unsigned int *)(v5 + 316)) )
sub_1002E74E0(v2, v5);
}
}
if ( (unsigned int)sub_1002E757C(v2) >= 2 )
qsort(
*(void **)(*(_QWORD *)(v2 + 56) + 16LL),
**(unsigned int **)(v2 + 56),
8u,
(int (__cdecl *)(const void *, const void *))sub_1001D1A0C);
return v2;
}