// File: 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
subq $0x140, %rsp            # imm = 0x140
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
callq 0x2e220
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
testb $0x1, 0x74(%rax)
je 0x2718a
movb $0x0, -0x1(%rbp)
jmp 0x277ec
movq 0x5232f(%rip), %rax     # 0x794c0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x13e8, %rax           # imm = 0x13E8
movq %rax, -0x38(%rbp)
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x271c0
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1a0(%rax)
jle 0x271c0
callq 0x18470
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0xf0(%rbp)
callq 0xbc60
movq -0xf0(%rbp), %rsi
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movss 0x33e89(%rip), %xmm0    # 0x5b07c
callq 0x10930
movlpd %xmm0, -0x44(%rbp)
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x27211
jp 0x27211
jmp 0x27223
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0xf4(%rbp)
jmp 0x27230
movss -0x44(%rbp), %xmm0
movss %xmm0, -0xf4(%rbp)
movss -0xf4(%rbp), %xmm0
movss %xmm0, -0xf8(%rbp)
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x27255
jp 0x27255
jmp 0x27268
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0xfc(%rbp)
jmp 0x27275
movss -0x40(%rbp), %xmm0
movss %xmm0, -0xfc(%rbp)
movss -0xf8(%rbp), %xmm0
movss -0xfc(%rbp), %xmm1
leaq -0x4c(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x2d280
movq -0x108(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movss 0xcc(%rax), %xmm1
movss -0x54(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xc7e0
movlpd %xmm0, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x2eb40
leaq -0x68(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0xc060
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x78(%rbp)
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x27326
callq 0x198b0
movlpd %xmm0, -0x84(%rbp)
movss -0x84(%rbp), %xmm0
movss %xmm0, -0x10c(%rbp)
jmp 0x27343
callq 0xc830
movlpd %xmm0, -0x8c(%rbp)
movss -0x8c(%rbp), %xmm0
movss %xmm0, -0x10c(%rbp)
movss -0x10c(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
movss -0x44(%rbp), %xmm0
movq -0x28(%rbp), %rax
movss 0x18(%rax), %xmm1
addss -0x7c(%rbp), %xmm1
subss -0x78(%rbp), %xmm1
movq -0x28(%rbp), %rax
subss 0xa8(%rax), %xmm1
callq 0xb7c0
movss %xmm0, -0x90(%rbp)
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x27395
jp 0x27395
jmp 0x273b2
movl -0x18(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x273b2
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
movss %xmm0, -0x110(%rbp)
jmp 0x273c2
movss -0x90(%rbp), %xmm0
movss %xmm0, -0x110(%rbp)
movss -0x110(%rbp), %xmm0
movss %xmm0, -0x114(%rbp)
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x273e7
jp 0x273e7
jmp 0x273fa
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x118(%rbp)
jmp 0x27407
movss -0x48(%rbp), %xmm0
movss %xmm0, -0x118(%rbp)
movss -0x114(%rbp), %xmm0
movss -0x118(%rbp), %xmm1
leaq -0x98(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x2d280
movq -0x120(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0xc7e0
movlpd %xmm0, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x2eb40
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2746d
jp 0x2746d
jmp 0x27478
movl -0x18(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2748d
movss -0x78(%rbp), %xmm0
addss -0xa0(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movq -0x38(%rbp), %rax
movss 0x33b8b(%rip), %xmm0    # 0x5b024
mulss 0x2c(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xb4(%rbp)
movq -0x38(%rbp), %rax
movss 0x33b6a(%rip), %xmm0    # 0x5b024
mulss 0x30(%rax), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, -0xb8(%rbp)
movq -0x38(%rbp), %rax
movss 0x2c(%rax), %xmm0
subss -0xb4(%rbp), %xmm0
movss %xmm0, -0xbc(%rbp)
movq -0x38(%rbp), %rax
movss 0x30(%rax), %xmm0
subss -0xb8(%rbp), %xmm0
movss %xmm0, -0xc0(%rbp)
movss -0xb4(%rbp), %xmm1
movss -0xa8(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0xa8(%rbp)
movss -0xb8(%rbp), %xmm1
movss -0xa4(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0xbc(%rbp), %xmm0
addss -0xa0(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movss -0xc0(%rbp), %xmm0
addss -0x9c(%rbp), %xmm0
movss %xmm0, -0x9c(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0xc0a0
testb $0x1, %al
jne 0x275a8
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x2759f
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1a0(%rax)
jle 0x2759f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x27800
movb $0x0, -0x1(%rbp)
jmp 0x277ec
movl $0x0, -0xc4(%rbp)
movl -0x18(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x275cc
movl -0xc4(%rbp), %eax
orl $0x2, %eax
movl %eax, -0xc4(%rbp)
movl -0x18(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x275e6
movl -0xc4(%rbp), %eax
orl $0x6, %eax
movl %eax, -0xc4(%rbp)
movl -0x18(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x27600
movl -0xc4(%rbp), %eax
orl $0x20, %eax
movl %eax, -0xc4(%rbp)
movl -0x3c(%rbp), %esi
movl -0xc4(%rbp), %r9d
leaq -0xa8(%rbp), %rdi
leaq -0xc5(%rbp), %rdx
leaq -0xc6(%rbp), %rcx
movl $0x1, %r8d
callq 0x17010
andb $0x1, %al
movb %al, -0xc7(%rbp)
movl -0x18(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x27641
movb $0x0, -0x11(%rbp)
testb $0x1, -0xc5(%rbp)
jne 0x27654
testb $0x1, -0x11(%rbp)
je 0x276f6
movq -0x28(%rbp), %rax
movq %rax, -0x128(%rbp)
testb $0x1, -0xc6(%rbp)
je 0x2767e
testb $0x1, -0xc5(%rbp)
je 0x2767e
movl $0x1a, %eax
movl %eax, -0x12c(%rbp)
jmp 0x2769a
movb -0xc5(%rbp), %dl
movl $0x18, %eax
movl $0x19, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x12c(%rbp)
movq -0x128(%rbp), %rdi
movl -0x12c(%rbp), %esi
movss 0x33969(%rip), %xmm0    # 0x5b018
callq 0x2ea40
movl %eax, -0xcc(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl -0xcc(%rbp), %edi
movsd -0xd8(%rbp), %xmm0
movsd -0xe0(%rbp), %xmm1
xorl %esi, %esi
xorps %xmm2, %xmm2
callq 0x10a20
movl -0x18(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x27746
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1a0(%rax)
jle 0x27746
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x27800
callq 0xc830
movlpd %xmm0, -0xe8(%rbp)
movss -0xe8(%rbp), %xmm1
subss -0x7c(%rbp), %xmm1
movss -0xa0(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0xa0(%rbp)
movl -0x18(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x2776b
movq -0x30(%rbp), %rsi
addq $0x13e8, %rsi           # imm = 0x13E8
addq $0x78, %rsi
addq $0x10, %rsi
xorl %edi, %edi
callq 0x16040
leaq -0x68(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x44(%rbp), %r8
movl $0x9, %r9d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x105f0
movl -0x18(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x277b7
movl $0x1, %edi
callq 0x161b0
testb $0x1, -0xc7(%rbp)
je 0x277e1
movl -0x18(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x277e1
movq -0x28(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x2000000, %eax        # imm = 0x2000000
cmpl $0x0, %eax
je 0x277e1
callq 0x15440
movb -0xc7(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw (%rax,%rax)