//
// DemonInfoPopup::init from 0x14055aff0 to 0x14055b948 (2392 bytes)
//
// 2 xrefs:
// > DemonInfoPopup::create @ 0x14055afa2
// > ??> @ 0x14092c0e4
//
// 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:34:13 +0000
//
// Hidden C++ exception states: #wind=6
bool __fastcall DemonInfoPopup::init(
__int64 a1,
signed int a2,
signed int a3,
signed int a4,
signed int a5,
signed int a6,
signed int a7,
signed int a8,
signed int a9,
signed int a10,
signed int a11,
signed int a12,
signed int a13)
{
signed int v15; // r14d
bool result; // al
__int64 v17; // rcx
__int64 v18; // rax
__int64 v19; // rax
__int64 *v20; // rdi
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // rcx
__int64 v26; // rax
__m128i *v27; // rax
cocos2d::CCString *v28; // rax
const char *CString; // rax
struct cocos2d::CCObject *v30; // rsi
__m128i *v31; // rax
cocos2d::CCString *v32; // rax
const char *v33; // rax
struct cocos2d::CCLabelBMFont *v34; // rdi
__int64 v35; // rax
__int64 v36; // rbx
struct cocos2d::CCArray *v37; // rax
int v38; // r15d
__int64 v39; // rax
int v40; // edx
signed int v41; // edi
signed int v42; // esi
cocos2d::CCString *v43; // rax
const char *v44; // rax
size_t v45; // r8
__m128i *v46; // rcx
struct cocos2d::CCSprite *v47; // rbx
__m128i *v48; // rax
struct cocos2d::CCLabelBMFont *v49; // r14
__int64 v50; // rax
__m128i *v51; // rax
struct cocos2d::CCLabelBMFont *v52; // rdi
__int64 v53; // rax
__int64 v54; // rbx
__int64 v55; // rax
__m128i *v56; // rax
cocos2d::CCString *v57; // rax
const char *v58; // rax
struct cocos2d::CCLabelBMFont *v59; // rdi
__int64 v60; // rbx
__int64 v61; // rax
__m128i *v62; // rax
cocos2d::CCString *v63; // rax
const char *v64; // rax
struct cocos2d::CCLabelBMFont *v65; // rdi
__int64 v66; // rbx
__int64 v67; // rax
__int64 *v68; // rbx
cocos2d::CCObject *v69; // rsi
__int64 v70; // rdi
__int64 v71; // rbx
__int64 v72; // rax
__int64 v73; // rax
__int16 v74; // [rsp+48h] [rbp-C0h] BYREF
char v75; // [rsp+4Ah] [rbp-BEh]
float v76; // [rsp+50h] [rbp-B8h] BYREF
float v77; // [rsp+54h] [rbp-B4h]
__int16 v78; // [rsp+58h] [rbp-B0h] BYREF
char v79; // [rsp+5Ah] [rbp-AEh]
signed int v80; // [rsp+5Ch] [rbp-ACh]
signed int v81; // [rsp+60h] [rbp-A8h]
signed int v82; // [rsp+64h] [rbp-A4h]
signed int v83; // [rsp+68h] [rbp-A0h]
signed int v84; // [rsp+6Ch] [rbp-9Ch]
signed int v85; // [rsp+70h] [rbp-98h]
_BYTE v86[4]; // [rsp+78h] [rbp-90h] BYREF
float v87; // [rsp+7Ch] [rbp-8Ch]
char v88[8]; // [rsp+80h] [rbp-88h] BYREF
signed int v89; // [rsp+88h] [rbp-80h]
signed int v90; // [rsp+8Ch] [rbp-7Ch]
signed int v91; // [rsp+90h] [rbp-78h]
signed int v92; // [rsp+94h] [rbp-74h]
signed int v93; // [rsp+98h] [rbp-70h]
char v94[8]; // [rsp+A0h] [rbp-68h] BYREF
char v95[8]; // [rsp+A8h] [rbp-60h] BYREF
char v96[8]; // [rsp+B0h] [rbp-58h] BYREF
char v97[8]; // [rsp+B8h] [rbp-50h] BYREF
char v98[8]; // [rsp+C0h] [rbp-48h] BYREF
__m128i v99; // [rsp+C8h] [rbp-40h] BYREF
__int64 v100; // [rsp+D8h] [rbp-30h]
unsigned __int64 v101; // [rsp+E0h] [rbp-28h]
__m128i v102[2]; // [rsp+E8h] [rbp-20h] BYREF
__m128i v103[2]; // [rsp+108h] [rbp+0h] BYREF
__m128i v104[2]; // [rsp+128h] [rbp+20h] BYREF
v84 = a4;
v85 = a3;
v90 = a2;
v82 = a5;
v80 = a6;
v15 = a8;
v91 = a8;
v89 = a9;
v83 = a10;
v81 = a11;
v93 = a12;
v92 = a13;
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
v18 = cocos2d::CCDirector::sharedDirector(v17);
cocos2d::CCDirector::getWinSize(v18, &v76);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v102, 0.0, 0.0, 80.0, 80.0);
v20 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v19);
v21 = *v20;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v88, 380.0, 210.0);
(*(void (__fastcall **)(__int64 *, __int64))(v21 + 312))(v20, v22);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v20,
0xFFFFFFFFLL);
v23 = *v20;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v88, v76 * 0.5, v77 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v23 + 184))(v20, v24);
v26 = cocos2d::CCMenu::create(v25);
*(_QWORD *)(a1 + 552) = v26;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v26, 10);
v27 = GameToolbox::pointsToString(&v99, a2 + v85 + v84 + v82 + v80);
if ( v27[1].m128i_i64[1] > 0xFuLL )
v27 = (__m128i *)v27->m128i_i64[0];
v28 = cocos2d::CCString::createWithFormat("Classic: %s", v27->m128i_i8);
CString = cocos2d::CCString::getCString(v28);
v30 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
sub_14003D310((__int64)&v99);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v30);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v30 + 160LL))(v30);
v31 = GameToolbox::pointsToString(v102, a7 + a8 + a9 + v83 + v81);
if ( v31[1].m128i_i64[1] > 0xFuLL )
v31 = (__m128i *)v31->m128i_i64[0];
v32 = cocos2d::CCString::createWithFormat("Platformer: %s", v31->m128i_i8);
v33 = cocos2d::CCString::getCString(v32);
v34 = cocos2d::CCLabelBMFont::create(v33, "goldFont.fnt");
sub_14003D310((__int64)v102);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v34);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v34 + 160LL))(v34);
v74 = -14081;
v75 = -1;
(**((void (__fastcall ***)(__int64, __int16 *))v34 + 46))((__int64)v34 + 368, &v74);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v88, v76 * 0.5, (float)((float)(v77 * 0.5) + 105.0) - 20.0);
v36 = v35;
v37 = cocos2d::CCArray::create(v30, v34, 0);
GameToolbox::alignItemsHorisontally((__int64)v37, 30.0, v36, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v95, (float)(v76 * 0.5) - 140.0, (float)(v77 * 0.5) + 35.0);
v38 = 0;
v74 = -14081;
do
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v98, (float)v38 * 70.0, 0.0);
cocos2d::CCPoint::operator+(v95, v94, v39);
v40 = v38 + 6;
v41 = 0;
v42 = 0;
if ( v38 )
{
switch ( v38 )
{
case 1:
v40 = 8;
v41 = v85;
v42 = v15;
break;
case 2:
v40 = 6;
v41 = v84;
v42 = v89;
break;
case 3:
v40 = 9;
v41 = v82;
v42 = v83;
break;
case 4:
v40 = 10;
v41 = v80;
v42 = v81;
break;
}
}
else
{
v40 = 7;
v41 = v90;
v42 = a7;
}
v43 = cocos2d::CCString::createWithFormat("difficulty_%02d_btn2_001.png", v40);
v44 = cocos2d::CCString::getCString(v43);
v99 = 0;
v100 = 0;
v101 = 0;
v45 = -1;
do
++v45;
while ( v44[v45] );
sub_14003D230(&v99, v44, v45);
v46 = &v99;
if ( v101 > 0xF )
v46 = (__m128i *)v99.m128i_i64[0];
v47 = cocos2d::CCSprite::createWithSpriteFrameName(v46->m128i_i8);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v47 + 160LL))(v47);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, char *))(*(_QWORD *)v47 + 184LL))(v47, v94);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v47);
v48 = GameToolbox::pointsToString(v104, v41);
if ( v48[1].m128i_i64[1] > 0xFuLL )
v48 = (__m128i *)v48->m128i_i64[0];
v49 = cocos2d::CCLabelBMFont::create(v48->m128i_i8, "goldFont.fnt");
sub_14003D310((__int64)v104);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v49 + 160LL))(v49);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v49);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v97, 0.0, -50.0);
cocos2d::CCPoint::operator+(v94, v96, v50);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, char *))(*(_QWORD *)v49 + 184LL))(v49, v96);
v51 = GameToolbox::pointsToString(v103, v42);
if ( v51[1].m128i_i64[1] > 0xFuLL )
v51 = (__m128i *)v51->m128i_i64[0];
v52 = cocos2d::CCLabelBMFont::create(v51->m128i_i8, "goldFont.fnt");
sub_14003D310((__int64)v103);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v52 + 160LL))(v52);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v52);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, 0.0, -26.0);
v54 = v53;
v55 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v49 + 200LL))(v49);
cocos2d::CCPoint::operator+(v55, v88, v54);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, char *))(*(_QWORD *)v52 + 184LL))(v52, v88);
v78 = v74;
v79 = -1;
(**((void (__fastcall ***)(__int64, __int16 *))v52 + 46))((__int64)v52 + 368, &v78);
sub_14003D310((__int64)&v99);
++v38;
v15 = v91;
}
while ( v38 <= 4 );
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v86,
(float)((float)(v76 * 0.5) + 190.0) - 12.0,
(float)((float)(v77 * 0.5) - 105.0) + 14.0);
if ( v92 > 0 )
{
v56 = GameToolbox::pointsToString(v103, v92);
if ( v56[1].m128i_i64[1] > 0xFuLL )
v56 = (__m128i *)v56->m128i_i64[0];
v57 = cocos2d::CCString::createWithFormat("Gauntlet: %s", v56->m128i_i8);
v58 = cocos2d::CCString::getCString(v57);
v59 = cocos2d::CCLabelBMFont::create(v58, "goldFont.fnt");
sub_14003D310((__int64)v103);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v59);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v59 + 160LL))(v59);
v60 = *(_QWORD *)v59;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, 1.0, 0.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v60 + 288))(v59, v61);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v59 + 184LL))(v59, v86);
v87 = v87 + 16.0;
}
if ( v93 > 0 )
{
v62 = GameToolbox::pointsToString(v103, v93);
if ( v62[1].m128i_i64[1] > 0xFuLL )
v62 = (__m128i *)v62->m128i_i64[0];
v63 = cocos2d::CCString::createWithFormat("Weekly: %s", v62->m128i_i8);
v64 = cocos2d::CCString::getCString(v63);
v65 = cocos2d::CCLabelBMFont::create(v64, "goldFont.fnt");
sub_14003D310((__int64)v103);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v65);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v65 + 160LL))(v65);
v66 = *(_QWORD *)v65;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, 1.0, 0.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v66 + 288))(v65, v67);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v65 + 184LL))(v65, v86);
}
v68 = (__int64 *)ButtonSprite::create_1(
(int)"OK",
0,
0,
1.0,
0,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0);
v102[0].m128i_i64[0] = (__int64)operator new(0x208u);
v69 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(v102[0].m128i_i64[0]);
if ( v69 )
{
if ( CCMenuItemSpriteExtra::init((__int64 *)v69, v68, 0, a1, (__int64)PagedListPopup::onClose) )
{
cocos2d::CCObject::autorelease(v69);
LABEL_39:
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v69);
v70 = *(_QWORD *)v69;
v71 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, v76 * 0.5, (float)((float)(v77 * 0.5) - 105.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace(v71, v97, v72);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v70 + 184))(v69, v73);
return 1;
}
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v69 + 8LL))(v69, 1);
}
v69 = nullptr;
goto LABEL_39;
}
return result;
}