//
// FRequestProfilePage::selectedCount from 0x1402102f0 to 0x14021039c (172 bytes)
//
// 3 xrefs:
// > FRequestProfilePage::onToggleAllObjects @ 0x14021026f
// > FRequestProfilePage::updateSelectUI @ 0x1402103c9
// > ??> @ 0x14091b458
//
// 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:28:19 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall FRequestProfilePage::selectedCount(__int64 a1)
{
unsigned int v1; // ebx
_QWORD *v2; // rdi
__int64 v3; // rcx
__int64 StoredOnlineLevels; // rax
unsigned int *v5; // rcx
__int64 v6; // rax
unsigned __int64 v7; // rcx
unsigned __int64 i; // r8
unsigned int v9; // edx
void *v11; // [rsp+30h] [rbp+8h]
v1 = 0;
v2 = (_QWORD *)(a1 + 712);
if ( *(_QWORD *)(a1 + 736) > 0xFu )
v2 = (_QWORD *)*v2;
v3 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v11 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v11);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v3 = *(_QWORD *)&qword_14090BFB0;
}
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v3, v2);
if ( StoredOnlineLevels )
{
v5 = *(unsigned int **)(StoredOnlineLevels + 56);
v6 = *v5;
if ( (_DWORD)v6 )
{
v7 = *((_QWORD *)v5 + 2);
for ( i = v7 + 8 * (v6 - 1); v7 <= i; v7 += 8LL )
{
v9 = v1;
if ( !*(_QWORD *)v7 )
break;
++v1;
if ( !*(_BYTE *)(*(_QWORD *)v7 + 797LL) )
v1 = v9;
}
}
}
return v1;
}