//
// SongInfoObject::getTagsString from 0x10015c100 to 0x10015c3a0 (672 bytes)
//
// 2 xrefs:
// > CustomSongWidget::onMore @ 0x1000fb248
// > CustomSongWidget::updateSongInfo @ 0x1000fc158
//
// 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
//
void __usercall SongInfoObject::getTagsString(__int64 a1@, int a2@, __int64 a3@)
{
__int64 v6; // x8
int v7; // w9
unsigned __int64 v8; // x2
_QWORD *v9; // x27
int v10; // w28
char v11; // w22
int v12; // w24
MusicDownloadManager *v13; // x0
std::string::size_type v14; // x8
unsigned __int8 v15; // w10
std::string::size_type v16; // x9
std::string::size_type v17; // x11
const std::string::value_type *p_p; // x1
std::string::size_type v19; // x2
int v20; // w24
int v21; // w23
cocos2d::CCString *v22; // x0
const char *CString; // x0
_QWORD *v24; // x9
_QWORD *v25; // x8
bool v26; // zf
__int64 v27; // x21
__int64 v28; // x8
void *__p; // [xsp+10h] [xbp-80h] BYREF
std::string::size_type v30; // [xsp+18h] [xbp-78h]
unsigned __int8 v31; // [xsp+27h] [xbp-69h]
std::string __str; // [xsp+28h] [xbp-68h] BYREF
if ( a2 )
{
v6 = a1 + 648;
v7 = *(char *)(a1 + 671);
if ( v7 < 0 )
{
v8 = *(_QWORD *)(a1 + 656);
if ( !v8 )
goto LABEL_10;
LABEL_9:
sub_1000097D0((_BYTE *)a3, *(void **)v6, v8);
return;
}
}
else
{
v6 = a1 + 624;
v7 = *(char *)(a1 + 647);
if ( v7 < 0 )
{
v8 = *(_QWORD *)(a1 + 632);
if ( !v8 )
goto LABEL_10;
goto LABEL_9;
}
}
if ( v7 )
{
*(_OWORD *)a3 = *(_OWORD *)v6;
*(_QWORD *)(a3 + 16) = *(_QWORD *)(v6 + 16);
return;
}
LABEL_10:
if ( !*(_QWORD *)(a1 + 616) )
{
sub_100009900((_QWORD *)a3, "");
return;
}
sub_100009900(&__str, "");
v9 = *(_QWORD **)(a1 + 600);
if ( v9 != (_QWORD *)(a1 + 608) )
{
v10 = 0;
v11 = 1;
do
{
v12 = *((_DWORD *)v9 + 7);
v13 = MusicDownloadManager::sharedState();
MusicDownloadManager::nameForTagID((__int64)v13, v12, &__p);
v14 = v31;
v15 = v31;
v16 = v30;
if ( (v31 & 0x80u) == 0 )
v17 = v31;
else
v17 = v30;
if ( v17 )
{
if ( (v11 & 1) == 0 )
{
std::string::append(&__str, ", ");
v14 = v31;
v16 = v30;
v15 = v31;
}
if ( (v15 & 0x80u) == 0 )
p_p = (const std::string::value_type *)&__p;
else
p_p = (const std::string::value_type *)__p;
if ( (v15 & 0x80u) == 0 )
v19 = v14;
else
v19 = v16;
std::string::append(&__str, p_p, v19);
v11 = 0;
v20 = v10 + 1;
v21 = 1;
if ( a2 && v10 >= 3 )
{
if ( *(_DWORD *)(a1 + 616) - v20 >= 1 )
{
v22 = (cocos2d::CCString *)sub_100268F4C(" +%i", *(_DWORD *)(a1 + 616) - v20);
CString = cocos2d::CCString::getCString(v22);
std::string::append(&__str, CString);
}
v11 = 0;
v21 = 0;
}
++v10;
}
else
{
v21 = 1;
}
if ( (char)v31 < 0 )
operator delete(__p);
if ( !v21 )
break;
v24 = (_QWORD *)v9[1];
if ( v24 )
{
do
{
v25 = v24;
v24 = (_QWORD *)*v24;
}
while ( v24 );
}
else
{
do
{
v25 = (_QWORD *)v9[2];
v26 = *v25 == (_QWORD)v9;
v9 = v25;
}
while ( !v26 );
}
v9 = v25;
}
while ( v25 != (_QWORD *)(a1 + 608) );
}
if ( (a2 & 1) == 0 )
{
v27 = a1 + 624;
std::string::operator=((std::string *)(a1 + 624), &__str);
if ( *(char *)(a1 + 647) < 0 )
{
v28 = 632;
goto LABEL_48;
}
LABEL_46:
*(_OWORD *)a3 = *(_OWORD *)v27;
*(_QWORD *)(a3 + 16) = *(_QWORD *)(v27 + 16);
goto LABEL_49;
}
v27 = a1 + 648;
std::string::operator=((std::string *)(a1 + 648), &__str);
if ( (*(char *)(a1 + 671) & 0x80000000) == 0 )
goto LABEL_46;
v28 = 656;
LABEL_48:
sub_1000097D0((_BYTE *)a3, *(void **)v27, *(_QWORD *)(a1 + v28));
LABEL_49:
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}