//
// AccountLayer::onSync from 0x1000cc800 to 0x1000cc9b5 (437 bytes)
//
// 1 xrefs:
// > AccountLayer::customSetup @ 0x1000cc02d
//
// 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 AccountLayer::onSync(AccountLayer *a1, cocos2d::CCObject *a2)
{
GameLevelManager *v2; // rax
cocos2d::CCString *v3; // rax
const char *CString; // r14
size_t v5; // rax
size_t v6; // rbx
char *v7; // r15
__int64 v8; // rbx
size_t v9; // r12
_QWORD v10[2]; // [rsp+0h] [rbp-50h] BYREF
void *__p; // [rsp+10h] [rbp-40h]
_QWORD __dst[2]; // [rsp+18h] [rbp-38h] BYREF
void *v13; // [rsp+28h] [rbp-28h]
v2 = GameLevelManager::sharedState();
if ( (unsigned int)(GameLevelManager::getTimeLeft(v2, "sync_account", 30.0) - 1) <= 0x1D )
{
v3 = (cocos2d::CCString *)sub_1007AB580(
"Please wait %i seconds before attempting to sync your account again.",
v10[0]);
CString = cocos2d::CCString::getCString(v3);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(COERCE_DOUBLE(1106247680));
v6 = v5;
if ( v5 >= 0x17 )
{
v9 = 26;
if ( (v5 | 7) != 0x17 )
v9 = (v5 | 7) + 1;
v7 = (char *)operator new(v9);
v13 = v7;
__dst[0] = v9 + 1;
__dst[1] = v6;
}
else
{
LOBYTE(__dst[0]) = 2 * v5;
v7 = (char *)__dst + 1;
if ( !v5 )
{
LABEL_13:
v7[v6] = 0;
v8 = FLAlertLayer::create_1(0, "Too fast", __dst, "OK", 0, 300.0);
if ( (__dst[0] & 1) != 0 )
operator delete(v13);
goto LABEL_15;
}
}
memmove(v7, CString, v6);
goto LABEL_13;
}
__p = operator new(0x88u);
v10[0] = 137;
v10[1] = 131;
strcpy(
(char *)__p,
"Do you want to download your account data from the cloud?\n"
"This will merge current data with the saved data.");
v8 = FLAlertLayer::create_1(&a1->FLAlertLayerProtocol, "Load Data", v10, "Cancel", "Load", 300.0);
if ( (v10[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 72LL))(v8, 2);
LABEL_15:
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1288LL))(v8);
}