// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
leaq 0x59380(%rip), %rax     # 0xe3ce0
movq (%rax), %rax
movq 0x1ae0(%rax), %rbx
movb $0x1, 0x90(%rbx)
cmpb $0x0, 0x93(%rbx)
jne 0x8a980
testb $0x4, 0xd(%rbx)
jne 0x8a987
xorl %eax, %eax
jmp 0x8aac0
cmpb $0x1, 0x15e(%rbx)
je 0x8aacb
callq 0x43ff2
leaq 0x2f429(%rip), %rdi     # 0xb9dc9
callq 0x42ea4
movq %rbx, %rdi
callq 0x4c2fc
movss 0x48(%rbx), %xmm3
movss 0x4c(%rbx), %xmm4
movaps %xmm0, %xmm5
addss %xmm4, %xmm5
movss 0x11652(%rip), %xmm2    # 0x9c018
addss %xmm2, %xmm5
cvttps2dq %xmm5, %xmm5
cvtdq2ps %xmm5, %xmm6
movaps %xmm0, %xmm5
shufps $0x55, %xmm0, %xmm5     # xmm5 = xmm5[1,1],xmm0[1,1]
movaps %xmm5, -0x40(%rbp)
addss %xmm4, %xmm5
addss %xmm2, %xmm5
cvttps2dq %xmm5, %xmm5
cvtdq2ps %xmm5, %xmm5
unpcklps %xmm5, %xmm6            # xmm6 = xmm6[0],xmm5[0],xmm6[1],xmm5[1]
movaps %xmm4, %xmm5
cmpless %xmm3, %xmm5
andps %xmm5, %xmm3
andnps %xmm4, %xmm5
orps %xmm3, %xmm5
movaps %xmm1, %xmm3
subss %xmm5, %xmm3
movaps %xmm3, %xmm4
movaps %xmm0, -0x30(%rbp)
cmpless %xmm0, %xmm4
movaps %xmm4, %xmm5
andnps %xmm3, %xmm5
andps %xmm0, %xmm4
orps %xmm5, %xmm4
addss %xmm2, %xmm4
cvttps2dq %xmm4, %xmm3
cvtdq2ps %xmm3, %xmm3
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss %xmm2, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
unpcklps %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movlhps %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0]
leaq -0x48(%rbp), %r14
movups %xmm6, -0x8(%r14)
leaq 0x208(%rbx), %rsi
leaq -0x50(%rbp), %r15
movq %r15, %rdi
callq 0x49efc
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x3f0d3
movss 0x160(%rbx), %xmm0
addss -0x30(%rbp), %xmm0
movss 0x164(%rbx), %xmm1
addss -0x40(%rbp), %xmm1
movss %xmm0, 0xf0(%rbx)
movss %xmm1, 0xf4(%rbx)
movss %xmm0, 0xd8(%rbx)
movss %xmm1, 0xdc(%rbx)
andl $0x0, 0x1bc(%rbx)
movl $0x1, 0x14c(%rbx)
movb $0x1, 0x15e(%rbx)
callq 0x7c785
movb $0x1, %al
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2f2bf(%rip), %rdi     # 0xb9d91
leaq 0x2d8af(%rip), %rsi     # 0xb8388
leaq 0x2f2ce(%rip), %rcx     # 0xb9dae
movl $0x1969, %edx           # imm = 0x1969
callq 0xc140