//
// CCTextInputNode::updateLabel from 0x1001fb214 to 0x1001fb704 (1264 bytes)
//
// 35 xrefs:
// > CustomizeObjectLayer::textInputOpened @ 0x1000592b8
// > sub_10005BA1C @ 0x10005bb48
// > LevelSearchLayer::textInputOpened @ 0x10005d2e4
// > SetupSmartTemplateLayer::textInputOpened @ 0x100079a84
// > sub_10007D470 @ 0x10007d548
// > SecretLayer5::onSubmit @ 0x10007d72c
// > SecretLayer5::textInputOpened @ 0x10007f5d0
// > EditLevelLayer::textInputClosed @ 0x1001118fc
// > EditLevelLayer::textInputOpened @ 0x100111ac0
// > CCTextInputNode::addTextArea @ 0x1001fb16c
// > sub_1001FB794 @ 0x1001fb934
// > CCTextInputNode::setString @ 0x1001fbce4
// > CCTextInputNode::setParseEmotes @ 0x1001fc4c4
// > sub_1001FCC58 @ 0x1001fcc94
// > CCTextInputNode::textChanged @ 0x1001fd558
// > CCTextInputNode::onTextFieldDetachWithIME @ 0x1001fe564
// > LevelListLayer::textInputClosed @ 0x1002e44f0
// > LevelListLayer::textInputOpened @ 0x1002e462c
// > sub_10037BC48 @ 0x10037bdac
// > SetColorIDPopup::colorSelectClosed @ 0x10037bf0c
// > GJGarageLayer::textInputOpened @ 0x1003a14a8
// > SecretLayer2::updateSearchLabel @ 0x1003a7340
// > SecretLayer2::textInputOpened @ 0x1003a9e60
// > sub_1003F457C @ 0x1003f4654
// > SecretLayer4::textInputOpened @ 0x1003f5788
// > sub_10045D510 @ 0x10045d5c4
// > sub_10045D620 @ 0x10045d6b8
// > SetupPulsePopup::colorSelectClosed @ 0x10045dd50
// > SetupPulsePopup::colorSelectClosed @ 0x10045dde8
// > sub_10046491C @ 0x1004649f4
// > SecretLayer::textInputOpened @ 0x100466078
// > sub_1004A108C @ 0x1004a1124
// > sub_1004A130C @ 0x1004a13a4
// > ColorSelectPopup::colorSelectClosed @ 0x1004a2980
// > ColorSelectPopup::colorSelectClosed @ 0x1004a2a20
//
// This function is hookable on this platform (idp: arm, 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:00:43 +0000
//
__int64 __fastcall CCTextInputNode::updateLabel(__int64 result, std::string *a2)
{
__int64 v3; // x19
__int64 v4; // x8
_BOOL4 v5; // w0
_BOOL4 v6; // w21
const std::string::value_type *v7; // x1
int v8; // w21
__int64 v9; // x0
char *v10; // x0
bool v11; // w21
char *v12; // x0
_QWORD *v13; // x0
__int64 v14; // x21
__int64 v15; // x0
_DWORD *v16; // x0
__int64 v17; // x9
std::string *p_str; // x8
int v19; // w10
int v20; // w10
std::string::value_type v21; // t1
__int64 v22; // x0
__int64 v23; // x21
void **v24; // x1
__int64 refreshed; // x0
__int64 v26; // x1
__int64 v27; // x20
int v28; // w0
__int64 v29; // x21
float v30; // s1
void *v31; // x0
char *v32; // x0
_BOOL4 v33; // w20
__int64 v34; // x20
__int64 v35; // x0
float v36; // s8
__n128 v37; // q0
void *v38[2]; // [xsp+8h] [xbp-98h] BYREF
char v39; // [xsp+1Fh] [xbp-81h]
__int128 __dst; // [xsp+20h] [xbp-80h] BYREF
std::string::size_type v41; // [xsp+30h] [xbp-70h]
void *__p[2]; // [xsp+40h] [xbp-60h] BYREF
char v43; // [xsp+57h] [xbp-49h]
std::string __str; // [xsp+58h] [xbp-48h] BYREF
v3 = result;
v4 = *(_QWORD *)(result + 600);
if ( v4 )
{
*(_DWORD *)(v4 + 512) = *(_DWORD *)(result + 708);
}
else if ( !*(_QWORD *)(result + 616) )
{
return result;
}
sub_100009900(&__str, "");
v5 = sub_1000045BC(a2, &__str);
v6 = v5;
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(__str.__r_.__value_.__l.__data_);
if ( v6 )
goto LABEL_6;
}
else if ( v5 )
{
LABEL_6:
v7 = (const std::string::value_type *)(v3 + 432);
if ( *(char *)(v3 + 455) < 0 )
v7 = *(const std::string::value_type **)v7;
std::string::assign(a2, v7);
goto LABEL_15;
}
if ( *(_BYTE *)(v3 + 609) == 1 )
{
v8 = sub_1001FC380(a2);
memset(&__str, 0, sizeof(__str));
std::string::reserve(&__str, 3LL * v8);
if ( v8 >= 1 )
{
do
{
std::string::append(&__str, "•");
--v8;
}
while ( v8 );
}
std::string::operator=(a2, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}
LABEL_15:
*(_QWORD *)(v3 + 520) = *(_QWORD *)(v3 + 512);
v9 = *(_QWORD *)(v3 + 536);
if ( v9 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 584LL))(v9, 1);
if ( *(int *)(v3 + 504) >= 1 && (*(_BYTE *)(v3 + 609) & 1) == 0 )
{
v10 = (char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 576) + 1248LL))(*(_QWORD *)(v3 + 576));
sub_100009900(&__str, v10);
sub_100009900(__p, "");
v11 = sub_1000045BC(&__str, __p);
if ( v43 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( !v11 )
{
EmoteSprite::parseTokens(a2);
v12 = (char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 576) + 1248LL))(*(_QWORD *)(v3 + 576));
v13 = sub_100009900(&__str, v12);
v14 = *(_QWORD *)(v3 + 576);
if ( (*(_DWORD *)(v14 + 752) & 0x80000000) == 0 )
{
v15 = sub_1001FC2D0(v13);
v16 = (_DWORD *)sub_1001FC790(v3, v15);
if ( v16 )
{
LODWORD(v17) = v16[2] + *v16;
p_str = (std::string *)__str.__r_.__value_.__r.__words[0];
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_str = &__str;
v19 = HIBYTE(__str.__r_.__value_.__r.__words[2]);
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
v19 = __str.__r_.__value_.__r.__words[1];
if ( v19 >= (int)v17 )
v17 = (unsigned int)v17;
else
v17 = (unsigned int)v19;
if ( (int)v17 < 1 )
{
v20 = 0;
}
else
{
v20 = 0;
do
{
v21 = p_str->__r_.__value_.__s.__data_[0];
p_str = (std::string *)((char *)p_str + 1);
if ( (v21 & 0xC0) != 0x80 )
++v20;
--v17;
}
while ( v17 );
}
*(_DWORD *)(v14 + 752) = v20;
}
}
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}
}
v22 = *(_QWORD *)(v3 + 600);
if ( !v22 )
{
v29 = *(_QWORD *)(v3 + 616);
if ( v29 )
{
if ( *(_QWORD *)(v3 + 640) || (v30 = *(float *)(v3 + 652), v30 <= 0.0) )
{
if ( SHIBYTE(a2->__r_.__value_.__r.__words[2]) < 0 )
a2 = (std::string *)a2->__r_.__value_.__r.__words[0];
sub_100009900(v38, (char *)a2);
TextArea::setString(v29, (const void **)v38);
if ( (v39 & 0x80000000) == 0 )
goto LABEL_69;
v31 = v38[0];
}
else
{
if ( SHIBYTE(a2->__r_.__value_.__r.__words[2]) < 0 )
{
sub_1000097D0(&__dst, a2->__r_.__value_.__l.__data_, a2->__r_.__value_.__l.__size_);
v30 = *(float *)(v3 + 652);
}
else
{
__dst = *(_OWORD *)&a2->__r_.__value_.__l.__data_;
v41 = a2->__r_.__value_.__r.__words[2];
}
sub_10011B3E8(v29, (__int64)&__dst, *(float *)(v3 + 656), v30, 0.5, 0.0);
if ( (SHIBYTE(v41) & 0x80000000) == 0 )
goto LABEL_69;
v31 = (void *)__dst;
}
operator delete(v31);
}
LABEL_69:
CCTextInputNode::refreshLabel(v3);
goto LABEL_70;
}
if ( *(_QWORD *)(v3 + 512) == *(_QWORD *)(v3 + 520) )
{
if ( SHIBYTE(a2->__r_.__value_.__r.__words[2]) < 0 )
a2 = (std::string *)a2->__r_.__value_.__r.__words[0];
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v22 + 928LL))(v22, a2);
goto LABEL_69;
}
memset(&__str, 0, sizeof(__str));
sub_100206248(&__str);
v23 = *(_QWORD *)(v3 + 600);
EmoteSprite::replaceTokens(__p, a2, &__str, 0.0);
if ( v43 >= 0 )
v24 = __p;
else
v24 = (void **)__p[0];
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v23 + 928LL))(v23, v24);
if ( v43 < 0 )
operator delete(__p[0]);
refreshed = CCTextInputNode::refreshLabel(v3);
v26 = *(_QWORD *)(v3 + 536);
if ( !v26 )
{
v27 = cocos2d::CCNode::create(refreshed);
*(_QWORD *)(v3 + 536) = v27;
v28 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 600) + 104LL))(*(_QWORD *)(v3 + 600));
(*(void (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)v3 + 464LL))(v3, v27, (unsigned int)(v28 + 1));
v26 = *(_QWORD *)(v3 + 536);
}
EmoteSprite::attachToLabel(*(_QWORD *)(v3 + 600), v26, &__str, 0.0);
if ( __str.__r_.__value_.__r.__words[0] )
{
__str.__r_.__value_.__l.__size_ = __str.__r_.__value_.__r.__words[0];
operator delete(__str.__r_.__value_.__l.__data_);
}
LABEL_70:
v32 = (char *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v3 + 576) + 1248LL))(*(_QWORD *)(v3 + 576));
sub_100009900(&__str, v32);
sub_100009900(__p, "");
v33 = sub_1000045BC(&__str, __p);
if ( v43 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(__str.__r_.__value_.__l.__data_);
if ( !v33 )
goto LABEL_75;
goto LABEL_74;
}
if ( v33 )
LABEL_74:
*(_DWORD *)(*(_QWORD *)(v3 + 576) + 752LL) = -1;
LABEL_75:
v34 = *(_QWORD *)(v3 + 640);
if ( v34 )
{
v35 = *(_QWORD *)(v3 + 616);
if ( v35 )
{
v36 = *(float *)(v35 + 648) + (float)*(int *)(v35 + 672);
v37.n128_f64[0] = (*(double (__fastcall **)(__int64))(*(_QWORD *)v35 + 168LL))(v35);
v37.n128_f32[0] = (float)(v36 * v37.n128_f32[0]) + 4.0;
ScrollableContentLayer::setContentHeight(v34, v37);
}
}
return sub_1001FCD10(v3, *(unsigned int *)(*(_QWORD *)(v3 + 576) + 752LL));
}