//
// GJGarageLayer::textInputClosed from 0x10030481c to 0x100304934 (280 bytes)
//
// 2 xrefs:
// > j_GJGarageLayer::textInputClosed @ 0x100304980
// > ??> @ 0x1007ec028
//
// 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 GJGarageLayer::textInputClosed(GJGarageLayer *a1, CCTextInputNode *a2)
{
_BOOL4 v3; // w0
_BOOL4 v4; // w20
GameManager *v5; // x20
std::string *v6; // x1
void *v7[2]; // [xsp+8h] [xbp-78h] BYREF
char v8; // [xsp+1Fh] [xbp-61h]
std::string __str; // [xsp+20h] [xbp-60h] BYREF
void *__p[2]; // [xsp+40h] [xbp-40h] BYREF
char v11; // [xsp+57h] [xbp-29h]
std::string v12; // [xsp+58h] [xbp-28h] BYREF
CCTextInputNode::getString((__int64)a2, &v12);
sub_100009900(__p, "");
v3 = sub_1000045BC(&v12, __p);
v4 = v3;
if ( v11 < 0 )
{
operator delete(__p[0]);
if ( !v4 )
goto LABEL_6;
goto LABEL_5;
}
if ( v3 )
LABEL_5:
std::string::assign(&v12, "Player");
LABEL_6:
GameManager::sharedState()->m_scoreValid = 0;
v5 = GameManager::sharedState();
if ( SHIBYTE(v12.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__str, v12.__r_.__value_.__l.__data_, v12.__r_.__value_.__l.__size_);
else
__str = v12;
std::string::operator=((std::string *)&v5->m_playerName, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (v12.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v6 = &v12;
else
v6 = (std::string *)v12.__r_.__value_.__r.__words[0];
sub_100009900(v7, (char *)v6);
CCTextInputNode::setString(a2, (__int64 **)v7);
if ( v8 < 0 )
operator delete(v7[0]);
if ( SHIBYTE(v12.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v12.__r_.__value_.__l.__data_);
}