//
// CustomSongWidget::deleteSong from 0x100121690 to 0x1001217ac (284 bytes)
//
// 1 xrefs:
// > CustomSongWidget::FLAlert_Clicked @ 0x10012312c
//
// 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::deleteSong(__int64 result)
{
__int64 v1; // x19
__int64 v2; // x20
__int64 v3; // x0
__int64 isMusicPlaying; // x0
int v5; // w20
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
float v9; // s0
float v10; // s1
__int16 v11; // [xsp+4h] [xbp-2Ch] BYREF
char v12; // [xsp+6h] [xbp-2Ah]
void *__p[2]; // [xsp+8h] [xbp-28h] BYREF
char v14; // [xsp+1Fh] [xbp-11h]
if ( !*(_QWORD *)(result + 336) )
return result;
v1 = result;
v2 = FMODAudioEngine::sharedEngine(result);
v3 = MusicDownloadManager::sharedState(v2);
MusicDownloadManager::pathForSong(__p, v3, *(unsigned int *)(*(_QWORD *)(v1 + 336) + 316LL));
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v2, __p, 0);
v5 = isMusicPlaying;
if ( v14 < 0 )
{
operator delete(__p[0]);
if ( !v5 )
goto LABEL_5;
goto LABEL_4;
}
if ( (_DWORD)isMusicPlaying )
{
LABEL_4:
v6 = FMODAudioEngine::sharedEngine(isMusicPlaying);
isMusicPlaying = FMODAudioEngine::stopAllMusic(v6, 1);
}
LABEL_5:
v7 = MusicDownloadManager::sharedState(isMusicPlaying);
MusicDownloadManager::deleteSong(v7, *(unsigned int *)(*(_QWORD *)(v1 + 336) + 316LL));
CustomSongWidget::updateSongInfo(v1);
v8 = *(_QWORD *)(v1 + 376);
v12 = 0;
v11 = 25855;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v8 + 1072LL))(v8, &v11);
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(v1 + 376) + 928LL))(
*(_QWORD *)(v1 + 376),
"Song Deleted");
if ( *(_BYTE *)(v1 + 501) == 1 )
{
v9 = 140.0;
v10 = 0.35;
}
else
{
v9 = 230.0;
v10 = 0.4;
}
cocos2d::CCLabelBMFont::limitLabelWidth(*(_QWORD *)(v1 + 376), v9, v10, 0.0);
return CustomSongWidget::showError(v1, 1);
}