//
// AccountRegisterLayer::textInputClosed from 0x100498000 to 0x1004987fe (2046 bytes)
//
// 2 xrefs:
// > sub_100498870 @ 0x10049887c
// > ??> @ 0x100944430
//
// 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 AccountRegisterLayer::textInputClosed(AccountRegisterLayer *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
const char *v5; // rsi
__int64 v6; // rbx
size_t v7; // r12
char *v8; // rdi
double v9; // xmm0_8
char *v10; // rdi
size_t v11; // rax
char *v12; // r14
unsigned int v13; // eax
__int64 v14; // rcx
int v15; // edx
__int64 v16; // rsi
int v17; // edi
void *v18; // rdi
int v19; // r8d
size_t v20; // rbx
size_t v21; // rbx
size_t v22; // rdx
char v23; // bl
size_t v24; // rcx
char *v25; // rdi
size_t v26; // rdx
char v27; // r13
size_t v28; // r14
_BYTE *v29; // r15
size_t v30; // rdx
AccountRegisterLayer *v31; // rbx
size_t v32; // rdx
char v33; // r13
size_t v34; // rcx
char *v35; // rdi
size_t v36; // rdx
char v37; // bl
cocos2d::CCLabelBMFont **p_m_usernameLabel; // rax
size_t v39; // r14
_BYTE *v40; // r15
_BYTE *v41; // rsi
size_t v42; // r12
size_t v43; // rdx
int v44; // r9d
int v45; // r10d
int v46; // r9d
int v47; // r10d
int v48; // r9d
int v49; // r10d
int v50; // r9d
char __s2[18]; // [rsp+1h] [rbp-EFh] BYREF
__int128 v52; // [rsp+19h] [rbp-D7h] BYREF
__int16 v53; // [rsp+29h] [rbp-C7h]
__int128 v54; // [rsp+30h] [rbp-C0h] BYREF
void *__p; // [rsp+40h] [rbp-B0h]
__int128 v56; // [rsp+50h] [rbp-A0h] BYREF
void *v57; // [rsp+60h] [rbp-90h]
char __s[16]; // [rsp+70h] [rbp-80h] BYREF
void *v59; // [rsp+80h] [rbp-70h]
AccountRegisterLayer *v60; // [rsp+88h] [rbp-68h]
void *p_m_confirmPasswordLabel; // [rsp+90h] [rbp-60h]
__int64 v62; // [rsp+98h] [rbp-58h] BYREF
size_t v63; // [rsp+A0h] [rbp-50h]
void *__s1; // [rsp+A8h] [rbp-48h]
size_t __n[2]; // [rsp+B0h] [rbp-40h] BYREF
void *v66; // [rsp+C0h] [rbp-30h]
CCTextInputNode::getString(__n, (__int64)a2, v2);
switch ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) )
{
case 1u:
v5 = "Username: (shown to other players)";
v6 = 696;
goto LABEL_7;
case 2u:
v5 = "Password:";
v6 = 704;
goto LABEL_7;
case 3u:
v5 = "Confirm Password:";
v6 = 712;
goto LABEL_7;
case 4u:
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_emailLabel->setString)(
a1->m_emailLabel,
"Email:");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))a1->m_emailLabel->setColor)(
a1->m_emailLabel,
&unk_10081D314);
goto LABEL_4;
case 5u:
LABEL_4:
v5 = "Verify Email:";
v6 = 728;
LABEL_7:
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6)
+ 912LL))(
*(AccountRegisterLayer_vtbl **)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6),
v5);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6)
+ 1056LL))(
*(AccountRegisterLayer_vtbl **)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6),
&unk_10081D314);
break;
default:
break;
}
switch ( ((unsigned int (__fastcall *)(CCTextInputNode *))a2->getTag)(a2) )
{
case 1u:
if ( (__n[0] & 1) != 0 )
{
sub_100006B70(&v54, v66, __n[1], v2);
}
else
{
__p = v66;
v54 = *(_OWORD *)__n;
}
if ( (v54 & 1) != 0 )
{
if ( *((_QWORD *)&v54 + 1) > 2u )
{
v18 = __p;
goto LABEL_46;
}
}
else if ( (unsigned __int8)v54 > 4u )
{
goto LABEL_108;
}
if ( (__n[0] & 1) != 0 )
{
v21 = __n[1];
if ( (v54 & 1) == 0 )
goto LABEL_105;
}
else
{
v21 = LOBYTE(__n[0]) >> 1;
if ( (v54 & 1) == 0 )
{
LABEL_105:
if ( !v21 )
goto LABEL_108;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_usernameLabel->setString)(
a1->m_usernameLabel,
"Too short. Minimum 3 characters");
p_m_usernameLabel = &a1->m_usernameLabel;
goto LABEL_107;
}
}
operator delete(__p);
goto LABEL_105;
case 2u:
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_confirmPasswordLabel->setString)(
a1->m_confirmPasswordLabel,
"Confirm Password:");
p_m_confirmPasswordLabel = &a1->m_confirmPasswordLabel;
v9 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *, void *))a1->m_confirmPasswordLabel->setColor)(
a1->m_confirmPasswordLabel,
&unk_10081D314);
CCTextInputNode::getString(&v62, (__int64)a1->m_confirmPasswordField, v9);
strcpy(__s2, "Confirm Password:");
v10 = (char *)&v62 + 1;
v60 = a1;
if ( (v62 & 1) != 0 )
{
v11 = v63;
v10 = (char *)__s1;
}
else
{
v11 = (unsigned __int8)v62 >> 1;
}
v32 = 17;
if ( v11 < 0x11 )
v32 = v11;
v33 = 1;
if ( ((v11 == 17) & (memcmp(v10, __s2, v32) == 0)) == 0 )
{
*(_QWORD *)&v52 = 0x64726F7773736150LL;
v34 = LOBYTE(__n[0]) >> 1;
v35 = (char *)__n + 1;
if ( (__n[0] & 1) != 0 )
v35 = (char *)v66;
WORD4(v52) = 58;
if ( (__n[0] & 1) != 0 )
v34 = __n[1];
v36 = 9;
if ( v34 < 9 )
v36 = v34;
v33 = (v34 == 9) & (memcmp(v35, &v52, v36) == 0);
}
if ( (__n[0] & 1) != 0 )
{
sub_100006B70(&v56, v66, __n[1], 1.757001349190059e-152);
}
else
{
v57 = v66;
v56 = *(_OWORD *)__n;
}
if ( (v56 & 1) != 0 )
{
if ( *((_QWORD *)&v56 + 1) > 5u )
{
operator delete(v57);
goto LABEL_115;
}
}
else if ( (unsigned __int8)v56 > 0xAu )
{
goto LABEL_115;
}
if ( (__n[0] & 1) != 0 )
{
v37 = *(_BYTE *)v66;
if ( (v56 & 1) == 0 )
goto LABEL_113;
}
else
{
v37 = BYTE1(__n[0]);
if ( (v56 & 1) == 0 )
goto LABEL_113;
}
operator delete(v57);
LABEL_113:
if ( v37 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))v60->m_passwordLabel->setString)(
v60->m_passwordLabel,
"Too short. Minimum 6 characters");
p_m_confirmPasswordLabel = &v60->m_passwordLabel;
LABEL_127:
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)p_m_confirmPasswordLabel + 1056LL))(
*(_QWORD *)p_m_confirmPasswordLabel,
&unk_10081D311);
goto LABEL_128;
}
LABEL_115:
if ( (__n[0] & 1) != 0 )
{
v39 = __n[1];
v40 = v66;
v41 = (char *)&v62 + 1;
if ( (v62 & 1) == 0 )
{
LABEL_117:
v42 = (unsigned __int8)v62 >> 1;
goto LABEL_120;
}
}
else
{
v39 = LOBYTE(__n[0]) >> 1;
v40 = (char *)__n + 1;
v41 = (char *)&v62 + 1;
if ( (v62 & 1) == 0 )
goto LABEL_117;
}
v42 = v63;
v41 = __s1;
LABEL_120:
v43 = v39;
if ( v42 < v39 )
v43 = v42;
if ( (memcmp(v40, v41, v43) || v42 != v39) && *v40 && !(v33 & 1 | (*v41 == 0)) )
{
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)p_m_confirmPasswordLabel + 912LL))(
*(_QWORD *)p_m_confirmPasswordLabel,
"Passwords do not match");
goto LABEL_127;
}
LABEL_128:
if ( (v62 & 1) != 0 )
LABEL_74:
operator delete(__s1);
LABEL_75:
v60->m_lockInput = 0;
if ( (__n[0] & 1) != 0 )
LABEL_109:
operator delete(v66);
return;
case 3u:
CCTextInputNode::getString(&v62, (__int64)a1->m_passwordField, v2);
strcpy(__s2, "Password:");
if ( (__n[0] & 1) != 0 )
{
v7 = __n[1];
v8 = (char *)v66;
}
else
{
v7 = LOBYTE(__n[0]) >> 1;
v8 = (char *)__n + 1;
}
v60 = a1;
v22 = 9;
if ( v7 < 9 )
v22 = v7;
p_m_confirmPasswordLabel = v8;
v23 = 1;
if ( ((v7 == 9) & (memcmp(v8, __s2, v22) == 0)) == 0 )
{
v52 = *(_OWORD *)"Confirm Password:";
v24 = (unsigned __int8)v62 >> 1;
v25 = (char *)&v62 + 1;
if ( (v62 & 1) != 0 )
v25 = (char *)__s1;
v53 = 58;
if ( (v62 & 1) != 0 )
v24 = v63;
v26 = 17;
if ( v24 < 0x11 )
v26 = v24;
v23 = (v24 == 17) & (memcmp(v25, &v52, v26) == 0);
}
v27 = v62;
v28 = (unsigned __int8)v62 >> 1;
if ( (v62 & 1) != 0 )
v28 = v63;
v29 = (char *)&v62 + 1;
if ( (v62 & 1) != 0 )
v29 = __s1;
v30 = v7;
if ( v28 < v7 )
v30 = v28;
if ( (memcmp(p_m_confirmPasswordLabel, v29, v30) || v28 != v7)
&& *(_BYTE *)p_m_confirmPasswordLabel
&& !(v23 & 1 | (*v29 == 0)) )
{
v31 = v60;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))v60->m_confirmPasswordLabel->setString)(
v60->m_confirmPasswordLabel,
"Passwords do not match");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))v31->m_confirmPasswordLabel->setColor)(
v31->m_confirmPasswordLabel,
&unk_10081D311);
v27 = v62;
}
if ( (v27 & 1) != 0 )
goto LABEL_74;
goto LABEL_75;
case 4u:
if ( (__n[0] & 1) != 0 )
{
sub_100006B70(__s, v66, __n[1], v2);
}
else
{
v59 = v66;
*(_OWORD *)__s = *(_OWORD *)__n;
}
if ( (__s[0] & 1) != 0 )
{
v12 = (char *)v59;
if ( !v59 )
goto LABEL_41;
}
else
{
v12 = &__s[1];
}
if ( (unsigned __int8)((*v12 & 0xDF) - 65) > 0x19u )
goto LABEL_41;
v13 = strlen(v12);
if ( !v13 )
goto LABEL_41;
v14 = v13 & 3;
if ( (unsigned __int64)v13 - 1 >= 3 )
{
v15 = -1;
v16 = 0;
v17 = -1;
while ( 1 )
{
v44 = (unsigned __int8)v12[v16];
if ( v44 == 46 )
{
v15 = v16;
v45 = (unsigned __int8)v12[v16 + 1];
v46 = v16 + 1;
if ( v45 == 46 )
goto LABEL_145;
}
else
{
if ( v44 == 64 )
v17 = v16;
v45 = (unsigned __int8)v12[v16 + 1];
v46 = v16 + 1;
if ( v45 == 46 )
{
LABEL_145:
v15 = v46;
v47 = (unsigned __int8)v12[v16 + 2];
v48 = v16 + 2;
if ( v47 == 46 )
goto LABEL_146;
goto LABEL_140;
}
}
if ( v45 == 64 )
v17 = v46;
v47 = (unsigned __int8)v12[v16 + 2];
v48 = v16 + 2;
if ( v47 == 46 )
{
LABEL_146:
v15 = v48;
v49 = (unsigned __int8)v12[v16 + 3];
v50 = v16 + 3;
if ( v49 != 46 )
goto LABEL_147;
goto LABEL_131;
}
LABEL_140:
if ( v47 == 64 )
v17 = v48;
v49 = (unsigned __int8)v12[v16 + 3];
v50 = v16 + 3;
if ( v49 != 46 )
{
LABEL_147:
if ( v49 == 64 )
v17 = v50;
goto LABEL_132;
}
LABEL_131:
v15 = v50;
LABEL_132:
v16 += 4;
if ( v13 - v14 == v16 )
goto LABEL_29;
}
}
v15 = -1;
v16 = 0;
v17 = -1;
LABEL_29:
if ( (v13 & 3) != 0 )
{
do
{
v19 = (unsigned __int8)v12[v16];
if ( v19 == 46 )
{
v15 = v16;
}
else if ( v19 == 64 )
{
v17 = v16;
}
++v16;
--v14;
}
while ( v14 );
}
if ( v17 == -1 || v15 == -1 || v17 > v15 || v15 >= (int)(v13 - 1) )
{
LABEL_41:
if ( (__n[0] & 1) != 0 )
{
v20 = __n[1];
if ( (__s[0] & 1) == 0 )
{
LABEL_101:
if ( v20 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_emailLabel->setString)(
a1->m_emailLabel,
"Email is invalid");
p_m_usernameLabel = &a1->m_emailLabel;
LABEL_107:
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void *))(*p_m_usernameLabel)->setColor)(
*p_m_usernameLabel,
&unk_10081D311);
}
LABEL_108:
a1->m_lockInput = 0;
if ( (__n[0] & 1) == 0 )
return;
goto LABEL_109;
}
}
else
{
v20 = LOBYTE(__n[0]) >> 1;
if ( (__s[0] & 1) == 0 )
goto LABEL_101;
}
operator delete(v59);
goto LABEL_101;
}
if ( (__s[0] & 1) == 0 )
goto LABEL_108;
v18 = v59;
LABEL_46:
operator delete(v18);
a1->m_lockInput = 0;
if ( (__n[0] & 1) != 0 )
goto LABEL_109;
return;
default:
goto LABEL_108;
}
}