//
// GameLevelManager::onGetLevelLeaderboardCompleted from 0x8499c8 to 0x849c24 (604 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85c764
// > ??> @ 0x80ec0
//
// 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
//
__int64 __fastcall GameLevelManager::onGetLevelLeaderboardCompleted(GameLevelManager *this, __int64 a2, char *a3)
{
char *v6; // x19
char v7; // w0
__int64 v8; // x0
__int64 v9; // x1
const char *v10; // x0
int v11; // w25
int v12; // w26
__int64 v13; // x0
__int64 v14; // x1
cocos2d::CCObject *Scores; // x20
__int64 v16; // x0
__int64 v18; // x0
__int64 v19; // x0
int v20; // [xsp+54h] [xbp+54h] BYREF
int v21; // [xsp+58h] [xbp+58h] BYREF
int v22; // [xsp+5Ch] [xbp+5Ch] BYREF
__int64 v23; // [xsp+60h] [xbp+60h] BYREF
__int64 v24; // [xsp+68h] [xbp+68h]
void *v25; // [xsp+70h] [xbp+70h]
v6 = a3 + 1;
if ( (*a3 & 1) != 0 )
v6 = *((char **)a3 + 2);
GameLevelManager::removeDLFromActive(this, v6);
v20 = 0;
v7 = *a3;
v21 = 0;
v22 = 0;
v23 = 0;
v24 = 0;
v25 = nullptr;
if ( (v7 & 1) != 0 )
{
std::string::__init(&v23, *((void **)a3 + 2), *((_QWORD *)a3 + 1));
}
else
{
v8 = *(_QWORD *)a3;
v9 = *((_QWORD *)a3 + 1);
v25 = *((void **)a3 + 2);
v23 = v8;
v24 = v9;
}
parseLevelLeaderboardKey((__int64)&v23, &v20, &v21, &v22);
if ( (v23 & 1) != 0 )
operator delete(v25);
v10 = (const char *)(a2 + 1);
v11 = *(_BYTE *)a2 & 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v10 = *(const char **)(a2 + 16);
v12 = atoi(v10);
if ( v21 == 4 )
{
v19 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 144), a3);
if ( v19 && (v12 & 0x80000000) == 0 )
{
if ( v22 )
{
if ( v22 == 1 )
*(_BYTE *)(v19 + 1433) = 0;
}
else
{
*(_BYTE *)(v19 + 1432) = 0;
}
}
cocos2d::CCDictionary::removeObjectForKey(*((_QWORD *)this + 144), a3);
}
else if ( v12 < 0 )
{
v18 = *((_QWORD *)this + 162);
if ( v18 )
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v18 + 24LL))(v18, v6);
}
else
{
v23 = 0;
v24 = 0;
v25 = nullptr;
if ( v11 )
{
std::string::__init(&v23, *(void **)(a2 + 16), *(_QWORD *)(a2 + 8));
}
else
{
v13 = *(_QWORD *)a2;
v14 = *(_QWORD *)(a2 + 8);
v25 = *(void **)(a2 + 16);
v23 = v13;
v24 = v14;
}
Scores = GameLevelManager::createAndGetScores(this, (char *)&v23, 3);
if ( (v23 & 1) != 0 )
operator delete(v25);
v23 = 0;
v24 = 0;
v25 = nullptr;
std::string::__init(&v23, &byte_11E1A70, 1u);
GameLevelManager::storeSearchResult(this, Scores, (__int64)&v23, v6);
if ( (v23 & 1) != 0 )
operator delete(v25);
v16 = *((_QWORD *)this + 162);
if ( v16 )
(*(void (__fastcall **)(__int64, cocos2d::CCObject *, char *))(*(_QWORD *)v16 + 16LL))(v16, Scores, v6);
}
return _stack_chk_guard;
}