//
// GJMessagePopup::onNewThread from 0x100294400 to 0x10029457d (381 bytes)
//
// 1 xrefs:
// > GJMessagePopup::loadFromGJMessage @ 0x100294233
//
// 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 12:27:50 +0000
//
void __fastcall GJMessagePopup::onNewThread(__int64 a1)
{
__int64 v1; // rax
__int128 *v2; // rax
__int64 v3; // rdx
__int64 v4; // rdx
char *v5; // r14
char *v6; // r15
void *v7; // rax
char *v8; // rax
__int64 v9; // rdi
__int64 v10; // rax
__int128 v11; // [rsp+8h] [rbp-48h] BYREF
void *__p; // [rsp+18h] [rbp-38h]
__int128 v13; // [rsp+20h] [rbp-30h] BYREF
void *__s; // [rsp+30h] [rbp-20h]
v1 = *(_QWORD *)(a1 + 712);
if ( !v1 || *(int *)(v1 + 320) <= 0 )
return;
if ( (*(_BYTE *)(v1 + 328) & 1) != 0 )
{
sub_10001AD30(&v13, *(const void **)(v1 + 344), *(_QWORD *)(v1 + 336));
v3 = (unsigned __int8)v13;
if ( (v13 & 1) != 0 )
{
LABEL_5:
v4 = *((_QWORD *)&v13 + 1);
if ( *((_QWORD *)&v13 + 1) )
{
v5 = (char *)__s;
if ( *((__int64 *)&v13 + 1) < 4 )
goto LABEL_17;
goto LABEL_11;
}
goto LABEL_20;
}
}
else
{
v2 = (__int128 *)(v1 + 328);
__s = *((void **)v2 + 2);
v13 = *v2;
v3 = (unsigned __int8)v13;
if ( (v13 & 1) != 0 )
goto LABEL_5;
}
if ( v3 )
{
v5 = (char *)&v13 + 1;
v4 = (unsigned int)v3 >> 1;
if ( v4 < 4 )
{
LABEL_17:
std::operator+(&v11, "Re: ", &v13);
if ( (v13 & 1) != 0 )
operator delete(__s);
__s = __p;
v13 = v11;
goto LABEL_20;
}
LABEL_11:
v6 = &v5[v4];
v7 = v5;
while ( 1 )
{
v8 = (char *)memchr(v7, 82, v4 - 3);
if ( !v8 )
goto LABEL_17;
if ( *(_DWORD *)v8 == 540697938 )
{
if ( v8 != v6 && v8 - v5 != -1 )
break;
goto LABEL_17;
}
v7 = v8 + 1;
v4 = v6 - (_BYTE *)v7;
if ( v6 - (_BYTE *)v7 < 4 )
goto LABEL_17;
}
}
LABEL_20:
v9 = *(unsigned int *)(*(_QWORD *)(a1 + 712) + 320LL);
LOWORD(v11) = 0;
v10 = NewThreadPopup::create(v9, &v13, &v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v10 + 1312LL))(v10);
if ( (v11 & 1) != 0 )
operator delete(__p);
if ( (v13 & 1) != 0 )
operator delete(__s);
}