//
// sub_14045C6F0 from 0x14045c6f0 to 0x14045c801 (273 bytes)
//
// 3 xrefs:
// > sub_14045DE8C @ 0x14045de93
// > ??> @ 0x1405f6878
// > ??> @ 0x1406dac70
//
// 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
//
// Hidden C++ exception states: #wind=1
MusicDownloadDelegate *__fastcall sub_14045C6F0(MusicDownloadDelegate *Block, char a2)
{
MusicDownloadDelegate *v4; // rbx
MusicDownloadManager *v5; // rax
Block->__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[40].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[41].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[42].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[43].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[44].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[51].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[54].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[79].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[80].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[81].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
v4 = Block + 118;
Block[118].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
Block[119].__vftable = (MusicDownloadDelegate_vtbl *)&SetupSongTriggerPopup::`vftable';
if ( !Block )
v4 = nullptr;
v5 = MusicDownloadManager::sharedState();
MusicDownloadManager::removeMusicDownloadDelegate(v5, v4);
sub_140445240(Block);
if ( (a2 & 1) != 0 )
j_j_free(Block);
return Block;
}