//
// LevelLeaderboard::getLocalScores from 0x931a74 to 0x931bf0 (380 bytes)
//
// 2 xrefs:
// > LevelLeaderboard::loadScores @ 0x93244c
// > ??> @ 0x9b868
//
// 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
//
cocos2d::CCArray *LevelLeaderboard::getLocalScores(LevelLeaderboard *a1)
{
cocos2d::CCArray *v2; // x24
GJGameLevel *m_level; // x0
std::string *p_m_localBestPoints; // x1
int *m_start; // x19
int *m_finish; // x25
int v8; // w22
GJLocalScore *v9; // x21
int m_M_ID; // w23
LevelLeaderboardMode m_mode; // w0
std::vector v12; // [xsp+60h] [xbp+60h] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
m_level = a1->m_level;
if ( a1->m_mode == Points )
p_m_localBestPoints = &m_level->m_localBestPoints;
else
p_m_localBestPoints = &m_level->m_localBestTimes;
if ( !*((_QWORD *)p_m_localBestPoints->m_data.m_data - 3) )
return v2;
memset(&v12, 0, sizeof(v12));
GJGameLevel::scoreStringToVector(m_level, p_m_localBestPoints, &v12);
m_start = v12.m_start;
m_finish = v12.m_finish;
if ( v12.m_start != v12.m_finish )
{
while ( 1 )
{
v8 = *m_start;
v9 = GJLocalScore::create(*m_start, a1->m_mode);
m_M_ID = a1->m_level->m_M_ID;
if ( m_M_ID != GameManager::sharedState()->m_leaderboardLevelID )
goto LABEL_8;
m_mode = a1->m_mode;
if ( m_mode )
break;
if ( GameManager::sharedState()->m_leaderboardLevelTime == v8 )
goto LABEL_14;
if ( a1->m_mode == Points )
goto LABEL_13;
LABEL_8:
cocos2d::CCArray::addObject(v2, v9);
if ( m_finish == ++m_start )
{
m_finish = v12.m_start;
goto LABEL_16;
}
}
if ( m_mode != Points )
goto LABEL_8;
LABEL_13:
if ( GameManager::sharedState()->m_leaderboardLevelPoints == v8 )
{
LABEL_14:
v9->m_currentScore = 1;
goto LABEL_8;
}
goto LABEL_8;
}
LABEL_16:
if ( m_finish )
operator delete(m_finish);
return v2;
}