//
// CustomSongWidget::updateWithMultiAssets from 0x86d670 to 0x86da24 (948 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::levelDownloadFinished @ 0x7e9d8c
// > LevelInfoLayer::init @ 0x7ebc58
// > AudioAssetsPopup::init @ 0xc8e588
// > ??> @ 0x8b018
//
// 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::updateWithMultiAssets(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 v5; // x2
char *v6; // x20
char *v7; // x26
__int64 v8; // x1
const char *v9; // x0
MusicDownloadManager *v10; // x0
MusicDownloadManager *v11; // x0
char isSongDownloaded; // w22
__int64 v13; // x2
char *v15; // x20
char *v16; // x25
__int64 v17; // x1
const char *v18; // x0
MusicDownloadManager *v19; // x0
MusicDownloadManager *v20; // x0
char isSFXDownloaded; // w22
char *v22; // x19
char *v23; // x0
char *v24; // x19
char *v25; // x0
int v29[2]; // [xsp+90h] [xbp+90h] BYREF
int v30[2]; // [xsp+98h] [xbp+98h] BYREF
void *v31; // [xsp+A0h] [xbp+A0h] BYREF
char *v32; // [xsp+A8h] [xbp+A8h]
__int64 v33; // [xsp+B0h] [xbp+B0h]
void *v34; // [xsp+B8h] [xbp+B8h] BYREF
char *v35; // [xsp+C0h] [xbp+C0h]
__int64 v36; // [xsp+C8h] [xbp+C8h]
void *v37; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v38; // [xsp+D8h] [xbp+D8h]
void *v39; // [xsp+E0h] [xbp+E0h]
if ( *(_BYTE *)(a1 + 529) )
goto LABEL_5;
v5 = *(_BYTE *)a2 >> 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v5 = *(_QWORD *)(a2 + 8);
if ( v5 )
goto LABEL_5;
v13 = *(_BYTE *)a3 >> 1;
if ( (*(_BYTE *)a3 & 1) != 0 )
v13 = *(_QWORD *)(a3 + 8);
if ( v13 )
{
LABEL_5:
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::clear((_QWORD *)(a1 + 552));
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::clear((_QWORD *)(a1 + 576));
v31 = nullptr;
*(_DWORD *)(a1 + 624) = a4;
v32 = nullptr;
v33 = 0;
sub_8693EC((unsigned __int8 *)a2, (__int64 *)&v31);
v34 = nullptr;
v35 = nullptr;
v36 = 0;
sub_8693EC((unsigned __int8 *)a3, (__int64 *)&v34);
v6 = (char *)v31;
v7 = v32;
if ( v31 != v32 )
{
do
{
v37 = nullptr;
v38 = 0;
v39 = nullptr;
if ( (*v6 & 1) != 0 )
{
std::string::__init((__int64 *)&v37, *((void **)v6 + 2), *((_QWORD *)v6 + 1));
}
else
{
v8 = *((_QWORD *)v6 + 1);
v37 = *(void **)v6;
v38 = v8;
v39 = *((void **)v6 + 2);
}
v9 = (char *)&v37 + 1;
if ( ((unsigned __int8)v37 & 1) != 0 )
v9 = (const char *)v39;
v10 = (MusicDownloadManager *)atoi(v9);
v30[0] = (int)v10;
v11 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v10);
isSongDownloaded = MusicDownloadManager::isSongDownloaded(v11, v30[0]);
*(_QWORD *)v29 = v30;
*(_BYTE *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)(a1 + 552),
v30,
(__int64)&unk_114B380,
(_DWORD **)v29)
+ 32) = isSongDownloaded;
if ( ((unsigned __int8)v37 & 1) != 0 )
operator delete(v39);
v6 += 24;
}
while ( v7 != v6 );
}
v15 = (char *)v34;
v16 = v35;
if ( v34 != v35 )
{
do
{
while ( 1 )
{
v37 = nullptr;
v38 = 0;
v39 = nullptr;
if ( (*v15 & 1) != 0 )
{
std::string::__init((__int64 *)&v37, *((void **)v15 + 2), *((_QWORD *)v15 + 1));
}
else
{
v17 = *((_QWORD *)v15 + 1);
v37 = *(void **)v15;
v38 = v17;
v39 = *((void **)v15 + 2);
}
v18 = (char *)&v37 + 1;
if ( ((unsigned __int8)v37 & 1) != 0 )
v18 = (const char *)v39;
v19 = (MusicDownloadManager *)atoi(v18);
v29[0] = (int)v19;
v20 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v19);
isSFXDownloaded = MusicDownloadManager::isSFXDownloaded(v20, v29[0]);
*(_QWORD *)v30 = v29;
*(_BYTE *)(std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::__emplace_unique_key_args,std::tuple<>>(
(__int64 **)(a1 + 576),
v29,
(__int64)&unk_114B380,
(_DWORD **)v30)
+ 32) = isSFXDownloaded;
if ( ((unsigned __int8)v37 & 1) != 0 )
break;
v15 += 24;
if ( v16 == v15 )
goto LABEL_29;
}
v15 += 24;
operator delete(v39);
}
while ( v16 != v15 );
}
LABEL_29:
CustomSongWidget::updateMultiAssetInfo((CustomSongWidget *)a1, 1u);
v22 = (char *)v34;
if ( v34 )
{
v23 = v35;
if ( v34 != v35 )
{
do
{
v35 = v23 - 24;
std::string::~string((__int64)(v23 - 24));
v23 = v35;
}
while ( v22 != v35 );
v23 = (char *)v34;
}
operator delete(v23);
}
v24 = (char *)v31;
if ( v31 )
{
v25 = v32;
if ( v31 != v32 )
{
do
{
v32 = v25 - 24;
std::string::~string((__int64)(v25 - 24));
v25 = v32;
}
while ( v24 != v32 );
v25 = (char *)v31;
}
operator delete(v25);
}
}
return _stack_chk_guard;
}