//
// MoreSearchLayer::onSongMode from 0x10062ea30 to 0x10062eb65 (309 bytes)
//
// 3 xrefs:
// > MoreSearchLayer::init @ 0x10062e0c6
// > MoreSearchLayer::init @ 0x10062da55
// > MoreSearchLayer::init @ 0x10062db4d
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall MoreSearchLayer::onSongMode(MoreSearchLayer *a1, cocos2d::CCObject *a2)
{
__m128 v2; // xmm0
int v4; // r14d
GameLevelManager *v5; // rax
bool BoolForKey; // r13
GameLevelManager *v7; // rax
GameLevelManager *v8; // rax
CCTextInputNode *m_enterSongID; // rdi
ButtonSprite *v10; // rax
bool v11; // zf
bool v12; // r15
const char *v13; // r14
const char *v14; // rsi
ButtonSprite *v15; // rax
GameLevelManager *v16; // rax
bool v17; // al
_WORD v18[8]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v4 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
v5 = GameLevelManager::sharedState();
BoolForKey = GameLevelManager::getBoolForKey(v5, "customsong_filter");
v7 = GameLevelManager::sharedState();
GameLevelManager::setBoolForKey(v7, v4 == 2, "customsong_filter");
if ( (v4 == 2) != BoolForKey )
{
v8 = GameLevelManager::sharedState();
GameLevelManager::setIntForKey(v8, v4 != 2, "song_filter");
m_enterSongID = a1->m_enterSongID;
v18[0] = 0;
CCTextInputNode::setString(m_enterSongID, (__int64)v18, v2);
if ( (v18[0] & 1) != 0 )
operator delete(__p);
}
v10 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_normalBtn->getNormalImage)(a1->m_normalBtn);
v11 = v4 == 2;
v12 = v4 == 2;
v13 = "GJ_button_04.png";
v14 = "GJ_button_01.png";
if ( v11 )
{
v14 = "GJ_button_04.png";
v13 = "GJ_button_01.png";
}
ButtonSprite::updateBGImage(v10, v14);
v15 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_customBtn->getNormalImage)(a1->m_customBtn);
ButtonSprite::updateBGImage(v15, v13);
v16 = GameLevelManager::sharedState();
v17 = GameLevelManager::getBoolForKey(v16, "enable_songFilter");
MoreSearchLayer::toggleSongNodes(a1, v12, !v17);
MoreSearchLayer::updateAudioLabel(a1);
}