//
// AccountRegisterLayer::onSubmit from 0x468f18 to 0x46910c (500 bytes)
//
// 0 xrefs:
//
// 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 AccountRegisterLayer::onSubmit(AccountRegisterLayer *a1, cocos2d::CCObject *a2)
{
_BOOL4 valid; // r11
AccountRegisterLayer *v4; // r0
AccountError v5; // r1
_BOOL4 v6; // r11
_BOOL4 v7; // r11
GJAccountManager *v8; // [sp+8h] [bp-3Ch]
int v9; // [sp+8h] [bp-3Ch]
char v10; // [sp+10h] [bp-34h] BYREF
char v11; // [sp+14h] [bp-30h] BYREF
char v12; // [sp+18h] [bp-2Ch] BYREF
char v13; // [sp+1Ch] [bp-28h] BYREF
char v14; // [sp+20h] [bp-24h] BYREF
int v15; // [sp+24h] [bp-20h] BYREF
int v16; // [sp+28h] [bp-1Ch] BYREF
const char *v17; // [sp+2Ch] [bp-18h] BYREF
int v18; // [sp+30h] [bp-14h] BYREF
int v19; // [sp+34h] [bp-10h] BYREF
const char *v20; // [sp+38h] [bp-Ch] BYREF
AccountRegisterLayer::resetLabels(a1);
AccountRegisterLayer::disableNodes(a1);
CCTextInputNode::getString((CCTextInputNode *)&v10, (int)a1->m_usernameField);
CCTextInputNode::getString((CCTextInputNode *)&v11, (int)a1->m_passwordField);
CCTextInputNode::getString((CCTextInputNode *)&v12, (int)a1->m_confirmPasswordField);
CCTextInputNode::getString((CCTextInputNode *)&v13, (int)a1->m_emailField);
CCTextInputNode::getString((CCTextInputNode *)&v14, (int)a1->m_verifyEmailField);
sub_775C20(&v15);
valid = AccountRegisterLayer::validUser((int)a1, &v15);
sub_774008(&v15);
if ( !valid )
{
v4 = a1;
v5 = TooShortLessThan3;
LABEL_3:
AccountRegisterLayer::updateLabel(v4, v5);
goto LABEL_4;
}
sub_775C20(&v16);
v6 = AccountRegisterLayer::validPassword((int)a1, &v16);
sub_774008(&v16);
if ( !v6 )
{
v4 = a1;
v5 = TooShortLessThan6;
goto LABEL_3;
}
if ( sub_774DBC(&v11, &v12) )
{
v4 = a1;
v5 = PasswordsDoNotMatch;
goto LABEL_3;
}
sub_775C20(&v17);
v7 = AccountRegisterLayer::validEmail((int)a1, &v17);
sub_774008(&v17);
if ( !v7 )
{
v4 = a1;
v5 = InvalidEmail;
goto LABEL_3;
}
if ( sub_774DBC(&v13, &v14) )
{
v4 = a1;
v5 = EmailsDoNotMatch;
goto LABEL_3;
}
GJAccountManager::sharedState()->m_accountRegisterDelegate = &a1->GJAccountRegisterDelegate;
v8 = GJAccountManager::sharedState();
sub_775C20(&v20);
CCTextInputNode::getString((CCTextInputNode *)&v18, (int)a1->m_passwordField);
CCTextInputNode::getString((CCTextInputNode *)&v19, (int)a1->m_emailField);
v9 = GJAccountManager::registerAccount(v8, &v20, &v18, &v19);
sub_774008(&v19);
sub_774008(&v18);
sub_774008(&v20);
if ( v9 )
AccountRegisterLayer::showLoadingUI(a1);
else
a1->registerAccountFailed(a1, AlreadyUsedUsername|0x1);
LABEL_4:
sub_774008(&v14);
sub_774008(&v13);
sub_774008(&v12);
sub_774008(&v11);
sub_774008(&v10);
}