//
// GJMessagePopup::init from 0xa33624 to 0xa340d8 (2740 bytes)
//
// 2 xrefs:
// > GJMessagePopup::create @ 0xa3426c
// > ??> @ 0xb2930
//
// This function is hookable on this platform (idp: arm, 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 12:59:49 +0000
//
__int64 __fastcall GJMessagePopup::init(GJMessagePopup *this, GJUserMessage *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w23
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v10; // x0
__int64 v11; // x22
void (__fastcall *v12)(__int64, __int64 *); // x25
__int64 (__fastcall *v13)(__int64, __int64 *); // x25
cocos2d::CCMenu *v14; // x0
__int64 v15; // x0
__int64 v16; // x0
const char *v17; // x2
__int64 v18; // x1
cocos2d::CCLabelBMFont *v19; // x0
__int64 v20; // x22
void (__fastcall *v21)(__int64, __int64 *); // x25
const char *v22; // x1
size_t v23; // x0
__int64 v24; // x0
__int64 v25; // x2
__int64 v26; // x0
size_t v27; // x1
char *v28; // x1
size_t v29; // x2
const char *v30; // x2
cocos2d::CCLabelBMFont *v31; // x0
__int64 v32; // x25
void (__fastcall *v33)(__int64, __int64 *); // x27
__int64 v34; // x28
LoadingCircle *v35; // x0
__int64 v36; // x0
__int64 v37; // x25
void (__fastcall *v38)(__int64, __int64 *); // x27
const char *v39; // x2
__int64 v40; // x0
__int64 v41; // x3
__int64 v42; // x25
void (__fastcall *v43)(__int64, __int64 *); // x26
const char *v44; // x1
__int64 v45; // x25
__int64 v46; // x0
__int64 v47; // x25
cocos2d::CCNode *v48; // x27
void (__fastcall *v49)(__int64, __int64 *); // x26
__int64 v50; // x22
void (__fastcall *v51)(__int64, __int64 *); // x2
__int64 v52; // x0
__int64 v53; // x2
__int64 v54; // x0
__int64 v55; // x1
__int64 v56; // x22
__int64 v57; // x0
__int64 v58; // x2
__int64 v59; // x0
__int64 v60; // x1
char *v61; // x1
cocos2d::CCString *v62; // x0
cocos2d::CCLabelBMFont *CString; // x0
const char *v64; // x2
__int64 v65; // x22
void (__fastcall *v66)(__int64, __int64 *); // x26
void (__fastcall *v67)(__int64, __int64 *); // x25
__int64 v68; // x0
__int64 v69; // x1
__int64 v70; // x20
GameLevelManager *v71; // x0
GameLevelManager *v72; // x0
GameLevelManager *v73; // x0
__int64 v74; // x22
__int64 v75; // x22
void (__fastcall *v76)(__int64, __int64 *); // x26
cocos2d::CCNode *v77; // x27
char *v78; // [xsp+88h] [xbp+88h]
__int64 v79; // [xsp+90h] [xbp+90h] BYREF
_BYTE v80[8]; // [xsp+98h] [xbp+98h] BYREF
_BYTE v81[8]; // [xsp+A0h] [xbp+A0h] BYREF
_BYTE v82[8]; // [xsp+A8h] [xbp+A8h] BYREF
_BYTE v83[16]; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v84[2]; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v85[2]; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCLabelBMFont *v86; // [xsp+E0h] [xbp+E0h]
__int64 v87; // [xsp+E8h] [xbp+E8h] BYREF
size_t v88; // [xsp+F0h] [xbp+F0h]
void *v89; // [xsp+F8h] [xbp+F8h]
__int64 v90; // [xsp+100h] [xbp+100h] BYREF
__int64 v91; // [xsp+108h] [xbp+108h]
void *v92; // [xsp+110h] [xbp+110h]
__int64 v93; // [xsp+118h] [xbp+118h] BYREF
__int64 v94; // [xsp+120h] [xbp+120h]
char *v95; // [xsp+128h] [xbp+128h]
__int64 v96; // [xsp+130h] [xbp+130h] BYREF
__int64 v97; // [xsp+138h] [xbp+138h]
void *v98; // [xsp+140h] [xbp+140h]
if ( a2 && (LODWORD(v84[0]) = -1778384896, v4 = cocos2d::CCLayerColor::initWithColor(this, v84), (v5 = v4) != 0) )
{
FLAlertLayer::incrementForcePrio(this);
*((_QWORD *)this + 89) = a2;
cocos2d::CCObject::retain(a2);
(*(void (__fastcall **)(GJMessagePopup *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v7 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(GJMessagePopup *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v79, v8);
v10 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v10;
(*(void (__fastcall **)(GJMessagePopup *, __int64))(*(_QWORD *)this + 456LL))(this, v10);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v84, 0.0, 0.0, 80.0, 80.0);
v11 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v84);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 912LL))(v11, 0xFFFFFFFFLL);
v12 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v84, 420.0, 240.0);
v12(v11, v84);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v11,
0xFFFFFFFFLL);
v13 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, *(float *)&v79 * 0.5, *((float *)&v79 + 1) * 0.5);
v14 = (cocos2d::CCMenu *)v13(v11, v84);
v15 = cocos2d::CCMenu::create(v14);
*((_QWORD *)this + 69) = v15;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v15,
10);
v96 = 0;
v16 = *((_QWORD *)this + 89);
v97 = 0;
*((_DWORD *)this + 160) = -1;
v17 = (const char *)(v16 + 328);
v98 = nullptr;
if ( (*(_BYTE *)(v16 + 328) & 1) != 0 )
{
std::string::__init(&v96, *(void **)(v16 + 344), *(_QWORD *)(v16 + 336));
}
else
{
v18 = *(_QWORD *)(v16 + 336);
v96 = *(_QWORD *)v17;
v97 = v18;
v98 = *(void **)(v16 + 344);
}
v19 = (cocos2d::CCLabelBMFont *)((char *)&v96 + 1);
if ( (v96 & 1) != 0 )
v19 = (cocos2d::CCLabelBMFont *)v98;
v20 = cocos2d::CCLabelBMFont::create(v19, "bigFont.fnt", v17);
if ( (v96 & 1) != 0 )
operator delete(v98);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v84,
*(float *)&v79 * 0.5,
(float)((float)(*((float *)&v79 + 1) * 0.5) + 120.0) - 16.0);
v21(v20, v84);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v20);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, 0.6);
if ( *(_BYTE *)(*((_QWORD *)this + 89) + 425LL) )
v22 = "To: ";
else
v22 = "From: ";
v78 = (char *)v22;
v85[0] = 0;
v85[1] = 0;
v86 = nullptr;
v23 = strlen(v22);
std::string::__init(v85, v78, v23);
v87 = 0;
v24 = *((_QWORD *)this + 89);
v88 = 0;
v25 = v24 + 376;
v89 = nullptr;
if ( (*(_BYTE *)(v24 + 376) & 1) != 0 )
{
std::string::__init(&v87, *(void **)(v24 + 392), *(_QWORD *)(v24 + 384));
}
else
{
v26 = *(_QWORD *)v25;
v27 = *(_QWORD *)(v25 + 8);
v89 = *(void **)(v25 + 16);
v87 = v26;
v88 = v27;
}
if ( (v87 & 1) != 0 )
{
v28 = (char *)v89;
v29 = v88;
}
else
{
v29 = (unsigned __int8)v87 >> 1;
v28 = (char *)&v87 + 1;
}
std::string::append((__int64)v85, v28, v29);
if ( (v87 & 1) != 0 )
operator delete(v89);
v31 = (cocos2d::CCLabelBMFont *)((char *)v85 + 1);
if ( (v85[0] & 1) != 0 )
v31 = v86;
v32 = cocos2d::CCLabelBMFont::create(v31, "goldFont.fnt", v30);
v33 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v32 + 184LL);
v34 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 192LL))(v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v83, 0.0, -20.0);
cocos2d::CCPoint::operator+(v84, v34);
v33(v32, v84);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v32);
v35 = (LoadingCircle *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v32 + 160LL))(v32, 0.6);
v36 = LoadingCircle::create(v35);
*((_QWORD *)this + 90) = v36;
*(_QWORD *)(v36 + 552) = *((_QWORD *)this + 73);
*(_BYTE *)(*((_QWORD *)this + 90) + 560LL) = 0;
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 90) + 160LL))(*((_QWORD *)this + 90), 0.8);
LoadingCircle::show(*((cocos2d::CCNode ***)this + 90));
v37 = *(_QWORD *)(*((_QWORD *)this + 90) + 544LL);
v38 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v37 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, *(float *)&v79 * 0.5, (float)(*((float *)&v79 + 1) * 0.5) + -4.0);
v38(v37, v84);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 90) + 344LL))(*((_QWORD *)this + 90), 0);
v40 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Something went wrong...", "goldFont.fnt", v39);
v41 = *((_QWORD *)this + 73);
*((_QWORD *)this + 88) = v40;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v41 + 464LL))(v41, v40, 10);
v42 = *((_QWORD *)this + 88);
v43 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v42 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, *(float *)&v79 * 0.5, *((float *)&v79 + 1) * 0.5);
v43(v42, v84);
(*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 88) + 160LL))(*((_QWORD *)this + 88), 0.6);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 88) + 344LL))(*((_QWORD *)this + 88), 0);
v45 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v44);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v45 + 160LL))(v45, 0.8);
v46 = CCMenuItemSpriteExtra::create(v45, 0, (__int64)this, (__int64)GJMessagePopup::onClose, 0);
*((_QWORD *)this + 91) = v46;
CCMenuItemSpriteExtra::setSizeMult(v46, 1.6);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 69) + 456LL))(
*((_QWORD *)this + 69),
*((_QWORD *)this + 91));
v47 = *((_QWORD *)this + 91);
v48 = *((cocos2d::CCNode **)this + 69);
v49 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v83,
(float)((float)(*(float *)&v79 * 0.5) + -210.0) + 5.0,
(float)((float)(*((float *)&v79 + 1) * 0.5) + 120.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(v84, v48, (const cocos2d::CCPoint *)v83);
v49(v47, v84);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v80, *(float *)&v79 * 0.5, *((float *)&v79 + 1) * 0.5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v83, 0.0, 0.0, 80.0, 80.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v84, (const cocos2d::CCRect *)v83);
v50 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v84);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v81, 370.0, 130.0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v50 + 320LL))(v50, v81);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v50,
0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v50 + 184LL))(v50, v80);
v51 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v50 + 960LL);
LOWORD(v84[0]) = 16514;
BYTE2(v84[0]) = 33;
v51(v50, v84);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v50 + 960LL))(v50, &unk_116D890);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v50 + 912LL))(v50, 75);
v52 = *((_QWORD *)this + 89);
v90 = 0;
v53 = v52 + 400;
v91 = 0;
LOBYTE(v52) = *(_BYTE *)(v52 + 400);
v92 = nullptr;
if ( (v52 & 1) != 0 )
{
std::string::__init(&v90, *(void **)(v53 + 16), *(_QWORD *)(v53 + 8));
}
else
{
v54 = *(_QWORD *)v53;
v55 = *(_QWORD *)(v53 + 8);
v92 = *(void **)(v53 + 16);
v90 = v54;
v91 = v55;
}
v56 = (unsigned __int8)v90 >> 1;
if ( (v90 & 1) != 0 )
{
v56 = v91;
operator delete(v92);
}
if ( v56 )
{
v57 = *((_QWORD *)this + 89);
v93 = 0;
v58 = v57 + 400;
v94 = 0;
LOBYTE(v57) = *(_BYTE *)(v57 + 400);
v95 = nullptr;
if ( (v57 & 1) != 0 )
{
std::string::__init(&v93, *(void **)(v58 + 16), *(_QWORD *)(v58 + 8));
}
else
{
v59 = *(_QWORD *)v58;
v60 = *(_QWORD *)(v58 + 8);
v95 = *(char **)(v58 + 16);
v93 = v59;
v94 = v60;
}
v61 = (char *)&v93 + 1;
if ( (v93 & 1) != 0 )
v61 = v95;
v62 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%s ago", v61);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v62);
v65 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt", v64);
if ( (v93 & 1) != 0 )
operator delete(v95);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v65,
1);
v66 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v65 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v84, 1.0, 0.5);
v66(v65, v84);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v65 + 160LL))(v65, 0.6);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v65 + 1072LL))(v65, &unk_116D890);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v65 + 1024LL))(v65, 4294967265LL);
v67 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v65 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v84,
(float)((float)(*(float *)&v79 * 0.5) + 210.0) - 8.0,
(float)((float)(*((float *)&v79 + 1) * 0.5) + 120.0) - 12.0);
v67(v65, v84);
}
v68 = *((_QWORD *)this + 89);
if ( !*(_BYTE *)(v68 + 425) )
{
v74 = cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_reportBtn_001.png",
(const char *)*(unsigned __int8 *)(v68 + 425));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v74 + 160LL))(v74, 0.6);
v75 = CCMenuItemSpriteExtra::create(v74, 0, (__int64)this, (__int64)GJMessagePopup::onReport, 0);
CCMenuItemSpriteExtra::setSizeMult(v75, 1.2);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v75);
v76 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v75 + 184LL);
v77 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v82,
(float)((float)(*(float *)&v79 * 0.5) + -210.0) + 10.0,
(float)((float)(*((float *)&v79 + 1) * 0.5) + -120.0) + 10.0);
cocos2d::CCNode::convertToNodeSpace(v84, v77, (const cocos2d::CCPoint *)v82);
v76(v75, v84);
v68 = *((_QWORD *)this + 89);
}
v96 = 0;
v97 = 0;
v98 = nullptr;
if ( (*(_BYTE *)(v68 + 352) & 1) != 0 )
{
std::string::__init(&v96, *(void **)(v68 + 368), *(_QWORD *)(v68 + 360));
}
else
{
v69 = *(_QWORD *)(v68 + 360);
v96 = *(_QWORD *)(v68 + 352);
v97 = v69;
v98 = *(void **)(v68 + 368);
}
v70 = (unsigned __int8)v96 >> 1;
if ( (v96 & 1) != 0 )
{
v70 = v97;
operator delete(v98);
}
if ( v70 )
{
GJMessagePopup::loadFromGJMessage(this, *((GJUserMessage **)this + 89));
}
else
{
v71 = (GameLevelManager *)(*(__int64 (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 90) + 344LL))(
*((_QWORD *)this + 90),
1);
v72 = (GameLevelManager *)GameLevelManager::sharedState(v71);
*((_QWORD *)v72 + 174) = (char *)this + 688;
v73 = (GameLevelManager *)GameLevelManager::sharedState(v72);
GameLevelManager::downloadUserMessage(
v73,
(const char *)*(unsigned int *)(*((_QWORD *)this + 89) + 316LL),
*(_BYTE *)(*((_QWORD *)this + 89) + 425LL));
}
if ( (v85[0] & 1) != 0 )
operator delete(v86);
}
else
{
return 0;
}
return v5;
}