//
// cocos2d::CCTextFieldTTF::deleteBackward from 0x1800b8f30 to 0x1800b91d9 (681 bytes)
//
// 3 xrefs:
// > ??> @ 0x18010d3d0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2d84
//
// This function is hookable on this platform (idp: pc, 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:22:22 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCTextFieldTTF::deleteBackward(cocos2d::CCTextFieldTTF *this)
{
__int64 *v2; // rsi
int v3; // r14d
int v4; // edx
int v5; // ebp
int v6; // edi
__int64 v7; // r8
unsigned __int64 v8; // rcx
__int64 *v9; // rax
__int64 v10; // rcx
void *v11; // rdi
__int64 v12; // rax
char *v13; // rdx
__int64 v14; // rcx
const char *v15; // r14
size_t v16; // rax
unsigned __int64 v17; // r9
unsigned __int64 v18; // rdx
void **v19; // rcx
unsigned __int64 v20; // rbp
int v21; // eax
void **v22; // rdx
void *v23; // rcx
void *Block[2]; // [rsp+30h] [rbp-48h] BYREF
unsigned __int64 v25; // [rsp+40h] [rbp-38h]
unsigned __int64 v26; // [rsp+48h] [rbp-30h]
v2 = *((__int64 **)this + 3);
v3 = *((_DWORD *)v2 + 4);
if ( v3 )
{
v4 = *((_DWORD *)this + 14);
if ( v4 )
{
v5 = v4 < 0 || v4 > *((_DWORD *)this + 4) ? *((_DWORD *)v2 + 4) : sub_1800B8DF0(*((__int64 **)this + 3), v4);
if ( v5 > 0 )
{
v6 = 1;
if ( v5 > 1 )
{
v7 = 1;
v8 = v5 - 1LL;
do
{
if ( v2[2] <= v8 )
std::vector::_Xlen();
v9 = v2;
if ( (unsigned __int64)v2[3] > 0xF )
v9 = (__int64 *)*v2;
if ( (*((_BYTE *)v9 + v8) & 0xC0) != 0x80 )
break;
++v6;
++v7;
--v8;
}
while ( v7 < v5 );
}
v10 = *((_QWORD *)this + 1);
if ( !v10 )
goto LABEL_19;
if ( (unsigned __int64)v2[3] > 0xF )
v2 = (__int64 *)*v2;
if ( !(*(unsigned __int8 (__fastcall **)(__int64, char *, __int64, _QWORD))(*(_QWORD *)v10 + 24LL))(
v10,
(char *)this - 704,
(__int64)v2 + v5 - (__int64)v6,
(unsigned int)v6) )
{
LABEL_19:
if ( v3 > v6 )
{
v15 = *((const char **)this + 3);
if ( *((_QWORD *)v15 + 3) > 0xFu )
v15 = *(const char **)v15;
*(_OWORD *)Block = 0;
v25 = 0;
v26 = 0;
v16 = strlen(v15);
sub_18000CEF0(Block, v15, v16);
v17 = v5 - v6;
if ( v25 < v17 )
std::vector::_Xlen();
v18 = v6;
if ( v25 - v17 < v6 )
v18 = v25 - v17;
v19 = Block;
if ( v26 > 0xF )
v19 = (void **)Block[0];
v20 = v25 - v18;
memmove((char *)v19 + v17, (char *)v19 + v17 + v18, v25 - v18 - v17 + 1);
v25 = v20;
v21 = *((_DWORD *)this + 14);
if ( v21 > 0 && v21 <= *((_DWORD *)this + 4) )
*((_DWORD *)this + 14) = v21 - 1;
v22 = Block;
if ( v26 > 0xF )
v22 = (void **)Block[0];
(**((void (__fastcall ***)(char *, void **))this - 13))((char *)this - 104, v22);
if ( v26 > 0xF )
{
v23 = Block[0];
if ( v26 + 1 >= 0x1000 )
{
v23 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v23 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v23);
}
}
else
{
v11 = *((void **)this + 3);
if ( v11 )
{
sub_180005C70((__int64)v11);
j_j_free_0(v11);
*((_QWORD *)this + 3) = 0;
}
v12 = sub_1800E4AC0(0x20u);
if ( v12 )
{
*(_OWORD *)v12 = 0;
*(_QWORD *)(v12 + 16) = 0;
*(_QWORD *)(v12 + 24) = 15;
*(_BYTE *)v12 = 0;
}
else
{
v12 = 0;
}
*((_QWORD *)this + 3) = v12;
*((_DWORD *)this + 4) = 0;
v13 = *((char **)this + 4);
if ( *((_QWORD *)v13 + 3) > 0xFu )
v13 = *(char **)v13;
cocos2d::CCLabelTTF::setString((void **)this - 13, v13);
v14 = *((_QWORD *)this + 1);
if ( v14 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v14 + 40LL))(v14);
}
}
}
}
}
}