//
// GJAccountSettingsLayer::onGroupFriends from 0x14039eb80 to 0x14039ec41 (193 bytes)
//
// 5 xrefs:
// > GJAccountSettingsLayer::init @ 0x14039e541
// > GJAccountSettingsLayer::init @ 0x14039dc05
// > GJAccountSettingsLayer::init @ 0x14039dcd5
// > GJAccountSettingsLayer::init @ 0x14039dd80
// > ??> @ 0x1409234bc
//
// 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:31:16 +0000
//
__int64 __fastcall GJAccountSettingsLayer::onGroupFriends(__int64 a1, __int64 a2)
{
int v3; // eax
int v4; // esi
__int64 result; // rax
unsigned int *v6; // rdi
__int64 *v7; // rdi
__int64 *i; // rbp
__int64 v9; // rbx
__int64 v10; // rdx
if ( a2 )
{
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 56LL))(a2);
*(_DWORD *)(a1 + 684) = (v3 != 3) + 1;
*(_DWORD *)(a1 + 680) = (v3 == 2) + 1;
}
v4 = 3;
if ( *(_DWORD *)(a1 + 684) != 1 )
v4 = *(_DWORD *)(a1 + 680);
result = *(_QWORD *)(a1 + 736);
if ( result )
{
v6 = *(unsigned int **)(result + 56);
result = *v6;
if ( (_DWORD)result )
{
v7 = *((__int64 **)v6 + 2);
for ( i = &v7[result - 1]; v7 <= i; ++v7 )
{
v9 = *v7;
if ( !*v7 )
break;
LOBYTE(v10) = (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v9 + 56LL))(*v7) != v4;
result = CCMenuItemToggler::toggle(v9, v10);
}
}
}
return result;
}