//
// GJMessagePopup::init from 0x5e0770 to 0x5e0e92 (1826 bytes)
//
// 1 xrefs:
// > GJMessagePopup::create @ 0x5e0f40
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:54:15 +0000
//
int __fastcall GJMessagePopup::init(GJMessagePopup *this, GJUserMessage *a2)
{
int v4; // r8
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *WinSize; // r0
int v7; // r0
int v8; // r3
int v9; // r6
void (__fastcall *v10)(int, _DWORD *); // r7
int (__fastcall *v11)(int, _DWORD *); // r7
cocos2d::CCMenu *v12; // r0
int v13; // r0
int v14; // r1
cocos2d::CCLabelBMFont *v15; // r0
int v16; // r6
void (__fastcall *v17)(int, _DWORD *); // r7
const char *v18; // r7
size_t v19; // r0
char *v20; // r1
size_t v21; // r2
const char *v22; // r2
cocos2d::CCLabelBMFont *v23; // r0
int v24; // r7
void (__fastcall *v25)(int, _DWORD *); // r10
int v26; // r11
LoadingCircle *v27; // r0
cocos2d::CCLayerColor *v28; // r0
int v29; // r3
int v30; // r7
void (__fastcall *v31)(int, _DWORD *); // r10
const char *v32; // r2
int v33; // r0
int v34; // r7
void (__fastcall *v35)(int, _DWORD *); // r10
const char *v36; // r1
int v37; // r5
int v38; // r0
int v39; // r7
const cocos2d::CCPoint *v40; // r11
void (__fastcall *v41)(int, _DWORD *); // r10
int v42; // r6
void (__fastcall *v43)(int, _DWORD *); // r3
int v44; // r6
const char *v45; // r1
const char *v46; // r1
cocos2d::CCString *v47; // r0
cocos2d::CCLabelBMFont *CString; // r0
const char *v49; // r2
int v50; // r6
void (__fastcall *v51)(int, _DWORD *); // r7
void (__fastcall *v52)(int, _DWORD *); // r7
int v53; // r5
int v54; // r5
const cocos2d::CCPoint *v55; // r11
void (__fastcall *v56)(int, _BYTE *); // r10
int v57; // r5
GameLevelManager *v58; // r0
GameLevelManager *v59; // r0
GameLevelManager *v60; // r0
float v62; // [sp+10h] [bp-94h] BYREF
float v63; // [sp+14h] [bp-90h]
_BYTE v64[8]; // [sp+18h] [bp-8Ch] BYREF
_BYTE v65[8]; // [sp+20h] [bp-84h] BYREF
_BYTE v66[8]; // [sp+28h] [bp-7Ch] BYREF
_BYTE v67[8]; // [sp+30h] [bp-74h] BYREF
int (__fastcall *v68)(GJMessagePopup *, cocos2d::CCObject *); // [sp+38h] [bp-6Ch]
int v69; // [sp+3Ch] [bp-68h]
int v70[2]; // [sp+40h] [bp-64h] BYREF
cocos2d::CCLabelBMFont *v71; // [sp+48h] [bp-5Ch]
int v72[3]; // [sp+4Ch] [bp-58h] BYREF
int v73[3]; // [sp+58h] [bp-4Ch] BYREF
int v74[3]; // [sp+64h] [bp-40h] BYREF
int v75[3]; // [sp+70h] [bp-34h] BYREF
_BYTE v76[16]; // [sp+7Ch] [bp-28h] BYREF
_DWORD v77[4]; // [sp+8Ch] [bp-18h] BYREF
if ( !a2 )
return 0;
v77[0] = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(this, v77);
if ( !v4 )
return 0;
FLAlertLayer::incrementForcePrio(this);
*((_DWORD *)this + 136) = a2;
cocos2d::CCObject::retain(a2);
(*(void (__fastcall **)(GJMessagePopup *, int))(*(_DWORD *)this + 500))(this, 1);
v5 = (cocos2d::CCDirector *)(*(int (__fastcall **)(GJMessagePopup *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v5);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v62);
v7 = cocos2d::CCLayer::create(WinSize);
v8 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v7;
(*(void (__fastcall **)(GJMessagePopup *, int))(v8 + 228))(this, v7);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v77, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v77);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v9 + 456))(v9, 255);
v10 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v77, 420.0, 240.0);
v10(v9, v77);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v9, -1);
v11 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77, v62 * 0.5, v63 * 0.5);
v12 = (cocos2d::CCMenu *)v11(v9, v77);
v13 = cocos2d::CCMenu::create(v12);
*((_DWORD *)this + 111) = v13;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v13, 10);
v14 = *((_DWORD *)this + 136);
*((_DWORD *)this + 125) = -1;
std::string::basic_string(v75, v14 + 276);
if ( (v75[0] & 1) != 0 )
v15 = (cocos2d::CCLabelBMFont *)v75[2];
else
v15 = (cocos2d::CCLabelBMFont *)((char *)v75 + 1);
v16 = cocos2d::CCLabelBMFont::create(v15, "bigFont.fnt", (const char *)(LOBYTE(v75[0]) << 31));
std::string::~string((int)v75);
v17 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v16 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77, v62 * 0.5, (float)((float)(v63 * 0.5) + 120.0) - 16.0);
v17(v16, v77);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v16);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v16 + 80))(v16, 1058642330);
if ( *(_BYTE *)(*((_DWORD *)this + 136) + 325) )
v18 = "To: ";
else
v18 = "From: ";
v70[0] = 0;
v70[1] = 0;
v71 = nullptr;
v19 = strlen(v18);
std::string::__init(v70, v18, v19);
std::string::basic_string(v72, *((_DWORD *)this + 136) + 300);
if ( (v72[0] & 1) != 0 )
{
v20 = (char *)v72[2];
v21 = v72[1];
}
else
{
v21 = (int)LOBYTE(v72[0]) >> 1;
v20 = (char *)v72 + 1;
}
std::string::append(v70, v20, v21);
std::string::~string((int)v72);
if ( (v70[0] & 1) != 0 )
v23 = v71;
else
v23 = (cocos2d::CCLabelBMFont *)((char *)v70 + 1);
v24 = cocos2d::CCLabelBMFont::create(v23, "goldFont.fnt", v22);
v25 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v24 + 92);
v26 = (*(int (__fastcall **)(int))(*(_DWORD *)v16 + 96))(v16);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, 0.0, -20.0);
cocos2d::CCPoint::operator+(v77, v26, v76);
v25(v24, v77);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v24);
v27 = (LoadingCircle *)(*(int (__fastcall **)(int, int))(*(_DWORD *)v24 + 80))(v24, 1058642330);
v28 = LoadingCircle::create(v27);
v29 = *((_DWORD *)this + 115);
*((_DWORD *)this + 137) = v28;
*((_DWORD *)v28 + 111) = v29;
*(_BYTE *)(*((_DWORD *)this + 137) + 448) = 0;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 137) + 80))(*((_DWORD *)this + 137), 1061997773);
LoadingCircle::show(*((cocos2d::CCNode ***)this + 137));
v30 = *(_DWORD *)(*((_DWORD *)this + 137) + 440);
v31 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v30 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77, v62 * 0.5, (float)(v63 * 0.5) - 4.0);
v31(v30, v77);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 137) + 172))(*((_DWORD *)this + 137), 0);
v33 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Something went wrong...", "goldFont.fnt", v32);
*((_DWORD *)this + 135) = v33;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v33, 10);
v34 = *((_DWORD *)this + 135);
v35 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v34 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77, v62 * 0.5, v63 * 0.5);
v35(v34, v77);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 135) + 80))(*((_DWORD *)this + 135), 1058642330);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 135) + 172))(*((_DWORD *)this + 135), 0);
v37 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v36);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v37 + 80))(v37, 1061997773);
v68 = GJMessagePopup::onClose;
v69 = 0;
v38 = CCMenuItemSpriteExtra::create(v37, 0, (int)this, (int)GJMessagePopup::onClose, 0);
*((_DWORD *)this + 138) = v38;
CCMenuItemSpriteExtra::setSizeMult(v38, 1.6);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
*((_DWORD *)this + 138));
v39 = *((_DWORD *)this + 138);
v40 = *((const cocos2d::CCPoint **)this + 111);
v41 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v39 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v76,
(float)((float)(v62 * 0.5) - 210.0) + 5.0,
(float)((float)(v63 * 0.5) + 120.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v77, v40);
v41(v39, v77);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, v62 * 0.5, v63 * 0.5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v76, 0.0, 0.0, 80.0, 80.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v77, (const cocos2d::CCRect *)v76);
v42 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v77);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v65, 370.0, 130.0);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v42 + 160))(v42, v65);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v42, -1);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v42 + 92))(v42, v64);
v43 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v42 + 480);
LOWORD(v77[0]) = 16514;
BYTE2(v77[0]) = 33;
v43(v42, v77);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v42 + 480))(v42, &unk_BEE20E);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v42 + 456))(v42, 75);
std::string::basic_string(v73, *((_DWORD *)this + 136) + 312);
if ( (v73[0] & 1) != 0 )
v44 = v73[1];
else
v44 = (int)LOBYTE(v73[0]) >> 1;
std::string::~string((int)v73);
if ( v44 )
{
std::string::basic_string(v74, *((_DWORD *)this + 136) + 312);
if ( (v74[0] & 1) != 0 )
v46 = (const char *)v74[2];
else
v46 = (char *)v74 + 1;
v47 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s ago",
v46,
LOBYTE(v74[0]) << 31);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v47);
v50 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt", v49);
std::string::~string((int)v74);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v50, 1);
v51 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v50 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77, 1.0, 0.5);
v51(v50, v77);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v50 + 80))(v50, 1058642330);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v50 + 536))(v50, &unk_BEE20E);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v50 + 512))(v50, 225);
v52 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v50 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v77,
(float)((float)(v62 * 0.5) + 210.0) - 8.0,
(float)((float)(v63 * 0.5) + 120.0) - 12.0);
v52(v50, v77);
}
if ( !*(_BYTE *)(*((_DWORD *)this + 136) + 325) )
{
v53 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_reportBtn_001.png", v45);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v53 + 80))(v53, 1058642330);
v77[0] = GJMessagePopup::onReport;
v77[1] = 0;
v54 = CCMenuItemSpriteExtra::create(v53, 0, (int)this, (int)GJMessagePopup::onReport, 0);
CCMenuItemSpriteExtra::setSizeMult(v54, 1.2);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v54);
v55 = *((const cocos2d::CCPoint **)this + 111);
v56 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v54 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v66,
(float)((float)(v62 * 0.5) - 210.0) + 10.0,
(float)((float)(v63 * 0.5) - 120.0) + 10.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v67, v55);
v56(v54, v67);
}
std::string::basic_string(v75, *((_DWORD *)this + 136) + 288);
if ( (v75[0] & 1) != 0 )
v57 = v75[1];
else
v57 = (int)LOBYTE(v75[0]) >> 1;
std::string::~string((int)v75);
if ( v57 )
{
GJMessagePopup::loadFromGJMessage((int)this, *((GJUserMessage **)this + 136));
}
else
{
v58 = (GameLevelManager *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 137) + 172))(
*((_DWORD *)this + 137),
1);
v59 = (GameLevelManager *)GameLevelManager::sharedState(v58);
*((_DWORD *)v59 + 226) = (char *)this + 532;
v60 = (GameLevelManager *)GameLevelManager::sharedState(v59);
GameLevelManager::downloadUserMessage(
v60,
*(const char **)(*((_DWORD *)this + 136) + 264),
*(unsigned __int8 *)(*((_DWORD *)this + 136) + 325));
}
std::string::~string((int)v70);
return v4;
}