//
// LevelBrowserLayer::getItemsMatchingSearch from 0x7f7824 to 0x7f7c5c (1080 bytes)
//
// 4 xrefs:
// > LevelBrowserLayer::loadPage @ 0x7f8a58
// > LevelBrowserLayer::FLAlert_Clicked @ 0x7fc5bc
// > LevelBrowserLayer::FLAlert_Clicked @ 0x7fc6cc
// > ??> @ 0x5bed0
//
// This function is hookable on this platform (idp: arm, 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:54:38 +0000
//
cocos2d::CCArray *__fastcall LevelBrowserLayer::getItemsMatchingSearch(__int64 a1, __int64 a2, char *a3)
{
cocos2d::CCArray *v4; // x0
int v5; // w25
char v6; // w0
__int64 v7; // x0
unsigned __int64 v8; // x1
unsigned int i; // w22
_BYTE *v10; // x19
int v11; // w19
int *v12; // x1
unsigned int v13; // w0
__int64 **v15; // x24
__int64 v16; // x0
char *v17; // x26
__int64 *v18; // x22
const void *v19; // x1
size_t v20; // x2
unsigned int j; // w28
unsigned __int64 v22; // x0
_BYTE *v23; // x27
int v24; // w3
char *v25; // x7
unsigned __int8 *v26; // x8
signed __int64 v27; // x1
char *v28; // x0
char *v29; // x11
char *v30; // x9
unsigned __int8 *v31; // x1
char *v32; // x10
char *v33; // x12
unsigned __int8 *v34; // x2
char *v35; // x4
int v36; // t1
cocos2d::CCArray *v37; // [xsp+60h] [xbp+60h]
__int64 v39; // [xsp+70h] [xbp+70h] BYREF
unsigned __int64 v40; // [xsp+78h] [xbp+78h]
void *v41; // [xsp+80h] [xbp+80h]
__int64 v42; // [xsp+88h] [xbp+88h] BYREF
size_t v43; // [xsp+90h] [xbp+90h]
void *v44; // [xsp+98h] [xbp+98h]
__int64 v45; // [xsp+A0h] [xbp+A0h] BYREF
unsigned __int64 v46; // [xsp+A8h] [xbp+A8h]
void *v47; // [xsp+B0h] [xbp+B0h]
v4 = *(cocos2d::CCArray **)(a1 + 664);
if ( *((_DWORD *)v4 + 108) == 1 )
v5 = 102;
else
v5 = *((_DWORD *)v4 + 79);
v37 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
v39 = 0;
v6 = *a3;
v40 = 0;
v41 = nullptr;
if ( (v6 & 1) != 0 )
{
std::string::__init(&v39, *((void **)a3 + 2), *((_QWORD *)a3 + 1));
}
else
{
v7 = *(_QWORD *)a3;
v8 = *((_QWORD *)a3 + 1);
v41 = *((void **)a3 + 2);
v39 = v7;
v40 = v8;
}
for ( i = 0; ; ++i )
{
v11 = v39 & 1;
if ( (v39 & 1) != 0 )
{
if ( i < v40 )
{
v10 = (char *)v41 + i;
goto LABEL_8;
}
if ( !a2 || (v12 = *(int **)(a2 + 56), v11 = 1, (v13 = *v12) == 0) )
{
LABEL_14:
operator delete(v41);
return v37;
}
LABEL_18:
v15 = *((__int64 ***)v12 + 2);
v16 = 8LL * v13 - 8;
v17 = (char *)v15 + v16;
if ( v15 > (__int64 **)((char *)v15 + v16) || (v18 = *v15) == nullptr )
{
LABEL_48:
if ( !v11 )
return v37;
goto LABEL_14;
}
LABEL_20:
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, &byte_11B8890, 0);
if ( v5 == 101 )
{
if ( &v42 == v18 + 18 )
goto LABEL_26;
if ( (v18[18] & 1) != 0 )
{
v19 = (const void *)v18[20];
v20 = v18[19];
}
else
{
v19 = (char *)v18 + 145;
v20 = *((_BYTE *)v18 + 144) >> 1;
}
}
else if ( v5 == 102 )
{
if ( &v42 == v18 + 54 )
goto LABEL_26;
if ( (v18[54] & 1) != 0 )
{
v19 = (const void *)v18[56];
v20 = v18[55];
}
else
{
v19 = (char *)v18 + 433;
v20 = *((_BYTE *)v18 + 432) >> 1;
}
}
else
{
if ( &v42 == v18 + 43 )
{
LABEL_26:
v45 = 0;
v46 = 0;
v47 = nullptr;
if ( (v42 & 1) != 0 )
{
std::string::__init(&v45, v44, v43);
}
else
{
v47 = v44;
v45 = v42;
v46 = v43;
}
for ( j = 0; ; ++j )
{
v24 = v45 & 1;
if ( (v45 & 1) != 0 )
{
v22 = v46;
if ( j >= v46 )
{
v25 = (char *)v47;
v24 = 1;
goto LABEL_36;
}
v23 = (char *)v47 + j;
}
else
{
v22 = (unsigned __int8)v45 >> 1;
if ( j >= v22 )
{
v25 = (char *)&v45 + 1;
LABEL_36:
if ( (v39 & 1) != 0 )
{
v26 = (unsigned __int8 *)v41;
v27 = v40;
}
else
{
v27 = (unsigned __int8)v39 >> 1;
v26 = (unsigned __int8 *)&v39 + 1;
}
if ( v22 >= v27 )
{
if ( !v27 )
goto LABEL_40;
if ( v27 <= (__int64)v22 )
{
v28 = &v25[v22];
v29 = &v28[1 - v27];
if ( v29 != v25 )
{
v30 = v25 + 1;
v31 = &v26[v27];
while ( 1 )
{
v32 = v30 - 1;
v33 = v30;
if ( (unsigned __int8)*(v30 - 1) == *v26 )
break;
LABEL_70:
++v30;
if ( v29 == v33 )
goto LABEL_41;
}
v34 = v26;
v35 = v30 - 1;
while ( ++v34 != v31 )
{
v36 = (unsigned __int8)*++v35;
if ( v36 != *v34 )
goto LABEL_70;
}
if ( v28 != v32 && v32 - v25 != -1 )
{
LABEL_40:
cocos2d::CCArray::addObject(v37, (cocos2d::CCObject *)v18);
v24 = v45 & 1;
}
}
}
}
LABEL_41:
if ( v24 )
operator delete(v47);
if ( (v42 & 1) != 0 )
operator delete(v44);
if ( v17 < (char *)++v15 || (v18 = *v15) == nullptr )
{
v11 = v39 & 1;
goto LABEL_48;
}
goto LABEL_20;
}
v23 = (char *)&v45 + j + 1;
}
*v23 = tolower((unsigned __int8)*v23);
}
}
if ( (v18[43] & 1) != 0 )
{
v19 = (const void *)v18[45];
v20 = v18[44];
}
else
{
v19 = (char *)v18 + 345;
v20 = *((_BYTE *)v18 + 344) >> 1;
}
}
std::string::assign(&v42, v19, v20);
goto LABEL_26;
}
if ( i >= (unsigned __int64)((unsigned __int8)v39 >> 1) )
break;
v10 = (char *)&v39 + i + 1;
LABEL_8:
*v10 = tolower((unsigned __int8)*v10);
}
if ( a2 )
{
v12 = *(int **)(a2 + 56);
v13 = *v12;
if ( *v12 )
goto LABEL_18;
}
return v37;
}