// File: /workspace/github_cpp_makefile_star2_O3/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 0x592ba(%rip), %rax     # 0xfbcd0
movq (%rax), %rax
movq 0x1ae0(%rax), %rbx
movb $0x1, 0x90(%rbx)
cmpb $0x0, 0x93(%rbx)
jne 0xa2a36
testb $0x4, 0xd(%rbx)
jne 0xa2a3d
xorl %eax, %eax
jmp 0xa2ba5
cmpb $0x1, 0x15e(%rbx)
je 0xa2bac
callq 0x56428
leaq 0x30003(%rip), %rdi     # 0xd2a59
callq 0x54b5f
movq %rbx, %rdi
callq 0x5eca4
movss 0x48(%rbx), %xmm4
movss 0x4c(%rbx), %xmm5
movaps %xmm0, %xmm2
addss %xmm5, %xmm2
movss 0x12588(%rip), %xmm3    # 0xb5004
addss %xmm3, %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 %xmm3, %xmm2
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm2
movaps %xmm5, %xmm6
cmpless %xmm4, %xmm6
andps %xmm6, %xmm4
andnps %xmm5, %xmm6
orps %xmm4, %xmm6
movaps %xmm1, %xmm4
subss %xmm6, %xmm4
movaps %xmm4, %xmm5
cmpless %xmm0, %xmm5
movaps %xmm5, %xmm6
andnps %xmm4, %xmm6
andps %xmm0, %xmm5
orps %xmm6, %xmm5
addss %xmm3, %xmm5
cvttps2dq %xmm5, %xmm4
cvtdq2ps %xmm4, %xmm4
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm3, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
leaq -0x38(%rbp), %rsi
movss 0x208(%rbx), %xmm3
movss 0x20c(%rbx), %xmm5
movaps %xmm3, %xmm6
cmpless %xmm7, %xmm6
andps %xmm6, %xmm7
andnps %xmm3, %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)
minss 0x210(%rbx), %xmm4
minss 0x214(%rbx), %xmm1
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movlps %xmm4, (%rsi)
leaq -0x40(%rbp), %rdi
xorl %edx, %edx
callq 0x4feb9
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 0x9353d
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2fe6e(%rip), %rdi     # 0xd2a21
leaq 0x2e45e(%rip), %rsi     # 0xd1018
leaq 0x2fe7d(%rip), %rcx     # 0xd2a3e
movl $0x1969, %edx           # imm = 0x1969
callq 0xc140