//
// StarInfoPopup::init from 0x10019da9c to 0x10019e208 (1900 bytes)
//
// 1 xrefs:
// > StarInfoPopup::create @ 0x10019da3c
//
// 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
//
// local variable allocation has failed, the output may be wrong!
bool __fastcall StarInfoPopup::init(
StarInfoPopup *a1,
int a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8,
int a9,
int a10,
bool a11)
{
__int64 v13; // x24
__int64 v14; // x25
__int64 v17; // x19
_BOOL4 inited; // w0
cocos2d::CCDirector *v20; // x0
int v21; // w28
cocos2d::extension::CCScale9Sprite *v22; // x21
__n128 v23; // q0
__n128 v24; // q1
cocos2d::CCMenu *v25; // x0
char *v26; // x1
int v27; // w22
void **v28; // x23
void **v29; // x8
void **v30; // x9
cocos2d::CCString *v31; // x0
const char *CString; // x0
cocos2d::CCLabelBMFont *v33; // x21
__n128 v34; // q0
__n128 v35; // q1
__n128 v36; // q0
__n128 v37; // q1
__n128 v38; // q0
__n128 v39; // q1
int i; // w23
__int64 v41; // x28
int v42; // w0
GJDifficultySprite *v43; // x22
void **v44; // x0
cocos2d::CCLabelBMFont *v45; // x28
__n128 v46; // q0
__n128 v47; // q1
double v48; // d0
void **v49; // x8
cocos2d::CCString *v50; // x0
const char *v51; // x0
cocos2d::CCLabelBMFont *v52; // x19
__n128 v53; // q0
__n128 v54; // q1
void **v55; // x8
cocos2d::CCString *v56; // x0
const char *v57; // x0
cocos2d::CCLabelBMFont *v58; // x19
__n128 v59; // q0
__n128 v60; // q1
void **v61; // x8
cocos2d::CCString *v62; // x0
const char *v63; // x0
cocos2d::CCLabelBMFont *v64; // x19
__n128 v65; // q0
__n128 v66; // q1
ButtonSprite *v67; // x0
CCMenuItemSpriteExtra *v68; // x19
__n128 v69; // q0
cocos2d::CCMenu *m_buttonMenu; // x20
__n128 v71; // q1
bool v73; // [xsp+1Ch] [xbp-E4h]
int v74; // [xsp+28h] [xbp-D8h]
unsigned int v75; // [xsp+30h] [xbp-D0h]
float32x2_t v76; // [xsp+38h] [xbp-C8h] BYREF
float32x2_t v77; // [xsp+40h] [xbp-C0h] BYREF
float32x2_t v78; // [xsp+48h] [xbp-B8h] BYREF
void *__p[2]; // [xsp+50h] [xbp-B0h] BYREF
char v80; // [xsp+67h] [xbp-99h]
void *v81[2]; // [xsp+68h] [xbp-98h] BYREF
char v82; // [xsp+7Fh] [xbp-81h]
float v83; // [xsp+80h] [xbp-80h]
float v84; // [xsp+84h] [xbp-7Ch]
cocos2d::CCPoint v85; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v86; // 0:x3.16
cocos2d::CCRect v87; // 0:s0.4,4:s1.4,8:s2.4,12:s3.4
v13 = *(_QWORD *)&a6;
v14 = *(_QWORD *)&a5;
v17 = *(_QWORD *)&a2;
inited = FLAlertLayer::init_1(a1, 75);
if ( inited )
{
v74 = a8;
v73 = inited;
v20 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v20);
sub_100022990((float *)v81, 0.0, 0.0, 80.0, 80.0);
v21 = a7;
v22 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v87);
sub_100022988((float *)v81, 380.0, 210.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, void **))v22->setContentSize)(v22, v81);
v23 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v22,
0xFFFFFFFFLL);
v23.n128_f32[0] = v83 * 0.5;
v24.n128_f32[0] = v84 * 0.5;
sub_100022980(v23, v24, v81);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, void **))v22->setPosition)(v22, v81);
v25 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v25;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v25,
10);
if ( a11 )
v26 = "Platformer";
else
v26 = "Classic";
sub_100009900(v81, v26);
v27 = v82;
v28 = (void **)v81[0];
v75 = v21;
GameToolbox::pointsToString((unsigned int)(a4 + a3 + v14 + v13 + v21), (__int64)__p);
if ( v27 >= 0 )
v29 = v81;
else
v29 = v28;
if ( v80 >= 0 )
v30 = __p;
else
v30 = (void **)__p[0];
v31 = (cocos2d::CCString *)sub_100268F4C("%s: %s", (const char *)v29, (const char *)v30);
CString = cocos2d::CCString::getCString(v31);
v33 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
if ( v80 < 0 )
operator delete(__p[0]);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v33);
v34 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v33->setScale)(v33, 0.7);
v34.n128_f32[0] = v83 * 0.5;
v35.n128_f32[0] = (float)((float)(v84 * 0.5) + 105.0) + -20.0;
sub_100022980(v34, v35, __p);
v36 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v33->setPosition)(v33, __p);
v36.n128_f32[0] = (float)(v83 * 0.5) + -147.5;
v37.n128_f32[0] = (float)(v84 * 0.5) + 25.0;
sub_100022980(v36, v37, &v78);
for ( i = 0; i != 6; ++i )
{
v38.n128_f32[0] = (float)(unsigned int)i * 59.0;
v39.n128_u32[0] = 0;
sub_100022980(v38, v39, __p);
sub_1000229DC(&v78, (float32x2_t *)__p, &v77);
if ( i > 2 )
{
v41 = v14;
if ( i != 3 )
{
v41 = v13;
if ( i != 4 )
v41 = v75;
}
}
else
{
v41 = v17;
if ( i )
{
v41 = (unsigned int)a3;
if ( i != 1 )
v41 = (unsigned int)a4;
}
}
if ( i )
v42 = i;
else
v42 = -1;
v43 = GJDifficultySprite::create(v42, Long);
((void (__fastcall *)(GJDifficultySprite *, float))v43->setScale)(v43, 0.9);
((void (__fastcall *)(GJDifficultySprite *, float32x2_t *))v43->setPosition)(v43, &v77);
((void (__fastcall *)(cocos2d::CCLayer *, GJDifficultySprite *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v43);
GameToolbox::pointsToString(v41, (__int64)__p);
if ( v80 >= 0 )
v44 = __p;
else
v44 = (void **)__p[0];
v45 = cocos2d::CCLabelBMFont::create_1((const char *)v44, "goldFont.fnt");
if ( v80 < 0 )
operator delete(__p[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v45->setScale)(v45, 0.6);
v46 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v45);
v47.n128_u32[0] = -1038090240;
v46.n128_u32[0] = 0;
sub_100022980(v46, v47, &v76);
*(float32x2_t *)&v48 = sub_1000229DC(&v77, &v76, (float32x2_t *)__p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **, double))v45->setPosition)(v45, __p, v48);
}
v38.n128_f32[0] = (float)((float)(v83 * 0.5) + 190.0) + -12.0;
v39.n128_f32[0] = (float)((float)(v84 * 0.5) + -105.0) + 14.0;
sub_100022980(v38, v39, &v77);
if ( a9 >= 1 )
{
GameToolbox::pointsToString((unsigned int)a9, (__int64)__p);
if ( v80 >= 0 )
v49 = __p;
else
v49 = (void **)__p[0];
v50 = (cocos2d::CCString *)sub_100268F4C("Gauntlet: %s", (const char *)v49);
v51 = cocos2d::CCString::getCString(v50);
v52 = cocos2d::CCLabelBMFont::create_1(v51, "goldFont.fnt");
if ( v80 < 0 )
operator delete(__p[0]);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v52);
v53 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v52->setScale)(v52, 0.4);
v53.n128_u32[0] = 1.0;
v54.n128_u32[0] = 0;
sub_100022980(v53, v54, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v52->setAnchorPoint)(v52, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v52->setPosition)(v52, &v77);
v77.f32[1] = v77.f32[1] + 16.0;
}
if ( v74 >= 1 )
{
GameToolbox::pointsToString((unsigned int)v74, (__int64)__p);
if ( v80 >= 0 )
v55 = __p;
else
v55 = (void **)__p[0];
v56 = (cocos2d::CCString *)sub_100268F4C("Daily: %s", (const char *)v55);
v57 = cocos2d::CCString::getCString(v56);
v58 = cocos2d::CCLabelBMFont::create_1(v57, "goldFont.fnt");
if ( v80 < 0 )
operator delete(__p[0]);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v58);
v59 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v58->setScale)(v58, 0.4);
v59.n128_u32[0] = 1.0;
v60.n128_u32[0] = 0;
sub_100022980(v59, v60, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v58->setAnchorPoint)(v58, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v58->setPosition)(v58, &v77);
v77.f32[1] = v77.f32[1] + 16.0;
}
if ( a10 >= 1 )
{
GameToolbox::pointsToString((unsigned int)a10, (__int64)__p);
if ( v80 >= 0 )
v61 = __p;
else
v61 = (void **)__p[0];
v62 = (cocos2d::CCString *)sub_100268F4C("Map: %s", (const char *)v61);
v63 = cocos2d::CCString::getCString(v62);
v64 = cocos2d::CCLabelBMFont::create_1(v63, "goldFont.fnt");
if ( v80 < 0 )
operator delete(__p[0]);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v64);
v65 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v64->setScale)(v64, 0.4);
v65.n128_u32[0] = 1.0;
v66.n128_u32[0] = 0;
sub_100022980(v65, v66, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v64->setAnchorPoint)(v64, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v64->setPosition)(v64, &v77);
v77.f32[1] = v77.f32[1] + 16.0;
}
v67 = sub_10005F294("OK");
v86.ptr = (void (__cdecl *)(cocos2d::CCObject *))StarInfoPopup::onClose;
v86.adj = 0;
v68 = CCMenuItemSpriteExtra::create(v67, nullptr, a1, v86);
v69 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(
a1->m_buttonMenu,
v68);
m_buttonMenu = a1->m_buttonMenu;
v69.n128_f32[0] = v83 * 0.5;
v71.n128_f32[0] = (float)((float)(v84 * 0.5) + -105.0) + 25.0;
sub_100022980(v69, v71, &v76);
v85 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, (const cocos2d::CCPoint *)&v76);
((void (__fastcall *)(CCMenuItemSpriteExtra *, void **, float, float))v68->setPosition)(v68, __p, v85.x, v85.y);
if ( v82 < 0 )
operator delete(v81[0]);
LOBYTE(inited) = v73;
}
return inited;
}