//
// MusicDownloadManager::addSongObjectFromString from 0x45c5ac to 0x45c6a0 (244 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::onGetSongInfoCompleted @ 0x45c740
// > MusicDownloadManager::createSongsInfo @ 0x45c9ee
//
// 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
//
SongInfoObject *__fastcall MusicDownloadManager::addSongObjectFromString(
int a1,
int a2,
stl::StringData::Internal *a3,
stl::StringData::Internal *a4)
{
cocos2d::CCDictionary *v5; // r9
SongInfoObject *v6; // r0
const char *m_songID; // r1
SongInfoObject *v8; // r5
cocos2d::CCDictionary *v9; // r10
cocos2d::CCString *v10; // r0
char *CString; // r0
int v12; // r10
cocos2d::CCString *v13; // r0
bool v14; // r9
const char *v15; // r1
int v16; // r8
cocos2d::CCString *v17; // r0
char *v18; // r0
std::string v20[2]; // [sp+8h] [bp-8h] BYREF
v20[0].m_data.m_data = a3;
v20[1].m_data.m_data = a4;
sub_775C20(v20);
v5 = MusicDownloadManager::responseToDict(a1, (char **)v20, "~|~");
sub_774008(v20);
v6 = SongInfoObject::create(v5);
m_songID = (const char *)v6->m_songID;
v8 = v6;
if ( !m_songID )
return nullptr;
v9 = *(cocos2d::CCDictionary **)(a1 + 276);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", m_songID);
CString = (char *)cocos2d::CCString::getCString(v10);
sub_776584((int)v20, CString);
v12 = cocos2d::CCDictionary::objectForKey(v9, v20);
sub_774008(v20);
if ( v12 )
SongInfoObject::copyValues(v8);
sub_776584((int)v20, (char *)&aO1i2r3e45s7t89[12]);
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v5, v20);
v14 = cocos2d::CCString::boolValue(v13);
sub_774008(v20);
v15 = (const char *)v8->m_songID;
v8->m_verified = !v14;
v16 = *(_DWORD *)(a1 + 276);
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v15);
v18 = (char *)cocos2d::CCString::getCString(v17);
sub_776584((int)v20, v18);
cocos2d::CCDictionary::setObject(v16, v8);
sub_774008(v20);
return v8;
}