//
// MusicDownloadManager::parseMusicLibrary from 0x8381ac to 0x83a0b8 (7948 bytes)
//
// 4 xrefs:
// > MusicDownloadManager::onDownloadMusicLibraryCompleted @ 0x83a190
// > MusicDownloadManager::tryLoadLibraries @ 0x83a2e8
// > MusicBrowser::init @ 0xa5c018
// > ??> @ 0x781f8
//
// 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
//
void MusicDownloadManager::parseMusicLibrary(MusicDownloadManager *a1)
{
cocos2d::CCFileUtils *v1; // x0
cocos2d::ZipUtils *v2; // x0
int v3; // w4
char *v4; // x1
char *v5; // x0
char *v6; // x0
void *v7; // x0
__int64 *v8; // x20
__int64 *v9; // x22
cocos2d::CCDictionary *m_musicObjects; // x0
cocos2d::CCDictionary *m_musicArtists; // x0
cocos2d::CCDictionary *v12; // x0
cocos2d::CCDictionary *v13; // x0
std::_rb_tree_base *m_parent; // x20
std::_rb_tree_base *v15; // x0
std::_rb_tree_base *m_left; // x24
std::_rb_tree_base *v17; // x1
std::_rb_tree_base **p_m_parent; // x0
unsigned int *p_m_right; // x1
int m_right; // w2
const char **v21; // x20
const char *v22; // x0
_QWORD *v23; // x0
unsigned __int64 v24; // x20
void *v25; // x3
__int64 *v26; // x4
__int64 *v27; // x28
__int64 *v28; // x27
__int64 v29; // x1
__int64 *v30; // x0
unsigned int *v31; // x1
int v32; // w2
void *v33; // x28
_QWORD *v34; // x0
unsigned __int64 i; // x21
void *v36; // x24
__int64 *v37; // x23
__int64 *v38; // x20
__int64 v39; // x1
__int64 *v40; // x0
unsigned int *v41; // x1
int v42; // w2
void *v43; // x23
signed __int64 v44; // x20
__int64 *v45; // x0
__int64 *v46; // x20
__int64 *v47; // x27
unsigned __int64 v48; // x21
void *v49; // x28
__int64 *v50; // x27
__int64 *v51; // x20
__int64 v52; // x1
__int64 *v53; // x0
unsigned int *v54; // x1
int v55; // w2
void *v56; // x20
int v57; // w28
__int64 insert_unique_pos; // x20
std::_rb_tree_base *v59; // x0
__int64 v60; // x27
int *v61; // x1
char *v62; // x0
int v63; // w3
std::_rb_tree_base *v64; // x2
_BOOL8 v65; // x0
void *v66; // x0
__int64 *v67; // x20
__int64 *v68; // x21
__int64 v69; // x1
__int64 *v70; // x0
unsigned int *v71; // x1
int v72; // w2
unsigned int *v73; // x1
int v74; // w2
__int64 v75; // x1
__int64 *v76; // x0
__int64 *v77; // x20
__int64 *v78; // x21
__int64 v79; // x1
__int64 *v80; // x0
unsigned int *v81; // x1
int v82; // w2
__int64 *v83; // x20
__int64 *v84; // x21
__int64 v85; // x1
__int64 *v86; // x0
unsigned int *v87; // x1
int v88; // w2
__int64 *v89; // x20
__int64 *v90; // x21
__int64 v91; // x1
__int64 *v92; // x0
unsigned int *v93; // x1
int v94; // w2
char *v95; // x0
unsigned int *v96; // x1
int v97; // w2
void *v98; // x26
int v99; // w23
float v100; // s8
void *v101; // x24
char *v102; // x1
char *v103; // x1
void *v104; // x26
char *v105; // x1
const std::string *v106; // x1
unsigned int *v107; // x1
unsigned int *v108; // x0
void *v109; // x0
cocos2d::CCObject *v110; // x1
SongInfoObject *v111; // x23
void *v112; // x0
void *v113; // x0
void *v114; // x0
void *v115; // x0
void *v116; // x0
void *v117; // x0
void *v118; // x0
char *v119; // x0
__int64 v120; // x1
void *v121; // x0
void *v122; // x0
void *v123; // x0
unsigned int *v124; // x0
void *v125; // x0
void *v126; // x0
unsigned int *v127; // x1
int v128; // w2
int v129; // w27
const std::string *v130; // x1
unsigned int *v131; // x1
unsigned int *v132; // x0
void *v133; // x0
cocos2d::CCObject *v134; // x28
char *v135; // x0
void *v136; // x0
void *v137; // x0
char *v138; // x0
void *v139; // x0
void *v140; // x0
unsigned int *v141; // x1
int v142; // w2
unsigned int *v143; // x1
int v144; // w2
unsigned int *v145; // x1
int v146; // w2
std::_rb_tree_base *v147; // x1
unsigned int *v148; // x1
int v149; // w2
unsigned int *v150; // x1
int v151; // w2
unsigned int *v152; // x1
int v153; // w2
unsigned int *v154; // x1
int v155; // w2
unsigned int *v156; // x1
int v157; // w2
unsigned int *v158; // x1
int v159; // w2
unsigned int *v160; // x1
int v161; // w2
unsigned int *v162; // x1
int v163; // w2
unsigned int *v164; // x1
int v165; // w2
unsigned int *v166; // x1
int v167; // w2
unsigned int *v168; // x1
int v169; // w2
unsigned int *v170; // x1
int v171; // w2
unsigned int *v172; // x1
int v173; // w2
unsigned int *v174; // x1
int v175; // w2
unsigned int *v176; // x1
int v177; // w2
unsigned int *v178; // x1
int v179; // w2
unsigned int *v180; // x1
int v181; // w2
unsigned int *v182; // x1
int v183; // w2
int v184; // w2
unsigned int *v185; // x1
int v186; // w2
int v187; // w2
void *v188; // x0
__int64 v189; // x1
__int64 *v190; // x0
unsigned int *v191; // x1
int v192; // w2
unsigned int *v193; // x1
int v194; // w2
unsigned int *v195; // x1
int v196; // w2
unsigned int *v197; // x1
int v198; // w2
unsigned int *v199; // x1
int v200; // w2
unsigned int *v201; // x3
int v202; // w1
std::map *p_m_musicTags; // [xsp+A8h] [xbp+78h]
char v204; // [xsp+B0h] [xbp+80h]
int v205; // [xsp+B4h] [xbp+84h]
int v206; // [xsp+B8h] [xbp+88h]
int v207; // [xsp+BCh] [xbp+8Ch]
int v208; // [xsp+C8h] [xbp+98h]
int v209; // [xsp+CCh] [xbp+9Ch]
void *v210; // [xsp+F0h] [xbp+C0h]
__int64 *v211; // [xsp+F8h] [xbp+C8h]
int v212; // [xsp+F8h] [xbp+C8h]
std::_rb_tree_base *p_m_header; // [xsp+108h] [xbp+D8h]
__int64 v215; // [xsp+130h] [xbp+100h] BYREF
_BOOL8 v216; // [xsp+138h] [xbp+108h] BYREF
char *v217; // [xsp+140h] [xbp+110h] BYREF
__int64 v218; // [xsp+148h] [xbp+118h] BYREF
__int64 v219; // [xsp+150h] [xbp+120h] BYREF
unsigned int *v220; // [xsp+158h] [xbp+128h] BYREF
__int64 v221; // [xsp+160h] [xbp+130h] BYREF
__int64 v222; // [xsp+168h] [xbp+138h] BYREF
unsigned int *v223; // [xsp+170h] [xbp+140h] BYREF
__int64 v224; // [xsp+178h] [xbp+148h] BYREF
__int64 v225; // [xsp+180h] [xbp+150h] BYREF
__int64 v226; // [xsp+188h] [xbp+158h] BYREF
__int64 v227; // [xsp+190h] [xbp+160h] BYREF
__int64 v228; // [xsp+198h] [xbp+168h] BYREF
__int64 v229; // [xsp+1A0h] [xbp+170h] BYREF
__int64 v230; // [xsp+1A8h] [xbp+178h] BYREF
__int64 v231; // [xsp+1B0h] [xbp+180h] BYREF
__int64 v232; // [xsp+1B8h] [xbp+188h] BYREF
void *v233; // [xsp+1C0h] [xbp+190h] BYREF
void *v234; // [xsp+1C8h] [xbp+198h]
__int64 v235; // [xsp+1D0h] [xbp+1A0h]
void *v236; // [xsp+1D8h] [xbp+1A8h] BYREF
void *v237; // [xsp+1E0h] [xbp+1B0h]
__int64 v238; // [xsp+1E8h] [xbp+1B8h]
void *v239; // [xsp+1F0h] [xbp+1C0h] BYREF
void *v240; // [xsp+1F8h] [xbp+1C8h]
__int64 v241; // [xsp+200h] [xbp+1D0h]
void *v242; // [xsp+208h] [xbp+1D8h] BYREF
void *v243; // [xsp+210h] [xbp+1E0h]
__int64 v244; // [xsp+218h] [xbp+1E8h]
void *p; // [xsp+220h] [xbp+1F0h] BYREF
__int64 *v246; // [xsp+228h] [xbp+1F8h]
__int64 v247; // [xsp+230h] [xbp+200h]
MusicDownloadManager::pathForSongFolder(a1, 0, (__int64)&v215);
sub_D15FD4(&v215, "musiclibrary.dat", 16);
v216 = 0;
v1 = cocos2d::CCFileUtils::sharedFileUtils();
v2 = (cocos2d::ZipUtils *)((__int64 (__fastcall *)(cocos2d::CCFileUtils *, __int64, char *, _BOOL8 *))v1->addSearchResolutionsOrder)(
v1,
v215,
"r",
&v216);
v4 = &byte_124B6C8;
v217 = &byte_124B6C8;
if ( v2 )
{
cocos2d::ZipUtils::decompressString2((__int64 *)&v239, v2, nullptr, v216, 11, v3);
sub_D163D4(&v217, &v239);
v5 = (char *)v239 - 24;
if ( (char *)v239 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v197 = (unsigned int *)((char *)v239 - 8);
do
v198 = __ldaxr(v197);
while ( __stlxr(v198 - 1, v197) );
}
else
{
v198 = *((_DWORD *)v239 - 2);
*((_DWORD *)v239 - 2) = v198 - 1;
}
if ( v198 <= 0 )
operator delete(v5);
}
v4 = v217;
if ( *((_QWORD *)v217 - 3) )
{
v233 = nullptr;
v234 = nullptr;
v235 = 0;
sub_830154(&v217, "|", (__int64)&v233);
v8 = (__int64 *)v233;
v9 = (__int64 *)v234;
if ( (unsigned __int64)((_BYTE *)v234 - (_BYTE *)v233) <= 0x1F )
{
v188 = v233;
if ( v233 != v234 )
{
do
{
v189 = *v8;
v190 = (__int64 *)(*v8 - 24);
if ( v190 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v191 = (unsigned int *)(v189 - 8);
do
v192 = __ldaxr(v191);
while ( __stlxr(v192 - 1, v191) );
}
else
{
v192 = *(_DWORD *)(v189 - 8);
*(_DWORD *)(v189 - 8) = v192 - 1;
}
if ( v192 <= 0 )
operator delete(v190);
}
++v8;
}
while ( v9 != v8 );
v188 = v233;
}
if ( v188 )
operator delete(v188);
v4 = v217;
goto LABEL_4;
}
v236 = nullptr;
v237 = nullptr;
m_musicObjects = a1->m_musicObjects;
v238 = 0;
if ( m_musicObjects )
cocos2d::CCObject::release(m_musicObjects);
m_musicArtists = a1->m_musicArtists;
if ( m_musicArtists )
cocos2d::CCObject::release(m_musicArtists);
a1->m_musicObjects = nullptr;
a1->m_musicArtists = nullptr;
v12 = cocos2d::CCDictionary::create();
a1->m_musicObjects = v12;
cocos2d::CCObject::retain(v12);
v13 = cocos2d::CCDictionary::create();
a1->m_musicArtists = v13;
cocos2d::CCObject::retain(v13);
m_parent = a1->m_musicTags.m_header.m_parent;
p_m_musicTags = &a1->m_musicTags;
if ( m_parent )
{
do
{
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_erase(
(__int64)p_m_musicTags,
&m_parent->m_right->m_isblack);
m_left = m_parent->m_left;
v17 = m_parent[1].m_parent;
p_m_parent = &v17[-1].m_parent;
if ( &v17[-1].m_parent != (std::_rb_tree_base **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_right = (unsigned int *)&v17[-1].m_right;
do
m_right = __ldaxr(p_m_right);
while ( __stlxr(m_right - 1, p_m_right) );
}
else
{
m_right = (int)v17[-1].m_right;
LODWORD(v17[-1].m_right) = m_right - 1;
}
if ( m_right <= 0 )
operator delete(p_m_parent);
}
v15 = m_parent;
m_parent = m_left;
operator delete(v15);
}
while ( m_left );
}
v21 = (const char **)v233;
p_m_header = &a1->m_musicTags.m_header;
a1->m_musicTags.m_header.m_left = &a1->m_musicTags.m_header;
a1->m_musicTags.m_header.m_right = &a1->m_musicTags.m_header;
a1->m_musicTags.m_header.m_parent = nullptr;
a1->m_musicTags.m_nodecount = 0;
v22 = *v21;
a1->m_musicObjectCount = 0;
a1->m_ncsSongCount = 0;
a1->m_musicLibraryVersion = atoi(v22);
v239 = nullptr;
v240 = nullptr;
v241 = 0;
sub_830154(&byte_8[(_QWORD)v21], ";", (__int64)&v239);
v23 = v239;
if ( ((_BYTE *)v240 - (_BYTE *)v239) >> 3 )
{
v24 = 0;
do
{
v25 = v236;
v26 = &`vtable for'cocos2d::CCTransitionPageTurn;
v27 = (__int64 *)v237;
v28 = (__int64 *)v236;
if ( v236 != v237 )
{
do
{
while ( 1 )
{
v29 = *v28;
v30 = (__int64 *)(*v28 - 24);
if ( v30 != &qword_124B6B0 )
{
if ( v26[285] )
{
v31 = (unsigned int *)(v29 - 8);
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *(_DWORD *)(v29 - 8);
*(_DWORD *)(v29 - 8) = v32 - 1;
}
if ( v32 <= 0 )
break;
}
if ( v27 == ++v28 )
goto LABEL_32;
}
v210 = v25;
v211 = v26;
++v28;
operator delete(v30);
v25 = v210;
v26 = v211;
}
while ( v27 != v28 );
LABEL_32:
v23 = v239;
}
v237 = v25;
sub_830154(&v23[v24], &byte_F804F8, (__int64)&v236);
v33 = v236;
if ( (unsigned __int64)((_BYTE *)v237 - (_BYTE *)v236) > 0x1F )
{
v129 = atoi(*(const char **)v236);
sub_D153B8((int)&v231, *(char **)&byte_8[(_QWORD)v33]);
sub_D153B8((int)&v232, *(char **)((char *)&word_10 + (_QWORD)v236));
sub_D153B8((int)&p, *(char **)((char *)&off_18 + (_QWORD)v236));
if ( *(_QWORD *)(v232 - 24) <= 1u )
{
sub_D1798C(&v232, &byte_F288A0, 0);
}
else
{
cocos2d::ZipUtils::urlDecode((cocos2d::ZipUtils *)&v232, v130);
sub_D163D4(&v232, &v220);
v131 = v220;
v132 = v220 - 6;
if ( v220 - 6 != (unsigned int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v131 = v220 - 2;
do
v187 = __ldaxr(v131);
while ( __stlxr(v187 - 1, v131) );
}
else
{
v187 = *(v220 - 2);
*(v220 - 2) = v187 - 1;
}
if ( v187 <= 0 )
operator delete(v132);
}
}
if ( *((_QWORD *)p - 3) <= 1u )
{
sub_D1798C(&p, &byte_F288A0, 0);
}
else
{
cocos2d::ZipUtils::urlDecode((cocos2d::ZipUtils *)&p, (const std::string *)v131);
sub_D163D4(&p, &v221);
v133 = (void *)(v221 - 24);
if ( (__int64 *)(v221 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v182 = (unsigned int *)(v221 - 8);
do
v183 = __ldaxr(v182);
while ( __stlxr(v183 - 1, v182) );
}
else
{
v183 = *(_DWORD *)(v221 - 8);
*(_DWORD *)(v221 - 8) = v183 - 1;
}
if ( v183 <= 0 )
operator delete(v133);
}
}
sub_D18D28(&v222);
sub_D18D28(&v225);
sub_D18D28(&v242);
v134 = (cocos2d::CCObject *)MusicArtistObject::create(v129);
v135 = (char *)v242 - 24;
if ( (char *)v242 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v152 = (unsigned int *)((char *)v242 - 8);
do
v153 = __ldaxr(v152);
while ( __stlxr(v153 - 1, v152) );
}
else
{
v153 = *((_DWORD *)v242 - 2);
*((_DWORD *)v242 - 2) = v153 - 1;
}
if ( v153 <= 0 )
operator delete(v135);
}
v136 = (void *)(v225 - 24);
if ( (__int64 *)(v225 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v150 = (unsigned int *)(v225 - 8);
do
v151 = __ldaxr(v150);
while ( __stlxr(v151 - 1, v150) );
}
else
{
v151 = *(_DWORD *)(v225 - 8);
*(_DWORD *)(v225 - 8) = v151 - 1;
}
if ( v151 <= 0 )
operator delete(v136);
}
v137 = (void *)(v222 - 24);
if ( (__int64 *)(v222 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v148 = (unsigned int *)(v222 - 8);
do
v149 = __ldaxr(v148);
while ( __stlxr(v149 - 1, v148) );
}
else
{
v149 = *(_DWORD *)(v222 - 8);
*(_DWORD *)(v222 - 8) = v149 - 1;
}
if ( v149 <= 0 )
operator delete(v137);
}
cocos2d::CCDictionary::setObject(a1->m_musicArtists, v134, v129);
v138 = (char *)p - 24;
if ( (char *)p - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v156 = (unsigned int *)((char *)p - 8);
do
v157 = __ldaxr(v156);
while ( __stlxr(v157 - 1, v156) );
}
else
{
v157 = *((_DWORD *)p - 2);
*((_DWORD *)p - 2) = v157 - 1;
}
if ( v157 <= 0 )
operator delete(v138);
}
v139 = (void *)(v232 - 24);
if ( (__int64 *)(v232 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v154 = (unsigned int *)(v232 - 8);
do
v155 = __ldaxr(v154);
while ( __stlxr(v155 - 1, v154) );
}
else
{
v155 = *(_DWORD *)(v232 - 8);
*(_DWORD *)(v232 - 8) = v155 - 1;
}
if ( v155 <= 0 )
operator delete(v139);
}
v140 = (void *)(v231 - 24);
if ( (__int64 *)(v231 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v141 = (unsigned int *)(v231 - 8);
do
v142 = __ldaxr(v141);
while ( __stlxr(v142 - 1, v141) );
}
else
{
v142 = *(_DWORD *)(v231 - 8);
*(_DWORD *)(v231 - 8) = v142 - 1;
}
if ( v142 <= 0 )
operator delete(v140);
}
}
v23 = v239;
++v24;
}
while ( v24 < ((_BYTE *)v240 - (_BYTE *)v239) >> 3 );
}
v242 = nullptr;
v243 = nullptr;
v244 = 0;
sub_830154((_QWORD *)v233 + 2, ";", (__int64)&v242);
v34 = v242;
if ( ((_BYTE *)v243 - (_BYTE *)v242) >> 3 )
{
for ( i = 0; i < ((_BYTE *)v243 - (_BYTE *)v242) >> 3; ++i )
{
v36 = v236;
v37 = (__int64 *)v237;
v38 = (__int64 *)v236;
if ( v236 != v237 )
{
do
{
while ( 1 )
{
v39 = *v38;
v40 = (__int64 *)(*v38 - 24);
if ( v40 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v41 = (unsigned int *)(v39 - 8);
do
v42 = __ldaxr(v41);
while ( __stlxr(v42 - 1, v41) );
}
else
{
v42 = *(_DWORD *)(v39 - 8);
*(_DWORD *)(v39 - 8) = v42 - 1;
}
if ( v42 <= 0 )
break;
}
if ( v37 == ++v38 )
goto LABEL_46;
}
++v38;
operator delete(v40);
}
while ( v37 != v38 );
LABEL_46:
v34 = v242;
}
v237 = v36;
sub_830154(&v34[i], &byte_F804F8, (__int64)&v236);
v43 = v236;
v44 = ((_BYTE *)v237 - (_BYTE *)v236) >> 3;
if ( (int)v44 <= 5 )
goto LABEL_48;
v207 = atoi(*(const char **)v236);
sub_D153B8((int)&v218, *(char **)&byte_8[(_QWORD)v43]);
v98 = v236;
v99 = atoi(*(const char **)((char *)&word_10 + (_QWORD)v236));
v100 = (float)atoi(*(const char **)((char *)&off_18 + (_QWORD)v98)) * 0.00000095367;
v206 = atoi(*(const char **)((char *)&qword_20 + (_QWORD)v98));
sub_D153B8((int)&v219, *(char **)((char *)&qword_28 + (_QWORD)v98));
if ( (_DWORD)v44 == 6 )
{
v209 = 0;
v102 = &byte_F288A0;
}
else
{
v101 = v236;
v209 = atoi(*(const char **)((char *)&dword_30 + (_QWORD)v236));
if ( (_DWORD)v44 == 7 )
v102 = &byte_F288A0;
else
v102 = *(char **)((char *)&word_38 + (_QWORD)v101);
}
sub_D153B8((int)&v220, v102);
if ( (int)v44 <= 8 )
v103 = &byte_F288A0;
else
v103 = *(char **)((char *)&dword_40 + (_QWORD)v236);
sub_D153B8((int)&v221, v103);
if ( (int)v44 <= 9 )
{
v204 = 0;
v208 = 0;
v105 = &byte_F288A0;
v205 = 0;
}
else
{
v104 = v236;
v204 = atoi(*(const char **)((char *)&qword_48 + (_QWORD)v236)) != 0;
if ( (int)v44 <= 10 )
{
v208 = 0;
LABEL_204:
v205 = 0;
v105 = &byte_F288A0;
goto LABEL_162;
}
v208 = atoi(*(const char **)((char *)off_50 + (_QWORD)v104));
if ( (_DWORD)v44 == 11 )
goto LABEL_204;
v205 = atoi(*(const char **)((char *)&qword_58 + (_QWORD)v104));
if ( (_DWORD)v44 == 12 )
v105 = &byte_F288A0;
else
v105 = *(char **)((char *)&qword_60 + (_QWORD)v104);
}
LABEL_162:
sub_D153B8((int)&v222, v105);
if ( *(_QWORD *)(v221 - 24) <= 1u )
{
sub_D1798C(&v221, &byte_F288A0, 0);
}
else
{
cocos2d::ZipUtils::urlDecode((cocos2d::ZipUtils *)&v221, v106);
sub_D163D4(&v221, &v223);
v107 = v223;
v108 = v223 - 6;
if ( v223 - 6 != (unsigned int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v107 = v223 - 2;
do
v184 = __ldaxr(v107);
while ( __stlxr(v184 - 1, v107) );
}
else
{
v184 = *(v223 - 2);
*(v223 - 2) = v184 - 1;
}
if ( v184 <= 0 )
operator delete(v108);
}
}
if ( *(_QWORD *)(v222 - 24) <= 1u )
{
sub_D1798C(&v222, &byte_F288A0, 0);
}
else
{
cocos2d::ZipUtils::urlDecode((cocos2d::ZipUtils *)&v222, (const std::string *)v107);
sub_D163D4(&v222, &v224);
v109 = (void *)(v224 - 24);
if ( (__int64 *)(v224 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v185 = (unsigned int *)(v224 - 8);
do
v186 = __ldaxr(v185);
while ( __stlxr(v186 - 1, v185) );
}
else
{
v186 = *(_DWORD *)(v224 - 8);
*(_DWORD *)(v224 - 8) = v186 - 1;
}
if ( v186 <= 0 )
operator delete(v109);
}
}
sub_D153B8((int)&v225, "NA");
v110 = cocos2d::CCDictionary::objectForKey(a1->m_musicArtists, v99);
if ( v110 )
sub_D18EA8(&v225, &v110[1].m_uID);
sub_D18D28(&v226);
sub_D18D28(&v227);
sub_D153B8((int)&v228, &byte_F288A0);
sub_D153B8((int)&v229, &byte_F288A0);
sub_D18D28(&v230);
sub_D18D28(&v231);
sub_D18D28(&v232);
v111 = (SongInfoObject *)SongInfoObject::create(
v207,
v100,
(__int64)&v226,
(__int64)&v227,
v99,
(__int64)&v228,
(__int64)&v229,
(__int64)&v230,
(__int64)&v231,
v209,
(__int64)&v232,
v204,
v208,
0);
v112 = (void *)(v232 - 24);
if ( (__int64 *)(v232 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v180 = (unsigned int *)(v232 - 8);
do
v181 = __ldaxr(v180);
while ( __stlxr(v181 - 1, v180) );
}
else
{
v181 = *(_DWORD *)(v232 - 8);
*(_DWORD *)(v232 - 8) = v181 - 1;
}
if ( v181 <= 0 )
operator delete(v112);
}
v113 = (void *)(v231 - 24);
if ( (__int64 *)(v231 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v178 = (unsigned int *)(v231 - 8);
do
v179 = __ldaxr(v178);
while ( __stlxr(v179 - 1, v178) );
}
else
{
v179 = *(_DWORD *)(v231 - 8);
*(_DWORD *)(v231 - 8) = v179 - 1;
}
if ( v179 <= 0 )
operator delete(v113);
}
v114 = (void *)(v230 - 24);
if ( (__int64 *)(v230 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v176 = (unsigned int *)(v230 - 8);
do
v177 = __ldaxr(v176);
while ( __stlxr(v177 - 1, v176) );
}
else
{
v177 = *(_DWORD *)(v230 - 8);
*(_DWORD *)(v230 - 8) = v177 - 1;
}
if ( v177 <= 0 )
operator delete(v114);
}
v115 = (void *)(v229 - 24);
if ( (__int64 *)(v229 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v174 = (unsigned int *)(v229 - 8);
do
v175 = __ldaxr(v174);
while ( __stlxr(v175 - 1, v174) );
}
else
{
v175 = *(_DWORD *)(v229 - 8);
*(_DWORD *)(v229 - 8) = v175 - 1;
}
if ( v175 <= 0 )
operator delete(v115);
}
v116 = (void *)(v228 - 24);
if ( (__int64 *)(v228 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v172 = (unsigned int *)(v228 - 8);
do
v173 = __ldaxr(v172);
while ( __stlxr(v173 - 1, v172) );
}
else
{
v173 = *(_DWORD *)(v228 - 8);
*(_DWORD *)(v228 - 8) = v173 - 1;
}
if ( v173 <= 0 )
operator delete(v116);
}
v117 = (void *)(v227 - 24);
if ( (__int64 *)(v227 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v170 = (unsigned int *)(v227 - 8);
do
v171 = __ldaxr(v170);
while ( __stlxr(v171 - 1, v170) );
}
else
{
v171 = *(_DWORD *)(v227 - 8);
*(_DWORD *)(v227 - 8) = v171 - 1;
}
if ( v171 <= 0 )
operator delete(v117);
}
v118 = (void *)(v226 - 24);
if ( (__int64 *)(v226 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v168 = (unsigned int *)(v226 - 8);
do
v169 = __ldaxr(v168);
while ( __stlxr(v169 - 1, v168) );
}
else
{
v169 = *(_DWORD *)(v226 - 8);
*(_DWORD *)(v226 - 8) = v169 - 1;
}
if ( v169 <= 0 )
operator delete(v118);
}
v111->m_duration = v206;
v111->m_verified = 1;
v111->m_songOrder = v205;
sub_D18D28(&p);
SongInfoObject::addTags((__int64)v111, (const void **)&p);
v119 = (char *)p - 24;
if ( (char *)p - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v166 = (unsigned int *)((char *)p - 8);
do
v167 = __ldaxr(v166);
while ( __stlxr(v167 - 1, v166) );
}
else
{
v167 = *((_DWORD *)p - 2);
*((_DWORD *)p - 2) = v167 - 1;
}
if ( v167 <= 0 )
operator delete(v119);
}
MusicDownloadManager::storeMusicObject(a1, v111);
++a1->m_musicObjectCount;
if ( v209 == 1 )
{
++a1->m_ncsSongCount;
v120 = v225;
v121 = (void *)(v225 - 24);
if ( (__int64 *)(v225 - 24) != &qword_124B6B0 )
{
LABEL_212:
if ( &pthread_create )
{
v143 = (unsigned int *)(v120 - 8);
do
v144 = __ldaxr(v143);
while ( __stlxr(v144 - 1, v143) );
}
else
{
v144 = *(_DWORD *)(v120 - 8);
*(_DWORD *)(v120 - 8) = v144 - 1;
}
if ( v144 <= 0 )
operator delete(v121);
}
}
else
{
v120 = v225;
v121 = (void *)(v225 - 24);
if ( (__int64 *)(v225 - 24) != &qword_124B6B0 )
goto LABEL_212;
}
v122 = (void *)(v222 - 24);
if ( (__int64 *)(v222 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v164 = (unsigned int *)(v222 - 8);
do
v165 = __ldaxr(v164);
while ( __stlxr(v165 - 1, v164) );
}
else
{
v165 = *(_DWORD *)(v222 - 8);
*(_DWORD *)(v222 - 8) = v165 - 1;
}
if ( v165 <= 0 )
operator delete(v122);
}
v123 = (void *)(v221 - 24);
if ( (__int64 *)(v221 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v162 = (unsigned int *)(v221 - 8);
do
v163 = __ldaxr(v162);
while ( __stlxr(v163 - 1, v162) );
}
else
{
v163 = *(_DWORD *)(v221 - 8);
*(_DWORD *)(v221 - 8) = v163 - 1;
}
if ( v163 <= 0 )
operator delete(v123);
}
v124 = v220 - 6;
if ( v220 - 6 != (unsigned int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v160 = v220 - 2;
do
v161 = __ldaxr(v160);
while ( __stlxr(v161 - 1, v160) );
}
else
{
v161 = *(v220 - 2);
*(v220 - 2) = v161 - 1;
}
if ( v161 <= 0 )
operator delete(v124);
}
v125 = (void *)(v219 - 24);
if ( (__int64 *)(v219 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v158 = (unsigned int *)(v219 - 8);
do
v159 = __ldaxr(v158);
while ( __stlxr(v159 - 1, v158) );
}
else
{
v159 = *(_DWORD *)(v219 - 8);
*(_DWORD *)(v219 - 8) = v159 - 1;
}
if ( v159 <= 0 )
operator delete(v125);
}
v126 = (void *)(v218 - 24);
if ( (__int64 *)(v218 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v127 = (unsigned int *)(v218 - 8);
do
v128 = __ldaxr(v127);
while ( __stlxr(v128 - 1, v127) );
}
else
{
v128 = *(_DWORD *)(v218 - 8);
*(_DWORD *)(v218 - 8) = v128 - 1;
}
if ( v128 <= 0 )
operator delete(v126);
}
LABEL_48:
v34 = v242;
}
}
p = nullptr;
v246 = nullptr;
v247 = 0;
sub_830154((_QWORD *)v233 + 3, ";", (__int64)&p);
v45 = (__int64 *)p;
v46 = v246;
v47 = (__int64 *)p;
if ( !(((char *)v246 - (_BYTE *)p) >> 3) )
{
LABEL_81:
if ( v46 != v45 )
{
do
{
v75 = *v47;
v76 = (__int64 *)(*v47 - 24);
if ( v76 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v73 = (unsigned int *)(v75 - 8);
do
v74 = __ldaxr(v73);
while ( __stlxr(v74 - 1, v73) );
}
else
{
v74 = *(_DWORD *)(v75 - 8);
*(_DWORD *)(v75 - 8) = v74 - 1;
}
if ( v74 <= 0 )
operator delete(v76);
}
++v47;
}
while ( v46 != v47 );
}
if ( p )
operator delete(p);
v67 = (__int64 *)v242;
v68 = (__int64 *)v243;
if ( v242 != v243 )
{
do
{
v69 = *v67;
v70 = (__int64 *)(*v67 - 24);
if ( v70 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v71 = (unsigned int *)(v69 - 8);
do
v72 = __ldaxr(v71);
while ( __stlxr(v72 - 1, v71) );
}
else
{
v72 = *(_DWORD *)(v69 - 8);
*(_DWORD *)(v69 - 8) = v72 - 1;
}
if ( v72 <= 0 )
operator delete(v70);
}
++v67;
}
while ( v68 != v67 );
v68 = (__int64 *)v242;
}
if ( v68 )
operator delete(v68);
v77 = (__int64 *)v239;
v78 = (__int64 *)v240;
if ( v239 != v240 )
{
do
{
v79 = *v77;
v80 = (__int64 *)(*v77 - 24);
if ( v80 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v81 = (unsigned int *)(v79 - 8);
do
v82 = __ldaxr(v81);
while ( __stlxr(v82 - 1, v81) );
}
else
{
v82 = *(_DWORD *)(v79 - 8);
*(_DWORD *)(v79 - 8) = v82 - 1;
}
if ( v82 <= 0 )
operator delete(v80);
}
++v77;
}
while ( v78 != v77 );
v78 = (__int64 *)v239;
}
if ( v78 )
operator delete(v78);
v83 = (__int64 *)v236;
v84 = (__int64 *)v237;
if ( v236 != v237 )
{
do
{
v85 = *v83;
v86 = (__int64 *)(*v83 - 24);
if ( v86 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v87 = (unsigned int *)(v85 - 8);
do
v88 = __ldaxr(v87);
while ( __stlxr(v88 - 1, v87) );
}
else
{
v88 = *(_DWORD *)(v85 - 8);
*(_DWORD *)(v85 - 8) = v88 - 1;
}
if ( v88 <= 0 )
operator delete(v86);
}
++v83;
}
while ( v84 != v83 );
v84 = (__int64 *)v236;
}
if ( v84 )
operator delete(v84);
v89 = (__int64 *)v233;
v90 = (__int64 *)v234;
if ( v233 != v234 )
{
do
{
v91 = *v89;
v92 = (__int64 *)(*v89 - 24);
if ( v92 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v93 = (unsigned int *)(v91 - 8);
do
v94 = __ldaxr(v93);
while ( __stlxr(v94 - 1, v93) );
}
else
{
v94 = *(_DWORD *)(v91 - 8);
*(_DWORD *)(v91 - 8) = v94 - 1;
}
if ( v94 <= 0 )
operator delete(v92);
}
++v89;
}
while ( v90 != v89 );
v90 = (__int64 *)v233;
}
if ( v90 )
operator delete(v90);
v95 = v217 - 24;
if ( v217 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v199 = (unsigned int *)(v217 - 8);
do
v200 = __ldaxr(v199);
while ( __stlxr(v200 - 1, v199) );
}
else
{
v200 = *((_DWORD *)v217 - 2);
*((_DWORD *)v217 - 2) = v200 - 1;
}
if ( v200 <= 0 )
operator delete(v95);
}
v7 = (void *)(v215 - 24);
if ( (__int64 *)(v215 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v96 = (unsigned int *)(v215 - 8);
do
v97 = __ldaxr(v96);
while ( __stlxr(v97 - 1, v96) );
}
else
{
v97 = *(_DWORD *)(v215 - 8);
*(_DWORD *)(v215 - 8) = v97 - 1;
}
if ( v97 <= 0 )
goto LABEL_146;
}
return;
}
v48 = 0;
while ( 1 )
{
v49 = v236;
v50 = (__int64 *)v237;
v51 = (__int64 *)v236;
if ( v236 != v237 )
{
do
{
while ( 1 )
{
v52 = *v51;
v53 = (__int64 *)(*v51 - 24);
if ( v53 != &qword_124B6B0 )
{
if ( &pthread_create )
{
v54 = (unsigned int *)(v52 - 8);
do
v55 = __ldaxr(v54);
while ( __stlxr(v55 - 1, v54) );
}
else
{
v55 = *(_DWORD *)(v52 - 8);
*(_DWORD *)(v52 - 8) = v55 - 1;
}
if ( v55 <= 0 )
break;
}
if ( v50 == ++v51 )
goto LABEL_60;
}
++v51;
operator delete(v53);
}
while ( v50 != v51 );
LABEL_60:
v45 = (__int64 *)p;
}
v237 = v49;
sub_830154(&v45[v48], &byte_F804F8, (__int64)&v236);
v56 = v236;
if ( (unsigned __int64)((_BYTE *)v237 - (_BYTE *)v236) <= 0xF )
goto LABEL_80;
v57 = atoi(*(const char **)v236);
sub_D153B8((int)&v232, *(char **)&byte_8[(_QWORD)v56]);
insert_unique_pos = (__int64)&a1->m_musicTags.m_header;
v59 = a1->m_musicTags.m_header.m_parent;
if ( !v59 )
break;
do
{
while ( v57 <= *(_DWORD *)&v59[1].m_isblack )
{
insert_unique_pos = (__int64)v59;
v59 = v59->m_left;
if ( !v59 )
goto LABEL_65;
}
v59 = v59->m_right;
}
while ( v59 );
LABEL_65:
if ( p_m_header == (std::_rb_tree_base *)insert_unique_pos || v57 < *(_DWORD *)(insert_unique_pos + 32) )
break;
LABEL_79:
sub_D18EA8(insert_unique_pos + 40, &v232);
v66 = (void *)(v232 - 24);
if ( (__int64 *)(v232 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v145 = (unsigned int *)(v232 - 8);
do
v146 = __ldaxr(v145);
while ( __stlxr(v146 - 1, v145) );
}
else
{
v146 = *(_DWORD *)(v232 - 8);
*(_DWORD *)(v232 - 8) = v146 - 1;
}
if ( v146 <= 0 )
operator delete(v66);
}
LABEL_80:
v45 = (__int64 *)p;
++v48;
v46 = v246;
v47 = (__int64 *)p;
if ( v48 >= ((char *)v246 - (_BYTE *)p) >> 3 )
goto LABEL_81;
}
v60 = operator new(0x30u);
v61 = (int *)(v60 + 32);
*(_DWORD *)(v60 + 32) = v57;
v62 = &byte_124B6C8;
*(_QWORD *)(v60 + 40) = &byte_124B6C8;
if ( (std::_rb_tree_base *)insert_unique_pos == p_m_header )
{
if ( !a1->m_musicTags.m_nodecount )
goto LABEL_227;
v64 = a1->m_musicTags.m_header.m_right;
if ( v57 <= *(_DWORD *)&v64[1].m_isblack )
goto LABEL_227;
insert_unique_pos = 0;
}
else
{
v63 = *(_DWORD *)(insert_unique_pos + 32);
if ( v57 >= v63 )
{
if ( v57 <= v63 )
goto LABEL_209;
if ( (std::_rb_tree_base *)insert_unique_pos == a1->m_musicTags.m_header.m_right )
goto LABEL_351;
v212 = *(_DWORD *)(insert_unique_pos + 32);
v64 = (std::_rb_tree_base *)sub_CFAB14(insert_unique_pos);
v61 = (int *)(v60 + 32);
if ( v57 >= *(_DWORD *)&v64[1].m_isblack )
goto LABEL_227;
v63 = v212;
if ( !*(_QWORD *)(insert_unique_pos + 24) )
{
LABEL_351:
v64 = (std::_rb_tree_base *)insert_unique_pos;
goto LABEL_77;
}
insert_unique_pos = (__int64)v64;
}
else
{
v64 = a1->m_musicTags.m_header.m_left;
if ( (std::_rb_tree_base *)insert_unique_pos != v64 )
{
v64 = (std::_rb_tree_base *)sub_CFABD4(insert_unique_pos);
v61 = (int *)(v60 + 32);
if ( v57 > *(_DWORD *)&v64[1].m_isblack )
{
if ( v64->m_right )
v64 = (std::_rb_tree_base *)insert_unique_pos;
else
insert_unique_pos = 0;
goto LABEL_74;
}
LABEL_227:
insert_unique_pos = std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::_M_get_insert_unique_pos(
(__int64)p_m_musicTags,
v61);
v64 = v147;
if ( !v147 )
{
v62 = *(char **)(v60 + 40);
LABEL_209:
if ( v62 - 24 != (char *)&qword_124B6B0 )
{
v201 = (unsigned int *)(v62 - 8);
if ( &pthread_create )
{
do
v202 = __ldaxr(v201);
while ( __stlxr(v202 - 1, v201) );
}
else
{
v202 = *((_DWORD *)v62 - 2);
*((_DWORD *)v62 - 2) = v202 - 1;
}
if ( v202 <= 0 )
operator delete(v62 - 24);
}
operator delete((void *)v60);
goto LABEL_79;
}
}
}
}
LABEL_74:
if ( insert_unique_pos || p_m_header == v64 )
{
v65 = 1;
goto LABEL_78;
}
v57 = *(_DWORD *)(v60 + 32);
v63 = *(_DWORD *)&v64[1].m_isblack;
LABEL_77:
v65 = v57 < v63;
LABEL_78:
insert_unique_pos = v60;
sub_CFAD74(v65, v60, v64, p_m_header);
++a1->m_musicTags.m_nodecount;
goto LABEL_79;
}
}
LABEL_4:
v6 = v4 - 24;
if ( v4 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v195 = (unsigned int *)(v4 - 8);
do
v196 = __ldaxr(v195);
while ( __stlxr(v196 - 1, v195) );
}
else
{
v196 = *((_DWORD *)v4 - 2);
*((_DWORD *)v4 - 2) = v196 - 1;
}
if ( v196 <= 0 )
operator delete(v6);
}
v7 = (void *)(v215 - 24);
if ( (__int64 *)(v215 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v193 = (unsigned int *)(v215 - 8);
do
v194 = __ldaxr(v193);
while ( __stlxr(v194 - 1, v193) );
}
else
{
v194 = *(_DWORD *)(v215 - 8);
*(_DWORD *)(v215 - 8) = v194 - 1;
}
if ( v194 <= 0 )
LABEL_146:
operator delete(v7);
}
}