//
// ProfilePage::onSendMessage from 0x140556b10 to 0x140556c5b (331 bytes)
//
// 2 xrefs:
// > ProfilePage::setupAccountButtons @ 0x1405525a2
// > ??> @ 0x14092bea4
//
// 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:34:11 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall ProfilePage::onSendMessage(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rdx
void **v5; // rdx
char v6; // bl
void *v7; // rcx
void *Block[2]; // [rsp+38h] [rbp-50h] BYREF
__m128i si128; // [rsp+48h] [rbp-40h]
_BYTE v10[32]; // [rsp+58h] [rbp-30h] BYREF
v2 = GJAccountManager::sharedState();
if ( *(_DWORD *)(v2 + 360) - *(_DWORD *)(v2 + 364) > 0 )
{
v4 = *(_QWORD *)(a1 + 728);
if ( v4 )
{
sub_14003F4F0((__int64)v10, v4 + 320);
v5 = (void **)v10;
v6 = 5;
}
else
{
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
v5 = Block;
v6 = 2;
}
ThreadOpenHelper::check(*(_DWORD *)(a1 + 736), (__int64)v5);
if ( (v6 & 2) != 0 )
{
v6 &= ~2u;
if ( si128.m128i_i64[1] > 0xFuLL )
{
v7 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
}
if ( (v6 & 1) != 0 )
sub_14003D310((__int64)v10);
}
else
{
GJAccountManager::sharedState();
GJAccountManager::showAccountNeededAlert(v3, "send messages");
}
}