//
// LevelLeaderboard::getLocalScores from 0xa81bd8 to 0xa81d9c (452 bytes)
//
// 2 xrefs:
// > LevelLeaderboard::loadScores @ 0xa821e0
// > ??> @ 0xccf28
//
// 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 13:00:32 +0000
//
cocos2d::CCArray *__fastcall LevelLeaderboard::getLocalScores(LevelLeaderboard *this)
{
cocos2d::CCArray *v2; // x25
__int64 v3; // x0
__int64 v4; // x1
__int64 v5; // x3
unsigned int *v7; // x19
unsigned int *v8; // x24
int v9; // w22
cocos2d::CCObject *v10; // x21
GameManager *v11; // x0
int v12; // w23
GameManager *v13; // x0
void *v14; // [xsp+60h] [xbp+60h] BYREF
void *v15; // [xsp+68h] [xbp+68h]
__int64 v16; // [xsp+70h] [xbp+70h]
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v3 = *((_QWORD *)this + 85);
if ( *((_DWORD *)this + 173) == 1 )
v4 = v3 + 1408;
else
v4 = v3 + 1384;
v5 = *(_BYTE *)v4 >> 1;
if ( (*(_BYTE *)v4 & 1) != 0 )
v5 = *(_QWORD *)(v4 + 8);
if ( v5 )
{
v14 = nullptr;
v15 = nullptr;
v16 = 0;
GJGameLevel::scoreStringToVector(v3, (char *)v4, (__int64)&v14);
v7 = (unsigned int *)v14;
v8 = (unsigned int *)v15;
if ( v14 == v15 )
{
LABEL_18:
if ( v8 )
{
if ( v15 != v8 )
v15 = (char *)v15 + 4 * ~((unsigned __int64)((char *)v15 - 4 - (char *)v8) >> 2);
operator delete(v8);
}
return v2;
}
while ( 1 )
{
v9 = *v7;
v10 = (cocos2d::CCObject *)GJLocalScore::create((GJLocalScore *)*v7, *((_DWORD *)this + 173));
v11 = *((GameManager **)this + 85);
v12 = *((_DWORD *)v11 + 286);
if ( v12 != *(_DWORD *)(GameManager::sharedState(v11) + 1688) )
goto LABEL_10;
v13 = (GameManager *)*((unsigned int *)this + 173);
if ( (_DWORD)v13 )
break;
if ( *(_DWORD *)(GameManager::sharedState(v13) + 1692) == v9 )
goto LABEL_16;
v13 = (GameManager *)*((unsigned int *)this + 173);
if ( (_DWORD)v13 == 1 )
goto LABEL_15;
LABEL_10:
cocos2d::CCArray::addObject(v2, v10);
if ( v8 == ++v7 )
{
v8 = (unsigned int *)v14;
goto LABEL_18;
}
}
if ( (_DWORD)v13 != 1 )
goto LABEL_10;
LABEL_15:
if ( *(_DWORD *)(GameManager::sharedState(v13) + 1696) == v9 )
{
LABEL_16:
*((_BYTE *)v10 + 64) = 1;
goto LABEL_10;
}
goto LABEL_10;
}
return v2;
}