//
// AccountHelpLayer::onUnlink from 0x84a66c to 0x84a858 (492 bytes)
//
// 3 xrefs:
// > ??> @ 0x38e08
// > AccountHelpLayer::customSetup @ 0x84d3d8
// > ??> @ 0x1229c28
//
// 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 AccountHelpLayer::onUnlink(AccountHelpLayer *a1, cocos2d::CCObject *a2)
{
int v2; // w22
double v3; // d0
cocos2d::CCString *v4; // x0
char *CString; // x23
char *v6; // x0
FLAlertLayer *v7; // x19
char *v8; // x0
unsigned int *v9; // x1
int v10; // w2
unsigned int *v11; // x1
int v12; // w2
char *v13; // [xsp+50h] [xbp+50h] BYREF
v2 = (int)a1;
GJAccountManager::sharedState();
*(_QWORD *)&v3 = sub_D18D28(&v13).n128_u64[0];
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Are you sure you want to unlink from the account %s?\n"
"Unlinking will delete all data from this device.",
v13,
v3);
CString = (char *)cocos2d::CCString::getCString(v4);
v6 = v13 - 24;
if ( v13 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v13 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v13 - 2);
*((_DWORD *)v13 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v6);
}
sub_D153B8((int)&v13, CString);
v7 = FLAlertLayer::create(v2 + 616, (__int64)"Unlink Account", (__int64)&v13);
v8 = v13 - 24;
if ( v13 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v13 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v13 - 2);
*((_DWORD *)v13 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v8);
}
ButtonSprite::updateBGImage(v7->m_button2, "GJ_button_05.png");
v7->setTag(v7, 3);
v7->show(v7);
}