//
// GJAccountManager::onLoginAccountCompleted from 0x140200f60 to 0x140201345 (997 bytes)
//
// 2 xrefs:
// > GJAccountManager::handleIt @ 0x140200402
// > ??> @ 0x1406ccaf8
//
// 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
//
// Hidden C++ exception states: #wind=3
void __fastcall GJAccountManager::onLoginAccountCompleted(__int64 a1, __int64 *a2, __int64 a3)
{
void *v5; // rcx
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // r8
void **v9; // rdx
char *v10; // r14
unsigned __int64 v11; // r13
const void *v12; // rcx
size_t v13; // r12
size_t v14; // r15
size_t v15; // r8
int v16; // esi
char *v17; // rax
__int64 v18; // rcx
cocos2d::CCString *v19; // rax
const char *v20; // rax
size_t v21; // r8
void **v22; // rdx
char *v23; // r14
unsigned __int64 v24; // r13
const void *v25; // rcx
size_t v26; // r12
size_t v27; // r15
size_t v28; // r8
int v29; // esi
char *v30; // rax
__int64 v31; // rcx
const void *v32; // rcx
unsigned __int64 v33; // rsi
size_t v34; // r8
__int64 v35; // r8
cocos2d::CCArray *v36; // r14
cocos2d::CCString *v37; // rax
int v38; // esi
cocos2d::CCString *v39; // rax
__int64 v40; // rcx
int v41; // eax
__int64 v42; // rcx
void (__fastcall ***v43)(_QWORD, _QWORD, __int64); // rcx
void *Block[2]; // [rsp+38h] [rbp-28h] BYREF
size_t Size; // [rsp+48h] [rbp-18h]
unsigned __int64 v47; // [rsp+50h] [rbp-10h]
Size = 13;
v47 = 15;
qmemcpy(Block, "login_accoun", 12);
HIDWORD(Block[1]) = (unsigned __int8)aLoginAccount[12];
cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 320), Block);
if ( v47 > 0xF )
{
v5 = Block[0];
if ( v47 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v5);
}
v6 = cocos2d::CCString::createWithFormat("%i", -12);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Block = 0;
Size = 0;
v47 = 0;
v8 = -1;
do
++v8;
while ( CString[v8] );
sub_14003A930(Block, CString, v8);
v9 = Block;
v10 = (char *)Block[0];
v11 = v47;
if ( v47 > 0xF )
v9 = (void **)Block[0];
v12 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v12 = (const void *)*a2;
v13 = Size;
v14 = a2[2];
v15 = v14;
if ( Size < v14 )
v15 = Size;
v16 = memcmp(v12, v9, v15);
if ( !v16 )
{
if ( v14 >= v13 )
v16 = v14 > v13;
else
v16 = -1;
}
if ( v11 > 0xF )
{
v17 = v10;
if ( v11 + 1 >= 0x1000 )
{
v10 = *((char **)v10 - 1);
if ( (unsigned __int64)(v17 - v10 - 8) > 0x1F )
LABEL_40:
invalid_parameter_noinfo_noreturn();
}
j_j_free(v10);
}
if ( !v16 )
{
v18 = *(_QWORD *)(a1 + 416);
if ( v18 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v18 + 8LL))(v18, 4294967284LL);
goto LABEL_61;
}
v19 = cocos2d::CCString::createWithFormat("%i", -13);
v20 = cocos2d::CCString::getCString(v19);
*(_OWORD *)Block = 0;
Size = 0;
v47 = 0;
v21 = -1;
do
++v21;
while ( v20[v21] );
sub_14003A930(Block, v20, v21);
v22 = Block;
v23 = (char *)Block[0];
v24 = v47;
if ( v47 > 0xF )
v22 = (void **)Block[0];
v25 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v25 = (const void *)*a2;
v26 = Size;
v27 = a2[2];
v28 = v27;
if ( Size < v27 )
v28 = Size;
v29 = memcmp(v25, v22, v28);
if ( !v29 )
{
if ( v27 >= v26 )
v29 = v27 > v26;
else
v29 = -1;
}
if ( v24 > 0xF )
{
v30 = v23;
if ( v24 + 1 >= 0x1000 )
{
v23 = *((char **)v23 - 1);
if ( (unsigned __int64)(v30 - v23 - 8) > 0x1F )
goto LABEL_40;
}
j_j_free(v23);
}
if ( v29 )
{
*(_OWORD *)Block = 0;
Size = 2;
v47 = 15;
strcpy((char *)Block, "-1");
v32 = a2;
if ( (unsigned __int64)a2[3] > 0xF )
v32 = (const void *)*a2;
v33 = a2[2];
v34 = v33;
if ( v33 > 2 )
v34 = 2;
if ( !memcmp(v32, Block, v34) && v33 == 2
|| (v36 = sub_140140F70(a2, ","), cocos2d::CCArray::count(v36) < 2)
|| (v37 = cocos2d::CCArray::stringAtIndex(v36, 0),
v38 = cocos2d::CCString::intValue(v37),
v39 = cocos2d::CCArray::stringAtIndex(v36, 1u),
v35 = (unsigned int)cocos2d::CCString::intValue(v39),
v38 <= 0) )
{
v40 = *(_QWORD *)(a1 + 416);
if ( v40 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v40 + 8LL))(v40, 0xFFFFFFFFLL, v35);
}
else
{
v41 = *(_DWORD *)(a1 + 360);
if ( !v41 || v41 == v38 )
{
v43 = *(void (__fastcall ****)(_QWORD, _QWORD, __int64))(a1 + 416);
if ( v43 )
(**v43)(v43, (unsigned int)v38, v35);
}
else
{
v42 = *(_QWORD *)(a1 + 416);
if ( v42 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v42 + 8LL))(v42, 4294967286LL, v35);
}
}
}
else
{
v31 = *(_QWORD *)(a1 + 416);
if ( v31 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v31 + 8LL))(v31, 4294967283LL);
}
LABEL_61:
sub_14003A830((__int64)a2);
sub_14003A830(a3);
}