//
// AccountLoginLayer::onSubmit from 0x5868fc to 0x586ad4 (472 bytes)
//
// 0 xrefs:
//
// 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:52:58 +0000
//
int __fastcall AccountLoginLayer::onSubmit(AccountLoginLayer *this, cocos2d::CCObject *a2)
{
int *v3; // r9
_BYTE *v4; // r2
int v5; // r3
bool v6; // zf
int *v7; // r6
int v8; // r0
int v9; // r1
int v10; // r2
int v11; // r0
int v12; // r1
int v13; // r2
int v14; // r3
unsigned int v15; // r3
AccountLoginLayer *v16; // r0
int v17; // r1
int v18; // r3
unsigned int v19; // r3
GJAccountManager *v20; // r0
int v22; // r0
int v23; // r1
int v24; // r2
GJAccountManager *v25; // r0
GJAccountManager *v26; // r10
int v27; // r6
int v28[3]; // [sp+4h] [bp-1Ch] BYREF
int v29; // [sp+10h] [bp-10h] BYREF
int v30; // [sp+14h] [bp-Ch]
int v31; // [sp+18h] [bp-8h]
v3 = (int *)((char *)this + 548);
AccountLoginLayer::resetLabels(this);
AccountLoginLayer::disableNodes(this);
CCTextInputNode::getString((CCTextInputNode *)&v29, *((_DWORD *)this + 132));
v6 = (*((_BYTE *)this + 548) & 1) == 0;
if ( (*((_BYTE *)this + 548) & 1) != 0 )
{
v4 = *((_BYTE **)this + 139);
v5 = 0;
}
else
{
*((_BYTE *)this + 549) = 0;
*((_BYTE *)this + 548) = 0;
}
v7 = (int *)((char *)this + 560);
if ( !v6 )
{
*v4 = v5;
*((_DWORD *)this + 138) = v5;
}
std::string::reserve(v3, 0);
v8 = v29;
v9 = v30;
v10 = v31;
v29 = 0;
v30 = 0;
v31 = 0;
*v3 = v8;
v3[1] = v9;
v3[2] = v10;
std::string::~string((int)&v29);
CCTextInputNode::getString((CCTextInputNode *)&v29, *((_DWORD *)this + 133));
if ( (*((_BYTE *)this + 560) & 1) != 0 )
{
**((_BYTE **)this + 142) = 0;
*((_DWORD *)this + 141) = 0;
}
else
{
*((_BYTE *)this + 561) = 0;
*((_BYTE *)this + 560) = 0;
}
std::string::reserve((int *)this + 140, 0);
v11 = v29;
v12 = v30;
v13 = v31;
v29 = 0;
v30 = 0;
v31 = 0;
*v7 = v11;
*((_DWORD *)this + 141) = v12;
*((_DWORD *)this + 142) = v13;
std::string::~string((int)&v29);
v14 = *((unsigned __int8 *)this + 548);
if ( (v14 & 1) != 0 )
v15 = *((_DWORD *)this + 138);
else
v15 = v14 >> 1;
if ( v15 <= 2 )
{
v16 = this;
v17 = -9;
return AccountLoginLayer::updateLabel((int)v16, v17);
}
v18 = *((unsigned __int8 *)this + 560);
if ( (v18 & 1) != 0 )
v19 = *((_DWORD *)this + 141);
else
v19 = v18 >> 1;
if ( v19 <= 5 )
{
v16 = this;
v17 = -8;
return AccountLoginLayer::updateLabel((int)v16, v17);
}
v20 = (GJAccountManager *)passwordCharsValid((unsigned __int8 *)this + 560);
if ( !v20 )
{
v16 = this;
v17 = -14;
return AccountLoginLayer::updateLabel((int)v16, v17);
}
*(_DWORD *)(GJAccountManager::sharedState(v20) + 308) = (char *)this + 520;
std::string::basic_string(v28, (int)this + 560);
GJAccountManager::getShaPassword(&v29, (int)v28);
if ( (*((_BYTE *)this + 560) & 1) != 0 )
{
**((_BYTE **)this + 142) = 0;
*((_DWORD *)this + 141) = 0;
}
else
{
*((_BYTE *)this + 561) = 0;
*((_BYTE *)this + 560) = 0;
}
std::string::reserve((int *)this + 140, 0);
v22 = v29;
v23 = v30;
v24 = v31;
v29 = 0;
v30 = 0;
v31 = 0;
*v7 = v22;
*((_DWORD *)this + 141) = v23;
*((_DWORD *)this + 142) = v24;
std::string::~string((int)&v29);
v25 = (GJAccountManager *)std::string::~string((int)v28);
v26 = (GJAccountManager *)GJAccountManager::sharedState(v25);
std::string::basic_string(v28, (int)v3);
std::string::basic_string(&v29, (int)this + 560);
v27 = GJAccountManager::loginAccount(v26, (int)v28, (int)&v29);
std::string::~string((int)&v29);
std::string::~string((int)v28);
if ( v27 )
return AccountLoginLayer::showLoadingUI(this);
else
return (*(int (__fastcall **)(AccountLoginLayer *, int))(*(_DWORD *)this + 692))(this, -1);
}