//
// DailyRecallUnlockPopup::init from 0xc5db5c to 0xc5e524 (2504 bytes)
//
// 2 xrefs:
// > DailyRecallUnlockPopup::create @ 0xc5e68c
// > ??> @ 0xc3f28
//
// 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 13:05:20 +0000
//
__int64 __fastcall DailyRecallUnlockPopup::init(cocos2d::CCMenu **this, FLAlertLayerProtocol *a2, GJGameLevel *a3)
{
unsigned __int8 v6; // w0
unsigned int v7; // w26
cocos2d::CCMenu *v9; // x2
int v10; // w22
unsigned int v11; // w24
char *v12; // x23
char *v13; // x0
const char *v14; // x27
cocos2d::CCDirector *v15; // x0
float v16; // s8
float v17; // s9
__int64 v18; // x0
__int64 v19; // x28
void (__fastcall *v20)(__int64, __int64 *); // x21
void (__fastcall *v21)(__int64, __int64 *); // x21
const char *v22; // x1
__int64 v23; // x23
void (__fastcall *v24)(__int64, __int64 *); // x28
const char *v25; // x2
__int64 v26; // x23
void (__fastcall *v27)(__int64, __int64 *); // x28
float v28; // s10
void (__fastcall *v29)(__int64, __int64 *); // x28
GameStatsManager *v30; // x0
GameStatsManager *v31; // x0
unsigned int Stat; // w0
cocos2d::CCString *v33; // x0
cocos2d::CCLabelBMFont *CString; // x0
const char *v35; // x2
__int64 v36; // x23
void (__fastcall *v37)(__int64, __int64 *); // x25
void (__fastcall *v38)(__int64, __int64 *); // x25
const char *v39; // x1
__int64 v40; // x25
__int64 v41; // x0
__int64 (__fastcall *v42)(__int64); // x1
void (__fastcall *v43)(__int64, __int64 *); // x23
__int64 v44; // x28
const char *v45; // x3
const char *v46; // x4
cocos2d::CCString *v47; // x0
int v48; // w23
const char *v49; // x0
size_t v50; // x0
__int64 v51; // x24
cocos2d::CCString *v52; // x0
cocos2d::CCLabelBMFont *v53; // x0
const char *v54; // x2
__int64 v55; // x23
void (__fastcall *v56)(__int64, __int64 *); // x28
float v57; // s9
void (__fastcall *v58)(__int64, __int64 *); // x21
cocos2d::CCMenu *v59; // x0
__int64 v60; // x0
__int64 v61; // x3
const char *v62; // x6
__int64 v63; // x0
__int64 v64; // x24
bool v65; // w4
__int64 v66; // x5
const char *v67; // x6
__int64 v68; // x0
__int64 v69; // x21
__int64 v70; // x21
void (__fastcall *v71)(__int64, __int64 *); // x22
__int64 v72; // x21
cocos2d::CCNode *v73; // x22
void (__fastcall *v74)(__int64, __int64 *); // x20
void (__fastcall *v75)(__int64, __int64 *); // x3
char *v76; // [xsp+A8h] [xbp+A8h]
char *v77; // [xsp+A8h] [xbp+A8h]
char *v78; // [xsp+A8h] [xbp+A8h]
__int64 v79; // [xsp+B8h] [xbp+B8h] BYREF
_BYTE v80[8]; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v81[2]; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v82; // [xsp+D8h] [xbp+D8h] BYREF
size_t v83; // [xsp+E0h] [xbp+E0h]
void *v84; // [xsp+E8h] [xbp+E8h]
__int64 v85; // [xsp+F0h] [xbp+F0h] BYREF
size_t v86; // [xsp+F8h] [xbp+F8h]
void *v87; // [xsp+100h] [xbp+100h]
__int64 v88[2]; // [xsp+108h] [xbp+108h] BYREF
void *v89; // [xsp+118h] [xbp+118h]
__int64 v90[2]; // [xsp+120h] [xbp+120h] BYREF
void *v91; // [xsp+130h] [xbp+130h]
v6 = FLAlertLayer::init((FLAlertLayer *)this, 150);
v7 = v6;
if ( !v6 )
return v7;
v9 = *this;
*(this + 70) = a2;
(*((void (__fastcall **)(cocos2d::CCMenu **, __int64))v9 + 136))(this, 1);
v10 = *((_DWORD *)a3 + 230) - *((_DWORD *)a3 + 231);
v11 = GameStatsManager::dailyRecallPrice((GameStatsManager *)(unsigned int)v10);
if ( v10 > 200000 )
{
v12 = "gj_eventCrown_001.png";
v13 = "Event";
v14 = "GJ_square04.png";
v76 = "Event";
}
else if ( v10 > 100000 )
{
v12 = "gj_weeklyCrown_001.png";
v13 = "Weekly";
v14 = "GJ_square05.png";
v76 = "Weekly";
}
else
{
v12 = "gj_dailyCrown_001.png";
v13 = "Daily";
v14 = "GJ_square02.png";
v76 = "Daily";
}
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v13);
cocos2d::CCDirector::getWinSize(&v79, v15);
v16 = *(float *)&v79 * 0.5;
v17 = *((float *)&v79 + 1) * 0.5;
*((_DWORD *)this + 162) = 1136525312;
*((_DWORD *)this + 163) = 1124859904;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v81, 0.0, 0.0, 80.0, 80.0);
v18 = cocos2d::extension::CCScale9Sprite::create(v14, v81);
v19 = v18;
if ( (unsigned int)(v10 - 100001) <= 0x1869F )
{
v75 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 960LL);
LOWORD(v81[0]) = -20561;
BYTE2(v81[0]) = -81;
v75(v18, v81);
}
v20 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v81, 380.0, 140.0);
v20(v19, v81);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, v16, v17);
v21(v19, v81);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v19, 1);
v23 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)v12, v22);
v24 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, v16, (float)(v17 + 70.0) + 12.0);
v24(v23, v81);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v23, 2);
v26 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Unlock", "goldFont.fnt", v25);
v27 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, 0.5, 1.0);
v27(v26, v81);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v26 + 160LL))(v26, 0.9);
v28 = (float)(v17 + 70.0) - 15.0;
v29 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, v16, v28);
v29(v26, v81);
v30 = (GameStatsManager *)(*(__int64 (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(
*(this + 73),
v26,
3);
v31 = (GameStatsManager *)GameStatsManager::sharedState(v30);
Stat = GameStatsManager::getStat(v31, "21");
v33 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)Stat);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v33);
v36 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt", v35);
v37 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v36 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, 1.0, 0.5);
v37(v36, v81);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v36 + 160LL))(v36, 0.65);
v38 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v36 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, (float)(v16 + 190.0) - 40.0, (float)(v17 + 70.0) - 16.0);
v38(v36, v81);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v36, 3);
v40 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_bigKey_001.png", v39);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v40 + 160LL))(v40, 0.7);
v41 = v36;
v42 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v36 + 192LL);
v43 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v40 + 184LL);
v44 = v42(v41);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v80, 17.0, -1.5);
cocos2d::CCPoint::operator+(v81, v44);
v43(v40, v81);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v40, 3);
if ( v11 == 1 )
v45 = "Demon Key";
else
v45 = "Demon Keys";
if ( v10 > 100000 )
v46 = "You get stars and the chest, nothing else.";
else
v46 = "You get stars only. No diamonds, no bonus.";
v47 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Unlock this %s level for %i %s?\n%s",
v76,
v11,
v45,
v46);
v48 = 0;
v49 = (const char *)cocos2d::CCString::getCString(v47);
v82 = 0;
v77 = (char *)v49;
v83 = 0;
v84 = nullptr;
v50 = strlen(v49);
std::string::__init(&v82, v77, v50);
v85 = 0;
v86 = 0;
v87 = nullptr;
if ( (v82 & 1) != 0 )
goto LABEL_30;
LABEL_13:
v87 = v84;
v85 = v82;
v86 = v83;
while ( 1 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, 0.5, 0.5);
v51 = TextArea::create((char *)&v85, "chatFont.fnt", (const cocos2d::CCPoint *)v81, 0, 0, 1.0, 352.0, 20.0);
if ( (v85 & 1) != 0 )
operator delete(v87);
v78 = *(char **)(*(_QWORD *)v51 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v81,
v16 + (float)((float)v48 * 1.5),
(float)(v17 + 4.0) - (float)((float)v48 * 1.5));
((void (__fastcall *)(__int64, __int64 *))v78)(v51, v81);
if ( v48 )
{
TextArea::colorAllLabels(v51, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v51 + 912LL))(v51, 100);
}
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(*(_QWORD *)*(this + 73) + 464LL))(
*(this + 73),
v51,
(unsigned int)(3 - v48));
if ( v48 )
break;
v48 = 1;
v85 = 0;
v86 = 0;
v87 = nullptr;
if ( (v82 & 1) == 0 )
goto LABEL_13;
LABEL_30:
std::string::__init(&v85, v84, v83);
}
if ( v10 <= 200000 )
{
if ( v10 > (((unsigned __int16)v48 << 16) | 0x86A0) )
{
v52 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"#%i",
(const char *)(unsigned int)(v10 - 100000));
goto LABEL_22;
}
}
else
{
v10 -= 200000;
}
v52 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"#%i",
(const char *)(unsigned int)v10);
LABEL_22:
v53 = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v52);
v55 = cocos2d::CCLabelBMFont::create(v53, "chatFont.fnt", v54);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v55 + 1072LL))(v55, &qword_119E200);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v55 + 1024LL))(v55, 4294967190LL);
v56 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v55 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, 1.0, 0.0);
v56(v55, v81);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v55 + 160LL))(v55, 0.6);
v57 = v17 - 70.0;
v58 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v55 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, (float)(v16 + 190.0) - 7.0, v57 + 7.0);
v58(v55, v81);
v59 = (cocos2d::CCMenu *)(*(__int64 (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(
*(this + 73),
v55,
3);
v60 = cocos2d::CCMenu::create(v59);
v61 = (__int64)*(this + 73);
*(this + 69) = (cocos2d::CCMenu *)v60;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v61 + 464LL))(v61, v60, 10);
v63 = ButtonSprite::create(
(ButtonSprite *)"Cancel",
(const char *)&qword_58 + 2,
0,
0,
1.0,
"goldFont.fnt",
"GJ_button_04.png",
v62);
*(this + 76) = (cocos2d::CCMenu *)v63;
v64 = CCMenuItemSpriteExtra::create(v63, 0, (__int64)this, (__int64)FLAlertLayer::onButton, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v64 + 72LL))(v64, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v64);
v68 = ButtonSprite::create((ButtonSprite *)"Unlock", (const char *)&qword_58 + 2, 0, 0, 1.0, v65, v66, v67);
*(this + 77) = (cocos2d::CCMenu *)v68;
v69 = CCMenuItemSpriteExtra::create(v68, 0, (__int64)this, (__int64)FLAlertLayer::onButton, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v69 + 72LL))(v69, 1);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v69);
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(*(this + 69), 15.0);
v70 = (__int64)*(this + 69);
v71 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v70 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v81, v16, v57 + 25.0);
v71(v70, v81);
v88[0] = 0;
v88[1] = 0;
v89 = nullptr;
std::string::__init(v88, "Recall", 6u);
v90[0] = 0;
v90[1] = 0;
v91 = nullptr;
std::string::__init(
v90,
"Recalled levels give stars and count as completed dailies.\n"
"No diamonds, no orbs, no daily bonus.\n"
"Weekly and Event levels still give their chest.",
0xB0u);
v72 = InfoAlertButton::create((char *)v88, (char *)v90, 0.56);
if ( (v90[0] & 1) != 0 )
operator delete(v91);
if ( (v88[0] & 1) != 0 )
operator delete(v89);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v72);
v73 = *(this + 69);
v74 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v72 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v80, (float)(v16 - 190.0) + 18.0, v28);
cocos2d::CCNode::convertToNodeSpace(v81, v73, (const cocos2d::CCPoint *)v80);
v74(v72, v81);
if ( (v82 & 1) != 0 )
operator delete(v84);
return v7;
}