//
// CCTextInputNode::init from 0x1000659e0 to 0x100065cb0 (720 bytes)
//
// 1 xrefs:
// > CCTextInputNode::create @ 0x100065992
//
// 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 12:19:43 +0000
//
__int64 __fastcall CCTextInputNode::init(
std::string *a1,
const std::string::value_type *a2,
__int64 a3,
int a4,
const char *a5,
__m128i a6,
float a7)
{
__int64 result; // rax
__int64 v11; // rax
__int64 v12; // rax
size_t v13; // rax
size_t v14; // r12
char *v15; // r15
char *v16; // r13
size_t v17; // r14
char v18; // r12
size_t v19; // rax
void *v20; // r14
size_t v21; // rdx
__int64 v22; // rax
char v23; // [rsp+0h] [rbp-70h] BYREF
_BYTE __s2[12]; // [rsp+1h] [rbp-6Fh] BYREF
char v25; // [rsp+Dh] [rbp-63h]
size_t __dst; // [rsp+18h] [rbp-58h] BYREF
size_t __n; // [rsp+20h] [rbp-50h]
void *__s1; // [rsp+28h] [rbp-48h]
float v29; // [rsp+34h] [rbp-3Ch]
const char *v30; // [rsp+38h] [rbp-38h]
unsigned __int8 v31; // [rsp+47h] [rbp-29h]
v29 = a7;
LODWORD(v30) = _mm_cvtsi128_si32(a6);
result = cocos2d::CCLayer::init();
if ( (_BYTE)result )
{
v31 = result;
(*(void (__fastcall **)(std::string *, __int64))(a1->__r_.__value_.__r.__words[0] + 1000))(a1, 1);
(*(void (__fastcall **)(std::string *, __int64))(a1->__r_.__value_.__r.__words[0] + 1104))(a1, 1);
a1[25].__r_.__value_.__s.__data_[7] = 0;
std::string::assign(a1 + 18, a2);
v11 = cocos2d::CCTextFieldTTF::textFieldWithPlaceHolder_1(a2, a3, (float)a4);
a1[24].__r_.__value_.__r.__words[0] = v11;
(*(void (__fastcall **)(std::string *, __int64))(a1->__r_.__value_.__r.__words[0] + 456))(a1, v11);
*(_QWORD *)(a1[24].__r_.__value_.__r.__words[0] + 704) = (char *)a1 + 416;
sub_100278260(
&v23,
COERCE_DOUBLE((unsigned __int64)(unsigned int)v30),
COERCE_DOUBLE((unsigned __int64)LODWORD(v29)));
(*(void (__fastcall **)(std::string *, char *))(a1->__r_.__value_.__r.__words[0] + 320))(a1, &v23);
LODWORD(a1[22].__r_.__value_.__r.__words[2]) = (_DWORD)v30;
*(std::string::size_type *)((char *)&a1[22].__r_.__value_.__r.__words[2] + 4) = _mm_cvtsi32_si128(0x3F800000u).u64[0];
HIDWORD(a1[23].__r_.__value_.__r.__words[0]) = -1;
LOWORD(a1[23].__r_.__value_.__r.__words[1]) = -1;
std::string::assign(
(std::string *)((char *)a1 + 472),
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
if ( !a5 )
{
LABEL_19:
v22 = cocos2d::CCLabelBMFont::create_3("|", "chatFont.fnt");
a1[23].__r_.__value_.__r.__words[2] = v22;
(*(void (__fastcall **)(std::string *, __int64, __int64))(a1->__r_.__value_.__r.__words[0] + 464))(a1, v22, 10);
(*(void (__fastcall **)(std::string::size_type, __int64))(*(_QWORD *)a1[23].__r_.__value_.__l.__data_ + 1024LL))(
a1[23].__r_.__value_.__r.__words[2],
150);
(*(void (__fastcall **)(std::string::size_type, _QWORD))(*(_QWORD *)a1[23].__r_.__value_.__l.__data_ + 344LL))(
a1[23].__r_.__value_.__r.__words[2],
0);
return v31;
}
v12 = cocos2d::CCLabelBMFont::create_3(a2, a5);
a1[25].__r_.__value_.__r.__words[0] = v12;
(*(void (__fastcall **)(std::string *, __int64))(a1->__r_.__value_.__r.__words[0] + 456))(a1, v12);
(*(void (__fastcall **)(std::string::size_type, _QWORD))(*(_QWORD *)a1[24].__r_.__value_.__r.__words[0] + 344LL))(
a1[24].__r_.__value_.__r.__words[0],
0);
v13 = strlen(a5);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v14 = v13;
v15 = (char *)&__dst + 1;
if ( v13 >= 0x17 )
{
v30 = a5;
v17 = 26;
if ( (v13 | 7) != 0x17 )
v17 = (v13 | 7) + 1;
v16 = (char *)operator new(v17);
__s1 = v16;
__dst = v17 + 1;
a5 = v30;
__n = v14;
}
else
{
LOBYTE(__dst) = 2 * v13;
v16 = (char *)&__dst + 1;
if ( !v13 )
goto LABEL_11;
}
memcpy(v16, a5, v14);
LABEL_11:
v16[v14] = 0;
qmemcpy(__s2, "chatFont.fnt", sizeof(__s2));
v18 = __dst;
v19 = (unsigned __int8)__dst >> 1;
v20 = __s1;
if ( (__dst & 1) != 0 )
v15 = (char *)__s1;
v25 = 0;
if ( (__dst & 1) != 0 )
v19 = __n;
v21 = 12;
if ( v19 < 0xC )
v21 = v19;
_mm_storel_ps(
(double *)&a1[19].__r_.__value_.__l.__size_,
_mm_blendv_ps(
(__m128)0x41A000003FC00000uLL,
(__m128)xmmword_100A03FF0,
(__m128)_mm_slli_epi32(
_mm_shuffle_epi32(_mm_cvtsi32_si128((v19 == 12) & (unsigned __int8)(memcmp(v15, __s2, v21) == 0)), 80),
0x1Fu)));
if ( (v18 & 1) != 0 )
operator delete(v20);
goto LABEL_19;
}
return result;
}