//
// cocos2d::CCTextFieldTTF::deleteBackward from 0x1002634e4 to 0x1002636e0 (508 bytes)
//
// 2 xrefs:
// > sub_1002636FC @ 0x100263700
// > ??> @ 0x100911c90
//
// 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 11:01:40 +0000
//
void __fastcall cocos2d::CCTextFieldTTF::deleteBackward(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x21
int v4; // w1
int v5; // w8
__int64 v6; // x22
__int64 v7; // x20
__int64 v8; // x20
__int64 v9; // x0
__int64 **v10; // x8
char *v11; // x1
int v12; // w9
std::string *v13; // x1
__int64 v14; // x20
_QWORD *v15; // x0
const std::string::value_type *v16; // x1
__int64 v17; // x0
std::string v18; // [xsp+8h] [xbp-38h] BYREF
v2 = *(_QWORD *)(a1 + 720);
v3 = *(char *)(v2 + 23);
if ( v3 < 0 )
{
v3 = *(_QWORD *)(v2 + 8);
if ( !(_DWORD)v3 )
return;
}
else if ( !*(_BYTE *)(v2 + 23) )
{
return;
}
v4 = *(_DWORD *)(a1 + 752);
if ( v4 )
{
v5 = v3;
if ( (v4 & 0x80000000) == 0 )
{
v5 = v3;
if ( v4 <= *(_DWORD *)(a1 + 712) )
v5 = sub_1002633E4((__int64 *)v2, v4);
}
if ( v5 >= 1 )
{
v6 = (unsigned int)v5;
if ( v5 == 1 )
{
v7 = 1;
}
else
{
v8 = -1;
while ( (*std::string::at(*(std::string **)(a1 + 720), v6 + v8) & 0xC0) == 0x80 )
{
--v8;
if ( !(v6 + v8) )
{
v7 = v6;
goto LABEL_17;
}
}
v7 = (unsigned int)-(int)v8;
}
LABEL_17:
v9 = *(_QWORD *)(a1 + 704);
if ( !v9 )
goto LABEL_21;
v10 = *(__int64 ***)(a1 + 720);
if ( *((char *)v10 + 23) < 0 )
v10 = (__int64 **)*v10;
if ( ((*(__int64 (__fastcall **)(__int64, __int64, __int64, __int64))(*(_QWORD *)v9 + 24LL))(
v9,
a1,
(__int64)v10 + v6 - (unsigned int)v7,
v7)
& 1) == 0 )
{
LABEL_21:
if ( (int)v7 >= (int)v3 )
{
v14 = *(_QWORD *)(a1 + 720);
if ( v14 )
{
if ( *(char *)(v14 + 23) < 0 )
operator delete(*(void **)v14);
operator delete((void *)v14);
*(_QWORD *)(a1 + 720) = 0;
}
v15 = operator new(0x18u);
v15[1] = 0;
v15[2] = 0;
*v15 = 0;
*(_QWORD *)(a1 + 720) = v15;
*(_DWORD *)(a1 + 712) = 0;
v16 = *(const std::string::value_type **)(a1 + 728);
if ( v16[23] < 0 )
v16 = *(const std::string::value_type **)v16;
cocos2d::CCLabelTTF::setString(a1, v16);
v17 = *(_QWORD *)(a1 + 704);
if ( v17 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v17 + 40LL))(v17);
}
else
{
v11 = *(char **)(a1 + 720);
if ( v11[23] < 0 )
v11 = *(char **)v11;
sub_100009900(&v18, v11);
std::string::erase(&v18, (int)v6 - (int)v7, (unsigned int)v7);
v12 = *(_DWORD *)(a1 + 752);
if ( v12 >= 1 && v12 <= *(_DWORD *)(a1 + 712) )
*(_DWORD *)(a1 + 752) = v12 - 1;
if ( (v18.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v13 = &v18;
else
v13 = (std::string *)v18.__r_.__value_.__r.__words[0];
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)a1 + 1240LL))(a1, v13);
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v18.__r_.__value_.__l.__data_);
}
}
}
}
}