// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::BeginMenuBar()
bool ImGui::BeginMenuBar()
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;
    if (!(window->Flags & ImGuiWindowFlags_MenuBar))
        return false;

    IM_ASSERT(!window->DC.MenuBarAppending);
    BeginGroup(); // Backup position on layer 0 // FIXME: Misleading to use a group for that backup/restore
    PushID("##menubar");

    // We don't clip with current window clipping rectangle as it is already set to the area below. However we clip with window full rect.
    // We remove 1 worth of rounding to Max.x to that text in long menus and small windows don't tend to display over the lower-right rounded area, which looks particularly glitchy.
    ImRect bar_rect = window->MenuBarRect();
    ImRect clip_rect(IM_ROUND(bar_rect.Min.x + window->WindowBorderSize), IM_ROUND(bar_rect.Min.y + window->WindowBorderSize), IM_ROUND(ImMax(bar_rect.Min.x, bar_rect.Max.x - ImMax(window->WindowRounding, window->WindowBorderSize))), IM_ROUND(bar_rect.Max.y));
    clip_rect.ClipWith(window->OuterRectClipped);
    PushClipRect(clip_rect.Min, clip_rect.Max, false);

    // We overwrite CursorMaxPos because BeginGroup sets it to CursorPos (essentially the .EmitItem hack in EndMenuBar() would need something analoguous here, maybe a BeginGroupEx() with flags).
    window->DC.CursorPos = window->DC.CursorMaxPos = ImVec2(bar_rect.Min.x + window->DC.MenuBarOffset.x, bar_rect.Min.y + window->DC.MenuBarOffset.y);
    window->DC.LayoutType = ImGuiLayoutType_Horizontal;
    window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
    window->DC.MenuBarAppending = true;
    AlignTextToFramePadding();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
leaq 0x5993c(%rip), %rax     # 0xfdcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rbx
movb $0x1, 0x90(%rbx)
cmpb $0x0, 0x93(%rbx)
jne 0xa43b4
testb $0x4, 0xd(%rbx)
jne 0xa43bb
xorl %eax, %eax
jmp 0xa453e
cmpb $0x1, 0x15e(%rbx)
je 0xa4545
callq 0x5752d
leaq 0x307d8(%rip), %rdi     # 0xd4bac
callq 0x55c36
movq %rbx, %rdi
callq 0x5fe88
movss 0x48(%rbx), %xmm3
movss 0x4c(%rbx), %xmm5
movaps %xmm0, %xmm2
addss %xmm5, %xmm2
movss 0x12c0a(%rip), %xmm4    # 0xb7004
addss %xmm4, %xmm2
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm7
movaps %xmm0, %xmm2
movaps %xmm0, -0x20(%rbp)
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
movaps %xmm2, -0x30(%rbp)
addss %xmm5, %xmm2
addss %xmm4, %xmm2
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm2
movaps %xmm5, %xmm6
cmpless %xmm3, %xmm6
andps %xmm6, %xmm3
andnps %xmm5, %xmm6
orps %xmm3, %xmm6
movaps %xmm1, %xmm3
subss %xmm6, %xmm3
movaps %xmm3, %xmm5
cmpless %xmm0, %xmm5
movaps %xmm5, %xmm6
andnps %xmm3, %xmm6
andps %xmm0, %xmm5
orps %xmm6, %xmm5
addss %xmm4, %xmm5
cvttps2dq %xmm5, %xmm3
cvtdq2ps %xmm3, %xmm3
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm4, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movaps %xmm3, %xmm4
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movaps %xmm7, %xmm5
unpcklps %xmm2, %xmm5            # xmm5 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
movlhps %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
leaq -0x38(%rbp), %rsi
movups %xmm5, -0x8(%rsi)
movss 0x208(%rbx), %xmm4
movss 0x20c(%rbx), %xmm5
movaps %xmm4, %xmm6
cmpless %xmm7, %xmm6
andps %xmm6, %xmm7
andnps %xmm4, %xmm6
orps %xmm7, %xmm6
movaps %xmm5, %xmm0
cmpless %xmm2, %xmm0
andps %xmm0, %xmm2
andnps %xmm5, %xmm0
orps %xmm2, %xmm0
unpcklps %xmm0, %xmm6            # xmm6 = xmm6[0],xmm0[0],xmm6[1],xmm0[1]
movlps %xmm6, -0x8(%rsi)
movss 0x210(%rbx), %xmm0
minss %xmm0, %xmm3
movss 0x214(%rbx), %xmm0
minss %xmm0, %xmm1
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movlps %xmm3, (%rsi)
leaq -0x40(%rbp), %rdi
xorl %edx, %edx
callq 0x50eae
movss 0x160(%rbx), %xmm0
addss -0x20(%rbp), %xmm0
movss 0x164(%rbx), %xmm1
addss -0x30(%rbp), %xmm1
movss %xmm0, 0xf0(%rbx)
movss %xmm1, 0xf4(%rbx)
movss %xmm0, 0xd8(%rbx)
movss %xmm1, 0xdc(%rbx)
movl $0x0, 0x1bc(%rbx)
movl $0x1, 0x14c(%rbx)
movb $0x1, 0x15e(%rbx)
callq 0x951e6
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
leaq 0x30628(%rip), %rdi     # 0xd4b74
leaq 0x2ebf5(%rip), %rsi     # 0xd3148
leaq 0x30637(%rip), %rcx     # 0xd4b91
movl $0x1969, %edx           # imm = 0x1969
callq 0xc140