//
// cocos2d::CCMenuItemSprite::updateImagesVisibility from 0x18005bf00 to 0x18005bfdc (220 bytes)
//
// 4 xrefs:
// > ??> @ 0x1800f8738
// > ??> @ 0x1800f8b98
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2fdc
//
// 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 cocos2d::CCMenuItemSprite::updateImagesVisibility(cocos2d::CCMenuItemSprite *this, __int64 a2)
{
cocos2d::CCNode **p_m_pNormalImage; // rdi
cocos2d::CCNode **p_m_pSelectedImage; // rbx
cocos2d::CCNode **v4; // rsi
bool v5; // zf
__int64 v6; // rcx
cocos2d::CCNode *v7; // rcx
cocos2d::CCNode *v8; // rcx
p_m_pNormalImage = &this->m_pNormalImage;
p_m_pSelectedImage = &this->m_pSelectedImage;
if ( this->m_pNormalImage )
{
v4 = &this->m_pNormalImage;
}
else
{
if ( !*p_m_pSelectedImage )
return;
v4 = &this->m_pNormalImage;
}
v5 = !this->m_bEnabled;
v6 = *(_QWORD *)&this->m_nScriptTapHandler;
if ( !v5 )
{
if ( v6 )
{
LOBYTE(a2) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v6 + 320LL))(v6, a2);
}
v7 = *p_m_pNormalImage;
goto LABEL_19;
}
if ( !*p_m_pSelectedImage )
{
if ( v6 )
{
LOBYTE(a2) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v6 + 320LL))(v6, a2);
}
v7 = *v4;
LABEL_19:
if ( v7 )
((void (__fastcall *)(cocos2d::CCNode *, _QWORD))v7->setVisible)(v7, 0);
v8 = *p_m_pSelectedImage;
if ( *p_m_pSelectedImage )
{
a2 = 0;
goto LABEL_23;
}
return;
}
if ( v6 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 320LL))(v6, 0);
p_m_pNormalImage = v4;
}
if ( *p_m_pNormalImage )
((void (__fastcall *)(cocos2d::CCNode *, _QWORD))(*p_m_pNormalImage)->setVisible)(*p_m_pNormalImage, 0);
v8 = *p_m_pSelectedImage;
if ( *p_m_pSelectedImage )
{
LOBYTE(a2) = 1;
LABEL_23:
((void (__fastcall *)(cocos2d::CCNode *, __int64))v8->setVisible)(v8, a2);
}
}