//
// DeathStatsPopup::init from 0xca777c to 0xca8158 (2524 bytes)
//
// 2 xrefs:
// > DeathStatsPopup::create @ 0xca83e8
// > ??> @ 0x69d48
//
// 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:06:03 +0000
//
__int64 __fastcall DeathStatsPopup::init(CCTextInputNode **this, LevelEditorLayer *a2)
{
float v4; // s0
float v5; // s8
cocos2d::CCDirector *v6; // x0
unsigned int v7; // w24
cocos2d::CCDirector *v9; // x0
float v10; // s9
float v11; // s8
const char *v12; // x1
__int64 v13; // x26
__int64 v14; // x26
const char *v15; // x2
__int64 v16; // x26
__int64 v17; // x26
void (__fastcall *v18)(__int64, __int64 *); // x2
const char *v19; // x4
__int64 v20; // x26
__int64 v21; // x26
__int64 v22; // x0
__int64 v23; // x1
GameToolbox *v24; // x0
_QWORD *v25; // x26
const char *v26; // x2
__int64 v27; // x28
__int64 v28; // x27
void (__fastcall *v29)(__int64, __int64 *); // x28
void (__fastcall *v30)(__int64, __int64 *); // x2
void (__fastcall *v31)(__int64, __int64 *); // x28
const char *v32; // x4
__int64 v33; // x27
void (__fastcall *v34)(__int64, __int64 *); // x28
__int64 v35; // x27
bool v36; // w4
__int64 v37; // x5
const char *v38; // x6
__int64 v39; // x23
__int64 v40; // x23
cocos2d::CCNode *v41; // x27
void (__fastcall *v42)(__int64, __int64 *); // x26
const char *v43; // x2
__int64 v44; // x0
__int64 v45; // x23
void (__fastcall *v46)(__int64, __int64 *); // x25
__int64 v47; // x23
void (__fastcall *v48)(__int64, __int64 *); // x25
bool v49; // w4
__int64 v50; // x5
const char *v51; // x6
__int64 v52; // x23
__int64 v53; // x23
cocos2d::CCNode *v54; // x26
float v55; // s8
void (__fastcall *v56)(__int64, __int64 *); // x25
bool v57; // w4
__int64 v58; // x5
const char *v59; // x6
__int64 v60; // x23
__int64 v61; // x23
cocos2d::CCNode *v62; // x25
void (__fastcall *v63)(__int64, __int64 *); // x19
cocos2d::CCNode *v64; // [xsp+A0h] [xbp+A0h]
void (__fastcall *v65)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v66)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v67)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v68)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v69)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v70)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v71)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
void (__fastcall *v72)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
__int64 v73; // [xsp+B0h] [xbp+B0h] BYREF
_BYTE v74[8]; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v75[2]; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v76; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v77; // [xsp+D8h] [xbp+D8h]
void *v78; // [xsp+E0h] [xbp+E0h]
FLAlertLayer::keyboardRaise(_stack_chk_guard, 210.0, 60.0);
v5 = v4;
v6 = (cocos2d::CCDirector *)(unsigned __int8)SetupTriggerPopup::init(
(SetupTriggerPopup *)this,
nullptr,
nullptr,
340.0,
210.0,
1u,
v4);
v7 = (unsigned __int8)v6;
if ( (_BYTE)v6 )
{
*(this + 127) = a2;
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(&v73, v9);
v76 = 0;
v77 = 0;
v78 = nullptr;
v10 = *(float *)&v73 * 0.5;
v11 = (float)(v5 + (float)(*((float *)&v73 + 1) * 0.5)) + 105.0;
std::string::__init(&v76, "Death Stats", 0xBu);
SetupTriggerPopup::addTitle((__int64)this, (__int64)&v76);
if ( (v76 & 1) != 0 )
operator delete(v78);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v12);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v13 + 160LL))(v13, 0.8);
v14 = CCMenuItemSpriteExtra::create(v13, 0, (__int64)this, 1368, 1);
CCMenuItemSpriteExtra::setSizeMult(v14, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v14);
v65 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v14 + 184LL);
v64 = *(this + 69);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, (float)(v10 - 170.0) + 8.0, v11 - 12.0);
cocos2d::CCNode::convertToNodeSpace(v75, v64, (const cocos2d::CCPoint *)v74);
v65(v14, v75);
v16 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Level ID:", "goldFont.fnt", v15);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 0.6);
v66 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, 1.0, 0.5);
v66(v16, v75);
v67 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10 - 78.0, v11 - 56.0);
v67(v16, v75);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v16, 1);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v75, 0.0, 0.0, 40.0, 40.0);
v17 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v75);
v68 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v75, 110.0, 28.0);
v68(v17, v75);
v18 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 960LL);
LOWORD(v75[0]) = 0;
BYTE2(v75[0]) = 0;
v18(v17, v75);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 912LL))(v17, 90);
v69 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10 - 8.0, v11 - 56.0);
v69(v17, v75);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v17, 0);
v20 = CCTextInputNode::create(
(CCTextInputNode *)"Level ID",
98.0,
28.0,
"Thonburi",
(const char *)&off_18,
"bigFont.fnt",
v19);
*(this + 128) = (CCTextInputNode *)v20;
v70 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10 - 8.0, v11 - 56.0);
v70(v20, v75);
CCTextInputNode::setMaxLabelScale(*(this + 128), 0.7);
CCTextInputNode::setMaxLabelWidth(*(this + 128), 94.0);
*((_DWORD *)*(this + 128) + 148) = 12;
v76 = 0;
v21 = (__int64)*(this + 128);
v77 = 0;
v78 = nullptr;
std::string::__init(&v76, "0123456789", 0xAu);
CCTextInputNode::setAllowedChars(v21, (__int64)&v76);
if ( (v76 & 1) != 0 )
operator delete(v78);
v22 = (__int64)*(this + 127);
if ( v22 )
{
v23 = *(_QWORD *)(v22 + 1936);
if ( v23 )
{
v24 = (GameToolbox *)(unsigned int)(*(_DWORD *)(v23 + 328) - *(_DWORD *)(v23 + 332));
if ( (int)v24 > 0 )
{
v25 = *(this + 128);
GameToolbox::intToString((unsigned __int64 *)&v76, v24);
CCTextInputNode::setString(v25, (char *)&v76);
if ( (v76 & 1) != 0 )
operator delete(v78);
}
}
}
*((_QWORD *)*(this + 128) + 73) = this + 68;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), *(this + 128), 5);
v27 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Version:", "goldFont.fnt", v26);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v27 + 160LL))(v27, 0.6);
v71 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v27 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, 1.0, 0.5);
v71(v27, v75);
v72 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v27 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10 - 78.0, v11 - 92.0);
v72(v27, v75);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v27, 1);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v75, 0.0, 0.0, 40.0, 40.0);
v28 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v75);
v29 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v28 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v75, 60.0, 28.0);
v29(v28, v75);
v30 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v28 + 960LL);
LOWORD(v75[0]) = 0;
BYTE2(v75[0]) = 0;
v30(v28, v75);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v28 + 912LL))(v28, 90);
v31 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v28 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10 - 33.0, v11 - 92.0);
v31(v28, v75);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v28, 0);
v33 = CCTextInputNode::create(
(CCTextInputNode *)"Latest",
48.0,
28.0,
"Thonburi",
(const char *)&off_18,
"bigFont.fnt",
v32);
*(this + 129) = (CCTextInputNode *)v33;
v34 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v33 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10 - 33.0, v11 - 92.0);
v34(v33, v75);
CCTextInputNode::setMaxLabelScale(*(this + 129), 0.7);
CCTextInputNode::setMaxLabelWidth(*(this + 129), 44.0);
*((_DWORD *)*(this + 129) + 148) = 4;
v76 = 0;
v35 = (__int64)*(this + 129);
v77 = 0;
v78 = nullptr;
std::string::__init(&v76, "0123456789", 0xAu);
CCTextInputNode::setAllowedChars(v35, (__int64)&v76);
if ( (v76 & 1) != 0 )
operator delete(v78);
*((_QWORD *)*(this + 129) + 73) = this + 68;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), *(this + 129), 5);
v39 = ButtonSprite::create((ButtonSprite *)"Fetch", (const char *)&word_3C, 0, 1, 1.0, v36, v37, v38);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v39 + 160LL))(v39, 0.7);
v40 = CCMenuItemSpriteExtra::create(v39, 0, (__int64)this, (__int64)DeathStatsPopup::onFetch, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v40);
v41 = *(this + 69);
v42 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v40 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, v10 + 95.0, v11 - 74.0);
cocos2d::CCNode::convertToNodeSpace(v75, v41, (const cocos2d::CCPoint *)v74);
v42(v40, v75);
v44 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Enter a level ID, then Fetch.", "bigFont.fnt", v43);
*(this + 130) = (CCTextInputNode *)v44;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v44 + 160LL))(v44, 0.45);
v45 = (__int64)*(this + 130);
v46 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v45 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, 0.5, 0.5);
v46(v45, v75);
v47 = (__int64)*(this + 130);
v48 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v10, v11 - 128.0);
v48(v47, v75);
cocos2d::CCLabelBMFont::limitLabelWidth(*(this + 130), 310.0, 0.45, 0.0);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), *(this + 130), 1);
v52 = ButtonSprite::create((ButtonSprite *)"Clear Local", (const char *)&qword_68 + 6, 0, 1, 1.0, v49, v50, v51);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v52 + 160LL))(v52, 0.65);
v53 = CCMenuItemSpriteExtra::create(v52, 0, (__int64)this, (__int64)DeathStatsPopup::onClearLocal, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v53);
v54 = *(this + 69);
v55 = v11 - 168.0;
v56 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v53 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, v10 - 70.0, v55);
cocos2d::CCNode::convertToNodeSpace(v75, v54, (const cocos2d::CCPoint *)v74);
v56(v53, v75);
v60 = ButtonSprite::create((ButtonSprite *)"Clear Fetched", (const char *)&qword_68 + 6, 0, 1, 1.0, v57, v58, v59);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v60 + 160LL))(v60, 0.65);
v61 = CCMenuItemSpriteExtra::create(v60, 0, (__int64)this, (__int64)DeathStatsPopup::onClearFetched, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v61);
v62 = *(this + 69);
v63 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v61 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, v10 + 70.0, v55);
cocos2d::CCNode::convertToNodeSpace(v75, v62, (const cocos2d::CCPoint *)v74);
v63(v61, v75);
}
return v7;
}