//
// AccountHelpLayer::onUnlink from 0x1000ce8f0 to 0x1000cea72 (386 bytes)
//
// 1 xrefs:
// > AccountHelpLayer::customSetup @ 0x1000ce638
//
// 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
//
void __fastcall AccountHelpLayer::onUnlink(AccountHelpLayer *a1, cocos2d::CCObject *a2)
{
__int128 v2; // xmm0
GJAccountManager *v3; // rax
std::string *p_m_username; // rax
cocos2d::CCString *v5; // rax
const char *CString; // r14
size_t v7; // rax
size_t v8; // r15
char *v9; // r12
size_t v10; // r13
ButtonSprite **v11; // rbx
char v12; // [rsp+0h] [rbp-60h]
_QWORD __dst[2]; // [rsp+8h] [rbp-58h] BYREF
void *v14; // [rsp+18h] [rbp-48h]
__int128 v15; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v3 = GJAccountManager::sharedState();
if ( (v3->m_username.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v15, v3->m_username.m_data.m_long.longStorage, v3->m_username.m_data.m_long.size, *(double *)&v2);
}
else
{
p_m_username = &v3->m_username;
__p = p_m_username->m_data.m_long.longStorage;
v2 = *(_OWORD *)&p_m_username->m_data.m_short.sizex2;
v15 = *(_OWORD *)&p_m_username->m_data.m_short.sizex2;
}
v5 = (cocos2d::CCString *)sub_1007AB580(
"Are you sure you want to unlink from the account %s?\n"
"Unlinking will delete all data from this device.",
v12);
CString = cocos2d::CCString::getCString(v5);
if ( (v15 & 1) != 0 )
operator delete(__p);
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v2);
v8 = v7;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
v9 = (char *)operator new(v10);
v14 = v9;
__dst[0] = v10 + 1;
__dst[1] = v8;
goto LABEL_13;
}
LOBYTE(__dst[0]) = 2 * v7;
v9 = (char *)__dst + 1;
if ( v7 )
LABEL_13:
memmove(v9, CString, v8);
v9[v8] = 0;
v11 = (ButtonSprite **)FLAlertLayer::create_1(
&a1->FLAlertLayerProtocol,
"Unlink Account",
__dst,
"Cancel",
"Unlink",
300.0);
if ( (__dst[0] & 1) != 0 )
operator delete(v14);
ButtonSprite::updateBGImage(v11[75], "GJ_button_05.png");
(*(void (__fastcall **)(ButtonSprite **, __int64))&(*v11)->m_fVertexZ)(v11, 3);
(*(void (__fastcall **)(ButtonSprite **))&(*v11)[1].m_fTextureTop)(v11);
}