//
// GJGarageLayer::textInputOpened from 0x140274c70 to 0x140274e5e (494 bytes)
//
// 2 xrefs:
// > ??> @ 0x14056ad58
// > ??> @ 0x1406d0f08
//
// 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
//
// Hidden C++ exception states: #wind=2
void GJGarageLayer::textInputOpened(GJGarageLayer *a1, CCTextInputNode *a2)
{
__int64 v3; // rax
const char *v4; // rax
size_t v5; // r8
void **v6; // rcx
char *v7; // rbx
unsigned __int64 v8; // r13
unsigned __int64 v9; // r15
size_t v10; // r8
__int64 v11; // rdi
char *v12; // rax
void *v13; // [rsp+20h] [rbp-50h]
__int128 Buf2; // [rsp+28h] [rbp-48h] BYREF
__int64 v15; // [rsp+38h] [rbp-38h]
__int64 v16; // [rsp+40h] [rbp-30h]
void *Buf1[2]; // [rsp+48h] [rbp-28h] BYREF
unsigned __int64 v18; // [rsp+58h] [rbp-18h]
unsigned __int64 v19; // [rsp+60h] [rbp-10h]
v3 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v13 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = qword_1406C2ED8;
}
*(_BYTE *)(v3 + 921) = 1;
v4 = a2->m_textField->getString(&a2->m_textField->cocos2d::CCLabelProtocol);
*(_OWORD *)Buf1 = 0;
v18 = 0;
v19 = 0;
v5 = -1;
do
++v5;
while ( v4[v5] );
sub_14003A930(Buf1, v4, v5);
Buf2 = 0;
v15 = 6;
v16 = 15;
strcpy((char *)&Buf2, "Player");
v6 = Buf1;
v7 = (char *)Buf1[0];
v8 = v19;
if ( v19 > 0xF )
v6 = (void **)Buf1[0];
v9 = v18;
v10 = v18;
if ( v18 > 6 )
v10 = 6;
LODWORD(v11) = memcmp(v6, &Buf2, v10);
if ( !(_DWORD)v11 )
{
if ( v9 >= 6 )
v11 = v9 > 6;
else
LODWORD(v11) = -1;
}
if ( !(_DWORD)v11 )
{
Buf2 = 0;
v15 = 0;
v16 = 15;
LOBYTE(Buf2) = 0;
CCTextInputNode::setString((__int64)a2, &Buf2);
Buf2 = 0;
v15 = 1;
v16 = 15;
strcpy((char *)&Buf2, " ");
CCTextInputNode::updateLabel(a2, (__int64)&Buf2);
}
if ( v8 > 0xF )
{
v12 = v7;
if ( v8 + 1 >= 0x1000 )
{
v7 = *((char **)v7 - 1);
if ( (unsigned __int64)(v12 - v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
}