//
// SongInfoObject::create_2 from 0x10058c1e0 to 0x10058cf5a (3450 bytes)
//
// 2 xrefs:
// > GameLevelManager::onGetTopArtistsCompleted @ 0x10052a291
// > MusicDownloadManager::addSongObjectFromString @ 0x10058bcc0
//
// 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
//
SongInfoObject *__fastcall SongInfoObject::create_2(cocos2d::CCDictionary *a1)
{
std::string::size_type v1; // xmm0_8
cocos2d::CCString *v2; // rax
cocos2d::CCString *v3; // rax
const char *CString; // r14
size_t v5; // rax
size_t v6; // r15
char *v7; // r12
cocos2d::CCString *v8; // rax
const char *v9; // r14
size_t v10; // rax
size_t v11; // r15
char *v12; // r12
cocos2d::CCString *v13; // rax
int v14; // r14d
cocos2d::CCString *v15; // rax
cocos2d::CCString *v16; // rax
const char *v17; // r14
size_t v18; // rax
size_t v19; // r12
char *v20; // r13
cocos2d::CCString *v21; // rax
const char *v22; // r14
size_t v23; // rax
size_t v24; // r12
char *v25; // r13
cocos2d::CCString *v26; // rax
const char *v27; // r14
size_t v28; // rax
std::string::size_type v29; // r12
char *data; // r13
cocos2d::CCString *v31; // rax
const char *v32; // r14
size_t v33; // rax
std::string::size_type v34; // r12
char *v35; // r13
size_t v36; // r13
size_t v37; // r13
size_t v38; // r15
size_t v39; // r15
size_t v40; // r15
size_t v41; // r15
cocos2d::CCString *v42; // rax
cocos2d::CCString *v43; // rax
const char *v44; // r14
size_t v45; // rax
size_t v46; // r13
char *v47; // r15
cocos2d::CCString *v48; // rax
char v49; // r13
cocos2d::CCString *v50; // rax
int v51; // r14d
size_t v52; // r12
double v53; // xmm0_8
__int64 v54; // r14
cocos2d::CCString *v55; // rax
const char *v56; // rbx
size_t v57; // rax
std::string::size_type v58; // r15
char *v59; // r12
size_t v60; // r13
__int128 v62; // [rsp+40h] [rbp-200h] BYREF
void *v63; // [rsp+50h] [rbp-1F0h]
__int128 v64; // [rsp+60h] [rbp-1E0h] BYREF
void *v65; // [rsp+70h] [rbp-1D0h]
__int128 v66; // [rsp+80h] [rbp-1C0h] BYREF
void *v67; // [rsp+90h] [rbp-1B0h]
__int128 v68; // [rsp+A0h] [rbp-1A0h] BYREF
void *v69; // [rsp+B0h] [rbp-190h]
__int128 v70; // [rsp+C0h] [rbp-180h] BYREF
void *v71; // [rsp+D0h] [rbp-170h]
__int128 v72; // [rsp+E0h] [rbp-160h] BYREF
void *v73; // [rsp+F0h] [rbp-150h]
__int128 v74; // [rsp+100h] [rbp-140h] BYREF
void *v75; // [rsp+110h] [rbp-130h]
std::string __str; // [rsp+120h] [rbp-120h] BYREF
int v77; // [rsp+138h] [rbp-108h]
unsigned int v78; // [rsp+13Ch] [rbp-104h]
int v79; // [rsp+140h] [rbp-100h]
int v80; // [rsp+144h] [rbp-FCh]
__int128 __dst; // [rsp+148h] [rbp-F8h] BYREF
void *__p; // [rsp+158h] [rbp-E8h]
__int128 v83; // [rsp+160h] [rbp-E0h] BYREF
void *v84; // [rsp+170h] [rbp-D0h]
__int128 v85; // [rsp+178h] [rbp-C8h] BYREF
void *v86; // [rsp+188h] [rbp-B8h]
std::string v87; // [rsp+190h] [rbp-B0h] BYREF
std::string v88; // [rsp+1B0h] [rbp-90h] BYREF
char v89; // [rsp+1D0h] [rbp-70h] BYREF
char v90[15]; // [rsp+1D1h] [rbp-6Fh] BYREF
void *v91; // [rsp+1E0h] [rbp-60h]
__int128 v92; // [rsp+1E8h] [rbp-58h] BYREF
void *v93; // [rsp+1F8h] [rbp-48h]
__int128 v94; // [rsp+200h] [rbp-40h] BYREF
void *v95; // [rsp+210h] [rbp-30h]
LOWORD(__dst) = 12546;
BYTE2(__dst) = 0;
v2 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&__dst);
v77 = cocos2d::CCString::intValue(v2);
if ( (__dst & 1) != 0 )
operator delete(__p);
LOWORD(v83) = 12802;
BYTE2(v83) = 0;
v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v83);
CString = cocos2d::CCString::getCString(v3);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v6 = v5;
if ( v5 >= 0x17 )
{
v36 = 26;
if ( (v5 | 7) != 0x17 )
v36 = (v5 | 7) + 1;
v7 = (char *)operator new(v36);
__p = v7;
*(_QWORD *)&__dst = v36 | 1;
*((_QWORD *)&__dst + 1) = v6;
}
else
{
LOBYTE(__dst) = 2 * v5;
v7 = (char *)&__dst + 1;
if ( !v5 )
{
BYTE1(__dst) = 0;
if ( (v83 & 1) == 0 )
goto LABEL_8;
goto LABEL_7;
}
}
memmove(v7, CString, v6);
v7[v6] = 0;
if ( (v83 & 1) != 0 )
LABEL_7:
operator delete(v84);
LABEL_8:
LOWORD(v92) = 13314;
BYTE2(v92) = 0;
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v92);
v9 = cocos2d::CCString::getCString(v8);
v10 = strlen(v9);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v11 = v10;
if ( v10 >= 0x17 )
{
v37 = 26;
if ( (v10 | 7) != 0x17 )
v37 = (v10 | 7) + 1;
v12 = (char *)operator new(v37);
v84 = v12;
*(_QWORD *)&v83 = v37 | 1;
*((_QWORD *)&v83 + 1) = v11;
}
else
{
LOBYTE(v83) = 2 * v10;
v12 = (char *)&v83 + 1;
if ( !v10 )
{
BYTE1(v83) = 0;
if ( (v92 & 1) == 0 )
goto LABEL_13;
goto LABEL_12;
}
}
memmove(v12, v9, v11);
v12[v11] = 0;
if ( (v92 & 1) != 0 )
LABEL_12:
operator delete(v93);
LABEL_13:
LOWORD(v92) = 13058;
BYTE2(v92) = 0;
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v92);
v14 = cocos2d::CCString::intValue(v13);
if ( (v92 & 1) != 0 )
operator delete(v93);
LOWORD(v92) = 13570;
BYTE2(v92) = 0;
v15 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v92);
*(float *)&v1 = cocos2d::CCString::floatValue(v15);
v78 = v1;
v79 = v14;
if ( (v92 & 1) != 0 )
operator delete(v93);
LOWORD(v85) = 13826;
BYTE2(v85) = 0;
v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v85);
v17 = cocos2d::CCString::getCString(v16);
v18 = strlen(v17);
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v19 = v18;
if ( v18 >= 0x17 )
{
v38 = 26;
if ( (v18 | 7) != 0x17 )
v38 = (v18 | 7) + 1;
v20 = (char *)operator new(v38);
v93 = v20;
*(_QWORD *)&v92 = v38 | 1;
*((_QWORD *)&v92 + 1) = v19;
}
else
{
LOBYTE(v92) = 2 * v18;
v20 = (char *)&v92 + 1;
if ( !v18 )
{
BYTE1(v92) = 0;
if ( (v85 & 1) == 0 )
goto LABEL_22;
goto LABEL_21;
}
}
memmove(v20, v17, v19);
v20[v19] = 0;
if ( (v85 & 1) != 0 )
LABEL_21:
operator delete(v86);
LABEL_22:
*(_WORD *)&v87.__r_.__value_.__l.0 = 14082;
v87.__r_.__value_.__s.__data_[1] = 0;
v21 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v87);
v22 = cocos2d::CCString::getCString(v21);
v23 = strlen(v22);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v24 = v23;
if ( v23 >= 0x17 )
{
v39 = 26;
if ( (v23 | 7) != 0x17 )
v39 = (v23 | 7) + 1;
v25 = (char *)operator new(v39);
v86 = v25;
*(_QWORD *)&v85 = v39 | 1;
*((_QWORD *)&v85 + 1) = v24;
}
else
{
LOBYTE(v85) = 2 * v23;
v25 = (char *)&v85 + 1;
if ( !v23 )
{
BYTE1(v85) = 0;
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_27;
goto LABEL_26;
}
}
memmove(v25, v22, v24);
v25[v24] = 0;
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) != 0 )
LABEL_26:
operator delete(v87.__r_.__value_.__l.__data_);
LABEL_27:
v88.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)4;
strcpy(v88.__r_.__value_.__s.__data_, "10");
v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v88);
v27 = cocos2d::CCString::getCString(v26);
v28 = strlen(v27);
if ( v28 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v29 = v28;
if ( v28 >= 0x17 )
{
v40 = 26;
if ( (v28 | 7) != 0x17 )
v40 = (v28 | 7) + 1;
data = (char *)operator new(v40);
v87.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
v87.__r_.__value_.__r.__words[0] = v40 | 1;
v87.__r_.__value_.__l.__size_ = v29;
}
else
{
v87.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v28);
data = v87.__r_.__value_.__s.__data_;
if ( !v28 )
{
v87.__r_.__value_.__s.__data_[0] = 0;
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_32;
goto LABEL_31;
}
}
memmove(data, v27, v29);
data[v29] = 0;
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) != 0 )
LABEL_31:
operator delete(v88.__r_.__value_.__l.__data_);
LABEL_32:
LOBYTE(v94) = 4;
*(_WORD *)((char *)&v94 + 1) = 13873;
BYTE3(v94) = 0;
v31 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v94);
v32 = cocos2d::CCString::getCString(v31);
v33 = strlen(v32);
if ( v33 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v34 = v33;
if ( v33 >= 0x17 )
{
v41 = 26;
if ( (v33 | 7) != 0x17 )
v41 = (v33 | 7) + 1;
v35 = (char *)operator new(v41);
v88.__r_.__value_.__r.__words[2] = (std::string::size_type)v35;
v88.__r_.__value_.__r.__words[0] = v41 | 1;
v88.__r_.__value_.__l.__size_ = v34;
}
else
{
v88.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v33);
v35 = v88.__r_.__value_.__s.__data_;
if ( !v33 )
{
v88.__r_.__value_.__s.__data_[0] = 0;
if ( (v94 & 1) == 0 )
goto LABEL_37;
goto LABEL_36;
}
}
memmove(v35, v32, v34);
v35[v34] = 0;
if ( (v94 & 1) != 0 )
LABEL_36:
operator delete(v95);
LABEL_37:
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) == 0 )
{
if ( *(_BYTE *)&v87.__r_.__value_.__l.0 >> 1 > 1uLL )
goto LABEL_39;
LABEL_73:
std::string::assign(&v87, "");
goto LABEL_74;
}
if ( v87.__r_.__value_.__l.__size_ <= 1 )
goto LABEL_73;
LABEL_39:
cocos2d::ZipUtils::urlDecode(&v94, &v87, *(double *)&v1);
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v87.__r_.__value_.__l.__data_);
v87.__r_.__value_.__r.__words[2] = (std::string::size_type)v95;
v1 = v94;
*(_OWORD *)&v87.__r_.__value_.__l.0 = v94;
LABEL_74:
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) == 0 )
{
if ( *(_BYTE *)&v88.__r_.__value_.__l.0 >> 1 > 1uLL )
goto LABEL_76;
LABEL_80:
std::string::assign(&v88, "");
goto LABEL_81;
}
if ( v88.__r_.__value_.__l.__size_ <= 1 )
goto LABEL_80;
LABEL_76:
cocos2d::ZipUtils::urlDecode(&v94, &v88, *(double *)&v1);
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v88.__r_.__value_.__l.__data_);
v88.__r_.__value_.__r.__words[2] = (std::string::size_type)v95;
v1 = v94;
*(_OWORD *)&v88.__r_.__value_.__l.0 = v94;
LABEL_81:
LOBYTE(v94) = 4;
*(_WORD *)((char *)&v94 + 1) = 12593;
BYTE3(v94) = 0;
v42 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v94);
v80 = cocos2d::CCString::intValue(v42);
if ( (v94 & 1) != 0 )
operator delete(v95);
v89 = 4;
strcpy(v90, "12");
v43 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v89);
v44 = cocos2d::CCString::getCString(v43);
v45 = strlen(v44);
if ( v45 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v1);
v46 = v45;
if ( v45 >= 0x17 )
{
v52 = 26;
if ( (v45 | 7) != 0x17 )
v52 = (v45 | 7) + 1;
v47 = (char *)operator new(v52);
v95 = v47;
*(_QWORD *)&v94 = v52 | 1;
*((_QWORD *)&v94 + 1) = v46;
}
else
{
LOBYTE(v94) = 2 * v45;
v47 = (char *)&v94 + 1;
if ( !v45 )
{
BYTE1(v94) = 0;
if ( (v89 & 1) == 0 )
goto LABEL_88;
goto LABEL_87;
}
}
memmove(v47, v44, v46);
v47[v46] = 0;
if ( (v89 & 1) != 0 )
LABEL_87:
operator delete(v91);
LABEL_88:
v89 = 4;
strcpy(v90, "13");
v48 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v89);
v49 = cocos2d::CCString::boolValue(v48);
if ( (v89 & 1) != 0 )
operator delete(v91);
v89 = 4;
strcpy(v90, "14");
v50 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v89);
v51 = cocos2d::CCString::intValue(v50);
if ( (v89 & 1) != 0 )
operator delete(v91);
if ( (__dst & 1) != 0 )
{
sub_100006B70(&v62, __p, *((unsigned __int64 *)&__dst + 1), *(double *)&v1);
}
else
{
v63 = __p;
v1 = __dst;
v62 = __dst;
}
if ( (v83 & 1) != 0 )
{
sub_100006B70(&v64, v84, *((unsigned __int64 *)&v83 + 1), *(double *)&v1);
}
else
{
v65 = v84;
v1 = v83;
v64 = v83;
}
if ( (v92 & 1) != 0 )
{
sub_100006B70(&v66, v93, *((unsigned __int64 *)&v92 + 1), *(double *)&v1);
}
else
{
v67 = v93;
v1 = v92;
v66 = v92;
}
if ( (v85 & 1) != 0 )
{
sub_100006B70(&v68, v86, *((unsigned __int64 *)&v85 + 1), *(double *)&v1);
}
else
{
v69 = v86;
v1 = v85;
v68 = v85;
}
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v70, v87.__r_.__value_.__l.__data_, v87.__r_.__value_.__l.__size_, *(double *)&v1);
}
else
{
v71 = v87.__r_.__value_.__l.__data_;
v1 = v87.__r_.__value_.__r.__words[0];
v70 = *(_OWORD *)&v87.__r_.__value_.__l.0;
}
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) != 0 )
{
sub_100006B70(&v72, v88.__r_.__value_.__l.__data_, v88.__r_.__value_.__l.__size_, *(double *)&v1);
}
else
{
v73 = v88.__r_.__value_.__l.__data_;
v1 = v88.__r_.__value_.__r.__words[0];
v72 = *(_OWORD *)&v88.__r_.__value_.__l.0;
}
if ( (v94 & 1) != 0 )
{
sub_100006B70(&v74, v95, *((unsigned __int64 *)&v94 + 1), *(double *)&v1);
}
else
{
v75 = v95;
v74 = v94;
}
*(_QWORD *)&v53 = v78;
v54 = SongInfoObject::create(
v77,
(unsigned int)&v62,
(unsigned int)&v64,
v79,
(unsigned int)&v66,
(unsigned int)&v68,
(__int64)&v70,
(__int64)&v72,
v80,
(__int64)&v74,
v49,
v51,
-1);
if ( (v74 & 1) != 0 )
{
operator delete(v75);
if ( (v72 & 1) == 0 )
{
LABEL_120:
if ( (v70 & 1) == 0 )
goto LABEL_121;
goto LABEL_132;
}
}
else if ( (v72 & 1) == 0 )
{
goto LABEL_120;
}
operator delete(v73);
if ( (v70 & 1) == 0 )
{
LABEL_121:
if ( (v68 & 1) == 0 )
goto LABEL_122;
goto LABEL_133;
}
LABEL_132:
operator delete(v71);
if ( (v68 & 1) == 0 )
{
LABEL_122:
if ( (v66 & 1) == 0 )
goto LABEL_123;
goto LABEL_134;
}
LABEL_133:
operator delete(v69);
if ( (v66 & 1) == 0 )
{
LABEL_123:
if ( (v64 & 1) == 0 )
goto LABEL_124;
goto LABEL_135;
}
LABEL_134:
operator delete(v67);
if ( (v64 & 1) == 0 )
{
LABEL_124:
if ( (v62 & 1) == 0 )
goto LABEL_126;
goto LABEL_125;
}
LABEL_135:
operator delete(v65);
if ( (v62 & 1) != 0 )
LABEL_125:
operator delete(v63);
LABEL_126:
v89 = 4;
strcpy(v90, "15");
v55 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)a1, (__int64)&v89);
v56 = cocos2d::CCString::getCString(v55);
v57 = strlen(v56);
if ( v57 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v53);
v58 = v57;
if ( v57 >= 0x17 )
{
v60 = 26;
if ( (v57 | 7) != 0x17 )
v60 = (v57 | 7) + 1;
v59 = (char *)operator new(v60);
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)v59;
__str.__r_.__value_.__r.__words[0] = v60 | 1;
__str.__r_.__value_.__l.__size_ = v58;
goto LABEL_140;
}
__str.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v57);
v59 = __str.__r_.__value_.__s.__data_;
if ( v57 )
LABEL_140:
memmove(v59, v56, v58);
v59[v58] = 0;
std::string::operator=((std::string *)(v54 + 536), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(__str.__r_.__value_.__l.__data_);
if ( (v89 & 1) == 0 )
{
LABEL_143:
if ( (v94 & 1) == 0 )
goto LABEL_144;
goto LABEL_154;
}
}
else if ( (v89 & 1) == 0 )
{
goto LABEL_143;
}
operator delete(v91);
if ( (v94 & 1) == 0 )
{
LABEL_144:
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_145;
goto LABEL_155;
}
LABEL_154:
operator delete(v95);
if ( (*(_BYTE *)&v88.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_145:
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_146;
goto LABEL_156;
}
LABEL_155:
operator delete(v88.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v87.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_146:
if ( (v85 & 1) == 0 )
goto LABEL_147;
goto LABEL_157;
}
LABEL_156:
operator delete(v87.__r_.__value_.__l.__data_);
if ( (v85 & 1) == 0 )
{
LABEL_147:
if ( (v92 & 1) == 0 )
goto LABEL_148;
goto LABEL_158;
}
LABEL_157:
operator delete(v86);
if ( (v92 & 1) == 0 )
{
LABEL_148:
if ( (v83 & 1) == 0 )
goto LABEL_149;
LABEL_159:
operator delete(v84);
if ( (__dst & 1) == 0 )
return (SongInfoObject *)v54;
goto LABEL_150;
}
LABEL_158:
operator delete(v93);
if ( (v83 & 1) != 0 )
goto LABEL_159;
LABEL_149:
if ( (__dst & 1) != 0 )
LABEL_150:
operator delete(__p);
return (SongInfoObject *)v54;
}