//
// EditLevelLayer::textChanged from 0x7ef6a0 to 0x7ef8b0 (528 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'EditLevelLayer::textChanged @ 0x7ef8b4
// > ??> @ 0xec9f8
// > ??> @ 0x143c960
//
// 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:54:34 +0000
//
__int64 __fastcall EditLevelLayer::textChanged(EditLevelLayer *this, CCTextInputNode *a2)
{
int v4; // w0
__int64 *String; // x0
int v6; // w0
char v7; // w0
char *v8; // x21
__int64 v9; // x0
size_t v10; // x1
CCTextInputNode *v12; // x0
__int64 v13; // x20
char *v14; // x21
size_t v15; // x0
__int64 *v16; // x0
char *v17; // x1
size_t v18; // x2
char *v19; // x1
__int64 v20[2]; // [xsp+38h] [xbp+38h] BYREF
char *v21; // [xsp+48h] [xbp+48h]
__int64 v22; // [xsp+50h] [xbp+50h] BYREF
size_t v23; // [xsp+58h] [xbp+58h]
void *v24; // [xsp+60h] [xbp+60h]
v4 = (*(__int64 (__fastcall **)(CCTextInputNode *))(*(_QWORD *)a2 + 64LL))(a2);
if ( v4 != 1 )
{
if ( v4 != 2 )
return _stack_chk_guard;
String = CCTextInputNode::getString(a2, v20);
v6 = EmoteSprite::maxEmotesComment((EmoteSprite *)String);
if ( (int)EmoteSprite::effectiveLength((char *)v20, v6) <= 180 )
{
if ( (__int64 *)((char *)this + 560) != v20 )
{
if ( (v20[0] & 1) != 0 )
{
v17 = v21;
v18 = v20[1];
}
else
{
v18 = LOBYTE(v20[0]) >> 1;
v17 = (char *)v20 + 1;
}
std::string::assign((__int64 *)this + 70, v17, v18);
}
v19 = (char *)v20 + 1;
if ( (v20[0] & 1) != 0 )
v19 = v21;
EditLevelLayer::updateDescText(this, v19);
goto LABEL_8;
}
v7 = *((_BYTE *)this + 560);
v22 = 0;
v8 = (char *)this + 560;
v23 = 0;
v24 = nullptr;
if ( (v7 & 1) != 0 )
{
std::string::__init(&v22, *((void **)v8 + 2), *((_QWORD *)v8 + 1));
}
else
{
v9 = *(_QWORD *)v8;
v10 = *((_QWORD *)v8 + 1);
v24 = *((void **)v8 + 2);
v22 = v9;
v23 = v10;
}
CCTextInputNode::setString(a2, (char *)&v22);
LABEL_7:
if ( (v22 & 1) == 0 )
goto LABEL_8;
goto LABEL_17;
}
v12 = a2;
v13 = *((_QWORD *)this + 59);
v14 = (char *)v20 + 1;
CCTextInputNode::getString(v12, v20);
if ( (v20[0] & 1) != 0 )
v14 = v21;
v22 = 0;
v23 = 0;
v24 = nullptr;
v15 = strlen(v14);
std::string::__init(&v22, v14, v15);
v16 = (__int64 *)(v13 + 344);
if ( (__int64 *)(v13 + 344) == &v22 )
goto LABEL_7;
if ( (v22 & 1) != 0 )
std::string::assign(v16, v24, v23);
else
std::string::assign(v16, (char *)&v22 + 1, (unsigned __int8)v22 >> 1);
if ( (v22 & 1) == 0 )
goto LABEL_8;
LABEL_17:
operator delete(v24);
LABEL_8:
if ( (v20[0] & 1) != 0 )
operator delete(v21);
return _stack_chk_guard;
}