//
// LeaderboardsLayer::isCorrect from 0x1402c3a50 to 0x1402c3b96 (326 bytes)
//
// 3 xrefs:
// > LeaderboardsLayer::loadLeaderboardFinished @ 0x1402c38c5
// > LeaderboardsLayer::loadLeaderboardFailed @ 0x1402c3980
// > ??> @ 0x1406d2a8c
//
// 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
//
// Hidden C++ exception states: #wind=2
_BOOL8 __fastcall LeaderboardsLayer::isCorrect(__int64 a1, _QWORD *a2)
{
int v4; // esi
cocos2d::CCString *v5; // rax
const char *CString; // rax
size_t v7; // r8
bool v8; // di
void *v9; // rcx
void *v11; // [rsp+20h] [rbp-48h]
void *Block[2]; // [rsp+30h] [rbp-38h] BYREF
__int64 v13; // [rsp+40h] [rbp-28h]
unsigned __int64 v14; // [rsp+48h] [rbp-20h]
if ( *(_DWORD *)(a1 + 440) == 3 )
v4 = 0;
else
v4 = *(_DWORD *)(a1 + 444);
if ( !qword_1406C2EC0 )
{
v11 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v5 = cocos2d::CCString::createWithFormat("lb_%i_%i", *(_DWORD *)(a1 + 440), v4);
CString = cocos2d::CCString::getCString(v5);
*(_OWORD *)Block = 0;
v13 = 0;
v14 = 0;
v7 = -1;
do
++v7;
while ( CString[v7] );
sub_14003A930(Block, CString, v7);
v8 = sub_14003A760(Block, a2) == 0;
if ( v14 > 0xF )
{
v9 = Block[0];
if ( v14 + 1 >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
sub_14003A830((__int64)a2);
return v8;
}