//
// DailyLevelNode::init from 0x140172b80 to 0x14017388e (3342 bytes)
//
// 2 xrefs:
// > DailyLevelPage::createDailyNode @ 0x140171280
// > ??> @ 0x1409183b0
//
// 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:27:32 +0000
//
// Hidden C++ exception states: #wind=3
bool __fastcall DailyLevelNode::init(__int64 a1, cocos2d::CCObject *a2, __int64 a3, char a4)
{
bool result; // al
__int64 v9; // rcx
__int64 v10; // rax
cocos2d::CCTouchDispatcher *v11; // rax
int v12; // ecx
int v13; // ecx
char *v14; // rax
__int64 v15; // rcx
char v16; // r12
void **v17; // rbx
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rdi
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rbx
__int64 v24; // rax
cocos2d::CCObject *v25; // r15
__int64 v26; // rbx
__int64 v27; // rax
void **v28; // rcx
struct cocos2d::CCSprite *v29; // rdi
__int64 v30; // rbx
__int64 v31; // rax
struct cocos2d::CCLabelBMFont *v32; // rdi
__int64 v33; // rbx
__int64 v34; // rax
__int64 v35; // rbx
__int64 v36; // rax
struct cocos2d::CCSprite *v37; // rax
int v38; // ebx
cocos2d::CCObject *v39; // rax
struct cocos2d::CCMenu *v40; // rdi
__int64 v41; // rbx
__int64 v42; // rax
__int64 v43; // rax
__int64 v44; // rdi
__int64 v45; // rax
__int64 v46; // rax
__int64 v47; // rbx
__int64 v48; // rax
__int64 v49; // rdx
cocos2d::CCString *v50; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v52; // rdi
__int64 v53; // rdx
__int64 v54; // rbx
__int64 v55; // rax
__int64 v56; // rbx
__int64 v57; // rax
struct cocos2d::CCSprite *v58; // rax
int v59; // ebx
cocos2d::CCObject *v60; // rax
struct cocos2d::CCMenu *v61; // rax
__int64 v62; // rdi
__int64 v63; // rbx
__int64 v64; // rax
struct cocos2d::CCLabelBMFont *v65; // r14
__int64 v66; // rbx
__int64 v67; // rax
__int64 v68; // rdx
__int64 v69; // r8
int v70; // ecx
struct cocos2d::CCSprite *v71; // r15
int v72; // ebx
int v73; // edx
cocos2d::CCString *v74; // rax
const char *v75; // rax
struct cocos2d::CCLabelBMFont *v76; // rdi
__int64 v77; // rbx
__int64 v78; // rax
float v79; // xmm6_4
double v80; // xmm0_8
float v81; // xmm7_4
float v82; // xmm6_4
double v83; // xmm0_8
float v84; // xmm8_4
float v85; // xmm6_4
double v86; // xmm0_8
float v87; // xmm7_4
__int64 v88; // rbx
float v89; // xmm6_4
float v90; // xmm7_4
__int64 v91; // rax
__int64 v92; // rax
__int64 v93; // rbx
__int64 v94; // rax
float v95; // xmm6_4
double v96; // xmm0_8
float v97; // xmm1_4
__int64 v98; // rbx
__int64 v99; // rax
__int64 v100; // rax
__int64 v101; // rbx
__int64 v102; // rax
__int64 v103; // rdx
struct cocos2d::CCLabelBMFont *v104; // rax
void *v105; // rcx
void *v106; // rcx
__int16 v107; // [rsp+38h] [rbp-89h] BYREF
char v108; // [rsp+3Ah] [rbp-87h]
_BYTE v109[12]; // [rsp+3Ch] [rbp-85h] BYREF
_QWORD v110[2]; // [rsp+48h] [rbp-79h] BYREF
void *Block[2]; // [rsp+58h] [rbp-69h] BYREF
__int64 v112; // [rsp+68h] [rbp-59h]
unsigned __int64 v113; // [rsp+70h] [rbp-51h]
void *v114[2]; // [rsp+78h] [rbp-49h] BYREF
__int64 v115; // [rsp+88h] [rbp-39h]
unsigned __int64 v116; // [rsp+90h] [rbp-31h]
result = cocos2d::CCNode::init((cocos2d::CCNode *)a1);
if ( !result )
return result;
v10 = cocos2d::CCDirector::sharedDirector(v9);
v11 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 144LL))(v10);
cocos2d::CCTouchDispatcher::registerForcePrio(v11, (struct cocos2d::CCObject *)a1, 2, 0);
if ( a2 )
{
*(_QWORD *)(a1 + 328) = a2;
cocos2d::CCObject::retain(a2);
}
*(_QWORD *)(a1 + 336) = a3;
*(_OWORD *)v114 = 0;
v115 = 0;
v116 = 15;
LOBYTE(v114[0]) = 0;
*(_OWORD *)Block = 0;
v112 = 0;
v113 = 15;
LOBYTE(Block[0]) = 0;
v12 = *(_DWORD *)(a3 + 732);
if ( !v12 )
goto LABEL_9;
v13 = v12 - 1;
if ( !v13 )
{
v115 = 15;
qmemcpy(v114, "GJ_square05.pn", 14);
HIWORD(v114[1]) = (unsigned __int8)aGjSquare05Png[14];
v14 = (char *)sub_14003D460(0x20u);
v112 = 22;
v113 = 31;
strcpy(v14, "gj_weeklyCrown_001.png");
goto LABEL_11;
}
if ( v13 == 1 )
{
v115 = 15;
strcpy((char *)v114, "GJ_square04.png");
v14 = (char *)sub_14003D460(0x20u);
v112 = 21;
v113 = 31;
qmemcpy(v14, "gj_eventCrown_001.pn", 20);
}
else
{
LABEL_9:
v115 = 15;
qmemcpy(v114, "GJ_square02.pn", 14);
HIWORD(v114[1]) = (unsigned __int8)aGjSquare02Png[14];
v14 = (char *)sub_14003D460(0x20u);
v112 = 21;
v113 = 31;
qmemcpy(v14, "gj_dailyCrown_001.pn", 20);
}
*((_WORD *)v14 + 10) = 103;
LABEL_11:
Block[0] = v14;
v15 = *(_QWORD *)(a1 + 328);
if ( v15 && *(_DWORD *)(v15 + 936) - *(_DWORD *)(v15 + 940) >= 100 )
{
v16 = 1;
v17 = (void **)"GJ_square03.png";
}
else
{
v16 = 0;
v17 = v114;
if ( v116 > 0xF )
v17 = (void **)v114[0];
}
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v110, 0.0, 0.0, 80.0, 80.0);
v19 = cocos2d::extension::CCScale9Sprite::create(v17, v18);
v20 = v19;
if ( *(_DWORD *)(*(_QWORD *)(a1 + 336) + 732LL) == 1 && !v16 )
{
v107 = -20561;
v108 = -81;
(**(void (__fastcall ***)(__int64, __int16 *))(v19 + 320))(v19 + 320, &v107);
}
v21 = *(_QWORD *)v20;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v109, 380.0, 116.0);
(*(void (__fastcall **)(__int64, __int64))(v21 + 312))(v20, v22);
v23 = *(_QWORD *)v20;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, 0.0, 0.0);
(*(void (__fastcall **)(__int64, __int64))(v23 + 184))(v20, v24);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v20, 1);
if ( *(_QWORD *)(a1 + 328) )
{
v25 = sub_140148900();
*((_BYTE *)v25 + 578) = 1;
LevelCell::loadFromLevel((__int64)v25, (__int64)a2);
(*(void (__fastcall **)(__int64, cocos2d::CCObject *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v25, 2);
v26 = *(_QWORD *)v25;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, -180.0, -47.0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v26 + 184))(v25, v27);
v28 = Block;
if ( v113 > 0xF )
v28 = (void **)Block[0];
v29 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v28);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v29, 2);
v30 = *(_QWORD *)v29;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, 0.0, 70.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v30 + 184))(v29, v31);
if ( a4 )
{
v32 = cocos2d::CCLabelBMFont::create("New!", "goldFont.fnt");
v33 = *(_QWORD *)v32;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, 1.0, 1.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v33 + 288))(v32, v34);
v35 = *(_QWORD *)v32;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, 182.0, 53.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v35 + 184))(v32, v36);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v32 + 160LL))(v32);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v32, 3);
}
if ( v16 )
{
v37 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_rewardBtn_001.png");
v38 = (int)v37;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v37 + 160LL))(v37);
v39 = CCMenuItemSpriteExtra::create(v38, 0, a1, (__int64)DailyLevelNode::onClaimReward);
*((_DWORD *)v39 + 93) = 1066192077;
v40 = cocos2d::CCMenu::createWithItem(v39);
(*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v40, 10);
v41 = *(_QWORD *)v40;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v109, 150.0, -2.0);
(*(void (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v41 + 184))(v40, v42);
v43 = (*(__int64 (__fastcall **)(struct cocos2d::CCMenu *))(*(_QWORD *)v40 + 200LL))(v40);
cocos2d::CCPoint::operator=(a1 + 352, v43);
v44 = *((_QWORD *)v25 + 70);
if ( v44 )
{
v45 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v44 + 952LL))(*((_QWORD *)v25 + 70));
(*(void (__fastcall **)(__int64))(*(_QWORD *)v45 + 160LL))(v45);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, -55.0, 0.0);
v47 = v46;
v48 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v44 + 200LL))(v44);
cocos2d::CCPoint::operator+(v48, v109, v47);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v44 + 184LL))(v44, v109);
}
}
if ( *(_QWORD *)(a1 + 328) )
{
v49 = (unsigned int)(*((_DWORD *)a2 + 248) - *((_DWORD *)a2 + 249));
if ( (int)v49 <= 200000 )
{
if ( (int)v49 > 100000 )
v49 = (unsigned int)(v49 - 100000);
}
else
{
v49 = (unsigned int)(v49 - 200000);
}
v50 = cocos2d::CCString::createWithFormat("#%i", v49);
CString = cocos2d::CCString::getCString(v50);
v52 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt");
(**((void (__fastcall ***)(__int64, void *))v52 + 46))((__int64)v52 + 368, &unk_140702F84);
LOBYTE(v53) = -106;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v52 + 46) + 40LL))((__int64)v52 + 368, v53);
v54 = *(_QWORD *)v52;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 1.0, 0.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v54 + 288))(v52, v55);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v52 + 160LL))(v52);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v52, 3);
v56 = *(_QWORD *)v52;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 183.0, -51.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v56 + 184))(v52, v57);
}
v58 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteBtn_001.png");
v59 = (int)v58;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v58 + 160LL))(v58);
v60 = CCMenuItemSpriteExtra::create(v59, 0, a1, (__int64)DailyLevelNode::onSkipLevel);
v61 = cocos2d::CCMenu::createWithItem(v60);
*(_QWORD *)(a1 + 360) = v61;
(*(void (__fastcall **)(__int64, struct cocos2d::CCMenu *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v61, 10);
v62 = **(_QWORD **)(a1 + 360);
v63 = *(_QWORD *)(a1 + 360);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, -186.0, 54.0);
(*(void (__fastcall **)(__int64, __int64))(v62 + 184))(v63, v64);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 360) + 336LL))(*(_QWORD *)(a1 + 360), 0);
v65 = cocos2d::CCLabelBMFont::create("Bonus:", "goldFont.fnt");
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v65, 10);
v66 = *(_QWORD *)v65;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 1.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v66 + 288))(v65, v67);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v65 + 160LL))(v65);
v70 = *(_DWORD *)(*(_QWORD *)(a1 + 336) + 732LL);
if ( v70 == 1 || v70 == 2 )
{
v76 = (struct cocos2d::CCLabelBMFont *)GJChestSprite::create(3, v68, v69);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v76, 10);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 160LL))(v76);
v98 = *(_QWORD *)v76;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 30.0, -84.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v98 + 184))(v76, v99);
v97 = -25.0;
}
else
{
v71 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_bigDiamond_001.png");
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v71, 10);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v71 + 160LL))(v71);
v72 = *(_DWORD *)(*(_QWORD *)(a1 + 328) + 1020LL) - *(_DWORD *)(*(_QWORD *)(a1 + 328) + 1024LL);
if ( !qword_14090BFE0 )
{
v110[0] = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v110[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
}
if ( (unsigned int)(v72 - 2) > 8 )
{
v73 = 0;
}
else if ( v72 == 10 )
{
v73 = 20;
}
else
{
v73 = (int)floorf((float)(v72 + 2) * 0.5);
}
v74 = cocos2d::CCString::createWithFormat("%ix", v73);
v75 = cocos2d::CCString::getCString(v74);
v76 = cocos2d::CCLabelBMFont::create(v75, (const char *)&qword_140704F78);
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v76, 10);
v77 = *(_QWORD *)v76;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, 1.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v77 + 288))(v76, v78);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 160LL))(v76);
v79 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v71 + 320LL))(v71);
v80 = (*(double (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v71 + 168LL))(v71);
v81 = *(float *)&v80 * v79;
v82 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 320LL))(v76);
v83 = (*(double (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 168LL))(v76);
v84 = (float)(*(float *)&v83 * v82) + v81;
v85 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v65 + 320LL))(v65);
v86 = (*(double (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v65 + 168LL))(v65);
v87 = (float)((float)(*(float *)&v86 * v85) + v84) + 25.0;
v88 = *(_QWORD *)v71;
v89 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v71 + 320LL))(v71);
v90 = (float)(v87 * 0.5)
- (float)((float)((*(float (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v71 + 168LL))(v71) * v89)
* 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, v90, -84.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v88 + 184))(v71, v91);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, -20.0, 0.0);
v93 = v92;
v94 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v71 + 200LL))(v71);
cocos2d::CCPoint::operator+(v94, v109, v93);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v76 + 184LL))(v76, v109);
v95 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 320LL))(v76);
v96 = (*(double (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 168LL))(v76);
v97 = (float)-(float)(*(float *)&v96 * v95) - 5.0;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v110, v97, 0.0);
v101 = v100;
v102 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v76 + 200LL))(v76);
cocos2d::CCPoint::operator+(v102, v109, v101);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v65 + 184LL))(v65, v109);
}
else
{
(**(void (__fastcall ***)(__int64, void *))(v20 + 320))(v20 + 320, &unk_140702F84);
LOBYTE(v103) = 75;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(v20 + 320) + 40LL))(v20 + 320, v103);
v104 = cocos2d::CCLabelBMFont::create("00:00:00", (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 344) = v104;
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v104 + 160LL))(v104);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)a1 + 456LL))(a1, *(_QWORD *)(a1 + 344), 3);
*(_BYTE *)(a1 + 369) = 1;
}
if ( v113 > 0xF )
{
v105 = Block[0];
if ( v113 + 1 >= 0x1000 )
{
v105 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v105 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v105);
}
v112 = 0;
v113 = 15;
LOBYTE(Block[0]) = 0;
if ( v116 > 0xF )
{
v106 = v114[0];
if ( v116 + 1 >= 0x1000 )
{
v106 = *((void **)v114[0] - 1);
if ( (unsigned __int64)((char *)v114[0] - (char *)v106 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v106);
}
return 1;
}