//
// CustomSongWidget::updateMultiAssetInfo from 0x1000fd980 to 0x1000fdde8 (1128 bytes)
//
// 4 xrefs:
// > CustomSongWidget::updateWithMultiAssets @ 0x1000fd768
// > CustomSongWidget::downloadAssetFinished @ 0x1000fe2f4
// > CustomSongWidget::processNextMultiAsset @ 0x1000fe500
// > CustomSongWidget::processNextMultiAsset @ 0x1000fe5ac
//
// 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 __fastcall CustomSongWidget::updateMultiAssetInfo(CustomSongWidget *a1, bool a2)
{
_BOOL4 v2; // w20
int value; // w23
int v5; // w24
std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer begin_node; // x27
int v7; // w22
int left_low; // w28
std::string::size_type size; // x8
std::string *p_p; // x1
std::string::size_type v11; // x2
std::string::size_type v12; // x8
std::string *v13; // x1
std::string::size_type v14; // x2
CustomSongWidget *left; // x9
CustomSongWidget *v16; // x8
bool v17; // zf
std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer v18; // x27
int v19; // w28
std::string::size_type v20; // x8
std::string *v21; // x1
std::string::size_type v22; // x2
std::string::size_type v23; // x8
std::string *v24; // x1
std::string::size_type v25; // x2
CustomSongWidget *v26; // x9
CustomSongWidget *v27; // x8
int v28; // w21
_BOOL4 v29; // w1
bool v30; // w8
CCMenuItemSpriteExtra *m_infoBtn; // x0
unsigned __int64 v32; // x23
unsigned __int64 v33; // x24
void **v34; // x8
cocos2d::CCString *v35; // x0
char *CString; // x0
std::string *v37; // x8
cocos2d::CCString *v38; // x0
const char *v39; // x0
std::string *v40; // x1
void *v41[2]; // [xsp+18h] [xbp-E8h] BYREF
char v42; // [xsp+2Fh] [xbp-D1h]
std::string __p; // [xsp+30h] [xbp-D0h] BYREF
std::string v44; // [xsp+48h] [xbp-B8h] BYREF
std::string v45; // [xsp+60h] [xbp-A0h] BYREF
std::string v46; // [xsp+78h] [xbp-88h] BYREF
std::string v47; // [xsp+90h] [xbp-70h] BYREF
v2 = a2;
sub_100009900(&v47, "");
sub_100009900(&v46, "");
sub_100009900(&v45, "");
sub_100009900(&v44, "");
value = a1->m_songs.__tree_.__pair3_.__value_;
v5 = a1->m_sfx.__tree_.__pair3_.__value_;
begin_node = a1->m_songs.__tree_.__begin_node_;
if ( begin_node == (std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer)&a1->m_songs.__tree_.__pair1_ )
{
v7 = 0;
}
else
{
v7 = 0;
do
{
left_low = LOBYTE(begin_node[4].__left_);
if ( left_low == 1 )
{
size = HIBYTE(v47.__r_.__value_.__r.__words[2]);
if ( (v47.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = v47.__r_.__value_.__l.__size_;
if ( size )
std::string::append(&v47, ", ");
GameToolbox::intToString(HIDWORD(begin_node[3].__left_), &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v11 = HIBYTE(__p.__r_.__value_.__r.__words[2]);
else
v11 = __p.__r_.__value_.__l.__size_;
std::string::append(&v47, (const std::string::value_type *)p_p, v11);
}
else
{
v12 = HIBYTE(v46.__r_.__value_.__r.__words[2]);
if ( (v46.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v12 = v46.__r_.__value_.__l.__size_;
if ( v12 )
std::string::append(&v46, ", ");
GameToolbox::intToString(HIDWORD(begin_node[3].__left_), &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v13 = &__p;
else
v13 = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v14 = HIBYTE(__p.__r_.__value_.__r.__words[2]);
else
v14 = __p.__r_.__value_.__l.__size_;
std::string::append(&v46, (const std::string::value_type *)v13, v14);
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
left = (CustomSongWidget *)begin_node[1].__left_;
if ( left )
{
do
{
v16 = left;
left = (CustomSongWidget *)left->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
}
while ( left );
}
else
{
do
{
v16 = (CustomSongWidget *)begin_node[2].__left_;
v17 = v16->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable == (CustomSongWidget_vtbl *)begin_node;
begin_node = (std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer)v16;
}
while ( !v17 );
}
v7 += left_low;
begin_node = (std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer)v16;
}
while ( v16 != (CustomSongWidget *)&a1->m_songs.__tree_.__pair1_ );
}
v18 = a1->m_sfx.__tree_.__begin_node_;
if ( v18 != (std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer)&a1->m_sfx.__tree_.__pair1_ )
{
do
{
v19 = LOBYTE(v18[4].__left_);
if ( v19 == 1 )
{
v20 = HIBYTE(v45.__r_.__value_.__r.__words[2]);
if ( (v45.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v20 = v45.__r_.__value_.__l.__size_;
if ( v20 )
std::string::append(&v45, ", ");
GameToolbox::intToString(HIDWORD(v18[3].__left_), &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v21 = &__p;
else
v21 = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v22 = HIBYTE(__p.__r_.__value_.__r.__words[2]);
else
v22 = __p.__r_.__value_.__l.__size_;
std::string::append(&v45, (const std::string::value_type *)v21, v22);
}
else
{
v23 = HIBYTE(v44.__r_.__value_.__r.__words[2]);
if ( (v44.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v23 = v44.__r_.__value_.__l.__size_;
if ( v23 )
std::string::append(&v44, ", ");
GameToolbox::intToString(HIDWORD(v18[3].__left_), &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v24 = &__p;
else
v24 = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v25 = HIBYTE(__p.__r_.__value_.__r.__words[2]);
else
v25 = __p.__r_.__value_.__l.__size_;
std::string::append(&v44, (const std::string::value_type *)v24, v25);
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v26 = (CustomSongWidget *)v18[1].__left_;
if ( v26 )
{
do
{
v27 = v26;
v26 = (CustomSongWidget *)v26->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
}
while ( v26 );
}
else
{
do
{
v27 = (CustomSongWidget *)v18[2].__left_;
v17 = v27->cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable == (CustomSongWidget_vtbl *)v18;
v18 = (std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer)v27;
}
while ( !v17 );
}
v7 += v19;
v18 = (std::__tree, std::__map_value_compare, std::less, true>, std::allocator>>::__iter_pointer)v27;
}
while ( v27 != (CustomSongWidget *)&a1->m_sfx.__tree_.__pair1_ );
}
v28 = v5 + value;
if ( a1->m_songs.__tree_.__pair3_.__value_ )
v29 = 1;
else
v29 = a1->m_sfx.__tree_.__pair3_.__value_ != 0;
a1->m_hasSFX = v29;
v30 = v7 < v28 && v29;
a1->m_unkBool2 = v30;
m_infoBtn = a1->m_infoBtn;
if ( m_infoBtn )
{
((void (__fastcall *)(CCMenuItemSpriteExtra *))m_infoBtn->setVisible)(m_infoBtn);
if ( !a1->m_hasSFX )
goto LABEL_92;
}
else if ( !v29 )
{
goto LABEL_92;
}
v32 = a1->m_songs.__tree_.__pair3_.__value_;
v33 = a1->m_sfx.__tree_.__pair3_.__value_;
sub_100152E1C(v41, (unsigned int)a1->m_totalBytes);
if ( v42 >= 0 )
v34 = v41;
else
v34 = (void **)v41[0];
v35 = (cocos2d::CCString *)sub_100268F4C("Songs: %i SFX: %i Size: %s", v32, v33, (const char *)v34);
CString = (char *)cocos2d::CCString::getCString(v35);
sub_100009900(&__p, CString);
if ( v42 < 0 )
operator delete(v41[0]);
if ( v7 >= 1 && v7 < v28 )
{
v37 = &__p;
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v37 = (std::string *)__p.__r_.__value_.__r.__words[0];
v38 = (cocos2d::CCString *)sub_100268F4C("%s (%i/%i)", (const char *)v37, v7, v28);
v39 = cocos2d::CCString::getCString(v38);
std::string::assign(&__p, v39);
}
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v40 = &__p;
else
v40 = (std::string *)__p.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))a1->m_songIDLabel->setString)(a1->m_songIDLabel, v40);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_songIDLabel, 230.0, 0.4, 0.0);
if ( (SHIBYTE(__p.__r_.__value_.__r.__words[2]) & 0x80000000) == 0 )
{
LABEL_92:
if ( !v2 )
goto LABEL_94;
goto LABEL_93;
}
operator delete(__p.__r_.__value_.__l.__data_);
if ( v2 )
LABEL_93:
CustomSongWidget::updateSongInfo(a1);
LABEL_94:
if ( SHIBYTE(v44.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v44.__r_.__value_.__l.__data_);
if ( SHIBYTE(v45.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v45.__r_.__value_.__l.__data_);
if ( SHIBYTE(v46.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v46.__r_.__value_.__l.__data_);
if ( SHIBYTE(v47.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v47.__r_.__value_.__l.__data_);
}