//
// AccountHelpLayer::onUnlink from 0x10009cd50 to 0x10009ced2 (386 bytes)
//
// 1 xrefs:
// > AccountHelpLayer::customSetup @ 0x10009ca8b
//
// 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:20:12 +0000
//
__int64 __fastcall AccountHelpLayer::onUnlink(__int64 a1)
{
__int64 v1; // rax
__int64 v2; // rax
__int64 v3; // rax
const char *CString; // r14
size_t v5; // rax
size_t v6; // r15
char *v7; // r12
size_t v8; // r13
__int64 *v9; // rbx
char v11; // [rsp+0h] [rbp-60h]
_QWORD __dst[2]; // [rsp+8h] [rbp-58h] BYREF
void *v13; // [rsp+18h] [rbp-48h]
__int128 v14; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v1 = GJAccountManager::sharedState(a1);
if ( (*(_BYTE *)(v1 + 328) & 1) != 0 )
{
sub_10001AD30(&v14, *(const void **)(v1 + 344), *(_QWORD *)(v1 + 336));
}
else
{
v2 = v1 + 328;
__p = *(void **)(v2 + 16);
v14 = *(_OWORD *)v2;
}
v3 = sub_10088E820(
"Are you sure you want to unlink from the account %s?\n"
"Unlinking will delete all data from this device.",
v11);
CString = (const char *)cocos2d::CCString::getCString(v3);
if ( (v14 & 1) != 0 )
operator delete(__p);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = 26;
if ( (v5 | 7) != 0x17 )
v8 = (v5 | 7) + 1;
v7 = (char *)operator new(v8);
v13 = v7;
__dst[0] = v8 + 1;
__dst[1] = v6;
goto LABEL_13;
}
LOBYTE(__dst[0]) = 2 * v5;
v7 = (char *)__dst + 1;
if ( v5 )
LABEL_13:
memmove(v7, CString, v6);
v7[v6] = 0;
v9 = (__int64 *)FLAlertLayer::create_1(a1 + 616, "Unlink Account", __dst, "Cancel", "Unlink", 300.0);
if ( (__dst[0] & 1) != 0 )
operator delete(v13);
ButtonSprite::updateBGImage(v9[77], (__int64)"GJ_button_05.png");
(*(void (__fastcall **)(__int64 *, __int64))(*v9 + 72))(v9, 3);
return (*(__int64 (__fastcall **)(__int64 *))(*v9 + 1312))(v9);
}