//
// cocos2d::extension::CCEditBoxImplAndroid::setText from 0xaaa95c to 0xaaab8c (560 bytes)
//
// 2 xrefs:
// > ??> @ 0x35b08
// > ??> @ 0x11fac98
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall cocos2d::extension::CCEditBoxImplAndroid::setText(
cocos2d::extension::CCEditBoxImplAndroid *this,
const char *a2)
{
size_t v3; // x0
long double v4; // q0
__int64 v5; // x2
int v6; // w1
float v7; // s8
char *v8; // x19
__int64 v10; // x24
__int64 v11; // x19
__int64 v12; // x2
unsigned int *v13; // x23
int v14; // w0
char *v16; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCRect v17; // [xsp+78h] [xbp+78h] BYREF
if ( a2 )
{
v3 = strlen(a2);
*(__n128 *)&v4 = sub_D1798C((char *)this + 56, a2, v3);
v5 = *((_QWORD *)this + 4);
if ( *(_QWORD *)(*((_QWORD *)this + 7) - 24LL) )
{
(*(void (__fastcall **)(_QWORD, _QWORD, long double))(*(_QWORD *)v5 + 328LL))(*((_QWORD *)this + 4), 0, v4);
v6 = *((_DWORD *)this + 11);
v16 = &byte_124B6C8;
if ( v6 )
{
sub_D18EA8(&v16, (char *)this + 56);
}
else
{
v10 = cocos2d::cc_utf8_strlen(*((const char **)this + 7), 0);
v11 = 0;
if ( v10 > 0 )
{
do
{
sub_D15FD4(&v16, &unk_F16530, 3);
++v11;
}
while ( v11 != v10 );
}
}
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 3) + 1224LL))(*((_QWORD *)this + 3), v16);
v7 = *((float *)this + 21) - 10.0;
cocos2d::CCRect::CCRect(&v17, (const cocos2d::CCRect *)(*((_QWORD *)this + 3) + 424LL));
if ( v7 < v17.size.width )
{
v12 = *((_QWORD *)this + 3);
v17.size.width = v7;
(*(void (__fastcall **)(__int64, cocos2d::CCRect *))(*(_QWORD *)v12 + 1120LL))(v12, &v17);
}
v8 = v16 - 24;
if ( v16 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v16 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *((_DWORD *)v16 - 2);
*((_DWORD *)v16 - 2) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v8);
}
}
else
{
(*(void (__fastcall **)(_QWORD, __int64, long double))(*(_QWORD *)v5 + 328LL))(*((_QWORD *)this + 4), 1, v4);
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 3) + 1224LL))(*((_QWORD *)this + 3), &byte_F288A0);
}
}
return _stack_chk_guard;
}