//
// LevelLeaderboard::init from 0xa82a54 to 0xa839e8 (3988 bytes)
//
// 2 xrefs:
// > LevelLeaderboard::create @ 0xa83b94
// > ??> @ 0x6a090
//
// 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 13:00:33 +0000
//
__int64 __fastcall LevelLeaderboard::init(__int64 a1, GJGameLevel *a2, int a3, int a4)
{
int v7; // w2
int v8; // w1
_BOOL4 v9; // w28
bool v10; // w0
cocos2d::CCDirector *v11; // x0
__int64 v12; // x20
void (__fastcall *v13)(__int64, __int64 *); // x24
__int64 (__fastcall *v14)(__int64, __int64 *); // x24
cocos2d::CCMenu *v15; // x0
__int64 v16; // x0
__int64 v17; // x0
__int64 v18; // x1
const char *v19; // x1
size_t v20; // x0
size_t v21; // x3
unsigned __int64 v22; // x1
cocos2d::CCLabelBMFont *v23; // x2
size_t v24; // x1
cocos2d::CCLabelBMFont *v25; // x0
cocos2d::CCLabelBMFont *v26; // x20
void (__fastcall *v27)(cocos2d::CCLabelBMFont *, __int64 *); // x24
const char *v28; // x1
size_t v29; // x0
cocos2d::CCSprite *v30; // x0
float *v31; // x24
float v32; // s9
__int64 v33; // x25
float v34; // s8
float v35; // s0
void (__fastcall *v36)(cocos2d::CCLabelBMFont *, __int64 *); // x25
__int64 v37; // x24
char *v38; // x6
float *SpriteButton; // x0
char v40; // w1
__int64 v41; // x24
char *v42; // x6
float *v43; // x0
char v44; // w1
cocos2d::CCNode *v45; // x22
cocos2d::CCNode *v46; // x20
__int64 v47; // x24
void (__fastcall *v48)(__int64, __int64 *); // x22
__int64 v49; // x24
void (__fastcall *v50)(__int64, __int64 *); // x22
__int64 v51; // x0
const char *v52; // x1
GameLevelManager *v53; // x0
__int64 v54; // x0
__int64 v55; // x20
void (__fastcall *v56)(__int64, __int64 *); // x24
cocos2d::CCNode *v57; // x22
const char *v58; // x1
__int64 v59; // x20
__int64 v60; // x0
__int64 v61; // x20
cocos2d::CCNode *v62; // x24
void (__fastcall *v63)(__int64, __int64 *); // x22
LoadingCircle *v64; // x0
__int64 v65; // x0
__int64 v66; // x1
float v67; // s1
__int64 v68; // x20
void (__fastcall *v69)(__int64, __int64 *); // x22
cocos2d::CCMenu *v70; // x0
cocos2d::CCNode *v71; // x25
float v72; // s11
int v73; // w28
int v74; // w20
const char *v75; // x1
unsigned int v76; // w24
cocos2d::CCSprite *v77; // x0
__int64 v78; // x22
GameManager *NormalPercent; // x0
__int64 v80; // x19
cocos2d::CCNode *v81; // x20
__int64 (__fastcall *v82)(__int64, __int64 *); // x22
GameLevelManager *v83; // x0
GameLevelManager *v84; // x0
GameLevelManager *v85; // x0
void (__fastcall *v87)(__int64, __int64 *); // x3
cocos2d::CCDictionary **v88; // x0
__int64 v89; // x24
float *v90; // x22
cocos2d::CCNode *v91; // x24
void (__fastcall *v92)(float *, __int64 *); // x20
bool isPlatformer; // w0
unsigned __int8 v94; // [xsp+9Fh] [xbp+9Fh]
__int64 v95; // [xsp+A8h] [xbp+A8h]
char *v96; // [xsp+B0h] [xbp+B0h]
char *v97; // [xsp+B0h] [xbp+B0h]
void (__fastcall *v98)(float *, __int64 *); // [xsp+B0h] [xbp+B0h]
__int64 v99; // [xsp+B0h] [xbp+B0h]
void (__fastcall *v100)(__int64, __int64 *); // [xsp+B0h] [xbp+B0h]
_BOOL4 v102; // [xsp+B8h] [xbp+B8h]
__int64 v103; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v104; // [xsp+C8h] [xbp+C8h] BYREF
_BYTE v105[8]; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v106; // [xsp+D8h] [xbp+D8h] BYREF
__int64 v107[2]; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v108; // [xsp+F0h] [xbp+F0h] BYREF
size_t v109; // [xsp+F8h] [xbp+F8h]
cocos2d::CCLabelBMFont *v110; // [xsp+100h] [xbp+100h]
__int64 v111[2]; // [xsp+108h] [xbp+108h] BYREF
void *v112; // [xsp+118h] [xbp+118h]
__int64 v113[2]; // [xsp+120h] [xbp+120h] BYREF
void *v114; // [xsp+130h] [xbp+130h]
__int64 v115[2]; // [xsp+138h] [xbp+138h] BYREF
void *v116; // [xsp+148h] [xbp+148h]
__int64 v117[2]; // [xsp+150h] [xbp+150h] BYREF
void *v118; // [xsp+160h] [xbp+160h]
__int64 v119[2]; // [xsp+168h] [xbp+168h] BYREF
void *v120; // [xsp+178h] [xbp+178h]
char *v121; // [xsp+180h] [xbp+180h] BYREF
__int64 v122; // [xsp+188h] [xbp+188h]
void *v123; // [xsp+190h] [xbp+190h]
v94 = FLAlertLayer::init((FLAlertLayer *)a1, 150);
if ( !v94 )
return v94;
v7 = a3;
if ( a3 == 3 )
{
isPlatformer = GJGameLevel::isPlatformer(a2);
v7 = 3;
if ( !isPlatformer )
v7 = 1;
}
v8 = *((_DWORD *)a2 + 285);
*(_QWORD *)(a1 + 680) = a2;
v9 = v8 == 2;
*(_DWORD *)(a1 + 692) = a4;
if ( v8 == 2 )
v7 = 3;
*(_DWORD *)(a1 + 688) = v7;
cocos2d::CCObject::retain(a2);
v10 = GJGameLevel::isPlatformer(a2);
v102 = v10;
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v10);
cocos2d::CCDirector::getWinSize(&v103, v11);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v107, 0.0, 0.0, 80.0, 80.0);
v12 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v107);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v12 + 912LL))(v12, 0xFFFFFFFFLL);
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v107, 440.0, 290.0);
v13(v12, v107);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v12,
0xFFFFFFFFLL);
v14 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v107, *(float *)&v103 * 0.5, *((float *)&v103 + 1) * 0.5);
v15 = (cocos2d::CCMenu *)v14(v12, v107);
v16 = cocos2d::CCMenu::create(v15);
*(_QWORD *)(a1 + 552) = v16;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v16, 10);
v121 = nullptr;
v17 = *(_QWORD *)(a1 + 680);
v122 = 0;
v123 = nullptr;
if ( (*(_BYTE *)(v17 + 344) & 1) != 0 )
{
std::string::__init((__int64 *)&v121, *(void **)(v17 + 360), *(_QWORD *)(v17 + 352));
}
else
{
v18 = *(_QWORD *)(v17 + 352);
v121 = *(char **)(v17 + 344);
v122 = v18;
v123 = *(void **)(v17 + 360);
}
v19 = (char *)&v121 + 1;
if ( ((unsigned __int8)v121 & 1) != 0 )
v19 = (const char *)v123;
v96 = (char *)v19;
v108 = 0;
v109 = 0;
v110 = nullptr;
v20 = strlen(v19);
std::string::__init(&v108, v96, v20);
if ( ((unsigned __int8)v121 & 1) != 0 )
operator delete(v123);
if ( (v108 & 1) != 0 )
{
v21 = v109;
v22 = (v108 & 0xFFFFFFFFFFFFFFFELL) - 1;
if ( v22 - v109 > 0xB )
{
v23 = v110;
LABEL_14:
v24 = v21 + 12;
qmemcpy((char *)v23 + v21, " Leaderboard", 12);
if ( (v108 & 1) != 0 )
v109 = v21 + 12;
else
LOBYTE(v108) = 2 * v24;
*((_BYTE *)v23 + v24) = 0;
goto LABEL_17;
}
}
else
{
v21 = (unsigned __int8)v108 >> 1;
v22 = 22;
v23 = (cocos2d::CCLabelBMFont *)((char *)&v108 + 1);
if ( 22 - v21 > 0xB )
goto LABEL_14;
}
std::string::__grow_by_and_replace((__int64)&v108, v22, v21 + 12 - v22, v21, v21, 0, 0xCu, " Leaderboard");
LABEL_17:
v25 = (cocos2d::CCLabelBMFont *)((char *)&v108 + 1);
if ( (v108 & 1) != 0 )
v25 = v110;
v26 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v25, "goldFont.fnt", (const char *)v23);
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v26,
20);
v27 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64 *))(*(_QWORD *)v26 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v107,
*(float *)&v103 * 0.5,
(float)((float)(*((float *)&v103 + 1) * 0.5) + 145.0) - 18.0);
v27(v26, v107);
cocos2d::CCLabelBMFont::limitLabelWidth(v26, 300.0, 0.8, 0.0);
if ( v102 )
{
if ( a4 == 1 )
v28 = "GJ_pointsIcon_001.png";
else
v28 = "GJ_timeIcon_001.png";
v97 = (char *)v28;
v121 = nullptr;
v122 = 0;
v123 = nullptr;
v29 = strlen(v28);
std::string::__init((__int64 *)&v121, v97, v29);
v30 = (cocos2d::CCSprite *)((char *)&v121 + 1);
if ( ((unsigned __int8)v121 & 1) != 0 )
v30 = (cocos2d::CCSprite *)v123;
v31 = (float *)cocos2d::CCSprite::createWithSpriteFrameName(v30, (const char *)(unsigned __int8)v121);
v32 = v31[108];
(*(void (__fastcall **)(_QWORD, float *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v31, 20);
v98 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v31 + 184LL);
v33 = (*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v26 + 192LL))(v26);
v34 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v26 + 328LL))(v26);
v35 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v26 + 168LL))(v26);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, (float)((float)(v34 * v35) * 0.5) + 2.5, -3.0);
cocos2d::CCPoint::operator+(v107, v33);
v98(v31, v107);
v36 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, __int64 *))(*(_QWORD *)v26 + 184LL);
v37 = (*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v26 + 192LL))(v26);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, -2.5 - (float)(v32 * 0.5), 0.0);
cocos2d::CCPoint::operator+(v107, v37);
v36(v26, v107);
v111[0] = 0;
v111[1] = 0;
v112 = nullptr;
std::string::__init(v111, "GJ_timeIcon_001.png", 0x13u);
v99 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v107, 0.0, -0.5);
if ( a4 )
v38 = (_BYTE *)(&dword_0 + 1);
else
v38 = (_BYTE *)(&dword_0 + 2);
SpriteButton = LevelLeaderboard::getSpriteButton(
a1,
(unsigned __int8 *)v111,
(__int64)LevelLeaderboard::onChangeMode,
0,
v99,
(const cocos2d::CCPoint *)v107,
v38,
0.7);
v40 = v111[0];
*(_QWORD *)(a1 + 736) = SpriteButton;
if ( (v40 & 1) != 0 )
{
operator delete(v112);
SpriteButton = *(float **)(a1 + 736);
}
(*(void (__fastcall **)(float *, bool))(*(_QWORD *)SpriteButton + 1056LL))(SpriteButton, a4 != 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 736) + 72LL))(*(_QWORD *)(a1 + 736), 0);
v113[0] = 0;
v113[1] = 0;
v114 = nullptr;
std::string::__init(v113, "GJ_pointsIcon_001.png", 0x15u);
v41 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v107, 0.0, -1.0);
if ( a4 == 1 )
v42 = (_BYTE *)(&dword_0 + 2);
else
v42 = (_BYTE *)(&dword_0 + 1);
v43 = LevelLeaderboard::getSpriteButton(
a1,
(unsigned __int8 *)v113,
(__int64)LevelLeaderboard::onChangeMode,
0,
v41,
(const cocos2d::CCPoint *)v107,
v42,
0.7);
v44 = v113[0];
*(_QWORD *)(a1 + 744) = v43;
if ( (v44 & 1) != 0 )
{
operator delete(v114);
v43 = *(float **)(a1 + 744);
}
(*(void (__fastcall **)(float *, bool))(*(_QWORD *)v43 + 1056LL))(v43, a4 != 1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 744) + 72LL))(*(_QWORD *)(a1 + 744), 1);
v45 = *(cocos2d::CCNode **)(a1 + 552);
v46 = *(cocos2d::CCNode **)(a1 + 584);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v106,
(float)((float)(*(float *)&v103 * 0.5) + -220.0) + 25.0,
(float)(*((float *)&v103 + 1) * 0.5) + 40.0);
cocos2d::CCNode::convertToWorldSpace(v107, v46, (const cocos2d::CCPoint *)&v106);
cocos2d::CCNode::convertToNodeSpace(&v104, v45, (const cocos2d::CCPoint *)v107);
v47 = *(_QWORD *)(a1 + 736);
v48 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 0.0, 20.0);
cocos2d::CCPoint::operator+(v107, &v104);
v48(v47, v107);
v49 = *(_QWORD *)(a1 + 744);
v50 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v49 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v106, 0.0, -20.0);
cocos2d::CCPoint::operator+(v107, &v104);
v50(v49, v107);
if ( v9 )
{
v115[0] = 0;
v115[1] = 0;
v116 = nullptr;
std::string::__init(v115, "edit_delBtn_001.png", 0x13u);
v89 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v107, 0.0, -0.5);
v90 = LevelLeaderboard::getSpriteButton(
a1,
(unsigned __int8 *)v115,
(__int64)LevelLeaderboard::onDeleteLocalScores,
0,
v89,
(const cocos2d::CCPoint *)v107,
byte_4,
0.7);
if ( (v115[0] & 1) != 0 )
operator delete(v116);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v105,
(float)((float)(*(float *)&v103 * 0.5) + 220.0) - 25.0,
(float)((float)(*((float *)&v103 + 1) * 0.5) + 145.0) - 23.0);
v91 = *(cocos2d::CCNode **)(a1 + 552);
v92 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v90 + 184LL);
cocos2d::CCNode::convertToWorldSpace(&v106, *(cocos2d::CCNode **)(a1 + 584), (const cocos2d::CCPoint *)v105);
cocos2d::CCNode::convertToNodeSpace(v107, v91, (const cocos2d::CCPoint *)&v106);
v92(v90, v107);
}
if ( ((unsigned __int8)v121 & 1) != 0 )
operator delete(v123);
}
v51 = *(_QWORD *)(a1 + 680);
v52 = (const char *)*(unsigned int *)(v51 + 588);
v53 = (GameLevelManager *)*(unsigned int *)(v51 + 592);
if ( (_DWORD)v52 == (_DWORD)v53 )
{
v88 = (cocos2d::CCDictionary **)GameLevelManager::sharedState(v53);
GameLevelManager::accountIDForUserID(
v88,
*(_DWORD *)(*(_QWORD *)(a1 + 680) + 576LL) - *(_DWORD *)(*(_QWORD *)(a1 + 680) + 580LL));
}
v54 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v52);
v55 = CCMenuItemSpriteExtra::create(v54, 0, a1, (__int64)LevelLeaderboard::onClose, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v55);
CCMenuItemSpriteExtra::setSizeMult(v55, 1.6);
v56 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v55 + 184LL);
v57 = *(cocos2d::CCNode **)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v106,
(float)((float)(*(float *)&v103 * 0.5) + -220.0) + 10.0,
(float)((float)(*((float *)&v103 + 1) * 0.5) + 145.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v107, v57, (const cocos2d::CCPoint *)&v106);
v56(v55, v107);
v59 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_updateBtn_001.png", v58);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v59 + 160LL))(v59, 0.6);
v60 = CCMenuItemSpriteExtra::create(v59, 0, a1, (__int64)LevelLeaderboard::onUpdate, 0);
*(_QWORD *)(a1 + 728) = v60;
CCMenuItemSpriteExtra::setSizeMult(v60, 1.5);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 456LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 728));
v61 = *(_QWORD *)(a1 + 728);
v62 = *(cocos2d::CCNode **)(a1 + 552);
v63 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v61 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v106,
(float)((float)(*(float *)&v103 * 0.5) + 220.0) - 25.0,
(float)(*((float *)&v103 + 1) * 0.5) + 100.0);
cocos2d::CCNode::convertToNodeSpace(v107, v62, (const cocos2d::CCPoint *)&v106);
v63(v61, v107);
v64 = (LoadingCircle *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 728) + 344LL))(
*(_QWORD *)(a1 + 728),
0);
v65 = LoadingCircle::create(v64);
*(_QWORD *)(a1 + 712) = v65;
*(_QWORD *)(v65 + 552) = *(_QWORD *)(a1 + 584);
*(_BYTE *)(*(_QWORD *)(a1 + 712) + 560LL) = 0;
cocos2d::CCObject::retain(*(cocos2d::CCObject **)(a1 + 712));
LoadingCircle::show(*(cocos2d::CCNode ***)(a1 + 712));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 712) + 344LL))(*(_QWORD *)(a1 + 712), 0);
v117[0] = 0;
v117[1] = 0;
v118 = nullptr;
std::string::__init(v117, "No Internet connection!", 0x1Fu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v107, 0.5, 1.0);
v66 = TextArea::create((char *)v117, "bigFont.fnt", (const cocos2d::CCPoint *)v107, 0, 0, 1.0, 600.0, 20.0);
*(_QWORD *)(a1 + 720) = v66;
if ( (v117[0] & 1) != 0 )
{
operator delete(v118);
v66 = *(_QWORD *)(a1 + 720);
}
v67 = (float)(*((float *)&v103 + 1) * 0.5) + 10.0;
*(float *)(v66 + 648) = 30.0;
v68 = *(_QWORD *)(a1 + 720);
v69 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v68 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v107, *(float *)&v103 * 0.5, v67);
v69(v68, v107);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 720) + 160LL))(*(_QWORD *)(a1 + 720), 0.6);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 720),
2);
v70 = (cocos2d::CCMenu *)(*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 720) + 344LL))(
*(_QWORD *)(a1 + 720),
0);
if ( !v9 )
{
v71 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v70);
(*(void (__fastcall **)(_QWORD, cocos2d::CCNode *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v71,
2);
if ( v102 )
{
v73 = 4;
v72 = 15.0;
}
else
{
v72 = 0.0;
v73 = 3;
}
v74 = 0;
while ( 1 )
{
v121 = nullptr;
v122 = 0;
v123 = nullptr;
std::string::__init((__int64 *)&v121, &byte_11B8890, 0);
switch ( v74 )
{
case 2:
std::string::assign((__int64 *)&v121, "levelLeaderboard_globalWeeklyBtn_001.png");
v76 = 2;
break;
case 3:
std::string::assign((__int64 *)&v121, "levelLeaderboard_localBtn_001.png");
v76 = 3;
break;
case 1:
std::string::assign((__int64 *)&v121, "levelLeaderboard_globalBtn_001.png");
v76 = 1;
break;
default:
std::string::assign((__int64 *)&v121, "levelLeaderboard_friendsBtn_001.png");
v76 = 0;
break;
}
if ( ((unsigned __int8)v121 & 1) != 0 )
break;
if ( (int)(unsigned __int8)v121 >> 1 )
{
v77 = (cocos2d::CCSprite *)((char *)&v121 + 1);
goto LABEL_52;
}
LABEL_55:
if ( ++v74 == v73 )
goto LABEL_56;
}
if ( v122 )
{
v77 = (cocos2d::CCSprite *)v123;
LABEL_52:
v95 = cocos2d::CCSprite::createWithSpriteFrameName(v77, v75);
v78 = CCMenuItemSpriteExtra::create(v95, 0, a1, (__int64)LevelLeaderboard::onChangeType, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v78 + 72LL))(v78, v76);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)v71 + 456LL))(v71, v78);
v100 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v78 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v106,
(float)((float)(*(float *)&v103 * 0.5) + 220.0) - 25.0,
(float)((float)((float)(*((float *)&v103 + 1) * 0.5) + 42.0) - (float)((float)v74 * 42.0)) + v72);
cocos2d::CCNode::convertToNodeSpace(v107, v71, (const cocos2d::CCPoint *)&v106);
v100(v78, v107);
if ( *(_DWORD *)(a1 + 688) == v76 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v78 + 1056LL))(v78, 0);
v87 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v95 + 960LL);
LOWORD(v107[0]) = -26986;
BYTE2(v107[0]) = -106;
v87(v95, v107);
}
if ( ((unsigned __int8)v121 & 1) == 0 )
goto LABEL_55;
}
operator delete(v123);
goto LABEL_55;
}
LABEL_56:
NormalPercent = (GameManager *)GJGameLevel::getNormalPercent(*(GJGameLevel **)(a1 + 680));
if ( (int)NormalPercent > *(_DWORD *)(*(_QWORD *)(a1 + 680) + 876LL) - *(_DWORD *)(*(_QWORD *)(a1 + 680) + 880LL) )
{
v119[0] = 0;
v119[1] = 0;
v120 = nullptr;
std::string::__init(v119, "Level Leaderboards", 0x12u);
v121 = nullptr;
v122 = 0;
v123 = nullptr;
std::string::__init(
(__int64 *)&v121,
"Q: My score is wrong!?\n"
"A: Level leaderboards changed in update 2.11. Scores from before update 2.11 need to be replayed. You can see your"
" leaderboard percentage by pressing the info button on the bottom left of the level page, or toggle the Leaderboar"
"d percent option.",
0x114u);
v80 = InfoAlertButton::create((char *)v119, (char *)&v121, 1.0);
if ( ((unsigned __int8)v121 & 1) != 0 )
operator delete(v123);
if ( (v119[0] & 1) != 0 )
operator delete(v120);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v80);
v81 = *(cocos2d::CCNode **)(a1 + 552);
v82 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v80 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v106,
(float)((float)(*(float *)&v103 * 0.5) + 220.0) - 5.0,
(float)((float)(*((float *)&v103 + 1) * 0.5) + 145.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(v107, v81, (const cocos2d::CCPoint *)&v106);
NormalPercent = (GameManager *)v82(v80, v107);
}
if ( *(_BYTE *)(GameManager::sharedState(NormalPercent) + 656) || *(_DWORD *)(a1 + 688) == 3 )
{
LevelLeaderboard::loadScores((LevelLeaderboard *)a1);
}
else
{
v83 = (GameLevelManager *)LevelLeaderboard::setupLeaderboard((LevelLeaderboard *)a1, nullptr);
v84 = (GameLevelManager *)GameLevelManager::sharedState(v83);
*((_QWORD *)v84 + 162) = a1 + 664;
v85 = (GameLevelManager *)GameLevelManager::sharedState(v84);
GameLevelManager::updateUserScore(v85);
}
if ( (v108 & 1) != 0 )
operator delete(v110);
return v94;
}