//
// CustomSongWidget::downloadAssetFailed from 0x1400cd560 to 0x1400cd62f (207 bytes)
//
// 2 xrefs:
// > CustomSongWidget::downloadSongFailed @ 0x1400cd004
// > CustomSongWidget::downloadSFXFailed @ 0x1400cd08d
//
// 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 CustomSongWidget::downloadAssetFailed(CustomSongWidget *a1, int a2, GJAssetType a3, GJSongError a4)
{
std::_Vector_val>::pointer Mylast; // rax
std::_Vector_val>::pointer Myfirst; // r9
GJAssetType *p_m_assetType; // rdx
std::_Vector_val>::pointer v8; // rax
_OWORD *p_m_id; // r8
GJAssetType *v10; // rcx
__int128 v11; // xmm1
_OWORD *v12; // rcx
__int128 v13; // xmm1
__int128 v14; // xmm1
Mylast = a1->m_undownloadedAssets._Mypair._Myval2._Mylast;
Myfirst = a1->m_undownloadedAssets._Mypair._Myval2._Myfirst;
if ( Myfirst != Mylast )
{
while ( Myfirst->m_id != a2 || Myfirst->m_assetType != a3 )
{
Myfirst = (std::_Vector_val>::pointer)((char *)Myfirst + 16);
if ( Myfirst == Mylast )
return;
}
++Myfirst->m_status;
p_m_assetType = &Myfirst[1].m_assetType;
LOBYTE(Myfirst[1].m_id) = 0;
v8 = a1->m_undownloadedAssets._Mypair._Myval2._Mylast;
if ( &Myfirst[1].m_assetType != (GJAssetType *)v8 )
{
p_m_id = &Myfirst->m_id;
v10 = &Myfirst[1].m_assetType;
do
{
v10 -= 4;
if ( p_m_id == (_OWORD *)v10 )
break;
v11 = *p_m_id;
*p_m_id++ = *(_OWORD *)v10;
*(_OWORD *)v10 = v11;
}
while ( p_m_id != (_OWORD *)v10 );
v12 = &v8->m_id;
do
{
if ( p_m_assetType == (GJAssetType *)--v12 )
break;
v13 = *(_OWORD *)p_m_assetType;
*(_OWORD *)p_m_assetType = *v12;
p_m_assetType += 4;
*v12 = v13;
}
while ( p_m_assetType != (GJAssetType *)v12 );
for ( ; Myfirst != v8; *(_OWORD *)&v8->m_id = v14 )
{
v8 = (std::_Vector_val>::pointer)((char *)v8 - 16);
if ( Myfirst == v8 )
break;
v14 = *(_OWORD *)&Myfirst->m_id;
*(_OWORD *)&Myfirst->m_id = *(_OWORD *)&v8->m_id;
Myfirst = (std::_Vector_val>::pointer)((char *)Myfirst + 16);
}
}
CustomSongWidget::processNextMultiAsset(a1);
}
}