//
// sub_10012138C from 0x10012138c to 0x100121448 (188 bytes)
//
// 3 xrefs:
// > CustomSongWidget::init @ 0x10011f504
// > CustomSongWidget::songStateChanged @ 0x100121df0
// > sub_100121DF4 @ 0x100121e18
//
// 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:15 +0000
//
__int64 __fastcall sub_10012138C(__int64 result)
{
__int64 v1; // x20
__int64 v2; // x19
__int64 v3; // x21
__int64 v4; // x0
__int64 isMusicPlaying; // x0
int v6; // w20
__int64 v7; // x0
const char *v8; // x1
__int64 v9; // x0
void *__p[2]; // [xsp+8h] [xbp-38h] BYREF
char v11; // [xsp+1Fh] [xbp-21h]
if ( *(_QWORD *)(result + 336) )
{
v1 = result;
v2 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(result + 416) + 1072LL))(*(_QWORD *)(result + 416));
v3 = FMODAudioEngine::sharedEngine(v2);
v4 = MusicDownloadManager::sharedState(v3);
MusicDownloadManager::pathForSong(__p, v4, *(unsigned int *)(*(_QWORD *)(v1 + 336) + 316LL));
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v3, __p, 0);
v6 = isMusicPlaying;
if ( v11 < 0 )
operator delete(__p[0]);
v7 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(isMusicPlaying);
if ( v6 )
v8 = "GJ_stopMusicBtn_001.png";
else
v8 = "GJ_playMusicBtn_001.png";
v9 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v7, v8);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v2 + 1160LL))(v2, v9);
}
return result;
}