//
// GameLevelManager::createAndGetScores from 0x849368 to 0x84960c (676 bytes)
//
// 4 xrefs:
// > GameLevelManager::onGetLeaderboardScoresCompleted @ 0x849788
// > GameLevelManager::onGetLevelLeaderboardCompleted @ 0x849ac0
// > GameLevelManager::onGetUsersCompleted @ 0x849e0c
// > ??> @ 0xce758
//
// 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:55:22 +0000
//
cocos2d::CCArray *__fastcall GameLevelManager::createAndGetScores(_QWORD *a1, char *a2, int a3)
{
cocos2d::CCArray *v5; // x27
char *v6; // x19
char v7; // t1
size_t v8; // x0
cocos2d::CCArray *v9; // x24
unsigned int i; // w23
cocos2d::CCString *v11; // x0
const char *CString; // x0
size_t v13; // x0
GJUserScore *v14; // x0
cocos2d::CCDictionary *v15; // x1
__int64 v16; // x21
int v17; // w26
int v18; // w25
__int64 v19; // x1
char *v23; // [xsp+68h] [xbp+68h]
__int64 v24; // [xsp+70h] [xbp+70h] BYREF
size_t v25; // [xsp+78h] [xbp+78h]
void *v26; // [xsp+80h] [xbp+80h]
__int64 v27; // [xsp+88h] [xbp+88h] BYREF
size_t v28; // [xsp+90h] [xbp+90h]
void *v29; // [xsp+98h] [xbp+98h]
__int64 v30; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v31; // [xsp+A8h] [xbp+A8h]
void *v32; // [xsp+B0h] [xbp+B0h]
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard);
v7 = *a2;
v6 = a2 + 1;
if ( (v7 & 1) != 0 )
v6 = *((char **)a2 + 2);
v30 = 0;
v31 = 0;
v32 = nullptr;
v8 = strlen(v6);
std::string::__init(&v30, v6, v8);
v9 = sub_80CFCC((unsigned __int8 *)&v30, "|");
if ( (v30 & 1) != 0 )
operator delete(v32);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(v9); ++i )
{
v11 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, i);
CString = (const char *)cocos2d::CCString::getCString(v11);
v24 = 0;
v25 = 0;
v26 = nullptr;
v23 = (char *)CString;
v13 = strlen(CString);
std::string::__init(&v24, v23, v13);
v27 = 0;
v28 = 0;
v29 = nullptr;
if ( (v24 & 1) != 0 )
{
std::string::__init(&v27, v26, v25);
}
else
{
v29 = v26;
v27 = v24;
v28 = v25;
}
v14 = (GJUserScore *)GameLevelManager::responseToDict((__int64)&v27, 0);
v16 = GJUserScore::create(v14, v15);
if ( (v27 & 1) != 0 )
operator delete(v29);
if ( v16 )
{
*(_DWORD *)(v16 + 368) = a3;
cocos2d::CCArray::addObject(v5, (cocos2d::CCObject *)v16);
v17 = *(_DWORD *)(v16 + 372);
v18 = *(_DWORD *)(v16 + 376);
v30 = 0;
v31 = 0;
v32 = nullptr;
if ( (*(_BYTE *)(v16 + 320) & 1) != 0 )
{
std::string::__init(&v30, *(void **)(v16 + 336), *(_QWORD *)(v16 + 328));
}
else
{
v19 = *(_QWORD *)(v16 + 328);
v30 = *(_QWORD *)(v16 + 320);
v31 = v19;
v32 = *(void **)(v16 + 336);
}
GameLevelManager::storeUserName(a1, v17, v18, (char *)&v30);
if ( (v30 & 1) != 0 )
operator delete(v32);
}
if ( (v24 & 1) != 0 )
operator delete(v26);
}
return v5;
}