// File: /workspace/github_cpp_makefile_star2_O3/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::Selectable(char const*, bool, int, ImVec2 const&)
bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiState& g = *GImGui;
    const ImGuiStyle& style = g.Style;

    if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsCount > 1)
        PopClipRect();

    ImGuiID id = window->GetID(label);
    ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true);
    ImVec2 size(size_arg.x != 0.0f ? size_arg.x : label_size.x, size_arg.y != 0.0f ? size_arg.y : label_size.y);
    ImVec2 pos = window->DC.CursorPos;
    pos.y += window->DC.CurrentLineTextBaseOffset;
    ImRect bb(pos, pos + size);
    ItemSize(bb);

    // Fill horizontal space.
    ImVec2 window_padding = window->WindowPadding;
    float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? ImGui::GetWindowContentRegionMax().x : ImGui::GetContentRegionMax().x;
    float w_draw = ImMax(label_size.x, window->Pos.x + max_x - window_padding.x - window->DC.CursorPos.x);
    ImVec2 size_draw((size_arg.x != 0 && !(flags & ImGuiSelectableFlags_DrawFillAvailWidth)) ? size_arg.x : w_draw, size_arg.y != 0.0f ? size_arg.y : size.y);
    ImRect bb_with_spacing(pos, pos + size_draw);
    if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_DrawFillAvailWidth))
        bb_with_spacing.Max.x += window_padding.x;

    // Selectables are tightly packed together, we extend the box to cover spacing between selectable.
    float spacing_L = (float)(int)(style.ItemSpacing.x * 0.5f);
    float spacing_U = (float)(int)(style.ItemSpacing.y * 0.5f);
    float spacing_R = style.ItemSpacing.x - spacing_L;
    float spacing_D = style.ItemSpacing.y - spacing_U;
    bb_with_spacing.Min.x -= spacing_L;
    bb_with_spacing.Min.y -= spacing_U;
    bb_with_spacing.Max.x += spacing_R;
    bb_with_spacing.Max.y += spacing_D;
    if (!ItemAdd(bb_with_spacing, &id))
    {
        if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsCount > 1)
            PushColumnClipRect();
        return false;
    }

    ImGuiButtonFlags button_flags = 0;
    if (flags & ImGuiSelectableFlags_Menu) button_flags |= ImGuiButtonFlags_PressedOnClick;
    if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnClick|ImGuiButtonFlags_PressedOnRelease;
    if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled;
    bool hovered, held;
    bool pressed = ButtonBehavior(bb_with_spacing, id, &hovered, &held, true, button_flags);
    if (flags & ImGuiSelectableFlags_Disabled)
        selected = false;

    // Render
    if (hovered || selected)
    {
        const ImU32 col = window->Color((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
        RenderFrame(bb_with_spacing.Min, bb_with_spacing.Max, col, false, 0.0f);
    }

    if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.ColumnsCount > 1)
    {
        PushColumnClipRect();
        bb_with_spacing.Max.x -= (ImGui::GetContentRegionMax().x - max_x);
    }

    if (flags & ImGuiSelectableFlags_Disabled) ImGui::PushStyleColor(ImGuiCol_Text, g.Style.Colors[ImGuiCol_TextDisabled]);
    RenderTextClipped(bb.Min, bb_with_spacing.Max, label, NULL, &label_size);
    if (flags & ImGuiSelectableFlags_Disabled) ImGui::PopStyleColor();

    // Automatically close popups
    if (pressed && !(flags & ImGuiSelectableFlags_DontClosePopups) && (window->Flags & ImGuiWindowFlags_Popup))
        ImGui::CloseCurrentPopup();
    return pressed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq 0x352ac(%rip), %r12     # 0x55480
movq 0x1758(%r12), %rbx
movb $0x1, 0x72(%rbx)
cmpb $0x0, 0x74(%rbx)
je 0x201fe
xorl %r13d, %r13d
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, %r13
movl %edx, %r14d
movq %rdi, %r15
movl %esi, -0x44(%rbp)
testb $0x2, %r14b
je 0x2021e
cmpl $0x2, 0x1a0(%rbx)
jl 0x2021e
callq 0x14778
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0xa766
movl %eax, -0x38(%rbp)
movss 0x1d166(%rip), %xmm0    # 0x3d39c
movq %r15, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xe505
movlps %xmm0, -0x60(%rbp)
movss (%r13), %xmm1
movss 0x4(%r13), %xmm2
xorps %xmm3, %xmm3
movaps %xmm1, %xmm5
cmpneqss %xmm3, %xmm5
movaps %xmm5, %xmm4
andnps %xmm0, %xmm4
andps %xmm1, %xmm5
orps %xmm4, %xmm5
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movaps %xmm2, %xmm0
cmpneqss %xmm3, %xmm0
movaps %xmm0, %xmm3
andnps %xmm1, %xmm3
andps %xmm2, %xmm0
orps %xmm3, %xmm0
movl 0xa8(%rbx), %eax
movss 0xac(%rbx), %xmm3
movd %eax, %xmm4
addss 0xcc(%rbx), %xmm3
addss %xmm4, %xmm5
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, %xmm1
addss %xmm3, %xmm1
movaps %xmm5, %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movl %eax, -0x70(%rbp)
movss %xmm3, -0x6c(%rbp)
movlps %xmm2, -0x68(%rbp)
movss %xmm4, -0x40(%rbp)
subss %xmm4, %xmm5
movss %xmm3, -0x30(%rbp)
subss %xmm3, %xmm1
unpcklps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
leaq -0x90(%rbp), %rdi
movlps %xmm5, (%rdi)
xorps %xmm0, %xmm0
callq 0xa99d
movss 0x40(%rbx), %xmm0
movss %xmm0, -0x34(%rbp)
testb $0x2, %r14b
jne 0x20307
callq 0xaf8c
jmp 0x2030c
callq 0x155f0
movss (%r13), %xmm1
movss 0x4(%r13), %xmm2
xorps %xmm5, %xmm5
ucomiss %xmm1, %xmm5
setp %al
setne %cl
orb %al, %cl
testb $0x20, %r14b
sete %al
testb %cl, %al
movss -0x30(%rbp), %xmm6
movss -0x40(%rbp), %xmm7
jne 0x2036f
movss 0x18(%rbx), %xmm3
addss %xmm0, %xmm3
subss -0x34(%rbp), %xmm3
subss 0xa8(%rbx), %xmm3
movaps %xmm3, %xmm1
movaps -0xb0(%rbp), %xmm8
cmpless %xmm8, %xmm1
movaps %xmm1, %xmm4
andnps %xmm3, %xmm4
andps %xmm8, %xmm1
orps %xmm4, %xmm1
cmpneqss %xmm2, %xmm5
andps %xmm5, %xmm2
andnps -0x80(%rbp), %xmm5
orps %xmm2, %xmm5
addss %xmm7, %xmm1
addss %xmm6, %xmm5
movaps %xmm0, -0xa0(%rbp)
jne 0x20394
addss -0x34(%rbp), %xmm1
movss 0x1414(%r12), %xmm0
movss 0x1418(%r12), %xmm2
movss 0x1d01c(%rip), %xmm3    # 0x3d3cc
movaps %xmm0, %xmm4
mulss %xmm3, %xmm4
cvttps2dq %xmm4, %xmm4
cvtdq2ps %xmm4, %xmm4
mulss %xmm2, %xmm3
cvttps2dq %xmm3, %xmm3
cvtdq2ps %xmm3, %xmm3
subss %xmm4, %xmm0
addss %xmm1, %xmm0
subss %xmm3, %xmm2
addss %xmm5, %xmm2
subss %xmm4, %xmm7
leaq -0x58(%rbp), %rdi
movss %xmm7, (%rdi)
subss %xmm3, %xmm6
movss %xmm6, 0x4(%rdi)
movss %xmm0, -0x30(%rbp)
movss %xmm0, 0x8(%rdi)
movss %xmm2, 0xc(%rdi)
leaq -0x38(%rbp), %rsi
callq 0xaaef
testb %al, %al
je 0x20559
movq %r12, -0x80(%rbp)
movq %r15, -0x40(%rbp)
movl %r14d, %eax
shrl %eax
andl $0x2, %eax
testb $0x8, %r14b
movl $0x6, %ecx
cmovel %eax, %ecx
movl %r14d, %r12d
andl $0x10, %r12d
sete %r15b
leal (%rcx,%r12,2), %r9d
movl -0x38(%rbp), %esi
leaq -0x58(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movl $0x1, %r8d
callq 0x13a49
movl %eax, %r13d
andb -0x44(%rbp), %r15b
leaq -0x2a(%rbp), %rax
movb (%rax), %al
orb %al, %r15b
cmpb $0x1, %r15b
jne 0x204fc
movzbl %al, %eax
leal 0x18(%rax), %ecx
testb %al, -0x29(%rbp)
movq 0x35003(%rip), %r15     # 0x55480
movl $0x1a, %eax
cmovel %ecx, %eax
shll $0x4, %eax
movups 0x1460(%r15,%rax), %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x13e8(%r15), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x8c82
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
leaq -0x90(%rbp), %rcx
movsd %xmm0, (%rcx)
leaq -0xb8(%rbp), %rdx
movsd %xmm1, (%rdx)
movq 0x1758(%r15), %rcx
movb $0x1, 0x72(%rcx)
movq 0x270(%rcx), %rdi
leaq -0x90(%rbp), %rsi
xorps %xmm0, %xmm0
movl %eax, %ecx
movl $0xf, %r8d
callq 0x2f984
testb $0x2, %r14b
je 0x2052b
cmpl $0x2, 0x1a0(%rbx)
jl 0x2052b
callq 0x205df
callq 0xaf8c
subss -0xa0(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, -0x50(%rbp)
leaq -0x50(%rbp), %rsi
testl %r12d, %r12d
movq -0x40(%rbp), %r15
jne 0x2057a
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %r8
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x9, %r9d
callq 0xe23a
jmp 0x205bb
testb $0x2, %r14b
je 0x201e6
cmpl $0x2, 0x1a0(%rbx)
jl 0x201e6
callq 0x205df
jmp 0x201e6
movq %rsi, %r12
movq -0x80(%rbp), %rsi
addq $0x1470, %rsi           # imm = 0x1470
xorl %edi, %edi
callq 0x132dd
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %r8
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x9, %r9d
callq 0xe23a
movl $0x1, %edi
callq 0x13561
movl %r13d, %eax
notb %al
orb %r14b, %al
testb $0x1, %al
jne 0x201e9
testb $0x2, 0xf(%rbx)
je 0x201e9
callq 0x127f9
jmp 0x201e9