//
// SetupSmartTemplateLayer::textInputOpened from 0x1405ef4c0 to 0x1405ef63c (380 bytes)
//
// 2 xrefs:
// > ??> @ 0x140805b20
// > ??> @ 0x14092f15c
//
// 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 11:35:05 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall SetupSmartTemplateLayer::textInputOpened(__int64 a1, _QWORD *a2)
{
int v3; // esi
_BYTE *v4; // rax
size_t v5; // r8
unsigned __int64 v6; // rdi
char *v7; // rbx
void **v8; // rcx
size_t v9; // rsi
size_t v10; // r8
char *v11; // rax
__int128 Buf2; // [rsp+30h] [rbp-68h] BYREF
__int64 v13; // [rsp+40h] [rbp-58h]
__int64 v14; // [rsp+48h] [rbp-50h]
void *Buf1[2]; // [rsp+58h] [rbp-40h] BYREF
size_t v16; // [rsp+68h] [rbp-30h]
unsigned __int64 v17; // [rsp+70h] [rbp-28h]
v3 = (*(__int64 (__fastcall **)(_QWORD *))(*a2 + 56LL))(a2);
v4 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a2[74] + 600LL) + 8LL))(a2[74] + 600LL);
*(_OWORD *)Buf1 = 0;
v16 = 0;
v17 = 0;
v5 = -1;
do
++v5;
while ( v4[v5] );
sub_14003D230(Buf1, v4, v5);
v6 = v17;
v7 = (char *)Buf1[0];
if ( !v3 )
{
Buf2 = 0;
v13 = 0;
v14 = 15;
LOBYTE(Buf2) = 0;
v8 = Buf1;
if ( v17 > 0xF )
v8 = (void **)Buf1[0];
v9 = v16;
v10 = v16;
if ( v16 )
v10 = 0;
if ( !memcmp(v8, &Buf2, v10) && !v9 )
{
Buf2 = 0;
v13 = 1;
v14 = 15;
LOWORD(Buf2) = 32;
CCTextInputNode::updateLabel((__int64)a2, (__int64 *)&Buf2);
}
}
if ( v6 > 0xF )
{
v11 = v7;
if ( v6 + 1 >= 0x1000 )
{
v7 = *((char **)v7 - 1);
if ( (unsigned __int64)(v11 - v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
}