//
// FriendsProfilePage::onToggleSort from 0x100735d40 to 0x100735e53 (275 bytes)
//
// 1 xrefs:
// > FriendsProfilePage::init @ 0x100735620
//
// 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 12:36:24 +0000
//
__int64 __fastcall FriendsProfilePage::onToggleSort(__int64 a1)
{
char v2; // al
__int64 v3; // rcx
const char *v4; // rdi
const char *v5; // rsi
__int64 v6; // rdi
void **v7; // rax
size_t v8; // rsi
int (__cdecl *v9)(const void *, const void *); // rcx
unsigned int v10; // eax
v2 = *(_BYTE *)(a1 + 944);
*(_BYTE *)(a1 + 944) = v2 ^ 1;
v3 = *(_QWORD *)(a1 + 936);
if ( v3 )
{
v4 = "New";
if ( *(_BYTE *)(a1 + 968) )
v4 = "Old";
v5 = "A-Z";
if ( *(_BYTE *)(a1 + 968) )
v5 = "Z-A";
if ( !v2 )
v5 = v4;
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(v3 + 624) + 928LL))(*(_QWORD *)(v3 + 624), v5);
}
v6 = *(_QWORD *)(a1 + 856);
if ( v6 && (unsigned int)sub_1007FEF90(v6) >= 2 )
{
v7 = *(void ***)(*(_QWORD *)(a1 + 856) + 56LL);
v8 = *(unsigned int *)v7;
v9 = (int (__cdecl *)(const void *, const void *))sub_100734500;
if ( *(_BYTE *)(a1 + 944) )
v9 = (int (__cdecl *)(const void *, const void *))sub_100734680;
qsort(v7[2], v8, 8u, v9);
if ( *(_BYTE *)(a1 + 968) == 1 )
sub_1007FF280(*(_QWORD *)(a1 + 856), v8);
}
v10 = *(unsigned __int8 *)(a1 + 880);
if ( (v10 & 1) == 0 )
{
if ( !(v10 >> 1) )
goto LABEL_20;
goto LABEL_19;
}
if ( *(_QWORD *)(a1 + 888) )
LABEL_19:
FriendsProfilePage::filterUsersWithQuery(a1, a1 + 880);
LABEL_20:
FriendsProfilePage::updateCountLabel(a1);
return ScrollableContentLayer::reloadVirtualRows(*(_QWORD *)(a1 + 688), 0.0);
}