//
// cocos2d::extension::CCEditBoxImplAndroid::setText from 0x7b137c to 0x7b152a (430 bytes)
//
// 0 xrefs:
//
// 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 12:00:07 +0000
//
int __fastcall cocos2d::extension::CCEditBoxImplAndroid::setText(int this, const char *a2)
{
int v2; // r4
int *v4; // r7
size_t v5; // r0
int v6; // r3
int v7; // r0
int v8; // r3
const char *v9; // r1
cocos2d *v10; // r0
int v11; // r7
int i; // r6
int v13; // r3
unsigned int v14; // r1
int v15; // r10
char *v16; // r11
char *v17; // r1
int v18; // r2
const void *v19; // r1
size_t v20; // r2
float v21; // s16
int v22; // [sp+10h] [bp-24h] BYREF
int v23; // [sp+14h] [bp-20h]
char *v24; // [sp+18h] [bp-1Ch]
_BYTE v25[8]; // [sp+1Ch] [bp-18h] BYREF
float v26; // [sp+24h] [bp-10h]
v2 = this;
if ( a2 )
{
v4 = (int *)(this + 32);
v5 = strlen(a2);
std::string::assign(v4, a2, v5);
v6 = *(unsigned __int8 *)(v2 + 32);
v7 = *(_DWORD *)(v2 + 16);
if ( (v6 & 1) != 0 )
v8 = *(_DWORD *)(v2 + 36);
else
v8 = v6 >> 1;
if ( v8 )
{
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v7 + 172))(v7, 0);
v22 = 0;
v23 = 0;
v24 = nullptr;
if ( *(_DWORD *)(v2 + 24) )
{
if ( v4 != &v22 )
{
v18 = *(unsigned __int8 *)(v2 + 32);
if ( (v18 & 1) != 0 )
{
v19 = *(const void **)(v2 + 40);
v20 = *(_DWORD *)(v2 + 36);
}
else
{
v19 = (const void *)(v2 + 33);
v20 = v18 >> 1;
}
std::string::assign(&v22, v19, v20);
}
}
else
{
if ( (*(_BYTE *)(v2 + 32) & 1) != 0 )
v10 = *(cocos2d **)(v2 + 40);
else
v10 = (cocos2d *)(v2 + 33);
v11 = cocos2d::cc_utf8_strlen(v10, v9);
for ( i = 0; i < v11; ++i )
{
if ( (v22 & 1) != 0 )
{
v13 = v23;
v14 = (v22 & 0xFFFFFFFE) - 1;
}
else
{
v13 = (int)(unsigned __int8)v22 >> 1;
v14 = 10;
}
v15 = v13 + 3;
if ( v14 - v13 <= 2 )
{
std::string::__grow_by_and_replace((int)&v22, v14, v15 - v14, v13, v13, 0, 3u, &unk_BE4D1C);
}
else
{
if ( (v22 & 1) != 0 )
v16 = v24;
else
v16 = (char *)&v22 + 1;
std::char_traits::copy(&v16[v13], &unk_BE4D1C, 3u);
if ( (v22 & 1) != 0 )
v23 = v15;
else
LOBYTE(v22) = 2 * v15;
v16[v15] = 0;
}
}
}
if ( (v22 & 1) != 0 )
v17 = v24;
else
v17 = (char *)&v22 + 1;
(*(void (__fastcall **)(_DWORD, char *, int))(**(_DWORD **)(v2 + 12) + 620))(
*(_DWORD *)(v2 + 12),
v17,
(unsigned __int8)v22 << 31);
v21 = *(float *)(v2 + 68) - 10.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v25, (const cocos2d::CCRect *)(*(_DWORD *)(v2 + 12) + 336));
if ( v26 > v21 )
{
v26 = v21;
(*(void (__fastcall **)(_DWORD, _BYTE *))(**(_DWORD **)(v2 + 12) + 568))(*(_DWORD *)(v2 + 12), v25);
}
return std::string::~string((int)&v22);
}
else
{
(*(void (__fastcall **)(int, int))(*(_DWORD *)v7 + 172))(v7, 1);
return (*(int (__fastcall **)(_DWORD, void *))(**(_DWORD **)(v2 + 12) + 620))(*(_DWORD *)(v2 + 12), &unk_B6B226);
}
}
return this;
}