//
// SetupSmartTemplateLayer::textInputClosed from 0x1004e8890 to 0x1004e894c (188 bytes)
//
// 2 xrefs:
// > sub_1004E89B0 @ 0x1004e89bc
// > ??> @ 0x100956e40
//
// 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
//
void __fastcall SetupSmartTemplateLayer::textInputClosed(SetupSmartTemplateLayer *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int v3; // eax
int v4; // r15d
GJSmartTemplate *m_smartTemplate; // rbx
void *v6[3]; // [rsp+8h] [rbp-68h] BYREF
std::string __str; // [rsp+20h] [rbp-50h] BYREF
__int128 v8; // [rsp+40h] [rbp-30h] BYREF
void *__p; // [rsp+50h] [rbp-20h]
v2 = ((double (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
v4 = v3;
CCTextInputNode::getString(v6, (__int64)a2, v2);
if ( !v4 )
{
CCTextInputNode::getString(&v8, (__int64)a2, v2);
m_smartTemplate = a1->m_smartTemplate;
if ( m_smartTemplate )
{
if ( (v8 & 1) != 0 )
{
sub_100006B70(&__str, __p, *((unsigned __int64 *)&v8 + 1), v2);
}
else
{
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)__p;
*(_OWORD *)&__str.__r_.__value_.__l.0 = v8;
}
std::string::operator=((std::string *)&m_smartTemplate->m_templateName, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
}
if ( (v8 & 1) != 0 )
operator delete(__p);
}
if ( ((__int64)v6[0] & 1) != 0 )
operator delete(v6[2]);
}