//
// AccountLayer::updatePage from 0x10009af10 to 0x10009b33a (1066 bytes)
//
// 7 xrefs:
// > AccountLayer::customSetup @ 0x10009a77a
// > AccountLayer::doBackup @ 0x10009b5ab
// > AccountLayer::doSync @ 0x10009b67b
// > AccountLayer::accountStatusChanged @ 0x10009b70a
// > sub_10009B710 @ 0x10009b721
// > AccountLayer::FLAlert_Clicked @ 0x10009c10b
// > AccountLayer::FLAlert_Clicked @ 0x10009c13a
//
// 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 12:20:11 +0000
//
__int64 __fastcall AccountLayer::updatePage(__int64 a1, char a2)
{
__int64 v3; // rax
__int64 *v4; // r12
__int64 v5; // rdi
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // r15
__int64 v9; // r15
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // r15
__int64 v14; // r15
unsigned __int8 v15; // r13
void **v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 CString; // rax
__int64 v21; // rdi
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rdi
__int64 v25; // rdi
__int64 v26; // r12
__int64 v27; // rax
__int64 v28; // rdi
__int64 v29; // r15
__int64 v30; // rax
__int64 result; // rax
__int64 v32; // rbx
__int64 v33; // rdi
__int64 v34; // rdi
char v35; // [rsp+0h] [rbp-90h]
_WORD v36[8]; // [rsp+8h] [rbp-88h] BYREF
char v37; // [rsp+18h] [rbp-78h] BYREF
_QWORD v38[2]; // [rsp+20h] [rbp-70h] BYREF
char *v39; // [rsp+30h] [rbp-60h] BYREF
char v40; // [rsp+38h] [rbp-58h] BYREF
char v41[23]; // [rsp+39h] [rbp-57h] BYREF
__int128 v42; // [rsp+50h] [rbp-40h] BYREF
void *__p; // [rsp+60h] [rbp-30h]
v3 = GJAccountManager::sharedState(a1);
if ( *(_DWORD *)(v3 + 352) == *(_DWORD *)(v3 + 356) )
{
v4 = (__int64 *)(a1 + 648);
v5 = *(_QWORD *)(a1 + 648);
TextArea::colorAllCharactersTo(v5, 0xFFFFFF);
goto LABEL_11;
}
v6 = GJAccountManager::sharedState(a1);
if ( (*(_BYTE *)(v6 + 368) & 1) != 0 )
{
sub_10001AD30(&v42, *(const void **)(v6 + 384), *(_QWORD *)(v6 + 376));
}
else
{
v7 = v6 + 368;
__p = *(void **)(v7 + 16);
v42 = *(_OWORD *)v7;
}
v8 = (unsigned __int8)v42 >> 1;
if ( (v42 & 1) != 0 )
{
v8 = *((_QWORD *)&v42 + 1);
operator delete(__p);
}
v4 = (__int64 *)(a1 + 648);
v5 = *(_QWORD *)(a1 + 648);
TextArea::colorAllCharactersTo(v5, 0xFFFFFF);
if ( !v8 )
{
LABEL_11:
v12 = GJAccountManager::sharedState(v5);
v13 = *(_QWORD *)(a1 + 640);
if ( *(_DWORD *)(v12 + 352) == *(_DWORD *)(v12 + 356) )
{
(*(void (__fastcall **)(_QWORD, const char *))(*(_QWORD *)v13 + 928LL))(*(_QWORD *)(a1 + 640), "Not logged in");
v14 = *v4;
v39 = (char *)operator new(0x40u);
v38[0] = 65;
v38[1] = 62;
strcpy(v39, "Create an account to back up\nand load your data from the cloud");
TextArea::setString(v14, v38);
v15 = 0;
if ( (v38[0] & 1) == 0 )
goto LABEL_28;
v16 = (void **)&v39;
}
else
{
v17 = GJAccountManager::sharedState(v5);
if ( (*(_BYTE *)(v17 + 328) & 1) != 0 )
{
sub_10001AD30(&v42, *(const void **)(v17 + 344), *(_QWORD *)(v17 + 336));
}
else
{
v18 = v17 + 328;
__p = *(void **)(v18 + 16);
v42 = *(_OWORD *)v18;
}
v19 = sub_10088E820("Linked to account: %s", v35);
CString = cocos2d::CCString::getCString(v19);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v13 + 928LL))(v13, CString);
if ( (v42 & 1) != 0 )
operator delete(__p);
v21 = *v4;
v40 = 28;
strcpy(v41, "Login required");
TextArea::setString(v21, &v40);
if ( (v40 & 1) == 0 )
{
v15 = 0;
goto LABEL_28;
}
v16 = (void **)&v41[15];
v15 = 0;
}
goto LABEL_27;
}
v9 = *(_QWORD *)(a1 + 640);
v10 = GJAccountManager::sharedState(v5);
if ( (*(_BYTE *)(v10 + 328) & 1) != 0 )
{
sub_10001AD30(&v42, *(const void **)(v10 + 344), *(_QWORD *)(v10 + 336));
}
else
{
v11 = v10 + 328;
__p = *(void **)(v11 + 16);
v42 = *(_OWORD *)v11;
}
v22 = sub_10088E820("Linked to account: %s", v35);
v23 = cocos2d::CCString::getCString(v22);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 928LL))(v9, v23);
if ( (v42 & 1) != 0 )
operator delete(__p);
v24 = *v4;
v36[0] = 0;
TextArea::setString(v24, v36);
v15 = 1;
if ( (v36[0] & 1) != 0 )
{
v15 = 1;
v16 = (void **)&v37;
LABEL_27:
operator delete(*v16);
}
LABEL_28:
v25 = *(_QWORD *)(a1 + 656);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v25 + 344LL))(v25, v15 ^ 1u);
v26 = *(_QWORD *)(a1 + 664);
v27 = GJAccountManager::sharedState(v25);
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v26 + 344LL))(
v26,
*(_DWORD *)(v27 + 352) == *(_DWORD *)(v27 + 356));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 672) + 344LL))(*(_QWORD *)(a1 + 672), v15);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 680) + 344LL))(*(_QWORD *)(a1 + 680), v15);
v28 = *(_QWORD *)(a1 + 688);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v28 + 344LL))(v28, v15 ^ 1u);
v29 = *(_QWORD *)(a1 + 696);
v30 = GJAccountManager::sharedState(v28);
result = (*(__int64 (__fastcall **)(__int64, bool))(*(_QWORD *)v29 + 344LL))(
v29,
*(_DWORD *)(v30 + 352) != *(_DWORD *)(v30 + 356));
if ( a2 )
{
if ( !*(_BYTE *)(a1 + 716) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 672) + 1056LL))(*(_QWORD *)(a1 + 672), 0);
v32 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 672) + 1072LL))(*(_QWORD *)(a1 + 672));
v33 = *(_QWORD *)(v32 + 648);
memset(&v42, 125, 3);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v33 + 960LL))(v33, &v42);
v34 = *(_QWORD *)(v32 + 624);
memset(&v42, 125, 3);
return (*(__int64 (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v34 + 1072LL))(v34, &v42);
}
}
return result;
}