//
// GJMessagePopup::init from 0x1403a3490 to 0x1403a3eb2 (2594 bytes)
//
// 2 xrefs:
// > GJMessagePopup::create @ 0x1403a3439
// > ??> @ 0x1409236a8
//
// 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:31:18 +0000
//
// Hidden C++ exception states: #wind=6
char __fastcall GJMessagePopup::init(__int64 a1, cocos2d::CCObject *a2)
{
__int64 v4; // rdx
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 *v10; // rdi
__int64 v11; // rdx
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rbx
__int64 v15; // rax
__int64 v16; // rcx
__int64 v17; // rax
const char *v18; // rcx
struct cocos2d::CCLabelBMFont *v19; // rsi
__int64 v20; // rbx
__int64 v21; // rax
int *v22; // rdx
size_t v23; // r8
void **v24; // rdx
void **v25; // rcx
struct cocos2d::CCLabelBMFont *v26; // rdi
__int64 v27; // rax
__int64 v28; // rbx
__int64 v29; // rax
cocos2d::CCLayerColor *v30; // rax
__int64 *v31; // rdi
__int64 v32; // rbx
__int64 v33; // rax
struct cocos2d::CCLabelBMFont *v34; // rax
__int64 v35; // rdi
__int64 v36; // rbx
__int64 v37; // rax
struct cocos2d::CCSprite *v38; // rax
cocos2d::CCObject *v39; // rax
__int64 v40; // rsi
__int64 v41; // rbx
__int64 v42; // rdi
__int64 v43; // rax
__int64 v44; // rax
__int64 v45; // rax
__int64 v46; // rbx
__int64 v47; // rdx
const char *v48; // rdx
cocos2d::CCString *v49; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v51; // rdi
__int64 v52; // rbx
__int64 v53; // rax
__int64 v54; // rdx
__int64 v55; // rbx
__int64 v56; // rax
struct cocos2d::CCSprite *v57; // rax
int v58; // ebx
cocos2d::CCObject *v59; // rsi
__int64 v60; // rdi
__int64 v61; // rbx
__int64 v62; // rax
__int64 v63; // rax
bool v64; // bl
__int64 v65; // rdx
__int64 v66; // rcx
void *v67; // rcx
int v69; // [rsp+38h] [rbp-D0h] BYREF
float v70; // [rsp+40h] [rbp-C8h] BYREF
float v71; // [rsp+44h] [rbp-C4h]
_BYTE v72[8]; // [rsp+48h] [rbp-C0h] BYREF
_BYTE v73[8]; // [rsp+50h] [rbp-B8h] BYREF
_BYTE v74[16]; // [rsp+58h] [rbp-B0h] BYREF
void *v75[4]; // [rsp+68h] [rbp-A0h] BYREF
_QWORD v76[2]; // [rsp+88h] [rbp-80h] BYREF
__int64 v77; // [rsp+98h] [rbp-70h]
unsigned __int64 v78; // [rsp+A0h] [rbp-68h]
void *Block[2]; // [rsp+A8h] [rbp-60h] BYREF
__int64 v80; // [rsp+B8h] [rbp-50h]
unsigned __int64 v81; // [rsp+C0h] [rbp-48h]
if ( !a2 )
return 0;
v69 = -1778384896;
if ( !cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)&v69) )
return 0;
FLAlertLayer::incrementForcePrio((struct cocos2d::CCObject *)a1);
*(_QWORD *)(a1 + 712) = a2;
cocos2d::CCObject::retain(a2);
LOBYTE(v4) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 920LL))(a1, v4);
LOBYTE(v5) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v5);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v70);
v8 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 584) = v8;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v8);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v75, 0.0, 0.0, 80.0, 80.0);
v10 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v9);
LOBYTE(v11) = -1;
(*(void (__fastcall **)(__int64 *, __int64))(v10[40] + 40))(v10 + 40, v11);
v12 = *v10;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v69, 420.0, 240.0);
(*(void (__fastcall **)(__int64 *, __int64))(v12 + 312))(v10, v13);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v10,
0xFFFFFFFFLL);
v14 = *v10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v69, v70 * 0.5, v71 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v14 + 184))(v10, v15);
v17 = cocos2d::CCMenu::create(v16);
*(_QWORD *)(a1 + 552) = v17;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v17, 10);
*(_DWORD *)(a1 + 640) = -1;
sub_14003F4F0((__int64)v76, *(_QWORD *)(a1 + 712) + 336LL);
v18 = (const char *)v76;
if ( v78 > 0xF )
v18 = (const char *)v76[0];
v19 = cocos2d::CCLabelBMFont::create(v18, (const char *)&qword_140704F78);
sub_14003D310((__int64)v76);
v20 = *(_QWORD *)v19;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v69, v70 * 0.5, (float)((float)(v71 * 0.5) + 120.0) - 16.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v20 + 184))(v19, v21);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v19);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v19 + 160LL))(v19);
v22 = &dword_1407285AC;
if ( *(_BYTE *)(*(_QWORD *)(a1 + 712) + 465LL) )
v22 = (int *)"To: ";
*(_OWORD *)Block = 0;
v80 = 0;
v81 = 0;
v23 = -1;
do
++v23;
while ( *((_BYTE *)v22 + v23) );
sub_14003D230(Block, v22, v23);
sub_14003F4F0((__int64)v75, *(_QWORD *)(a1 + 712) + 400LL);
v24 = v75;
if ( v75[3] > (void *)0xF )
v24 = (void **)v75[0];
sub_140044D80(Block, v24, (size_t)v75[2]);
sub_14003D310((__int64)v75);
v25 = Block;
if ( v81 > 0xF )
v25 = (void **)Block[0];
v26 = cocos2d::CCLabelBMFont::create((const char *)v25, "goldFont.fnt");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, 0.0, -20.0);
v28 = v27;
v29 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v19 + 200LL))(v19);
cocos2d::CCPoint::operator+(v29, &v69, v28);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, int *))(*(_QWORD *)v26 + 184LL))(v26, &v69);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v26);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v26 + 160LL))(v26);
v30 = LoadingCircle::create();
*(_QWORD *)(a1 + 720) = v30;
*((_QWORD *)v30 + 69) = *(_QWORD *)(a1 + 584);
*(_BYTE *)(*(_QWORD *)(a1 + 720) + 560LL) = 0;
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 720) + 160LL))(*(_QWORD *)(a1 + 720));
LoadingCircle::show(*(_QWORD *)(a1 + 720));
v31 = *(__int64 **)(*(_QWORD *)(a1 + 720) + 544LL);
v32 = *v31;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v70 * 0.5, (float)(v71 * 0.5) - 4.0);
(*(void (__fastcall **)(__int64 *, __int64))(v32 + 184))(v31, v33);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 720) + 336LL))(*(_QWORD *)(a1 + 720), 0);
v34 = cocos2d::CCLabelBMFont::create((const char *)&xmmword_140726660, "goldFont.fnt");
*(_QWORD *)(a1 + 704) = v34;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v34,
10);
v35 = **(_QWORD **)(a1 + 704);
v36 = *(_QWORD *)(a1 + 704);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v70 * 0.5, v71 * 0.5);
(*(void (__fastcall **)(__int64, __int64))(v35 + 184))(v36, v37);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 704) + 160LL))(*(_QWORD *)(a1 + 704));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 704) + 336LL))(*(_QWORD *)(a1 + 704), 0);
v38 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
LODWORD(v36) = (_DWORD)v38;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v38 + 160LL))(v38);
v39 = CCMenuItemSpriteExtra::create(v36, 0, a1, (__int64)PagedListPopup::onClose);
*(_QWORD *)(a1 + 728) = v39;
*((_DWORD *)v39 + 93) = 1070386381;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 728));
v40 = **(_QWORD **)(a1 + 728);
v41 = *(_QWORD *)(a1 + 552);
v42 = *(_QWORD *)(a1 + 728);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v75,
(float)((float)(v70 * 0.5) - 210.0) + 5.0,
(float)((float)(v71 * 0.5) + 120.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(v41, &v69, v43);
(*(void (__fastcall **)(__int64, __int64))(v40 + 184))(v42, v44);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v73, v70 * 0.5, v71 * 0.5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v74, 0.0, 0.0, 80.0, 80.0);
v45 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v75, (const struct cocos2d::CCRect *)v74);
v46 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v45);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v72, 370.0, 130.0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v46 + 312LL))(v46, v72);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v46,
0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v46 + 184LL))(v46, v73);
LOWORD(v69) = 16514;
BYTE2(v69) = 33;
v46 += 320;
(**(void (__fastcall ***)(__int64, int *))v46)(v46, &v69);
(**(void (__fastcall ***)(__int64, void *))v46)(v46, &unk_1407034A8);
LOBYTE(v47) = 75;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v46 + 40LL))(v46, v47);
sub_14003F4F0((__int64)v76, *(_QWORD *)(a1 + 712) + 432LL);
LOBYTE(v46) = v77 != 0;
sub_14003D310((__int64)v76);
if ( (_BYTE)v46 )
{
sub_14003F4F0((__int64)v76, *(_QWORD *)(a1 + 712) + 432LL);
v48 = (const char *)v76;
if ( v78 > 0xF )
v48 = (const char *)v76[0];
v49 = cocos2d::CCString::createWithFormat("%s ago", v48);
CString = cocos2d::CCString::getCString(v49);
v51 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt");
sub_14003D310((__int64)v76);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v51,
1);
v52 = *(_QWORD *)v51;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, 1.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v52 + 288))(v51, v53);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v51 + 160LL))(v51);
(**((void (__fastcall ***)(__int64, void *))v51 + 46))((__int64)v51 + 368, &unk_1407034A8);
LOBYTE(v54) = -31;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v51 + 46) + 40LL))((__int64)v51 + 368, v54);
v55 = *(_QWORD *)v51;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v75,
(float)((float)(v70 * 0.5) + 210.0) - 8.0,
(float)((float)(v71 * 0.5) + 120.0) - 12.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v55 + 184))(v51, v56);
}
if ( !*(_BYTE *)(*(_QWORD *)(a1 + 712) + 465LL) )
{
v57 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_reportBtn_001.png");
v58 = (int)v57;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v57 + 160LL))(v57);
v59 = CCMenuItemSpriteExtra::create(v58, 0, a1, (__int64)GJMessagePopup::onReport);
*((_DWORD *)v59 + 93) = 1067030938;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v59);
v60 = *(_QWORD *)v59;
v61 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v75,
(float)((float)(v70 * 0.5) - 210.0) + 10.0,
(float)((float)(v71 * 0.5) - 120.0) + 10.0);
cocos2d::CCNode::convertToNodeSpace(v61, &v69, v62);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v60 + 184))(v59, v63);
}
sub_14003F4F0((__int64)v76, *(_QWORD *)(a1 + 712) + 368LL);
v64 = v77 != 0;
sub_14003D310((__int64)v76);
if ( v64 )
{
GJMessagePopup::loadFromGJMessage(a1, *(_QWORD *)(a1 + 712));
}
else
{
LOBYTE(v65) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 720) + 336LL))(*(_QWORD *)(a1 + 720), v65);
v66 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v75[0] = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v75[0]);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v66 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v66 + 1520) = a1 + 688;
GameLevelManager::downloadUserMessage(
(cocos2d::CCActionManager **)v66,
*(_DWORD *)(*(_QWORD *)(a1 + 712) + 320LL),
*(_BYTE *)(*(_QWORD *)(a1 + 712) + 465LL));
}
if ( v81 > 0xF )
{
v67 = Block[0];
if ( v81 + 1 >= 0x1000 )
{
v67 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v67 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v67);
}
return 1;
}