//
// LeaderboardsLayer::loadLeaderboardFinished from 0x94e9a4 to 0x94eb20 (380 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'LeaderboardsLayer::loadLeaderboardFinished @ 0x94eb24
// > ??> @ 0x76f90
// > ??> @ 0x146a508
//
// This function is hookable on this platform (idp: arm, 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:57:21 +0000
//
__int64 __fastcall LeaderboardsLayer::loadLeaderboardFinished(
LeaderboardsLayer *this,
cocos2d::CCArray *a2,
const char *a3)
{
size_t v6; // x0
size_t v7; // x19
unsigned __int64 v8; // x0
char *v9; // x3
_BOOL4 isCorrect; // w19
cocos2d::CCObject *v11; // x0
__int64 v13; // [xsp+50h] [xbp+50h] BYREF
size_t v14; // [xsp+58h] [xbp+58h]
void *v15; // [xsp+60h] [xbp+60h]
v13 = 0;
v14 = 0;
v15 = nullptr;
v6 = strlen(a3);
v7 = v6;
if ( v6 > 0xFFFFFFFFFFFFFFEFLL )
sub_62D21C();
if ( v6 > 0x16 )
{
v8 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v13 = v8 | 1;
v9 = (char *)operator new(v8);
v15 = v9;
v14 = v7;
LABEL_4:
v9 = (char *)memcpy(v9, a3, v7);
goto LABEL_5;
}
LOBYTE(v13) = 2 * v6;
v9 = (char *)&v13 + 1;
if ( v6 )
goto LABEL_4;
LABEL_5:
v9[v7] = 0;
isCorrect = LeaderboardsLayer::isCorrect((__int64)this, (char *)&v13);
if ( (v13 & 1) != 0 )
operator delete(v15);
if ( isCorrect )
{
v11 = *((cocos2d::CCObject **)this + 54);
if ( v11 )
cocos2d::CCObject::release(v11);
*((_QWORD *)this + 54) = a2;
cocos2d::CCObject::retain(a2);
LeaderboardsLayer::setupLevelBrowser(this, *((cocos2d::CCArray **)this + 54));
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 60) + 344LL))(*((_QWORD *)this + 60), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 61) + 344LL))(*((_QWORD *)this + 61), 0);
}
return _stack_chk_guard;
}