//
// EditLevelLayer::textChanged from 0x6e2288 to 0x6e24d0 (584 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'EditLevelLayer::textChanged @ 0x6e24d4
// > ??> @ 0xb5290
// > ??> @ 0x115be20
//
// 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 EditLevelLayer::textChanged(EditLevelLayer *a1, CCTextInputNode *a2)
{
int v3; // w0
char *v4; // x0
GJGameLevel *m_level; // x20
char *v6; // x0
unsigned int *v7; // x1
int v8; // w2
unsigned int *v9; // x2
int v10; // w1
unsigned int *v11; // x1
int v12; // w2
char *v14; // [xsp+58h] [xbp+58h] BYREF
char *v15; // [xsp+60h] [xbp+60h] BYREF
v3 = a2->getTag(a2);
if ( v3 == 1 )
{
m_level = a1->m_level;
CCTextInputNode::getString(a2, (__int64)&v14);
sub_D153B8((int)&v15, v14);
sub_D18EA8(&m_level->m_levelName, &v15);
v6 = v15 - 24;
if ( v15 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v15 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v15 - 2);
*((_DWORD *)v15 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v6);
}
v4 = v14 - 24;
if ( v14 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v14 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v14 - 2);
*((_DWORD *)v14 - 2) = v8 - 1;
}
if ( v8 <= 0 )
goto LABEL_11;
}
}
else if ( v3 == 2 )
{
CCTextInputNode::getString(a2, (__int64)&v15);
EditLevelLayer::updateDescText(a1, v15);
v4 = v15 - 24;
if ( v15 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v15 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v15 - 2);
*((_DWORD *)v15 - 2) = v10 - 1;
}
if ( v10 <= 0 )
LABEL_11:
operator delete(v4);
}
}
}