//
// LevelLeaderboard::isCorrect from 0x100250db4 to 0x100250ea0 (236 bytes)
//
// 2 xrefs:
// > LevelLeaderboard::loadLeaderboardFinished @ 0x100250ed4
// > LevelLeaderboard::loadLeaderboardFailed @ 0x100250f74
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall LevelLeaderboard::isCorrect(LevelLeaderboard *a1, const char *a2)
{
GameLevelManager *v4; // x0
char *LevelLeaderboardKey; // x0
unsigned __int8 v6; // w24
__int64 v7; // x25
void *v8; // x20
size_t v9; // x21
_QWORD *v10; // x0
size_t v11; // x22
void **v12; // x1
size_t v13; // x2
int v14; // w19
_QWORD v17[2]; // [xsp+0h] [xbp-70h] BYREF
char v18; // [xsp+17h] [xbp-59h]
void *__p[2]; // [xsp+18h] [xbp-58h] BYREF
unsigned __int8 v20; // [xsp+2Fh] [xbp-41h]
v4 = GameLevelManager::sharedState();
LevelLeaderboardKey = (char *)GameLevelManager::getLevelLeaderboardKey(
v4,
a1->m_level->m_levelID.random - a1->m_level->m_levelID.seed,
a1->m_type,
a1->m_mode);
sub_100009900(__p, LevelLeaderboardKey);
sub_100009900(v17, (char *)a2);
v6 = v20;
v7 = v18;
v8 = (void *)v17[0];
if ( v18 >= 0 )
v9 = v18;
else
v9 = v17[1];
if ( v18 >= 0 )
v10 = v17;
else
v10 = (_QWORD *)v17[0];
if ( (v20 & 0x80u) == 0 )
v11 = v20;
else
v11 = (size_t)__p[1];
if ( (v20 & 0x80u) == 0 )
v12 = __p;
else
v12 = (void **)__p[0];
if ( v11 >= v9 )
v13 = v9;
else
v13 = v11;
v14 = memcmp(v10, v12, v13);
if ( v7 < 0 )
{
operator delete(v8);
if ( (v20 & 0x80) == 0 )
return v11 == v9 && v14 == 0;
}
else if ( (v6 & 0x80) == 0 )
{
return v11 == v9 && v14 == 0;
}
operator delete(__p[0]);
return v11 == v9 && v14 == 0;
}