//
// CustomSongLayer::onSearch from 0x100215a70 to 0x100215bbc (332 bytes)
//
// 1 xrefs:
// > CustomSongLayer::init @ 0x100215726
//
// 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 CustomSongLayer::onSearch(CustomSongLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // rax
FMODAudioEngine *v4; // rax
double v5; // xmm0_8
const char *v6; // rdi
GameManager *v7; // rax
__int64 v8; // rbx
int v9; // eax
CustomSongWidget *m_songWidget; // r14
SongInfoObject *v11; // rax
char v12[8]; // [rsp+8h] [rbp-28h] BYREF
__int64 v13; // [rsp+10h] [rbp-20h]
void *__p; // [rsp+18h] [rbp-18h]
v3 = GameManager::sharedState();
if ( GameManager::getGameVariable(v3, "0051") )
{
v4 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v4, 1);
v5 = ((double (__fastcall *)(CCTextInputNode *, _QWORD))a1->m_songIDInput->onClickTrackNode)(a1->m_songIDInput, 0);
CCTextInputNode::getString(v12, (__int64)a1->m_songIDInput, v5);
if ( (v12[0] & 1) != 0 )
v6 = (const char *)__p;
else
v6 = &v12[1];
v9 = atoi(v6);
m_songWidget = a1->m_songWidget;
v11 = SongInfoObject::create_1(v9);
CustomSongWidget::updateSongObject(m_songWidget, v11);
CustomSongWidget::getSongInfoIfUnloaded(a1->m_songWidget);
if ( (v12[0] & 1) != 0 )
operator delete(__p);
}
else
{
v7 = GameManager::sharedState();
GameManager::setGameVariable(v7, "0051", 1);
__p = operator new(0x118u);
*(_QWORD *)v12 = 281;
v13 = 273;
strcpy(
(char *)__p,
"There are thousands of great custom songs for you to choose from Newgrounds. Please do not upload music you did no"
"t create. You are only allowed to use songs from artists that have been scouted on Newgrounds. For more informatio"
"n, please check the Audio Guidelines.");
v8 = FLAlertLayer::create_1(0, "Newgrounds Info", v12, "OK", 0, 380.0);
if ( (v12[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1288LL))(v8);
}
}