//
// SongInfoObject::addTags from 0x10065db90 to 0x10065dd99 (521 bytes)
//
// 1 xrefs:
// > MusicDownloadManager::parseMusicLibrary @ 0x10065b8b4
//
// 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
//
void __fastcall SongInfoObject::addTags(__int64 a1, unsigned __int8 *a2)
{
unsigned int v3; // eax
const void *v4; // rdi
__int64 v5; // rbx
void **v6; // r12
char *v7; // r15
unsigned __int64 i; // rbx
char *v9; // rdi
int v10; // eax
int v11; // r14d
char *v12; // rcx
_QWORD *v13; // r13
__int64 v14; // rax
_QWORD *v15; // r15
int v16; // eax
_DWORD *v17; // rax
__int64 v18; // rcx
void *v19; // rdi
__int64 v20; // [rsp+8h] [rbp-48h]
__int128 __s2; // [rsp+10h] [rbp-40h] BYREF
__int64 v22; // [rsp+20h] [rbp-30h]
v3 = *a2;
if ( (v3 & 1) != 0 )
{
if ( !*((_QWORD *)a2 + 1) )
return;
}
else if ( !(v3 >> 1) )
{
return;
}
v4 = a2 + 1;
LOWORD(__s2) = 11778;
BYTE2(__s2) = 0;
if ( (v3 & 1) != 0 )
v4 = *((const void **)a2 + 2);
v5 = (unsigned __int8)v3 >> 1;
if ( (v3 & 1) != 0 )
v5 = *((_QWORD *)a2 + 1);
if ( memcmp(v4, (char *)&__s2 + 1, v5 != 0) || v5 != 1 )
{
v20 = a1;
__s2 = 0;
v22 = 0;
sub_10064E0E0(a2, ".", (__int64)&__s2);
v6 = *((void ***)&__s2 + 1);
v7 = (char *)__s2;
if ( *((_QWORD *)&__s2 + 1) != (_QWORD)__s2 )
{
for ( i = 0; 0xAAAAAAAAAAAAAAABLL * (((char *)v6 - v7) >> 3) > i; ++i )
{
v9 = &v7[24 * i];
if ( (*v9 & 1) != 0 )
{
v10 = atoi(*((const char **)v9 + 2));
if ( v10 > 0 )
{
LABEL_19:
v11 = v10;
v12 = v7;
v13 = (_QWORD *)(v20 + 632);
while ( 1 )
{
v14 = *v13;
v15 = v13;
if ( !*v13 )
break;
while ( 1 )
{
v13 = (_QWORD *)v14;
v16 = *(_DWORD *)(v14 + 28);
if ( v11 < v16 )
break;
if ( v11 <= v16 )
{
v7 = v12;
goto LABEL_14;
}
v14 = v13[1];
if ( !v14 )
{
v15 = v13 + 1;
goto LABEL_25;
}
}
}
LABEL_25:
v17 = operator new(0x20u);
v17[7] = v11;
*(_OWORD *)v17 = 0;
*((_QWORD *)v17 + 2) = v13;
*v15 = v17;
v18 = **(_QWORD **)(v20 + 624);
if ( v18 )
*(_QWORD *)(v20 + 624) = v18;
sub_10001B680(*(__int64 **)(v20 + 632), (__int64 *)v17);
++*(_QWORD *)(v20 + 640);
v6 = *((void ***)&__s2 + 1);
v7 = (char *)__s2;
}
}
else
{
v10 = atoi(v9 + 1);
if ( v10 > 0 )
goto LABEL_19;
}
LABEL_14:
;
}
}
if ( v7 )
{
v19 = v7;
if ( v6 != (void **)v7 )
{
do
{
if ( (*(_BYTE *)(v6 - 3) & 1) != 0 )
operator delete(*(v6 - 1));
v6 -= 3;
}
while ( v6 != (void **)v7 );
v19 = (void *)__s2;
}
*((_QWORD *)&__s2 + 1) = v7;
operator delete(v19);
}
}
}