//
// CustomSongWidget::downloadAssetFinished from 0x100122bf4 to 0x100122d04 (272 bytes)
//
// 3 xrefs:
// > CustomSongWidget::downloadSongFinished @ 0x100122b54
// > CustomSongWidget::downloadSFXFinished @ 0x100122e04
// > sub_100122E08 @ 0x100122e10
//
// 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
//
__int64 __fastcall CustomSongWidget::downloadAssetFinished(__int64 result, int a2, int a3)
{
__int64 v3; // x21
__int64 v4; // x9
__int64 v5; // x19
__int64 v6; // x22
__int64 v7; // x0
char *v8; // x20
char *v9; // x1
char *v10; // x9
char *v11; // x8
char *v12; // x21
char *v13; // x8
char v14; // [xsp+7h] [xbp-29h] BYREF
__int64 v15; // [xsp+8h] [xbp-28h] BYREF
v3 = *(_QWORD *)(result + 600);
v4 = *(_QWORD *)(result + 608);
if ( v3 == v4 )
return result;
v5 = result;
v6 = 0;
while ( *(_DWORD *)(v3 + v6) != a2 || *(_DWORD *)(v3 + v6 + 4) != a3 )
{
v6 += 16;
if ( v3 + v6 == v4 )
return result;
}
if ( a3 == 2 )
{
v15 = v3 + v6;
v7 = result + 576;
goto LABEL_11;
}
if ( a3 == 1 )
{
v15 = v3 + v6;
v7 = result + 552;
LABEL_11:
*(_BYTE *)(sub_1001231E8(v7, v3 + v6, &unk_10075DE87, &v15, &v14) + 32) = 1;
}
v8 = (char *)(v3 + v6);
v9 = (char *)(v3 + v6 + 16);
v10 = *(char **)(v5 + 608);
v11 = &v10[-v3 - v6];
v12 = v11 - 16;
if ( v9 != v10 )
memmove(v8, v9, (size_t)(v11 - 19));
v13 = *(char **)(v5 + 600);
*(_QWORD *)(v5 + 608) = &v12[(_QWORD)v8];
if ( v13 != &v12[(_QWORD)v8] )
CustomSongWidget::updateMultiAssetInfo(v5, 0);
return CustomSongWidget::processNextMultiAsset(v5);
}