//
// CustomSongWidget::updatePlaybackBtn from 0x868394 to 0x8684b8 (292 bytes)
//
// 3 xrefs:
// > CustomSongWidget::init @ 0x86ba40
// > CustomSongWidget::songStateChanged @ 0x86c594
// > ??> @ 0x6b458
//
// 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 12:55:41 +0000
//
__int64 __fastcall CustomSongWidget::updatePlaybackBtn(CustomSongWidget *this)
{
FMODAudioEngine *v2; // x22
MusicDownloadManager *v3; // x23
MusicDownloadManager *v4; // x0
_BOOL4 isMusicPlaying; // w20
cocos2d::CCSpriteFrameCache *v6; // x0
void (__fastcall *v7)(FMODAudioEngine *, __int64); // x20
cocos2d::CCSpriteFrameCache *v8; // x0
__int64 v9; // x0
cocos2d::CCSpriteFrameCache *v11; // x0
__int64 v12[3]; // [xsp+40h] [xbp+40h] BYREF
if ( *((_QWORD *)this + 42) )
{
v2 = (FMODAudioEngine *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 52) + 1072LL))(*((_QWORD *)this + 52));
v3 = (MusicDownloadManager *)FMODAudioEngine::sharedEngine(v2);
v4 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v3);
MusicDownloadManager::pathForSong(v12, v4, *(_DWORD *)(*((_QWORD *)this + 42) + 316LL));
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v3, (__int64)v12, 0);
if ( (v12[0] & 1) != 0 )
operator delete((void *)v12[2]);
v6 = *(cocos2d::CCSpriteFrameCache **)v2;
if ( isMusicPlaying )
{
v7 = *((void (__fastcall **)(FMODAudioEngine *, __int64))v6 + 145);
v11 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v6);
v9 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v11, "GJ_stopMusicBtn_001.png");
}
else
{
v7 = *((void (__fastcall **)(FMODAudioEngine *, __int64))v6 + 145);
v8 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v6);
v9 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v8, "GJ_playMusicBtn_001.png");
}
v7(v2, v9);
}
return _stack_chk_guard;
}