//
// GJMessagePopup::loadFromGJMessage from 0x1403a3ec0 to 0x1403a44cb (1547 bytes)
//
// 3 xrefs:
// > GJMessagePopup::init @ 0x1403a3d9d
// > GJMessagePopup::downloadMessageFinished @ 0x1403a4b77
// > ??> @ 0x1409236b4
//
// 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
void __fastcall GJMessagePopup::loadFromGJMessage(__int64 a1, cocos2d::CCObject *a2, __int64 a3, double a4)
{
cocos2d::CCObject *v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
unsigned __int64 v9; // rdi
bool v10; // bl
__m128i v11; // xmm6
void **v12; // rdx
size_t v13; // r8
__int64 v14; // rdx
__int64 v15; // rcx
__int64 v16; // r8
int v17; // ebx
const struct cocos2d::CCPoint *v18; // rax
float *v19; // rdi
__int64 v20; // rax
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rcx
cocos2d::CCArray *v25; // rdi
cocos2d::CCObject *v26; // rbx
struct cocos2d::CCObject *v27; // rbx
cocos2d::CCObject *v28; // rbx
struct cocos2d::CCObject *v29; // rbx
cocos2d::CCObject *v30; // rbx
struct cocos2d::CCObject *v31; // rbx
__int64 v32; // rax
void *v33; // rcx
void *v34; // [rsp+50h] [rbp-69h] BYREF
__int128 *v35; // [rsp+58h] [rbp-61h] BYREF
float v36[2]; // [rsp+60h] [rbp-59h] BYREF
void *Block[2]; // [rsp+68h] [rbp-51h] BYREF
__m128i v38; // [rsp+78h] [rbp-41h]
char v39[8]; // [rsp+88h] [rbp-31h] BYREF
char v40[8]; // [rsp+90h] [rbp-29h] BYREF
char v41[8]; // [rsp+98h] [rbp-21h] BYREF
__int128 v42; // [rsp+A0h] [rbp-19h] BYREF
__m128i v43; // [rsp+B0h] [rbp-9h]
if ( a2 )
{
cocos2d::CCObject::retain(a2);
v6 = *(cocos2d::CCObject **)(a1 + 712);
if ( v6 )
cocos2d::CCObject::release(v6);
*(_QWORD *)(a1 + 712) = a2;
v7 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v35 = (__int128 *)operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v35);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v7 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v7 + 1488) = a1 + 664;
v8 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v8, v36);
Block[1] = (void *)25959;
v38.m128i_i64[0] = 10;
v9 = 15;
v38.m128i_i64[1] = 15;
Block[0] = (void *)0x617373656D206F4ELL;
sub_14003F4F0((__int64)&v42, *(_QWORD *)(a1 + 712) + 368LL);
v10 = v43.m128i_i64[0] != 0;
sub_14003D310((__int64)&v42);
if ( v10 )
{
sub_14003F4F0((__int64)&v42, *(_QWORD *)(a1 + 712) + 368LL);
*(_OWORD *)Block = v42;
v11 = v43;
v38 = v43;
v43.m128i_i64[0] = 0;
v43.m128i_i64[1] = 15;
LOBYTE(v42) = 0;
sub_14003D310((__int64)&v42);
v9 = _mm_srli_si128(v11, 8).m128i_u64[0];
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v36[0] * 0.5, (float)(v36[1] * 0.5) - 4.0);
v35 = &v42;
v12 = Block;
if ( v9 > 0xF )
v12 = (void **)Block[0];
v42 = 0;
v43 = 0u;
v13 = -1;
do
++v13;
while ( *((_BYTE *)v12 + v13) );
sub_14003D230(&v42, v12, v13);
ensureEmotesAreLoaded(v15, v14, v16, a4);
v17 = dword_1408FE394;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v41, 0.0, 0.5);
v19 = (float *)TextArea::create((__int64)&v42, "chatFont.fnt", 1.0, 319.0, v18, 1101004800, 1, v17);
(*(void (__fastcall **)(_QWORD, float *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v19, 6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, 0.0, 2.0);
cocos2d::CCPoint::operator+(v39, &v35, v20);
(*(void (__fastcall **)(float *, __int128 **))(*(_QWORD *)v19 + 184LL))(v19, &v35);
v21 = *(_QWORD *)v19;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, 0.0, 0.5);
(*(void (__fastcall **)(float *, __int64))(v21 + 288))(v19, v22);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, (float)((float)(370.0 - v19[174]) * 0.5) - 185.0, 4.0);
cocos2d::CCPoint::operator+(v39, &v35, v23);
(*(void (__fastcall **)(float *, __int128 **))(*(_QWORD *)v19 + 184LL))(v19, &v35);
(*(void (__fastcall **)(float *))(*(_QWORD *)v19 + 160LL))(v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, 0.0, -98.0);
v25 = (cocos2d::CCArray *)cocos2d::CCArray::create(v24);
if ( !*(_BYTE *)(*(_QWORD *)(a1 + 712) + 465LL) )
{
v34 = operator new(0x2C8u);
v26 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v34);
if ( v26 )
{
if ( ButtonSprite::init_1(
(__int64)v26,
(__int64)"Reply",
80,
0,
1057803469,
1,
&qword_140704F78,
(__int64)"GJ_button_01.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v26);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v26 + 8LL))(v26, 1);
LODWORD(v26) = 0;
}
}
v27 = CCMenuItemSpriteExtra::create((int)v26, 0, a1, (__int64)GJMessagePopup::onNewThread);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v27);
cocos2d::CCArray::addObject(v25, v27);
}
v34 = operator new(0x2C8u);
v28 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v34);
if ( v28 )
{
if ( ButtonSprite::init_1(
(__int64)v28,
(__int64)"Remove",
65,
0,
1057803469,
1,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v28);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v28 + 8LL))(v28, 1);
LODWORD(v28) = 0;
}
}
v29 = CCMenuItemSpriteExtra::create((int)v28, 0, a1, (__int64)GJMessagePopup::onRemove);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v29);
cocos2d::CCArray::addObject(v25, v29);
if ( !*(_BYTE *)(*(_QWORD *)(a1 + 712) + 465LL) )
{
v34 = operator new(0x2C8u);
v30 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v34);
if ( v30 )
{
if ( ButtonSprite::init_1(
(__int64)v30,
(__int64)"Block",
65,
0,
1057803469,
1,
&qword_140704F78,
(__int64)"GJ_button_06.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v30);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v30 + 8LL))(v30, 1);
LODWORD(v30) = 0;
}
}
v31 = CCMenuItemSpriteExtra::create((int)v30, 0, a1, (__int64)GJMessagePopup::onBlock);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v31);
cocos2d::CCArray::addObject(v25, v31);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, (const struct cocos2d::CCPoint *)v40);
GameToolbox::alignItemsHorisontally((__int64)v25, 35.0, v32, 0);
if ( v38.m128i_i64[1] > 0xFuLL )
{
v33 = Block[0];
if ( (unsigned __int64)(v38.m128i_i64[1] + 1) >= 0x1000 )
{
v33 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v33 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v33);
}
}
}