//
// MusicDownloadManager::responseToDict from 0x96711c to 0x967370 (596 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::addSongObjectFromString @ 0x975a78
// > ??> @ 0xab190
//
// 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 12:57:36 +0000
//
__int64 __fastcall MusicDownloadManager::responseToDict(__int64 a1, char *a2, char *a3)
{
__int64 v5; // x26
char *v6; // x20
char v7; // t1
size_t v8; // x0
size_t v9; // x0
cocos2d::CCArray *v10; // x23
unsigned int v11; // w21
unsigned int v12; // w20
cocos2d::CCString *v13; // x0
const char *CString; // x24
__int64 v15; // x0
cocos2d::CCObject *v16; // x25
size_t v17; // x0
size_t v18; // x20
char *v19; // x3
unsigned __int64 v21; // x0
__int64 v22; // x22
char *v23; // x0
__int64 v25[2]; // [xsp+78h] [xbp+78h] BYREF
void *v26; // [xsp+88h] [xbp+88h]
__int64 v27; // [xsp+90h] [xbp+90h] BYREF
size_t v28; // [xsp+98h] [xbp+98h]
void *v29; // [xsp+A0h] [xbp+A0h]
v5 = cocos2d::CCDictionary::create(_stack_chk_guard);
v7 = *a2;
v6 = a2 + 1;
if ( (v7 & 1) != 0 )
v6 = *((char **)a2 + 2);
v25[0] = 0;
v25[1] = 0;
v26 = nullptr;
v8 = strlen(v6);
std::string::__init(v25, v6, v8);
v27 = 0;
v28 = 0;
v29 = nullptr;
v9 = strlen(a3);
std::string::__init(&v27, a3, v9);
v10 = sub_966E30((__int64)v25, (char *)&v27);
if ( (v27 & 1) != 0 )
operator delete(v29);
if ( (v25[0] & 1) != 0 )
operator delete(v26);
v11 = 0;
v12 = 1;
if ( (unsigned int)cocos2d::CCArray::count(v10) > 1 )
{
while ( 1 )
{
v13 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v10, v11);
CString = (const char *)cocos2d::CCString::getCString(v13);
v15 = cocos2d::CCArray::objectAtIndex(v10, v12);
v27 = 0;
v16 = (cocos2d::CCObject *)v15;
v28 = 0;
v29 = nullptr;
v17 = strlen(CString);
v18 = v17;
if ( v17 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D3FC();
if ( v17 > 0x16 )
break;
LOBYTE(v27) = 2 * v17;
v19 = (char *)&v27 + 1;
if ( v17 )
goto LABEL_16;
LABEL_11:
v19[v18] = 0;
cocos2d::CCDictionary::setObject(v5, v16);
v11 += 2;
if ( (v27 & 1) != 0 )
operator delete(v29);
v12 = v11 + 1;
if ( (unsigned int)cocos2d::CCArray::count(v10) <= v11 + 1 )
return v5;
}
v21 = (v17 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v22 = v21 | 1;
v23 = (char *)operator new(v21);
v27 = v22;
v19 = v23;
v29 = v23;
v28 = v18;
LABEL_16:
v19 = (char *)memcpy(v19, CString, v18);
goto LABEL_11;
}
return v5;
}