//
// LevelListLayer::textInputClosed from 0x10034c330 to 0x10034c4b3 (387 bytes)
//
// 2 xrefs:
// > sub_10034C510 @ 0x10034c51c
// > ??> @ 0x100b20600
//
// 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:28:48 +0000
//
void __fastcall LevelListLayer::textInputClosed(__int64 a1, __int64 a2)
{
std::string *v2; // r14
char *v3; // r14
size_t v4; // rax
std::string::size_type v5; // r15
char *data; // r12
size_t v7; // r13
char *v8[2]; // [rsp+8h] [rbp-88h] BYREF
char *__s; // [rsp+18h] [rbp-78h]
std::string __str; // [rsp+20h] [rbp-70h] BYREF
__int128 v11; // [rsp+38h] [rbp-58h] BYREF
void *__p; // [rsp+48h] [rbp-48h]
std::string __dst[2]; // [rsp+50h] [rbp-40h] BYREF
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) != 1002 )
return;
CCTextInputNode::getString(&v11, a2);
v2 = *(std::string **)(a1 + 912);
if ( (v11 & 1) != 0 )
{
sub_10001AD30(&__str, __p, *((unsigned __int64 *)&v11 + 1));
}
else
{
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)__p;
*(_OWORD *)&__str.__r_.__value_.__l.0 = v11;
}
std::string::operator=(v2 + 18, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
CCTextInputNode::getString(v8, a2);
if ( ((__int64)v8[0] & 1) != 0 )
v3 = __s;
else
v3 = (char *)v8 + 1;
v4 = strlen(v3);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
data = (char *)operator new(v7);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v7 | 1;
__dst[0].__r_.__value_.__l.__size_ = v5;
}
else
{
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v4);
data = __dst[0].__r_.__value_.__s.__data_;
if ( !v4 )
goto LABEL_18;
}
memmove(data, v3, v5);
LABEL_18:
data[v5] = 0;
CCTextInputNode::updateLabel(a2, __dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(__dst[0].__r_.__value_.__l.__data_);
if ( ((__int64)v8[0] & 1) == 0 )
{
LABEL_20:
if ( (v11 & 1) == 0 )
return;
goto LABEL_21;
}
}
else if ( ((__int64)v8[0] & 1) == 0 )
{
goto LABEL_20;
}
operator delete(__s);
if ( (v11 & 1) != 0 )
LABEL_21:
operator delete(__p);
}