//
// GJRequestCell::onViewFriendRequest from 0x1002406d0 to 0x1002407e8 (280 bytes)
//
// 1 xrefs:
// > GJRequestCell::loadFromScore @ 0x100231f48
//
// 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:27:17 +0000
//
__int64 __fastcall GJRequestCell::onViewFriendRequest(__int64 a1, double a2)
{
__int64 result; // rax
__int64 v4; // rax
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // r15
__int64 v8; // rdi
__int64 v9; // rsi
__int64 v10; // rax
__int64 v11; // r14
__int64 v12; // rax
int v13; // esi
__int64 v14; // rax
result = *(_QWORD *)(a1 + 552);
if ( result )
{
if ( *(int *)(result + 376) > 0 )
{
v4 = GameLevelManager::sharedState(a2);
result = GameLevelManager::friendRequestFromAccountID(v4, *(unsigned int *)(*(_QWORD *)(a1 + 552) + 376LL));
if ( result )
{
if ( !*(_BYTE *)(a1 + 568) )
{
v6 = *(_QWORD *)(a1 + 552);
if ( *(_BYTE *)(v6 + 724) == 1 )
{
v7 = result;
v8 = *(_QWORD *)(a1 + 536);
v9 = 100;
v10 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 480LL))(v8, 100);
if ( v10 )
{
v8 = v10;
v9 = 0;
a2 = (*(double (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 344LL))(v10, 0);
}
*(_BYTE *)(*(_QWORD *)(a1 + 552) + 724LL) = 0;
v11 = GameLevelManager::sharedState(a2);
v12 = GJAccountManager::sharedState(v8, v9);
v6 = GameLevelManager::userInfoForAccountID(
v11,
(unsigned int)(*(_DWORD *)(v12 + 352) - *(_DWORD *)(v12 + 356)));
result = v7;
if ( v6 )
{
v5 = *(unsigned int *)(v6 + 696);
v13 = 1;
if ( (int)v5 >= 2 )
v13 = *(_DWORD *)(v6 + 696);
*(_DWORD *)(v6 + 696) = v13 - 1;
}
}
}
v14 = FriendRequestPopup::create(result, *(unsigned __int8 *)(a1 + 568), v5, v6);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 1312LL))(v14);
}
}
}
return result;
}