//
// MusicChangelogPopup::buildContent from 0xb895b4 to 0xb8a1dc (3112 bytes)
//
// 2 xrefs:
// > ??> @ 0xde3b8
// > ??> @ 0x14d5bc0
//
// 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 13:02:33 +0000
//
__int64 __fastcall MusicChangelogPopup::buildContent(cocos2d::CCArray **this, cocos2d::CCNode *a2, float a3, float a4)
{
float v5; // s8
__int64 v6; // x0
__int64 v7; // x19
const char *v8; // x2
cocos2d::CCArray *v9; // x0
float v10; // s0
float v11; // s8
int v12; // w0
signed int v13; // w28
__int64 v14; // x25
__int64 v15; // x1
cocos2d::CCString *v16; // x0
char *CString; // x0
_BYTE *v18; // x22
int v19; // w2
__int64 v20; // x19
_BYTE *v21; // x0
__int64 v22; // x26
__int64 v23; // x21
unsigned __int64 v24; // x20
size_t v25; // x3
unsigned __int64 v26; // x2
__int64 v27; // x1
size_t v28; // x2
void *v29; // x1
int v30; // w1
size_t v31; // x2
__int64 *v32; // x0
size_t v33; // x3
__int64 v34; // x2
unsigned __int64 v35; // x0
_BYTE *v36; // x3
_BYTE *v37; // x0
__int64 *v38; // x21
__int64 *v39; // x3
__int64 v40; // x20
unsigned __int64 v41; // x22
MusicDownloadManager *v42; // x0
__int64 v43; // x1
__int64 *i; // x0
size_t v45; // x20
MusicDownloadManager *v46; // x0
MusicDownloadManager *v47; // x0
__int64 *MusicArtistForID; // x0
const void *v49; // x7
size_t v50; // x6
unsigned __int64 v51; // x1
char *v52; // x3
const char *v53; // x2
cocos2d::CCLabelBMFont *v54; // x0
cocos2d::CCLabelBMFont *v55; // x20
void (__fastcall *v56)(cocos2d::CCLabelBMFont *, void **); // x22
void (__fastcall *v57)(cocos2d::CCLabelBMFont *, void **); // x22
const char *v58; // x2
float v59; // s9
cocos2d::CCLabelBMFont *v60; // x0
cocos2d::CCLabelBMFont *v61; // x20
void (__fastcall *v62)(cocos2d::CCLabelBMFont *, void **); // x3
void (__fastcall *v63)(cocos2d::CCLabelBMFont *, void **); // x21
void (__fastcall *v64)(cocos2d::CCLabelBMFont *, void **); // x21
__int64 v66; // x26
const char *v67; // x0
MusicDownloadManager *v68; // x0
__int64 v69; // x1
__int64 v70; // x21
size_t v71; // x1
void *v72; // x1
size_t v73; // x2
unsigned __int64 v74; // x0
char *v75; // x0
char *v76; // x1
__int64 v77; // x0
size_t v78; // x3
char *v79; // x1
size_t v80; // x2
__int64 v81; // x19
_BYTE *v82; // x21
std::logic_error *exception; // x20
__int64 v84; // x3
void *v85; // x0
__int64 v86; // x20
void (__fastcall *v87)(__int64, void **); // x3
void (__fastcall *v88)(__int64, void **); // x21
void (__fastcall *v89)(__int64, void **); // x21
unsigned int v92; // [xsp+B4h] [xbp+B4h]
__int64 v93; // [xsp+C0h] [xbp+C0h]
int v94; // [xsp+C8h] [xbp+C8h]
signed int v95; // [xsp+CCh] [xbp+CCh]
char *v96; // [xsp+D0h] [xbp+D0h]
__int64 v97; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v98; // [xsp+E8h] [xbp+E8h]
void *v99; // [xsp+F0h] [xbp+F0h]
unsigned __int64 v100; // [xsp+F8h] [xbp+F8h] BYREF
__int64 v101; // [xsp+100h] [xbp+100h]
void *v102; // [xsp+108h] [xbp+108h]
__int64 v103; // [xsp+110h] [xbp+110h] BYREF
size_t v104; // [xsp+118h] [xbp+118h]
void *v105; // [xsp+120h] [xbp+120h]
void *v106; // [xsp+128h] [xbp+128h] BYREF
__int64 *v107; // [xsp+130h] [xbp+130h]
__int64 *v108; // [xsp+138h] [xbp+138h]
__int64 v109; // [xsp+140h] [xbp+140h] BYREF
size_t v110; // [xsp+148h] [xbp+148h]
void *v111; // [xsp+150h] [xbp+150h]
v5 = 0.0;
v92 = 0;
if ( !(unsigned int)cocos2d::CCArray::count(*(this + 83)) )
return _stack_chk_guard;
do
{
v6 = cocos2d::CCArray::objectAtIndex(*(this + 83), v92);
v93 = v6;
v7 = v6;
if ( !v6 )
goto LABEL_87;
ScrollViewPopup::addVersionHeader(
(ScrollViewPopup *)this,
a2,
(char *)*(unsigned int *)(v6 + 56),
*(_DWORD *)(v6 + 60),
v5,
a3);
v9 = *(cocos2d::CCArray **)(v7 + 72);
v11 = v5 - v10;
if ( !v9 || (v12 = cocos2d::CCArray::count(v9), (v95 = v12) == 0) )
{
v86 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"(no new songs)", "chatFont.fnt", v8);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v86 + 160LL))(v86, 0.55);
v87 = *(void (__fastcall **)(__int64, void **))(*(_QWORD *)v86 + 1072LL);
LOWORD(v106) = -26986;
BYTE2(v106) = -106;
v87(v86, &v106);
v88 = *(void (__fastcall **)(__int64, void **))(*(_QWORD *)v86 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 0.0, 0.5);
v88(v86, &v106);
v89 = *(void (__fastcall **)(__int64, void **))(*(_QWORD *)v86 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 22.0, v11 - 7.0);
v89(v86, &v106);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)a2 + 456LL))(a2, v86);
v11 = v11 - 14.0;
goto LABEL_86;
}
if ( v12 <= 0 )
goto LABEL_86;
v13 = 0;
do
{
v94 = *(_DWORD *)(cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v93 + 72), v13) + 56);
v97 = 0;
v98 = 0;
v99 = nullptr;
if ( v95 <= v13 )
goto LABEL_68;
do
{
v14 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(v93 + 72), v13);
if ( *(_DWORD *)(v14 + 56) != v94 )
break;
v15 = (unsigned __int8)v97 >> 1;
if ( (v97 & 1) != 0 )
v15 = v98;
if ( v15 )
std::string::append((__int64)&v97, ", ");
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"+%i",
(const char *)*(unsigned int *)(v14 + 60));
CString = (char *)cocos2d::CCString::getCString(v16);
std::string::append((__int64)&v97, CString);
v103 = 0;
v104 = 0;
v18 = (_BYTE *)(v14 + 64);
v105 = nullptr;
v106 = nullptr;
v107 = nullptr;
v108 = nullptr;
v19 = *(unsigned __int8 *)(v14 + 64);
if ( (v19 & 1) != 0 )
{
v20 = *(_QWORD *)(v14 + 72);
v21 = *(_BYTE **)(v14 + 80);
if ( !v20 )
goto LABEL_15;
v81 = (__int64)&v21[v20];
v23 = -1;
if ( v21 != (_BYTE *)v81 )
{
LABEL_126:
v82 = v21;
if ( *v21 == 46 )
{
v23 = 0;
}
else
{
do
{
if ( (_BYTE *)v81 == ++v82 )
{
v23 = -1;
goto LABEL_131;
}
}
while ( *v82 != 46 );
v23 = v82 - v21;
}
LABEL_131:
LODWORD(v22) = v19 >> 1;
if ( (v19 & 1) == 0 )
{
v22 = (int)v22;
goto LABEL_16;
}
}
v22 = *(_QWORD *)(v14 + 72);
goto LABEL_16;
}
LODWORD(v22) = v19 >> 1;
if ( !(v19 >> 1) )
{
LABEL_15:
v22 = 0;
v23 = -1;
goto LABEL_16;
}
v21 = (_BYTE *)(v14 + 65);
v81 = v14 + 65 + (int)v22;
if ( v81 != v14 + 65 )
goto LABEL_126;
v23 = -1;
v22 = (int)v22;
LABEL_16:
v109 = 0;
v110 = 0;
v24 = 0;
v111 = nullptr;
v25 = v23;
if ( (v19 & 1) != 0 )
{
LABEL_17:
v26 = *(_QWORD *)(v14 + 72);
if ( v24 <= v26 )
{
v27 = *(_QWORD *)(v14 + 80);
goto LABEL_19;
}
LABEL_139:
exception = (std::logic_error *)_cxa_allocate_exception(0x10u);
std::logic_error::logic_error(exception, "basic_string");
*(_QWORD *)exception = off_1536D68;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::logic_error::~logic_error);
}
while ( 1 )
{
v26 = (unsigned __int8)v19 >> 1;
if ( v24 > v26 )
goto LABEL_139;
v27 = v14 + 65;
LABEL_19:
v28 = v26 - v24;
v29 = (void *)(v27 + v24);
if ( v28 > v25 )
v28 = v25;
std::string::__init(&v109, v29, v28);
v30 = v109 & 1;
v31 = (unsigned __int8)v109 >> 1;
if ( (v109 & 1) != 0 )
v31 = v110;
if ( !v31 && v24 == v22 )
goto LABEL_31;
v32 = v107;
if ( v107 == v108 )
break;
if ( v107 )
{
*v107 = 0;
v32[1] = 0;
v32[2] = 0;
if ( (v109 & 1) != 0 )
{
std::string::__init(v32, v111, v110);
}
else
{
v33 = v110;
*v32 = v109;
v32[1] = v33;
v32[2] = (__int64)v111;
}
v32 = v107;
v30 = v109 & 1;
}
v107 = v32 + 3;
LABEL_31:
if ( v23 == -1 )
goto LABEL_53;
LABEL_32:
v24 = v23 + 1;
if ( (*v18 & 1) != 0 )
{
v34 = *(_QWORD *)(v14 + 80);
v35 = *(_QWORD *)(v14 + 72);
}
else
{
v34 = v14 + 65;
v35 = *v18 >> 1;
}
v23 = -1;
if ( v24 >= v35 || (v36 = (_BYTE *)(v34 + v24), v37 = (_BYTE *)(v34 + v35), (_BYTE *)(v34 + v24) == v37) )
{
if ( v30 )
goto LABEL_40;
}
else if ( *(_BYTE *)(v34 + v24) == 46 )
{
LABEL_49:
v23 = (__int64)&v36[-v34];
if ( v30 )
goto LABEL_40;
}
else
{
while ( v37 != ++v36 )
{
if ( *v36 == 46 )
goto LABEL_49;
}
v23 = -1;
if ( v30 )
{
LABEL_40:
operator delete(v111);
LOBYTE(v19) = *v18;
goto LABEL_37;
}
}
LOBYTE(v19) = *v18;
LABEL_37:
v109 = 0;
v25 = v23 - v24;
v110 = 0;
v111 = nullptr;
if ( (v19 & 1) != 0 )
goto LABEL_17;
}
std::vector::__push_back_slow_path((__int64 *)&v106, &v109);
v30 = v109 & 1;
if ( v23 != -1 )
goto LABEL_32;
LABEL_53:
if ( v30 )
operator delete(v111);
v38 = (__int64 *)v106;
v39 = v107;
v40 = 0;
v41 = 0;
if ( 0xAAAAAAAAAAAAAAABLL * (((char *)v107 - (_BYTE *)v106) >> 3) )
{
do
{
v42 = (MusicDownloadManager *)LOBYTE(v38[v40]);
v43 = (unsigned __int8)v42 >> 1;
if ( ((unsigned __int8)v42 & 1) != 0 )
v43 = v38[v40 + 1];
if ( v43 )
{
v66 = MusicDownloadManager::sharedState(v42);
v67 = (char *)v106 + v40 * 8 + 1;
if ( (*((_BYTE *)v106 + v40 * 8) & 1) != 0 )
v67 = *(const char **)((char *)v106 + v40 * 8 + 16);
v68 = (MusicDownloadManager *)atoi(v67);
v69 = *(_QWORD *)(v66 + 472);
v70 = v66 + 472;
if ( v69 )
{
do
{
while ( (int)v68 <= *(_DWORD *)(v69 + 32) )
{
v70 = v69;
v69 = *(_QWORD *)v69;
if ( !v69 )
goto LABEL_94;
}
v69 = *(_QWORD *)(v69 + 8);
}
while ( v69 );
LABEL_94:
if ( v66 + 472 == v70 )
{
v70 = v66 + 472;
}
else if ( (int)v68 < *(_DWORD *)(v70 + 32) )
{
v70 = v66 + 472;
}
}
if ( v70 != MusicDownloadManager::sharedState(v68) + 472 )
{
v71 = (unsigned __int8)v103 >> 1;
if ( (v103 & 1) != 0 )
v71 = v104;
if ( v71 )
std::string::append((__int64)&v103, ", ");
if ( (*(_BYTE *)(v70 + 40) & 1) != 0 )
{
v72 = *(void **)(v70 + 56);
v73 = *(_QWORD *)(v70 + 48);
}
else
{
v72 = (void *)(v70 + 41);
v73 = *(_BYTE *)(v70 + 40) >> 1;
}
std::string::append((__int64)&v103, v72, v73);
}
v38 = (__int64 *)v106;
v39 = v107;
}
++v41;
v40 += 3;
}
while ( v41 < 0xAAAAAAAAAAAAAAABLL * (v39 - v38) );
}
if ( v38 )
{
for ( i = v107; v107 != v38; i = v107 )
{
v107 = i - 3;
std::string::~string((__int64)(i - 3));
}
operator delete(v106);
}
if ( (v103 & 1) != 0 )
{
v45 = v104;
if ( !v104 )
goto LABEL_66;
v74 = v104 + 2;
v100 = 0;
v101 = 0;
v102 = nullptr;
if ( v104 + 2 > 0xFFFFFFFFFFFFFFEFLL )
LABEL_138:
sub_62F43C();
LABEL_112:
if ( v74 > 0x16 )
{
v75 = (char *)operator new((v45 + 18) & 0xFFFFFFFFFFFFFFF0LL);
v102 = v75;
v100 = (v45 + 18) & 0xFFFFFFFFFFFFFFF0LL | 1;
v101 = 2;
}
else
{
LOBYTE(v100) = 4;
v75 = (char *)&v100 + 1;
}
strcpy(v75, " (");
v76 = (char *)&v103 + 1;
if ( (v103 & 1) != 0 )
v76 = (char *)v105;
std::string::append((__int64)&v100, v76, v45);
v77 = std::string::append((__int64)&v100, ")");
v78 = *(_QWORD *)(v77 + 8);
v109 = *(_QWORD *)v77;
v110 = v78;
v111 = *(void **)(v77 + 16);
*(_QWORD *)v77 = 0;
*(_QWORD *)(v77 + 8) = 0;
*(_QWORD *)(v77 + 16) = 0;
if ( (v109 & 1) != 0 )
{
v79 = (char *)v111;
v80 = v110;
}
else
{
v80 = (unsigned __int8)v109 >> 1;
v79 = (char *)&v109 + 1;
}
std::string::append((__int64)&v97, v79, v80);
if ( (v109 & 1) != 0 )
operator delete(v111);
if ( (v100 & 1) != 0 )
operator delete(v102);
if ( (v103 & 1) != 0 )
LABEL_66:
operator delete(v105);
}
else
{
LODWORD(v45) = (int)(unsigned __int8)v103 >> 1;
if ( (_DWORD)v45 )
{
v45 = (int)v45;
v100 = 0;
v74 = (int)v45 + 2LL;
v101 = 0;
v102 = nullptr;
if ( v74 > 0xFFFFFFFFFFFFFFEFLL )
goto LABEL_138;
goto LABEL_112;
}
}
++v13;
}
while ( v95 != v13 );
LABEL_68:
v103 = 0;
v104 = 0;
v105 = nullptr;
v46 = (MusicDownloadManager *)std::string::__init(&v103, "Unknown", 7u);
v47 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v46);
MusicArtistForID = (__int64 *)MusicDownloadManager::getMusicArtistForID(v47, v94);
if ( !MusicArtistForID || &v103 == MusicArtistForID + 8 )
goto LABEL_77;
if ( (MusicArtistForID[8] & 1) != 0 )
{
v49 = (const void *)MusicArtistForID[10];
v50 = MusicArtistForID[9];
}
else
{
v49 = (char *)MusicArtistForID + 65;
v50 = *((_BYTE *)MusicArtistForID + 64) >> 1;
}
if ( (v103 & 1) != 0 )
{
v51 = (v103 & 0xFFFFFFFFFFFFFFFELL) - 1;
if ( v50 <= v51 )
{
v52 = (char *)v105;
if ( !v50 )
goto LABEL_75;
LABEL_146:
v96 = (char *)v50;
v85 = memmove(v52, v49, v50);
v50 = (size_t)v96;
v96[(_QWORD)v85] = 0;
if ( (v103 & 1) == 0 )
goto LABEL_147;
LABEL_76:
v104 = v50;
goto LABEL_77;
}
v84 = v104;
LABEL_143:
std::string::__grow_by_and_replace((__int64)&v103, v51, v50 - v51, v84, 0, v84, v50, v49);
goto LABEL_77;
}
if ( v50 > 0x16 )
{
v84 = (unsigned __int8)v103 >> 1;
v51 = 22;
goto LABEL_143;
}
v52 = (char *)&v103 + 1;
if ( v50 )
goto LABEL_146;
LABEL_75:
v52[v50] = 0;
if ( (v103 & 1) != 0 )
goto LABEL_76;
LABEL_147:
LOBYTE(v103) = 2 * v50;
LABEL_77:
std::string::append((__int64)&v103, ":");
v54 = (cocos2d::CCLabelBMFont *)((char *)&v103 + 1);
if ( (v103 & 1) != 0 )
v54 = (cocos2d::CCLabelBMFont *)v105;
v55 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v54, "chatFont.fnt", v53);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, float))(*(_QWORD *)v55 + 160LL))(v55, 0.65);
cocos2d::CCLabelBMFont::limitLabelWidth(v55, (float)(a3 - 35.0) * 0.6, 0.65, 0.35);
v56 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v55 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 0.0, 0.5);
v56(v55, &v106);
v57 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v55 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 22.0, v11 - 8.0);
v57(v55, &v106);
(*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))(*(_QWORD *)a2 + 456LL))(a2, v55);
(*(void (__fastcall **)(void **__return_ptr, cocos2d::CCLabelBMFont *))(*(_QWORD *)v55 + 336LL))(&v106, v55);
v59 = *(float *)&v106;
v60 = (cocos2d::CCLabelBMFont *)((char *)&v97 + 1);
if ( (v97 & 1) != 0 )
v60 = (cocos2d::CCLabelBMFont *)v99;
v61 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v60, "chatFont.fnt", v58);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, float))(*(_QWORD *)v61 + 160LL))(v61, 0.6);
v62 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v61 + 1072LL);
LOWORD(v106) = -19276;
BYTE2(v106) = -76;
v62(v61, &v106);
cocos2d::CCLabelBMFont::limitLabelWidth(v61, (float)(a3 - 41.0) - v59, 0.6, 0.25);
v63 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v61 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 0.0, 0.5);
v63(v61, &v106);
v64 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v61 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, (float)(v59 + 22.0) + 6.0, v11 - 8.0);
v64(v61, &v106);
(*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))(*(_QWORD *)a2 + 456LL))(a2, v61);
v11 = v11 - 16.0;
if ( (v103 & 1) != 0 )
operator delete(v105);
if ( (v97 & 1) != 0 )
operator delete(v99);
}
while ( v95 > v13 );
LABEL_86:
v5 = v11 - 10.0;
LABEL_87:
++v92;
}
while ( v92 < (unsigned int)cocos2d::CCArray::count(*(this + 83)) );
return _stack_chk_guard;
}