//
// MusicDownloadManager::dataLoaded from 0x57998c to 0x57a2d2 (2374 bytes)
//
// 1 xrefs:
// > GameManager::dataLoaded @ 0x41c5a4
//
// 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:48 +0000
//
char **__fastcall MusicDownloadManager::dataLoaded(MusicDownloadManager *this, DS_Dictionary *a2)
{
cocos2d::CCObject *v4; // r0
cocos2d::CCObject *v5; // r4
cocos2d::CCObject *v6; // r0
unsigned int v7; // r6
cocos2d::CCString *v8; // r0
const char *CString; // r0
int v10; // r10
const char *v11; // r7
size_t v12; // r0
int v13; // r10
int v14; // r3
size_t v15; // r0
cocos2d::CCObject *v16; // r10
size_t v17; // r0
cocos2d::CCObject *v18; // r0
cocos2d::CCObject *v19; // r4
cocos2d::CCObject *v20; // r0
unsigned int v21; // r6
cocos2d::CCString *v22; // r0
const char *v23; // r0
int v24; // r10
const char *v25; // r7
size_t v26; // r0
int v27; // r10
int v28; // r3
size_t v29; // r0
cocos2d::CCObject *v30; // r10
size_t v31; // r0
int v32; // r5
int IntegerForKey; // r0
char *v34; // r7
unsigned int v35; // r4
unsigned int v36; // r6
unsigned int v37; // t1
unsigned int v38; // r10
int v39; // r5
_DWORD *v40; // r3
unsigned int v41; // r0
int v42; // r1
float v43; // s13
float v44; // s15
bool v45; // r5
unsigned int v46; // r5
unsigned int v47; // r1
_DWORD *v48; // r3
unsigned int v49; // r0
int v50; // r1
char *v51; // r7
unsigned int v52; // r4
unsigned int v53; // r6
unsigned int v54; // t1
unsigned int v55; // r10
int v56; // r5
_DWORD *v57; // r3
unsigned int v58; // r0
int v59; // r1
float v60; // s13
float v61; // s15
bool v62; // r5
unsigned int v63; // r5
unsigned int v64; // r1
_DWORD *v65; // r3
unsigned int v66; // r0
int v67; // r1
char *v68; // r7
unsigned int v69; // r4
unsigned int v70; // r6
unsigned int v71; // t1
unsigned int v72; // r10
int v73; // r5
_DWORD *v74; // r3
float v75; // s13
float v76; // s15
bool v77; // r5
unsigned int v78; // r5
unsigned int v79; // r1
void **v80; // r3
unsigned int v81; // r0
int v82; // r1
unsigned int v83; // r0
int v84; // r1
unsigned int v85; // r7
int v86; // r8
unsigned int v87; // r3
int v88; // r5
size_t v89; // r6
char *v90; // r0
int v91; // r8
char *v92; // r0
int v93; // r6
int *v94; // r2
int v95; // r6
unsigned int v96; // r7
int v97; // r0
int v98; // r2
unsigned int v99; // r1
unsigned int v100; // r7
int *v101; // r3
cocos2d::CCArray *v103; // [sp+Ch] [bp-F0h]
cocos2d::CCArray *v104; // [sp+Ch] [bp-F0h]
cocos2d::CCDictionary *DictForKey; // [sp+10h] [bp-ECh]
cocos2d::CCDictionary *v106; // [sp+10h] [bp-ECh]
char *v107; // [sp+10h] [bp-ECh]
char *v108; // [sp+10h] [bp-ECh]
char *v109; // [sp+10h] [bp-ECh]
int v110; // [sp+10h] [bp-ECh]
int v111; // [sp+14h] [bp-E8h]
int v112; // [sp+14h] [bp-E8h]
char *v113; // [sp+14h] [bp-E8h]
char *v114; // [sp+14h] [bp-E8h]
char *v115; // [sp+14h] [bp-E8h]
char *v116; // [sp+2Ch] [bp-D0h] BYREF
char *v117; // [sp+30h] [bp-CCh]
int v118; // [sp+34h] [bp-C8h]
unsigned __int8 v119[12]; // [sp+38h] [bp-C4h] BYREF
unsigned __int8 v120[12]; // [sp+44h] [bp-B8h] BYREF
unsigned __int8 v121[12]; // [sp+50h] [bp-ACh] BYREF
unsigned __int8 v122[4]; // [sp+5Ch] [bp-A0h] BYREF
int v123; // [sp+60h] [bp-9Ch]
unsigned __int8 v124[12]; // [sp+68h] [bp-94h] BYREF
_BYTE v125[12]; // [sp+74h] [bp-88h] BYREF
_BYTE v126[12]; // [sp+80h] [bp-7Ch] BYREF
unsigned __int8 v127[12]; // [sp+8Ch] [bp-70h] BYREF
int v128[3]; // [sp+98h] [bp-64h] BYREF
int v129[3]; // [sp+A4h] [bp-58h] BYREF
void *v130; // [sp+B0h] [bp-4Ch] BYREF
int v131[3]; // [sp+BCh] [bp-40h] BYREF
int v132; // [sp+C8h] [bp-34h] BYREF
int v133; // [sp+CCh] [bp-30h]
char *v134; // [sp+D0h] [bp-2Ch]
int v135; // [sp+D4h] [bp-28h] BYREF
int v136; // [sp+D8h] [bp-24h]
char *v137; // [sp+DCh] [bp-20h]
_DWORD v138[2]; // [sp+E0h] [bp-1Ch] BYREF
int *v139; // [sp+E8h] [bp-14h]
if ( *((_DWORD *)this + 69) )
{
v7 = 0;
DictForKey = (cocos2d::CCDictionary *)DS_Dictionary::getDictForKey(a2, "MDLM_001", 0);
v103 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(DictForKey);
while ( v7 < cocos2d::CCArray::count(v103) )
{
v8 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v103, v7);
CString = (const char *)cocos2d::CCString::getCString(v8);
v135 = 0;
v136 = 0;
v137 = nullptr;
v10 = *((_DWORD *)this + 69);
v11 = CString;
v12 = strlen(CString);
std::string::__init(&v135, v11, v12);
v13 = cocos2d::CCDictionary::objectForKey(v10, &v135);
std::string::~string((int)&v135);
if ( !v13 )
{
v14 = *((_DWORD *)this + 69);
v132 = 0;
v133 = 0;
v111 = v14;
v134 = nullptr;
v15 = strlen(v11);
std::string::__init(&v132, v11, v15);
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(DictForKey, &v132);
v135 = 0;
v136 = 0;
v137 = nullptr;
v17 = strlen(v11);
std::string::__init(&v135, v11, v17);
cocos2d::CCDictionary::setObject(v111, v16);
std::string::~string((int)&v135);
std::string::~string((int)&v132);
}
++v7;
}
}
else
{
v4 = (cocos2d::CCObject *)DS_Dictionary::getDictForKey(a2, "MDLM_001", 0);
v5 = v4;
if ( *((cocos2d::CCObject **)this + 69) != v4 )
{
if ( v4 )
cocos2d::CCObject::retain(v4);
v6 = *((cocos2d::CCObject **)this + 69);
if ( v6 )
cocos2d::CCObject::release(v6);
*((_DWORD *)this + 69) = v5;
}
}
if ( *((_DWORD *)this + 70) )
{
v21 = 0;
v106 = (cocos2d::CCDictionary *)DS_Dictionary::getDictForKey(a2, "MDLM_003", 0);
v104 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v106);
while ( v21 < cocos2d::CCArray::count(v104) )
{
v22 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v104, v21);
v23 = (const char *)cocos2d::CCString::getCString(v22);
v135 = 0;
v136 = 0;
v137 = nullptr;
v24 = *((_DWORD *)this + 70);
v25 = v23;
v26 = strlen(v23);
std::string::__init(&v135, v25, v26);
v27 = cocos2d::CCDictionary::objectForKey(v24, &v135);
std::string::~string((int)&v135);
if ( !v27 )
{
v28 = *((_DWORD *)this + 70);
v132 = 0;
v133 = 0;
v112 = v28;
v134 = nullptr;
v29 = strlen(v25);
std::string::__init(&v132, v25, v29);
v30 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v106, &v132);
v135 = 0;
v136 = 0;
v137 = nullptr;
v31 = strlen(v25);
std::string::__init(&v135, v25, v31);
cocos2d::CCDictionary::setObject(v112, v30);
std::string::~string((int)&v135);
std::string::~string((int)&v132);
}
++v21;
}
}
else
{
v18 = (cocos2d::CCObject *)DS_Dictionary::getDictForKey(a2, "MDLM_003", 0);
v19 = v18;
if ( *((cocos2d::CCObject **)this + 70) != v18 )
{
if ( v18 )
cocos2d::CCObject::retain(v18);
v20 = *((cocos2d::CCObject **)this + 70);
if ( v20 )
cocos2d::CCObject::release(v20);
*((_DWORD *)this + 70) = v19;
}
}
v32 = *((_DWORD *)this + 71);
if ( v32 >= DS_Dictionary::getIntegerForKey(a2, "MDLM_002") )
IntegerForKey = *((_DWORD *)this + 71);
else
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, "MDLM_002");
*((_DWORD *)this + 71) = IntegerForKey;
v116 = nullptr;
v117 = nullptr;
v118 = 0;
DS_Dictionary::getStringForKey((DS_Dictionary *)v119, (const char *)a2);
MusicDownloadManager::splitIDString(v119, (int)&v116);
std::string::~string((int)v119);
v34 = v116;
v107 = v117;
LABEL_29:
while ( 1 )
{
v113 = v34;
if ( v34 == v107 )
break;
v35 = *((_DWORD *)this + 107);
v37 = *(_DWORD *)v34;
v34 += 4;
v36 = v37;
if ( v35 )
{
v38 = v35 - 1;
if ( ((v35 - 1) & v35) != 0 )
v39 = v36 % v35;
else
v39 = v36 & v38;
v40 = *(_DWORD **)(*((_DWORD *)this + 106) + 4 * v39);
if ( v40 )
{
while ( 1 )
{
v40 = (_DWORD *)*v40;
if ( !v40 )
break;
v41 = v40[1];
v42 = ((v35 - 1) & v35) != 0 ? v41 % v35 : v38 & v41;
if ( v42 != v39 )
break;
if ( v40[2] == v36 )
goto LABEL_29;
}
}
}
else
{
v39 = 0;
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)v128,
(int)this + 424,
v36,
v113);
v43 = *((float *)this + 110);
v44 = (float)(unsigned int)(*((_DWORD *)this + 109) + 1);
if ( v44 > (float)((float)v35 * v43) )
{
v45 = v35 > 2 && ((v35 - 1) & v35) == 0;
}
else
{
if ( v35 )
goto LABEL_50;
v45 = 0;
}
v46 = 2 * v35 + !v45;
v47 = (unsigned int)ceilf(v44 / v43);
if ( v47 < v46 )
v47 = v46;
std::__hash_table,std::equal_to,std::allocator>::rehash((int)this + 424, v47);
v35 = *((_DWORD *)this + 107);
if ( ((v35 - 1) & v35) != 0 )
v39 = v36 % v35;
else
v39 = (v35 - 1) & v36;
LABEL_50:
v48 = *(_DWORD **)(*((_DWORD *)this + 106) + 4 * v39);
if ( v48 )
{
*(_DWORD *)v128[0] = *v48;
*v48 = v128[0];
}
else
{
*(_DWORD *)v128[0] = *((_DWORD *)this + 108);
*((_DWORD *)this + 108) = v128[0];
*(_DWORD *)(*((_DWORD *)this + 106) + 4 * v39) = (char *)this + 432;
if ( *(_DWORD *)v128[0] )
{
v49 = *(_DWORD *)(*(_DWORD *)v128[0] + 4);
if ( ((v35 - 1) & v35) != 0 )
v50 = v49 % v35;
else
v50 = (v35 - 1) & v49;
*(_DWORD *)(*((_DWORD *)this + 106) + 4 * v50) = v128[0];
}
}
++*((_DWORD *)this + 109);
}
v117 -= 4 * ((unsigned int)(v117 - v116) >> 2);
DS_Dictionary::getStringForKey((DS_Dictionary *)v120, (const char *)a2);
MusicDownloadManager::splitIDString(v120, (int)&v116);
std::string::~string((int)v120);
v51 = v116;
v108 = v117;
LABEL_59:
while ( 1 )
{
v114 = v51;
if ( v51 == v108 )
break;
v52 = *((_DWORD *)this + 117);
v54 = *(_DWORD *)v51;
v51 += 4;
v53 = v54;
if ( v52 )
{
v55 = v52 - 1;
if ( ((v52 - 1) & v52) != 0 )
v56 = v53 % v52;
else
v56 = v53 & v55;
v57 = *(_DWORD **)(*((_DWORD *)this + 116) + 4 * v56);
if ( v57 )
{
while ( 1 )
{
v57 = (_DWORD *)*v57;
if ( !v57 )
break;
v58 = v57[1];
v59 = ((v52 - 1) & v52) != 0 ? v58 % v52 : v55 & v58;
if ( v59 != v56 )
break;
if ( v57[2] == v53 )
goto LABEL_59;
}
}
}
else
{
v56 = 0;
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)v129,
(int)this + 464,
v53,
v114);
v60 = *((float *)this + 120);
v61 = (float)(unsigned int)(*((_DWORD *)this + 119) + 1);
if ( v61 > (float)((float)v52 * v60) )
{
v62 = v52 > 2 && ((v52 - 1) & v52) == 0;
}
else
{
if ( v52 )
goto LABEL_80;
v62 = 0;
}
v63 = 2 * v52 + !v62;
v64 = (unsigned int)ceilf(v61 / v60);
if ( v64 < v63 )
v64 = v63;
std::__hash_table,std::equal_to,std::allocator>::rehash((int)this + 464, v64);
v52 = *((_DWORD *)this + 117);
if ( ((v52 - 1) & v52) != 0 )
v56 = v53 % v52;
else
v56 = (v52 - 1) & v53;
LABEL_80:
v65 = *(_DWORD **)(*((_DWORD *)this + 116) + 4 * v56);
if ( v65 )
{
*(_DWORD *)v129[0] = *v65;
*v65 = v129[0];
}
else
{
*(_DWORD *)v129[0] = *((_DWORD *)this + 118);
*((_DWORD *)this + 118) = v129[0];
*(_DWORD *)(*((_DWORD *)this + 116) + 4 * v56) = (char *)this + 472;
if ( *(_DWORD *)v129[0] )
{
v66 = *(_DWORD *)(*(_DWORD *)v129[0] + 4);
if ( ((v52 - 1) & v52) != 0 )
v67 = v66 % v52;
else
v67 = (v52 - 1) & v66;
*(_DWORD *)(*((_DWORD *)this + 116) + 4 * v67) = v129[0];
}
}
++*((_DWORD *)this + 119);
}
v117 -= 4 * ((unsigned int)(v117 - v116) >> 2);
DS_Dictionary::getStringForKey((DS_Dictionary *)v121, (const char *)a2);
MusicDownloadManager::splitIDString(v121, (int)&v116);
std::string::~string((int)v121);
v68 = v116;
v109 = v117;
LABEL_103:
while ( 1 )
{
v115 = v68;
if ( v68 == v109 )
break;
v69 = *((_DWORD *)this + 112);
v71 = *(_DWORD *)v68;
v68 += 4;
v70 = v71;
if ( v69 )
{
v72 = v69 - 1;
if ( ((v69 - 1) & v69) != 0 )
v73 = v70 % v69;
else
v73 = v70 & v72;
v74 = *(_DWORD **)(*((_DWORD *)this + 111) + 4 * v73);
if ( v74 )
{
while ( 1 )
{
v74 = (_DWORD *)*v74;
if ( !v74 )
break;
v81 = v74[1];
v82 = ((v69 - 1) & v69) != 0 ? v81 % v69 : v72 & v81;
if ( v82 != v73 )
break;
if ( v74[2] == v70 )
goto LABEL_103;
}
}
}
else
{
v73 = 0;
}
std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)&v130,
(int)this + 444,
v70,
v115);
v75 = *((float *)this + 115);
v76 = (float)(unsigned int)(*((_DWORD *)this + 114) + 1);
if ( v76 <= (float)((float)v69 * v75) )
{
if ( v69 )
goto LABEL_100;
v77 = 0;
}
else
{
v77 = v69 > 2 && ((v69 - 1) & v69) == 0;
}
v78 = 2 * v69 + !v77;
v79 = (unsigned int)ceilf(v76 / v75);
if ( v79 < v78 )
v79 = v78;
std::__hash_table,std::equal_to,std::allocator>::rehash((int)this + 444, v79);
v69 = *((_DWORD *)this + 112);
if ( ((v69 - 1) & v69) != 0 )
v73 = v70 % v69;
else
v73 = (v69 - 1) & v70;
LABEL_100:
v80 = *(void ***)(*((_DWORD *)this + 111) + 4 * v73);
if ( v80 )
{
*(_DWORD *)v130 = *v80;
*v80 = v130;
}
else
{
*(_DWORD *)v130 = *((_DWORD *)this + 113);
*((_DWORD *)this + 113) = v130;
*(_DWORD *)(*((_DWORD *)this + 111) + 4 * v73) = (char *)this + 452;
if ( *(_DWORD *)v130 )
{
v83 = *(_DWORD *)(*(_DWORD *)v130 + 4);
if ( ((v69 - 1) & v69) != 0 )
v84 = v83 % v69;
else
v84 = (v69 - 1) & v83;
*(_DWORD *)(*((_DWORD *)this + 111) + 4 * v84) = v130;
}
}
++*((_DWORD *)this + 114);
}
if ( *((_DWORD *)this + 121) == *((_DWORD *)this + 122) )
{
DS_Dictionary::getStringForKey((DS_Dictionary *)v122, (const char *)a2);
v85 = 0;
while ( 1 )
{
v86 = v122[0];
v110 = v122[0] & 1;
v87 = v110 ? v123 : (int)v122[0] >> 1;
if ( v85 >= v87 )
break;
v88 = std::string::find(v122, 44, v85);
if ( v88 == -1 )
{
if ( v110 )
v88 = v123;
else
v88 = v86 >> 1;
}
std::string::basic_string(v131, v122, v85, v88 - v85);
v89 = std::string::find((unsigned __int8 *)v131, 58, 0);
std::string::basic_string(&v135, (unsigned __int8 *)v131, 0, v89);
if ( (v135 & 1) != 0 )
v90 = v137;
else
v90 = (char *)&v135 + 1;
v91 = atoi(v90);
std::string::~string((int)&v135);
if ( v89 == -1 )
{
v93 = 0;
}
else
{
std::string::basic_string(&v132, (unsigned __int8 *)v131, v89 + 1, 0xFFFFFFFF);
if ( (v132 & 1) != 0 )
v92 = v134;
else
v92 = (char *)&v132 + 1;
v93 = atoi(v92);
std::string::~string((int)&v132);
}
if ( v91 > 0 )
{
v94 = *((int **)this + 122);
v95 = v93 & ~(v93 >> 31);
v96 = *((_DWORD *)this + 123);
if ( (unsigned int)v94 >= v96 )
{
v97 = *((_DWORD *)this + 121);
v98 = ((int)v94 - v97) >> 3;
v99 = v98 + 1;
if ( (unsigned int)(v98 + 1) >= 0x20000000 )
sub_388878();
v100 = (int)(v96 - v97) >> 3;
if ( v100 > 0xFFFFFFE )
{
v99 = 0x1FFFFFFF;
}
else if ( v99 < 2 * v100 )
{
v99 = 2 * v100;
}
std::__split_buffer>::__split_buffer(v138, v99, v98, (int)this + 492);
v101 = v139;
if ( v139 )
{
*v139 = v91;
v101[1] = v95;
}
v139 += 2;
std::vector>::__swap_out_circular_buffer((_DWORD *)this + 121, v138);
std::__split_buffer>::~__split_buffer((int)v138);
}
else
{
if ( v94 )
{
*v94 = v91;
v94[1] = v95;
}
*((_DWORD *)this + 122) += 8;
}
}
v85 = v88 + 1;
std::string::~string((int)v131);
}
std::string::~string((int)v122);
}
if ( *((_DWORD *)this + 124) == *((_DWORD *)this + 125) )
{
DS_Dictionary::getStringForKey((DS_Dictionary *)v124, (const char *)a2);
MusicDownloadManager::splitIDString(v124, (int)this + 496);
std::string::~string((int)v124);
}
if ( !*((_DWORD *)this + 129) )
{
DS_Dictionary::getStringForKey((DS_Dictionary *)v125, (const char *)a2);
sub_5750B0((int)v125, (int **)this + 127);
std::string::~string((int)v125);
}
if ( !*((_DWORD *)this + 132) )
{
DS_Dictionary::getStringForKey((DS_Dictionary *)v126, (const char *)a2);
sub_5750B0((int)v126, (int **)this + 130);
std::string::~string((int)v126);
}
DS_Dictionary::getStringForKey((DS_Dictionary *)v127, (const char *)a2);
MusicDownloadManager::decodeCustomSFX((int)this, v127);
std::string::~string((int)v127);
return std::__vector_base::~__vector_base(&v116);
}