//
// FriendsProfilePage::onToggleSortDir from 0x100735e60 to 0x100735fad (333 bytes)
//
// 1 xrefs:
// > FriendsProfilePage::init @ 0x100735712
//
// 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::onToggleSortDir(__int64 a1)
{
__int64 v2; // r14
__int64 v3; // rax
const char *v4; // rsi
__int64 v5; // rax
__int64 v6; // rax
const char *v7; // rdx
const char *v8; // rsi
__int64 v9; // rdi
void **v10; // rax
size_t v11; // rsi
int (__cdecl *v12)(const void *, const void *); // rcx
unsigned int v13; // eax
*(_BYTE *)(a1 + 968) ^= 1u;
v2 = *(_QWORD *)(a1 + 960);
if ( v2 )
{
v3 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v4 = "edit_downBtn_001.png";
if ( *(_BYTE *)(a1 + 968) )
v4 = "edit_upBtn_001.png";
v5 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v3, v4);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v2 + 1160LL))(v2, v5);
}
v6 = *(_QWORD *)(a1 + 936);
if ( v6 )
{
v7 = "New";
if ( *(_BYTE *)(a1 + 968) )
v7 = "Old";
v8 = "A-Z";
if ( *(_BYTE *)(a1 + 968) )
v8 = "Z-A";
if ( *(_BYTE *)(a1 + 944) )
v8 = v7;
(*(void (__fastcall **)(_QWORD, const char *, const char *))(**(_QWORD **)(v6 + 624) + 928LL))(
*(_QWORD *)(v6 + 624),
v8,
v7);
}
v9 = *(_QWORD *)(a1 + 856);
if ( v9 && (unsigned int)sub_1007FEF90(v9) >= 2 )
{
v10 = *(void ***)(*(_QWORD *)(a1 + 856) + 56LL);
v11 = *(unsigned int *)v10;
v12 = (int (__cdecl *)(const void *, const void *))sub_100734500;
if ( *(_BYTE *)(a1 + 944) )
v12 = (int (__cdecl *)(const void *, const void *))sub_100734680;
qsort(v10[2], v11, 8u, v12);
if ( *(_BYTE *)(a1 + 968) == 1 )
sub_1007FF280(*(_QWORD *)(a1 + 856), v11);
}
v13 = *(unsigned __int8 *)(a1 + 880);
if ( (v13 & 1) == 0 )
{
if ( !(v13 >> 1) )
goto LABEL_24;
goto LABEL_23;
}
if ( *(_QWORD *)(a1 + 888) )
LABEL_23:
FriendsProfilePage::filterUsersWithQuery(a1, a1 + 880);
LABEL_24:
FriendsProfilePage::updateCountLabel(a1);
return ScrollableContentLayer::reloadVirtualRows(*(_QWORD *)(a1 + 688), 0.0);
}