//
// GameLevelManager::createAndGetScores from 0x100095fa8 to 0x100096140 (408 bytes)
//
// 3 xrefs:
// > GameLevelManager::onGetLeaderboardScoresCompleted @ 0x10008b9a0
// > GameLevelManager::onGetUsersCompleted @ 0x10008e89c
// > GameLevelManager::onGetLevelLeaderboardCompleted @ 0x100090998
//
// 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
//
__int64 __fastcall GameLevelManager::createAndGetScores(_QWORD *a1, char *a2, int a3)
{
__int64 v6; // x21
__int64 v7; // x22
__int64 v8; // x23
cocos2d::CCString *v9; // x0
char *CString; // x0
cocos2d::CCDictionary *v11; // x0
GJUserScore *v12; // x0
GJUserScore *v13; // x24
int m_userID; // w25
int m_accountID; // w26
void *v17[2]; // [xsp+0h] [xbp-90h] BYREF
char *longStorage; // [xsp+10h] [xbp-80h]
std::string __dst; // [xsp+20h] [xbp-70h] BYREF
std::string __p; // [xsp+38h] [xbp-58h] BYREF
v6 = sub_10024A15C(a1);
if ( a2[23] < 0 )
a2 = *(char **)a2;
sub_100009900(&__p, a2);
v7 = sub_100093338(&__p, "|");
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( (unsigned int)sub_10024A36C(v7) )
{
v8 = 0;
do
{
v9 = (cocos2d::CCString *)sub_10024A388(v7, v8);
CString = (char *)cocos2d::CCString::getCString(v9);
sub_100009900(&__p, CString);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__dst, __p.__r_.__value_.__l.__data_, __p.__r_.__value_.__l.__size_);
else
__dst = __p;
v11 = GameLevelManager::responseToDict((char *)&__dst, 0);
v12 = GJUserScore::create(v11);
v13 = v12;
if ( SHIBYTE(__dst.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(__dst.__r_.__value_.__l.__data_);
if ( v13 )
{
LABEL_14:
v13->m_scoreType = a3;
sub_10024A2D0(v6, v13);
m_userID = v13->m_userID;
m_accountID = v13->m_accountID;
if ( v13->m_userName.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(v17, (void *)v13->m_userName.m_data.m_long.capacitym1, v13->m_userName.m_data.m_long.size);
}
else
{
*(_OWORD *)v17 = *(_OWORD *)&v13->m_userName.m_data.m_short.sizex2;
longStorage = v13->m_userName.m_data.m_long.longStorage;
}
GameLevelManager::storeUserName(a1, m_userID, m_accountID, (char *)v17);
if ( SHIBYTE(longStorage) < 0 )
operator delete(v17[0]);
}
}
else if ( v12 )
{
goto LABEL_14;
}
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v8 = (unsigned int)(v8 + 1);
}
while ( (unsigned int)v8 < (unsigned int)sub_10024A36C(v7) );
}
return v6;
}