//
// LevelStatsInfoPopup::init from 0x140426920 to 0x140426d93 (1139 bytes)
//
// 2 xrefs:
// > LevelStatsInfoPopup::create @ 0x1404268a8
// > ??> @ 0x1409269d8
//
// 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:32:11 +0000
//
// Hidden C++ exception states: #wind=2
bool __fastcall LevelStatsInfoPopup::init(__int64 a1, __int64 a2)
{
bool result; // al
__int64 v5; // rcx
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rbx
struct cocos2d::CCLabelBMFont *v9; // rax
__int64 *v10; // rdi
__int64 v11; // rbx
__int64 v12; // rax
float v13; // xmm7_4
__int64 v14; // rbx
const struct cocos2d::CCPoint *v15; // rax
char *v16; // rdi
__int64 v17; // rbx
__int64 v18; // rax
__int64 v19; // rbx
const struct cocos2d::CCPoint *v20; // rax
char *v21; // rdi
__int64 v22; // rbx
__int64 v23; // rax
__int64 v24; // rcx
__int64 v25; // rax
int v26; // eax
cocos2d::CCObject *v27; // rax
struct cocos2d::CCSprite *v28; // rax
cocos2d::CCObject *v29; // rax
cocos2d::CCSprite *v30; // rbx
cocos2d::CCObject *v31; // rax
_BYTE *v32; // [rsp+40h] [rbp-A8h] BYREF
_QWORD v33[2]; // [rsp+48h] [rbp-A0h] BYREF
_BYTE v34[120]; // [rsp+58h] [rbp-90h] BYREF
float v35; // [rsp+100h] [rbp+18h] BYREF
float v36; // [rsp+104h] [rbp+1Ch]
char v37; // [rsp+108h] [rbp+20h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
*(_QWORD *)(a1 + 664) = a2;
v6 = cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(v6, &v35);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, v35 * 0.5, v36 * 0.5);
*(_DWORD *)(a1 + 728) = 1136525312;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v33, 0.0, 0.0, 94.0, 94.0);
v8 = cocos2d::extension::CCScale9Sprite::create("square01_001.png", v7);
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v8 + 184LL))(v8, &v37);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v8);
*(_QWORD *)(a1 + 720) = v8;
v9 = cocos2d::CCLabelBMFont::create("Level Stats", "goldFont.fnt");
*(_QWORD *)(a1 + 688) = v9;
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v9 + 160LL))(v9);
v10 = *(__int64 **)(a1 + 688);
v11 = *v10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, 0.5, 1.0);
(*(void (__fastcall **)(__int64 *, __int64))(v11 + 288))(v10, v12);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 688),
3);
v13 = *(float *)(a1 + 728) - 60.0;
v32 = v34;
v14 = LevelStatsInfoPopup::buildStatsText(a1, v34);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 0.5, 0.5);
v16 = TextArea::create(v14, "chatFont.fnt", 1.0, v13, v15, 1101004800, 0, 0);
*(_QWORD *)(a1 + 672) = v16;
v17 = *(_QWORD *)v16;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 0.5, 0.5);
(*(void (__fastcall **)(char *, __int64))(v17 + 288))(v16, v18);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 672),
3);
v33[0] = v34;
v19 = LevelStatsInfoPopup::buildInfoText(a1, v34);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, 0.5, 0.5);
v21 = TextArea::create(v19, "chatFont.fnt", 1.0, v13, v20, 1101004800, 0, 0);
*(_QWORD *)(a1 + 680) = v21;
v22 = *(_QWORD *)v21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 0.5, 0.5);
(*(void (__fastcall **)(char *, __int64))(v22 + 288))(v21, v23);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 680),
3);
v25 = cocos2d::CCMenu::create(v24);
*(_QWORD *)(a1 + 552) = v25;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v25, 5);
v26 = (unsigned int)ButtonSprite::create_1(
(int)"OK",
90,
0,
1.0,
0,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0);
v27 = CCMenuItemSpriteExtra::create(v26, 0, a1, (__int64)LevelStatsInfoPopup::onClose);
*(_QWORD *)(a1 + 712) = v27;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v27);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
LODWORD(v22) = (_DWORD)v28;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v28 + 160LL))(v28);
v29 = CCMenuItemSpriteExtra::create(v22, 0, a1, (__int64)LevelStatsInfoPopup::onPrevPage);
*(_QWORD *)(a1 + 696) = v29;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v29);
v30 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v30, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v30 + 160LL))(v30);
v31 = CCMenuItemSpriteExtra::create((int)v30, 0, a1, (__int64)LevelStatsInfoPopup::onNextPage);
*(_QWORD *)(a1 + 704) = v31;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v31);
LevelStatsInfoPopup::updatePage(a1);
return 1;
}
return result;
}