// File: /workspace/github_cpp_makefile_star2_O1/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 0x5975b(%rip), %rax     # 0xfdcd0
movq (%rax), %r14
movq 0x1ae0(%r14), %rbx
movb $0x1, 0x90(%rbx)
cmpb $0x0, 0x93(%rbx)
jne 0xa46c5
callq 0x58ef0
testb %al, %al
je 0xa4637
cmpl $0x1, 0x1d10(%r14)
ja 0xa4637
movq 0x1c90(%r14), %rax
testb $0x10, 0xf(%rax)
je 0xa4637
movq %rax, %rcx
movq 0x388(%rax), %rax
testq %rax, %rax
je 0xa45d0
testb $0x10, 0xf(%rax)
jne 0xa45bb
cmpq %rbx, %rax
jne 0xa4637
cmpl $0x0, 0x1c0(%rcx)
jne 0xa4637
cmpl $0x0, 0x1d08(%r14)
jne 0xa4637
testb $0x2, 0x154(%rbx)
je 0xa472d
movq %rbx, %rdi
callq 0x47d9b
movl 0x3b4(%rbx), %edi
leaq 0x3c8(%rbx), %rcx
movl $0x1, %r15d
movl $0x1, %esi
xorl %edx, %edx
callq 0x58d91
movl %r15d, 0x1cdc(%r14)
movb $0x1, 0x1ce6(%r14)
movl %r15d, 0x1d08(%r14)
callq 0x58f1d
testb $0x4, 0xd(%rbx)
je 0xa46d0
cmpb $0x0, 0x15e(%rbx)
je 0xa46ef
callq 0x50f2c
callq 0x56188
movss 0xd8(%rbx), %xmm0
movss %xmm0, -0x1c(%rbp)
movq %rbx, %rdi
callq 0x5fe88
movss -0x1c(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x160(%rbx)
movslq 0x1c60(%r14), %rax
testq %rax, %rax
jle 0xa470e
movq 0x1c68(%r14), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
xorl %r14d, %r14d
movb %r14b, -0x3(%rcx,%rax)
callq 0x56723
movl $0x1, 0x1bc(%rbx)
movl $0x0, 0x14c(%rbx)
movb %r14b, 0x15e(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30529(%rip), %rdi     # 0xd4c00
leaq 0x2ea6a(%rip), %rsi     # 0xd3148
leaq 0x30502(%rip), %rcx     # 0xd4be7
movl $0x1999, %edx           # imm = 0x1999
callq 0xc140
leaq 0x3047f(%rip), %rdi     # 0xd4b75
leaq 0x2ea4b(%rip), %rsi     # 0xd3148
leaq 0x304e3(%rip), %rcx     # 0xd4be7
movl $0x199a, %edx           # imm = 0x199A
callq 0xc140
leaq 0x2b2c5(%rip), %rdi     # 0xcf9da
leaq 0x16f6f(%rip), %rsi     # 0xbb68b
leaq 0x1865b(%rip), %rcx     # 0xbcd7e
movl $0x666, %edx            # imm = 0x666
callq 0xc140
leaq 0x30482(%rip), %rdi     # 0xd4bb6
leaq 0x2ea0d(%rip), %rsi     # 0xd3148
leaq 0x304a5(%rip), %rcx     # 0xd4be7
movl $0x198f, %edx           # imm = 0x198F
callq 0xc140