//
// LevelLeaderboard::isCorrect from 0x614e08 to 0x614efa (242 bytes)
//
// 2 xrefs:
// > LevelLeaderboard::loadLeaderboardFinished @ 0x614f08
// > LevelLeaderboard::loadLeaderboardFailed @ 0x614f7c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:54:54 +0000
//
bool __fastcall LevelLeaderboard::isCorrect(LevelLeaderboard *this, const char *a2)
{
int v4; // r0
const char *LevelLeaderboardKey; // r0
const char *v6; // r8
size_t v7; // r0
size_t v8; // r0
int v9; // r3
size_t v10; // r9
unsigned int v11; // r4
char *v12; // r0
char *v13; // r1
size_t v14; // r2
int v15; // r5
int v17; // [sp+4h] [bp+0h] BYREF
unsigned int v18; // [sp+8h] [bp+4h]
char *v19; // [sp+Ch] [bp+8h]
int v20; // [sp+10h] [bp+Ch] BYREF
size_t v21; // [sp+14h] [bp+10h]
char *v22; // [sp+18h] [bp+14h]
v4 = GameLevelManager::sharedState(this);
LevelLeaderboardKey = (const char *)GameLevelManager::getLevelLeaderboardKey(
v4,
(const char *)(*(_DWORD *)(*((_DWORD *)this + 132) + 268)
- *(_DWORD *)(*((_DWORD *)this + 132) + 272)));
v17 = 0;
v18 = 0;
v19 = nullptr;
v6 = LevelLeaderboardKey;
v7 = strlen(LevelLeaderboardKey);
std::string::__init(&v17, v6, v7);
v20 = 0;
v21 = 0;
v22 = nullptr;
v8 = strlen(a2);
std::string::__init(&v20, a2, v8);
v9 = v20 & 1;
if ( v9 )
v10 = v21;
else
v10 = (int)(unsigned __int8)v20 >> 1;
if ( (v17 & 1) != 0 )
{
v11 = v18;
if ( !v9 )
{
v12 = (char *)&v20 + 1;
LABEL_9:
v13 = v19;
goto LABEL_12;
}
}
else
{
v11 = (int)(unsigned __int8)v17 >> 1;
if ( !v9 )
{
v12 = (char *)&v20 + 1;
goto LABEL_11;
}
}
v12 = v22;
if ( (v17 & 1) != 0 )
goto LABEL_9;
LABEL_11:
v13 = (char *)&v17 + 1;
LABEL_12:
v14 = v11;
if ( v11 >= v10 )
v14 = v10;
if ( !v14 || (v15 = memcmp(v12, v13, v14)) == 0 )
{
if ( v10 < v11 )
v15 = -1;
else
v15 = v10 > v11;
}
std::string::~string((int)&v20);
std::string::~string((int)&v17);
return v15 == 0;
}