//
// CustomSongWidget::processNextMultiAsset from 0x100122e28 to 0x100123054 (556 bytes)
//
// 4 xrefs:
// > sub_100121A4C @ 0x100121ce4
// > CustomSongWidget::downloadAssetFinished @ 0x100122cec
// > sub_100122D74 @ 0x100122df4
// > CustomSongWidget::processNextMultiAsset @ 0x10012303c
//
// 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 10:59:16 +0000
//
void __fastcall CustomSongWidget::processNextMultiAsset(__int64 a1)
{
__int64 Instance; // x0
__int64 SongInfo; // x0
unsigned int *v4; // x21
unsigned int *v5; // x8
unsigned __int64 v6; // x20
float v7; // s0
float v8; // s1
__int64 v9; // x0
unsigned int v10; // w8
__int64 v11; // x21
_DWORD *v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x0
__int64 v16; // x0
unsigned __int64 v17; // x0
unsigned int v18; // [xsp+8h] [xbp-28h] BYREF
__int16 v19; // [xsp+Ch] [xbp-24h] BYREF
char v20; // [xsp+Eh] [xbp-22h]
if ( *(_QWORD *)(a1 + 600) == *(_QWORD *)(a1 + 608) )
{
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 376) + 1072LL))(*(_QWORD *)(a1 + 376), &unk_10075DE59);
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 376) + 928LL))(
*(_QWORD *)(a1 + 376),
"Download complete.");
if ( *(_BYTE *)(a1 + 501) == 1 )
{
v7 = 140.0;
v8 = 0.35;
}
else
{
v7 = 230.0;
v8 = 0.4;
}
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 376), v7, v8, 0.0);
CustomSongWidget::showError(a1, 1);
*(_BYTE *)(a1 + 545) = 0;
CustomSongWidget::updateMultiAssetInfo(a1, 1);
}
else
{
Instance = cocos2d::extension::CCHttpClient::getInstance(a1);
SongInfo = cocos2d::extension::CCHttpClient::availableThreadCount(Instance);
v4 = *(unsigned int **)(a1 + 600);
v5 = *(unsigned int **)(a1 + 608);
if ( v4 != v5 )
{
v6 = SongInfo;
while ( *((_BYTE *)v4 + 12) == 1 )
{
v4 += 4;
if ( v4 == v5 )
return;
}
if ( (int)v4[2] < 2 )
{
*((_BYTE *)v4 + 12) = 1;
v10 = v4[1];
if ( v10 == 2 )
{
v14 = MusicDownloadManager::sharedState(SongInfo);
SongInfo = MusicDownloadManager::downloadSFX(v14, *v4);
}
else if ( v10 == 1 )
{
v11 = *v4;
v18 = v11;
if ( (int)v11 > 9999999 )
{
v15 = MusicDownloadManager::sharedState(SongInfo);
SongInfo = MusicDownloadManager::downloadSong(v15, v11);
}
else
{
v12 = sub_1000D8E78(a1 + 632, (int *)&v18, &v18);
v13 = MusicDownloadManager::sharedState(v12);
SongInfo = MusicDownloadManager::getSongInfo(v13, v18, 0);
}
}
}
else
{
CustomSongWidget::updateMultiAssetInfo(a1, 1);
v9 = *(_QWORD *)(a1 + 376);
v20 = 25;
v19 = 13055;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v9 + 1072LL))(v9, &v19);
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 376) + 928LL))(
*(_QWORD *)(a1 + 376),
"Some assets failed to download.");
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(a1 + 376), 230.0, 0.4, 0.0);
CustomSongWidget::showError(a1, 0);
}
v16 = cocos2d::extension::CCHttpClient::getInstance(SongInfo);
v17 = cocos2d::extension::CCHttpClient::availableThreadCount(v16);
if ( *(_QWORD *)(a1 + 600) != *(_QWORD *)(a1 + 608) && v17 && v17 < v6 )
CustomSongWidget::processNextMultiAsset(a1);
}
}
}