//
// KeybindingsLayer::textChanged from 0x997ed4 to 0x99805c (392 bytes)
//
// 4 xrefs:
// > `non-virtual thunk to'KeybindingsLayer::textChanged @ 0x998060
// > ??> @ 0x79990
// > ??> @ 0x1474f08
// > ??> @ 0x1504138
//
// 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:58:03 +0000
//
__int64 __fastcall KeybindingsLayer::textChanged(KeybindingsLayer *this, CCTextInputNode *a2)
{
CCTextInputNode *v3; // x0
int v5; // w4
size_t v6; // x2
__int64 *v7; // x22
__int64 v8; // x1
char *v9; // x1
size_t v10; // x2
ScrollableContentLayer *v11; // x0
unsigned __int8 *v12; // x0
unsigned __int8 *v13; // x1
unsigned __int8 *v14; // x4
unsigned __int8 *v15; // x2
int v16; // t1
__int64 v17; // [xsp+30h] [xbp+30h] BYREF
size_t v18; // [xsp+38h] [xbp+38h]
void *v19; // [xsp+40h] [xbp+40h]
v3 = *((CCTextInputNode **)this + 139);
if ( v3 != a2 )
return _stack_chk_guard;
CCTextInputNode::getString(v3, &v17);
v5 = v17 & 1;
v6 = (unsigned __int8)v17 >> 1;
if ( v5 )
v6 = v18;
v7 = (__int64 *)((char *)this + 1160);
v8 = *((_BYTE *)this + 1160) >> 1;
if ( (*((_BYTE *)this + 1160) & 1) != 0 )
v8 = *((_QWORD *)this + 146);
if ( v6 != v8 )
{
if ( v7 == &v17 )
goto LABEL_12;
if ( v5 )
goto LABEL_10;
goto LABEL_27;
}
v12 = (unsigned __int8 *)&v17 + 1;
if ( v5 )
v12 = (unsigned __int8 *)v19;
v13 = (unsigned __int8 *)this + 1161;
if ( (*((_BYTE *)this + 1160) & 1) != 0 )
v13 = *((unsigned __int8 **)this + 147);
if ( v5 )
{
if ( !v6 || !memcmp(v12, v13, v6) )
{
LABEL_15:
operator delete(v19);
return _stack_chk_guard;
}
if ( v7 == &v17 )
goto LABEL_12;
LABEL_10:
v9 = (char *)v19;
v10 = v18;
LABEL_11:
std::string::assign((__int64 *)this + 145, v9, v10);
goto LABEL_12;
}
if ( !v6 )
return _stack_chk_guard;
if ( *v12 == *v13 )
{
v14 = v12 + 1;
v15 = &v12[v6];
do
{
++v13;
if ( v14 == v15 )
return _stack_chk_guard;
v16 = *v14++;
}
while ( *v13 == v16 );
}
if ( v7 != &v17 )
{
LABEL_27:
v10 = (unsigned __int8)v17 >> 1;
v9 = (char *)&v17 + 1;
goto LABEL_11;
}
LABEL_12:
v11 = *((ScrollableContentLayer **)this + 142);
if ( v11 )
ScrollableContentLayer::scrollTo(v11, 0.0);
(*(void (__fastcall **)(KeybindingsLayer *, _QWORD))(*(_QWORD *)this + 1504LL))(this, *((unsigned int *)this + 296));
if ( (v17 & 1) != 0 )
goto LABEL_15;
return _stack_chk_guard;
}