//
// cocos2d::extension::CCEditBoxImplWin::setText from 0x180011aa0 to 0x180011c1f (383 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800281a8
// > ??> @ 0x18002fdf8
// > ??> @ 0x18004a2d8
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::extension::CCEditBoxImplWin::setText(void **this, char *a2)
{
size_t v3; // r8
size_t *v4; // rbx
__int64 v5; // rdx
__int64 *v6; // rcx
__int64 v7; // rax
const char *v8; // rdx
int v9; // eax
__int64 v10; // rbx
void *v11; // rdx
void **v12; // rdx
void *v13; // rcx
void *Block[2]; // [rsp+20h] [rbp-38h] BYREF
__m128i si128; // [rsp+30h] [rbp-28h]
if ( a2 )
{
v3 = -1;
do
++v3;
while ( a2[v3] );
v4 = (size_t *)(this + 7);
sub_180003BC0(this + 7, a2, v3);
v6 = (__int64 *)*(this + 4);
v7 = *v6;
if ( *(this + 9) )
{
(*(void (__fastcall **)(__int64 *, _QWORD))(v7 + 320))(v6, 0);
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_1800295E0);
LOBYTE(Block[0]) = 0;
if ( *((_DWORD *)this + 11) )
{
if ( Block != (void **)v4 )
{
v11 = v4;
if ( v4[3] > 0xF )
v11 = (void *)*v4;
sub_180003BC0(Block, v11, v4[2]);
}
}
else
{
if ( v4[3] > 0xF )
v4 = (size_t *)*v4;
v9 = cocos2d::cc_utf8_strlen((cocos2d *)v4, v8);
if ( v9 > 0 )
{
v10 = (unsigned int)v9;
do
{
sub_1800039A0(Block, "*", 1u);
--v10;
}
while ( v10 );
}
}
v12 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v12 = (void **)Block[0];
(**((void (__fastcall ***)(__int64, void **))*(this + 3) + 75))((__int64)*(this + 3) + 600, v12);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v13 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v13 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v13);
}
}
else
{
LOBYTE(v5) = 1;
(*(void (__fastcall **)(__int64 *, __int64))(v7 + 320))(v6, v5);
(**((void (__fastcall ***)(__int64, char *))*(this + 3) + 75))((__int64)*(this + 3) + 600, byte_180023460);
}
}
}