//
// AccountLoginLayer::loginAccountFinished from 0x992144 to 0x992390 (588 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'AccountLoginLayer::loginAccountFinished @ 0x992398
// > ??> @ 0x91600
// > ??> @ 0x1474680
//
// This function is hookable on this platform (idp: arm, 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:57:59 +0000
//
__int64 __fastcall AccountLoginLayer::loginAccountFinished(AccountLoginLayer *this, int a2, int a3)
{
__int64 v6; // x25
char v7; // w0
__int64 v8; // x0
__int64 v9; // x1
char v10; // w0
__int64 v11; // x0
__int64 v12; // x1
char *v13; // x1
cocos2d::CCString *v14; // x0
char *CString; // x22
size_t v16; // x0
__int64 v17; // x19
__int64 v19; // [xsp+58h] [xbp+58h] BYREF
__int64 v20; // [xsp+60h] [xbp+60h]
void *v21; // [xsp+68h] [xbp+68h]
__int64 v22; // [xsp+70h] [xbp+70h] BYREF
__int64 v23; // [xsp+78h] [xbp+78h]
char *v24; // [xsp+80h] [xbp+80h]
v6 = GJAccountManager::sharedState(_stack_chk_guard);
v7 = *((_BYTE *)this + 720);
v19 = 0;
v20 = 0;
v21 = nullptr;
if ( (v7 & 1) != 0 )
{
std::string::__init(&v19, *((void **)this + 92), *((_QWORD *)this + 91));
}
else
{
v8 = *((_QWORD *)this + 90);
v9 = *((_QWORD *)this + 91);
v21 = *((void **)this + 92);
v19 = v8;
v20 = v9;
}
v10 = *((_BYTE *)this + 744);
v22 = 0;
v23 = 0;
v24 = nullptr;
if ( (v10 & 1) != 0 )
{
std::string::__init(&v22, *((void **)this + 95), *((_QWORD *)this + 94));
}
else
{
v11 = *((_QWORD *)this + 93);
v12 = *((_QWORD *)this + 94);
v24 = *((char **)this + 95);
v22 = v11;
v23 = v12;
}
GJAccountManager::linkToAccount(v6, (__int64)&v19, (__int64)&v22, a2, a3);
if ( (v22 & 1) != 0 )
{
operator delete(v24);
if ( (v19 & 1) == 0 )
goto LABEL_7;
}
else if ( (v19 & 1) == 0 )
{
goto LABEL_7;
}
operator delete(v21);
LABEL_7:
CCTextInputNode::getString(*((CCTextInputNode **)this + 85), &v22);
v13 = (char *)&v22 + 1;
if ( (v22 & 1) != 0 )
v13 = v24;
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Thank you for logging in.\n"
"You have now linked your account:\n"
"%s",
v13);
CString = (char *)cocos2d::CCString::getCString(v14);
if ( (v22 & 1) != 0 )
operator delete(v24);
AccountLoginLayer::hideLoadingUI(this);
v22 = 0;
v23 = 0;
v24 = nullptr;
v16 = strlen(CString);
std::string::__init(&v22, CString, v16);
v17 = FLAlertLayer::create(
(__int64)this + 672,
(cocos2d::CCLabelBMFont *)"Login Success",
(char *)&v22,
(ButtonSprite *)"OK",
nullptr,
320.0);
if ( (v22 & 1) != 0 )
operator delete(v24);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 72LL))(v17, 2);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v17 + 1312LL))(v17);
return _stack_chk_guard;
}