//
// CCTextInputNode::updateLabel from 0x3e2d98 to 0x3e31b6 (1054 bytes)
//
// 35 xrefs:
// > CCTextInputNode::addTextArea @ 0x3e3276
// > CCTextInputNode::enableTextScroll @ 0x3e3418
// > CCTextInputNode::setString @ 0x3e347e
// > CCTextInputNode::setParseEmotes @ 0x3e3b5a
// > CCTextInputNode::setMaxTextAreaHeight @ 0x3e3bc2
// > CCTextInputNode::textChanged @ 0x3e3c2a
// > CCTextInputNode::onTextFieldDetachWithIME @ 0x3e4a5e
// > LevelSearchLayer::textInputOpened @ 0x497ef2
// > LevelSearchLayer::updateSearchLabel @ 0x49801c
// > EditLevelLayer::textInputOpened @ 0x49fdbe
// > EditLevelLayer::textInputClosed @ 0x4a0692
// > ColorSelectPopup::updateTextInputLabel @ 0x4df784
// > ColorSelectPopup::colorSelectClosed @ 0x4df894
// > ColorSelectPopup::colorSelectClosed @ 0x4df90e
// > ColorSelectPopup::updateCopyColorTextInputLabel @ 0x4df9ec
// > GJGarageLayer::textInputOpened @ 0x50c372
// > CustomizeObjectLayer::textInputOpened @ 0x57f47a
// > SetColorIDPopup::colorSelectClosed @ 0x5d7be4
// > SetColorIDPopup::init @ 0x5daf2c
// > SetupPulsePopup::colorSelectClosed @ 0x5ecca0
// > SetupPulsePopup::colorSelectClosed @ 0x5ecd14
// > SetupPulsePopup::updateTextInputLabel @ 0x5ece08
// > SetupPulsePopup::updateCopyColorTextInputLabel @ 0x5ed01c
// > SecretLayer::textInputOpened @ 0x5fd1fe
// > SecretLayer::updateSearchLabel @ 0x5fd328
// > SecretLayer2::textInputOpened @ 0x61db7e
// > SecretLayer2::updateSearchLabel @ 0x61dca8
// > SecretLayer4::textInputOpened @ 0x621be6
// > SecretLayer4::updateSearchLabel @ 0x621d10
// > SetupSmartTemplateLayer::textInputOpened @ 0x674a08
// > LevelListLayer::textInputOpened @ 0x6d7312
// > LevelListLayer::textInputClosed @ 0x6d8342
// > SecretLayer5::textInputOpened @ 0x6e4d3e
// > SecretLayer5::updateSearchLabel @ 0x6e4e68
// > SecretLayer5::onSubmit @ 0x6e5952
//
// 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 11:47:03 +0000
//
float *__fastcall CCTextInputNode::updateLabel(float *result, int a2)
{
unsigned int v2; // r4
int v4; // r3
_BOOL4 v5; // r7
char *v6; // r1
int v7; // r0
int v8; // r9
int i; // r7
int v10; // r2
int v11; // r3
int v12; // r0
size_t v13; // r7
const char *v14; // r0
const char *v15; // r10
size_t v16; // r0
_BOOL4 v17; // r7
const char *v18; // r0
const char *v19; // r9
size_t v20; // r0
int v21; // r1
int v22; // r0
_DWORD *v23; // r0
int v24; // r7
int v25; // r0
int v26; // r2
int v27; // r7
int v28; // r1
int v29; // r7
bool v30; // nf
size_t v31; // r0
const char *v32; // r0
const char *v33; // r9
size_t v34; // r0
_BOOL4 v35; // r7
int v36; // r1
int v37; // r2
ScrollableContentLayer *v38; // r5
int v39; // r0
float v40; // s16
float v41; // r0
signed int v42; // r7
std::logic_error *exception; // r4
char *v44; // r0
_DWORD *v45; // r3
_DWORD *v46; // lr
char *v47; // r7
int v48; // r1
int v49; // r2
int v50; // r9
void (__fastcall *v51)(int, char *); // r10
char *v52; // r1
cocos2d::CCNode *refreshed; // r0
int v54; // r0
int v55; // r6
void (__fastcall *v56)(unsigned int, int, int); // r9
int v57; // r0
char *v58; // [sp+8h] [bp-28h] BYREF
char *v59; // [sp+Ch] [bp-24h]
char *v60; // [sp+10h] [bp-20h]
size_t v61; // [sp+14h] [bp-1Ch] BYREF
size_t v62; // [sp+18h] [bp-18h]
size_t v63; // [sp+1Ch] [bp-14h]
size_t v64; // [sp+20h] [bp-10h] BYREF
size_t v65; // [sp+24h] [bp-Ch]
char *v66; // [sp+28h] [bp-8h]
v2 = (unsigned int)result;
v4 = *((_DWORD *)result + 107);
if ( v4 )
{
*(float *)(v4 + 376) = result[128];
}
else if ( !*((_DWORD *)result + 109) )
{
return result;
}
v64 = 0;
v65 = 0;
v66 = nullptr;
std::string::__init((int *)&v64, &unk_B6B226, 0);
v5 = sub_3DC1CE((unsigned __int8 *)a2, (unsigned __int8 *)&v64);
std::string::~string((int)&v64);
if ( v5 )
{
if ( (*(_BYTE *)(v2 + 328) & 1) != 0 )
v6 = *(char **)(v2 + 336);
else
v6 = (char *)(v2 + 329);
std::string::assign((int *)a2, v6);
}
else if ( *(_BYTE *)(v2 + 433) )
{
v7 = sub_3DC602((unsigned __int8 *)a2);
v64 = 0;
v65 = 0;
v66 = nullptr;
v8 = v7;
std::string::reserve((int *)&v64, 3 * v7);
for ( i = 0; i < v8; ++i )
std::string::append(&v64, &unk_B7AF60, 3u);
std::string::operator=((unsigned __int8 *)a2, (unsigned __int8 *)&v64);
std::string::~string((int)&v64);
}
v10 = *(_DWORD *)(v2 + 376);
while ( 1 )
{
v11 = *(_DWORD *)(v2 + 380);
if ( v10 == v11 )
break;
*(_DWORD *)(v2 + 380) = v11 - 12;
}
v12 = *(_DWORD *)(v2 + 388);
if ( v12 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v12 + 292))(v12, 1);
if ( *(int *)(v2 + 372) > 0 )
{
v13 = *(unsigned __int8 *)(v2 + 433);
if ( !*(_BYTE *)(v2 + 433) )
{
v14 = (const char *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 416) + 624))(*(_DWORD *)(v2 + 416));
v61 = v13;
v62 = v13;
v63 = v13;
v15 = v14;
v16 = strlen(v14);
std::string::__init((int *)&v61, v15, v16);
v64 = v13;
v65 = v13;
v66 = (char *)v13;
std::string::__init((int *)&v64, &unk_B6B226, v13);
v17 = sub_3DC1CE((unsigned __int8 *)&v61, (unsigned __int8 *)&v64);
std::string::~string((int)&v64);
std::string::~string((int)&v61);
if ( !v17 )
{
EmoteSprite::parseTokens(a2, v2 + 376, *(_DWORD *)(v2 + 372));
v18 = (const char *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 416) + 624))(*(_DWORD *)(v2 + 416));
v64 = 0;
v65 = 0;
v66 = nullptr;
v19 = v18;
v20 = strlen(v18);
std::string::__init((int *)&v64, v19, v20);
v21 = *(_DWORD *)(*(_DWORD *)(v2 + 416) + 608);
if ( v21 >= 0 )
{
v22 = sub_3DC656((unsigned __int8 *)&v64, v21);
v23 = CCTextInputNode::emoteTokenContaining((CCTextInputNode *)v2, v22);
if ( v23 )
{
v24 = *(_DWORD *)(v2 + 416);
*(_DWORD *)(v24 + 608) = sub_3DC19C((unsigned __int8 *)&v64, v23[1] + *v23);
}
}
std::string::~string((int)&v64);
}
}
}
v25 = *(_DWORD *)(v2 + 428);
if ( v25 )
{
v26 = *(_DWORD *)(v2 + 376);
v27 = *(_DWORD *)(v2 + 380);
if ( v26 != v27 )
{
v42 = v27 - v26;
v58 = nullptr;
v59 = nullptr;
v60 = nullptr;
if ( -1431655765 * (v42 >> 2) )
{
if ( (unsigned int)(-1431655765 * (v42 >> 2)) > 0x15555555 )
{
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "vector");
*(_DWORD *)exception = &off_D1546C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::length_error,
(void (*)(void *))std::length_error::~length_error);
}
v44 = (char *)operator new(v42);
v45 = *(_DWORD **)(v2 + 376);
v46 = *(_DWORD **)(v2 + 380);
v59 = v44;
v58 = v44;
v60 = &v44[v42];
while ( v45 != v46 )
{
v47 = v59;
if ( v59 )
{
v48 = v45[1];
v49 = v45[2];
*(_DWORD *)v59 = *v45;
*((_DWORD *)v47 + 1) = v48;
*((_DWORD *)v47 + 2) = v49;
}
v45 += 3;
v59 += 12;
}
}
v50 = *(_DWORD *)(v2 + 428);
v51 = *(void (__fastcall **)(int, char *))(*(_DWORD *)v50 + 464);
EmoteSprite::replaceTokens(&v64, a2, &v58, 0);
if ( (v64 & 1) != 0 )
v52 = v66;
else
v52 = (char *)&v64 + 1;
v51(v50, v52);
std::string::~string((int)&v64);
refreshed = (cocos2d::CCNode *)CCTextInputNode::refreshLabel(v2);
if ( !*(_DWORD *)(v2 + 388) )
{
v54 = cocos2d::CCNode::create(refreshed);
*(_DWORD *)(v2 + 388) = v54;
v55 = v54;
v56 = *(void (__fastcall **)(unsigned int, int, int))(*(_DWORD *)v2 + 232);
v57 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 428) + 52))(*(_DWORD *)(v2 + 428));
v56(v2, v55, v57 + 1);
}
EmoteSprite::attachToLabel(*(_DWORD *)(v2 + 428), *(_DWORD *)(v2 + 388), &v58, 0);
std::__vector_base::~__vector_base(&v58);
goto LABEL_44;
}
if ( (*(_BYTE *)a2 & 1) != 0 )
v28 = *(_DWORD *)(a2 + 8);
else
v28 = a2 + 1;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 464))(v25, v28);
}
else
{
v29 = *(_DWORD *)(v2 + 436);
if ( v29 )
{
if ( *(_DWORD *)(v2 + 452) || *(float *)(v2 + 460) <= 0.0 )
{
v30 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v64 = 0;
if ( v30 )
a2 = *(_DWORD *)(a2 + 8);
v65 = 0;
v66 = nullptr;
v31 = strlen((const char *)a2);
std::string::__init((int *)&v64, (const void *)a2, v31);
TextArea::setString(v29, &v64);
}
else
{
std::string::basic_string((int *)&v64, a2);
TextArea::fitString(v29, (int)&v64, *(float *)(v2 + 464), *(float *)(v2 + 460), 0.5, 0.0);
}
std::string::~string((int)&v64);
}
}
CCTextInputNode::refreshLabel(v2);
LABEL_44:
v32 = (const char *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v2 + 416) + 624))(*(_DWORD *)(v2 + 416));
v61 = 0;
v62 = 0;
v63 = 0;
v33 = v32;
v34 = strlen(v32);
std::string::__init((int *)&v61, v33, v34);
v64 = 0;
v65 = 0;
v66 = nullptr;
std::string::__init((int *)&v64, &unk_B6B226, 0);
v35 = sub_3DC1CE((unsigned __int8 *)&v61, (unsigned __int8 *)&v64);
std::string::~string((int)&v64);
std::string::~string((int)&v61);
if ( v35 )
{
v37 = -1;
*(_DWORD *)(*(_DWORD *)(v2 + 416) + 608) = -1;
}
v38 = *(ScrollableContentLayer **)(v2 + 452);
if ( v38 )
{
v39 = *(_DWORD *)(v2 + 436);
if ( v39 )
{
v40 = (float)*(int *)(v39 + 568) + *(float *)(v39 + 544);
v41 = (*(float (**)(void))(*(_DWORD *)v39 + 84))();
ScrollableContentLayer::setContentHeight(v38, (float)(v40 * v41) + 4.0);
}
}
return CCTextInputNode::updateBlinkLabel((CCTextInputNode *)v2, v36, v37);
}