//
// MusicDownloadManager::createSongsInfo from 0x1001d3e90 to 0x1001d40e8 (600 bytes)
//
// 2 xrefs:
// > sub_100096B48 @ 0x100096d44
// > sub_1000B9B2C @ 0x1000b9f08
//
// This function is hookable on this platform (idp: arm, 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 11:00:24 +0000
//
__int64 __fastcall MusicDownloadManager::createSongsInfo(__int64 result, __int64 a2, __int64 a3)
{
char *v3; // x21
_QWORD *v4; // x19
__int64 ArtistsInfo; // x20
__int64 v6; // x21
__int64 v7; // x22
__int64 v8; // x0
char *CString; // x0
__int64 v10; // x0
__int64 v11; // x25
__int64 *i; // x27
int v13; // w28
__int64 v14; // x26
std::string::size_type size; // x8
const char *v16; // x8
__int64 v17; // x0
const std::string::value_type *v18; // x0
void *__dst[2]; // [xsp+10h] [xbp-C0h] BYREF
__int64 v20; // [xsp+20h] [xbp-B0h]
std::string __str; // [xsp+30h] [xbp-A0h] BYREF
void *v22[2]; // [xsp+48h] [xbp-88h] BYREF
__int64 v23; // [xsp+58h] [xbp-78h]
void *__p[2]; // [xsp+60h] [xbp-70h] BYREF
__int64 v25; // [xsp+70h] [xbp-60h]
v3 = (char *)a2;
v4 = (_QWORD *)result;
if ( (*(char *)(a2 + 23) & 0x8000000000000000LL) != 0 )
{
if ( !*(_QWORD *)(a2 + 8) )
return result;
}
else if ( !*(_BYTE *)(a2 + 23) )
{
return result;
}
if ( *(char *)(a3 + 23) < 0 )
{
LODWORD(result) = (unsigned int)sub_1000097D0(__p, *(void **)a3, *(_QWORD *)(a3 + 8));
}
else
{
*(_OWORD *)__p = *(_OWORD *)a3;
v25 = *(_QWORD *)(a3 + 16);
}
ArtistsInfo = MusicDownloadManager::createArtistsInfo(result, (int)__p);
if ( SHIBYTE(v25) < 0 )
operator delete(__p[0]);
if ( v3[23] < 0 )
v3 = *(char **)v3;
sub_100009900(v22, v3);
sub_100009900(&__str, "~:~");
v6 = sub_1001D4354(v22, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( SHIBYTE(v23) < 0 )
operator delete(v22[0]);
result = sub_1002E757C(v6);
if ( (_DWORD)result )
{
v7 = 0;
do
{
v8 = cocos2d::CCArray::stringAtIndex(v6, v7);
CString = (char *)cocos2d::CCString::getCString(v8);
sub_100009900(v22, CString);
if ( SHIBYTE(v23) < 0 )
{
sub_1000097D0(__dst, v22[0], (unsigned __int64)v22[1]);
}
else
{
*(_OWORD *)__dst = *(_OWORD *)v22;
v20 = v23;
}
v10 = MusicDownloadManager::addSongObjectFromString(v4, (__int64)__dst);
v11 = v10;
if ( SHIBYTE(v20) < 0 )
{
operator delete(__dst[0]);
if ( v11 )
{
LABEL_25:
if ( ArtistsInfo && *(_QWORD *)(v11 + 512) )
{
memset(&__str, 0, sizeof(__str));
for ( i = *(__int64 **)(v11 + 504); i; i = (__int64 *)*i )
{
v13 = *((_DWORD *)i + 4);
v14 = cocos2d::CCDictionary::objectForKey_1(ArtistsInfo, v13);
if ( v14 )
{
size = HIBYTE(__str.__r_.__value_.__r.__words[2]);
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = __str.__r_.__value_.__l.__size_;
if ( size )
std::string::append(&__str, ",");
v16 = (const char *)(v14 + 64);
if ( *(char *)(v14 + 87) < 0 )
v16 = *(const char **)v16;
v17 = sub_1003065B0("%i,%s", v13, v16);
v18 = (const std::string::value_type *)cocos2d::CCString::getCString(v17);
std::string::append(&__str, v18);
}
}
std::string::operator=((std::string *)(v11 + 464), &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}
}
}
else if ( v10 )
{
goto LABEL_25;
}
if ( SHIBYTE(v23) < 0 )
operator delete(v22[0]);
v7 = (unsigned int)(v7 + 1);
result = sub_1002E757C(v6);
}
while ( (unsigned int)v7 < (unsigned int)result );
}
return result;
}