// File: /workspace/github_cpp_makefile_star2_O3/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 0x590f4(%rip), %rax     # 0xfbcd0
movq (%rax), %r14
movq 0x1ae0(%r14), %rbx
movb $0x1, 0x90(%rbx)
cmpb $0x0, 0x93(%rbx)
jne 0xa2d2c
callq 0x57d7d
testb %al, %al
je 0xa2c9e
cmpl $0x1, 0x1d10(%r14)
ja 0xa2c9e
movq 0x1c90(%r14), %rax
testb $0x10, 0xf(%rax)
je 0xa2c9e
movq %rax, %rcx
movq 0x388(%rax), %rax
testq %rax, %rax
je 0xa2c37
testb $0x10, 0xf(%rax)
jne 0xa2c22
cmpq %rbx, %rax
jne 0xa2c9e
cmpl $0x0, 0x1c0(%rcx)
jne 0xa2c9e
cmpl $0x0, 0x1d08(%r14)
jne 0xa2c9e
testb $0x2, 0x154(%rbx)
je 0xa2d94
movq %rbx, %rdi
callq 0x4726c
movl 0x3b4(%rbx), %edi
leaq 0x3c8(%rbx), %rcx
movl $0x1, %r15d
movl $0x1, %esi
xorl %edx, %edx
callq 0x57c1e
movl %r15d, 0x1cdc(%r14)
movb $0x1, 0x1ce6(%r14)
movl %r15d, 0x1d08(%r14)
callq 0x57daa
testb $0x4, 0xd(%rbx)
je 0xa2d37
cmpb $0x0, 0x15e(%rbx)
je 0xa2d56
callq 0x4ff37
callq 0x55082
movss 0xd8(%rbx), %xmm0
movss %xmm0, -0x1c(%rbp)
movq %rbx, %rdi
callq 0x5eca4
movss -0x1c(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x160(%rbx)
movslq 0x1c60(%r14), %rax
testq %rax, %rax
jle 0xa2d75
movq 0x1c68(%r14), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
xorl %r14d, %r14d
movb %r14b, -0x3(%rcx,%rax)
callq 0x55617
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 0x2fd6f(%rip), %rdi     # 0xd2aad
leaq 0x2e2d3(%rip), %rsi     # 0xd1018
leaq 0x2fd48(%rip), %rcx     # 0xd2a94
movl $0x1999, %edx           # imm = 0x1999
callq 0xc140
leaq 0x2fcc5(%rip), %rdi     # 0xd2a22
leaq 0x2e2b4(%rip), %rsi     # 0xd1018
leaq 0x2fd29(%rip), %rcx     # 0xd2a94
movl $0x199a, %edx           # imm = 0x199A
callq 0xc140
leaq 0x2ac2e(%rip), %rdi     # 0xcd9aa
leaq 0x16908(%rip), %rsi     # 0xb968b
leaq 0x17fc7(%rip), %rcx     # 0xbad51
movl $0x666, %edx            # imm = 0x666
callq 0xc140
leaq 0x2fcc8(%rip), %rdi     # 0xd2a63
leaq 0x2e276(%rip), %rsi     # 0xd1018
leaq 0x2fceb(%rip), %rcx     # 0xd2a94
movl $0x198f, %edx           # imm = 0x198F
callq 0xc140