//
// CCTextInputNode::onTextFieldDeleteBackward from 0x3e34c4 to 0x3e363a (374 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'CCTextInputNode::onTextFieldDeleteBackward @ 0x3e3648
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:47:03 +0000
//
int __fastcall CCTextInputNode::onTextFieldDeleteBackward(
CCTextInputNode *this,
cocos2d::CCTextFieldTTF *a2,
const char *a3,
int a4)
{
int v6; // r4
int v8; // r4
const char *v9; // r0
const char *v10; // r7
size_t v11; // r0
int v12; // r7
int v13; // r0
int v14; // r1
unsigned int *v15; // r0
int v16; // r0
unsigned int v17; // r10
unsigned int v18; // r1
unsigned int v19; // r4
char *v20; // r3
size_t v21; // r2
unsigned int v22; // r11
unsigned int v23; // r4
int v24; // r1
int v25; // r2
int v26; // r0
char *v27; // [sp+4h] [bp-28h]
int v28; // [sp+Ch] [bp-20h] BYREF
unsigned int v29; // [sp+10h] [bp-1Ch]
char *v30; // [sp+14h] [bp-18h]
int v31[3]; // [sp+18h] [bp-14h] BYREF
*((_DWORD *)this + 114) = -1082130432;
if ( *((int *)this + 93) <= 0 || *((_DWORD *)this + 94) == *((_DWORD *)this + 95) )
return 0;
v8 = 0;
v9 = (const char *)(*(int (__fastcall **)(cocos2d::CCTextFieldTTF *))(*(_DWORD *)a2 + 624))(a2);
v28 = 0;
v29 = 0;
v30 = nullptr;
v10 = v9;
v11 = strlen(v9);
std::string::__init(&v28, v10, v11);
v12 = *((_DWORD *)a2 + 152);
v13 = sub_3DC602((unsigned __int8 *)&v28);
if ( v12 < 0 || v12 > v13 )
{
if ( (v28 & 1) != 0 )
v14 = v29;
else
v14 = (int)(unsigned __int8)v28 >> 1;
v8 = 1;
}
else
{
v14 = sub_3DC656((unsigned __int8 *)&v28, v12);
}
v15 = CCTextInputNode::emoteTokenEndingAt(this, v14);
if ( v15
|| !v8
&& v12 > 0
&& (v16 = sub_3DC656((unsigned __int8 *)&v28, v12 - 1),
(v15 = CCTextInputNode::emoteTokenStartingAt(this, v16)) != nullptr) )
{
v17 = *v15;
v18 = v15[1];
if ( (v28 & 1) != 0 )
v19 = v29;
else
v19 = (int)(unsigned __int8)v28 >> 1;
if ( v17 > v19 )
sub_3875A0();
if ( v18 )
{
if ( (v28 & 1) != 0 )
v20 = v30;
else
v20 = (char *)&v28 + 1;
if ( v18 >= v19 - v17 )
v18 = v19 - v17;
v21 = v19 - v17 - v18;
v22 = v18;
if ( v21 )
{
v27 = v20;
std::char_traits::move(&v20[v17], &v20[v18 + v17], v21);
v20 = v27;
}
v23 = v19 - v22;
if ( (v28 & 1) != 0 )
v29 = v23;
else
LOBYTE(v28) = 2 * v23;
v20[v23] = 0;
}
std::string::basic_string(v31, (int)&v28);
CCTextInputNode::setString((int)this, (int)v31);
std::string::~string((int)v31);
if ( v12 < 0 )
v26 = -1;
else
v26 = sub_3DC19C((unsigned __int8 *)&v28, v17);
*((_DWORD *)a2 + 152) = v26;
CCTextInputNode::updateBlinkLabel(this, v24, v25);
v6 = 1;
}
else
{
v6 = 0;
}
std::string::~string((int)&v28);
return v6;
}