//
// GameLevelManager::onGetLevelLeaderboardCompleted from 0x10052e480 to 0x10052e675 (501 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051f54f
//
// This function is hookable on this platform (idp: pc, 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:31:49 +0000
//
void __fastcall GameLevelManager::onGetLevelLeaderboardCompleted(__int64 a1, char *a2, __int128 *a3)
{
__int64 v4; // r14
char v5; // r14
int v6; // r13d
__int64 v7; // rax
__int64 v8; // rdi
__int64 Scores; // rax
__int64 v10; // r14
__int64 v11; // r15
__int64 v12; // rdi
__int16 v13; // [rsp+0h] [rbp-90h] BYREF
char v14; // [rsp+2h] [rbp-8Eh]
_BYTE v15[4]; // [rsp+1Ch] [rbp-74h] BYREF
__int128 v16; // [rsp+20h] [rbp-70h] BYREF
void *__p; // [rsp+30h] [rbp-60h]
__int128 v18; // [rsp+40h] [rbp-50h] BYREF
void *v19; // [rsp+50h] [rbp-40h]
__int64 v20; // [rsp+58h] [rbp-38h]
int v21; // [rsp+60h] [rbp-30h] BYREF
_DWORD v22[11]; // [rsp+64h] [rbp-2Ch] BYREF
if ( (*(_BYTE *)a3 & 1) != 0 )
v4 = *((_QWORD *)a3 + 2);
else
v4 = (__int64)a3 + 1;
GameLevelManager::removeDLFromActive(a1, v4);
v21 = 0;
v22[0] = 0;
if ( (*(_BYTE *)a3 & 1) != 0 )
{
sub_10001AD30(&v16, *((const void **)a3 + 2), *((_QWORD *)a3 + 1));
}
else
{
__p = *((void **)a3 + 2);
v16 = *a3;
}
sub_100565890(&v16, v15, &v21, v22);
v20 = v4;
if ( (v16 & 1) != 0 )
operator delete(__p);
v5 = *a2;
if ( (*a2 & 1) != 0 )
{
v6 = atoi(*((const char **)a2 + 2));
if ( v21 != 4 )
{
LABEL_11:
if ( v6 < 0 )
{
v8 = *(_QWORD *)(a1 + 1296);
if ( v8 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 24LL))(v8, v20);
}
else
{
if ( (v5 & 1) != 0 )
{
sub_10001AD30(&v18, *((const void **)a2 + 2), *((_QWORD *)a2 + 1));
}
else
{
v19 = *((void **)a2 + 2);
v18 = *(_OWORD *)a2;
}
Scores = GameLevelManager::createAndGetScores(a1, &v18, 3);
v10 = v20;
v11 = Scores;
if ( (v18 & 1) != 0 )
operator delete(v19);
v13 = 8194;
v14 = 0;
GameLevelManager::storeSearchResult(a1, v11, &v13, v10);
v12 = *(_QWORD *)(a1 + 1296);
if ( v12 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v12 + 16LL))(v12, v11, v10);
}
return;
}
}
else
{
v6 = atoi(a2 + 1);
if ( v21 != 4 )
goto LABEL_11;
}
v7 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1152), (char *)a3);
if ( v7 != 0 && v6 >= 0 )
{
if ( v22[0] == 1 )
{
*(_BYTE *)(v7 + 1433) = 0;
}
else if ( !v22[0] )
{
*(_BYTE *)(v7 + 1432) = 0;
}
}
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 1152), (char *)a3);
}