//
// PauseLayer::customSetup from 0x1404d68e0 to 0x1404d8f8c (9900 bytes)
//
// 3 xrefs:
// > ??> @ 0x1407d2748
// > ??> @ 0x1409298f4
// > ??> @ 0x140929900
//
// 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 11:33:03 +0000
//
// Hidden C++ exception states: #wind=40
__int64 __fastcall PauseLayer::customSetup(__int64 a1)
{
__int64 v2; // rdx
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
float ScreenRight; // xmm0_4
__int64 v9; // rcx
cocos2d::CCDirector *v10; // rax
float v11; // xmm7_4
__int64 v12; // rcx
cocos2d::CCDirector *v13; // rax
float ScreenTop; // xmm0_4
__int64 v15; // rcx
cocos2d::CCDirector *v16; // rax
float v17; // xmm13_4
__int64 v18; // rax
_QWORD *v19; // rdi
__int64 v20; // rdx
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rax
void **v24; // rcx
struct cocos2d::CCLabelBMFont *v25; // rdi
__int64 v26; // rbx
float v27; // xmm13_4
__int64 v28; // rax
__int64 v29; // rdx
__int64 v30; // rcx
__int64 v31; // rax
__int64 v32; // rdi
unsigned __int8 v33; // bl
cocos2d::CCMenu *v34; // r15
struct cocos2d::CCSprite *v35; // r12
__int64 v36; // rdx
struct cocos2d::CCSprite *v37; // rsi
__int64 v38; // rdi
cocos2d::CCObject *v39; // rax
int v40; // eax
cocos2d::CCObject *v41; // rax
int v42; // eax
int v43; // eax
int v44; // eax
int v45; // eax
cocos2d::CCObject *v46; // rax
float v47; // xmm6_4
__int64 v48; // rax
__int64 v49; // rbx
float v50; // xmm6_4
float *v51; // rax
__int64 v52; // rax
__int64 v53; // rax
__int64 v54; // rcx
struct cocos2d::CCSprite *v55; // rdi
__int64 v56; // rbx
__int64 v57; // rax
float v58; // xmm7_4
__int64 v59; // rax
int v60; // ebx
unsigned int v61; // r12d
__int64 v62; // rsi
_WORD *v63; // rax
char v64; // r13
unsigned __int64 v65; // rdi
_BYTE *v66; // rbx
unsigned __int64 v67; // rcx
char *v68; // rax
char *v69; // rbx
void *v70; // rcx
unsigned __int64 v71; // rdi
_BYTE *v72; // rbx
unsigned __int64 v73; // rcx
__int64 v74; // rbx
_QWORD *v75; // rax
int v76; // ecx
void *v77; // rsi
void *v78; // rcx
__int64 v79; // rax
unsigned __int64 v80; // rdi
_BYTE *v81; // rbx
unsigned __int64 v82; // rcx
__int64 v83; // rbx
char *v84; // rsi
void *v85; // rcx
void *v86; // rcx
unsigned __int64 v87; // rdi
_BYTE *v88; // rbx
unsigned __int64 v89; // rcx
_QWORD *v90; // rax
__int16 v91; // cx
_BYTE *v92; // rbx
unsigned __int64 v93; // rcx
__int64 v94; // rbx
__int64 v95; // rax
_BYTE *v96; // rbx
unsigned __int64 v97; // rcx
__int64 v98; // rax
_BYTE *v99; // rbx
unsigned __int64 v100; // rcx
__int64 v101; // rcx
bool GameVariable; // al
char *v103; // rdx
size_t v104; // r8
__int64 v105; // rax
_BYTE *v106; // rbx
unsigned __int64 v107; // rcx
_BYTE *v108; // rbx
unsigned __int64 v109; // rcx
void *v110; // rbx
void *v111; // rcx
void **v112; // rcx
__int64 *v113; // rdi
cocos2d::CCObject *v114; // rbx
void (__fastcall *v115)(cocos2d::CCObject *, __int64); // rsi
__int64 v116; // rax
__int64 v117; // rax
struct cocos2d::CCSprite *v118; // rdi
__int64 v119; // rbx
__int64 v120; // rax
__int64 v121; // rax
void *v122; // rcx
__int64 *v123; // rdi
cocos2d::CCObject *v124; // rbx
struct cocos2d::CCMenu *v125; // rax
__int64 v126; // rbx
__int64 v127; // rcx
cocos2d::CCDirector *v128; // rax
__int64 v129; // rcx
cocos2d::CCDirector *v130; // rax
__int64 v131; // r8
cocos2d::CCLayer *v132; // rax
__int64 v133; // rdx
__int64 v134; // rax
__int64 v135; // rax
__int64 v136; // r8
cocos2d::CCLayer *v137; // rax
__int64 v138; // rdx
__int64 v139; // rax
__int64 v140; // rax
__int64 v141; // rax
struct cocos2d::CCSprite *v142; // rdi
__int64 v143; // rax
__int64 v144; // rbx
__int64 v145; // rax
struct cocos2d::CCSprite *v146; // rdi
__int64 v147; // rax
__int64 v148; // rbx
__int64 v149; // rax
__int64 v150; // rcx
__int64 v151; // rax
_DWORD *v152; // r13
int v153; // r12d
int v154; // esi
__int64 v155; // rcx
unsigned int v156; // r15d
__int64 v157; // rax
__int64 v158; // rbx
cocos2d::CCString *v159; // rax
const char *CString; // rax
size_t v161; // r8
__int64 v162; // rdi
void *v163; // r8
char *CoinKey; // rbx
__int64 v165; // rcx
bool hasSecretCoin; // al
bool v167; // bl
const char *v168; // rcx
const char *v169; // rax
struct cocos2d::CCSprite *v170; // rsi
int v171; // eax
float v172; // xmm6_4
unsigned __int8 v173; // di
__int64 v174; // rax
int v175; // edx
__int64 v176; // rax
cocos2d::CCObject *StartPosObjectsForCurrentMode; // rax
__int64 v178; // rax
__int64 v179; // rcx
__int64 v180; // rax
struct cocos2d::CCObject *v181; // rdx
unsigned int v182; // eax
struct cocos2d::CCLabelBMFont *v183; // rdi
__int64 v184; // rbx
__int64 v185; // rax
struct cocos2d::CCLabelBMFont *v186; // rax
__int64 *v187; // rbx
__int64 *v188; // rax
__int64 *v189; // rdi
__int64 v190; // rax
__int64 v191; // rbx
__int64 v192; // rax
cocos2d::CCSprite *v193; // rbx
__int64 *v194; // rax
__int64 *v195; // rdi
__int64 v196; // rax
__int64 v197; // rbx
__int64 v198; // rax
__int64 v199; // rax
__int64 *v200; // rbx
cocos2d::CCObject *v201; // rdi
__int64 v202; // rax
__int64 v203; // rbx
__int64 v204; // rax
__int64 v205; // rax
__int64 *v206; // rbx
cocos2d::CCObject *v207; // rdi
__int64 v208; // rax
__int64 v209; // rbx
__int64 v210; // rax
__int64 result; // rax
struct cocos2d::CCSprite *v212; // rsi
cocos2d::CCObject *v213; // r15
__int64 (__fastcall *v214)(cocos2d::CCObject *); // rdi
__int64 v215; // rbx
__int64 v216; // rax
__int64 v217; // rax
__int64 v218; // rax
struct cocos2d::CCSprite *v219; // rsi
cocos2d::CCObject *v220; // r15
__int64 (__fastcall *v221)(cocos2d::CCObject *); // rdi
__int64 v222; // rbx
__int64 v223; // rax
__int64 v224; // rax
__int64 v225; // rax
__int64 v226; // rax
struct cocos2d::CCSprite *v227; // rsi
cocos2d::CCObject *v228; // r15
__int64 (__fastcall *v229)(cocos2d::CCObject *); // rdi
__int64 v230; // rbx
__int64 v231; // rax
__int64 v232; // rax
__int64 v233; // rax
__int64 v234; // rax
void *v235; // [rsp+48h] [rbp-C0h] BYREF
float v236; // [rsp+50h] [rbp-B8h] BYREF
float v237; // [rsp+54h] [rbp-B4h]
__int64 v238; // [rsp+58h] [rbp-B0h]
cocos2d::CCArray *v239; // [rsp+60h] [rbp-A8h] BYREF
cocos2d::CCObject *v240; // [rsp+68h] [rbp-A0h] BYREF
void *v241; // [rsp+70h] [rbp-98h] BYREF
__int64 v242[2]; // [rsp+78h] [rbp-90h] BYREF
cocos2d::CCMenu *v243; // [rsp+88h] [rbp-80h] BYREF
__int16 v244; // [rsp+90h] [rbp-78h]
__int16 v245; // [rsp+94h] [rbp-74h] BYREF
char v246; // [rsp+96h] [rbp-72h]
__int16 v247; // [rsp+98h] [rbp-70h]
__int16 v248; // [rsp+9Ch] [rbp-6Ch] BYREF
char v249; // [rsp+9Eh] [rbp-6Ah]
void *v250; // [rsp+A0h] [rbp-68h] BYREF
void *v251; // [rsp+A8h] [rbp-60h] BYREF
__int16 v252; // [rsp+B0h] [rbp-58h]
_BYTE v253[4]; // [rsp+B8h] [rbp-50h] BYREF
float v254; // [rsp+BCh] [rbp-4Ch]
_BYTE v255[4]; // [rsp+C0h] [rbp-48h] BYREF
float v256; // [rsp+C4h] [rbp-44h]
void *v257; // [rsp+C8h] [rbp-40h] BYREF
cocos2d::CCObject *v258; // [rsp+D0h] [rbp-38h] BYREF
char v259[8]; // [rsp+D8h] [rbp-30h] BYREF
cocos2d::CCObject *v260; // [rsp+E0h] [rbp-28h]
void *v261; // [rsp+E8h] [rbp-20h] BYREF
char v262[8]; // [rsp+F0h] [rbp-18h] BYREF
void *v263; // [rsp+F8h] [rbp-10h]
void *v264; // [rsp+100h] [rbp-8h]
_BYTE v265[16]; // [rsp+108h] [rbp+0h] BYREF
void *Block[2]; // [rsp+118h] [rbp+10h] BYREF
__int64 v267; // [rsp+128h] [rbp+20h]
unsigned __int64 v268; // [rsp+130h] [rbp+28h]
(**(void (__fastcall ***)(__int64, void *))(a1 + 408))(a1 + 408, &unk_140704504);
LOBYTE(v2) = 75;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(a1 + 408) + 40LL))(a1 + 408, v2);
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v236);
v5 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 632) = v5;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v265, 0.0, 0.0, 80.0, 80.0);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
ScreenRight = cocos2d::CCDirector::getScreenRight(v7);
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
v11 = (float)(ScreenRight - 20.0) - cocos2d::CCDirector::getScreenLeft(v10);
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v12);
ScreenTop = cocos2d::CCDirector::getScreenTop(v13);
v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v15);
v17 = (float)(ScreenTop - 20.0) - cocos2d::CCDirector::getScreenBottom(v16);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v242, (const struct cocos2d::CCRect *)v265);
v19 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("square04_001.png", v18);
LOBYTE(v20) = -81;
(*(void (__fastcall **)(_QWORD *, __int64))(v19[40] + 40LL))(v19 + 40, v20);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v262, v11, v17);
(*(void (__fastcall **)(_QWORD *, char *))(*v19 + 312LL))(v19, v262);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v19,
0xFFFFFFFFLL);
v21 = *v19;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v240, v236 * 0.5, v237 * 0.5);
(*(void (__fastcall **)(_QWORD *, __int64))(v21 + 184))(v19, v22);
(*(void (__fastcall **)(_QWORD *, void *))v19[40])(v19 + 40, &unk_140704504);
v23 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v240 = (cocos2d::CCObject *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v240);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v23 = qword_14090BFD0;
}
sub_14003F4F0((__int64)Block, *(_QWORD *)(*(_QWORD *)(v23 + 560) + 2168LL) + 344LL);
v24 = Block;
if ( v268 > 0xF )
v24 = (void **)Block[0];
v25 = cocos2d::CCLabelBMFont::create((const char *)v24, (const char *)&qword_140704F78);
sub_14003D310((__int64)Block);
v26 = *(_QWORD *)v25;
v27 = v17 * 0.5;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v240, v236 * 0.5, (float)((float)(v237 * 0.5) + v27) - 20.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v26 + 184))(v25, v28);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v25);
LOBYTE(v29) = 1;
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)v25 + 336LL))(v25, v29);
v30 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v240 = (cocos2d::CCObject *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v240);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v30 = qword_14090BFD0;
}
v31 = *(_QWORD *)(v30 + 560);
v32 = *(_QWORD *)(v31 + 2168);
if ( !*(_BYTE *)(v31 + 12670) || *(_BYTE *)(v31 + 15232) )
{
v33 = 1;
if ( *(_DWORD *)(v32 + 972) == 5 || !GameManager::getGameVariable(v30, "0249") )
PauseLayer::setupSessionProgressBar(a1);
else
PauseLayer::setupLegacyProgressBars(a1);
}
else
{
v33 = 0;
}
if ( *(_DWORD *)(v32 + 972) == 5 )
PauseLayer::setupPlatformerLabels(a1, v33);
v34 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v30);
v243 = v34;
(*(void (__fastcall **)(_QWORD, cocos2d::CCMenu *))(**(_QWORD **)(a1 + 632) + 464LL))(*(_QWORD *)(a1 + 632), v34);
v35 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_menuBtn_001.png");
v36 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v240 = (cocos2d::CCObject *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v240);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v36 = qword_14090BFD0;
}
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v36 + 560) + 2168LL) + 1220LL) == 2
|| *(_DWORD *)(v36 + 1064) - *(_DWORD *)(v36 + 1068) > 0 )
{
v37 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_editBtn_001.png");
v38 = *(_QWORD *)v37;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v35 + 320LL))(v35);
(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v37 + 320LL))(v37);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(v38 + 160))(v37);
v39 = CCMenuItemSpriteExtra::create((int)v37, 0, a1, (__int64)PauseLayer::onTryEdit);
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v39);
v36 = qword_14090BFD0;
}
if ( !v36 )
{
v240 = (cocos2d::CCObject *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v240);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v36 = qword_14090BFD0;
}
if ( *(_BYTE *)(*(_QWORD *)(*(_QWORD *)(v36 + 560) + 3528LL) + 341LL) )
{
v40 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_replayFullBtn_001.png");
v41 = CCMenuItemSpriteExtra::create(v40, 0, a1, (__int64)PauseLayer::onRestartFull);
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v41);
v36 = qword_14090BFD0;
}
if ( !v36 )
{
v240 = (cocos2d::CCObject *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v240);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v36 = qword_14090BFD0;
}
if ( *(_BYTE *)(*(_QWORD *)(v36 + 560) + 13024LL) )
{
v43 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_normalBtn_001.png");
v260 = CCMenuItemSpriteExtra::create(v43, 0, a1, (__int64)PauseLayer::onNormalMode);
}
else
{
v42 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_practiceBtn_001.png");
v260 = CCMenuItemSpriteExtra::create(v42, 0, a1, (__int64)PauseLayer::onPracticeMode);
}
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v260);
v44 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_playBtn2_001.png");
v258 = CCMenuItemSpriteExtra::create(v44, 0, a1, (__int64)PauseLayer::onResume);
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v258);
v240 = CCMenuItemSpriteExtra::create((int)v35, 0, a1, (__int64)PauseLayer::tryQuit);
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v240);
v45 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_replayBtn_001.png");
v46 = CCMenuItemSpriteExtra::create(v45, 0, a1, (__int64)PauseLayer::onRestart);
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v46);
v47 = 15.0;
v48 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v250 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v250);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v48 = qword_14090BFD0;
}
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v48 + 560) + 2168LL) + 1220LL) == 2 )
v47 = 10.0;
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(v34, v47);
v49 = *(_QWORD *)v34;
v50 = (float)(v237 * 0.5) - 30.0;
v51 = (float *)(*(__int64 (__fastcall **)(cocos2d::CCMenu *))(*(_QWORD *)v34 + 200LL))(v34);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v250, *v51, v50);
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64))(v49 + 184))(v34, v52);
v53 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v257 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v257);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v53 = qword_14090BFD0;
}
if ( !*(_BYTE *)(v53 + 962) )
{
v54 = *(_QWORD *)(v53 + 560);
if ( *(_DWORD *)(*(_QWORD *)(v54 + 2168) + 1220LL) != 2 && !*(_BYTE *)(*(_QWORD *)(v54 + 3528) + 341LL) )
{
v55 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_practiceTxt_001.png");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v55);
v56 = *(_QWORD *)v55;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v250, (float)(v236 * 0.5) - 190.0, (float)(v237 * 0.5) - 12.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v56 + 184))(v55, v57);
}
}
v58 = v11 * 0.5;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v253,
(float)((float)((float)(v236 * 0.5) + v58) - 26.0) - 0.0,
(float)((float)((float)(v237 * 0.5) + v27) - 26.0) - 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v255, (float)((float)((float)(v236 * 0.5) - v58) + 26.0) + 0.0, v254);
v59 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v250 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v250);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v59 = qword_14090BFD0;
}
v60 = *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v59 + 560) + 2168LL) + 1220LL);
LODWORD(v238) = v60;
v61 = 0;
v62 = 0x7FFFFFFFFFFFFFFFLL;
while ( 2 )
{
*(_OWORD *)Block = 0;
v267 = 0;
v268 = 0;
v63 = sub_14003D460(0x20u);
Block[0] = v63;
v267 = 19;
v268 = 31;
qmemcpy(v63, "GJ_plainBtn_001.pn", 18);
v63[9] = (unsigned __int8)aGjPlainbtn001P[18];
v64 = 0;
switch ( v61 )
{
case 0u:
v65 = v268;
if ( v268 >= 0x17 )
{
v66 = Block[0];
v267 = 23;
memmove(Block[0], "sideBtn_options_001.png", 0x17u);
v66[23] = 0;
goto LABEL_149;
}
v67 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v62 = 31;
if ( v268 + v67 > 0x1F )
v62 = v268 + v67;
}
v68 = (char *)sub_14003D460(v62 + 1);
v267 = 23;
v268 = v62;
strcpy(v68, "sideBtn_options_001.png");
goto LABEL_50;
case 1u:
v71 = v268;
if ( v268 >= 0x14 )
{
v72 = Block[0];
v267 = 20;
memmove(Block[0], "sideBtn_hide_001.png", 0x14u);
v72[20] = 0;
goto LABEL_149;
}
v73 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v74 = 31;
if ( v73 + v268 > 0x1F )
v74 = v73 + v268;
}
else
{
v74 = 0x7FFFFFFFFFFFFFFFLL;
}
v75 = sub_14003D460(v74 + 1);
v267 = 20;
v268 = v74;
*(_OWORD *)v75 = *(_OWORD *)"sideBtn_hide_001.png";
v76 = *(_DWORD *)".png";
goto LABEL_62;
case 2u:
v105 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v264 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v264);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v105 = qword_14090BFD0;
}
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v105 + 560) + 2168LL) + 972LL) == 5 )
goto LABEL_82;
v87 = v268;
if ( v268 >= 0x15 )
{
v106 = Block[0];
v267 = 21;
memmove(Block[0], "sideBtn_death_001.png", 0x15u);
v106[21] = 0;
goto LABEL_148;
}
v107 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v62 = 31;
if ( v107 + v268 > 0x1F )
v62 = v107 + v268;
}
v90 = sub_14003D460(v62 + 1);
v267 = 21;
v268 = v62;
qmemcpy(v90, "sideBtn_death_001.pn", 20);
*((_WORD *)v90 + 10) = (unsigned __int8)aSidebtnDeath00[20];
goto LABEL_143;
case 3u:
v87 = v268;
if ( v268 >= 0x16 )
{
v108 = Block[0];
v267 = 22;
memmove(Block[0], "sideBtn_marker_001.png", 0x16u);
v108[22] = 0;
goto LABEL_148;
}
v109 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v62 = 31;
if ( v109 + v268 > 0x1F )
v62 = v109 + v268;
}
v90 = sub_14003D460(v62 + 1);
v267 = 22;
v268 = v62;
qmemcpy(v90, "sideBtn_marker_001.p", 20);
v91 = *(_WORD *)"ng";
goto LABEL_142;
case 4u:
if ( v60 == 2 )
goto LABEL_82;
v79 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v250 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v250);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v79 = qword_14090BFD0;
}
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v79 + 560) + 2168LL) + 1220LL) == 1 )
goto LABEL_82;
v80 = v268;
if ( v268 < 0x14 )
{
v82 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v83 = 31;
if ( v82 + v268 > 0x1F )
v83 = v82 + v268;
}
else
{
v83 = 0x7FFFFFFFFFFFFFFFLL;
}
v84 = (char *)sub_14003D460(v83 + 1);
v267 = 20;
v268 = v83;
strcpy(v84, "sideBtn_chat_001.png");
if ( v80 > 0xF )
{
v85 = Block[0];
if ( v80 + 1 >= 0x1000 )
{
v85 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v85 - 8) > 0x1F )
LABEL_175:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v85);
}
Block[0] = v84;
}
else
{
v81 = Block[0];
v267 = 20;
memmove(Block[0], "sideBtn_chat_001.png", 0x14u);
v81[20] = 0;
}
goto LABEL_148;
case 5u:
if ( v60 == 2 )
goto LABEL_82;
v87 = v268;
if ( v268 >= 0x16 )
{
v88 = Block[0];
v267 = 22;
memmove(Block[0], "sideBtn_quests_001.png", 0x16u);
v88[22] = 0;
goto LABEL_148;
}
v89 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v62 = 31;
if ( v268 + v89 > 0x1F )
v62 = v268 + v89;
}
v90 = sub_14003D460(v62 + 1);
v267 = 22;
v268 = v62;
qmemcpy(v90, "sideBtn_quests_001.p", 20);
v91 = *(_WORD *)"ng";
LABEL_142:
*((_WORD *)v90 + 10) = v91;
*((_BYTE *)v90 + 22) = 0;
goto LABEL_143;
case 6u:
if ( v60 != 2 )
goto LABEL_82;
v101 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v235 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v235);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v101 = qword_14090BFD0;
}
GameVariable = GameManager::getGameVariable(v101, "0173");
v103 = "sideBtn_damageOn_001.png";
if ( GameVariable )
v103 = "sideBtn_damageOff_001.png";
v104 = -1;
do
++v104;
while ( v103[v104] );
sub_1400405A0(Block, v103, v104);
goto LABEL_148;
case 7u:
v95 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v257 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v257);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v95 = qword_14090BFD0;
}
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v95 + 560) + 2168LL) + 972LL) != 5 )
goto LABEL_82;
v87 = v268;
if ( v268 < 0x16 )
{
v97 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v62 = 31;
if ( v268 + v97 > 0x1F )
v62 = v268 + v97;
}
v90 = sub_14003D460(v62 + 1);
v267 = 22;
v268 = v62;
strcpy((char *)v90, "sideBtn_platUI_001.png");
LABEL_143:
v110 = v90;
if ( v87 > 0xF )
{
v111 = Block[0];
if ( v87 + 1 >= 0x1000 )
{
v111 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v111 - 8) > 0x1F )
goto LABEL_175;
}
j_j_free(v111);
}
Block[0] = v110;
}
else
{
v96 = Block[0];
v267 = 22;
memmove(Block[0], "sideBtn_platUI_001.png", 0x16u);
v96[22] = 0;
}
LABEL_148:
v64 = 1;
LABEL_149:
v112 = Block;
if ( v268 > 0xF )
v112 = (void **)Block[0];
v113 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName((const char *)v112);
v263 = operator new(0x208u);
v114 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v263);
if ( !v114 )
goto LABEL_155;
if ( CCMenuItemSpriteExtra::init((__int64 *)v114, v113, 0, a1, (__int64)PauseLayer::onSideButtonPressed) )
{
cocos2d::CCObject::autorelease(v114);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v114 + 8LL))(v114, 1);
LABEL_155:
v114 = nullptr;
}
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v114 + 64LL))(v114, v61);
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v114);
v115 = *(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v114 + 184LL);
if ( v64 )
{
cocos2d::CCNode::convertToNodeSpace(v34, &v261, v255);
v115(v114, v116);
v256 = v256 + -34.0;
}
else
{
cocos2d::CCNode::convertToNodeSpace(v34, &v251, v253);
v115(v114, v117);
v254 = v254 + -34.0;
}
if ( v61 == 5 )
{
*(_QWORD *)(a1 + 664) = v113;
if ( v113 )
{
(*(void (__fastcall **)(__int64 *, __int64))(*v113 + 560))(v113, 99);
if ( ChallengesPage::canCollectQuests() )
{
v118 = cocos2d::CCSprite::createWithSpriteFrameName("exMark_001.png");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64, __int64))(**(_QWORD **)(a1 + 664)
+ 448LL))(
*(_QWORD *)(a1 + 664),
v118,
10,
99);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v118 + 160LL))(v118);
v119 = *(_QWORD *)v118;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v241, 6.0, 22.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v119 + 184))(v118, v120);
}
}
}
else if ( v61 == 8 )
{
v121 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v242[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v242[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v121 = qword_14090BFD0;
}
if ( *(float *)(*(_QWORD *)(v121 + 560) + 13664LL) != 1.0 )
PauseLayer::onSideButtonPressed(a1, v114);
}
if ( v268 > 0xF )
{
v122 = Block[0];
if ( v268 + 1 >= 0x1000 )
{
v122 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v122 - 8) > 0x1F )
goto LABEL_176;
}
j_j_free(v122);
}
v62 = 0x7FFFFFFFFFFFFFFFLL;
v60 = v238;
LABEL_173:
if ( (int)++v61 <= 9 )
continue;
v123 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName("hideBtn_001.png");
(*(void (__fastcall **)(__int64 *, _QWORD))(v123[40] + 40))(v123 + 40, 0);
v242[0] = (__int64)operator new(0x208u);
v124 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v242[0]);
if ( !v124 )
goto LABEL_181;
if ( CCMenuItemSpriteExtra::init((__int64 *)v124, v123, 0, a1, (__int64)PauseLayer::onToggleUI) )
{
cocos2d::CCObject::autorelease(v124);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v124 + 8LL))(v124, 1);
LABEL_181:
v124 = nullptr;
}
v125 = cocos2d::CCMenu::createWithItem(v124);
*(_QWORD *)(a1 + 656) = v125;
(*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v125, 100);
v126 = **(_QWORD **)(a1 + 656);
v128 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v127);
cocos2d::CCDirector::getScreenTop(v128);
v130 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v129);
cocos2d::CCDirector::getScreenRight(v130);
(*(void (__fastcall **)(_QWORD))(v126 + 176))(*(_QWORD *)(a1 + 656));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 656) + 336LL))(*(_QWORD *)(a1 + 656), 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v259, v236 * 0.5, (float)(v237 * 0.5) - 90.0);
v132 = Slider::create(
a1,
(__int64)EditorPauseLayer::musicSliderChanged,
v131,
"slidergroove.png",
(__int64)"sliderthumb.png",
(__int64)"sliderthumbsel.png",
0.69999999);
*(_QWORD *)(a1 + 640) = v132;
LOBYTE(v133) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)v132 + 52) + 336LL))(*((_QWORD *)v132 + 52), v133);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
*(_QWORD *)(a1 + 640));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, -100.0, 0.0);
cocos2d::CCPoint::operator+(v259, &v239, v134);
(*(void (__fastcall **)(_QWORD, cocos2d::CCArray **))(**(_QWORD **)(a1 + 640) + 184LL))(
*(_QWORD *)(a1 + 640),
&v239);
v135 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v241 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v241);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v135 = qword_14090BF60;
}
Slider::setValue(*(_QWORD *)(a1 + 640), *(float *)(v135 + 512));
v137 = Slider::create(
a1,
(__int64)EditorPauseLayer::sfxSliderChanged,
v136,
"slidergroove.png",
(__int64)"sliderthumb.png",
(__int64)"sliderthumbsel.png",
0.69999999);
*(_QWORD *)(a1 + 648) = v137;
LOBYTE(v138) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)v137 + 52) + 336LL))(*((_QWORD *)v137 + 52), v138);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
*(_QWORD *)(a1 + 648));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, 100.0, 0.0);
cocos2d::CCPoint::operator+(v259, &v239, v139);
(*(void (__fastcall **)(_QWORD, cocos2d::CCArray **))(**(_QWORD **)(a1 + 648) + 184LL))(
*(_QWORD *)(a1 + 648),
&v239);
v140 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v241 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v241);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v140 = qword_14090BF60;
}
Slider::setValue(*(_QWORD *)(a1 + 648), *(float *)(v140 + 516));
v141 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v242[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v242[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v141 = qword_14090BFD0;
}
*(_QWORD *)(v141 + 984) = a1 + 576;
v142 = cocos2d::CCSprite::createWithSpriteFrameName("gj_songIcon_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v142 + 160LL))(v142);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v142);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, -90.0, 0.0);
v144 = v143;
v145 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 640) + 200LL))(*(_QWORD *)(a1 + 640));
cocos2d::CCPoint::operator+(v145, &v239, v144);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, cocos2d::CCArray **))(*(_QWORD *)v142 + 184LL))(v142, &v239);
v146 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_sfxIcon_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v146 + 160LL))(v146);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v146);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, -90.0, 0.0);
v148 = v147;
v149 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 648) + 200LL))(*(_QWORD *)(a1 + 648));
cocos2d::CCPoint::operator+(v149, &v257, v148);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, void **))(*(_QWORD *)v146 + 184LL))(v146, &v257);
v150 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v241 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v241);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v150 = qword_14090BFD0;
}
v151 = *(_QWORD *)(v150 + 560);
v152 = *(_DWORD **)(v151 + 2168);
LODWORD(v235) = v152[259];
if ( (int)v235 > 0 && !*(_BYTE *)(v151 + 13024) )
{
v153 = v152[305];
if ( v153 != 2 )
{
v154 = v152[260] - v152[261];
LODWORD(v238) = v154;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v250, v236 * 0.5, (float)((float)(v237 * 0.5) - v27) + 23.0);
v239 = (cocos2d::CCArray *)cocos2d::CCArray::create(v155);
v156 = 1;
while ( 1 )
{
v157 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v241 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v241);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v157 = qword_14090BFD0;
}
v158 = *(_QWORD *)(v157 + 560);
v159 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, v156);
CString = cocos2d::CCString::getCString(v159);
*(_OWORD *)Block = 0;
v267 = 0;
v268 = 0;
v161 = -1;
do
++v161;
while ( CString[v161] );
sub_14003D230(Block, CString, v161);
v162 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v158 + 13072), Block);
if ( v268 > 0xF )
{
v163 = Block[0];
if ( v268 + 1 >= 0x1000 )
{
v163 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v163 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v163);
}
CoinKey = (char *)GJGameLevel::getCoinKey((__int64)v152, v156, v152[248] - v152[249]);
v165 = qword_14090BFE0;
if ( v153 == 1 )
{
if ( !qword_14090BFE0 )
{
v251 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v251);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v165 = qword_14090BFE0;
}
hasSecretCoin = GameStatsManager::hasSecretCoin(v165, CoinKey);
}
else if ( v154 == 1 )
{
if ( !qword_14090BFE0 )
{
v261 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v261);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v165 = qword_14090BFE0;
}
hasSecretCoin = GameStatsManager::hasUserCoin(v165, CoinKey);
}
else
{
if ( !qword_14090BFE0 )
{
v263 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v263);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v165 = qword_14090BFE0;
}
hasSecretCoin = GameStatsManager::hasPendingUserCoin(v165, CoinKey);
}
v167 = hasSecretCoin;
if ( hasSecretCoin )
{
v168 = "gjCoinUI_01_collected_001.png";
v169 = "gjCoinUI_02_collected_001.png";
}
else if ( v162 )
{
v168 = "gjCoinUI_01_on_001.png";
v169 = "gjCoinUI_02_on_001.png";
}
else
{
v168 = "gjCoinUI_01_off_001.png";
v169 = "gjCoinUI_02_off_001.png";
}
if ( v153 != 1 )
v168 = v169;
v170 = cocos2d::CCSprite::createWithSpriteFrameName(v168);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v170 + 160LL))(v170);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v170,
8);
cocos2d::CCArray::addObject(v239, v170);
v171 = v238;
if ( v153 != 1 && (_DWORD)v238 != 1 )
{
v244 = -20481;
v245 = -20481;
v246 = 75;
(**((void (__fastcall ***)(__int64, __int16 *))v170 + 40))((__int64)v170 + 320, &v245);
v171 = v238;
}
if ( !v162 )
{
if ( v167 )
v172 = 0.5;
else
v172 = 0.75;
v173 = -65;
if ( v167 )
v173 = 125;
if ( v153 != 1 && v171 != 1 )
{
v172 = v172 * 0.5;
if ( v167 )
v173 = -106;
}
v174 = (*(__int64 (__fastcall **)(__int64))(*((_QWORD *)v170 + 40) + 8LL))((__int64)v170 + 320);
v252 = *(_WORD *)v174;
v175 = *(unsigned __int8 *)(v174 + 2);
LOBYTE(v247) = (int)(float)((float)(unsigned __int8)v252 * v172);
HIBYTE(v247) = (int)(float)((float)HIBYTE(v252) * v172);
v248 = v247;
v249 = (int)(float)((float)v175 * v172);
(**((void (__fastcall ***)(__int64, __int16 *))v170 + 40))((__int64)v170 + 320, &v248);
(*(void (__fastcall **)(__int64, _QWORD))(*((_QWORD *)v170 + 40) + 40LL))((__int64)v170 + 320, v173);
}
if ( (int)++v156 > (int)v235 )
break;
v154 = v238;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v241, (const struct cocos2d::CCPoint *)&v250);
GameToolbox::alignItemsHorisontally((__int64)v239, 20.0, v176, 0);
v150 = qword_14090BFD0;
v34 = v243;
}
}
if ( !v150 )
{
v251 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v251);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v150 = qword_14090BFD0;
}
StartPosObjectsForCurrentMode = GJBaseGameLayer::getStartPosObjectsForCurrentMode(*(_QWORD *)(v150 + 560));
*(_QWORD *)(a1 + 608) = StartPosObjectsForCurrentMode;
cocos2d::CCObject::retain(StartPosObjectsForCurrentMode);
if ( !cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 608)) )
{
v178 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v242[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v242[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v178 = qword_14090BFD0;
}
v179 = *(_QWORD *)(*(_QWORD *)(v178 + 560) + 2168LL);
if ( *(_DWORD *)(v179 + 1220) != 2 )
goto LABEL_274;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v235, v236 * 0.5, (float)((float)(v237 * 0.5) - v27) + 17.0);
v180 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v242[0] = (__int64)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v242[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v180 = qword_14090BFD0;
}
v181 = *(struct cocos2d::CCObject **)(*(_QWORD *)(v180 + 560) + 12912LL);
if ( v181 )
v182 = cocos2d::CCArray::indexOfObject(*(cocos2d::CCArray **)(a1 + 608), v181) + 1;
else
v182 = 0;
*(_DWORD *)(a1 + 600) = v182;
v183 = cocos2d::CCLabelBMFont::create("StartPos:", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v183 + 160LL))(v183);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v183);
v184 = *(_QWORD *)v183;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, *(float *)&v235 - 130.0, *((float *)&v235 + 1) + 1.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v184 + 184))(v183, v185);
v186 = cocos2d::CCLabelBMFont::create("StartPos", (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 592) = v186;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v186);
(*(void (__fastcall **)(_QWORD, void **))(**(_QWORD **)(a1 + 592) + 184LL))(*(_QWORD *)(a1 + 592), &v235);
v187 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
(*(void (__fastcall **)(__int64 *))(*v187 + 160))(v187);
v242[0] = (__int64)operator new(0x208u);
v188 = (__int64 *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v242[0]);
v189 = v188;
if ( !v188 )
goto LABEL_253;
if ( CCMenuItemSpriteExtra::init(v188, v187, 0, a1, (__int64)PauseLayer::onChangeStartpos) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v189);
}
else
{
(*(void (__fastcall **)(__int64 *, __int64))(*v189 + 8))(v189, 1);
LABEL_253:
v189 = nullptr;
}
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64 *))(*(_QWORD *)v34 + 464LL))(v34, v189);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v235, &v243, v190);
v191 = *v189;
cocos2d::CCNode::convertToNodeSpace(v34, &v241, &v243);
(*(void (__fastcall **)(__int64 *, __int64))(v191 + 184))(v189, v192);
*((_DWORD *)v189 + 93) = 1068708659;
(*(void (__fastcall **)(__int64 *, __int64))(*v189 + 64))(v189, 0xFFFFFFFFLL);
v193 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v193, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v193 + 160LL))(v193);
v242[0] = (__int64)operator new(0x208u);
v194 = (__int64 *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v242[0]);
v195 = v194;
if ( !v194 )
goto LABEL_258;
if ( CCMenuItemSpriteExtra::init(v194, (__int64 *)v193, 0, a1, (__int64)PauseLayer::onChangeStartpos) )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v195);
}
else
{
(*(void (__fastcall **)(__int64 *, __int64))(*v195 + 8))(v195, 1);
LABEL_258:
v195 = nullptr;
}
(*(void (__fastcall **)(cocos2d::CCMenu *, __int64 *))(*(_QWORD *)v34 + 464LL))(v34, v195);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v235, &v243, v196);
v197 = *v195;
cocos2d::CCNode::convertToNodeSpace(v34, &v241, &v243);
(*(void (__fastcall **)(__int64 *, __int64))(v197 + 184))(v195, v198);
*((_DWORD *)v195 + 93) = 1068708659;
(*(void (__fastcall **)(__int64 *, __int64))(*v195 + 64))(v195, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v251, 110.0, 0.0);
cocos2d::CCPoint::operator+(&v235, &v239, v199);
v200 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_menuBtn_001.png");
(*(void (__fastcall **)(__int64 *))(*v200 + 160))(v200);
v242[0] = (__int64)operator new(0x208u);
v201 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v242[0]);
if ( !v201 )
goto LABEL_263;
if ( CCMenuItemSpriteExtra::init((__int64 *)v201, v200, 0, a1, (__int64)PauseLayer::onShowStartposBrowser) )
{
cocos2d::CCObject::autorelease(v201);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v201 + 8LL))(v201, 1);
LABEL_263:
v201 = nullptr;
}
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v201);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v239, &v243, v202);
v203 = *(_QWORD *)v201;
cocos2d::CCNode::convertToNodeSpace(v34, &v241, &v243);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v203 + 184))(v201, v204);
v205 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v251 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v251);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v205 = qword_14090BFD0;
}
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)(v205 + 560) + 2168LL) + 1220LL) != 2 )
goto LABEL_273;
v206 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_plusBtn_001.png");
(*(void (__fastcall **)(__int64 *))(*v206 + 160))(v206);
v242[0] = (__int64)operator new(0x208u);
v207 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v242[0]);
if ( !v207 )
goto LABEL_271;
if ( CCMenuItemSpriteExtra::init((__int64 *)v207, v206, 0, a1, (__int64)PauseLayer::onCreateStartpos) )
{
cocos2d::CCObject::autorelease(v207);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v207 + 8LL))(v207, 1);
LABEL_271:
v207 = nullptr;
}
(*(void (__fastcall **)(cocos2d::CCMenu *, cocos2d::CCObject *))(*(_QWORD *)v34 + 464LL))(v34, v207);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v242, 30.0, 0.0);
cocos2d::CCPoint::operator+(&v239, &v243, v208);
v209 = *(_QWORD *)v207;
cocos2d::CCNode::convertToNodeSpace(v34, &v241, &v243);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v209 + 184))(v207, v210);
LABEL_273:
PauseLayer::onChangeStartpos(a1, 0);
*(_BYTE *)(a1 + 616) = 0;
LABEL_274:
result = cocos2d::CCApplication::sharedApplication(v179);
if ( *(_BYTE *)(result + 209) )
{
v212 = cocos2d::CCSprite::createWithSpriteFrameName("controllerBtn_Start_001.png");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v212);
v213 = v258;
v214 = *(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v258 + 504LL);
v215 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v258 + 200LL))(v258);
v216 = v214(v213);
cocos2d::CCNode::convertToWorldSpace(v216, v242, v215);
cocos2d::CCNode::convertToNodeSpace(a1, &v235, v217);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v241, 0.0, -37.0);
cocos2d::CCPoint::operator+(&v235, &v258, v218);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, cocos2d::CCObject **))(*(_QWORD *)v212 + 184LL))(
v212,
&v258);
v219 = cocos2d::CCSprite::createWithSpriteFrameName("controllerBtn_B_001.png");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v219);
v220 = v240;
v221 = *(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v240 + 504LL);
v222 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v240 + 200LL))(v240);
v223 = v221(v220);
cocos2d::CCNode::convertToWorldSpace(v223, v242, v222);
cocos2d::CCNode::convertToNodeSpace(a1, &v241, v224);
cocos2d::CCPoint::operator=(&v235, v225);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v251, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v235, &v240, v226);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, cocos2d::CCObject **))(*(_QWORD *)v219 + 184LL))(
v219,
&v240);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v219 + 160LL))(v219);
v227 = cocos2d::CCSprite::createWithSpriteFrameName("controllerBtn_X_001.png");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
v227);
v228 = v260;
v229 = *(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v260 + 504LL);
v230 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v260 + 200LL))(v260);
v231 = v229(v228);
cocos2d::CCNode::convertToWorldSpace(v231, v242, v230);
cocos2d::CCNode::convertToNodeSpace(a1, &v241, v232);
cocos2d::CCPoint::operator=(&v235, v233);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v261, 0.0, -30.0);
cocos2d::CCPoint::operator+(&v235, &v240, v234);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, cocos2d::CCObject **))(*(_QWORD *)v227 + 184LL))(
v227,
&v240);
return (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v227 + 160LL))(v227);
}
return result;
case 8u:
if ( v60 != 2 )
goto LABEL_82;
v71 = v268;
if ( v268 < 0x14 )
{
v93 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v94 = 31;
if ( v268 + v93 > 0x1F )
v94 = v268 + v93;
}
else
{
v94 = 0x7FFFFFFFFFFFFFFFLL;
}
v75 = sub_14003D460(v94 + 1);
v267 = 20;
v268 = v94;
*(_OWORD *)v75 = *(_OWORD *)"sideBtn_time_001.png";
v76 = *(_DWORD *)".png";
LABEL_62:
*((_DWORD *)v75 + 4) = v76;
*((_BYTE *)v75 + 20) = 0;
v77 = v75;
if ( v71 > 0xF )
{
v78 = Block[0];
if ( v71 + 1 >= 0x1000 )
{
v78 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v78 - 8) > 0x1F )
goto LABEL_175;
}
j_j_free(v78);
}
Block[0] = v77;
}
else
{
v92 = Block[0];
v267 = 20;
memmove(Block[0], "sideBtn_time_001.png", 0x14u);
v92[20] = 0;
}
goto LABEL_149;
case 9u:
v98 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v239 = (cocos2d::CCArray *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v239);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v98 = qword_14090BFD0;
}
if ( !*(_BYTE *)(*(_QWORD *)(v98 + 560) + 13024LL) )
{
LABEL_82:
if ( v268 > 0xF )
{
v86 = Block[0];
if ( v268 + 1 >= 0x1000 )
{
v86 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v86 - 8) > 0x1F )
LABEL_176:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v86);
}
goto LABEL_173;
}
v65 = v268;
if ( v268 < 0x1A )
{
v100 = v268 >> 1;
if ( v268 <= 0x7FFFFFFFFFFFFFFFLL - (v268 >> 1) )
{
v62 = 31;
if ( v100 + v268 > 0x1F )
v62 = v100 + v268;
}
v68 = (char *)sub_14003D460(v62 + 1);
v267 = 26;
v268 = v62;
strcpy(v68, "sideBtn_practiceUI_001.png");
LABEL_50:
v69 = v68;
if ( v65 > 0xF )
{
v70 = Block[0];
if ( v65 + 1 >= 0x1000 )
{
v70 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v70 - 8) > 0x1F )
goto LABEL_175;
}
j_j_free(v70);
}
Block[0] = v69;
}
else
{
v99 = Block[0];
v267 = 26;
memmove(Block[0], "sideBtn_practiceUI_001.png", 0x1Au);
v99[26] = 0;
}
goto LABEL_149;
default:
goto LABEL_149;
}
}
}