//
// MenuLayer::init from 0x10037ad10 to 0x10037c20c (5372 bytes)
//
// 2 xrefs:
// > MenuLayer::scene @ 0x10037ac22
// > ??> @ 0x100b279f8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:29:06 +0000
//
__int64 __fastcall MenuLayer::init(_QWORD *a1, double a2)
{
__int64 v2; // rbx
__int64 result; // rax
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
double v7; // xmm0_8
char *v8; // rsi
__int64 v9; // rax
double v10; // xmm0_8
float v11; // xmm1_4
double v12; // xmm0_8
__int64 v13; // r13
char *v14; // rax
_QWORD *v15; // r12
double v16; // xmm0_8
char *v17; // rax
_QWORD *v18; // r15
__int64 v19; // rax
unsigned __int64 *v20; // r14
double v21; // xmm0_8
__int64 v22; // rax
bool v23; // zf
char *v24; // rax
__int64 v25; // r14
unsigned int *v26; // rax
char *v27; // rax
_QWORD *v28; // r15
unsigned __int64 *v29; // r14
__int64 v30; // rax
char *v31; // rdi
char *v32; // r14
unsigned int *v33; // rax
__int64 v34; // rdi
double v35; // xmm0_8
__int64 v36; // r15
double v37; // xmm0_8
char *v38; // r14
void *v39; // rax
double v40; // xmm0_8
char *v41; // r14
void *v42; // rsi
__int64 v43; // rax
double v44; // xmm0_8
char *v45; // r14
void *v46; // rax
__int64 v47; // rax
char *v48; // r14
void *v49; // rax
__int64 v50; // rax
double v51; // xmm0_8
char *v52; // r14
void *v53; // rax
int v54; // edx
int v55; // ecx
int v56; // r8d
int v57; // r9d
__int64 v58; // r13
__int64 v59; // rax
double v60; // xmm0_8
char *v61; // r14
double v62; // xmm0_8
char *v63; // r15
double v64; // xmm0_8
char *v65; // r12
__int64 v66; // r14
void *v67; // r12
double v68; // xmm0_8
char *v69; // rbx
double v70; // xmm0_8
char *v71; // rbx
__int64 v72; // rax
unsigned __int64 *v73; // rbx
unsigned __int64 *v74; // rbx
unsigned __int64 *v75; // rbx
unsigned __int64 *v76; // rbx
double v77; // xmm0_8
__int64 v78; // rax
char *v79; // rbx
_QWORD *v80; // r13
void *v81; // r15
int v82; // edx
int v83; // ecx
int v84; // r8d
int v85; // r9d
__int64 v86; // r14
__int64 v87; // rax
double v88; // xmm0_8
__int64 v89; // rax
char *v90; // rbx
void *v91; // rsi
__int64 v92; // rax
double v93; // xmm0_8
double v94; // xmm0_8
char *v95; // r14
unsigned int *v96; // rax
double v97; // xmm0_8
char *v98; // r14
__int64 v99; // rbx
unsigned int *v100; // rax
double v101; // xmm0_8
char *v102; // r14
__int64 v103; // rbx
unsigned int *v104; // rax
double v105; // xmm0_8
char *v106; // r14
__int64 v107; // rbx
unsigned int *v108; // rax
__int64 v109; // rdi
__int64 v110; // rax
bool v111; // cc
int v112; // eax
char *v113; // rsi
__int64 v114; // rax
float v115; // xmm0_4
double v116; // xmm0_8
char *v117; // r14
unsigned __int64 *v118; // rbx
__int64 v119; // r13
unsigned __int64 *v120; // rbx
__int64 v121; // rax
__int64 v122; // rdi
__int64 v123; // r15
unsigned __int64 *v124; // rbx
char *v125; // rax
void *v126; // rax
__int64 v127; // r14
__int64 v128; // rbx
__int64 v129; // rax
__int64 v130; // rbx
__int64 v131; // xmm0_8
__int64 v132; // rax
char *v133; // rbx
void *v134; // rax
__int64 v135; // rbx
__int64 v136; // rax
char *v137; // rax
__int64 v138; // rbx
char *v139; // rax
void *v140; // r14
__int64 v141; // r12
__int64 v142; // rdi
__int64 v143; // rax
float v144; // xmm0_4
__int64 v145; // xmm0_8
__int64 v146; // rdi
int v147; // ebx
int v148; // eax
int v149; // ecx
int v150; // r8d
int v151; // r9d
__int64 v152; // rax
int v153; // ebx
int v154; // eax
int v155; // ecx
int v156; // r8d
int v157; // r9d
__int64 v158; // rax
__int64 v159; // rax
__int64 v160; // rdi
__int64 v161; // rax
double updated; // xmm0_8
__int64 v163; // rax
int v164; // ebx
int v165; // eax
int v166; // ecx
int v167; // r8d
int v168; // r9d
__int64 v169; // rax
unsigned __int64 v170; // [rsp+8h] [rbp-B8h] BYREF
__int64 v171; // [rsp+10h] [rbp-B0h]
void *v172; // [rsp+18h] [rbp-A8h]
void *v173; // [rsp+20h] [rbp-A0h]
void *v174; // [rsp+28h] [rbp-98h]
void *v175; // [rsp+30h] [rbp-90h]
void *v176; // [rsp+38h] [rbp-88h]
_QWORD *v177; // [rsp+40h] [rbp-80h]
_QWORD *v178; // [rsp+48h] [rbp-78h]
_QWORD *v179; // [rsp+50h] [rbp-70h]
__int64 v180; // [rsp+58h] [rbp-68h]
float v181; // [rsp+64h] [rbp-5Ch]
float v182; // [rsp+68h] [rbp-58h] BYREF
float v183; // [rsp+6Ch] [rbp-54h]
float v184; // [rsp+70h] [rbp-50h]
unsigned __int8 v185; // [rsp+77h] [rbp-49h]
unsigned __int64 v186; // [rsp+78h] [rbp-48h] BYREF
unsigned __int64 v187; // [rsp+80h] [rbp-40h] BYREF
_QWORD *v188; // [rsp+88h] [rbp-38h]
unsigned __int64 v189[6]; // [rsp+90h] [rbp-30h] BYREF
v2 = (__int64)a1;
result = cocos2d::CCLayer::init(a1);
if ( (_BYTE)result )
{
v185 = result;
v4 = GameManager::sharedState();
GameManager::fadeInMenuMusic(v4, a2);
*(_BYTE *)(GameManager::sharedState() + 584) = 1;
*(_DWORD *)(GameManager::sharedState() + 708) = 0;
*(_BYTE *)(GameManager::sharedState() + 1064) = 0;
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1072LL))(a1, 1);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1088LL))(a1, 1);
v5 = cocos2d::CCDirector::sharedDirector(a1, 1);
cocos2d::CCDirector::getWinSize(&v182, v5);
v6 = MenuGameLayer::create();
a1[63] = v6;
v7 = (*(double (__fastcall **)(_QWORD *, __int64))(*a1 + 456LL))(a1, v6);
v8 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_logo_001.png", v7);
(*(void (__fastcall **)(_QWORD *, char *, __int64))(*a1 + 464LL))(a1, v8, 2);
*(float *)&v188 = v182 * 0.5;
v9 = cocos2d::CCDirector::sharedDirector(a1, v8);
v10 = sub_100479740(v9);
v11 = *(float *)&v10 + -50.0;
*(_QWORD *)&v12 = (unsigned int)v188;
sub_100278250((float *)&v187, *(float *)&v188, v11);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v8 + 184LL))(v8, &v187);
v13 = cocos2d::CCMenu::create();
v14 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_playBtn_001.png", v12);
v15 = CCMenuItemSpriteExtra::create((__int64)v14, 0, (__int64)a1, (__int64)MenuLayer::onPlay, 0);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v13 + 456LL))(v13, v15);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 456LL))(a1, v13);
sub_100278250((float *)&v187, v182 * 0.5, (float)(0.5 * v183) + 10.0);
v16 = (*(double (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v13 + 184LL))(v13, &v187);
v17 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_garageBtn_001.png", v16);
v18 = CCMenuItemSpriteExtra::create((__int64)v17, 0, (__int64)a1, (__int64)MenuLayer::onGarage, 0);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v13 + 456LL))(v13, v18);
v19 = *v15;
v177 = v15;
v20 = (unsigned __int64 *)(*(__int64 (__fastcall **)(_QWORD *))(v19 + 192))(v15);
*(_QWORD *)&v21 = 3269197824LL;
sub_100278250((float *)v189, -110.0, 0.0);
sub_100278350((double *)&v187, v20, v189);
v22 = *v18;
v178 = v18;
(*(void (__fastcall **)(_QWORD *, unsigned __int64 *))(v22 + 184))(v18, &v187);
v23 = *(_BYTE *)(GameManager::sharedState() + 927) == 0;
v188 = a1;
v180 = v13;
if ( v23 )
{
v24 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_chrSel_001.png", COERCE_DOUBLE(3269197824LL));
a1[60] = v24;
(*(void (__fastcall **)(_QWORD *, char *))(*a1 + 456LL))(a1, v24);
v25 = a1[60];
v26 = (unsigned int *)(*(__int64 (__fastcall **)(_QWORD *))(*v178 + 192LL))(v178);
cocos2d::CCNode::convertToWorldSpace((double *)v189, v13, v26);
sub_100278250((float *)&v186, -50.0, -50.0);
sub_100278350((double *)&v187, v189, &v186);
v13 = v180;
v2 = (__int64)v188;
v21 = (*(double (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v25 + 184LL))(v25, &v187);
}
v27 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_creatorBtn_001.png", v21);
v28 = CCMenuItemSpriteExtra::create((__int64)v27, 0, v2, (__int64)MenuLayer::onCreator, 0);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v13 + 456LL))(v13, v28);
v29 = (unsigned __int64 *)(*(__int64 (__fastcall **)(_QWORD *))(*v177 + 192LL))(v177);
sub_100278250((float *)v189, 110.0, 0.0);
sub_100278350((double *)&v187, v29, v189);
v30 = *v28;
v179 = v28;
v31 = (char *)v28;
(*(void (__fastcall **)(_QWORD *, unsigned __int64 *))(v30 + 184))(v28, &v187);
if ( !*(_BYTE *)(GameManager::sharedState() + 928) )
{
v32 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_lvlEdit_001.png", COERCE_DOUBLE(1121714176));
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v2 + 456LL))(v2, v32);
v33 = (unsigned int *)(*(__int64 (__fastcall **)(_QWORD *))(*v179 + 192LL))(v179);
cocos2d::CCNode::convertToWorldSpace((double *)v189, v13, v33);
sub_100278250((float *)&v186, 50.0, -50.0);
sub_100278350((double *)&v187, v189, &v186);
v31 = v32;
v2 = (__int64)v188;
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v32 + 184LL))(v32, &v187);
}
v34 = cocos2d::CCDirector::sharedDirector(v31, &v187);
v35 = sub_100479750(v34);
v184 = *(float *)&v35 + 45.0;
v36 = cocos2d::CCMenu::create();
v37 = (*(double (__fastcall **)(__int64, __int64))(*(_QWORD *)v2 + 456LL))(v2, v36);
v38 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_achBtn_001.png", v37);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v38 + 160LL))(v38, 1.0);
v39 = CCMenuItemSpriteExtra::create((__int64)v38, 0, v2, (__int64)MenuLayer::onAchievements, 0);
v40 = (*(double (__fastcall **)(__int64, void *))(*(_QWORD *)v36 + 456LL))(v36, v39);
v41 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_optionsBtn_001.png", v40);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v41 + 160LL))(v41, 1.0);
v42 = CCMenuItemSpriteExtra::create((__int64)v41, 0, v2, (__int64)MenuLayer::onOptions, 0);
v43 = *(_QWORD *)v36;
v176 = v42;
v44 = (*(double (__fastcall **)(__int64))(v43 + 456))(v36);
v45 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_statsBtn_001.png", v44);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v45 + 160LL))(v45, 1.0);
v46 = CCMenuItemSpriteExtra::create((__int64)v45, 0, v2, (__int64)MenuLayer::onStats, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v36 + 456LL))(v36, v46);
v47 = GameManager::sharedState();
if ( !GameManager::safeModeEnabled(v47) )
{
v48 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_ngBtn_001.png", COERCE_DOUBLE(1065353216));
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v48 + 160LL))(v48, 1.0);
v49 = CCMenuItemSpriteExtra::create((__int64)v48, 0, v2, (__int64)MenuLayer::onNewgrounds, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v36 + 456LL))(v36, v49);
}
sub_100278250((float *)&v187, v182 * 0.5, v184);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v36 + 184LL))(v36, &v187);
v171 = v36;
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(v36, 5.0);
v50 = cocos2d::CCDirector::sharedDirector(v36, &v187);
v51 = sub_100479750(v50);
*(float *)&v51 = *(float *)&v51 + 30.0;
v181 = *(float *)&v51;
v52 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"robtoplogo_small.png", v51);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v52 + 160LL))(v52, 0.80000001);
v53 = CCMenuItemSpriteExtra::create((__int64)v52, 0, v2, (__int64)MenuLayer::onRobTop, 0);
LODWORD(v52) = (_DWORD)v53;
CCMenuItemSpriteExtra::setSizeMult((__int64)v53, 1.1);
v58 = sub_1008735E0((_DWORD)v52, 0, v54, v55, v56, v57);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v2 + 464LL))(v2, v58, 2);
v59 = cocos2d::CCDirector::sharedDirector(v2, v58);
*(float *)&v51 = sub_100479760(v59);
sub_100278250((float *)&v187, *(float *)&v51 + 50.0, v181 + -5.0);
v60 = (*(double (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v58 + 184LL))(v58, &v187);
v61 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_fbIcon_001.png", v60);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v61 + 160LL))(v61, 0.80000001);
v172 = CCMenuItemSpriteExtra::create((__int64)v61, 0, v2, (__int64)MenuLayer::onFacebook, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v172, 1.5);
v62 = (*(double (__fastcall **)(__int64, void *))(*(_QWORD *)v58 + 456LL))(v58, v172);
v63 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_twIcon_001.png", v62);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v63 + 160LL))(v63, 0.80000001);
v173 = CCMenuItemSpriteExtra::create((__int64)v63, 0, v2, (__int64)MenuLayer::onTwitter, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v173, 1.5);
v64 = (*(double (__fastcall **)(__int64, void *))(*(_QWORD *)v58 + 456LL))(v58, v173);
v65 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_ytIcon_001.png", v64);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v65 + 160LL))(v65, 0.80000001);
v66 = v2;
v67 = CCMenuItemSpriteExtra::create((__int64)v65, 0, v2, (__int64)MenuLayer::onYouTube, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v67, 1.5);
v68 = (*(double (__fastcall **)(__int64, void *))(*(_QWORD *)v58 + 456LL))(v58, v67);
v69 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_twitchIcon_001.png", v68);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v69 + 160LL))(v69, 0.80000001);
v174 = CCMenuItemSpriteExtra::create((__int64)v69, 0, v66, (__int64)MenuLayer::onTwitch, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v174, 1.5);
v70 = (*(double (__fastcall **)(__int64, void *))(*(_QWORD *)v58 + 456LL))(v58, v174);
v71 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"gj_discordIcon_001.png", v70);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v71 + 160LL))(v71, 0.80000001);
v175 = CCMenuItemSpriteExtra::create((__int64)v71, 0, v66, (__int64)MenuLayer::onDiscord, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v175, 1.5);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v58 + 456LL))(v58, v175);
v72 = cocos2d::CCDirector::sharedDirector(v58, v175);
*(float *)&v70 = sub_100479760(v72);
sub_100278250((float *)v189, *(float *)&v70 + 22.0, v181 + 25.0);
cocos2d::CCNode::convertToNodeSpace((double *)&v187, v58, (unsigned int *)v189);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v172 + 184LL))(v172, &v187);
v73 = (unsigned __int64 *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v172 + 192LL))(v172);
sub_100278250((float *)v189, 29.0, 0.0);
sub_100278350((double *)&v187, v73, v189);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v173 + 184LL))(v173, &v187);
v74 = (unsigned __int64 *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v173 + 192LL))(v173);
sub_100278250((float *)v189, 29.0, 0.0);
sub_100278350((double *)&v187, v74, v189);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v67 + 184LL))(v67, &v187);
v75 = (unsigned __int64 *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v67 + 192LL))(v67);
sub_100278250((float *)v189, 29.0, 0.0);
sub_100278350((double *)&v187, v75, v189);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v174 + 184LL))(v174, &v187);
v76 = (unsigned __int64 *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v67 + 192LL))(v67);
*(_QWORD *)&v77 = 1105723392;
sub_100278250((float *)v189, 29.0, -29.0);
sub_100278350((double *)&v187, v76, v189);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v175 + 184LL))(v175, &v187);
v78 = GameManager::sharedState();
if ( GameManager::safeModeEnabled(v78) )
v77 = (*(double (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v58 + 344LL))(v58, 0);
v79 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_newsBtn_001.png", v77);
HIDWORD(v88) = 0;
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v79 + 160LL))(v79, 0.85000002);
v80 = v188;
v81 = CCMenuItemSpriteExtra::create((__int64)v79, 0, (__int64)v188, (__int64)MenuLayer::onNews, 0);
v80[61] = v79;
v86 = sub_1008735E0((_DWORD)v81, 0, v82, v83, v84, v85);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v80 + 464LL))(v80, v86, 2);
v87 = cocos2d::CCDirector::sharedDirector(v80, v86);
*(float *)&v88 = sub_100479770(v87) + -43.0;
sub_100278250((float *)&v187, *(float *)&v88, v184);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v86 + 184LL))(v86, &v187);
v89 = GameManager::sharedState();
if ( (unsigned __int8)GameManager::offlineModeEnabled(v89) )
{
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v81 + 344LL))(v81, 0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v81 + 1056LL))(v81, 0);
}
*(_BYTE *)(GameManager::sharedState() + 600) = 0;
v90 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_closeBtn_001.png", v88);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v90 + 160LL))(v90, 0.69999999);
v91 = CCMenuItemSpriteExtra::create((__int64)v90, 0, (__int64)v80, (__int64)MenuLayer::onQuit, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v86 + 456LL))(v86, v91);
v92 = cocos2d::CCDirector::sharedDirector(v86, v91);
v93 = sub_100479740(v92);
sub_100278250((float *)v189, 18.0, *(float *)&v93 + -18.0);
cocos2d::CCNode::convertToNodeSpace((double *)&v187, v86, (unsigned int *)v189);
v94 = (*(double (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v91 + 184LL))(v91, &v187);
if ( (unsigned __int8)PlatformToolbox::isControllerConnected(v94) )
{
v95 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_Start_001.png", v94);
(*(void (__fastcall **)(_QWORD *, char *))(*v80 + 456LL))(v80, v95);
v96 = (unsigned int *)(*(__int64 (__fastcall **)(_QWORD *))(*v177 + 192LL))(v177);
cocos2d::CCNode::convertToWorldSpace((double *)v189, v180, v96);
cocos2d::CCNode::convertToNodeSpace((double *)&v187, (__int64)v188, (unsigned int *)v189);
sub_100278250((float *)&v186, 0.0, -66.0);
sub_100278350((double *)v189, &v187, &v186);
v97 = (*(double (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v95 + 184LL))(v95, v189);
v98 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_Y_001.png", v97);
(*(void (__fastcall **)(_QWORD *, char *))(*v188 + 456LL))(v188, v98);
v99 = (*(__int64 (__fastcall **)(_QWORD *))(*v179 + 512LL))(v179);
v100 = (unsigned int *)(*(__int64 (__fastcall **)(_QWORD *))(*v179 + 192LL))(v179);
cocos2d::CCNode::convertToWorldSpace((double *)&v186, v99, v100);
cocos2d::CCNode::convertToNodeSpace((double *)v189, (__int64)v188, (unsigned int *)&v186);
sub_100278300(&v187, v189);
sub_100278250((float *)&v186, 0.0, -45.0);
sub_100278350((double *)v189, &v187, &v186);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v98 + 184LL))(v98, v189);
v101 = (*(double (__fastcall **)(char *, float))(*(_QWORD *)v98 + 160LL))(v98, 0.80000001);
v102 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_X_001.png", v101);
(*(void (__fastcall **)(_QWORD *, char *))(*v188 + 456LL))(v188, v102);
v103 = (*(__int64 (__fastcall **)(_QWORD *))(*v178 + 512LL))(v178);
v104 = (unsigned int *)(*(__int64 (__fastcall **)(_QWORD *))(*v178 + 192LL))(v178);
cocos2d::CCNode::convertToWorldSpace((double *)&v186, v103, v104);
cocos2d::CCNode::convertToNodeSpace((double *)v189, (__int64)v188, (unsigned int *)&v186);
sub_100278300(&v187, v189);
sub_100278250((float *)&v186, 0.0, -45.0);
sub_100278350((double *)v189, &v187, &v186);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v102 + 184LL))(v102, v189);
v105 = (*(double (__fastcall **)(char *, float))(*(_QWORD *)v102 + 160LL))(v102, 0.80000001);
v106 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_DPad_Down_001.png", v105);
(*(void (__fastcall **)(_QWORD *, char *))(*v188 + 456LL))(v188, v106);
v107 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v176 + 512LL))(v176);
v108 = (unsigned int *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v176 + 192LL))(v176);
cocos2d::CCNode::convertToWorldSpace((double *)&v186, v107, v108);
cocos2d::CCNode::convertToNodeSpace((double *)v189, (__int64)v188, (unsigned int *)&v186);
sub_100278300(&v187, v189);
sub_100278250((float *)&v186, 0.0, -34.0);
v80 = v188;
sub_100278350((double *)v189, &v187, &v186);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v106 + 184LL))(v106, v189);
*(_QWORD *)&v94 = 1056964608;
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v106 + 160LL))(v106, 0.5);
v109 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::getGameVariable(v109, "0028") )
{
v110 = GJAccountManager::sharedState(v109, (__int64)"0028");
v111 = *(_DWORD *)(v110 + 352) <= *(_DWORD *)(v110 + 356);
v112 = 15;
if ( v111 )
v112 = 0;
v184 = (float)v112;
v113 = cocos2d::CCSprite::createWithSpriteFrameName(
(__int64)"controllerBtn_LThumb_001.png",
COERCE_DOUBLE((unsigned __int64)COERCE_UNSIGNED_INT((float)v112)));
(*(void (__fastcall **)(_QWORD *, char *))(*v80 + 456LL))(v80, v113);
v114 = cocos2d::CCDirector::sharedDirector(v80, v113);
v115 = sub_100479760(v114);
sub_100278250((float *)v189, v115 + 25.0, (float)((float)((float)(v183 * 0.5) + 15.0) + 10.0) + v184);
v116 = (*(double (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v113 + 184LL))(v113, v189);
v117 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_A_001.png", v116);
(*(void (__fastcall **)(_QWORD *, char *))(*v80 + 456LL))(v80, v117);
v118 = (unsigned __int64 *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v113 + 192LL))(v113);
sub_100278250((float *)&v186, 0.0, -30.0);
sub_100278350((double *)v189, v118, &v186);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v117 + 184LL))(v117, v189);
v119 = cocos2d::CCLabelBMFont::create_3("Mouse", "goldFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v119 + 160LL))(v119, 0.5);
(*(void (__fastcall **)(_QWORD *, __int64))(*v188 + 456LL))(v188, v119);
sub_100278250((float *)v189, 0.0, 0.60000002);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v119 + 296LL))(v119, v189);
v120 = (unsigned __int64 *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v113 + 192LL))(v113);
sub_100278250((float *)&v186, 16.0, 1.0);
sub_100278350((double *)v189, v120, &v186);
v121 = *(_QWORD *)v119;
v122 = v119;
v80 = v188;
(*(void (__fastcall **)(__int64, unsigned __int64 *))(v121 + 184))(v122, v189);
v123 = cocos2d::CCLabelBMFont::create_3("Click", "goldFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v123 + 160LL))(v123, 0.5);
(*(void (__fastcall **)(_QWORD *, __int64))(*v80 + 456LL))(v80, v123);
sub_100278250((float *)v189, 0.0, 0.60000002);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v123 + 296LL))(v123, v189);
v124 = (unsigned __int64 *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v117 + 192LL))(v117);
sub_100278250((float *)&v186, 16.0, 1.0);
sub_100278350((double *)v189, v124, &v186);
v94 = (*(double (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v123 + 184LL))(v123, v189);
}
}
v125 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_profileButton_001.png", v94);
v126 = CCMenuItemSpriteExtra::create((__int64)v125, 0, (__int64)v80, (__int64)MenuLayer::onMyProfile, 0);
v80[58] = v126;
v127 = v180;
(*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)v180 + 464LL))(v180, v126, 2);
sub_100278250((float *)&v187, 45.0, 105.0);
v128 = v80[58];
cocos2d::CCNode::convertToNodeSpace((double *)v189, v180, (unsigned int *)&v187);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v128 + 184LL))(v128, v189);
v129 = cocos2d::CCLabelBMFont::create_3(" ", "goldFont.fnt");
v80[57] = v129;
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v80 + 464LL))(v80, v129, 2);
v130 = v80[57];
sub_100278250((float *)&v186, 2.0, 36.0);
sub_100278350((double *)v189, &v187, &v186);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v130 + 184LL))(v130, v189);
v131 = 1116471296;
cocos2d::CCLabelBMFont::limitLabelWidth(v80[57], 70.0, 0.69999999, 0.0);
v132 = GameManager::sharedState();
if ( (unsigned int)GameManager::modUIRank(v132) == 2 )
{
v133 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"modBadge_02_001.png", COERCE_DOUBLE(1116471296));
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v133 + 160LL))(v133, 1.3);
v134 = CCMenuItemSpriteExtra::create((__int64)v133, 0, (__int64)v80, (__int64)MenuLayer::onReportQueue, 0);
v80[59] = v134;
CCMenuItemSpriteExtra::setSizeMult((__int64)v134, 1.5);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v127 + 464LL))(v127, v80[59], 2);
v135 = v80[59];
v131 = 0;
sub_100278250((float *)&v170, 0.0, 75.0);
sub_100278350((double *)&v186, &v187, &v170);
cocos2d::CCNode::convertToNodeSpace((double *)v189, v127, (unsigned int *)&v186);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v135 + 184LL))(v135, v189);
}
v136 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::getGameVariable(v136, "0048")
&& *(_BYTE *)(GameManager::sharedState() + 927) == 1 )
{
v137 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_viewProfileTxt_001.png", *(double *)&v131);
v80[56] = v137;
(*(void (__fastcall **)(_QWORD *, char *, __int64))(*v80 + 464LL))(v80, v137, 2);
v138 = v80[56];
v131 = 1117257728;
sub_100278250((float *)&v186, 76.0, -1.0);
sub_100278350((double *)v189, &v187, &v186);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v138 + 184LL))(v138, v189);
}
MenuLayer::updateUserProfileButton(v80);
*(_QWORD *)(GameManager::sharedState() + 576) = v80;
v139 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_dailyRewardBtn_001.png", *(double *)&v131);
v140 = CCMenuItemSpriteExtra::create((__int64)v139, 0, (__int64)v80, (__int64)MenuLayer::onDaily, 0);
v141 = v171;
v142 = v171;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v171 + 456LL))(v171, v140);
v143 = cocos2d::CCDirector::sharedDirector(v142, v140);
v144 = sub_100479770(v143);
sub_100278250((float *)&v186, v144 + -40.0, (float)(v183 * 0.5) + 20.0);
cocos2d::CCNode::convertToNodeSpace((double *)v189, v141, (unsigned int *)&v186);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v140 + 184LL))(v140, v189);
v145 = 1069547520;
CCMenuItemSpriteExtra::setSizeMult((__int64)v140, 1.5);
v146 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::getUGV(v146, "30") )
{
*((_BYTE *)v80 + 432) = 1;
v145 = 1008981770;
v147 = cocos2d::CCDelayTime::create(0.0099999998);
v148 = cocos2d::CCCallFunc::create(v80, MenuLayer::showTOS, 0);
v152 = sub_10039EB60(v147, v148, 0, v149, v150, v151);
v146 = (__int64)v80;
cocos2d::CCNode::runAction((__int64)v80, v152);
}
if ( !*(_BYTE *)(GameLevelManager::sharedState(*(double *)&v145) + 1536) )
{
v153 = cocos2d::CCDelayTime::create(0.0099999998);
v154 = cocos2d::CCCallFunc::create(v80, MenuLayer::firstNetworkTest, 0);
v158 = sub_10039EB60(v153, v154, 0, v155, v156, v157);
v146 = (__int64)v80;
cocos2d::CCNode::runAction((__int64)v80, v158);
}
v159 = MusicDownloadManager::sharedState(v146);
MusicDownloadManager::addMusicDownloadDelegate(v159, v80 + 53);
v160 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::offlineModeEnabled(v160) )
{
v161 = MusicDownloadManager::sharedState(v160);
MusicDownloadManager::tryUpdateNewsFeed(v161);
updated = MenuLayer::updateNewsBadge(v80);
v163 = GameLevelManager::sharedState(updated);
GameLevelManager::syncFollowListIfNeeded(v163);
}
v164 = cocos2d::CCDelayTime::create(0.0099999998);
v165 = cocos2d::CCCallFunc::create(v80, sub_10037CA80, 0);
v169 = sub_10039EB60(v164, v165, 0, v166, v167, v168);
cocos2d::CCNode::runAction((__int64)v80, v169);
return v185;
}
return result;
}