//
// FriendsProfilePage::filterUsersWithQuery from 0x5f4bb8 to 0x5f4d3a (386 bytes)
//
// 5 xrefs:
// > FriendsProfilePage::onToggleSort @ 0x5f4d70
// > FriendsProfilePage::onToggleSortDir @ 0x5f4ddc
// > FriendsProfilePage::getUserListFinished @ 0x5f4ece
// > FriendsProfilePage::textChanged @ 0x5f50c0
// > FriendsProfilePage::onClearSearch @ 0x5f55f6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:54:30 +0000
//
cocos2d::CCArray *__fastcall FriendsProfilePage::filterUsersWithQuery(int a1, unsigned __int8 *a2)
{
cocos2d::CCObject *v3; // r0
cocos2d::CCArray *result; // r0
int v6; // r3
int *v8; // r0
cocos2d::CCObject *v9; // r0
int v10; // r3
_DWORD *v11; // r2
cocos2d::CCObject *v12; // r7
unsigned __int8 *v13; // r1
int v14; // lr
unsigned __int8 *v15; // r2
int v16; // r3
char *v17; // r0
unsigned __int8 *v18; // lr
char *v19; // r3
int v20; // r9
unsigned __int8 *v21; // r12
char *v22; // r9
int v23; // t1
cocos2d::CCObject **v24; // [sp+4h] [bp-40h]
unsigned __int8 *v25; // [sp+8h] [bp-3Ch]
cocos2d::CCObject **v26; // [sp+Ch] [bp-38h]
unsigned __int8 *v27; // [sp+14h] [bp-30h]
int v28[3]; // [sp+18h] [bp-2Ch] BYREF
int v29[3]; // [sp+24h] [bp-20h] BYREF
int v30[3]; // [sp+30h] [bp-14h] BYREF
v3 = *(cocos2d::CCObject **)(a1 + 640);
if ( v3 )
{
cocos2d::CCObject::release(v3);
*(_DWORD *)(a1 + 640) = 0;
}
result = *(cocos2d::CCArray **)(a1 + 636);
if ( result )
{
result = (cocos2d::CCArray *)cocos2d::CCArray::count(result);
if ( result )
{
v6 = *a2;
if ( (v6 & 1) != 0 ? *((_DWORD *)a2 + 1) : v6 >> 1 )
{
v8 = sub_5F4A68(v28, (int)a2);
v9 = (cocos2d::CCObject *)cocos2d::CCArray::create((cocos2d::CCArray *)v8);
*(_DWORD *)(a1 + 640) = v9;
cocos2d::CCObject::retain(v9);
v10 = *(_DWORD *)(a1 + 636);
if ( v10 )
{
v11 = *(_DWORD **)(v10 + 52);
if ( *v11 )
{
v24 = (cocos2d::CCObject **)v11[3];
v26 = &v24[*v11] + 0x3FFFFFFF;
while ( v24 <= v26 )
{
v12 = *v24++;
if ( !v12 )
break;
std::string::basic_string(v30, (int)v12 + 264);
sub_5F4A68(v29, (int)v30);
std::string::~string((int)v30);
if ( (v29[0] & 1) != 0 )
{
v13 = (unsigned __int8 *)v29[2];
v14 = v29[1];
}
else
{
v14 = (int)LOBYTE(v29[0]) >> 1;
v13 = (unsigned __int8 *)v29 + 1;
}
if ( (v28[0] & 1) != 0 )
{
v15 = (unsigned __int8 *)v28[2];
v16 = v28[1];
}
else
{
v16 = (int)LOBYTE(v28[0]) >> 1;
v15 = (unsigned __int8 *)v28 + 1;
}
if ( v14 >= (unsigned int)v16 )
{
if ( !v16 )
goto LABEL_21;
v17 = (char *)&v13[v14];
if ( v14 >= v16 )
{
v18 = v13;
v25 = (unsigned __int8 *)&v17[1 - v16];
v27 = &v15[v16];
LABEL_24:
while ( 1 )
{
v19 = (char *)v18;
if ( v18 == v25 )
break;
v20 = *v18++;
if ( v20 == *v15 )
{
v21 = v15;
v22 = v19;
while ( ++v21 != v27 )
{
v23 = (unsigned __int8)*++v22;
if ( v23 != *v21 )
goto LABEL_24;
}
goto LABEL_31;
}
}
}
v19 = v17;
LABEL_31:
if ( v19 != v17 && v19 - (char *)v13 != -1 )
LABEL_21:
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 640), v12);
}
std::string::~string((int)v29);
}
}
}
return (cocos2d::CCArray *)std::string::~string((int)v28);
}
}
}
return result;
}