//
// SongInfoObject::getArtistNames from 0x10015bd40 to 0x10015c04c (780 bytes)
//
// 1 xrefs:
// > CustomSongWidget::onMore @ 0x1000fb15c
//
// 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::getArtistNames@(void **result@, __int64 a2@)
{
void **v2; // x20
std::string::size_type v4; // x27
__int64 v6; // x23
unsigned __int64 v7; // x24
std::string::size_type v8; // x28
const char *v9; // x0
int v10; // w0
__int128 v11; // q0
std::string *v12; // x0
_DWORD *i; // x22
cocos2d::CCDictionary *m_musicArtists; // x0
cocos2d::CCObject *v15; // x8
std::string::size_type size; // x8
const std::string *v17; // x0
std::string::size_type v18; // x8
char v19; // w9
std::string::size_type v20; // x10
std::string::size_type v21; // x11
__int64 v22; // x11
std::string *v23; // x1
std::string::size_type v24; // x2
std::string __p; // [xsp+0h] [xbp-D0h] BYREF
int v26; // [xsp+24h] [xbp-ACh] BYREF
std::string v27; // [xsp+28h] [xbp-A8h] BYREF
_OWORD v28[2]; // [xsp+40h] [xbp-90h] BYREF
int v29; // [xsp+60h] [xbp-70h]
int *v30; // [xsp+78h] [xbp-58h] BYREF
v2 = result;
if ( *((char *)result + 367) < 0 )
{
result = (void **)sub_1000097D0((_BYTE *)a2, result[43], (unsigned __int64)result[44]);
}
else
{
*(_OWORD *)a2 = *(_OWORD *)(result + 43);
*(_QWORD *)(a2 + 16) = result[45];
}
if ( !v2[73] )
return result;
memset(v28, 0, sizeof(v28));
v29 = 1065353216;
if ( (*((char *)v2 + 559) & 0x8000000000000000LL) == 0 )
{
if ( !*((_BYTE *)v2 + 559) )
goto LABEL_27;
LABEL_9:
memset(&v27, 0, sizeof(v27));
sub_100155A98((std::string *)(v2 + 67), ",", (__int64)&v27);
v4 = v27.__r_.__value_.__r.__words[0];
if ( 0xAAAAAAAAAAAAAAABLL * ((__int64)(v27.__r_.__value_.__l.__size_ - v27.__r_.__value_.__r.__words[0]) >> 3) >= 2
&& v27.__r_.__value_.__l.__size_ != v27.__r_.__value_.__r.__words[0] )
{
v6 = 0;
v7 = 0;
do
{
v8 = v4 + v6;
if ( *(char *)(v4 + v6 + 23) < 0 )
v9 = *(const char **)v8;
else
v9 = (const char *)(v4 + v6);
v10 = atoi(v9);
v26 = v10;
if ( *(char *)(v8 + 47) < 0 )
{
sub_1000097D0(&__p, *(void **)(v8 + 24), *(_QWORD *)(v4 + v6 + 32));
v10 = v26;
}
else
{
v11 = *(_OWORD *)(v8 + 24);
__p.__r_.__value_.__r.__words[2] = *(_QWORD *)(v8 + 40);
*(_OWORD *)&__p.__r_.__value_.__l.__data_ = v11;
}
if ( v10 >= 1 && v10 != 10004636 )
{
v30 = &v26;
v12 = (std::string *)sub_100140AE0((unsigned __int64)v28, &v26, (__int64)&unk_100638B16, &v30);
std::string::operator=(v12 + 1, &__p);
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v7 += 2LL;
v4 = v27.__r_.__value_.__r.__words[0];
v6 += 48;
}
while ( v7 < 0xAAAAAAAAAAAAAAABLL
* ((__int64)(v27.__r_.__value_.__l.__size_ - v27.__r_.__value_.__r.__words[0]) >> 3) );
}
__p.__r_.__value_.__r.__words[0] = (std::string::size_type)&v27;
sub_1000177FC((void ***)&__p);
goto LABEL_27;
}
if ( v2[68] )
goto LABEL_9;
LABEL_27:
for ( i = v2[72]; i; i = *(_DWORD **)i )
{
LODWORD(v30) = i[4];
if ( (_DWORD)v30 != 10004636 )
{
memset(&v27, 0, sizeof(v27));
m_musicArtists = MusicDownloadManager::sharedState()->m_musicArtists;
if ( m_musicArtists )
{
v15 = cocos2d::CCDictionary::objectForKey(m_musicArtists, (int)v30);
if ( v15 )
std::string::operator=(&v27, (const std::string *)&v15[1].m_uID);
}
size = HIBYTE(v27.__r_.__value_.__r.__words[2]);
if ( (v27.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = v27.__r_.__value_.__l.__size_;
if ( !size && sub_100018814(v28, (int *)&v30) )
{
__p.__r_.__value_.__r.__words[0] = (std::string::size_type)&v30;
v17 = (const std::string *)sub_100140AE0((unsigned __int64)v28, (int *)&v30, (__int64)&unk_100638B16, &__p);
std::string::operator=(&v27, v17 + 1);
}
v18 = HIBYTE(v27.__r_.__value_.__r.__words[2]);
v19 = HIBYTE(v27.__r_.__value_.__r.__words[2]);
v20 = v27.__r_.__value_.__l.__size_;
if ( (v27.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v21 = HIBYTE(v27.__r_.__value_.__r.__words[2]);
else
v21 = v27.__r_.__value_.__l.__size_;
if ( v21 )
{
v22 = *(unsigned __int8 *)(a2 + 23);
if ( (v22 & 0x80u) != 0LL )
v22 = *(_QWORD *)(a2 + 8);
if ( v22 )
{
std::string::append((std::string *)a2, ", ");
v18 = HIBYTE(v27.__r_.__value_.__r.__words[2]);
v20 = v27.__r_.__value_.__l.__size_;
v19 = HIBYTE(v27.__r_.__value_.__r.__words[2]);
}
if ( v19 >= 0 )
v23 = &v27;
else
v23 = (std::string *)v27.__r_.__value_.__r.__words[0];
if ( v19 >= 0 )
v24 = v18;
else
v24 = v20;
std::string::append((std::string *)a2, (const std::string::value_type *)v23, v24);
v19 = HIBYTE(v27.__r_.__value_.__r.__words[2]);
}
if ( v19 < 0 )
operator delete(v27.__r_.__value_.__l.__data_);
}
}
return sub_1001275A0((void **)v28);
}