//
// MenuLayer::updateUserProfileButton from 0x6eb090 to 0x6eb240 (432 bytes)
//
// 3 xrefs:
// > MenuLayer::init @ 0x6ebed0
// > GameManager::accountStatusChanged @ 0x71759c
// > ??> @ 0x93898
//
// 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:51:45 +0000
//
__int64 __fastcall MenuLayer::updateUserProfileButton(MenuLayer *this)
{
unsigned int v2; // w19
__int64 v3; // x0
GameManager *v4; // x0
GameManager *v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
GJAccountManager **v10; // x22
void (__fastcall *v11)(GJAccountManager **, char *); // x23
__int64 v12; // x2
char v13; // w0
__int64 v14; // x0
__int64 v15; // x1
char *v16; // x1
__int64 v17; // [xsp+40h] [xbp+40h] BYREF
__int64 v18; // [xsp+48h] [xbp+48h]
void *v19; // [xsp+50h] [xbp+50h]
v2 = 0;
v3 = GJAccountManager::sharedState(_stack_chk_guard);
v4 = (GameManager *)(unsigned int)(*(_DWORD *)(v3 + 352) - *(_DWORD *)(v3 + 356));
if ( (int)v4 > 0 )
{
v5 = (GameManager *)GameManager::sharedState(v4);
v2 = (unsigned __int8)GameManager::offlineModeEnabled(v5) ^ 1;
}
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 58) + 344LL))(*((_QWORD *)this + 58), v2);
v6 = *((_QWORD *)this + 59);
if ( v6 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 344LL))(v6, v2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 57) + 344LL))(*((_QWORD *)this + 57), v2);
v7 = *((_QWORD *)this + 56);
if ( v7 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 344LL))(v7, v2);
v8 = *((_QWORD *)this + 60);
if ( v8 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v8 + 344LL))(v8, v2 ^ 1);
if ( v2 )
{
v10 = *((GJAccountManager ***)this + 57);
v11 = *((void (__fastcall **)(GJAccountManager **, char *))*v10 + 116);
v12 = GJAccountManager::sharedState(*v10) + 328;
v13 = *(_BYTE *)v12;
v17 = 0;
v18 = 0;
v19 = nullptr;
if ( (v13 & 1) != 0 )
{
std::string::__init(&v17, *(void **)(v12 + 16), *(_QWORD *)(v12 + 8));
}
else
{
v14 = *(_QWORD *)v12;
v15 = *(_QWORD *)(v12 + 8);
v19 = *(void **)(v12 + 16);
v17 = v14;
v18 = v15;
}
v16 = (char *)&v17 + 1;
if ( (v17 & 1) != 0 )
v16 = (char *)v19;
v11(v10, v16);
if ( (v17 & 1) != 0 )
operator delete(v19);
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 57), 70.0, 0.7, 0.0);
}
return _stack_chk_guard;
}