//
// CustomSongLayer::onSearch from 0x1001f9050 to 0x1001f919c (332 bytes)
//
// 1 xrefs:
// > CustomSongLayer::init @ 0x1001f8cf6
//
// 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
//
void __fastcall CustomSongLayer::onSearch(__int64 a1, __int64 a2, __int64 a3)
{
double v4; // xmm0_8
__int64 v5; // rax
__int64 v6; // rdi
__int64 v7; // rdx
__int64 v8; // rax
const char *v9; // rdi
__int64 v10; // rax
__int64 v11; // rbx
unsigned int v12; // eax
__int64 v13; // r14
__int64 v14; // rax
char v15[8]; // [rsp+8h] [rbp-28h] BYREF
__int64 v16; // [rsp+10h] [rbp-20h]
void *__p; // [rsp+18h] [rbp-18h]
*(_QWORD *)&v4 = GameManager::sharedState(a1, a2, a3).u64[0];
v6 = v5;
if ( (unsigned __int8)GameManager::getGameVariable(v5, "0051") )
{
v8 = FMODAudioEngine::sharedEngine(v4);
FMODAudioEngine::stopAllMusic(v8, 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 1160LL))(*(_QWORD *)(a1 + 688), 0);
CCTextInputNode::getString(v15, *(_QWORD *)(a1 + 688));
if ( (v15[0] & 1) != 0 )
v9 = (const char *)__p;
else
v9 = &v15[1];
v12 = atoi(v9);
v13 = *(_QWORD *)(a1 + 696);
v14 = SongInfoObject::create_1(v12);
CustomSongWidget::updateSongObject(v13, v14);
CustomSongWidget::getSongInfoIfUnloaded(*(_QWORD *)(a1 + 696));
if ( (v15[0] & 1) != 0 )
operator delete(__p);
}
else
{
GameManager::sharedState(v6, "0051", v7);
GameManager::setGameVariable(v10, "0051", 1);
__p = operator new(0x118u);
*(_QWORD *)v15 = 281;
v16 = 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.");
v11 = FLAlertLayer::create_1(0, "Newgrounds Info", v15, "OK", 0, 380.0);
if ( (v15[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v11 + 1312LL))(v11);
}
}