//
// AccountHelpLayer::updatePage from 0x1000ceaa0 to 0x1000ced9e (766 bytes)
//
// 3 xrefs:
// > AccountHelpLayer::customSetup @ 0x1000ce776
// > AccountHelpLayer::accountStatusChanged @ 0x1000cef45
// > sub_1000CEF50 @ 0x1000cef5c
//
// 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 AccountHelpLayer::updatePage(AccountHelpLayer *a1)
{
__int128 v1; // xmm0
GJAccountManager *v3; // rax
TextArea **p_m_textArea; // r15
GJAccountManager *v5; // rax
std::string *p_m_GJP2; // rax
__int64 v7; // r14
cocos2d::CCLabelBMFont *m_loginStatusLabel; // r14
GJAccountManager *v9; // rax
std::string *p_m_username; // rax
GJAccountManager *v11; // rax
cocos2d::CCLabelBMFont *v12; // r14
TextArea *v13; // r14
void **v14; // rax
GJAccountManager *v15; // rax
std::string *v16; // rax
cocos2d::CCString *v17; // rax
const char *v18; // rax
TextArea *v19; // rdi
cocos2d::CCString *v20; // rax
const char *CString; // rax
TextArea *v22; // rdi
CCMenuItemSpriteExtra *m_unlinkAccountButton; // rbx
GJAccountManager *v24; // rax
char v25; // [rsp+0h] [rbp-80h]
_WORD v26[8]; // [rsp+8h] [rbp-78h] BYREF
char v27; // [rsp+18h] [rbp-68h] BYREF
_QWORD v28[2]; // [rsp+20h] [rbp-60h] BYREF
char *v29; // [rsp+30h] [rbp-50h] BYREF
char v30; // [rsp+38h] [rbp-48h] BYREF
char v31[23]; // [rsp+39h] [rbp-47h] BYREF
__int128 v32; // [rsp+50h] [rbp-30h] BYREF
void *__p; // [rsp+60h] [rbp-20h]
v3 = GJAccountManager::sharedState();
if ( v3->m_accountID == v3->m_unkInt1 )
{
p_m_textArea = &a1->m_textArea;
TextArea::colorAllCharactersTo(a1->m_textArea, (cocos2d::ccColor3B)-1);
}
else
{
v5 = GJAccountManager::sharedState();
if ( (v5->m_GJP2.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v32, v5->m_GJP2.m_data.m_long.longStorage, v5->m_GJP2.m_data.m_long.size, *(double *)&v1);
}
else
{
p_m_GJP2 = &v5->m_GJP2;
__p = p_m_GJP2->m_data.m_long.longStorage;
v1 = *(_OWORD *)&p_m_GJP2->m_data.m_short.sizex2;
v32 = *(_OWORD *)&p_m_GJP2->m_data.m_short.sizex2;
}
v7 = (unsigned __int8)v32 >> 1;
if ( (v32 & 1) != 0 )
{
v7 = *((_QWORD *)&v32 + 1);
operator delete(__p);
}
p_m_textArea = &a1->m_textArea;
TextArea::colorAllCharactersTo(a1->m_textArea, (cocos2d::ccColor3B)-1);
if ( v7 )
{
m_loginStatusLabel = a1->m_loginStatusLabel;
v9 = GJAccountManager::sharedState();
if ( (v9->m_username.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v32, v9->m_username.m_data.m_long.longStorage, v9->m_username.m_data.m_long.size, *(double *)&v1);
}
else
{
p_m_username = &v9->m_username;
__p = p_m_username->m_data.m_long.longStorage;
v32 = *(_OWORD *)&p_m_username->m_data.m_short.sizex2;
}
v20 = (cocos2d::CCString *)sub_1007AB580("Linked to account: %s", v25);
CString = cocos2d::CCString::getCString(v20);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_loginStatusLabel->setString)(
m_loginStatusLabel,
CString);
if ( (v32 & 1) != 0 )
operator delete(__p);
v22 = *p_m_textArea;
v26[0] = 0;
TextArea::setString(v22, v26);
if ( (v26[0] & 1) != 0 )
{
v14 = (void **)&v27;
goto LABEL_26;
}
goto LABEL_27;
}
}
v11 = GJAccountManager::sharedState();
v12 = a1->m_loginStatusLabel;
if ( v11->m_accountID == v11->m_unkInt1 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))v12->setString)(
a1->m_loginStatusLabel,
"Not logged in");
v13 = *p_m_textArea;
v29 = (char *)operator new(0x30u);
v28[0] = 49;
v28[1] = 46;
strcpy(v29, "Create an account to backup\nand sync your data");
TextArea::setString(v13, v28);
if ( (v28[0] & 1) != 0 )
{
v14 = (void **)&v29;
LABEL_26:
operator delete(*v14);
}
}
else
{
v15 = GJAccountManager::sharedState();
if ( (v15->m_username.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(&v32, v15->m_username.m_data.m_long.longStorage, v15->m_username.m_data.m_long.size, *(double *)&v1);
}
else
{
v16 = &v15->m_username;
__p = v16->m_data.m_long.longStorage;
v32 = *(_OWORD *)&v16->m_data.m_short.sizex2;
}
v17 = (cocos2d::CCString *)sub_1007AB580("Linked to account: %s", v25);
v18 = cocos2d::CCString::getCString(v17);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))v12->setString)(v12, v18);
if ( (v32 & 1) != 0 )
operator delete(__p);
v19 = *p_m_textArea;
v30 = 28;
strcpy(v31, "Login required");
TextArea::setString(v19, &v30);
if ( (v30 & 1) != 0 )
{
v14 = (void **)&v31[15];
goto LABEL_26;
}
}
LABEL_27:
m_unlinkAccountButton = a1->m_unlinkAccountButton;
v24 = GJAccountManager::sharedState();
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))m_unlinkAccountButton->setVisible)(
m_unlinkAccountButton,
v24->m_accountID != v24->m_unkInt1);
}