// File: /workspace/github_cpp_makefile_star2_O1/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 0x34fef(%rip), %rax     # 0x55490
movq 0x1758(%rax), %rbx
movb $0x1, 0x72(%rbx)
cmpb $0x0, 0x74(%rbx)
je 0x204ca
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, %r12
movl %esi, -0x64(%rbp)
movq %rax, -0x80(%rbp)
testb $0x2, %r14b
je 0x204ee
cmpl $0x2, 0x1a0(%rbx)
jl 0x204ee
callq 0x14adb
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xa872
movl %eax, -0x48(%rbp)
movss 0x1ce86(%rip), %xmm0    # 0x3d38c
movq %r12, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0xe720
movlps %xmm0, -0x40(%rbp)
movss (%r13), %xmm1
movss 0x4(%r13), %xmm2
xorps %xmm3, %xmm3
movaps %xmm1, %xmm0
cmpneqss %xmm3, %xmm0
andps %xmm0, %xmm1
movss -0x40(%rbp), %xmm4
movss -0x3c(%rbp), %xmm5
andnps %xmm4, %xmm0
orps %xmm1, %xmm0
movaps %xmm2, %xmm1
cmpneqss %xmm3, %xmm1
andps %xmm1, %xmm2
andnps %xmm5, %xmm1
orps %xmm2, %xmm1
movl 0xa8(%rbx), %r15d
movss 0xac(%rbx), %xmm2
addss 0xcc(%rbx), %xmm2
movd %r15d, %xmm3
movd %xmm3, -0x60(%rbp)
addss %xmm3, %xmm0
movaps %xmm1, -0x90(%rbp)
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movl %r15d, -0x74(%rbp)
movss %xmm2, -0x70(%rbp)
movlps %xmm0, -0x6c(%rbp)
movss -0x6c(%rbp), %xmm0
movss -0x68(%rbp), %xmm1
subss -0x74(%rbp), %xmm0
movss %xmm2, -0x30(%rbp)
subss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0xa0(%rbp), %rdi
movlps %xmm0, (%rdi)
xorps %xmm0, %xmm0
callq 0xaab7
movss 0x40(%rbx), %xmm0
movss %xmm0, -0x44(%rbp)
testb $0x2, %r14b
jne 0x205d8
callq 0xb0a3
jmp 0x205dd
callq 0x15a7b
movss (%r13), %xmm2
movss 0x4(%r13), %xmm1
xorps %xmm6, %xmm6
ucomiss %xmm2, %xmm6
setp %al
setne %cl
orb %al, %cl
testb $0x20, %r14b
sete %al
testb %cl, %al
jne 0x20631
movss -0x40(%rbp), %xmm3
movss 0x18(%rbx), %xmm4
addss %xmm0, %xmm4
subss -0x44(%rbp), %xmm4
subss 0xa8(%rbx), %xmm4
movaps %xmm4, %xmm2
cmpless %xmm3, %xmm2
movaps %xmm2, %xmm5
andnps %xmm4, %xmm5
andps %xmm3, %xmm2
orps %xmm5, %xmm2
movaps %xmm0, -0xb0(%rbp)
cmpneqss %xmm1, %xmm6
andps %xmm6, %xmm1
andnps -0x90(%rbp), %xmm6
orps %xmm1, %xmm6
addss -0x60(%rbp), %xmm2
movss -0x30(%rbp), %xmm0
addss %xmm0, %xmm6
unpcklps %xmm6, %xmm2            # xmm2 = xmm2[0],xmm6[0],xmm2[1],xmm6[1]
movl %r15d, -0x58(%rbp)
movss %xmm0, -0x54(%rbp)
movlps %xmm2, -0x50(%rbp)
jne 0x20679
movss -0x44(%rbp), %xmm0
addss -0x50(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movq -0x80(%rbp), %rax
movss 0x1414(%rax), %xmm5
movss 0x1418(%rax), %xmm0
movss 0x1cd27(%rip), %xmm1    # 0x3d3bc
movaps %xmm5, %xmm2
mulss %xmm1, %xmm2
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm2, %xmm2
mulss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
subss %xmm2, %xmm5
subss %xmm1, %xmm0
leaq -0x58(%rbp), %rdi
movss (%rdi), %xmm3
movss 0x4(%rdi), %xmm4
subss %xmm2, %xmm3
movss %xmm3, (%rdi)
subss %xmm1, %xmm4
movss %xmm4, 0x4(%rdi)
addss 0x8(%rdi), %xmm5
movss %xmm5, -0x30(%rbp)
movss %xmm5, 0x8(%rdi)
addss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
leaq -0x48(%rbp), %rsi
callq 0xac09
testb %al, %al
je 0x20857
movq %r12, -0x60(%rbp)
movl %r14d, %eax
shrl %eax
andl $0x2, %eax
testb $0x8, %r14b
movl $0x6, %ecx
cmovel %eax, %ecx
movl %r14d, -0x90(%rbp)
movl %r14d, %r12d
andl $0x10, %r12d
sete %r14b
leal (%rcx,%r12,2), %r9d
movl -0x48(%rbp), %esi
leaq -0x58(%rbp), %rdi
leaq -0x31(%rbp), %r15
leaq -0x29(%rbp), %rcx
movq %r15, %rdx
movl $0x1, %r8d
callq 0x13d8d
movl %eax, %r13d
andb -0x64(%rbp), %r14b
movb (%r15), %al
orb %al, %r14b
cmpb $0x1, %r14b
jne 0x207ef
movzbl %al, %eax
leal 0x18(%rax), %ecx
testb %al, -0x29(%rbp)
movq 0x34d20(%rip), %r14     # 0x55490
movl $0x1a, %eax
cmovel %ecx, %eax
shll $0x4, %eax
movups 0x1460(%r14,%rax), %xmm0
leaq -0xa0(%rbp), %r15
movaps %xmm0, (%r15)
movss 0x13e8(%r14), %xmm0
mulss 0xc(%r15), %xmm0
movss %xmm0, 0xc(%r15)
movq %r15, %rdi
callq 0x8cce
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
movsd %xmm0, (%r15)
leaq -0xb8(%rbp), %rdx
movsd %xmm1, (%rdx)
movq 0x1758(%r14), %rcx
movb $0x1, 0x72(%rcx)
movq 0x270(%rcx), %rdi
leaq -0xa0(%rbp), %rsi
xorps %xmm0, %xmm0
movl %eax, %ecx
movl $0xf, %r8d
callq 0x300c8
movl -0x90(%rbp), %r14d
testb $0x2, %r14b
je 0x20825
cmpl $0x2, 0x1a0(%rbx)
jl 0x20825
callq 0x208d7
callq 0xb0a3
subss -0xb0(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
subss %xmm0, %xmm1
movss %xmm1, -0x50(%rbp)
leaq -0x50(%rbp), %r15
testl %r12d, %r12d
movq -0x80(%rbp), %rsi
jne 0x20878
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x74(%rbp), %rdi
leaq -0x40(%rbp), %r8
movq %r15, %rsi
movq -0x60(%rbp), %rdx
xorl %ecx, %ecx
movl $0x9, %r9d
callq 0xe466
jmp 0x208b3
testb $0x2, %r14b
je 0x204b2
cmpl $0x2, 0x1a0(%rbx)
jl 0x204b2
callq 0x208d7
jmp 0x204b2
addq $0x1470, %rsi           # imm = 0x1470
xorl %edi, %edi
callq 0x1367a
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
leaq -0x74(%rbp), %rdi
leaq -0x40(%rbp), %r8
movq %r15, %rsi
movq -0x60(%rbp), %rdx
xorl %ecx, %ecx
movl $0x9, %r9d
callq 0xe466
movl $0x1, %edi
callq 0x13916
movl %r13d, %eax
notb %al
orb %r14b, %al
testb $0x1, %al
jne 0x204b5
testb $0x2, 0xf(%rbx)
je 0x204b5
callq 0x12b73
jmp 0x204b5