//
// LevelSearchLayer::demonFilterSelectClosed from 0x14030e2e0 to 0x14030e513 (563 bytes)
//
// 2 xrefs:
// > ??> @ 0x14058be30
// > ??> @ 0x1406d4718
//
// 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=3
void LevelSearchLayer::demonFilterSelectClosed(LevelSearchLayer *a1, int a2)
{
__int64 v4; // rbx
struct cocos2d::CCString *v5; // rax
void *v6; // rcx
char *v7; // rax
__int64 v8; // rcx
cocos2d::CCString *v9; // rax
char *CString; // rax
size_t v11; // r8
void **v12; // rdi
__int64 v13; // rbx
cocos2d::CCSpriteFrameCache *v14; // rax
struct cocos2d::CCSpriteFrame *v15; // rax
void *v16; // rcx
void *v17; // [rsp+20h] [rbp-58h]
void *v18[2]; // [rsp+28h] [rbp-50h] BYREF
__int64 v19; // [rsp+38h] [rbp-40h]
unsigned __int64 v20; // [rsp+40h] [rbp-38h]
char Block[13]; // [rsp+48h] [rbp-30h] BYREF
char v22; // [rsp+55h] [rbp-23h]
__int16 v23; // [rsp+56h] [rbp-22h]
__int64 v24; // [rsp+58h] [rbp-20h]
unsigned __int64 v25; // [rsp+60h] [rbp-18h]
v4 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v17 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v4 = qword_1406C2EC0;
}
v22 = 0;
v23 = 0;
v24 = 12;
v25 = 15;
strcpy(Block, "demon_filter");
v5 = cocos2d::CCString::createWithFormat("%i", a2);
cocos2d::CCDictionary::setObject(*(_QWORD *)(v4 + 344), v5, Block);
if ( v25 > 0xF )
{
v6 = *(void **)Block;
if ( v25 + 1 >= 0x1000 )
{
v6 = *(void **)(*(_QWORD *)Block - 8LL);
if ( (unsigned __int64)(*(_QWORD *)Block - (_QWORD)v6 - 8LL) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v6);
}
*(_OWORD *)v18 = 0;
v19 = 0;
v20 = 15;
LOBYTE(v18[0]) = 0;
if ( a2 )
{
v9 = cocos2d::CCString::createWithFormat("difficulty_%02d_btn2_001.png", a2);
CString = (char *)cocos2d::CCString::getCString(v9);
v11 = -1;
do
++v11;
while ( CString[v11] );
sub_14003CCE0(v18, CString, v11);
v7 = (char *)v18[0];
}
else
{
v7 = (char *)sub_14003AA10(0x20u);
v19 = 25;
v20 = 31;
strcpy(v7, "difficulty_06_btn_001.png");
v8 = 103;
v18[0] = v7;
}
v12 = v18;
if ( v20 > 0xF )
v12 = (void **)v7;
v13 = **(_QWORD **)&a1->m_fRotationX;
v14 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v8);
v15 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, (const char *)v12);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSpriteFrame *))(v13 + 992))(*(_QWORD *)&a1->m_fRotationX, v15);
if ( v20 > 0xF )
{
v16 = v18[0];
if ( v20 + 1 >= 0x1000 )
{
v16 = *((void **)v18[0] - 1);
if ( (unsigned __int64)((char *)v18[0] - (char *)v16 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v16);
}
}