// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::EndMenuBar()
void ImGui::EndMenuBar()
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return;
    ImGuiContext& g = *GImGui;

    // Nav: When a move request within one of our child menu failed, capture the request to navigate among our siblings.
    if (NavMoveRequestButNoResultYet() && (g.NavMoveDir == ImGuiDir_Left || g.NavMoveDir == ImGuiDir_Right) && (g.NavWindow->Flags & ImGuiWindowFlags_ChildMenu))
    {
        ImGuiWindow* nav_earliest_child = g.NavWindow;
        while (nav_earliest_child->ParentWindow && (nav_earliest_child->ParentWindow->Flags & ImGuiWindowFlags_ChildMenu))
            nav_earliest_child = nav_earliest_child->ParentWindow;
        if (nav_earliest_child->ParentWindow == window && nav_earliest_child->DC.ParentLayoutType == ImGuiLayoutType_Horizontal && g.NavMoveRequestForward == ImGuiNavForward_None)
        {
            // To do so we claim focus back, restore NavId and then process the movement request for yet another frame.
            // This involve a one-frame delay which isn't very problematic in this situation. We could remove it by scoring in advance for multiple window (probably not worth the hassle/cost)
            const ImGuiNavLayer layer = ImGuiNavLayer_Menu;
            IM_ASSERT(window->DC.NavLayerActiveMaskNext & (1 << layer)); // Sanity check
            FocusWindow(window);
            SetNavIDWithRectRel(window->NavLastIds[layer], layer, 0, window->NavRectRel[layer]);
            g.NavLayer = layer;
            g.NavDisableHighlight = true; // Hide highlight for the current frame so we don't see the intermediary selection.
            g.NavMoveRequestForward = ImGuiNavForward_ForwardQueued;
            NavMoveRequestCancel();
        }
    }

    IM_ASSERT(window->Flags & ImGuiWindowFlags_MenuBar);
    IM_ASSERT(window->DC.MenuBarAppending);
    PopClipRect();
    PopID();
    window->DC.MenuBarOffset.x = window->DC.CursorPos.x - window->MenuBarRect().Min.x; // Save horizontal position so next append can reuse it. This is kinda equivalent to a per-layer CursorPos.
    g.GroupStack.back().EmitItem = false;
    EndGroup(); // Restore position on layer 0
    window->DC.LayoutType = ImGuiLayoutType_Vertical;
    window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
    window->DC.MenuBarAppending = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x591e5(%rip), %rax     # 0xe3ce0
movq (%rax), %r14
movq 0x1ae0(%r14), %rbx
movb $0x1, 0x90(%rbx)
cmpb $0x0, 0x93(%rbx)
jne 0x8ac2f
callq 0x455d9
testb %al, %al
je 0x8abb9
cmpl $0x1, 0x1d10(%r14)
ja 0x8abb9
movq 0x1c90(%r14), %rax
testb $0x10, 0xf(%rax)
je 0x8abb9
movq %rax, %rcx
movq 0x388(%rax), %rax
testq %rax, %rax
je 0x8ab56
testb $0x10, 0xf(%rax)
jne 0x8ab41
cmpq %rbx, %rax
jne 0x8abb9
cmpl $0x0, 0x1c0(%rcx)
jne 0x8abb9
cmpl $0x0, 0x1d08(%r14)
jne 0x8abb9
testb $0x2, 0x154(%rbx)
je 0x8ac78
movq %rbx, %rdi
callq 0x37fa1
movl 0x3b4(%rbx), %edi
leaq 0x3c8(%rbx), %rcx
pushq $0x1
popq %r15
movl %r15d, %esi
xorl %edx, %edx
callq 0x4547a
movl %r15d, 0x1cdc(%r14)
movb $0x1, 0x1ce6(%r14)
movl %r15d, 0x1d08(%r14)
callq 0x45606
testb $0x4, 0xd(%rbx)
je 0x8ac3a
cmpb $0x0, 0x15e(%rbx)
je 0x8ac59
callq 0x3f128
callq 0x42fea
movss 0xd8(%rbx), %xmm0
movss %xmm0, -0x1c(%rbp)
movq %rbx, %rdi
callq 0x4c2fc
movss -0x1c(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x160(%rbx)
addq $0x1c60, %r14           # imm = 0x1C60
movq %r14, %rdi
callq 0x4b8f2
xorl %r14d, %r14d
movb %r14b, 0x2d(%rax)
callq 0x4352b
movl $0x1, 0x1bc(%rbx)
andl $0x0, 0x14c(%rbx)
movb %r14b, 0x15e(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f1dc(%rip), %rdi     # 0xb9e1d
leaq 0x2d740(%rip), %rsi     # 0xb8388
leaq 0x2f1b5(%rip), %rcx     # 0xb9e04
movl $0x1999, %edx           # imm = 0x1999
callq 0xc140
leaq 0x2f132(%rip), %rdi     # 0xb9d92
leaq 0x2d721(%rip), %rsi     # 0xb8388
leaq 0x2f196(%rip), %rcx     # 0xb9e04
movl $0x199a, %edx           # imm = 0x199A
callq 0xc140
leaq 0x2f154(%rip), %rdi     # 0xb9dd3
leaq 0x2d702(%rip), %rsi     # 0xb8388
leaq 0x2f177(%rip), %rcx     # 0xb9e04
movl $0x198f, %edx           # imm = 0x198F
callq 0xc140