//
// MusicDownloadManager::nameForTagID from 0x100594ae0 to 0x100594c10 (304 bytes)
//
// 1 xrefs:
// > SongInfoObject::getTagsString @ 0x100598a86
//
// 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
//
_QWORD *__fastcall MusicDownloadManager::nameForTagID(_QWORD *a1, __int64 a2, int a3, double a4)
{
char *v4; // rax
__int64 *v5; // rcx
_QWORD *v6; // r14
int v7; // r15d
__int64 v8; // r12
_QWORD *v9; // r13
char *v11; // rbx
__int64 v12; // rax
char *v13; // rbx
_QWORD *v14; // [rsp+0h] [rbp-30h]
v4 = *(char **)(a2 + 448);
if ( !v4 )
{
LABEL_12:
*(_WORD *)a1 = 0;
return a1;
}
v5 = *(__int64 **)(a2 + 448);
while ( *((_DWORD *)v5 + 8) > a3 )
{
LABEL_3:
v5 = (__int64 *)*v5;
if ( !v5 )
goto LABEL_12;
}
if ( *((_DWORD *)v5 + 8) < a3 )
{
++v5;
goto LABEL_3;
}
do
{
while ( 1 )
{
v6 = v4;
if ( *((_DWORD *)v4 + 8) > a3 )
break;
if ( *((_DWORD *)v4 + 8) >= a3 )
{
v11 = v4;
if ( (v4[40] & 1) != 0 )
goto LABEL_21;
LABEL_19:
v13 = v11 + 40;
a1[2] = *((_QWORD *)v13 + 2);
*(_OWORD *)a1 = *(_OWORD *)v13;
return a1;
}
v4 = *((char **)v4 + 1);
if ( !v4 )
{
v7 = a3;
v8 = a2;
v14 = a1;
v9 = v6 + 1;
goto LABEL_16;
}
}
v4 = *(char **)v4;
}
while ( *v6 );
v7 = a3;
v8 = a2;
v14 = a1;
v9 = v6;
LABEL_16:
v11 = (char *)operator new(0x40u);
*((_DWORD *)v11 + 8) = v7;
a4 = 0.0;
*(_OWORD *)(v11 + 40) = 0;
*((_QWORD *)v11 + 7) = 0;
*(_OWORD *)v11 = 0;
*((_QWORD *)v11 + 2) = v6;
*v9 = v11;
v12 = **(_QWORD **)(v8 + 440);
if ( v12 )
*(_QWORD *)(v8 + 440) = v12;
sub_100054DD0(*(__int64 **)(v8 + 448), (__int64 *)v11);
++*(_QWORD *)(v8 + 456);
a1 = v14;
if ( (v11[40] & 1) == 0 )
goto LABEL_19;
LABEL_21:
sub_100006B70(a1, *((const void **)v11 + 7), *((_QWORD *)v11 + 6), a4);
return a1;
}