//
// StarInfoPopup::init from 0x1403c81b0 to 0x1403c89fc (2124 bytes)
//
// 2 xrefs:
// > StarInfoPopup::create @ 0x1403c816c
// > ??> @ 0x1406d797c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=4
bool StarInfoPopup::init(
StarInfoPopup *a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8,
int a9,
int a10,
bool a11)
{
bool result; // al
__int64 v15; // rcx
cocos2d::CCDirector *v16; // rax
struct cocos2d::CCRect *v17; // rax
struct cocos2d::extension::CCScale9Sprite *v18; // rdi
cocos2d::extension::CCScale9Sprite_vtbl *v19; // rbx
const cocos2d::CCSize *v20; // rax
float v21; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v22; // rbx
const cocos2d::CCPoint *v23; // rax
__int64 v24; // rcx
cocos2d::CCMenu *v25; // rax
const char *v26; // rdx
size_t v27; // r8
__m128i *v28; // rax
const char *v29; // rdx
cocos2d::CCString *v30; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v32; // rdi
float v33; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v34; // rbx
const cocos2d::CCPoint *v35; // rax
double v36; // xmm0_8
int i; // edi
signed int v38; // esi
int v39; // ecx
GJDifficultySprite *v40; // rbx
__m128i *v41; // rax
struct cocos2d::CCLabelBMFont *v42; // rbx
float v43; // xmm0_4
__m128i *v44; // rax
cocos2d::CCString *v45; // rax
const char *v46; // rax
struct cocos2d::CCLabelBMFont *v47; // rdi
float v48; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v49; // rbx
const cocos2d::CCPoint *v50; // rax
__m128i *v51; // rax
cocos2d::CCString *v52; // rax
const char *v53; // rax
struct cocos2d::CCLabelBMFont *v54; // rdi
float v55; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v56; // rbx
const cocos2d::CCPoint *v57; // rax
__m128i *v58; // rax
cocos2d::CCString *v59; // rax
const char *v60; // rax
struct cocos2d::CCLabelBMFont *v61; // rdi
float v62; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v63; // rbx
const cocos2d::CCPoint *v64; // rax
ButtonSprite *v65; // rbx
CCMenuItemSpriteExtra *v66; // rdi
float v67; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v68; // rbx
struct cocos2d::CCPoint v69; // rax
float v70; // [rsp+40h] [rbp-C0h]
_BYTE v71[4]; // [rsp+48h] [rbp-B8h] BYREF
float v72; // [rsp+4Ch] [rbp-B4h]
int v73; // [rsp+50h] [rbp-B0h]
int v74; // [rsp+54h] [rbp-ACh]
cocos2d::CCSize v75; // [rsp+58h] [rbp-A8h] BYREF
int v76; // [rsp+60h] [rbp-A0h]
signed int v77; // [rsp+64h] [rbp-9Ch]
signed int v78; // [rsp+68h] [rbp-98h]
signed int v79; // [rsp+6Ch] [rbp-94h]
cocos2d::CCPoint v80; // [rsp+70h] [rbp-90h] BYREF
char v81[8]; // [rsp+78h] [rbp-88h] BYREF
struct cocos2d::CCPoint v82; // [rsp+80h] [rbp-80h] BYREF
cocos2d::CCRect v83[2]; // [rsp+88h] [rbp-78h] BYREF
__int128 v84; // [rsp+A8h] [rbp-58h] BYREF
__int64 v85; // [rsp+B8h] [rbp-48h]
unsigned __int64 v86; // [rsp+C0h] [rbp-40h]
__m128i v87[2]; // [rsp+C8h] [rbp-38h] BYREF
v76 = a2;
v73 = a6;
v74 = a7;
v78 = a8;
v77 = a9;
v79 = a10;
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v15);
cocos2d::CCDirector::getWinSize(v16);
cocos2d::CCRect::CCRect(v83, 0.0, 0.0, 80.0, 80.0);
v18 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v17);
v19 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize(&v75, 380.0, 210.0);
v19->setContentSize(v18, v20);
v21 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v18,
-1);
v22 = v18->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v21, v70 * 0.5);
v22->setPosition_0(v18, v23);
v25 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v24);
a1->m_buttonMenu = v25;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v25, 10);
v26 = "Classic";
if ( a11 )
v26 = "Platformer";
v84 = 0;
v85 = 0;
v86 = 0;
v27 = -1;
do
++v27;
while ( v26[v27] );
sub_14003A930(&v84, v26, v27);
v28 = GameToolbox::pointsToString((__m128i *)v83, a3 + a4 + a5 + v73 + v74);
if ( v28[1].m128i_i64[1] > 0xFuLL )
v28 = (__m128i *)v28->m128i_i64[0];
v29 = (const char *)&v84;
if ( v86 > 0xF )
v29 = (const char *)v84;
v30 = cocos2d::CCString::createWithFormat("%s: %s", v29, v28->m128i_i8);
CString = cocos2d::CCString::getCString(v30);
v32 = cocos2d::CCLabelBMFont::create(CString, "goldFont.fnt");
sub_14003A830((__int64)v83);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v32);
v33 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *))v32->setScale_0)(v32);
v34 = v32->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v33, v70 * 0.5);
v34->setPosition_0(v32, v35);
v36 = cocos2d::CCPoint::CCPoint(v70 * 0.5, (float)(v70 * 0.5) - 147.5);
for ( i = 0; i <= 5; ++i )
{
cocos2d::CCPoint::CCPoint(*(float *)&v36, (float)i * 59.0);
cocos2d::CCPoint::operator+(v81, &v80);
v38 = 0;
switch ( i )
{
case 0:
v38 = v76;
break;
case 1:
v38 = a3;
break;
case 2:
v38 = a4;
break;
case 3:
v38 = a5;
break;
case 4:
v38 = v73;
break;
case 5:
v38 = v74;
break;
default:
break;
}
v39 = i;
if ( !i )
v39 = -1;
v40 = GJDifficultySprite::create(v39, Long);
((void (__fastcall *)(GJDifficultySprite *))v40->setScale_0)(v40);
v40->setPosition_0(v40, &v80);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v40);
v41 = GameToolbox::pointsToString(v87, v38);
if ( v41[1].m128i_i64[1] > 0xFuLL )
v41 = (__m128i *)v41->m128i_i64[0];
v42 = cocos2d::CCLabelBMFont::create(v41->m128i_i8, "goldFont.fnt");
sub_14003A830((__int64)v87);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v42->setScale_0)(v42);
v43 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild_1)(
a1->m_mainLayer,
v42);
cocos2d::CCPoint::CCPoint(v43, 0.0);
v36 = cocos2d::CCPoint::operator+(&v80, &v75);
v42->setPosition_0(v42, (const cocos2d::CCPoint *)&v75);
}
cocos2d::CCPoint::CCPoint(*(float *)&v36, (float)((float)(v70 * 0.5) + 190.0) - 12.0);
if ( v77 > 0 )
{
v44 = GameToolbox::pointsToString(v87, v77);
if ( v44[1].m128i_i64[1] > 0xFuLL )
v44 = (__m128i *)v44->m128i_i64[0];
v45 = cocos2d::CCString::createWithFormat("Gauntlet: %s", v44->m128i_i8);
v46 = cocos2d::CCString::getCString(v45);
v47 = cocos2d::CCLabelBMFont::create(v46, "goldFont.fnt");
sub_14003A830((__int64)v87);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v47);
v48 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *))v47->setScale_0)(v47);
v49 = v47->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v48, 1.0);
v49->setAnchorPoint(v47, v50);
v47->setPosition_0(v47, (const cocos2d::CCPoint *)v71);
v72 = v72 + 16.0;
}
if ( v78 > 0 )
{
v51 = GameToolbox::pointsToString(v87, v78);
if ( v51[1].m128i_i64[1] > 0xFuLL )
v51 = (__m128i *)v51->m128i_i64[0];
v52 = cocos2d::CCString::createWithFormat("Daily: %s", v51->m128i_i8);
v53 = cocos2d::CCString::getCString(v52);
v54 = cocos2d::CCLabelBMFont::create(v53, "goldFont.fnt");
sub_14003A830((__int64)v87);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v54);
v55 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *))v54->setScale_0)(v54);
v56 = v54->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v55, 1.0);
v56->setAnchorPoint(v54, v57);
v54->setPosition_0(v54, (const cocos2d::CCPoint *)v71);
v72 = v72 + 16.0;
}
if ( v79 > 0 )
{
v58 = GameToolbox::pointsToString(v87, v79);
if ( v58[1].m128i_i64[1] > 0xFuLL )
v58 = (__m128i *)v58->m128i_i64[0];
v59 = cocos2d::CCString::createWithFormat("Map: %s", v58->m128i_i8);
v60 = cocos2d::CCString::getCString(v59);
v61 = cocos2d::CCLabelBMFont::create(v60, "goldFont.fnt");
sub_14003A830((__int64)v87);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v61);
v62 = ((float (__fastcall *)(struct cocos2d::CCLabelBMFont *))v61->setScale_0)(v61);
v63 = v61->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v62, 1.0);
v63->setAnchorPoint(v61, v64);
v61->setPosition_0(v61, (const cocos2d::CCPoint *)v71);
v72 = v72 + 16.0;
}
v65 = ButtonSprite::create_1("OK", 0, 0, 1.0, 0, "goldFont.fnt", "GJ_button_01.png", 0.0);
v83[0].origin = (cocos2d::CCPoint)operator new(0x208u);
v66 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra(*(CCMenuItemSpriteExtra **)&v83[0].origin);
if ( v66 )
{
if ( CCMenuItemSpriteExtra::init(v66, v65, nullptr, a1, (cocos2d::SEL_MenuHandler *)AudioAssetsBrowser::onClose) )
{
cocos2d::CCObject::autorelease(v66);
LABEL_40:
v67 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v66);
v68 = v66->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v67, v70 * 0.5);
v69 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v82);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v68->setPosition_0)(v66, v69);
sub_14003A830((__int64)&v84);
return 1;
}
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v66->~CCMenuItemSpriteExtra)(v66, 1);
}
v66 = nullptr;
goto LABEL_40;
}
return result;
}