//
// LevelLeaderboard::getLocalScores from 0x1003dbaf0 to 0x1003dbc42 (338 bytes)
//
// 1 xrefs:
// > LevelLeaderboard::loadScores @ 0x1003db5ef
//
// 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 *__fastcall LevelLeaderboard::getLocalScores(LevelLeaderboard *a1)
{
__int64 v1; // rsi
GJGameLevel *m_level; // rdi
std::string *p_m_localBestTimes; // rsi
unsigned int sizex2; // eax
std::__vector_base::pointer begin; // r15
int v7; // r13d
GJLocalScore *v8; // r12
int m_M_ID; // ebx
LevelLeaderboardMode m_mode; // eax
std::__vector_base::pointer end; // [rsp+0h] [rbp-50h]
cocos2d::CCArray *v13; // [rsp+8h] [rbp-48h]
std::vector __p[2]; // [rsp+10h] [rbp-40h] BYREF
v13 = (cocos2d::CCArray *)sub_10071F9E0(a1, v1);
m_level = a1->m_level;
p_m_localBestTimes = &m_level->m_localBestTimes;
if ( a1->m_mode == Points )
p_m_localBestTimes = &m_level->m_localBestPoints;
sizex2 = p_m_localBestTimes->m_data.m_short.sizex2;
if ( (sizex2 & 1) != 0 )
{
if ( !p_m_localBestTimes->m_data.m_long.size )
return v13;
}
else if ( !(sizex2 >> 1) )
{
return v13;
}
memset(__p, 0, 24);
GJGameLevel::scoreStringToVector(m_level, p_m_localBestTimes, __p);
begin = __p[0].__begin_;
end = __p[0].__end_;
if ( __p[0].__begin_ != __p[0].__end_ )
{
while ( 1 )
{
v7 = *begin;
v8 = GJLocalScore::create(*begin, a1->m_mode);
m_M_ID = a1->m_level->m_M_ID;
if ( m_M_ID == GameManager::sharedState()->m_leaderboardLevelID )
{
m_mode = a1->m_mode;
if ( m_mode == Time )
{
if ( v7 != GameManager::sharedState()->m_leaderboardLevelTime )
{
if ( a1->m_mode != Points )
goto LABEL_15;
LABEL_11:
if ( v7 != GameManager::sharedState()->m_leaderboardLevelPoints )
goto LABEL_15;
}
v8->m_currentScore = 1;
goto LABEL_15;
}
if ( m_mode == Points )
goto LABEL_11;
}
LABEL_15:
sub_10071FCD0(v13, v8);
if ( ++begin == end )
{
begin = __p[0].__begin_;
break;
}
}
}
if ( begin )
{
__p[0].__end_ = begin;
operator delete(begin);
}
return v13;
}