//
// NewgroundsInfoLayer::init from 0x140166750 to 0x140166fda (2186 bytes)
//
// 5 xrefs:
// > CustomSongLayer::onNewgroundsBrowser @ 0x1401651b0
// > CustomSongLayer::onNewgroundsBrowser @ 0x1401651b7
// > CustomSongLayer::onNewgroundsBrowser @ 0x1401651a1
// > ??> @ 0x140743188
// > ??> @ 0x140917f54
//
// 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:27:27 +0000
//
// Hidden C++ exception states: #wind=4
bool __fastcall NewgroundsInfoLayer::init(__int64 a1)
{
bool result; // al
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rax
__int64 *v6; // rdi
__int64 v7; // rbx
__int64 v8; // rax
__int64 v9; // rbx
__int64 v10; // rax
struct cocos2d::CCLabelBMFont *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rax
int v15; // eax
cocos2d::CCObject *v16; // rsi
__int64 v17; // rdi
__int64 v18; // rbx
__int64 v19; // rax
__int64 v20; // rax
struct cocos2d::CCLabelBMFont *v21; // rdi
__int64 v22; // rbx
__int64 v23; // rax
float v24; // xmm7_4
float v25; // xmm6_4
float v26; // xmm7_4
__int64 v27; // rbx
__int64 v28; // rax
struct cocos2d::CCLabelBMFont *v29; // rsi
__int64 v30; // rbx
__int64 v31; // rax
__int64 v32; // rax
__int64 v33; // rbx
__int64 v34; // rax
struct cocos2d::CCLabelBMFont *v35; // rdi
__int64 v36; // rbx
__int64 v37; // rax
__int64 v38; // rax
__int64 v39; // rbx
__int64 v40; // rax
cocos2d::CCObject *v41; // rbx
cocos2d::CCObject *v42; // r13
cocos2d::CCObject *v43; // rbx
cocos2d::CCObject *v44; // r15
cocos2d::CCObject *v45; // rbx
cocos2d::CCObject *v46; // rsi
cocos2d::CCObject *v47; // rbx
cocos2d::CCObject *v48; // rbx
__int64 v49; // rcx
cocos2d::CCArray *v50; // rdi
__int64 v51; // rbx
__int64 v52; // rax
__int64 v53; // rax
int v54; // eax
cocos2d::CCObject *v55; // rsi
__int64 v56; // rdi
__int64 v57; // rbx
__int64 v58; // rax
__int64 v59; // rax
_BYTE v60[80]; // [rsp+58h] [rbp-29h] BYREF
float v61; // [rsp+F0h] [rbp+6Fh] BYREF
float v62; // [rsp+F4h] [rbp+73h]
void *v63; // [rsp+F8h] [rbp+77h] BYREF
char v64; // [rsp+100h] [rbp+7Fh] BYREF
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
*(_BYTE *)(a1 + 596) = 1;
v4 = cocos2d::CCDirector::sharedDirector(v3);
cocos2d::CCDirector::getWinSize(v4, &v61);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v60, 0.0, 0.0, 80.0, 80.0);
v6 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v5);
v7 = *v6;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v63, 440.0, 290.0);
(*(void (__fastcall **)(__int64 *, __int64))(v7 + 312))(v6, v8);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v6,
0xFFFFFFFFLL);
v9 = *v6;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, v61 * 0.5, v62 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v9 + 184))(v6, v10);
v11 = cocos2d::CCLabelBMFont::create("Newgrounds", (const char *)&qword_140704F78);
v12 = *(_QWORD *)v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, v61 * 0.5, (float)((float)(v62 * 0.5) + 145.0) - 28.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v12 + 184))(v11, v13);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v11);
v14 = cocos2d::CCMenu::create();
*(_QWORD *)(a1 + 552) = v14;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v14, 10);
v15 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v16 = CCMenuItemSpriteExtra::create(v15, 0, a1, (__int64)PagedListPopup::onClose);
*((_DWORD *)v16 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v16);
v17 = *(_QWORD *)v16;
v18 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v63,
(float)((float)(v61 * 0.5) - 220.0) + 10.0,
(float)((float)(v62 * 0.5) + 145.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v18, &v64, v19);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v17 + 184))(v16, v20);
v21 = cocos2d::CCLabelBMFont::create("1. Find a song on Newgrounds.com", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v21 + 160LL))(v21);
v22 = *(_QWORD *)v21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v22 + 288))(v21, v23);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v21);
v24 = v61 * 0.5;
v25 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v21 + 320LL))(v21) * 0.5;
v26 = (float)(v24
- (float)((*(float (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v21 + 168LL))(v21) * v25))
- 2.0;
v27 = *(_QWORD *)v21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, v26, (float)(v62 * 0.5) + 70.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v27 + 184))(v21, v28);
v29 = cocos2d::CCLabelBMFont::create("2. Save the song ID", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v29 + 160LL))(v29);
v30 = *(_QWORD *)v29;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v30 + 288))(v29, v31);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v29);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v64, 0.0, -30.0);
v33 = v32;
v34 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v21 + 200LL))(v21);
cocos2d::CCPoint::operator+(v34, &v63, v33);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v29 + 184LL))(v29, &v63);
v35 = cocos2d::CCLabelBMFont::create("3. Enter the ID in the search box", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v35 + 160LL))(v35);
v36 = *(_QWORD *)v35;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v36 + 288))(v35, v37);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v35);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v64, 0.0, -30.0);
v39 = v38;
v40 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v29 + 200LL))(v29);
cocos2d::CCPoint::operator+(v40, &v63, v39);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v35 + 184LL))(v35, &v63);
v63 = operator new(0x2C8u);
v41 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v63);
if ( v41 )
{
if ( ButtonSprite::init_1(
(__int64)v41,
(__int64)"Artists",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_02.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v41);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v41 + 8LL))(v41, 1);
LODWORD(v41) = 0;
}
}
v42 = CCMenuItemSpriteExtra::create((int)v41, 0, a1, (__int64)NewgroundsInfoLayer::onArtists);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v42);
*((_DWORD *)v42 + 93) = 1066192077;
v63 = operator new(0x2C8u);
v43 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v63);
if ( v43 )
{
if ( ButtonSprite::init_1(
(__int64)v43,
(__int64)"Newgrounds",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_01.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v43);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v43 + 8LL))(v43, 1);
LODWORD(v43) = 0;
}
}
v44 = CCMenuItemSpriteExtra::create((int)v43, 0, a1, (__int64)NewgroundsInfoLayer::onNewgrounds);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v44);
*((_DWORD *)v44 + 93) = 1066192077;
v63 = operator new(0x2C8u);
v45 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v63);
if ( v45 )
{
if ( ButtonSprite::init_1(
(__int64)v45,
(__int64)"Guidelines",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_05.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v45);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v45 + 8LL))(v45, 1);
LODWORD(v45) = 0;
}
}
v46 = CCMenuItemSpriteExtra::create((int)v45, 0, a1, (__int64)NewgroundsInfoLayer::onGuidelines);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v46);
*((_DWORD *)v46 + 93) = 1066192077;
v63 = operator new(0x2C8u);
v47 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v63);
if ( v47 )
{
if ( ButtonSprite::init_1(
(__int64)v47,
(__int64)"Support NG!",
200,
0,
1053609165,
0,
&qword_140704F78,
(__int64)"GJ_button_03.png",
1103626240) )
{
cocos2d::CCObject::autorelease(v47);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v47 + 8LL))(v47, 1);
LODWORD(v47) = 0;
}
}
v48 = CCMenuItemSpriteExtra::create((int)v47, 0, a1, (__int64)NewgroundsInfoLayer::onSupporter);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v48);
*((_DWORD *)v48 + 93) = 1066192077;
v50 = (cocos2d::CCArray *)cocos2d::CCArray::create(v49);
cocos2d::CCArray::addObject(v50, v42);
cocos2d::CCArray::addObject(v50, v44);
cocos2d::CCArray::addObject(v50, v46);
cocos2d::CCArray::addObject(v50, v48);
v51 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, v61 * 0.5, (float)((float)(v62 * 0.5) - 145.0) + 40.0);
cocos2d::CCNode::convertToNodeSpace(v51, &v64, v52);
GameToolbox::alignItemsHorisontally((__int64)v50, 8.0, v53, 0);
v54 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_helpBtn2_001.png");
v55 = CCMenuItemSpriteExtra::create(v54, 0, a1, (__int64)NewgroundsInfoLayer::onInfo);
*((_DWORD *)v55 + 93) = 1067030938;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v55);
v56 = *(_QWORD *)v55;
v57 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v63,
(float)((float)(v61 * 0.5) + 220.0) - 27.0,
(float)((float)(v62 * 0.5) + 145.0) - 27.0);
cocos2d::CCNode::convertToNodeSpace(v57, &v64, v58);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v56 + 184))(v55, v59);
return 1;
}
return result;
}