//
// GJWriteMessagePopup::textChanged from 0x8d104c to 0x8d1298 (588 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJWriteMessagePopup::textChanged @ 0x8d129c
// > ??> @ 0xaa508
// > ??> @ 0x1199ab0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJWriteMessagePopup::textChanged(GJWriteMessagePopup *a1, CCTextInputNode *a2)
{
int v3; // w0
char *v4; // x0
void *v5; // x0
unsigned int *v6; // x1
int v7; // w2
unsigned int *v8; // x1
int v9; // w2
unsigned int *v10; // x1
int v11; // w2
char *v13; // [xsp+50h] [xbp+50h] BYREF
__int64 v14; // [xsp+58h] [xbp+58h] BYREF
__int64 v15; // [xsp+60h] [xbp+60h] BYREF
CCTextInputNode::getString(a2, (__int64)&v13);
v3 = a2->getTag(a2);
if ( v3 )
{
if ( v3 == 1 )
{
sub_D153B8((int)&v15, v13);
GJWriteMessagePopup::updateBody(a1);
v5 = (void *)(v15 - 24);
if ( (__int64 *)(v15 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v15 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v15 - 8);
*(_DWORD *)(v15 - 8) = v7 - 1;
}
if ( v7 <= 0 )
LABEL_10:
operator delete(v5);
}
}
}
else
{
sub_D153B8((int)&v14, v13);
GJWriteMessagePopup::updateSubject(a1);
v5 = (void *)(v14 - 24);
if ( (__int64 *)(v14 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v14 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v14 - 8);
*(_DWORD *)(v14 - 8) = v9 - 1;
}
if ( v9 <= 0 )
goto LABEL_10;
}
}
v4 = v13 - 24;
if ( v13 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v13 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *((_DWORD *)v13 - 2);
*((_DWORD *)v13 - 2) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v4);
}
}