//
// MusicDownloadManager::createSongsInfo from 0x45c948 to 0x45caa8 (352 bytes)
//
// 2 xrefs:
// > GameLevelManager::onGetOnlineLevelsCompleted @ 0x3c6652
// > GameLevelManager::processOnDownloadLevelCompleted @ 0x3c7444
//
// 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
//
unsigned int __fastcall MusicDownloadManager::createSongsInfo(unsigned int result, char **a2)
{
int v3; // r9
cocos2d::CCArray *v4; // r10
unsigned int i; // r8
cocos2d::CCString *v6; // r0
char *CString; // r0
stl::StringData::Internal *v8; // r2
stl::StringData::Internal *v9; // r3
SongInfoObject *v10; // r7
cocos2d::CCObject *v11; // r11
std::__detail::_Hash_node_base *j; // r6
cocos2d::CCString *v13; // r0
char *v14; // r0
cocos2d::CCDictionary *v15; // [sp+4h] [bp-30h]
char *M_nxt; // [sp+8h] [bp-2Ch]
char v17; // [sp+24h] [bp-10h] BYREF
char *v18; // [sp+28h] [bp-Ch] BYREF
v3 = result;
if ( *((_DWORD *)*a2 - 3) )
{
sub_775C20(&v18);
v15 = MusicDownloadManager::createArtistsInfo(v3, &v18);
sub_774008(&v18);
sub_776584((int)&v17, *a2);
sub_776584((int)&v18, "~:~");
v4 = sub_456F20((cocos2d::CCArray *)&v17, &v18);
sub_774008(&v18);
sub_774008(&v17);
for ( i = 0; ; ++i )
{
result = cocos2d::CCArray::count(v4);
if ( i >= result )
break;
v6 = cocos2d::CCArray::stringAtIndex(v4, i);
CString = (char *)cocos2d::CCString::getCString(v6);
sub_776584((int)&v17, CString);
sub_775C20(&v18);
v10 = MusicDownloadManager::addSongObjectFromString(v3, (int)&v18, v8, v9);
sub_774008(&v18);
if ( v10 && v15 && v10->m_artistIDs._M_h._M_element_count )
{
v18 = (char *)&unk_ACDDA8;
for ( j = v10->m_artistIDs._M_h._M_before_begin._M_nxt; j; j = j->_M_nxt )
{
M_nxt = (char *)j[1]._M_nxt;
v11 = cocos2d::CCDictionary::objectForKey(v15, (intptr_t)M_nxt);
if ( v11 )
{
if ( *(_DWORD *)&v18[-12] )
sub_774544((int)&v18, ",");
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i,%s",
M_nxt,
v11[1].m_uID);
v14 = (char *)cocos2d::CCString::getCString(v13);
sub_774544((int)&v18, v14);
}
}
sub_775D40(&v10->m_extraArtistNames, &v18);
sub_774008(&v18);
}
sub_774008(&v17);
}
}
return result;
}