//
// AccountLayer::backupAccountFailed from 0x14007ed30 to 0x14007f036 (774 bytes)
//
// 2 xrefs:
// > ??> @ 0x14053b180
// > ??> @ 0x1406c6918
//
// 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=1
void AccountLayer::backupAccountFailed(AccountLayer *a1, BackupAccountError a2, int a3)
{
BackupAccountError v4; // esi
__int64 v6; // rdx
float v7; // xmm7_4
float v8; // xmm1_4
size_t v9; // rbx
cocos2d::CCString *v10; // rax
char *CString; // rax
size_t v12; // r8
char *v13; // rax
void **v14; // rdx
cocos2d::CCString *v15; // rax
const char *v16; // rax
void **v17; // r8
cocos2d::CCString *v18; // rax
void *v19; // rcx
cocos2d::ccColor3B v20; // [rsp+20h] [rbp-39h] BYREF
__int128 v21; // [rsp+30h] [rbp-29h] BYREF
__int64 v22; // [rsp+40h] [rbp-19h]
__int64 v23; // [rsp+48h] [rbp-11h]
void *Block[2]; // [rsp+58h] [rbp-1h] BYREF
__int64 v25; // [rsp+68h] [rbp+Fh]
unsigned __int64 v26; // [rsp+70h] [rbp+17h]
v4 = a2;
LOBYTE(a2) = 1;
((void (__fastcall *)(CCMenuItemSpriteExtra *, BackupAccountError))a1[-1].m_registerButton->__vftable[1].update)(
a1[-1].m_registerButton,
a2);
LOBYTE(v6) = 1;
(*(void (__fastcall **)(float *, __int64))(*(_QWORD *)&a1[-1].m_obAnchorPoint.y + 976LL))(
&a1[-1].m_obAnchorPoint.y,
v6);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)&a1->m_fSkewY + 320LL))(*(_QWORD *)&a1->m_fSkewY, 0);
v7 = (float)GJAccountManager::sharedState()->m_gameManagerSize * 0.00000095367432;
v8 = (float)GJAccountManager::sharedState()->m_localLevelsSize * 0.00000095367432;
*(_OWORD *)Block = 0;
v25 = 0;
v26 = 15;
LOBYTE(Block[0]) = 0;
v9 = -1;
if ( (float)(v8 + v7) <= 32.0 )
{
v13 = (char *)sub_14003AA10(0x20u);
v25 = 27;
v26 = 31;
strcpy(v13, "Save size is within limits.");
Block[0] = v13;
}
else
{
v10 = cocos2d::CCString::createWithFormat(
"Size: %.2f/32MB. (Profile: %.2f, Levels: %.2f)",
(float)(v8 + v7),
v7,
v8);
CString = (char *)cocos2d::CCString::getCString(v10);
v12 = -1;
do
++v12;
while ( CString[v12] );
sub_14003CCE0(Block, CString, v12);
v13 = (char *)Block[0];
}
if ( v4 == BackupOrSyncFailed )
{
v17 = Block;
if ( v26 > 0xF )
v17 = (void **)v13;
v18 = cocos2d::CCString::createWithFormat("Backup failed. Error code: %i\n%s", a3, (const char *)v17);
v16 = cocos2d::CCString::getCString(v18);
v21 = 0;
v22 = 0;
v23 = 0;
do
++v9;
while ( v16[v9] );
}
else
{
if ( v4 == LoginFailed )
{
v21 = 0;
*(_QWORD *)&v21 = sub_14003AA10(0x40u);
v22 = 50;
v23 = 63;
strcpy((char *)v21, "Login failed. Please login to verify your account.");
goto LABEL_19;
}
v14 = Block;
if ( v26 > 0xF )
v14 = (void **)v13;
v15 = cocos2d::CCString::createWithFormat("Backup failed. Please try again later.\n%s", (const char *)v14);
v16 = cocos2d::CCString::getCString(v15);
v21 = 0;
v22 = 0;
v23 = 0;
do
++v9;
while ( v16[v9] );
}
sub_14003A930(&v21, v16, v9);
LABEL_19:
TextArea::setString(*(TextArea **)&a1->m_uIndexInArray, (__int64)&v21);
*(_WORD *)&v20.r = 19455;
v20.b = 0;
TextArea::colorAllCharactersTo(*(TextArea **)&a1->m_uIndexInArray, &v20);
if ( v26 > 0xF )
{
v19 = Block[0];
if ( v26 + 1 >= 0x1000 )
{
v19 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v19 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v19);
}
}