//
// GJGarageLayer::textInputClosed from 0x8bcfb8 to 0x8bd1dc (548 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJGarageLayer::textInputClosed @ 0x8bd1e0
// > ??> @ 0x6abd0
// > ??> @ 0x145ab78
//
// This function is hookable on this platform (idp: arm, 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:56:28 +0000
//
__int64 __fastcall GJGarageLayer::textInputClosed(GJGarageLayer *this, CCTextInputNode *a2)
{
__int64 *v4; // x0
int v5; // w20
GameManager *v6; // x0
__int64 v7; // x20
__int64 *v8; // x0
char *v9; // x1
char *v10; // x1
size_t v11; // x0
char *v13; // [xsp+48h] [xbp+48h]
__int64 v14; // [xsp+58h] [xbp+58h] BYREF
size_t v15; // [xsp+60h] [xbp+60h]
char *v16; // [xsp+68h] [xbp+68h]
__int64 v17[2]; // [xsp+70h] [xbp+70h] BYREF
void *v18; // [xsp+80h] [xbp+80h]
__int64 v19; // [xsp+88h] [xbp+88h] BYREF
size_t v20; // [xsp+90h] [xbp+90h]
void *v21; // [xsp+98h] [xbp+98h]
__int64 v22[2]; // [xsp+A0h] [xbp+A0h] BYREF
void *v23; // [xsp+B0h] [xbp+B0h]
CCTextInputNode::getString(a2, &v14);
v17[0] = 0;
v17[1] = 0;
v18 = nullptr;
std::string::__init(v17, &byte_11B8890, 0);
v4 = (__int64 *)sub_8B90C8((__int64)&v14, (__int64)v17);
v5 = (unsigned __int8)v4;
if ( (v17[0] & 1) != 0 )
operator delete(v18);
if ( v5 )
v4 = std::string::assign(&v14, "Player");
v6 = (GameManager *)GameManager::sharedState((GameManager *)v4);
*((_BYTE *)v6 + 656) = 0;
v7 = GameManager::sharedState(v6);
v19 = 0;
v20 = 0;
v21 = nullptr;
if ( (v14 & 1) != 0 )
{
std::string::__init(&v19, v16, v15);
}
else
{
v21 = v16;
v19 = v14;
v20 = v15;
}
v8 = (__int64 *)(v7 + 632);
if ( (__int64 *)(v7 + 632) != &v19 )
{
if ( (v19 & 1) != 0 )
std::string::assign(v8, v21, v20);
else
std::string::assign(v8, (char *)&v19 + 1, (unsigned __int8)v19 >> 1);
}
if ( (v19 & 1) != 0 )
operator delete(v21);
v9 = (char *)&v14 + 1;
if ( (v14 & 1) != 0 )
v9 = v16;
GJGarageLayer::updatePlayerName(this, v9);
v10 = (char *)&v14 + 1;
if ( (v14 & 1) != 0 )
v10 = v16;
v13 = v10;
v22[0] = 0;
v22[1] = 0;
v23 = nullptr;
v11 = strlen(v10);
std::string::__init(v22, v13, v11);
CCTextInputNode::setString(a2, (char *)v22);
if ( (v22[0] & 1) != 0 )
operator delete(v23);
if ( (v14 & 1) != 0 )
operator delete(v16);
return _stack_chk_guard;
}