//
// LeaderboardsLayer::init from 0x1402c13c0 to 0x1402c265c (4764 bytes)
//
// 3 xrefs:
// > CreatorLayer::onLeaderboards @ 0x14009d89d
// > ??> @ 0x1406d29cc
// > ??> @ 0x1406d29d8
//
// 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
//
// Hidden C++ exception states: #wind=29
bool LeaderboardsLayer::init(LeaderboardsLayer *a1, LeaderboardType a2, LeaderboardStat a3)
{
float v3; // xmm0_4
bool result; // al
_BOOL8 v8; // rdx
LeaderboardType v9; // r14d
__int64 v10; // rax
_BOOL8 v11; // rdx
__int64 v12; // rcx
__int64 v13; // rax
cocos2d::CCString *v14; // rax
const char *CString; // rax
size_t v16; // rbx
size_t v17; // r8
void **v18; // rdi
GameLevelManager *v19; // rcx
cocos2d::CCString *v20; // rax
const char *v21; // rax
size_t v22; // r8
void **v23; // rdi
GameLevelManager *v24; // rcx
void *v25; // rcx
cocos2d::CCString *v26; // rax
const char *v27; // rax
size_t v28; // r8
void **v29; // rdi
GameLevelManager *v30; // rcx
void *v31; // rcx
cocos2d::CCString *v32; // rax
const char *v33; // rax
size_t v34; // r8
void **v35; // rdi
GameLevelManager *v36; // rcx
void *v37; // rcx
cocos2d::CCString *v38; // rax
const char *v39; // rax
size_t v40; // r8
void **v41; // rdi
GameLevelManager *v42; // rcx
void *v43; // rcx
cocos2d::CCString *v44; // rax
const char *v45; // rax
size_t v46; // r8
void **v47; // rdi
GameLevelManager *v48; // rcx
void *v49; // rcx
cocos2d::CCString *v50; // rax
const char *v51; // rax
size_t v52; // r8
void **v53; // rdi
GameLevelManager *v54; // rcx
void *v55; // rcx
cocos2d::CCString *v56; // rax
const char *v57; // rax
size_t v58; // r8
void **v59; // rdi
GameLevelManager *v60; // rcx
void *v61; // rcx
cocos2d::CCString *v62; // rax
const char *v63; // rax
size_t v64; // r8
void **v65; // rdi
GameLevelManager *v66; // rcx
void *v67; // rcx
cocos2d::CCString *v68; // rax
const char *v69; // rax
size_t v70; // r8
void **v71; // rdi
GameLevelManager *v72; // rcx
void *v73; // rcx
cocos2d::CCString *v74; // rax
const char *v75; // rax
size_t v76; // r8
void **v77; // rdi
GameLevelManager *v78; // rcx
void *v79; // rcx
cocos2d::CCString *v80; // rax
const char *v81; // rax
void **v82; // rbx
GameLevelManager *v83; // rcx
void *v84; // rcx
cocos2d::CCDirector *v85; // rax
struct cocos2d::CCSprite *v86; // rdi
cocos2d::CCSprite_vtbl *v87; // rbx
const cocos2d::CCPoint *v88; // rax
float v89; // xmm0_4
cocos2d::CCSprite_vtbl *v90; // rbx
double v91; // xmm0_8
const cocos2d::CCPoint *v92; // rax
struct cocos2d::CCSprite *v93; // rdi
cocos2d::CCSprite_vtbl *v94; // rbx
const cocos2d::CCPoint *v95; // rax
cocos2d::CCSprite_vtbl *v96; // rbx
__int64 v97; // rcx
cocos2d::CCDirector *v98; // rax
__int64 v99; // rcx
cocos2d::CCDirector *v100; // rax
float v101; // xmm0_4
double v102; // xmm0_8
const cocos2d::CCPoint *v103; // rax
struct cocos2d::CCSprite *v104; // rdi
cocos2d::CCSprite_vtbl *v105; // rbx
const cocos2d::CCPoint *v106; // rax
cocos2d::CCSprite_vtbl *v107; // rbx
__int64 v108; // rcx
cocos2d::CCDirector *v109; // rax
__int64 v110; // rcx
cocos2d::CCDirector *v111; // rax
float v112; // xmm0_4
const cocos2d::CCPoint *v113; // rax
LoadingCircle *v114; // rax
const struct cocos2d::CCPoint *v115; // rax
char *v116; // rax
TextArea_vtbl *v117; // rbx
const cocos2d::CCPoint *v118; // rax
__int64 v119; // rcx
cocos2d::CCNode *v120; // rdi
struct cocos2d::CCSprite *v121; // rax
CCMenuItemSpriteExtra *v122; // rax
cocos2d::CCNode_vtbl *v123; // rbx
__int64 v124; // rcx
cocos2d::CCDirector *v125; // rax
__int64 v126; // rcx
cocos2d::CCDirector *v127; // rax
float v128; // xmm0_4
const cocos2d::CCPoint *v129; // rax
struct cocos2d::CCSprite *v130; // rax
CCMenuItemSpriteExtra *v131; // r14
struct cocos2d::CCMenu *v132; // rdi
cocos2d::CCMenu_vtbl *v133; // rbx
__int64 v134; // rcx
cocos2d::CCDirector *v135; // rax
__int64 v136; // rcx
cocos2d::CCDirector *v137; // rax
float v138; // xmm0_4
const cocos2d::CCPoint *v139; // rax
__int64 v140; // rdx
__int64 v141; // rcx
void **v142; // [rsp+48h] [rbp-39h] BYREF
float v143; // [rsp+50h] [rbp-31h]
void *Block[2]; // [rsp+60h] [rbp-21h] BYREF
__int64 v145; // [rsp+70h] [rbp-11h]
unsigned __int64 v146; // [rsp+78h] [rbp-9h]
result = cocos2d::CCLayer::init(a1);
if ( !result )
return result;
v9 = Top100;
if ( a2 )
v9 = a2;
v10 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v142 = (void **)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v10 = qword_1406C2ED8;
}
*(_BYTE *)(v10 + 704) = 0;
*(_DWORD *)(v10 + 700) = 6;
LOBYTE(v8) = 1;
a1->setKeypadEnabled(a1, v8);
LOBYTE(v11) = 1;
a1->setKeyboardEnabled(a1, v11);
v13 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v142 = (void **)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v13 = qword_1406C2ED8;
}
if ( !*(_BYTE *)(v13 + 648) )
{
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v14 = cocos2d::CCString::createWithFormat("lb_%i_%i", 1, 0);
CString = cocos2d::CCString::getCString(v14);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v16 = -1;
v17 = -1;
do
++v17;
while ( CString[v17] );
sub_14003A930(Block, CString, v17);
v18 = Block;
if ( v146 > 0xF )
v18 = (void **)Block[0];
v19 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v19 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v19, (const char *)v18);
sub_14003A830((__int64)Block);
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v20 = cocos2d::CCString::createWithFormat("lb_%i_%i", 1, 1);
v21 = cocos2d::CCString::getCString(v20);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v22 = -1;
do
++v22;
while ( v21[v22] );
sub_14003A930(Block, v21, v22);
v23 = Block;
if ( v146 > 0xF )
v23 = (void **)Block[0];
v24 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v24 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v24, (const char *)v23);
if ( v146 > 0xF )
{
v25 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v25 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v25 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v25);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v26 = cocos2d::CCString::createWithFormat("lb_%i_%i", 1, 2);
v27 = cocos2d::CCString::getCString(v26);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v28 = -1;
do
++v28;
while ( v27[v28] );
sub_14003A930(Block, v27, v28);
v29 = Block;
if ( v146 > 0xF )
v29 = (void **)Block[0];
v30 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v30 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v30, (const char *)v29);
if ( v146 > 0xF )
{
v31 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v31 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v31 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v31);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v32 = cocos2d::CCString::createWithFormat("lb_%i_%i", 1, 3);
v33 = cocos2d::CCString::getCString(v32);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v34 = -1;
do
++v34;
while ( v33[v34] );
sub_14003A930(Block, v33, v34);
v35 = Block;
if ( v146 > 0xF )
v35 = (void **)Block[0];
v36 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v36 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v36, (const char *)v35);
if ( v146 > 0xF )
{
v37 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v37 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v37 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v37);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v38 = cocos2d::CCString::createWithFormat("lb_%i_%i", 4, 0);
v39 = cocos2d::CCString::getCString(v38);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v40 = -1;
do
++v40;
while ( v39[v40] );
sub_14003A930(Block, v39, v40);
v41 = Block;
if ( v146 > 0xF )
v41 = (void **)Block[0];
v42 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v42 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v42, (const char *)v41);
if ( v146 > 0xF )
{
v43 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v43 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v43 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v43);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v44 = cocos2d::CCString::createWithFormat("lb_%i_%i", 4, 1);
v45 = cocos2d::CCString::getCString(v44);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v46 = -1;
do
++v46;
while ( v45[v46] );
sub_14003A930(Block, v45, v46);
v47 = Block;
if ( v146 > 0xF )
v47 = (void **)Block[0];
v48 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v48 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v48, (const char *)v47);
if ( v146 > 0xF )
{
v49 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v49 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v49 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v49);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v50 = cocos2d::CCString::createWithFormat("lb_%i_%i", 4, 2);
v51 = cocos2d::CCString::getCString(v50);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v52 = -1;
do
++v52;
while ( v51[v52] );
sub_14003A930(Block, v51, v52);
v53 = Block;
if ( v146 > 0xF )
v53 = (void **)Block[0];
v54 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v54 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v54, (const char *)v53);
if ( v146 > 0xF )
{
v55 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v55 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v55 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v55);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v56 = cocos2d::CCString::createWithFormat("lb_%i_%i", 4, 3);
v57 = cocos2d::CCString::getCString(v56);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v58 = -1;
do
++v58;
while ( v57[v58] );
sub_14003A930(Block, v57, v58);
v59 = Block;
if ( v146 > 0xF )
v59 = (void **)Block[0];
v60 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v60 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v60, (const char *)v59);
if ( v146 > 0xF )
{
v61 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v61 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v61 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v61);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v62 = cocos2d::CCString::createWithFormat("lb_%i_%i", 2, 0);
v63 = cocos2d::CCString::getCString(v62);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v64 = -1;
do
++v64;
while ( v63[v64] );
sub_14003A930(Block, v63, v64);
v65 = Block;
if ( v146 > 0xF )
v65 = (void **)Block[0];
v66 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v66 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v66, (const char *)v65);
if ( v146 > 0xF )
{
v67 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v67 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v67 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v67);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v68 = cocos2d::CCString::createWithFormat("lb_%i_%i", 2, 1);
v69 = cocos2d::CCString::getCString(v68);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v70 = -1;
do
++v70;
while ( v69[v70] );
sub_14003A930(Block, v69, v70);
v71 = Block;
if ( v146 > 0xF )
v71 = (void **)Block[0];
v72 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v72 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v72, (const char *)v71);
if ( v146 > 0xF )
{
v73 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v73 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v73 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v73);
}
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v74 = cocos2d::CCString::createWithFormat("lb_%i_%i", 2, 2);
v75 = cocos2d::CCString::getCString(v74);
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
v76 = -1;
do
++v76;
while ( v75[v76] );
sub_14003A930(Block, v75, v76);
v77 = Block;
if ( v146 > 0xF )
v77 = (void **)Block[0];
v78 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v78 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v78, (const char *)v77);
if ( v146 <= 0xF )
{
LABEL_137:
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v80 = cocos2d::CCString::createWithFormat("lb_%i_%i", 2, 3);
v81 = cocos2d::CCString::getCString(v80);
v3 = 0.0;
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 0;
do
++v16;
while ( v81[v16] );
sub_14003A930(Block, v81, v16);
v82 = Block;
if ( v146 > 0xF )
v82 = (void **)Block[0];
v83 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v142 = (void **)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v142);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v83 = (GameLevelManager *)qword_1406C2EC0;
}
GameLevelManager::resetTimerForKey(v83, (const char *)v82);
if ( v146 > 0xF )
{
v84 = Block[0];
if ( v146 + 1 >= 0x1000 )
{
v84 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v84 - 8) > 0x1F )
goto LABEL_148;
}
j_j_free(v84);
}
goto LABEL_150;
}
v79 = Block[0];
if ( v146 + 1 < 0x1000
|| (v79 = *((void **)Block[0] - 1), (unsigned __int64)((char *)Block[0] - (char *)v79 - 8) <= 0x1F) )
{
j_j_free(v79);
goto LABEL_137;
}
LABEL_148:
invalid_parameter_noinfo_noreturn();
}
LABEL_150:
v85 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize(v85);
v86 = cocos2d::CCSprite::create("GJ_gradientBG.png");
v87 = v86->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v3, 0.0);
v87->setAnchorPoint(v86, v88);
a1->addChild_0(a1, v86, -2);
((void (__fastcall *)(struct cocos2d::CCSprite *))v86->setScaleX)(v86);
v89 = ((float (__fastcall *)(struct cocos2d::CCSprite *))v86->setScaleY)(v86);
v90 = v86->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v91 = cocos2d::CCPoint::CCPoint(v89, -5.0);
v90->setPosition_0(v86, v92);
LOWORD(v142) = 26112;
BYTE2(v142) = -1;
v86->setColor(&v86->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v142);
v93 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v94 = v93->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v91, 0.0);
v94->setAnchorPoint(v93, v95);
v96 = v93->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v98 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v97);
cocos2d::CCDirector::getScreenBottom(v98);
v100 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v99);
v101 = cocos2d::CCDirector::getScreenLeft(v100) - 1.0;
v102 = cocos2d::CCPoint::CCPoint(v101, v101);
v96->setPosition_0(v93, v103);
a1->addChild_0(a1, v93, 1);
v104 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sideArt_001.png");
v105 = v104->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v102, 1.0);
v105->setAnchorPoint(v104, v106);
v107 = v104->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v109 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v108);
cocos2d::CCDirector::getScreenBottom(v109);
v111 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v110);
v112 = cocos2d::CCDirector::getScreenRight(v111) + 1.0;
cocos2d::CCPoint::CCPoint(v112, v112);
v107->setPosition_0(v104, v113);
cocos2d::CCSprite::setFlipX(v104, 1);
a1->addChild_0(a1, v104, 1);
v114 = LoadingCircle::create();
a1->m_circle = v114;
v114->m_parentLayer = a1;
a1->m_circle->m_fade = 0;
cocos2d::CCObject::retain(a1->m_circle);
LoadingCircle::show(a1->m_circle);
a1->m_circle->setVisible(a1->m_circle, 0);
v142 = Block;
*(_OWORD *)Block = 0;
v145 = 0;
v146 = 15;
Block[0] = sub_14003AA10(0x20u);
v145 = 31;
v146 = 31;
strcpy((char *)Block[0], "No Internet connection!");
cocos2d::CCPoint::CCPoint(1.6126443e-19, 0.5);
v116 = TextArea::create((__int64)Block, &qword_14052A4D8, 1.0, 600.0, v115, 1101004800, 0);
a1->m_noInternet = (TextArea *)v116;
*((_DWORD *)v116 + 164) = 1106247680;
v117 = a1->m_noInternet->__vftable;
cocos2d::CCPoint::CCPoint(20.0, v143 * 0.5);
v117->setPosition_0(a1->m_noInternet, v118);
((void (__fastcall *)(TextArea *))a1->m_noInternet->setScale_0)(a1->m_noInternet);
a1->addChild_0(a1, a1->m_noInternet, 2);
a1->m_noInternet->setVisible(a1->m_noInternet, 0);
v120 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v119);
a1->addChild_0(a1, v120, 10);
v121 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
v122 = CCMenuItemSpriteExtra::create(v121, nullptr, a1, (cocos2d::SEL_MenuHandler *)LeaderboardsLayer::onInfo);
HIDWORD(v122->m_pfnSelector.adj) = 0x40000000;
v120->addChild_1(v120, v122);
v123 = v120->__vftable;
v125 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v124);
cocos2d::CCDirector::getScreenBottom(v125);
v127 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v126);
v128 = cocos2d::CCDirector::getScreenLeft(v127) + 30.0;
cocos2d::CCPoint::CCPoint(v128, v128);
v123->setPosition_0(v120, v129);
LeaderboardsLayer::setupTabs(a1);
LeaderboardsLayer::selectLeaderboard(a1, v9, a3);
v130 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v131 = CCMenuItemSpriteExtra::create(v130, nullptr, a1, (cocos2d::SEL_MenuHandler *)LeaderboardsLayer::onBack);
HIDWORD(v131->m_pfnSelector.adj) = 1070386381;
v132 = cocos2d::CCMenu::create(v131, 0);
a1->addChild_0(a1, v132, 1);
v133 = v132->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v135 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v134);
cocos2d::CCDirector::getScreenTop(v135);
v137 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v136);
v138 = cocos2d::CCDirector::getScreenLeft(v137) + 24.0;
cocos2d::CCPoint::CCPoint(v138, v138);
v133->setPosition_0(v132, v139);
if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v141, v140) + 197) )
GameToolbox::addBackButton(a1, v131);
return 1;
}