// File: /workspace/github_cpp_makefile_star2_O2/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 $0x98, %rsp
movq 0x35918(%rip), %r12     # 0x50480
movq 0x1758(%r12), %rbx
movb $0x1, 0x72(%rbx)
cmpb $0x0, 0x74(%rbx)
je 0x1ab92
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x98, %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, -0x4c(%rbp)
testb $0x2, %r14b
je 0x1abb2
cmpl $0x2, 0x1a0(%rbx)
jl 0x1abb2
callq 0x112a5
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x9858
movl %eax, -0x34(%rbp)
pushq $0x1
popq %rdx
movss 0x1b7cf(%rip), %xmm0    # 0x3639c
movq %r15, %rdi
xorl %esi, %esi
callq 0xc6e3
movlps %xmm0, -0x68(%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, -0xa0(%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), %xmm2
movd %eax, %xmm1
addss 0xcc(%rbx), %xmm2
movd %xmm1, -0x48(%rbp)
addss %xmm1, %xmm5
movaps %xmm0, -0xb0(%rbp)
movaps %xmm0, %xmm1
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
leaq -0x78(%rbp), %rdi
movl %eax, (%rdi)
movss %xmm2, -0x40(%rbp)
movss %xmm2, 0x4(%rdi)
movlps %xmm5, 0x8(%rdi)
xorps %xmm0, %xmm0
callq 0x9af8
movss 0x40(%rbx), %xmm0
movss %xmm0, -0x30(%rbp)
testb $0x2, %r14b
jne 0x1ac87
callq 0x9fb7
jmp 0x1ac8c
callq 0x11cb9
movss (%r13), %xmm1
movss 0x4(%r13), %xmm2
xorps %xmm6, %xmm6
ucomiss %xmm1, %xmm6
setp %al
setne %cl
orb %al, %cl
testb $0x20, %r14b
sete %al
testb %cl, %al
movss -0x40(%rbp), %xmm7
movss -0x48(%rbp), %xmm8
jne 0x1aced
movss 0x18(%rbx), %xmm3
addss %xmm0, %xmm3
subss -0x30(%rbp), %xmm3
subss 0xa8(%rbx), %xmm3
movaps %xmm3, %xmm1
movaps -0xa0(%rbp), %xmm5
cmpless %xmm5, %xmm1
movaps %xmm1, %xmm4
andnps %xmm3, %xmm4
andps %xmm5, %xmm1
orps %xmm4, %xmm1
cmpneqss %xmm2, %xmm6
andps %xmm6, %xmm2
andnps -0xb0(%rbp), %xmm6
orps %xmm2, %xmm6
addss %xmm8, %xmm1
addss %xmm7, %xmm6
movaps %xmm0, -0x90(%rbp)
jne 0x1ad16
addss -0x30(%rbp), %xmm1
movss 0x1414(%r12), %xmm2
movss 0x1418(%r12), %xmm3
movss 0x1b69e(%rip), %xmm4    # 0x363d0
movaps %xmm2, %xmm5
mulss %xmm4, %xmm5
cvttps2dq %xmm5, %xmm5
cvtdq2ps %xmm5, %xmm5
mulss %xmm3, %xmm4
cvttps2dq %xmm4, %xmm4
cvtdq2ps %xmm4, %xmm4
subss %xmm5, %xmm2
addss %xmm1, %xmm2
subss %xmm4, %xmm3
addss %xmm6, %xmm3
subss %xmm5, %xmm8
leaq -0x60(%rbp), %rdi
movss %xmm8, (%rdi)
subss %xmm4, %xmm7
movss %xmm7, 0x4(%rdi)
movss %xmm2, 0x8(%rdi)
movss %xmm3, 0xc(%rdi)
leaq -0x34(%rbp), %rsi
callq 0x9b28
testb %al, %al
je 0x1ae78
movq %r12, -0x48(%rbp)
movq %r15, -0x40(%rbp)
movl %r14d, %eax
shrl %eax
andl $0x2, %eax
testb $0x8, %r14b
pushq $0x6
popq %rcx
cmovel %eax, %ecx
movl %r14d, %r15d
andl $0x10, %r15d
sete %r12b
leal (%rcx,%r15,2), %r9d
movl -0x34(%rbp), %esi
leaq -0x60(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
leaq -0x29(%rbp), %rcx
pushq $0x1
popq %r8
callq 0x1077a
movl %eax, %r13d
andb -0x4c(%rbp), %r12b
leaq -0x2a(%rbp), %rax
movb (%rax), %al
orb %al, %r12b
cmpb $0x1, %r12b
jne 0x1ae19
movzbl %al, %eax
testb %al, -0x29(%rbp)
leal 0x18(%rax), %eax
pushq $0x1a
popq %rsi
cmovel %eax, %esi
movss 0x1b595(%rip), %xmm0    # 0x36390
movq %rbx, %rdi
callq 0x1eae4
movsd -0x60(%rbp), %xmm0
movsd -0x58(%rbp), %xmm1
xorps %xmm2, %xmm2
movl %eax, %edi
xorl %esi, %esi
callq 0xc76b
testb $0x2, %r14b
je 0x1ae48
cmpl $0x2, 0x1a0(%rbx)
jl 0x1ae48
callq 0x1aef4
callq 0x9fb7
subss -0x90(%rbp), %xmm0
movss -0x58(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, -0x58(%rbp)
leaq -0x58(%rbp), %r12
testl %r15d, %r15d
movq -0x48(%rbp), %rsi
jne 0x1ae99
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %r8
pushq $0x9
popq %r9
movq %r12, %rsi
movq -0x40(%rbp), %rdx
xorl %ecx, %ecx
callq 0xc49f
jmp 0x1aed0
testb $0x2, %r14b
je 0x1ab7a
cmpl $0x2, 0x1a0(%rbx)
jl 0x1ab7a
callq 0x1aef4
jmp 0x1ab7a
addq $0x1470, %rsi           # imm = 0x1470
xorl %edi, %edi
callq 0x10000
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %r8
pushq $0x9
popq %r9
movq %r12, %rsi
movq -0x40(%rbp), %rdx
xorl %ecx, %ecx
callq 0xc49f
pushq $0x1
popq %rdi
callq 0x100e8
movl %r13d, %eax
notb %al
orb %r14b, %al
testb $0x1, %al
jne 0x1ab7d
testb $0x2, 0xf(%rbx)
je 0x1ab7d
callq 0xf7a7
jmp 0x1ab7d