//
// DemonInfoPopup::init from 0x1008a7e60 to 0x1008a874b (2283 bytes)
//
// 1 xrefs:
// > DemonInfoPopup::create @ 0x1008a7df6
//
// 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:37:17 +0000
//
__int64 __fastcall DemonInfoPopup::init(
__int64 a1,
__int64 a2,
unsigned int a3,
unsigned int a4,
unsigned int a5,
int a6,
int a7,
int a8,
int a9,
int a10,
int a11,
int a12,
int a13)
{
__int64 v14; // rbx
__int64 v15; // r12
__int64 v16; // r13
__int64 result; // rax
__int64 v18; // rax
void *v19; // rbx
int v20; // edx
int v21; // ecx
int v22; // r8d
int v23; // r9d
__int64 v24; // rax
const char *v25; // rsi
char *v26; // rax
int v27; // r12d
__int64 CString; // rax
void *v29; // rbx
const char *v30; // rsi
char *v31; // rax
__int64 v32; // rax
void *v33; // r14
unsigned int **v34; // rbx
unsigned __int64 *v35; // r14
int v36; // r15d
double v37; // xmm0_8
int v38; // esi
int v39; // ebx
char *v40; // rax
const char *v41; // r15
size_t v42; // rax
size_t v43; // r13
char *v44; // r12
char *v45; // rdi
char *v46; // rax
__int64 v47; // r13
char *v48; // r15
char *v49; // rdi
void *v50; // rbx
char *v51; // rdi
void *v52; // r12
unsigned __int64 *v53; // rbx
int v54; // r15d
unsigned __int64 *v55; // rbx
__int64 v56; // rax
size_t v57; // r14
const char *v58; // rsi
char *v59; // rax
__int64 v60; // rax
void *v61; // rbx
const char *v62; // rsi
char *v63; // rax
__int64 v64; // rax
void *v65; // rbx
__int64 v66; // rax
void *v67; // rbx
__int64 v68; // r14
float v69; // [rsp+8h] [rbp-B8h] BYREF
__int64 v70; // [rsp+10h] [rbp-B0h]
__int64 v71; // [rsp+18h] [rbp-A8h]
__int64 v72; // [rsp+20h] [rbp-A0h]
__int64 v73; // [rsp+28h] [rbp-98h]
__int64 v74; // [rsp+30h] [rbp-90h]
unsigned __int64 v75; // [rsp+3Ch] [rbp-84h] BYREF
unsigned __int64 v76; // [rsp+44h] [rbp-7Ch] BYREF
int v77; // [rsp+4Ch] [rbp-74h]
int v78; // [rsp+50h] [rbp-70h]
int v79; // [rsp+54h] [rbp-6Ch]
size_t v80[2]; // [rsp+58h] [rbp-68h] BYREF
void *v81; // [rsp+68h] [rbp-58h]
__int64 v82; // [rsp+70h] [rbp-50h] BYREF
int v83; // [rsp+78h] [rbp-48h]
unsigned __int8 v84; // [rsp+7Fh] [rbp-41h]
unsigned __int64 __dst[2]; // [rsp+80h] [rbp-40h] BYREF
void *__p; // [rsp+90h] [rbp-30h]
v14 = a5;
v15 = a4;
v16 = a3;
v73 = a2;
result = FLAlertLayer::init_1((_BYTE *)a1, 75);
if ( !(_BYTE)result )
return result;
v84 = result;
v18 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v82, v18);
v74 = v14;
sub_100278270((__int64)__dst, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v19 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"GJ_square02.png", __dst);
v79 = a6;
sub_100278260((float *)__dst, 380.0, 210.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v19 + 320LL))(v19, __dst);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v19,
0xFFFFFFFFLL);
sub_100278250((float *)__dst, *(float *)&v82 * 0.5, *((float *)&v82 + 1) * 0.5);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v19 + 184LL))(v19, __dst);
v24 = cocos2d::CCMenu::create((__int64)v19, (__int64)__dst, v20, v21, v22, v23);
*(_QWORD *)(a1 + 552) = v24;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v24, 10);
v72 = v16;
v71 = v15;
GameToolbox::pointsToString(__dst, a6 + v16 + v73 + v15 + v74);
if ( (__dst[0] & 1) != 0 )
v25 = (const char *)__p;
else
v25 = (char *)__dst + 1;
v26 = sub_10088E820("Classic: %s", v25);
v27 = v72;
CString = cocos2d::CCString::getCString((__int64)v26);
v29 = cocos2d::CCLabelBMFont::create_3(CString, (__int64)"goldFont.fnt");
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v29);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v29 + 160LL))(v29, 0.69999999);
GameToolbox::pointsToString(__dst, a11 + a7 + a8 + a9 + a10);
if ( (__dst[0] & 1) != 0 )
v30 = (const char *)__p;
else
v30 = (char *)__dst + 1;
v31 = sub_10088E820("Platformer: %s", v30);
v32 = cocos2d::CCString::getCString((__int64)v31);
v33 = cocos2d::CCLabelBMFont::create_3(v32, (__int64)"goldFont.fnt");
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v33);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v33 + 160LL))(v33, 0.69999999);
BYTE2(__dst[0]) = -1;
LOWORD(__dst[0]) = -14081;
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v33 + 1072LL))(v33, __dst);
v34 = sub_1007FEAB0((__int64)v29, v33, 0);
sub_100278250((float *)__dst, *(float *)&v82 * 0.5, (float)((float)(*((float *)&v82 + 1) * 0.5) + 105.0) + -20.0);
GameToolbox::alignItemsHorisontally((__int64)v34, __dst, 0, (__m128)0x41F00000u);
v35 = (unsigned __int64 *)&v69;
sub_100278250(&v69, (float)(*(float *)&v82 * 0.5) + -140.0, (float)(*((float *)&v82 + 1) * 0.5) + 35.0);
v36 = 0;
v70 = a1;
do
{
HIDWORD(v37) = 0;
*(float *)&v37 = (float)v36 * 70.0;
sub_100278250((float *)__dst, *(float *)&v37, 0.0);
sub_100278350((double *)&v75, v35, __dst);
v77 = v36;
switch ( v36 )
{
case 0:
v38 = 7;
v83 = a7;
v39 = v73;
break;
case 1:
v38 = 8;
v83 = a8;
v39 = v27;
break;
case 2:
v38 = 6;
v83 = a9;
v39 = v71;
break;
case 3:
v38 = 9;
v83 = a10;
v39 = v74;
break;
case 4:
v38 = 10;
v83 = a11;
v39 = v79;
break;
}
v40 = sub_10088E820("difficulty_%02d_btn2_001.png", v38);
v41 = (const char *)cocos2d::CCString::getCString((__int64)v40);
v42 = strlen(v41);
if ( v42 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v43 = v42;
if ( v42 >= 0x17 )
{
v78 = v39;
v55 = v35;
v56 = v42 | 7;
v57 = 26;
if ( (v43 | 7) != 0x17 )
v57 = v56 + 1;
v44 = (char *)operator new(v57);
__p = v44;
__dst[0] = v57 + 1;
__dst[1] = v43;
v35 = v55;
v39 = v78;
}
else
{
LOBYTE(__dst[0]) = 2 * v42;
v44 = (char *)__dst + 1;
if ( !v42 )
{
BYTE1(__dst[0]) = 0;
v45 = (char *)__dst + 1;
if ( (__dst[0] & 1) == 0 )
goto LABEL_25;
LABEL_24:
v45 = (char *)__p;
goto LABEL_25;
}
}
memmove(v44, v41, v43);
v44[v43] = 0;
v45 = (char *)__dst + 1;
if ( (__dst[0] & 1) != 0 )
goto LABEL_24;
LABEL_25:
v46 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v45, v37);
v47 = v70;
v48 = v46;
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v46 + 160LL))(v46, 1.0);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v48 + 184LL))(v48, &v75);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(v47 + 584) + 456LL))(*(_QWORD *)(v47 + 584), v48);
GameToolbox::pointsToString(v80, v39);
v49 = (char *)v80 + 1;
if ( (v80[0] & 1) != 0 )
v49 = (char *)v81;
v50 = cocos2d::CCLabelBMFont::create_3((__int64)v49, (__int64)"goldFont.fnt");
if ( (v80[0] & 1) != 0 )
operator delete(v81);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v50 + 160LL))(v50, 0.60000002);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v47 + 584) + 456LL))(*(_QWORD *)(v47 + 584), v50);
sub_100278250((float *)&v76, 0.0, -50.0);
sub_100278350((double *)v80, &v75, &v76);
(*(void (__fastcall **)(void *, size_t *))(*(_QWORD *)v50 + 184LL))(v50, v80);
GameToolbox::pointsToString(v80, v83);
v51 = (char *)v80 + 1;
if ( (v80[0] & 1) != 0 )
v51 = (char *)v81;
v52 = cocos2d::CCLabelBMFont::create_3((__int64)v51, (__int64)"goldFont.fnt");
if ( (v80[0] & 1) != 0 )
operator delete(v81);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v52 + 160LL))(v52, 0.60000002);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v47 + 584) + 456LL))(*(_QWORD *)(v47 + 584), v52);
v53 = (unsigned __int64 *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v50 + 192LL))(v50);
sub_100278250((float *)&v76, 0.0, -26.0);
sub_100278350((double *)v80, v53, &v76);
(*(void (__fastcall **)(void *, size_t *))(*(_QWORD *)v52 + 184LL))(v52, v80);
BYTE2(v80[0]) = -1;
LOWORD(v80[0]) = -14081;
(*(void (__fastcall **)(void *, size_t *))(*(_QWORD *)v52 + 1072LL))(v52, v80);
v27 = v72;
v54 = v77;
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
v36 = v54 + 1;
}
while ( v36 != 5 );
sub_100278250(
(float *)v80,
(float)((float)(*(float *)&v82 * 0.5) + 190.0) + -12.0,
(float)((float)(*((float *)&v82 + 1) * 0.5) + -105.0) + 14.0);
if ( a13 > 0 )
{
GameToolbox::pointsToString(__dst, a13);
if ( (__dst[0] & 1) != 0 )
v58 = (const char *)__p;
else
v58 = (char *)__dst + 1;
v59 = sub_10088E820("Gauntlet: %s", v58);
v60 = cocos2d::CCString::getCString((__int64)v59);
v61 = cocos2d::CCLabelBMFont::create_3(v60, (__int64)"goldFont.fnt");
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v47 + 584) + 456LL))(*(_QWORD *)(v47 + 584), v61);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v61 + 160LL))(v61, 0.40000001);
sub_100278250((float *)__dst, 1.0, 0.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v61 + 296LL))(v61, __dst);
(*(void (__fastcall **)(void *, size_t *))(*(_QWORD *)v61 + 184LL))(v61, v80);
*((float *)v80 + 1) = *((float *)v80 + 1) + 16.0;
}
if ( a12 > 0 )
{
GameToolbox::pointsToString(__dst, a12);
if ( (__dst[0] & 1) != 0 )
v62 = (const char *)__p;
else
v62 = (char *)__dst + 1;
v63 = sub_10088E820("Weekly: %s", v62);
v64 = cocos2d::CCString::getCString((__int64)v63);
v65 = cocos2d::CCLabelBMFont::create_3(v64, (__int64)"goldFont.fnt");
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v47 + 584) + 456LL))(*(_QWORD *)(v47 + 584), v65);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v65 + 160LL))(v65, 0.40000001);
sub_100278250((float *)__dst, 1.0, 0.0);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v65 + 296LL))(v65, __dst);
(*(void (__fastcall **)(void *, size_t *))(*(_QWORD *)v65 + 184LL))(v65, v80);
}
v66 = sub_100059E00((__int64)"OK");
v67 = CCMenuItemSpriteExtra::create(v66, 0, v47, (__int64)DemonInfoPopup::onClose, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v47 + 552) + 456LL))(*(_QWORD *)(v47 + 552), v67);
v68 = *(_QWORD *)(v47 + 552);
sub_100278250((float *)&v75, *(float *)&v82 * 0.5, (float)((float)(0.5 * *((float *)&v82 + 1)) + -105.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace((double *)__dst, v68, (unsigned int *)&v75);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v67 + 184LL))(v67, __dst);
return v84;
}