//
// GJWriteMessagePopup::onSend from 0xa28bec to 0xa28f04 (792 bytes)
//
// 3 xrefs:
// > ??> @ 0xa0cf0
// > GJWriteMessagePopup::init @ 0xa324a8
// > ??> @ 0x1544798
//
// 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:43 +0000
//
__int64 __fastcall GJWriteMessagePopup::onSend(GJWriteMessagePopup *this, cocos2d::CCObject *a2)
{
char *v3; // x21
__int64 v4; // x1
GameLevelManager *v5; // x0
__int64 v6; // x1
GameLevelManager *v7; // x0
GameLevelManager *v8; // x25
char v9; // w0
unsigned int v10; // w24
__int64 v11; // x0
__int64 v12; // x1
__int64 v13; // x0
__int64 v14; // x1
__int64 v15; // x0
char v16; // w1
__int64 v18; // x0
__int64 v19; // x19
char v20; // w0
__int64 v21; // [xsp+58h] [xbp+58h] BYREF
__int64 v22; // [xsp+60h] [xbp+60h]
void *v23; // [xsp+68h] [xbp+68h]
__int64 v24; // [xsp+70h] [xbp+70h] BYREF
__int64 v25; // [xsp+78h] [xbp+78h]
void *v26; // [xsp+80h] [xbp+80h]
v3 = (char *)this + 744;
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 88) + 1160LL))(*((_QWORD *)this + 88), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 89) + 1160LL))(*((_QWORD *)this + 89), 0);
v4 = *((_BYTE *)this + 744) >> 1;
if ( (*((_BYTE *)this + 744) & 1) != 0 )
v4 = *((_QWORD *)v3 + 1);
if ( v4 )
{
v5 = (GameLevelManager *)*((unsigned __int8 *)this + 720);
v6 = (unsigned __int8)v5 >> 1;
if ( ((unsigned __int8)v5 & 1) != 0 )
v6 = *((_QWORD *)this + 91);
if ( v6 )
{
v7 = (GameLevelManager *)GameLevelManager::sharedState(v5);
*((_QWORD *)v7 + 175) = (char *)this + 664;
v8 = (GameLevelManager *)GameLevelManager::sharedState(v7);
v9 = *((_BYTE *)this + 744);
v21 = 0;
v22 = 0;
v23 = nullptr;
v10 = *((_DWORD *)this + 173);
if ( (v9 & 1) != 0 )
{
std::string::__init(&v21, *((void **)v3 + 2), *((_QWORD *)v3 + 1));
v24 = 0;
v20 = *((_BYTE *)this + 720);
v25 = 0;
v26 = nullptr;
if ( (v20 & 1) == 0 )
goto LABEL_9;
}
else
{
v11 = *(_QWORD *)v3;
v12 = *((_QWORD *)v3 + 1);
v23 = *((void **)v3 + 2);
v21 = v11;
v22 = v12;
LOBYTE(v11) = *((_BYTE *)this + 720);
v24 = 0;
v25 = 0;
v26 = nullptr;
if ( (v11 & 1) == 0 )
{
LABEL_9:
v13 = *((_QWORD *)this + 90);
v14 = *((_QWORD *)this + 91);
v26 = *((void **)this + 92);
v24 = v13;
v25 = v14;
LABEL_10:
GameLevelManager::uploadUserMessage(v8, (const char *)v10, (char *)&v21, (__int64)&v24);
if ( (v24 & 1) != 0 )
operator delete(v26);
if ( (v21 & 1) != 0 )
operator delete(v23);
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::__init(&v24, "Sending...", 0xAu);
v15 = UploadActionPopup::create((__int64)this + 672, (char *)&v24);
v16 = v24;
*((_QWORD *)this + 98) = v15;
if ( (v16 & 1) != 0 )
{
operator delete(v26);
v15 = *((_QWORD *)this + 98);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v15 + 1312LL))(v15);
return _stack_chk_guard;
}
}
std::string::__init(&v24, *((void **)this + 92), *((_QWORD *)this + 91));
goto LABEL_10;
}
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::__init(&v24, "You can't send an empty message.", 0x28u);
v18 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"No message",
(char *)&v24,
(ButtonSprite *)"Ok",
nullptr,
0,
380.0,
0.0,
1.0);
}
else
{
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::__init(&v24, "You must enter a subject for the message", 0x30u);
v18 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"No subject",
(char *)&v24,
(ButtonSprite *)"Ok",
nullptr,
0,
380.0,
0.0,
1.0);
}
v19 = v18;
if ( (v24 & 1) != 0 )
operator delete(v26);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 1312LL))(v19);
return _stack_chk_guard;
}