//
// GJRequestCell::onViewFriendRequest from 0x140159100 to 0x140159298 (408 bytes)
//
// 2 xrefs:
// > GJRequestCell::loadFromScore @ 0x140158f36
// > ??> @ 0x140917a08
//
// 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:27:21 +0000
//
// Hidden C++ exception states: #wind=2
struct cocos2d::CCObject *__fastcall GJRequestCell::onViewFriendRequest(__int64 a1)
{
struct cocos2d::CCObject *result; // rax
__int64 v3; // rcx
struct cocos2d::CCObject *v4; // rsi
__int64 v5; // rax
__int64 v6; // rcx
__int64 v7; // rax
int v8; // edi
__int64 v9; // rcx
struct cocos2d::CCObject *v10; // rax
int v11; // ecx
__int64 v12; // rax
void *v13; // [rsp+30h] [rbp+8h]
void *v14; // [rsp+30h] [rbp+8h]
result = *(struct cocos2d::CCObject **)(a1 + 560);
if ( result && *((int *)result + 98) > 0 )
{
v3 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v13 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v13);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v3 = *(_QWORD *)&qword_14090BFB0;
}
result = cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(v3 + 1240),
*(int *)(*(_QWORD *)(a1 + 560) + 392LL));
v4 = result;
if ( result )
{
if ( !*(_BYTE *)(a1 + 576) && *(_BYTE *)(*(_QWORD *)(a1 + 560) + 796LL) )
{
v5 = (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 544) + 472LL))(*(_QWORD *)(a1 + 544), 100);
if ( v5 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 336LL))(v5, 0);
*(_BYTE *)(*(_QWORD *)(a1 + 560) + 796LL) = 0;
v7 = GJAccountManager::sharedState(v6);
v8 = *(_DWORD *)(v7 + 360) - *(_DWORD *)(v7 + 364);
v9 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v14 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v14);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v9 = *(_QWORD *)&qword_14090BFB0;
}
v10 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v9 + 1232), v8);
if ( v10 )
{
v11 = *((_DWORD *)v10 + 192) - 1;
if ( v11 < 0 )
v11 = 0;
*((_DWORD *)v10 + 192) = v11;
}
}
v12 = FriendRequestPopup::create(v4, *(unsigned __int8 *)(a1 + 576));
return (struct cocos2d::CCObject *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 1064LL))(v12);
}
}
return result;
}