//
// SongOptionsLayer::onPlayback from 0x1001faa00 to 0x1001fab2d (301 bytes)
//
// 1 xrefs:
// > SongOptionsLayer::init @ 0x1001fa668
//
// 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 12:26:49 +0000
//
__int64 __fastcall SongOptionsLayer::onPlayback(__int64 a1, double a2)
{
__int64 v2; // rax
__int64 v3; // rax
double v4; // xmm0_8
char *v5; // r14
__int64 v6; // r14
__int64 v7; // rbx
__int64 v8; // rdi
char isMusicPlaying_1; // r14
__int64 v10; // rax
const char *v11; // rsi
__int64 v12; // rax
char *v14[2]; // [rsp+0h] [rbp-50h] BYREF
char *v15; // [rsp+10h] [rbp-40h]
_BYTE v16[16]; // [rsp+18h] [rbp-38h] BYREF
void *__p; // [rsp+28h] [rbp-28h]
double v18; // [rsp+30h] [rbp-20h]
v2 = FMODAudioEngine::sharedEngine(a2);
if ( (unsigned __int8)FMODAudioEngine::isMusicPlaying_1(v2, 0) )
{
v3 = FMODAudioEngine::sharedEngine(a2);
FMODAudioEngine::stopAllMusic(v3, 1);
}
else
{
CCTextInputNode::getString(v14, *(_QWORD *)(a1 + 672));
if ( ((__int64)v14[0] & 1) != 0 )
{
v5 = v15;
v18 = atof(v15);
operator delete(v5);
v4 = v18;
}
else
{
v4 = atof((const char *)v14 + 1);
}
*(float *)&v4 = v4;
LODWORD(v18) = LODWORD(v4);
v6 = FMODAudioEngine::sharedEngine(v4);
(*(void (__fastcall **)(_BYTE *))(**(_QWORD **)(a1 + 664) + 16LL))(v16);
*(_QWORD *)&a2 = LODWORD(v18);
*(float *)&a2 = *(float *)&v18 * 1000.0;
FMODAudioEngine::loadAndPlayMusic(v6, v16, (unsigned int)(int)(float)(*(float *)&v18 * 1000.0), 0);
if ( (v16[0] & 1) != 0 )
operator delete(__p);
}
v7 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 680) + 1072LL))(*(_QWORD *)(a1 + 680));
v8 = FMODAudioEngine::sharedEngine(a2);
isMusicPlaying_1 = FMODAudioEngine::isMusicPlaying_1(v8, 0);
v10 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v11 = "GJ_playMusicBtn_001.png";
if ( isMusicPlaying_1 )
v11 = "GJ_stopMusicBtn_001.png";
v12 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v10, v11);
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 1160LL))(v7, v12);
}