//
// EndLevelLayer::customSetup from 0x100392028 to 0x10039365c (5684 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009415d8
//
// 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 11:03:39 +0000
//
void __fastcall EndLevelLayer::customSetup(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x9
int v4; // w26
int v5; // w10
int32x4_t v6; // q0
int32x4_t v7; // q0
bool v8; // zf
bool v9; // cc
float v10; // s0
float v11; // s8
float v12; // s1
float v13; // s3
float v14; // s0
const char *v15; // x0
unsigned __int8 *v16; // x21
__int64 v17; // x0
__int64 v18; // x0
__n128 GameVariable; // q0
int v20; // w0
double v21; // d0
float32x2_t *v22; // x21
int PlayTimerMilli; // w0
int v24; // w8
int v25; // w20
void *v26; // x0
const char *CString; // x0
__int64 v28; // x22
void *v29; // x0
const char *v30; // x0
__int64 v31; // x21
int v32; // w10
unsigned int v33; // w11
void *v34; // x0
const std::string::value_type *v35; // x0
std::string *v36; // x8
void *v37; // x0
const std::string::value_type *v38; // x0
std::string *v39; // x8
void *v40; // x0
const char *v41; // x0
__int64 v42; // x21
__int64 v43; // x0
std::string *v44; // x0
__int128 v45; // q0
__int64 v46; // x0
__int64 v47; // x21
_DWORD *v48; // x21
double v49; // d0
void *v50; // x0
_DWORD *v51; // x21
const char *v52; // x0
__int64 v53; // x21
__n128 v54; // q0
char *v55; // x1
float v56; // s9
__int64 v57; // x21
__int64 v58; // x22
void *v59; // x0
void *v60; // x20
double v61; // d0
void *v62; // x23
void *v63; // x20
double v64; // d0
void *v65; // x24
float v66; // s10
float *v67; // x0
void *v68; // x23
__int64 v69; // x24
double v70; // d0
void *v71; // x0
void *v72; // x23
__int64 v73; // x24
double v74; // d0
int v75; // w8
void *v76; // x0
void *v77; // x23
__int64 v78; // x24
__int64 v79; // x25
void *v80; // x0
void *v81; // x23
__int64 v82; // x24
void *v83; // x23
void *v84; // x0
__int64 v85; // x1
__int64 v86; // x2
__int64 v87; // x3
__int64 v88; // x4
__int64 v89; // x5
__int64 v90; // x6
__int64 v91; // x7
__int64 v92; // x24
__int64 v93; // x0
float v94; // s9
__int64 v95; // x0
__int64 v96; // x1
float v97; // s10
__int64 v98; // x0
float v99; // s0
float *v100; // x0
int v101; // w8
int v102; // w28
_QWORD *v103; // x0
float v104; // s0
float v105; // s9
_QWORD *v106; // x23
int v107; // w25
const char *v108; // x0
void *v109; // x24
unsigned int i; // w24
__int64 v111; // x0
__int64 v112; // x25
__int64 v113; // x26
__int64 CoinKey_1; // x0
char hasUserCoin; // w0
__int64 v116; // x26
__int64 v117; // x0
__int64 v118; // x26
__int64 v119; // x0
char v120; // w27
_BOOL4 hasItem; // w26
char *v122; // x0
void *v123; // x27
__int64 v124; // x0
char *v125; // x0
void *v126; // x26
__int64 v127; // x0
void *v128; // x20
__int64 v129; // x23
__int64 v130; // x24
__int64 v131; // x0
double v132; // d0
void *v133; // x20
__int64 v134; // x19
__int64 v135; // x22
__int64 v136; // x0
double v137; // d0
void *v138; // [xsp+18h] [xbp-218h]
void *v139; // [xsp+20h] [xbp-210h]
_DWORD *v140; // [xsp+28h] [xbp-208h]
void *v141; // [xsp+30h] [xbp-200h] BYREF
char v142; // [xsp+47h] [xbp-1E9h]
float32x2_t v143; // [xsp+48h] [xbp-1E8h] BYREF
float32x2_t v144; // [xsp+50h] [xbp-1E0h] BYREF
const void *v145[2]; // [xsp+58h] [xbp-1D8h] BYREF
char v146; // [xsp+6Fh] [xbp-1C1h]
void *__p[2]; // [xsp+70h] [xbp-1C0h] BYREF
char v148; // [xsp+87h] [xbp-1A9h]
void *v149[2]; // [xsp+88h] [xbp-1A8h] BYREF
char v150; // [xsp+9Fh] [xbp-191h]
void *v151[2]; // [xsp+A0h] [xbp-190h] BYREF
char v152; // [xsp+B7h] [xbp-179h]
const void *v153[2]; // [xsp+B8h] [xbp-178h] BYREF
char v154; // [xsp+CFh] [xbp-161h]
const void *v155[2]; // [xsp+D0h] [xbp-160h] BYREF
char v156; // [xsp+E7h] [xbp-149h]
const void *v157[2]; // [xsp+E8h] [xbp-148h] BYREF
char v158; // [xsp+FFh] [xbp-131h]
const void *v159[2]; // [xsp+100h] [xbp-130h] BYREF
char v160; // [xsp+117h] [xbp-119h]
const void *v161[2]; // [xsp+118h] [xbp-118h] BYREF
char v162; // [xsp+12Fh] [xbp-101h]
void *v163[2]; // [xsp+130h] [xbp-100h] BYREF
char v164; // [xsp+147h] [xbp-E9h]
std::string v165; // [xsp+148h] [xbp-E8h] BYREF
__int128 v166; // [xsp+160h] [xbp-D0h] BYREF
signed __int64 v167; // [xsp+170h] [xbp-C0h]
std::string v168; // [xsp+178h] [xbp-B8h] BYREF
__int64 v169; // [xsp+190h] [xbp-A0h] BYREF
float32x2_t v170; // [xsp+198h] [xbp-98h] BYREF
float32x2_t v171; // [xsp+1A0h] [xbp-90h] BYREF
float32x2_t v172; // [xsp+1A8h] [xbp-88h] BYREF
float v173[4]; // [xsp+1B0h] [xbp-80h] BYREF
*(_QWORD *)(a1 + 632) = 0;
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v2, v173);
v3 = *(_QWORD *)(a1 + 608);
v140 = *(_DWORD **)(v3 + 1936);
v4 = *(unsigned __int8 *)(v3 + 12238);
if ( *(_BYTE *)(v3 + 14644) == 1 )
{
v5 = v140[237] - v140[238];
if ( v140[225] == 5 )
*(_DWORD *)(a1 + 672) = v5;
else
*(_DWORD *)(a1 + 668) = v5;
}
v6.i64[0] = *(_QWORD *)(v3 + 14648);
*(_DWORD *)(a1 + 664) = v6.i32[0];
*(_DWORD *)(a1 + 676) = v6.i32[1];
v6.i64[1] = *(_QWORD *)(a1 + 668);
v7 = (int32x4_t)vandq_s8((int8x16_t)vcgtzq_s32(v6), (int8x16_t)xmmword_10076DB10);
v7.i32[0] = vaddvq_s32(v7) & 0xF;
*(int8x8_t *)v7.i8 = vcnt_s8(*(int8x8_t *)v7.i8);
v7.i16[0] = vaddlv_u8(*(uint8x8_t *)v7.i8);
v8 = v7.i32[0] == 2;
v9 = v7.i32[0] > 2u;
v10 = 0.0;
if ( v8 )
v10 = 5.0;
if ( v9 )
v11 = -34.0;
else
v11 = -38.0;
v12 = 16.0;
if ( !v9 )
v12 = v10;
v13 = v173[1];
v14 = (float)(v173[0] * 0.5) + 120.0;
*(_BYTE *)(a1 + 680) = *(_BYTE *)(v3 + 14656);
sub_1000262BC((float *)&v172, v14, (float)((float)(v13 * 0.5) + 18.0) + v12);
if ( *(int *)(a1 + 668) >= 1 || *(int *)(a1 + 672) >= 1 )
{
sub_10002630C((_QWORD *)(a1 + 640), (double *)&v172);
sub_1000262BC((float *)&v166, 0.0, v11);
sub_100026318(&v172, (float32x2_t *)&v166, (float32x2_t *)&v168);
sub_10002630C(&v172, (double *)&v168);
}
if ( *(int *)(a1 + 664) >= 1 )
{
sub_10002630C((_QWORD *)(a1 + 648), (double *)&v172);
sub_1000262BC((float *)&v166, 0.0, v11);
sub_100026318(&v172, (float32x2_t *)&v166, (float32x2_t *)&v168);
sub_10002630C(&v172, (double *)&v168);
}
if ( *(int *)(a1 + 676) >= 1 )
{
sub_10002630C((_QWORD *)(a1 + 656), (double *)&v172);
sub_1000262BC((float *)&v166, 0.0, v11);
sub_100026318(&v172, (float32x2_t *)&v166, (float32x2_t *)&v168);
sub_10002630C(&v172, (double *)&v168);
}
if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 12544LL) )
v15 = "GJ_practiceComplete_001.png";
else
v15 = "GJ_levelComplete_001.png";
v16 = (unsigned __int8 *)cocos2d::CCSprite::createWithSpriteFrameName((__int64)v15);
(*(void (__fastcall **)(unsigned __int8 *, float))(*(_QWORD *)v16 + 160LL))(v16, 0.8);
(*(void (__fastcall **)(_QWORD, unsigned __int8 *, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(
*(_QWORD *)(a1 + 576),
v16,
15);
sub_1000262BC((float *)&v168, v173[0] * 0.5, (float)(v173[1] * 0.5) + 75.0);
v17 = (*(__int64 (__fastcall **)(unsigned __int8 *, std::string *))(*(_QWORD *)v16 + 184LL))(v16, &v168);
v18 = GameManager::sharedState(v17);
GameVariable = GameManager::getGameVariable(v18, "0095");
if ( v20 )
cocos2d::CCSprite::setFlipX(v16, 1);
(*(void (__fastcall **)(_QWORD, _QWORD, __n128))(**(_QWORD **)(a1 + 560) + 344LL))(
*(_QWORD *)(a1 + 560),
0,
GameVariable);
sub_1000262BC((float *)&v166, 0.0, 5.0);
sub_100026318((float32x2_t *)(a1 + 544), (float32x2_t *)&v166, (float32x2_t *)&v168);
v21 = sub_10002630C((_QWORD *)(a1 + 544), (double *)&v168);
v22 = (float32x2_t *)(*(__int64 (__fastcall **)(unsigned __int8 *, double))(*(_QWORD *)v16 + 192LL))(v16, v21);
sub_1000262BC((float *)&v168, 0.0, -40.0);
sub_100026318(v22, (float32x2_t *)&v168, &v171);
if ( v4 )
{
v171.f32[1] = v171.f32[1] + -12.0;
sub_1000262F4(&v170, (double *)&v171);
sub_1000262F4(&v169, (double *)&v171);
PlayTimerMilli = GJBaseGameLayer::getPlayTimerMilli(*(_QWORD *)(a1 + 608));
v24 = PlayTimerMilli / 1000;
v25 = PlayTimerMilli % 1000;
}
else
{
sub_1000262F4(&v170, (double *)&v171);
sub_1000262F4(&v169, (double *)&v171);
v26 = sub_1003065B0("Attempts: %i", *(_DWORD *)(*(_QWORD *)(a1 + 608) + 12212LL));
CString = (const char *)cocos2d::CCString::getCString((__int64)v26);
v28 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(*(_QWORD *)(a1 + 576), v28, 3);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v28 + 184LL))(v28, &v170);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v28 + 160LL))(v28, 0.8);
(*(void (__fastcall **)(std::string *__return_ptr, __int64))(*(_QWORD *)v28 + 336LL))(&v165, v28);
sub_1000262BC((float *)&v166, (float)(*(float *)&v165.__r_.__value_.__l.__data_ * -0.5) + -21.0, -2.0);
sub_100026318(&v170, (float32x2_t *)&v166, (float32x2_t *)&v168);
sub_10002630C(&v169, (double *)&v168);
v170.f32[1] = v170.f32[1] + -24.0;
v29 = sub_1003065B0("Jumps: %i", *(_DWORD *)(*(_QWORD *)(a1 + 608) + 14624LL));
v30 = (const char *)cocos2d::CCString::getCString((__int64)v29);
v31 = cocos2d::CCLabelBMFont::create_1(v30, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(*(_QWORD *)(a1 + 576), v31, 3);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v31 + 184LL))(v31, &v170);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v31 + 160LL))(v31, 0.8);
v25 = 0;
v170.f32[1] = v170.f32[1] + -24.0;
v24 = (int)*(double *)(*(_QWORD *)(a1 + 608) + 936LL);
}
v32 = v24 / 60 % 60;
memset(&v168, 0, sizeof(v168));
v33 = v24 + 3599;
if ( !v4 || v32 || v33 > 0x1C1E )
{
if ( v33 > 0x1C1E )
v34 = sub_1003065B0("%02d:%02d:%02d", v24 / 3600, v32, v24 % 60);
else
v34 = sub_1003065B0("%02d:%02d", v24 / 60 % 60, v24 % 60);
}
else
{
v34 = sub_1003065B0("%i", v24 % 60);
}
v35 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v34);
std::string::assign(&v168, v35);
if ( v4 )
{
v36 = &v168;
if ( (v168.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v36 = (std::string *)v168.__r_.__value_.__r.__words[0];
v37 = sub_1003065B0("%s.%03d", (const char *)v36, v25);
v38 = (const std::string::value_type *)cocos2d::CCString::getCString((__int64)v37);
std::string::assign(&v168, v38);
}
v39 = &v168;
if ( (v168.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v39 = (std::string *)v168.__r_.__value_.__r.__words[0];
v40 = sub_1003065B0("Time: %s", (const char *)v39);
v41 = (const char *)cocos2d::CCString::getCString((__int64)v40);
v42 = cocos2d::CCLabelBMFont::create_1(v41, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(*(_QWORD *)(a1 + 576), v42, 3);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v42 + 184LL))(v42, &v170);
cocos2d::CCLabelBMFont::limitLabelWidth(v42, 150.0, 0.8, 0.0);
v170.f32[1] = v170.f32[1] + -24.0;
if ( v4 )
{
v43 = *(unsigned int *)(*(_QWORD *)(a1 + 608) + 1916LL);
if ( (_DWORD)v43 )
{
GameToolbox::pointsToString(v43, (__int64)&v165);
v44 = std::string::insert(&v165, 0, "Points: ");
v45 = *(_OWORD *)&v44->__r_.__value_.__l.__data_;
v167 = v44->__r_.__value_.__r.__words[2];
v166 = v45;
v44->__r_.__value_.__l.__size_ = 0;
v44->__r_.__value_.__r.__words[2] = 0;
v44->__r_.__value_.__r.__words[0] = 0;
if ( SHIBYTE(v165.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v165.__r_.__value_.__l.__data_);
if ( v167 >= 0 )
v46 = cocos2d::CCLabelBMFont::create_1((const char *)&v166, "goldFont.fnt");
else
v46 = cocos2d::CCLabelBMFont::create_1((const char *)v166, "goldFont.fnt");
v47 = v46;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(
*(_QWORD *)(a1 + 576),
v46,
3);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v47 + 184LL))(v47, &v170);
cocos2d::CCLabelBMFont::limitLabelWidth(v47, 150.0, 0.8, 0.0);
v170.f32[1] = v170.f32[1] + -24.0;
if ( SHIBYTE(v167) < 0 )
operator delete((void *)v166);
}
}
if ( v140[285] == 2 )
{
sub_100009900(v163, " ");
sub_1000262BC((float *)&v166, 0.5, 1.0);
v48 = TextArea::create((__int64)v163, (__int64)"bigFont.fnt", (double *)&v166, 0, 0, 1.0, 620.0, 20.0);
if ( v164 < 0 )
operator delete(v163[0]);
(*(void (__fastcall **)(_QWORD, _DWORD *))(**(_QWORD **)(a1 + 576) + 456LL))(*(_QWORD *)(a1 + 576), v48);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v48 + 160LL))(v48, 0.55);
v48[162] = 1107820544;
sub_1000262BC((float *)&v166, v173[0] * 0.5, (float)(v173[1] * 0.5) + -51.0);
(*(void (__fastcall **)(_DWORD *, __int128 *))(*(_QWORD *)v48 + 184LL))(v48, &v166);
if ( v4 )
{
sub_1000262BC((float *)&v165, 0.0, -12.0);
*(float32x2_t *)&v49 = sub_100026318(&v170, (float32x2_t *)&v165, (float32x2_t *)&v166);
(*(void (__fastcall **)(_DWORD *, __int128 *, double))(*(_QWORD *)v48 + 184LL))(v48, &v166, v49);
}
if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 14185LL) == 1 )
{
sub_100009900(v161, "You cannot verify a level after using Ignore Damage.");
TextArea::setString((__int64)v48, v161);
if ( (v162 & 0x80000000) == 0 )
goto LABEL_88;
v50 = (void *)v161[0];
goto LABEL_87;
}
if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 14186LL) == 1 )
{
sub_100009900(v159, "You cannot verify a level after using Speed Changes.");
TextArea::setString((__int64)v48, v159);
if ( (v160 & 0x80000000) == 0 )
goto LABEL_88;
v50 = (void *)v159[0];
goto LABEL_87;
}
if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 12616LL) == 1 )
{
sub_100009900(v157, "You cannot verify a level if it has a start pos.");
TextArea::setString((__int64)v48, v157);
if ( (v158 & 0x80000000) == 0 )
goto LABEL_88;
v50 = (void *)v157[0];
goto LABEL_87;
}
if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 12544LL) == 1 && v140[194] - v140[195] != 1 )
{
sub_100009900(v155, "Complete the level in normal mode to verify it!");
TextArea::setString((__int64)v48, v155);
if ( (v156 & 0x80000000) == 0 )
goto LABEL_88;
v50 = (void *)v155[0];
goto LABEL_87;
}
if ( sub_1000D4874(v140) )
{
if ( (int)v140[241] < 1 )
{
sub_100009900(v151, "Level Verified!");
TextArea::setString((__int64)v48, (const void **)v151);
if ( (v152 & 0x80000000) == 0 )
goto LABEL_88;
v50 = v151[0];
}
else
{
sub_100009900(v153, "Level and Coins Verified!");
TextArea::setString((__int64)v48, v153);
if ( (v154 & 0x80000000) == 0 )
goto LABEL_88;
v50 = (void *)v153[0];
}
goto LABEL_87;
}
sub_10039385C(&v166, a1);
if ( v167 >= 0 )
v55 = (char *)&v166;
else
v55 = (char *)v166;
sub_100009900(v149, v55);
TextArea::setString((__int64)v48, (const void **)v149);
if ( v150 < 0 )
operator delete(v149[0]);
if ( SHIBYTE(v167) < 0 )
{
v50 = (void *)v166;
goto LABEL_87;
}
}
else if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 12544LL) == 1 )
{
sub_100009900(__p, " ");
sub_1000262BC((float *)&v166, 0.5, 1.0);
v51 = TextArea::create((__int64)__p, (__int64)"bigFont.fnt", (double *)&v166, 0, 0, 1.0, 620.0, 20.0);
if ( v148 < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(_QWORD, _DWORD *))(**(_QWORD **)(a1 + 576) + 456LL))(*(_QWORD *)(a1 + 576), v51);
(*(void (__fastcall **)(_DWORD *, float))(*(_QWORD *)v51 + 160LL))(v51, 0.55);
v51[162] = 1107820544;
sub_1000262BC((float *)&v166, v173[0] * 0.5, (float)(v173[1] * 0.5) + -51.0);
(*(void (__fastcall **)(_DWORD *, __int128 *))(*(_QWORD *)v51 + 184LL))(v51, &v166);
sub_100009900(v145, "Well done... Now try to complete it without any checkpoints!");
TextArea::setString((__int64)v51, v145);
if ( v146 < 0 )
{
v50 = (void *)v145[0];
LABEL_87:
operator delete(v50);
}
}
else if ( (int)v140[241] <= 0 )
{
v52 = (const char *)sub_100393A24();
v53 = cocos2d::CCLabelBMFont::create_1(v52, "bigFont.fnt");
v54 = cocos2d::CCLabelBMFont::limitLabelWidth(v53, 260.0, 0.9, 0.0);
(*(void (__fastcall **)(_QWORD, __int64, __int64, __n128))(**(_QWORD **)(a1 + 576) + 464LL))(
*(_QWORD *)(a1 + 576),
v53,
3,
v54);
sub_1000262BC((float *)&v166, v173[0] * 0.5, (float)(v173[1] * 0.5) + -65.0);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v53 + 184LL))(v53, &v166);
}
LABEL_88:
*(_QWORD *)(a1 + 624) = cocos2d::CCMenu::create();
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 576) + 464LL))(*(_QWORD *)(a1 + 576));
v56 = (float)((float)(v173[1] * 0.5) + -115.0) + -10.0;
v57 = *(_QWORD *)(a1 + 624);
v58 = *(_QWORD *)(a1 + 576);
sub_1000262BC((float *)&v144, v173[0] * 0.5, v56);
cocos2d::CCNode::convertToWorldSpace(v58, (__int64)&v144, &v165);
cocos2d::CCNode::convertToNodeSpace(v57, (__int64)&v165, &v166);
v59 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_replayBtn_001.png");
v60 = CCMenuItemSpriteExtra::create((__int64)v59, 0, a1, (__int64)EndLevelLayer::onReplay, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 624) + 456LL))(*(_QWORD *)(a1 + 624), v60);
v139 = v60;
sub_1000262BC((float *)&v144, -100.0, 0.0);
*(float32x2_t *)&v61 = sub_100026318((float32x2_t *)&v166, &v144, (float32x2_t *)&v165);
(*(void (__fastcall **)(void *, std::string *, double))(*(_QWORD *)v139 + 184LL))(v139, &v165, v61);
v62 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_menuBtn_001.png");
v63 = CCMenuItemSpriteExtra::create((__int64)v62, 0, a1, (__int64)sub_100393BF4, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 624) + 456LL))(*(_QWORD *)(a1 + 624), v63);
v138 = v63;
sub_1000262BC((float *)&v144, 100.0, 0.0);
*(float32x2_t *)&v64 = sub_100026318((float32x2_t *)&v166, &v144, (float32x2_t *)&v165);
(*(void (__fastcall **)(void *, std::string *, double))(*(_QWORD *)v138 + 184LL))(v138, &v165, v64);
if ( v140[285] == 2 )
{
v65 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_editBtn_001.png");
v66 = *(float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v62 + 328LL))(v62);
v67 = (float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v65 + 328LL))(v65);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v65 + 160LL))(v65, v66 / *v67);
v68 = CCMenuItemSpriteExtra::create((__int64)v65, 0, a1, (__int64)EndLevelLayer::onEdit, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 624) + 456LL))(*(_QWORD *)(a1 + 624), v68);
sub_1000262BC((float *)&v165, v173[0] * 0.5, v56);
v69 = *(_QWORD *)(a1 + 624);
cocos2d::CCNode::convertToWorldSpace(*(_QWORD *)(a1 + 576), (__int64)&v165, &v143);
cocos2d::CCNode::convertToNodeSpace(v69, (__int64)&v143, &v144);
v70 = sub_10002630C(&v165, (double *)&v144);
(*(void (__fastcall **)(void *, std::string *, double))(*(_QWORD *)v68 + 184LL))(v68, &v165, v70);
}
if ( *(_BYTE *)(*(_QWORD *)(a1 + 608) + 12544LL) == 1 )
{
v71 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_restartCheckBtn_001.png");
v72 = CCMenuItemSpriteExtra::create((__int64)v71, 0, a1, (__int64)EndLevelLayer::onRestartCheckpoint, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 624) + 456LL))(*(_QWORD *)(a1 + 624), v72);
sub_1000262BC((float *)&v165, (float)(v173[0] * 0.5) + -180.0, v56);
v73 = *(_QWORD *)(a1 + 624);
cocos2d::CCNode::convertToWorldSpace(*(_QWORD *)(a1 + 576), (__int64)&v165, &v143);
cocos2d::CCNode::convertToNodeSpace(v73, (__int64)&v143, &v144);
v74 = sub_10002630C(&v165, (double *)&v144);
(*(void (__fastcall **)(void *, std::string *, double))(*(_QWORD *)v72 + 184LL))(v72, &v165, v74);
}
v75 = v140[285];
if ( (v4 & 1) == 0 && v75 == 2 )
goto LABEL_97;
if ( v75 != 1 )
{
v76 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_levelLeaderboardBtn_001.png");
v77 = CCMenuItemSpriteExtra::create((__int64)v76, 0, a1, (__int64)sub_100393EDC, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 624) + 456LL))(*(_QWORD *)(a1 + 624), v77);
v78 = *(_QWORD *)(a1 + 624);
v79 = *(_QWORD *)(a1 + 576);
sub_1000262BC((float *)&v143, (float)(v173[0] * 0.5) + 178.0, (float)(v173[1] * 0.5) + 115.0);
cocos2d::CCNode::convertToWorldSpace(v79, (__int64)&v143, &v144);
cocos2d::CCNode::convertToNodeSpace(v78, (__int64)&v144, &v165);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v77 + 184LL))(v77, &v165);
}
if ( (v4 & 1) == 0 )
{
LABEL_97:
v80 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"sideBtn_death_001.png");
v81 = CCMenuItemSpriteExtra::create((__int64)v80, 0, a1, (__int64)sub_100393F48, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 624) + 456LL))(*(_QWORD *)(a1 + 624), v81);
v82 = *(_QWORD *)(a1 + 624);
cocos2d::CCNode::convertToWorldSpace(*(_QWORD *)(a1 + 576), (__int64)&v169, &v144);
cocos2d::CCNode::convertToNodeSpace(v82, (__int64)&v144, &v165);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v81 + 184LL))(v81, &v165);
}
v83 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"hideBtn_001.png");
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v83 + 912LL))(v83, 0);
v84 = CCMenuItemSpriteExtra::create((__int64)v83, 0, a1, (__int64)EndLevelLayer::onHideLayer, 0);
v92 = cocos2d::CCMenu::createWithItem((__int64)v84, v85, v86, v87, v88, v89, v90, v91);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v92, 100);
v93 = cocos2d::CCDirector::sharedDirector();
v94 = sub_100207EB0(v93);
if ( *(_BYTE *)(AppDelegate::get(v95, v96) + 37) )
v97 = 10.0;
else
v97 = 0.0;
v98 = cocos2d::CCDirector::sharedDirector();
v99 = sub_100207E98(v98);
(*(void (__fastcall **)(__int64, float, float))(*(_QWORD *)v92 + 200LL))(v92, (float)(v94 + -17.0) - v97, v99 + -15.0);
v100 = cocos2d::CCFadeTo::create(125, 1.0);
cocos2d::CCNode::runAction((__int64)v83, (__int64)v100);
v101 = v140[285];
*(_BYTE *)(a1 + 616) = v101 != 1;
*(_BYTE *)(a1 + 617) = v140[242] - v140[243] == 1;
v102 = v140[241];
if ( v102 >= 1
&& (*(_BYTE *)(*(_QWORD *)(a1 + 608) + 12544LL) & 1) == 0
&& (*(_BYTE *)(*(_QWORD *)(a1 + 608) + 12616LL) & 1) == 0
&& v101 != 2 )
{
v103 = sub_1002E736C();
*(_QWORD *)(a1 + 632) = v103;
cocos2d::CCObject::retain((__int64)v103);
sub_1000262BC((float *)&v165, v173[0] * 0.5, (float)(v173[1] * 0.5) + 126.0);
sub_1000262BC((float *)&v144, v173[0] * 0.5, (float)(v173[1] * 0.5) + -64.0);
sub_10002630C(&v165, (double *)&v144);
v104 = 20.0;
if ( v102 == 4 )
v104 = 15.0;
if ( (unsigned int)v102 <= 4 )
v105 = v104;
else
v105 = 13.0;
v106 = sub_1002E736C();
v107 = v102;
do
{
if ( *(_BYTE *)(a1 + 616) )
v108 = "secretCoin_2_b_01_001.png";
else
v108 = "secretCoin_b_01_001.png";
v109 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v108);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(
*(_QWORD *)(a1 + 576),
v109,
8);
sub_1002E74E0((__int64)v106);
if ( *(_BYTE *)(a1 + 616) == 1 && (*(_BYTE *)(a1 + 617) & 1) == 0 )
{
v144.i16[0] = -20481;
v144.i8[2] = 75;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v109 + 960LL))(v109, &v144);
}
--v107;
}
while ( v107 );
sub_1000262F4(&v144, (double *)&v165);
GameToolbox::alignItemsHorisontally((__int64)v106, &v144, 0, v105);
for ( i = 0; i != v102; ++i )
{
v111 = sub_1002E75A0((__int64)v106, i);
v112 = v111;
if ( (*(_BYTE *)(a1 + 616) & 1) != 0 )
{
if ( *(_BYTE *)(a1 + 617) == 1 )
{
v113 = GameStatsManager::sharedState(v111);
CoinKey_1 = GJGameLevel::getCoinKey_1((__int64)v140, i + 1);
hasUserCoin = GameStatsManager::hasUserCoin(v113, CoinKey_1);
}
else
{
v118 = GameStatsManager::sharedState(v111);
v119 = GJGameLevel::getCoinKey_1((__int64)v140, i + 1);
hasUserCoin = GameStatsManager::hasPendingUserCoin(v118, v119);
}
}
else
{
v116 = GameStatsManager::sharedState(v111);
v117 = GJGameLevel::getCoinKey_1((__int64)v140, i + 1);
hasUserCoin = GameStatsManager::hasSecretCoin(v116, v117);
}
v120 = hasUserCoin;
hasItem = GJBaseGameLayer::hasItem(*(_QWORD *)(a1 + 608), i + 1);
if ( !hasItem && (v120 & 1) != 0 )
{
v122 = *(_BYTE *)(a1 + 616) ? "secretCoinUI2_001.png" : "secretCoinUI_001.png";
v123 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v122);
v124 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v112 + 192LL))(v112);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v123 + 184LL))(v123, v124);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(
*(_QWORD *)(a1 + 576),
v123,
9);
if ( *(_BYTE *)(a1 + 616) == 1 && (*(_BYTE *)(a1 + 617) & 1) == 0 )
{
v144.i16[0] = -20481;
v144.i8[2] = 75;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v123 + 960LL))(v123, &v144);
}
}
if ( hasItem )
{
v125 = *(_BYTE *)(a1 + 616) ? "secretCoinUI2_001.png" : "secretCoinUI_001.png";
v126 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v125);
v127 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v112 + 192LL))(v112);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v126 + 184LL))(v126, v127);
sub_1002E74E0(*(_QWORD *)(a1 + 632));
*(_BYTE *)(a1 + 620) = 1;
if ( *(_BYTE *)(a1 + 616) == 1 && (*(_BYTE *)(a1 + 617) & 1) == 0 )
{
v144.i16[0] = -20481;
v144.i8[2] = 75;
(*(void (__fastcall **)(void *, float32x2_t *))(*(_QWORD *)v126 + 960LL))(v126, &v144);
}
}
}
}
sub_100009900(&v141, "Geometry Dash");
sub_1001F9308();
if ( v142 < 0 )
operator delete(v141);
if ( (unsigned int)PlatformToolbox::isControllerConnected() )
{
v128 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_Start_001.png");
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(*(_QWORD *)(a1 + 576), v128, 10);
v129 = *(_QWORD *)(a1 + 576);
v130 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v139 + 512LL))(v139);
v131 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v139 + 192LL))(v139);
cocos2d::CCNode::convertToWorldSpace(v130, v131, &v144);
cocos2d::CCNode::convertToNodeSpace(v129, (__int64)&v144, &v165);
sub_1000262BC((float *)&v143, 0.0, -25.0);
*(float32x2_t *)&v132 = sub_100026318((float32x2_t *)&v165, &v143, &v144);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v128 + 184LL))(v128, &v144, v132);
v133 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_B_001.png");
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 576) + 464LL))(*(_QWORD *)(a1 + 576), v133, 10);
v134 = *(_QWORD *)(a1 + 576);
v135 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v138 + 512LL))(v138);
v136 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v138 + 192LL))(v138);
cocos2d::CCNode::convertToWorldSpace(v135, v136, &v143);
cocos2d::CCNode::convertToNodeSpace(v134, (__int64)&v143, &v144);
sub_10002630C(&v165, (double *)&v144);
sub_1000262BC((float *)&v143, 0.0, -25.0);
*(float32x2_t *)&v137 = sub_100026318((float32x2_t *)&v165, &v143, &v144);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)v133 + 184LL))(v133, &v144, v137);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v133 + 160LL))(v133, 0.8);
}
if ( SHIBYTE(v168.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v168.__r_.__value_.__l.__data_);
}