//
// FriendsProfilePage::filterUsersWithQuery from 0x140216c60 to 0x140216e7b (539 bytes)
//
// 6 xrefs:
// > FriendsProfilePage::onToggleSort @ 0x140214c22
// > FriendsProfilePage::onToggleSortDir @ 0x140214d26
// > FriendsProfilePage::getUserListFinished @ 0x140214ea8
// > FriendsProfilePage::textChanged @ 0x140216409
// > FriendsProfilePage::onClearSearch @ 0x140216c3a
// > ??> @ 0x14091b788
//
// 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 11:28:21 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall FriendsProfilePage::filterUsersWithQuery(__int64 a1, __int64 a2)
{
cocos2d::CCObject *v4; // rcx
cocos2d::CCArray *v5; // rcx
char *v6; // rdi
_QWORD *v7; // rcx
unsigned __int8 *v8; // rsi
char *v9; // rbx
signed __int64 v10; // rdi
cocos2d::CCObject *v11; // rax
__int64 v12; // rsi
unsigned int *v13; // rsi
__int64 v14; // rax
struct cocos2d::CCObject **v15; // rsi
struct cocos2d::CCObject **i; // r12
struct cocos2d::CCObject *v17; // r15
char *v18; // rdi
_QWORD *v19; // rcx
unsigned __int8 *v20; // r14
char *v21; // rbx
signed __int64 v22; // rdi
_QWORD *v23; // r9
_QWORD *v24; // rcx
_QWORD v25[2]; // [rsp+38h] [rbp-41h] BYREF
unsigned __int64 v26; // [rsp+48h] [rbp-31h]
unsigned __int64 v27; // [rsp+50h] [rbp-29h]
_QWORD v28[2]; // [rsp+58h] [rbp-21h] BYREF
unsigned __int64 v29; // [rsp+68h] [rbp-11h]
unsigned __int64 v30; // [rsp+70h] [rbp-9h]
_BYTE v31[32]; // [rsp+78h] [rbp-1h] BYREF
v4 = *(cocos2d::CCObject **)(a1 + 864);
if ( v4 )
{
cocos2d::CCObject::release(v4);
*(_QWORD *)(a1 + 864) = 0;
}
v5 = *(cocos2d::CCArray **)(a1 + 856);
if ( v5 && cocos2d::CCArray::count(v5) && *(_QWORD *)(a2 + 16) )
{
sub_14003F4F0((__int64)v28, a2);
v6 = (char *)v28;
if ( v30 > 0xF )
v6 = (char *)v28[0];
v7 = v28;
if ( v30 > 0xF )
v7 = (_QWORD *)v28[0];
v8 = (unsigned __int8 *)v7 + v29;
v9 = (char *)v28;
if ( v30 > 0xF )
v9 = (char *)v28[0];
if ( v9 != (char *)v8 )
{
v10 = v6 - v9;
do
{
v9[v10] = tolower((unsigned __int8)*v9);
++v9;
}
while ( v9 != (char *)v8 );
}
v11 = (cocos2d::CCObject *)cocos2d::CCArray::create(v7);
*(_QWORD *)(a1 + 864) = v11;
cocos2d::CCObject::retain(v11);
v12 = *(_QWORD *)(a1 + 856);
if ( v12 )
{
v13 = *(unsigned int **)(v12 + 56);
v14 = *v13;
if ( (_DWORD)v14 )
{
v15 = *((struct cocos2d::CCObject ***)v13 + 2);
for ( i = &v15[v14 - 1]; v15 <= i; ++v15 )
{
v17 = *v15;
if ( !*v15 )
break;
sub_14003F4F0((__int64)v31, (__int64)v17 + 320);
sub_14003F4F0((__int64)v25, (__int64)v31);
v18 = (char *)v25;
if ( v27 > 0xF )
v18 = (char *)v25[0];
v19 = v25;
if ( v27 > 0xF )
v19 = (_QWORD *)v25[0];
v20 = (unsigned __int8 *)v19 + v26;
v21 = (char *)v25;
if ( v27 > 0xF )
v21 = (char *)v25[0];
if ( v21 != (char *)v20 )
{
v22 = v18 - v21;
do
{
v21[v22] = tolower((unsigned __int8)*v21);
++v21;
}
while ( v21 != (char *)v20 );
}
sub_14003D310((__int64)v31);
v23 = v28;
if ( v30 > 0xF )
v23 = (_QWORD *)v28[0];
v24 = v25;
if ( v27 > 0xF )
v24 = (_QWORD *)v25[0];
if ( sub_14003EFB0((__int64)v24, v26, 0, (__int64)v23, v29) != -1 )
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 864), v17);
sub_14003D310((__int64)v25);
}
}
}
sub_14003D310((__int64)v28);
}
}