//
// UILayer::toggleMenuVisibility from 0x1004c9760 to 0x1004c98c0 (352 bytes)
//
// 8 xrefs:
// > PlayLayer::showEndLayer @ 0x1000b5290
// > PlayLayer::showRetryLayer @ 0x1000b6990
// > PlayLayer::resetLevel @ 0x1000be588
// > PlayLayer::pauseGame @ 0x1000bf3c1
// > PlayLayer::resumeAndRestart @ 0x1000bf4c6
// > PlayLayer::resume @ 0x1000bf6c6
// > UILayer::enableEditorMode @ 0x1004c8e4f
// > UILayer::editorPlaytest @ 0x1004c8f95
//
// 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 UILayer::toggleMenuVisibility(UILayer *a1, bool a2)
{
cocos2d::CCArray *m_uiNodes; // rax
cocos2d::ccArray *data; // rax
cocos2d::CCObject **arr; // r13
cocos2d::CCObject **v6; // r14
cocos2d::CCObject *v7; // r15
__int64 v8; // rdi
__int64 v9; // rdi
GameManager *v10; // rax
__int64 v11; // rax
unsigned int v12; // r15d
__int64 v13; // rsi
__int64 v14; // rax
__int16 v16; // [rsp+10h] [rbp-30h] BYREF
char v17; // [rsp+12h] [rbp-2Eh]
__int16 v18; // [rsp+14h] [rbp-2Ch] BYREF
char v19; // [rsp+16h] [rbp-2Ah]
m_uiNodes = a1->m_uiNodes;
if ( m_uiNodes )
{
data = m_uiNodes->data;
if ( data->num )
{
arr = data->arr;
v6 = &arr[data->num - 1];
do
{
v7 = *arr;
if ( !*arr )
break;
v7[6].m_nTag = -1;
*(_WORD *)((char *)&v7[6].m_nZOrder + 3) = 0;
v8 = *(_QWORD *)&v7[5].m_unknown2;
if ( v8 )
{
v19 = -1;
v18 = -1;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v8 + 944LL))(v8, &v18);
}
v9 = *((_QWORD *)&v7[5].m_unknown2 + (BYTE1(v7[6].m_nZOrder) ^ 1u));
if ( v9 )
{
v17 = -1;
v16 = -1;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v9 + 944LL))(v9, &v16);
}
++arr;
}
while ( arr <= v6 );
}
}
v10 = GameManager::sharedState();
if ( GameManager::getGameVariable(v10, "0024") )
{
v11 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_pauseBtn->getNormalImage)(a1->m_pauseBtn);
v12 = 0;
v13 = 75;
if ( !a2 )
v13 = 0;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 896LL))(v11, v13);
if ( (unsigned int)sub_100720070(a1->m_uiNodes) )
{
do
{
v14 = sub_1007200C0(a1->m_uiNodes, v12);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 328LL))(v14, 0);
++v12;
}
while ( v12 < (unsigned int)sub_100720070(a1->m_uiNodes) );
}
}
}