//
// FRequestProfilePage::deleteSelected from 0x100871520 to 0x100871707 (487 bytes)
//
// 2 xrefs:
// > FRequestProfilePage::FLAlert_Clicked @ 0x100871814
// > sub_100871820 @ 0x10087184b
//
// 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:51 +0000
//
char __fastcall FRequestProfilePage::deleteSelected(__int64 a1)
{
__int64 v2; // rax
__int64 StoredOnlineLevels; // rax
__int64 v4; // r15
void *v5; // r14
unsigned int *v6; // rax
__int64 *v7; // r13
__int64 *v8; // r12
__int64 v9; // r15
__int64 v10; // rdi
char *v11; // rsi
const char *v12; // rcx
char *v13; // rax
__int64 v14; // rbx
__int64 v15; // rax
int v16; // ecx
bool v17; // cc
int v18; // ecx
char v20; // [rsp+8h] [rbp-48h] BYREF
_BYTE __p[23]; // [rsp+9h] [rbp-47h]
int v22; // [rsp+24h] [rbp-2Ch]
v2 = GameLevelManager::sharedState();
if ( (*(_BYTE *)(a1 + 712) & 1) != 0 )
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v2, *(const char **)(a1 + 728));
if ( !StoredOnlineLevels )
return StoredOnlineLevels;
}
else
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v2, (const char *)(a1 + 713));
if ( !StoredOnlineLevels )
return StoredOnlineLevels;
}
v4 = StoredOnlineLevels;
v5 = sub_1007FE900();
v6 = *(unsigned int **)(v4 + 56);
if ( *v6 )
{
v7 = *((__int64 **)v6 + 2);
v8 = &v7[*v6 - 1];
v22 = 0;
do
{
v9 = *v7;
if ( !*v7 )
break;
if ( *(_BYTE *)(v9 + 725) == 1 )
{
sub_1007FEBF0((__int64)v5, *v7);
if ( !*(_BYTE *)(a1 + 704) && *(_BYTE *)(v9 + 724) == 1 )
{
*(_BYTE *)(v9 + 724) = 0;
++v22;
}
}
++v7;
}
while ( v7 <= v8 );
}
else
{
v22 = 0;
}
LODWORD(StoredOnlineLevels) = sub_1007FEF90((__int64)v5);
if ( (_DWORD)StoredOnlineLevels )
{
*(_QWORD *)(GameLevelManager::sharedState() + 1376) = a1 + 688;
*(_QWORD *)(GameLevelManager::sharedState() + 1360) = a1 + 672;
v10 = GameLevelManager::sharedState();
v11 = nullptr;
LOBYTE(StoredOnlineLevels) = GameLevelManager::deleteFriendRequests(v10, 0, (__int64)v5, *(_BYTE *)(a1 + 704));
if ( (_BYTE)StoredOnlineLevels )
{
v12 = "Ignoring Requests...";
if ( *(_BYTE *)(a1 + 704) )
v12 = "Deleting Requests...";
v20 = 40;
*(_OWORD *)__p = *(_OWORD *)v12;
*(_DWORD *)&__p[16] = *((_DWORD *)v12 + 4);
__p[20] = 0;
v11 = &v20;
v13 = UploadActionPopup::create(a1 + 680, (__int128 *)&v20);
*(_QWORD *)(a1 + 800) = v13;
if ( (v20 & 1) != 0 )
{
operator delete(*(void **)&__p[15]);
v13 = *(char **)(a1 + 800);
}
v10 = (__int64)v13;
LOBYTE(StoredOnlineLevels) = (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v13 + 1312LL))(v13);
}
if ( v22 > 0 )
{
v14 = GameLevelManager::sharedState();
v15 = GJAccountManager::sharedState(v10, (__int64)v11);
StoredOnlineLevels = GameLevelManager::userInfoForAccountID(v14, *(_DWORD *)(v15 + 352) - *(_DWORD *)(v15 + 356));
if ( StoredOnlineLevels )
{
v16 = *(_DWORD *)(StoredOnlineLevels + 696);
v17 = v16 <= v22;
v18 = v16 - v22;
if ( v17 )
v18 = 0;
*(_DWORD *)(StoredOnlineLevels + 696) = v18;
}
}
}
return StoredOnlineLevels;
}