//
// LeaderboardsLayer::isCorrect from 0x56352c to 0x5635d6 (170 bytes)
//
// 2 xrefs:
// > LeaderboardsLayer::loadLeaderboardFinished @ 0x564486
// > LeaderboardsLayer::loadLeaderboardFailed @ 0x56452c
//
// 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:52:26 +0000
//
bool __fastcall LeaderboardsLayer::isCorrect(int a1, unsigned __int8 *a2, char *a3, int a4)
{
int v6; // r6
int v7; // r0
int v8; // r4
int v9; // r3
size_t v10; // r6
int v11; // r2
unsigned int v12; // r4
char *v13; // r0
const void *v14; // r1
size_t v15; // r2
int v16; // r5
int v18; // [sp+0h] [bp-10h] BYREF
size_t v19; // [sp+4h] [bp-Ch]
char *v20; // [sp+8h] [bp-8h]
int v21; // [sp+Ch] [bp-4h]
v18 = a1;
v19 = (size_t)a2;
v20 = a3;
v21 = a4;
if ( *(_DWORD *)(a1 + 332) == 3 )
v6 = 0;
else
v6 = *(_DWORD *)(a1 + 336);
v7 = GameLevelManager::sharedState((GameLevelManager *)a1);
GameLevelManager::getLeaderboardKey(&v18, v7, *(const char **)(a1 + 332), v6);
v8 = *a2;
v9 = v18 & 1;
if ( v9 )
v10 = v19;
else
v10 = (int)(unsigned __int8)v18 >> 1;
v11 = v8 & 1;
if ( (v8 & 1) != 0 )
{
v12 = *((_DWORD *)a2 + 1);
if ( !v9 )
{
v13 = (char *)&v18 + 1;
LABEL_12:
v14 = *((const void **)a2 + 2);
goto LABEL_15;
}
}
else
{
v12 = v8 >> 1;
if ( !v9 )
{
v13 = (char *)&v18 + 1;
goto LABEL_14;
}
}
v13 = v20;
if ( v11 )
goto LABEL_12;
LABEL_14:
v14 = a2 + 1;
LABEL_15:
v15 = v12;
if ( v12 >= v10 )
v15 = v10;
if ( !v15 || (v16 = memcmp(v13, v14, v15)) == 0 )
{
if ( v10 < v12 )
v16 = -1;
else
v16 = v10 > v12;
}
std::string::~string((int)&v18);
return v16 == 0;
}