//
// GJAccountSettingsLayer::onFriendRequests from 0xa1d058 to 0xa1d0f8 (160 bytes)
//
// 6 xrefs:
// > GJAccountSettingsLayer::init @ 0xa38a5c
// > ??> @ 0xfd8e8
// > GJAccountSettingsLayer::init @ 0xa37f30
// > GJAccountSettingsLayer::init @ 0xa37fd0
// > GJAccountSettingsLayer::init @ 0xa3806c
// > ??> @ 0x1547b88
//
// This function is hookable on this platform (idp: arm, 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:59:38 +0000
//
__int64 __fastcall GJAccountSettingsLayer::onFriendRequests(GJAccountSettingsLayer *this, cocos2d::CCObject *a2)
{
__int64 result; // x0
unsigned int *v4; // x1
CCMenuItemToggler **v5; // x20
char *v6; // x21
CCMenuItemToggler *v7; // x19
__int64 v8; // x0
unsigned __int8 v9; // w1
if ( a2 )
*((_DWORD *)this + 167) = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
result = *((_QWORD *)this + 91);
if ( result )
{
v4 = *(unsigned int **)(result + 56);
result = *v4;
if ( (_DWORD)result )
{
v5 = *((CCMenuItemToggler ***)v4 + 2);
result = 8LL * (unsigned int)result - 8;
v6 = (char *)v5 + result;
if ( v5 <= (CCMenuItemToggler **)((char *)v5 + result) )
{
do
{
v7 = *v5;
if ( !*v5 )
break;
v8 = (__int64)*v5++;
v9 = (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v7 + 64LL))(v8) != *((_DWORD *)this + 167);
result = CCMenuItemToggler::toggle(v7, v9);
}
while ( v6 >= (char *)v5 );
}
}
}
return result;
}