//
// LevelBrowserLayer::selectedCount from 0x1403ea240 to 0x1403ea298 (88 bytes)
//
// 7 xrefs:
// > LevelBrowserLayer::init @ 0x1403e2ee1
// > LevelBrowserLayer::loadLevelsFinished @ 0x1403e60f1
// > LevelBrowserLayer::onProcessSelected @ 0x1403e957b
// > LevelBrowserLayer::onToggleAllObjects @ 0x1403ea15f
// > LevelBrowserLayer::onToggleAllObjects @ 0x1403ea1d1
// > LevelBrowserLayer::onSelectionChanged @ 0x1403ea220
// > LevelListLayer::loadLevelsFinished @ 0x14042e9b4
//
// 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:31:44 +0000
//
__int64 __fastcall LevelBrowserLayer::selectedCount(__int64 a1)
{
__int64 result; // rax
unsigned int *v2; // rdx
unsigned int v3; // r9d
__int64 v4; // rax
__int64 *v5; // rdx
__int64 *i; // r10
__int64 v7; // r8
unsigned int v8; // ecx
result = *(_QWORD *)(a1 + 656);
if ( result )
{
v2 = *(unsigned int **)(result + 56);
v3 = 0;
v4 = *v2;
if ( (_DWORD)v4 )
{
v5 = *((__int64 **)v2 + 2);
for ( i = &v5[v4 - 1]; v5 <= i; v3 = v8 )
{
v7 = *v5;
if ( !*v5 )
break;
++v5;
v8 = v3 + 1;
if ( !*(_BYTE *)(v7 + 843) )
v8 = v3;
}
}
return v3;
}
return result;
}