//
// GameLevelManager::getSavedLevel_1 from 0x100542e90 to 0x100542ed8 (72 bytes)
//
// 5 xrefs:
// > EditLevelLayer::onDeathTracker @ 0x1001dfa48
// > DailyLevelPage::refreshDailyPage @ 0x100216c99
// > sub_1002AF600 @ 0x1002af628
// > GauntletLayer::unlockActiveItem @ 0x10037faee
// > InfoLayer::onLevelInfo @ 0x100894f54
//
// 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:31:58 +0000
//
__int64 __fastcall GameLevelManager::getSavedLevel_1(__int64 a1, __int64 a2)
{
int v2; // eax
bool v3; // cc
unsigned int v4; // eax
unsigned int v6; // eax
if ( !a2 )
return 0;
v2 = *(_DWORD *)(a2 + 920);
v3 = v2 <= *(_DWORD *)(a2 + 924);
v4 = v2 - *(_DWORD *)(a2 + 924);
if ( !v3 )
return GameLevelManager::getSavedDailyLevel(a1, v4);
v6 = *(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332);
if ( *(_BYTE *)(a2 + 649) == 1 )
return GameLevelManager::getSavedGauntletLevel(a1, v6);
else
return GameLevelManager::getSavedLevel(a1, v6);
}