//
// MusicDownloadManager::responseToDict from 0x14033e390 to 0x14033e5df (591 bytes)
//
// 2 xrefs:
// > MusicDownloadManager::addSongObjectFromString @ 0x14033da80
// > ??> @ 0x1406d5630
//
// 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
//
// Hidden C++ exception states: #wind=3
__int64 __fastcall MusicDownloadManager::responseToDict(__int64 a1, _QWORD *a2)
{
__int64 v3; // r15
_BYTE *v4; // rdx
size_t v5; // r8
cocos2d::CCArray *v6; // rsi
void *v7; // rcx
void *v8; // rcx
unsigned int v9; // edi
cocos2d::CCString *v10; // rax
const char *CString; // rbx
struct cocos2d::CCObject *v12; // rbp
size_t v13; // r8
void *v14; // rcx
void *v16[2]; // [rsp+28h] [rbp-70h] BYREF
__int128 v17; // [rsp+38h] [rbp-60h]
void *Block[2]; // [rsp+48h] [rbp-50h] BYREF
__m128i si128; // [rsp+58h] [rbp-40h]
v3 = cocos2d::CCDictionary::create(a1);
*(_OWORD *)v16 = 0;
v17 = 0;
sub_14003A930(v16, "~|~", 3u);
v4 = a2;
if ( a2[3] > 0xFu )
v4 = (_BYTE *)*a2;
*(_OWORD *)Block = 0;
si128 = 0;
v5 = -1;
do
++v5;
while ( v4[v5] );
sub_14003A930(Block, v4, v5);
v6 = sub_14033B0F0((__int64 *)Block, (__int64)v16);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v7 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
if ( *((_QWORD *)&v17 + 1) > 0xFu )
{
v8 = v16[0];
if ( (unsigned __int64)(*((_QWORD *)&v17 + 1) + 1LL) >= 0x1000 )
{
v8 = *((void **)v16[0] - 1);
if ( (unsigned __int64)((char *)v16[0] - (char *)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v8);
}
if ( cocos2d::CCArray::count(v6) > 1 )
{
v9 = 1;
do
{
v10 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v6, v9 - 1);
CString = cocos2d::CCString::getCString(v10);
v12 = cocos2d::CCArray::objectAtIndex(v6, v9);
*(_OWORD *)v16 = 0;
v17 = 0u;
v13 = -1;
do
++v13;
while ( CString[v13] );
sub_14003A930(v16, CString, v13);
cocos2d::CCDictionary::setObject(v3, v12, v16);
if ( *((_QWORD *)&v17 + 1) > 0xFu )
{
v14 = v16[0];
if ( (unsigned __int64)(*((_QWORD *)&v17 + 1) + 1LL) >= 0x1000 )
{
v14 = *((void **)v16[0] - 1);
if ( (unsigned __int64)((char *)v16[0] - (char *)v14 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v14);
}
v9 += 2;
}
while ( v9 < cocos2d::CCArray::count(v6) );
}
sub_14003A830((__int64)a2);
return v3;
}