//
// AccountLayer::onSync from 0x14007e3b0 to 0x14007e62c (636 bytes)
//
// 2 xrefs:
// > AccountLayer::customSetup @ 0x14007da7e
// > ??> @ 0x1406c68dc
//
// 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
//
// Hidden C++ exception states: #wind=2
void AccountLayer::onSync(AccountLayer *a1, cocos2d::CCObject *a2)
{
GameLevelManager *v3; // rcx
int TimeLeft; // eax
cocos2d::CCString *v5; // rax
const char *CString; // rax
size_t v7; // r8
__int64 v8; // rax
FLAlertLayer *v9; // rbx
int v10; // ebx
__int64 v11; // rax
__int128 v12; // [rsp+50h] [rbp+7h] BYREF
__int64 v13; // [rsp+60h] [rbp+17h]
__int64 v14; // [rsp+68h] [rbp+1Fh]
_BYTE v15[48]; // [rsp+70h] [rbp+27h] BYREF
void *v16; // [rsp+C0h] [rbp+77h]
v3 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v16 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v3 = (GameLevelManager *)qword_1406C2EC0;
}
TimeLeft = GameLevelManager::getTimeLeft(v3, "sync_account", 30.0);
if ( (unsigned int)(TimeLeft - 1) > 0x1D )
{
v10 = (_DWORD)a1 + 632;
if ( !a1 )
v10 = 0;
v12 = 0;
v13 = 0;
v14 = 15;
*(_QWORD *)&v12 = sub_14003AA10(0x90u);
v13 = 131;
v14 = 143;
strcpy(
(char *)v12,
"Do you want to download your account data from the cloud?\n"
"This will merge current data with the saved data.");
v11 = sub_14003BDB0((__int64)v15, (__int64)&v12);
v9 = FLAlertLayer::create(
v10,
(int)"Load Data",
v11,
(__int64)"Cancel",
(__int64)"Load",
1133903872,
0,
0,
1065353216);
sub_14003A830((__int64)&v12);
v9->setTag(v9, 2);
}
else
{
v5 = cocos2d::CCString::createWithFormat(
"Please wait %i seconds before attempting to sync your account again.",
TimeLeft);
CString = cocos2d::CCString::getCString(v5);
v12 = 0;
v13 = 0;
v14 = 0;
v7 = -1;
do
++v7;
while ( CString[v7] );
sub_14003A930(&v12, CString, v7);
v8 = sub_14003BDB0((__int64)v15, (__int64)&v12);
v9 = FLAlertLayer::create(0, (int)"Too fast", v8, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003A830((__int64)&v12);
}
v9->show(v9);
}