//
// SongInfoObject::getTagsString from 0x1005988a0 to 0x100598c49 (937 bytes)
//
// 2 xrefs:
// > CustomSongWidget::onMore @ 0x10061c646
// > CustomSongWidget::updateSongInfo @ 0x10061db80
//
// 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 SongInfoObject::getTagsString(_QWORD *a1, __int64 a2, int a3, double a4)
{
_QWORD *v4; // rbx
char v5; // al
__int64 v6; // rsi
char v7; // al
unsigned __int64 v8; // rdx
const void *v9; // rsi
_QWORD *v10; // rbx
char v11; // r14
int v12; // r15d
int v13; // r12d
__int64 v14; // rsi
char *v15; // r13
std::string::size_type v16; // rdx
char v17; // cl
std::string::size_type v18; // rax
std::string::size_type v19; // rsi
char v20; // r12
std::string::value_type *v21; // rsi
cocos2d::CCString *v22; // rax
const char *CString; // rax
_QWORD *v24; // rcx
_QWORD *v25; // rax
bool v26; // zf
__int64 v27; // r15
__int64 v28; // rax
__int64 v29; // rcx
char v31; // [rsp+0h] [rbp-80h]
_QWORD *v32; // [rsp+8h] [rbp-78h]
std::string __str; // [rsp+18h] [rbp-68h] BYREF
__int64 v34; // [rsp+30h] [rbp-50h] BYREF
std::string::size_type __n; // [rsp+38h] [rbp-48h]
std::string::value_type *__s; // [rsp+40h] [rbp-40h]
__int64 v37; // [rsp+48h] [rbp-38h]
int v38; // [rsp+54h] [rbp-2Ch]
v4 = a1;
v38 = a3;
if ( a3 )
{
v5 = *(_BYTE *)(a2 + 648);
if ( (v5 & 1) == 0 )
{
if ( v5 )
{
v6 = a2 + 648;
LABEL_8:
a1[2] = *(_QWORD *)(v6 + 16);
*(_OWORD *)a1 = *(_OWORD *)v6;
return v4;
}
goto LABEL_14;
}
v8 = *(_QWORD *)(a2 + 656);
if ( !v8 )
goto LABEL_14;
v9 = *(const void **)(a2 + 664);
LABEL_13:
sub_100006B70(a1, v9, v8, a4);
return v4;
}
v7 = *(_BYTE *)(a2 + 624);
if ( (v7 & 1) != 0 )
{
v8 = *(_QWORD *)(a2 + 632);
if ( !v8 )
goto LABEL_14;
v9 = *(const void **)(a2 + 640);
goto LABEL_13;
}
if ( v7 )
{
v6 = a2 + 624;
goto LABEL_8;
}
LABEL_14:
if ( !*(_QWORD *)(a2 + 616) )
{
*(_WORD *)a1 = 0;
return v4;
}
*(_WORD *)&__str.__r_.__value_.__l.0 = 0;
v10 = *(_QWORD **)(a2 + 600);
v37 = a2;
v32 = (_QWORD *)(a2 + 608);
if ( v10 != (_QWORD *)(a2 + 608) )
{
v11 = 1;
v12 = 0;
while ( 1 )
{
v13 = *((_DWORD *)v10 + 7);
v14 = qword_1009A2C38;
if ( !qword_1009A2C38 )
{
v15 = (char *)operator new(0x230u);
cocos2d::CCNode::CCNode((__int64)v15);
*(_QWORD *)v15 = off_100970158;
*((_QWORD *)v15 + 40) = off_1009704D8;
a4 = 0.0;
*((_OWORD *)v15 + 28) = 0;
*(_OWORD *)(v15 + 328) = 0;
*(_OWORD *)(v15 + 344) = 0;
*((_DWORD *)v15 + 90) = 0;
*((_OWORD *)v15 + 23) = 0;
*((_OWORD *)v15 + 24) = 0;
*((_OWORD *)v15 + 25) = 0;
v15[416] = 0;
*(_OWORD *)(v15 + 424) = 0;
*((_QWORD *)v15 + 55) = v15 + 448;
*((_OWORD *)v15 + 30) = 0;
*((_OWORD *)v15 + 31) = 0;
*((_QWORD *)v15 + 58) = 0;
*(_QWORD *)(v15 + 471) = 0;
*((_DWORD *)v15 + 128) = 1065353216;
*(_OWORD *)(v15 + 520) = 0;
*(_OWORD *)(v15 + 536) = 0;
*((_DWORD *)v15 + 138) = 1065353216;
qword_1009A2C38 = (__int64)v15;
MusicDownloadManager::init((MusicDownloadManager *)v15);
v14 = qword_1009A2C38;
}
MusicDownloadManager::nameForTagID(&v34, v14, v13, a4);
v16 = (unsigned __int8)v34 >> 1;
v17 = v34 & 1;
v18 = __n;
v19 = __n;
if ( (v34 & 1) == 0 )
v19 = (unsigned __int8)v34 >> 1;
v20 = 1;
if ( !v19 )
goto LABEL_31;
if ( (v11 & 1) == 0 )
{
std::string::append(&__str, ", ");
v18 = __n;
v17 = v34 & 1;
v16 = (unsigned __int8)v34 >> 1;
}
v21 = (char *)&v34 + 1;
if ( v17 )
{
v21 = __s;
v16 = v18;
}
std::string::append(&__str, v21, v16);
if ( ((unsigned __int8)v38 & (v12 >= 3)) == 1 )
break;
v11 = 0;
++v12;
if ( (v34 & 1) != 0 )
goto LABEL_32;
LABEL_33:
if ( v20 )
{
v24 = (_QWORD *)v10[1];
if ( v24 )
{
do
{
v25 = v24;
v24 = (_QWORD *)*v24;
}
while ( v24 );
}
else
{
do
{
v25 = (_QWORD *)v10[2];
v26 = *v25 == (_QWORD)v10;
v10 = v25;
}
while ( !v26 );
}
v10 = v25;
if ( v25 != v32 )
continue;
}
goto LABEL_41;
}
if ( *(_DWORD *)(v37 + 616) - (v12 + 1) > 0 )
{
v22 = (cocos2d::CCString *)sub_1007AB580(" +%i", v31);
CString = cocos2d::CCString::getCString(v22);
std::string::append(&__str, CString);
}
v11 = 0;
++v12;
v20 = 0;
LABEL_31:
if ( (v34 & 1) == 0 )
goto LABEL_33;
LABEL_32:
operator delete(__s);
goto LABEL_33;
}
LABEL_41:
if ( !(_BYTE)v38 )
{
v27 = v37 + 624;
std::string::operator=((std::string *)(v37 + 624), &__str);
v4 = a1;
if ( (*(_BYTE *)v27 & 1) != 0 )
{
v28 = 632;
v29 = 640;
goto LABEL_48;
}
LABEL_46:
v4[2] = *(_QWORD *)(v27 + 16);
*(_OWORD *)v4 = *(_OWORD *)v27;
goto LABEL_49;
}
v27 = v37 + 648;
std::string::operator=((std::string *)(v37 + 648), &__str);
v4 = a1;
if ( (*(_BYTE *)v27 & 1) == 0 )
goto LABEL_46;
v28 = 656;
v29 = 664;
LABEL_48:
sub_100006B70(v4, *(const void **)(v37 + v29), *(_QWORD *)(v37 + v28), a4);
LABEL_49:
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
return v4;
}