//
// CustomSFXWidget::onCancelDownload from 0x140161d90 to 0x140161e4a (186 bytes)
//
// 2 xrefs:
// > CustomSFXWidget::init @ 0x140160998
// > ??> @ 0x140917d5c
//
// This function is hookable on this platform (idp: pc, 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 11:27:25 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall CustomSFXWidget::onCancelDownload(__int64 a1)
{
__int64 v2; // rbx
cocos2d::CCString *v3; // rax
const char *CString; // rsi
__int64 AchievementsWithID; // rax
void *v7; // [rsp+30h] [rbp+8h]
v2 = qword_14090C070;
if ( !qword_14090C070 )
{
v7 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v2 = qword_14090C070;
}
v3 = cocos2d::CCString::createWithFormat("d_%i", *(_DWORD *)(a1 + 496));
CString = cocos2d::CCString::getCString(v3);
AchievementsWithID = AchievementManager::getAchievementsWithID(v2, (__int64)CString);
if ( AchievementsWithID )
*(_BYTE *)(AchievementsWithID + 204) = 1;
MusicDownloadManager::removeDLFromActive(v2, CString);
return (*(__int64 (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)(a1 + 320) + 56LL))(
a1 + 320,
*(unsigned int *)(a1 + 496),
3);
}