//
// MessagesProfilePage::init from 0x140475940 to 0x1404762f5 (2485 bytes)
//
// 2 xrefs:
// > MessagesProfilePage::create @ 0x1404758f4
// > ??> @ 0x140928364
//
// 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:40 +0000
//
bool __fastcall MessagesProfilePage::init(__int64 a1, char a2)
{
bool result; // al
__int64 v5; // rcx
__int64 v6; // rax
__int64 v7; // rax
__int64 *v8; // rdi
__int64 v9; // rdx
void (__fastcall *v10)(__int64 *, __int64); // r8
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rbx
__int64 v14; // rax
const char *v15; // rcx
struct cocos2d::CCLabelBMFont *v16; // rdi
__int64 v17; // rbx
__int64 v18; // rax
struct cocos2d::CCLabelBMFont *v19; // rax
__int64 v20; // rcx
__int64 *v21; // rdi
__int64 v22; // rbx
__int64 v23; // rax
__int64 *v24; // rdi
__int64 v25; // rbx
__int64 v26; // rax
int v27; // eax
cocos2d::CCObject *v28; // rax
struct cocos2d::CCMenu *v29; // rax
float v30; // xmm1_4
struct cocos2d::CCMenu *v31; // rdi
float v32; // xmm2_4
__int64 v33; // rbx
__int64 v34; // rax
cocos2d::CCLayerColor *v35; // rax
__int64 v36; // rcx
__int64 *v37; // rdi
__int64 v38; // rbx
__int64 v39; // rax
int v40; // eax
cocos2d::CCObject *v41; // rsi
__int64 v42; // rdi
__int64 v43; // rbx
__int64 v44; // rax
__int64 v45; // rax
float v46; // xmm6_4
float v47; // xmm7_4
int v48; // eax
cocos2d::CCObject *v49; // rsi
float v50; // xmm7_4
__int64 v51; // rdi
__int64 v52; // rbx
__int64 v53; // rax
__int64 v54; // rax
struct cocos2d::CCLabelBMFont *v55; // rax
__int64 *v56; // rdi
__int64 v57; // rbx
__int64 v58; // rax
int v59; // eax
cocos2d::CCObject *v60; // rax
__int64 *v61; // rsi
__int64 v62; // rbx
__int64 v63; // rdi
__int64 v64; // rax
__int64 v65; // rax
__int64 v66; // rcx
__int64 v67; // rax
struct cocos2d::CCLabelBMFont *v68; // rax
__int64 v69; // rcx
__int64 *v70; // rdi
__int64 v71; // rbx
__int64 v72; // rax
float v73; // xmm7_4
struct cocos2d::CCSprite *v74; // rax
cocos2d::CCObject *v75; // rax
__int64 v76; // rcx
__int64 *v77; // rsi
__int64 v78; // rbx
__int64 v79; // rdi
__int64 v80; // rax
__int64 v81; // rax
cocos2d::CCSprite *v82; // rbx
cocos2d::CCObject *v83; // rax
__int64 v84; // rcx
__int64 *v85; // rsi
__int64 v86; // rbx
__int64 v87; // rdi
__int64 v88; // rax
__int64 v89; // rax
int v90; // eax
cocos2d::CCObject *v91; // rax
__int64 *v92; // rsi
__int64 v93; // rbx
__int64 v94; // rdi
__int64 v95; // rax
__int64 v96; // rax
_BYTE v97[16]; // [rsp+30h] [rbp-29h] BYREF
float v98; // [rsp+D0h] [rbp+77h] BYREF
float v99; // [rsp+D4h] [rbp+7Bh]
char v100; // [rsp+D8h] [rbp+7Fh] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
*(_BYTE *)(a1 + 596) = 1;
*(_BYTE *)(a1 + 696) = a2;
v6 = cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(v6, &v98);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v97, 0.0, 0.0, 80.0, 80.0);
v8 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v7);
v9 = v8[40];
v10 = *(void (__fastcall **)(__int64 *, __int64))(v9 + 40);
LOBYTE(v9) = -1;
v10(v8 + 40, v9);
v11 = *v8;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v100, 440.0, 290.0);
(*(void (__fastcall **)(__int64 *, __int64))(v11 + 312))(v8, v12);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v8,
0xFFFFFFFFLL);
v13 = *v8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v98 * 0.5, v99 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v13 + 184))(v8, v14);
v15 = "Old Messages";
if ( *(_BYTE *)(a1 + 696) )
v15 = "Old Sent Messages";
v16 = cocos2d::CCLabelBMFont::create(v15, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v16,
20);
v17 = *(_QWORD *)v16;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v98 * 0.5, (float)((float)(v99 * 0.5) + 145.0) - 20.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v17 + 184))(v16, v18);
cocos2d::CCLabelBMFont::limitLabelWidth(v16, 185.0, 0.80000001, 0.0);
v19 = cocos2d::CCLabelBMFont::create(" ", "goldFont.fnt");
v20 = *(_QWORD *)(a1 + 584);
*(_QWORD *)(a1 + 736) = v19;
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)v20 + 456LL))(v20, v19, 20);
v21 = *(__int64 **)(a1 + 736);
v22 = *v21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, 1.0, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v22 + 288))(v21, v23);
v24 = *(__int64 **)(a1 + 736);
v25 = *v24;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v100,
(float)((float)(v98 * 0.5) + 220.0) - 10.0,
(float)((float)(v99 * 0.5) + 145.0) - 20.0);
(*(void (__fastcall **)(__int64 *, __int64))(v25 + 184))(v24, v26);
v27 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_backBtn_001.png");
v28 = CCMenuItemSpriteExtra::create(v27, 0, a1, (__int64)MessagesProfilePage::onClose);
*((_DWORD *)v28 + 93) = 1070386381;
v29 = cocos2d::CCMenu::create(v28, 0);
v30 = v98;
v31 = v29;
v32 = v99 * 0.5;
*(_QWORD *)(a1 + 552) = v29;
v33 = *(_QWORD *)v29;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v100,
(float)((float)(v30 * 0.5) - 220.0) + 10.0,
(float)(v32 + 145.0) - 10.0);
(*(void (__fastcall **)(struct cocos2d::CCMenu *, __int64))(v33 + 184))(v31, v34);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 552),
10);
v35 = LoadingCircle::create();
v36 = *(_QWORD *)(a1 + 584);
*(_QWORD *)(a1 + 760) = v35;
*((_QWORD *)v35 + 69) = v36;
*(_BYTE *)(*(_QWORD *)(a1 + 760) + 560LL) = 0;
cocos2d::CCObject::retain(*(cocos2d::CCObject **)(a1 + 760));
LoadingCircle::show(*(_QWORD *)(a1 + 760));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 760) + 336LL))(*(_QWORD *)(a1 + 760), 0);
v37 = *(__int64 **)(*(_QWORD *)(a1 + 760) + 544LL);
v38 = *v37;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v98 * 0.5, v99 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v38 + 184))(v37, v39);
if ( !*(_BYTE *)(a1 + 696) )
{
v40 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("accountBtn_messagessent_001.png");
v41 = CCMenuItemSpriteExtra::create(v40, 0, a1, (__int64)MessagesProfilePage::onSentMessages);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v41);
v42 = *(_QWORD *)v41;
v43 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v100,
(float)((float)(v98 * 0.5) + 220.0) - 10.0,
(float)((float)(v99 * 0.5) + 145.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v43, v97, v44);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v42 + 184))(v41, v45);
}
v46 = (float)(v98 * 0.5) - 220.0;
v47 = (float)((float)(v99 * 0.5) - 145.0) + 18.0;
v48 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("threadBtn_selectAll_001.png");
v49 = CCMenuItemSpriteExtra::create(v48, 0, a1, (__int64)MessagesProfilePage::onToggleAllObjects);
*((_DWORD *)v49 + 93) = 1068708659;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v49);
v50 = v47 + 3.0;
v51 = *(_QWORD *)v49;
v52 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v46 + 21.0, v50);
cocos2d::CCNode::convertToNodeSpace(v52, v97, v53);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v51 + 184))(v49, v54);
v55 = cocos2d::CCLabelBMFont::create(&byte_1406ED6E0, (const char *)&qword_140704F78);
*(_QWORD *)(a1 + 808) = v55;
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v55 + 160LL))(v55);
v56 = *(__int64 **)(a1 + 808);
v57 = *v56;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v46 + 52.0, v50);
(*(void (__fastcall **)(__int64 *, __int64))(v57 + 184))(v56, v58);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 808),
10);
v59 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("threadBtn_delete_001.png");
v60 = CCMenuItemSpriteExtra::create(v59, 0, a1, (__int64)MessagesProfilePage::onDeleteSelected);
*(_QWORD *)(a1 + 816) = v60;
*((_DWORD *)v60 + 93) = 1067030938;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 816));
v61 = *(__int64 **)(a1 + 816);
v62 = *(_QWORD *)(a1 + 552);
v63 = *v61;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v46 + 84.0, v50);
cocos2d::CCNode::convertToNodeSpace(v62, v97, v64);
(*(void (__fastcall **)(__int64 *, __int64))(v63 + 184))(v61, v65);
MessagesProfilePage::updateSelectUI(a1);
v67 = cocos2d::CCNotificationCenter::sharedNotificationCenter(v66);
cocos2d::CCNotificationCenter::addObserver(
v67,
a1,
MessagesProfilePage::onSelectionChanged,
"MessageSelectionChangedNotification",
0);
v68 = cocos2d::CCLabelBMFont::create((const char *)&xmmword_140726660, "goldFont.fnt");
v69 = *(_QWORD *)(a1 + 584);
*(_QWORD *)(a1 + 744) = v68;
(*(void (__fastcall **)(__int64, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)v69 + 456LL))(v69, v68, 10);
v70 = *(__int64 **)(a1 + 744);
v71 = *v70;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, v98 * 0.5, v99 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v71 + 184))(v70, v72);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 744) + 160LL))(*(_QWORD *)(a1 + 744));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 744) + 336LL))(*(_QWORD *)(a1 + 744), 0);
v73 = v99 * 0.5;
v74 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
LODWORD(v71) = (_DWORD)v74;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v74 + 160LL))(v74);
v75 = CCMenuItemSpriteExtra::create(v71, 0, a1, (__int64)MessagesProfilePage::onPrevPage);
v76 = *(_QWORD *)(a1 + 552);
*(_QWORD *)(a1 + 792) = v75;
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v76 + 464LL))(v76, v75);
v77 = *(__int64 **)(a1 + 792);
v78 = *(_QWORD *)(a1 + 552);
v79 = *v77;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, (float)(v98 * 0.5) - 195.0, v73);
cocos2d::CCNode::convertToNodeSpace(v78, v97, v80);
(*(void (__fastcall **)(__int64 *, __int64))(v79 + 184))(v77, v81);
*(_DWORD *)(*(_QWORD *)(a1 + 792) + 372LL) = 0x40000000;
v82 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v82, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v82 + 160LL))(v82);
v83 = CCMenuItemSpriteExtra::create((int)v82, 0, a1, (__int64)MessagesProfilePage::onNextPage);
v84 = *(_QWORD *)(a1 + 552);
*(_QWORD *)(a1 + 784) = v83;
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v84 + 464LL))(v84, v83);
v85 = *(__int64 **)(a1 + 784);
v86 = *(_QWORD *)(a1 + 552);
v87 = *v85;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v100, (float)(v98 * 0.5) + 195.0, v73);
cocos2d::CCNode::convertToNodeSpace(v86, v97, v88);
(*(void (__fastcall **)(__int64 *, __int64))(v87 + 184))(v85, v89);
*(_DWORD *)(*(_QWORD *)(a1 + 784) + 372LL) = 0x40000000;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 792) + 336LL))(*(_QWORD *)(a1 + 792), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 784) + 336LL))(*(_QWORD *)(a1 + 784), 0);
v90 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_updateBtn_001.png");
v91 = CCMenuItemSpriteExtra::create(v90, 0, a1, (__int64)MessagesProfilePage::onUpdate);
*(_QWORD *)(a1 + 800) = v91;
*((_DWORD *)v91 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 800));
v92 = *(__int64 **)(a1 + 800);
v93 = *(_QWORD *)(a1 + 552);
v94 = *v92;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v100,
(float)((float)(v98 * 0.5) + 220.0) - 10.0,
(float)((float)((float)(v99 * 0.5) - 145.0) + 10.0) + 1.0);
cocos2d::CCNode::convertToNodeSpace(v93, v97, v95);
(*(void (__fastcall **)(__int64 *, __int64))(v94 + 184))(v92, v96);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 800) + 336LL))(*(_QWORD *)(a1 + 800), 0);
MessagesProfilePage::loadPage(a1, 0);
return 1;
}
return result;
}