//
// LeaderboardsLayer::isCorrect from 0x100514e80 to 0x100514f43 (195 bytes)
//
// 2 xrefs:
// > LeaderboardsLayer::loadLeaderboardFinished @ 0x100514dbd
// > LeaderboardsLayer::loadLeaderboardFailed @ 0x100515001
//
// 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:38 +0000
//
bool __fastcall LeaderboardsLayer::isCorrect(__int64 a1, unsigned __int8 *a2, double a3)
{
unsigned int v3; // r14d
__int64 v4; // rax
unsigned int v5; // r15d
unsigned __int8 v6; // r13
void *v7; // r14
size_t v8; // r12
char *p_s1; // rdi
size_t v10; // r15
const void *v11; // rbx
size_t v12; // rdx
int v13; // ebx
unsigned __int8 v15; // [rsp+0h] [rbp-40h] BYREF
char __s1; // [rsp+1h] [rbp-3Fh] BYREF
size_t v17; // [rsp+8h] [rbp-38h]
void *__p; // [rsp+10h] [rbp-30h]
v3 = 0;
if ( *(_DWORD *)(a1 + 440) != 3 )
v3 = *(_DWORD *)(a1 + 444);
v4 = GameLevelManager::sharedState(a3);
GameLevelManager::getLeaderboardKey(&v15, v4, *(unsigned int *)(a1 + 440), v3);
v5 = *a2;
v6 = v15;
v7 = __p;
if ( (v15 & 1) != 0 )
{
v8 = v17;
p_s1 = (char *)__p;
if ( (v5 & 1) == 0 )
{
LABEL_5:
v10 = v5 >> 1;
v11 = a2 + 1;
goto LABEL_8;
}
}
else
{
v8 = v15 >> 1;
p_s1 = &__s1;
if ( (v5 & 1) == 0 )
goto LABEL_5;
}
v10 = *((_QWORD *)a2 + 1);
v11 = *((const void **)a2 + 2);
LABEL_8:
v12 = v8;
if ( v10 < v8 )
v12 = v10;
v13 = memcmp(p_s1, v11, v12);
if ( (v6 & 1) != 0 )
operator delete(v7);
return v13 == 0 && v10 == v8;
}