//
// MusicDownloadManager::addSongObjectFromString from 0x577d88 to 0x577e9e (278 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::onGetSongInfoCompleted @ 0x577f50
// > MusicDownloadManager::createSongsInfo @ 0x578274
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:52:44 +0000
//
int __fastcall MusicDownloadManager::addSongObjectFromString(cocos2d::CCDictionary *a1, int a2, int a3, int a4)
{
SongInfoObject *v5; // r8
cocos2d::CCDictionary *v6; // r1
int v7; // r0
const char *v8; // r1
int v9; // r5
int v10; // r9
cocos2d::CCString *v11; // r0
const char *CString; // r0
const char *v13; // r10
size_t v14; // r0
SongInfoObject *v15; // r9
cocos2d::CCString *v16; // r0
char v17; // r8
const char *v18; // r1
int v19; // r7
cocos2d::CCString *v20; // r0
const char *v21; // r0
const char *v22; // r8
size_t v23; // r0
cocos2d::CCDictionary *v25; // [sp+0h] [bp-10h] BYREF
int v26; // [sp+4h] [bp-Ch]
int v27; // [sp+8h] [bp-8h]
int v28; // [sp+Ch] [bp-4h]
v25 = a1;
v26 = a2;
v27 = a3;
v28 = a4;
std::string::basic_string((int *)&v25, a2);
v5 = (SongInfoObject *)MusicDownloadManager::responseToDict(a1, (unsigned __int8 *)&v25, "~|~");
std::string::~string((int)&v25);
v7 = SongInfoObject::create(v5, v6);
v8 = *(const char **)(v7 + 264);
v9 = v7;
if ( !v8 )
return 0;
v10 = *((_DWORD *)a1 + 69);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v8);
CString = (const char *)cocos2d::CCString::getCString(v11);
v25 = nullptr;
v26 = 0;
v27 = 0;
v13 = CString;
v14 = strlen(CString);
std::string::__init((int *)&v25, v13, v14);
v15 = (SongInfoObject *)cocos2d::CCDictionary::objectForKey(v10, &v25);
std::string::~string((int)&v25);
if ( v15 )
SongInfoObject::copyValues((unsigned __int8 *)v9, v15);
v25 = nullptr;
v26 = 0;
v27 = 0;
std::string::__init((int *)&v25, &a1i2r3e45s789g[10], 1u);
v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v5, &v25);
v17 = cocos2d::CCString::boolValue(v16);
std::string::~string((int)&v25);
v18 = *(const char **)(v9 + 264);
*(_BYTE *)(v9 + 329) = v17 ^ 1;
v19 = *((_DWORD *)a1 + 69);
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v18);
v21 = (const char *)cocos2d::CCString::getCString(v20);
v25 = nullptr;
v26 = 0;
v27 = 0;
v22 = v21;
v23 = strlen(v21);
std::string::__init((int *)&v25, v22, v23);
cocos2d::CCDictionary::setObject(v19, (cocos2d::CCObject *)v9);
std::string::~string((int)&v25);
return v9;
}