//
// GJGarageLayer::textInputClosed from 0x50ce64 to 0x50cf76 (274 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'GJGarageLayer::textInputClosed @ 0x50cf88
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:51:29 +0000
//
int __fastcall GJGarageLayer::textInputClosed(GJGarageLayer *this, CCTextInputNode *a2)
{
_BOOL4 v4; // r9
int *v5; // r0
GameManager *v6; // r0
int v7; // r9
char *v8; // r1
char *v9; // r1
size_t v10; // r2
size_t v11; // r0
int v13[2]; // [sp+4h] [bp-38h] BYREF
char *v14; // [sp+Ch] [bp-30h]
int v15[3]; // [sp+10h] [bp-2Ch] BYREF
int v16[3]; // [sp+1Ch] [bp-20h] BYREF
int v17[3]; // [sp+28h] [bp-14h] BYREF
CCTextInputNode::getString((CCTextInputNode *)v13, (int)a2);
memset(v15, 0, sizeof(v15));
std::string::__init(v15, &unk_B6B226, 0);
v4 = sub_50AA62((unsigned __int8 *)v13, (unsigned __int8 *)v15);
v5 = (int *)std::string::~string((int)v15);
if ( v4 )
v5 = std::string::assign(v13, "Player");
v6 = (GameManager *)GameManager::sharedState((GameManager *)v5);
*((_BYTE *)v6 + 460) = 0;
v7 = GameManager::sharedState(v6);
std::string::basic_string(v16, (int)v13);
if ( (int *)(v7 + 448) != v16 )
{
if ( (v16[0] & 1) != 0 )
{
v9 = (char *)v16[2];
v10 = v16[1];
}
else
{
v10 = (int)LOBYTE(v16[0]) >> 1;
v9 = (char *)v16 + 1;
}
std::string::assign((_DWORD *)(v7 + 448), v9, v10);
}
std::string::~string((int)v16);
if ( (v13[0] & 1) != 0 )
v8 = v14;
else
v8 = (char *)v13 + 1;
GJGarageLayer::updatePlayerName(this, v8);
if ( (v13[0] & 1) == 0 )
this = (GJGarageLayer *)((char *)v13 + 1);
v17[0] = 0;
if ( (v13[0] & 1) != 0 )
this = (GJGarageLayer *)v14;
v17[1] = 0;
v17[2] = 0;
v11 = strlen((const char *)this);
std::string::__init(v17, this, v11);
CCTextInputNode::setString((int)a2, (int)v17);
std::string::~string((int)v17);
return std::string::~string((int)v13);
}