//
// MoreSearchLayer::selectSong from 0x140316a50 to 0x140316b90 (320 bytes)
//
// 5 xrefs:
// > MoreSearchLayer::onSongFilter @ 0x140316526
// > MoreSearchLayer::audioNext @ 0x140316913
// > MoreSearchLayer::audioPrevious @ 0x140316a33
// > ??> @ 0x1406d4964
// > ??> @ 0x1406d4970
//
// 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
//
// Hidden C++ exception states: #wind=2
void MoreSearchLayer::selectSong(MoreSearchLayer *a1, int a2)
{
int v2; // ebx
__int64 v4; // rdi
struct cocos2d::CCString *v5; // rax
void *v6; // rcx
void *v7; // [rsp+20h] [rbp-38h]
void *Block[2]; // [rsp+28h] [rbp-30h] BYREF
__int64 v9; // [rsp+38h] [rbp-20h]
unsigned __int64 v10; // [rsp+40h] [rbp-18h]
v2 = a2;
if ( a2 > 22 )
v2 = 22;
if ( v2 < 1 )
v2 = 1;
v4 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v7 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v4 = qword_1406C2EC0;
}
v9 = 11;
v10 = 15;
Block[0] = (void *)0x6C69665F676E6F73LL;
Block[1] = (void *)7497076;
v5 = cocos2d::CCString::createWithFormat("%i", v2);
cocos2d::CCDictionary::setObject(*(_QWORD *)(v4 + 344), v5, Block);
if ( v10 > 0xF )
{
v6 = Block[0];
if ( v10 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v6);
}
MoreSearchLayer::updateAudioLabel(a1);
}