//
// AccountLayer::updatePage from 0x98d628 to 0x98dabc (1172 bytes)
//
// 5 xrefs:
// > AccountLayer::doBackup @ 0x98dad0
// > AccountLayer::doSync @ 0x98db2c
// > AccountLayer::accountStatusChanged @ 0x98dc10
// > AccountLayer::customSetup @ 0x98e1b8
// > ??> @ 0xc7048
//
// This function is hookable on this platform (idp: arm, 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:57:57 +0000
//
__int64 __fastcall AccountLayer::updatePage(AccountLayer *this, unsigned __int8 a2)
{
int v3; // w23
__int64 v4; // x0
int v5; // w1
GJAccountManager *v6; // x0
__int64 v7; // x0
__int64 v8; // x1
_BOOL4 v9; // w21
GJAccountManager *v10; // x0
GJAccountManager **v11; // x24
void (__fastcall *v12)(GJAccountManager **, __int64); // x25
__int64 v13; // x0
__int64 v14; // x1
char *v15; // x1
cocos2d::CCString *v16; // x0
__int64 v17; // x0
__int64 *v18; // x24
GJAccountManager **v19; // x24
void (__fastcall *v20)(GJAccountManager **, bool); // x25
__int64 v21; // x1
GJAccountManager **v22; // x21
void (__fastcall *v23)(GJAccountManager **, bool); // x22
__int64 v24; // x1
__int64 v25; // x19
__int64 v26; // x0
void (__fastcall *v27)(__int64, _BYTE *); // x2
__int64 v28; // x0
void (__fastcall *v29)(__int64, _BYTE *); // x2
__int64 v31; // x0
GJAccountManager **v32; // x21
void (__fastcall *v33)(GJAccountManager **, __int64); // x24
__int64 v34; // x0
__int64 v35; // x1
char *v36; // x1
cocos2d::CCString *v37; // x0
__int64 CString; // x0
__int64 *v39; // x21
__int64 *v40; // x21
_BYTE v41[8]; // [xsp+58h] [xbp+58h] BYREF
__int64 v42; // [xsp+60h] [xbp+60h] BYREF
__int64 v43; // [xsp+68h] [xbp+68h]
char *v44; // [xsp+70h] [xbp+70h]
v3 = a2;
v4 = GJAccountManager::sharedState(_stack_chk_guard);
v5 = *(_DWORD *)(v4 + 352);
v6 = (GJAccountManager *)*(unsigned int *)(v4 + 356);
if ( v5 == (_DWORD)v6 )
{
v10 = (GJAccountManager *)TextArea::colorAllCharactersTo(*((_QWORD *)this + 81), 0xFFFFFF);
goto LABEL_20;
}
v7 = GJAccountManager::sharedState(v6);
v42 = 0;
v43 = 0;
v44 = nullptr;
if ( (*(_BYTE *)(v7 + 368) & 1) != 0 )
{
std::string::__init(&v42, *(void **)(v7 + 384), *(_QWORD *)(v7 + 376));
}
else
{
v8 = *(_QWORD *)(v7 + 376);
v42 = *(_QWORD *)(v7 + 368);
v43 = v8;
v44 = *(char **)(v7 + 384);
}
if ( (v42 & 1) != 0 )
{
v9 = v43 != 0;
operator delete(v44);
}
else
{
v9 = (int)(unsigned __int8)v42 >> 1 != 0;
}
v10 = (GJAccountManager *)TextArea::colorAllCharactersTo(*((_QWORD *)this + 81), 0xFFFFFF);
if ( !v9 )
{
LABEL_20:
v31 = GJAccountManager::sharedState(v10);
if ( *(_DWORD *)(v31 + 352) == *(_DWORD *)(v31 + 356) )
{
(*(void (__fastcall **)(_QWORD, const char *))(**((_QWORD **)this + 80) + 928LL))(
*((_QWORD *)this + 80),
"Not logged in");
v40 = *((__int64 **)this + 81);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Create an account to back up\nand load your data from the cloud", 0x3Eu);
TextArea::setString(v40, (char *)&v42);
}
else
{
v32 = *((GJAccountManager ***)this + 80);
v33 = *((void (__fastcall **)(GJAccountManager **, __int64))*v32 + 116);
v34 = GJAccountManager::sharedState(*v32);
v42 = 0;
v43 = 0;
v44 = nullptr;
if ( (*(_BYTE *)(v34 + 328) & 1) != 0 )
{
std::string::__init(&v42, *(void **)(v34 + 344), *(_QWORD *)(v34 + 336));
}
else
{
v35 = *(_QWORD *)(v34 + 336);
v42 = *(_QWORD *)(v34 + 328);
v43 = v35;
v44 = *(char **)(v34 + 344);
}
v36 = (char *)&v42 + 1;
if ( (v42 & 1) != 0 )
v36 = v44;
v37 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Linked to account: %s", v36);
CString = cocos2d::CCString::getCString(v37);
v33(v32, CString);
if ( (v42 & 1) != 0 )
operator delete(v44);
v39 = *((__int64 **)this + 81);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, "Login required", 0xEu);
TextArea::setString(v39, (char *)&v42);
}
v9 = 0;
if ( (v42 & 1) != 0 )
goto LABEL_14;
goto LABEL_15;
}
v11 = *((GJAccountManager ***)this + 80);
v12 = *((void (__fastcall **)(GJAccountManager **, __int64))*v11 + 116);
v13 = GJAccountManager::sharedState(*v11);
v42 = 0;
v43 = 0;
v44 = nullptr;
if ( (*(_BYTE *)(v13 + 328) & 1) != 0 )
{
std::string::__init(&v42, *(void **)(v13 + 344), *(_QWORD *)(v13 + 336));
}
else
{
v14 = *(_QWORD *)(v13 + 336);
v42 = *(_QWORD *)(v13 + 328);
v43 = v14;
v44 = *(char **)(v13 + 344);
}
v15 = (char *)&v42 + 1;
if ( (v42 & 1) != 0 )
v15 = v44;
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"Linked to account: %s", v15);
v17 = cocos2d::CCString::getCString(v16);
v12(v11, v17);
if ( (v42 & 1) != 0 )
operator delete(v44);
v18 = *((__int64 **)this + 81);
v42 = 0;
v43 = 0;
v44 = nullptr;
std::string::__init(&v42, &byte_11B8890, 0);
TextArea::setString(v18, (char *)&v42);
if ( (v42 & 1) != 0 )
LABEL_14:
operator delete(v44);
LABEL_15:
(*(void (__fastcall **)(_QWORD, bool))(**((_QWORD **)this + 82) + 344LL))(*((_QWORD *)this + 82), !v9);
v19 = *((GJAccountManager ***)this + 83);
v20 = *((void (__fastcall **)(GJAccountManager **, bool))*v19 + 43);
v21 = GJAccountManager::sharedState(*v19);
v20(v19, *(_DWORD *)(v21 + 352) == *(_DWORD *)(v21 + 356));
(*(void (__fastcall **)(_QWORD, _BOOL4))(**((_QWORD **)this + 84) + 344LL))(*((_QWORD *)this + 84), v9);
(*(void (__fastcall **)(_QWORD, _BOOL4))(**((_QWORD **)this + 85) + 344LL))(*((_QWORD *)this + 85), v9);
(*(void (__fastcall **)(_QWORD, bool))(**((_QWORD **)this + 86) + 344LL))(*((_QWORD *)this + 86), !v9);
v22 = *((GJAccountManager ***)this + 87);
v23 = *((void (__fastcall **)(GJAccountManager **, bool))*v22 + 43);
v24 = GJAccountManager::sharedState(*v22);
v23(v22, *(_DWORD *)(v24 + 352) != *(_DWORD *)(v24 + 356));
if ( v3 && !*((_BYTE *)this + 716) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 84) + 1056LL))(*((_QWORD *)this + 84), 0);
v25 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 84) + 1072LL))(*((_QWORD *)this + 84));
v26 = *(_QWORD *)(v25 + 648);
v27 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v26 + 960LL);
memset(v41, 125, 3);
v27(v26, v41);
v28 = *(_QWORD *)(v25 + 624);
v29 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v28 + 1072LL);
memset(v41, 125, 3);
v29(v28, v41);
}
return _stack_chk_guard;
}