//
// AccountLoginLayer::onSubmit from 0x100491da0 to 0x1004921b2 (1042 bytes)
//
// 1 xrefs:
// > AccountLoginLayer::init @ 0x10049134e
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:30:47 +0000
//
__int64 __fastcall AccountLoginLayer::onSubmit(__int64 a1)
{
unsigned __int8 *v2; // r15
__int64 v3; // rsi
__int128 *v4; // rdi
unsigned __int8 *v5; // r12
unsigned int v6; // eax
unsigned int v7; // ecx
__int64 v8; // rax
__int64 v9; // rcx
__int64 v10; // rdi
__int64 *v11; // rdi
__int64 v12; // rax
const char *v13; // rsi
__int64 v14; // rdx
std::string::pointer data; // rdi
__int64 v16; // r14
bool v17; // r14
std::string v19; // [rsp+0h] [rbp-90h] BYREF
__int128 v20; // [rsp+20h] [rbp-70h] BYREF
void *v21; // [rsp+30h] [rbp-60h]
__int128 v22; // [rsp+40h] [rbp-50h] BYREF
void *v23; // [rsp+50h] [rbp-40h]
__int128 v24; // [rsp+58h] [rbp-38h] BYREF
__int64 v25; // [rsp+68h] [rbp-28h]
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 696) + 928LL))(*(_QWORD *)(a1 + 696), "Username:");
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 696) + 1072LL))(*(_QWORD *)(a1 + 696), &unk_100A0B963);
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 704) + 928LL))(*(_QWORD *)(a1 + 704), "Password:");
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 704) + 1072LL))(*(_QWORD *)(a1 + 704), &unk_100A0B963);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 680) + 1160LL))(*(_QWORD *)(a1 + 680), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 1160LL))(*(_QWORD *)(a1 + 688), 0);
CCTextInputNode::getString(&v24, *(_QWORD *)(a1 + 680));
v2 = (unsigned __int8 *)(a1 + 720);
if ( (*(_BYTE *)(a1 + 720) & 1) != 0 )
operator delete(*(void **)(a1 + 736));
*(_QWORD *)(a1 + 736) = v25;
*(_OWORD *)v2 = v24;
v3 = *(_QWORD *)(a1 + 688);
v4 = &v24;
CCTextInputNode::getString(&v24, v3);
v5 = (unsigned __int8 *)(a1 + 744);
if ( (*(_BYTE *)(a1 + 744) & 1) != 0 )
{
v4 = *(__int128 **)(a1 + 760);
operator delete(v4);
}
*(_QWORD *)(a1 + 760) = v25;
*(_OWORD *)v5 = v24;
v6 = *v2;
if ( (v6 & 1) != 0 )
{
if ( *(_QWORD *)(a1 + 728) > 2u )
{
LABEL_7:
v7 = *v5;
if ( (v7 & 1) != 0 )
{
if ( *(_QWORD *)(a1 + 752) > 5u )
goto LABEL_9;
}
else if ( v7 >> 1 > 5uLL )
{
LABEL_9:
if ( (v7 & 1) != 0 )
{
v8 = *(_QWORD *)(a1 + 760);
v9 = *(_QWORD *)(a1 + 752);
if ( !v9 )
{
LABEL_20:
*(_QWORD *)(GJAccountManager::sharedState((__int64)v4, v3) + 400) = a1 + 664;
if ( (*(_BYTE *)(a1 + 744) & 1) != 0 )
{
sub_10001AD30(&v19, *(const void **)(a1 + 760), *(_QWORD *)(a1 + 752));
}
else
{
v19.__r_.__value_.__r.__words[2] = *(_QWORD *)(a1 + 760);
*(_OWORD *)&v19.__r_.__value_.__l.0 = *(_OWORD *)v5;
}
data = (std::string::pointer)&v24;
GJAccountManager::getShaPassword((size_t *)&v24, &v19);
if ( (*v5 & 1) != 0 )
{
data = *(std::string::pointer *)(a1 + 760);
operator delete(data);
}
*(_QWORD *)(a1 + 760) = v25;
*(_OWORD *)v5 = v24;
LOWORD(v24) = 0;
if ( (*(_BYTE *)&v19.__r_.__value_.__s.0 & 1) != 0 )
{
data = v19.__r_.__value_.__l.__data_;
operator delete(v19.__r_.__value_.__l.__data_);
}
v16 = GJAccountManager::sharedState((__int64)data, (__int64)&v19);
if ( (*v2 & 1) != 0 )
{
sub_10001AD30(&v20, *(const void **)(a1 + 736), *(_QWORD *)(a1 + 728));
if ( (*v5 & 1) != 0 )
goto LABEL_29;
}
else
{
v21 = *(void **)(a1 + 736);
v20 = *(_OWORD *)v2;
if ( (*v5 & 1) != 0 )
{
LABEL_29:
sub_10001AD30(&v22, *(const void **)(a1 + 760), *(_QWORD *)(a1 + 752));
goto LABEL_32;
}
}
v23 = *(void **)(a1 + 760);
v22 = *(_OWORD *)v5;
LABEL_32:
v17 = GJAccountManager::loginAccount(v16);
if ( (v22 & 1) != 0 )
{
operator delete(v23);
if ( (v20 & 1) == 0 )
{
LABEL_34:
if ( v17 )
{
LABEL_35:
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 680) + 1160LL))(*(_QWORD *)(a1 + 680), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 1160LL))(*(_QWORD *)(a1 + 688), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 1272LL))(*(_QWORD *)(a1 + 552), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 680) + 1000LL))(*(_QWORD *)(a1 + 680), 0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 688) + 1000LL))(*(_QWORD *)(a1 + 688), 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1000LL))(a1, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);
return (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 712) + 344LL))(
*(_QWORD *)(a1 + 712),
1);
}
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1384LL))(a1, 0xFFFFFFFFLL);
}
}
else if ( (v20 & 1) == 0 )
{
goto LABEL_34;
}
operator delete(v21);
if ( v17 )
goto LABEL_35;
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1384LL))(a1, 0xFFFFFFFFLL);
}
}
else
{
v8 = a1 + 745;
v9 = (unsigned __int8)v7 >> 1;
if ( !v9 )
goto LABEL_20;
}
v14 = 0;
while ( 1 )
{
v3 = *(unsigned __int8 *)(v8 + v14);
LOBYTE(v3) = v3 - 32;
if ( (unsigned __int8)v3 >= 0x5Fu )
break;
if ( v9 == ++v14 )
goto LABEL_20;
}
v11 = *(__int64 **)(a1 + 704);
v12 = *v11;
v13 = "Password contains invalid characters";
goto LABEL_40;
}
v11 = *(__int64 **)(a1 + 704);
v12 = *v11;
v13 = "Too short. Minimum 6 characters";
LABEL_40:
(*(void (__fastcall **)(__int64 *, const char *))(v12 + 928))(v11, v13);
v10 = *(_QWORD *)(a1 + 704);
return (*(__int64 (__fastcall **)(__int64, void *))(*(_QWORD *)v10 + 1072LL))(v10, &unk_100A0B960);
}
}
else if ( v6 >> 1 > 2uLL )
{
goto LABEL_7;
}
(*(void (__fastcall **)(_QWORD, const char *))(**(_QWORD **)(a1 + 696) + 928LL))(
*(_QWORD *)(a1 + 696),
"Too short. Minimum 3 characters");
v10 = *(_QWORD *)(a1 + 696);
return (*(__int64 (__fastcall **)(__int64, void *))(*(_QWORD *)v10 + 1072LL))(v10, &unk_100A0B960);
}