//
// AccountLayer::onBackup from 0x1400936e0 to 0x140093a6d (909 bytes)
//
// 2 xrefs:
// > AccountLayer::customSetup @ 0x1400930d4
// > ??> @ 0x140912b9c
//
// 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:26:01 +0000
//
// Hidden C++ exception states: #wind=3
__int64 __fastcall AccountLayer::onBackup(__int64 a1)
{
__int64 v2; // rcx
cocos2d::CCString *v3; // rax
const char *v4; // rax
size_t v5; // r8
__int64 v6; // rax
__int64 *v7; // rbx
__int64 v8; // rcx
int TimeLeft; // eax
cocos2d::CCString *v10; // rax
const char *CString; // rax
size_t v12; // r8
__int64 v13; // rax
int v14; // ebx
__int64 v15; // rax
__int128 v17; // [rsp+50h] [rbp+7h] BYREF
__int64 v18; // [rsp+60h] [rbp+17h]
__int64 v19; // [rsp+68h] [rbp+1Fh]
_BYTE v20[48]; // [rsp+70h] [rbp+27h] BYREF
void *v21; // [rsp+C0h] [rbp+77h]
void *v22; // [rsp+C0h] [rbp+77h]
v2 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v21 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480(v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v2 = qword_14090BFE0;
}
if ( (int)GameStatsManager::getStat(v2, "6") >= 10 )
{
v8 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v22 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v22);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v8 = *(_QWORD *)&qword_14090BFB0;
}
TimeLeft = GameLevelManager::getTimeLeft(v8, "bak_account");
if ( (unsigned int)(TimeLeft - 1) > 0x1D )
{
v14 = a1 + 632;
if ( !a1 )
v14 = 0;
v17 = 0;
v18 = 0;
v19 = 0;
*(_QWORD *)&v17 = sub_14003D460(0x80u);
v18 = 118;
v19 = 127;
strcpy(
(char *)v17,
"Do you want to save your account data on the cloud?\n"
"This will overwrite previously saved data.");
v15 = sub_14003F4F0((__int64)v20, (__int64)&v17);
v7 = (__int64 *)FLAlertLayer::create(
v14,
(int)"Save Data",
v15,
(__int64)"Cancel",
(__int64)"Save",
1133903872,
0,
0,
1065353216);
sub_14003D310((__int64)&v17);
ButtonSprite::updateBGImage(v7[76], "GJ_button_06.png");
(*(void (__fastcall **)(__int64 *, __int64))(*v7 + 64))(v7, 1);
}
else
{
v10 = cocos2d::CCString::createWithFormat(
"Please wait %i seconds before attempting to back up your account again.",
TimeLeft);
CString = cocos2d::CCString::getCString(v10);
v17 = 0;
v18 = 0;
v19 = 0;
v12 = -1;
do
++v12;
while ( CString[v12] );
sub_14003D230(&v17, CString, v12);
v13 = sub_14003F4F0((__int64)v20, (__int64)&v17);
v7 = (__int64 *)FLAlertLayer::create(0, (int)"Too Fast", v13, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003D310((__int64)&v17);
}
}
else
{
v3 = cocos2d::CCString::createWithFormat(
"You need to collect atleast %i stars to enable saving.",
10);
v4 = cocos2d::CCString::getCString(v3);
v17 = 0;
v18 = 0;
v19 = 0;
v5 = -1;
do
++v5;
while ( v4[v5] );
sub_14003D230(&v17, v4, v5);
v6 = sub_14003F4F0((__int64)v20, (__int64)&v17);
v7 = (__int64 *)FLAlertLayer::create(0, (int)"Collect more", v6, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003D310((__int64)&v17);
}
return (*(__int64 (__fastcall **)(__int64 *))(*v7 + 1064))(v7);
}