//
// GJAccountManager::unlinkFromAccount from 0x140309900 to 0x140309aaa (426 bytes)
//
// 2 xrefs:
// > AccountHelpLayer::FLAlert_Clicked @ 0x14009575d
// > ??> @ 0x14091e614
//
// 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 11:30:10 +0000
//
// Hidden C++ exception states: #wind=5
__int64 __fastcall GJAccountManager::unlinkFromAccount(__int64 a1)
{
_BYTE *v2; // rcx
__int64 v3; // rcx
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rcx
__int64 v7; // rdx
__int64 v8; // r8
void (__fastcall ***v9)(_QWORD); // rcx
__int64 result; // rax
__int64 v11; // rcx
void *v12; // [rsp+30h] [rbp+8h]
void *v13; // [rsp+30h] [rbp+8h]
void *v14; // [rsp+30h] [rbp+8h]
void *v15; // [rsp+30h] [rbp+8h]
sub_1400405A0((void **)(a1 + 376), &byte_1406ED6E0, 0);
sub_1400405A0((void **)(a1 + 464), &byte_1406ED6E0, 0);
sub_1400405A0((void **)(a1 + 328), &byte_1406ED6E0, 0);
*(_DWORD *)(a1 + 360) = 0;
v2 = (_BYTE *)qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v12 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = (_BYTE *)qword_14090BFD0;
}
v2[1058] = 1;
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)v2 + 928LL))(v2);
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v13 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
*(_BYTE *)(v4 + 1058) = 0;
v5 = LocalLevelManager::sharedState(v3);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 928LL))(v5);
v6 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v14 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v14);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v6 = *(_QWORD *)&qword_14090BFB0;
}
GameLevelManager::resetAccountCaches(v6);
v9 = *(void (__fastcall ****)(_QWORD))(a1 + 424);
if ( v9 )
(**v9)(v9);
result = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v15 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
result = qword_14090BFD0;
}
v11 = *(_QWORD *)(result + 592);
if ( v11 )
return MenuLayer::updateUserProfileButton(v11, v7, v8);
return result;
}