//
// GJWriteMessagePopup::updateText from 0xa2f34c to 0xa2f620 (724 bytes)
//
// 3 xrefs:
// > GJWriteMessagePopup::updateSubject @ 0xa2f680
// > GJWriteMessagePopup::updateBody @ 0xa2f748
// > ??> @ 0x8b5b8
//
// 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:46 +0000
//
__int64 __fastcall GJWriteMessagePopup::updateText(__int64 *a1, __int64 a2, int a3)
{
__int64 *v6; // x0
__int64 *v7; // x23
int v8; // w2
__int64 v9; // x1
long double v10; // q0
long double v11; // q1
__int64 *v12; // x0
const char *v13; // x1
size_t v14; // x0
char *v16; // [xsp+48h] [xbp+48h]
__int64 v17; // [xsp+58h] [xbp+58h]
__int64 v18; // [xsp+60h] [xbp+60h] BYREF
size_t v19; // [xsp+68h] [xbp+68h]
void *v20; // [xsp+70h] [xbp+70h]
__int64 v21; // [xsp+78h] [xbp+78h] BYREF
size_t v22; // [xsp+80h] [xbp+80h]
void *v23; // [xsp+88h] [xbp+88h]
__int64 v24[2]; // [xsp+90h] [xbp+90h] BYREF
void *v25; // [xsp+A0h] [xbp+A0h]
v18 = 0;
v19 = 0;
v20 = nullptr;
std::string::__init(&v18, &byte_11B8890, 0);
if ( a3 )
{
v12 = a1 + 90;
if ( (__int64 *)a2 != a1 + 90 )
{
if ( (*(_BYTE *)a2 & 1) != 0 )
std::string::assign(v12, *(const void **)(a2 + 16), *(_QWORD *)(a2 + 8));
else
std::string::assign(v12, (const void *)(a2 + 1), *(_BYTE *)a2 >> 1);
}
v7 = *(__int64 **)(a1[88] + 616);
std::string::assign(&v18, "Message");
}
else
{
v6 = a1 + 93;
if ( a1 + 93 != (__int64 *)a2 )
{
if ( (*(_BYTE *)a2 & 1) != 0 )
std::string::assign(v6, *(const void **)(a2 + 16), *(_QWORD *)(a2 + 8));
else
std::string::assign(v6, (const void *)(a2 + 1), *(_BYTE *)a2 >> 1);
}
v7 = *(__int64 **)(a1[89] + 616);
std::string::assign(&v18, "Subject");
}
v8 = *(_BYTE *)a2 & 1;
v9 = *(_BYTE *)a2 >> 1;
if ( (*(_BYTE *)a2 & 1) != 0 )
v9 = *(_QWORD *)(a2 + 8);
if ( v9 )
{
if ( a3 == 1 )
{
(*(void (__fastcall **)(__int64 *, float))(*v7 + 160))(v7, 1.0);
*((_DWORD *)v7 + 154) = 1134526464;
v8 = *(_BYTE *)a2 & 1;
}
v13 = (const char *)(a2 + 1);
if ( v8 )
v13 = *(const char **)(a2 + 16);
v16 = (char *)v13;
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
v14 = strlen(v13);
std::string::__init(v24, v16, v14);
TextArea::setString(v7, (char *)v24);
if ( (v24[0] & 1) != 0 )
operator delete(v25);
TextArea::colorAllCharactersTo((__int64)v7, 0xFFFFFF);
}
else
{
v21 = 0;
v22 = 0;
v23 = nullptr;
if ( (v18 & 1) != 0 )
{
std::string::__init(&v21, v20, v19);
}
else
{
v23 = v20;
v21 = v18;
v22 = v19;
}
TextArea::setString(v7, (char *)&v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
LOWORD(v17) = -14136;
BYTE2(v17) = -56;
TextArea::colorAllCharactersTo((__int64)v7, v17);
if ( a3 == 1 )
{
(*(void (__fastcall **)(__int64 *, float))(*v7 + 160))(v7, 1.0);
*((_DWORD *)v7 + 154) = 1134526464;
}
}
GJWriteMessagePopup::updateCharCountLabel((GJWriteMessagePopup *)a1, a3, v10, v11);
if ( (v18 & 1) != 0 )
operator delete(v20);
return _stack_chk_guard;
}