//
// CustomSongWidget::updateMultiAssetInfo from 0x86c5a8 to 0x86cd10 (1896 bytes)
//
// 6 xrefs:
// > CustomSongWidget::setMultiAssetFilesize @ 0x86cd24
// > CustomSongWidget::processNextMultiAsset @ 0x86cda8
// > CustomSongWidget::processNextMultiAsset @ 0x86cf08
// > CustomSongWidget::updateWithMultiAssets @ 0x86d90c
// > CustomSongWidget::downloadAssetFinished @ 0x86db14
// > ??> @ 0x104860
//
// 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 12:55:44 +0000
//
__int64 __fastcall CustomSongWidget::updateMultiAssetInfo(CustomSongWidget *this, unsigned __int8 a2)
{
_QWORD *v3; // x19
int v4; // w22
__int64 v5; // x1
char *v6; // x1
size_t v7; // x2
_QWORD *j; // x19
__int64 v9; // x1
char *v10; // x1
size_t v11; // x2
bool v12; // w2
__int64 v13; // x1
__int64 v14; // x0
const char *v15; // x24
char *v16; // x2
cocos2d::CCString *v17; // x0
size_t v18; // x0
char *v19; // x3
cocos2d::CCString *v20; // x0
size_t v21; // x0
const char *v22; // x1
cocos2d::CCString *v23; // x0
char *v24; // x0
char *v25; // x1
__int64 v27; // x1
char *v28; // x1
size_t v29; // x2
__int64 v30; // x1
char *v31; // x1
size_t v32; // x2
char *CString; // [xsp+68h] [xbp+68h]
char *v34; // [xsp+68h] [xbp+68h]
int v35; // [xsp+70h] [xbp+70h]
int i; // [xsp+74h] [xbp+74h]
__int64 v38; // [xsp+88h] [xbp+88h] BYREF
__int64 v39; // [xsp+90h] [xbp+90h]
void *v40; // [xsp+98h] [xbp+98h]
__int64 v41; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v42; // [xsp+A8h] [xbp+A8h]
void *v43; // [xsp+B0h] [xbp+B0h]
__int64 v44; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v45; // [xsp+C0h] [xbp+C0h]
void *v46; // [xsp+C8h] [xbp+C8h]
__int64 v47; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v48; // [xsp+D8h] [xbp+D8h]
void *v49; // [xsp+E0h] [xbp+E0h]
unsigned __int64 v50[2]; // [xsp+E8h] [xbp+E8h] BYREF
void *v51; // [xsp+F8h] [xbp+F8h]
unsigned __int64 v52[2]; // [xsp+100h] [xbp+100h] BYREF
void *v53; // [xsp+110h] [xbp+110h]
unsigned __int64 v54[2]; // [xsp+118h] [xbp+118h] BYREF
void *v55; // [xsp+128h] [xbp+128h]
__int64 v56; // [xsp+130h] [xbp+130h] BYREF
size_t v57; // [xsp+138h] [xbp+138h]
void *v58; // [xsp+140h] [xbp+140h]
__int64 v59[2]; // [xsp+148h] [xbp+148h] BYREF
void *v60; // [xsp+158h] [xbp+158h]
__int64 v61[2]; // [xsp+160h] [xbp+160h] BYREF
void *v62; // [xsp+170h] [xbp+170h]
v35 = a2;
v38 = 0;
v39 = 0;
v40 = nullptr;
std::string::__init(&v38, &byte_11B8890, 0);
v41 = 0;
v42 = 0;
v43 = nullptr;
std::string::__init(&v41, &byte_11B8890, 0);
v44 = 0;
v45 = 0;
v46 = nullptr;
std::string::__init(&v44, &byte_11B8890, 0);
v47 = 0;
v48 = 0;
v49 = nullptr;
std::string::__init(&v47, &byte_11B8890, 0);
v3 = *((_QWORD **)this + 69);
v4 = 0;
for ( i = *((_QWORD *)this + 74) + *((_QWORD *)this + 71);
(_QWORD *)((char *)this + 560) != v3;
v3 = std::__tree_next *>(v3) )
{
if ( *((_BYTE *)v3 + 32) )
{
v5 = (unsigned __int8)v38 >> 1;
if ( (v38 & 1) != 0 )
v5 = v39;
if ( v5 )
std::string::append((__int64)&v38, ", ", 2u);
GameToolbox::intToString(v50, (GameToolbox *)*((unsigned int *)v3 + 7));
if ( (v50[0] & 1) != 0 )
{
v6 = (char *)v51;
v7 = v50[1];
}
else
{
v7 = LOBYTE(v50[0]) >> 1;
v6 = (char *)v50 + 1;
}
std::string::append((__int64)&v38, v6, v7);
if ( (v50[0] & 1) != 0 )
operator delete(v51);
++v4;
}
else
{
v30 = (unsigned __int8)v41 >> 1;
if ( (v41 & 1) != 0 )
v30 = v42;
if ( v30 )
std::string::append((__int64)&v41, ", ", 2u);
GameToolbox::intToString(v52, (GameToolbox *)*((unsigned int *)v3 + 7));
if ( (v52[0] & 1) != 0 )
{
v31 = (char *)v53;
v32 = v52[1];
}
else
{
v32 = LOBYTE(v52[0]) >> 1;
v31 = (char *)v52 + 1;
}
std::string::append((__int64)&v41, v31, v32);
if ( (v52[0] & 1) != 0 )
operator delete(v53);
}
}
for ( j = *((_QWORD **)this + 72);
(_QWORD *)((char *)this + 584) != j;
j = std::__tree_next *>(j) )
{
if ( *((_BYTE *)j + 32) )
{
v9 = (unsigned __int8)v44 >> 1;
if ( (v44 & 1) != 0 )
v9 = v45;
if ( v9 )
std::string::append((__int64)&v44, ", ", 2u);
GameToolbox::intToString(v54, (GameToolbox *)*((unsigned int *)j + 7));
if ( (v54[0] & 1) != 0 )
{
v10 = (char *)v55;
v11 = v54[1];
}
else
{
v11 = LOBYTE(v54[0]) >> 1;
v10 = (char *)v54 + 1;
}
std::string::append((__int64)&v44, v10, v11);
if ( (v54[0] & 1) != 0 )
operator delete(v55);
++v4;
}
else
{
v27 = (unsigned __int8)v47 >> 1;
if ( (v47 & 1) != 0 )
v27 = v48;
if ( v27 )
std::string::append((__int64)&v47, ", ", 2u);
GameToolbox::intToString((unsigned __int64 *)&v56, (GameToolbox *)*((unsigned int *)j + 7));
if ( (v56 & 1) != 0 )
{
v28 = (char *)v58;
v29 = v57;
}
else
{
v29 = (unsigned __int8)v56 >> 1;
v28 = (char *)&v56 + 1;
}
std::string::append((__int64)&v47, v28, v29);
if ( (v56 & 1) != 0 )
operator delete(v58);
}
}
if ( *((_QWORD *)this + 71) || *((_QWORD *)this + 74) )
{
v12 = i > v4;
*((_BYTE *)this + 529) = 1;
v13 = 1;
}
else
{
v13 = 0;
v12 = 0;
*((_BYTE *)this + 529) = 0;
}
v14 = *((_QWORD *)this + 55);
*((_BYTE *)this + 545) = v12;
if ( v14 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v14 + 344LL))(v14, v13);
CustomSongWidget::updateUsageButton(this);
if ( *((_BYTE *)this + 529) )
{
if ( *((int *)this + 157) <= 0 )
{
formatBytes(&v56, *((_DWORD *)this + 156));
}
else
{
formatBytes(v59, *((_DWORD *)this + 156));
v15 = (char *)v59 + 1;
if ( (v59[0] & 1) != 0 )
v15 = (const char *)v60;
formatBytes(v61, *((_DWORD *)this + 157));
v16 = (char *)v61 + 1;
if ( (v61[0] & 1) != 0 )
v16 = (char *)v62;
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s / %s", v15, v16);
CString = (char *)cocos2d::CCString::getCString(v17);
v56 = 0;
v57 = 0;
v58 = nullptr;
v18 = strlen(CString);
std::string::__init(&v56, CString, v18);
if ( (v61[0] & 1) != 0 )
operator delete(v62);
if ( (v59[0] & 1) != 0 )
operator delete(v60);
}
v19 = (char *)&v56 + 1;
if ( (v56 & 1) != 0 )
v19 = (char *)v58;
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Songs: %i SFX: %i Size: %s",
*((const char **)this + 71),
*((_QWORD *)this + 74),
v19);
v34 = (char *)cocos2d::CCString::getCString(v20);
v61[0] = 0;
v61[1] = 0;
v62 = nullptr;
v21 = strlen(v34);
std::string::__init(v61, v34, v21);
if ( i > v4 && v4 > 0 )
{
v22 = (char *)v61 + 1;
if ( (v61[0] & 1) != 0 )
v22 = (const char *)v62;
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s (%i/%i)",
v22,
(unsigned int)v4,
(unsigned int)i);
v24 = (char *)cocos2d::CCString::getCString(v23);
std::string::assign(v61, v24);
}
if ( (v61[0] & 1) != 0 )
v25 = (char *)v62;
else
v25 = (char *)v61 + 1;
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 46) + 928LL))(*((_QWORD *)this + 46), v25);
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 46), 230.0, 0.4, 0.0);
(*(void (**)(void))(**((_QWORD **)this + 46) + 1072LL))();
if ( (v61[0] & 1) != 0 )
operator delete(v62);
if ( (v56 & 1) != 0 )
operator delete(v58);
}
if ( v35 )
{
CustomSongWidget::updateSongInfo(this);
if ( (v47 & 1) == 0 )
goto LABEL_55;
}
else if ( (v47 & 1) == 0 )
{
goto LABEL_55;
}
operator delete(v49);
LABEL_55:
if ( (v44 & 1) != 0 )
{
operator delete(v46);
if ( (v41 & 1) == 0 )
goto LABEL_57;
}
else if ( (v41 & 1) == 0 )
{
goto LABEL_57;
}
operator delete(v43);
LABEL_57:
if ( (v38 & 1) != 0 )
operator delete(v40);
return _stack_chk_guard;
}