//
// LevelLeaderboard::onUpdate from 0x14042a400 to 0x14042a57f (383 bytes)
//
// 2 xrefs:
// > LevelLeaderboard::init @ 0x140428dd0
// > ??> @ 0x140926a98
//
// 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:32:12 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall LevelLeaderboard::onUpdate(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rcx
__int64 v5; // rdx
__int64 v6; // rcx
void *v7; // [rsp+40h] [rbp+18h]
void *v8; // [rsp+40h] [rbp+18h]
void *v9; // [rsp+40h] [rbp+18h]
v2 = GJAccountManager::sharedState();
if ( *(_DWORD *)(v2 + 360) - *(_DWORD *)(v2 + 364) > 0 )
{
v3 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v7 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v7);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v3 = *(_QWORD *)&qword_14090BFB0;
}
if ( (unsigned int)GameLevelManager::getTimeLeft(v3, "upd_ll", 5.0) - 1 > 4 )
{
v4 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v8 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v8);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v4 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::makeTimeStamp(v4, "upd_ll");
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 720) + 336LL))(*(_QWORD *)(a1 + 720), 0);
LOBYTE(v5) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 712) + 336LL))(*(_QWORD *)(a1 + 712), v5);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 728) + 336LL))(*(_QWORD *)(a1 + 728), 0);
LevelLeaderboard::setupLeaderboard(a1, 0);
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v9 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v9);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v6 + 1424) = a1 + 664;
GameLevelManager::getLevelLeaderboard(v6, *(_QWORD *)(a1 + 680), *(_DWORD *)(a1 + 688), *(_DWORD *)(a1 + 692));
}
}
}