//
// GJLevelList::completedLevels from 0x140273540 to 0x1402735db (155 bytes)
//
// 5 xrefs:
// > LevelListCell::loadFromList @ 0x14015e530
// > LevelListLayer::updateStatsArt @ 0x14042d165
// > LevelListLayer::onClaimReward @ 0x14042df55
// > LevelListLayer::onClaimReward @ 0x14042dfab
// > ??> @ 0x14091cb98
//
// 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:55 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall GJLevelList::completedLevels(__int64 a1)
{
__int64 result; // rax
unsigned int *v2; // rbx
unsigned int *i; // rsi
unsigned int v4; // edi
__int64 v5; // rcx
char hasCompletedOnlineLevel; // cl
void *v7; // [rsp+30h] [rbp+8h]
result = 0;
v2 = *(unsigned int **)(a1 + 320);
for ( i = *(unsigned int **)(a1 + 328); v2 != i; ++v2 )
{
v4 = result;
v5 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v7 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v5 = qword_14090BFE0;
}
hasCompletedOnlineLevel = GameStatsManager::hasCompletedOnlineLevel(v5, *v2);
result = v4 + 1;
if ( !hasCompletedOnlineLevel )
result = v4;
}
return result;
}