//
// CustomSongWidget::onToggleFavorite from 0x14016b7e0 to 0x14016b88d (173 bytes)
//
// 2 xrefs:
// > CustomSongWidget::init @ 0x14016a0d7
// > ??> @ 0x140918110
//
// 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:29 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall CustomSongWidget::onToggleFavorite(__int64 a1)
{
__int64 v2; // rbx
_BYTE v3[24]; // [rsp+20h] [rbp-18h] BYREF
void *v4; // [rsp+40h] [rbp+8h] BYREF
if ( *(_QWORD *)(a1 + 336) )
{
v2 = qword_14090C070;
if ( !qword_14090C070 )
{
v4 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v4);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v2 = qword_14090C070;
}
LODWORD(v4) = *(_DWORD *)(*(_QWORD *)(a1 + 336) + 320LL);
if ( (int)v4 > 0 && !sub_140066A60((_QWORD *)(v2 + 776), (unsigned __int8 *)&v4) )
sub_140068190(v2 + 776, (__int64)v3, (unsigned __int8 *)&v4);
CustomSongWidget::updateSongInfo(a1);
}
}