//
// MenuLayer::updateUserProfileButton from 0x100267bc4 to 0x100267cd4 (272 bytes)
//
// 2 xrefs:
// > MenuLayer::init @ 0x1002675f4
// > GameManager::accountStatusChanged @ 0x100319748
//
// 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 MenuLayer::updateUserProfileButton(MenuLayer *a1)
{
GJAccountManager *v2; // x0
int m_accountID; // w21
int m_unkInt1; // w22
cocos2d::CCSprite *m_viewProfileSprite; // x0
cocos2d::CCLabelBMFont *m_profileLabel; // x20
GJAccountManager *v7; // x0
void **v8; // x1
void *__p[2]; // [xsp+0h] [xbp-40h] BYREF
char *longStorage; // [xsp+10h] [xbp-30h]
v2 = GJAccountManager::sharedState();
m_accountID = v2->m_accountID;
m_unkInt1 = v2->m_unkInt1;
((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_profileButton->setVisible)(
a1->m_profileButton,
m_accountID > m_unkInt1);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))a1->m_profileLabel->setVisible)(
a1->m_profileLabel,
m_accountID > m_unkInt1);
m_viewProfileSprite = a1->m_viewProfileSprite;
if ( m_viewProfileSprite )
((void (__fastcall *)(cocos2d::CCSprite *, bool))m_viewProfileSprite->setVisible)(
m_viewProfileSprite,
m_accountID > m_unkInt1);
if ( m_accountID > m_unkInt1 )
{
m_profileLabel = a1->m_profileLabel;
v7 = GJAccountManager::sharedState();
if ( v7->m_username.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v7->m_username.m_data.m_long.capacitym1, v7->m_username.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v7->m_username.m_data.m_short.sizex2;
longStorage = v7->m_username.m_data.m_long.longStorage;
}
if ( SHIBYTE(longStorage) >= 0 )
v8 = __p;
else
v8 = (void **)__p[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))m_profileLabel->setString)(m_profileLabel, v8);
if ( SHIBYTE(longStorage) < 0 )
operator delete(__p[0]);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_profileLabel, 70.0, 0.7, 0.0);
}
}