//
// MusicDownloadManager::getAllMusicTags from 0x10065e580 to 0x10065e6bc (316 bytes)
//
// 2 xrefs:
// > sub_100667040 @ 0x10066705e
// > MusicSearchResult::updateObjects_1 @ 0x1006684c9
//
// This function is hookable on this platform (idp: pc, 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 12:34:55 +0000
//
__int64 __fastcall MusicDownloadManager::getAllMusicTags(__int64 a1, __int64 a2)
{
__int64 v2; // rbx
_QWORD *v3; // r12
int v4; // r13d
char *v5; // r13
_QWORD *v6; // rcx
_QWORD *v7; // rax
bool v8; // zf
std::string v10[2]; // [rsp+0h] [rbp-40h] BYREF
v2 = sub_1007FEC20(*(unsigned int *)(a1 + 480));
v3 = *(_QWORD **)(a1 + 464);
if ( v3 != (_QWORD *)(a1 + 472) )
{
do
{
v4 = *((_DWORD *)v3 + 8);
if ( (v3[5] & 1) != 0 )
sub_10001AD30(v10, (const void *)v3[7], v3[6]);
else
v10[0] = *(std::string *)(v3 + 5);
v5 = OptionsObject::create(v4, 0, v10, a2);
if ( (*(_BYTE *)&v10[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v10[0].__r_.__value_.__l.__data_);
sub_1007FEBF0(v2, v5);
v6 = (_QWORD *)v3[1];
if ( v6 )
{
do
{
v7 = v6;
v6 = (_QWORD *)*v6;
}
while ( v6 );
}
else
{
do
{
v7 = (_QWORD *)v3[2];
v8 = *v7 == (_QWORD)v3;
v3 = v7;
}
while ( !v8 );
}
v3 = v7;
}
while ( v7 != (_QWORD *)(a1 + 472) );
}
if ( (unsigned int)sub_1007FEF90(v2) >= 2 )
qsort(
*(void **)(*(_QWORD *)(v2 + 56) + 16LL),
**(unsigned int **)(v2 + 56),
8u,
(int (__cdecl *)(const void *, const void *))sub_1006499E0);
return v2;
}