// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::SliderFloat(char const*, float*, float, float, char const*, float)
bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format, float power)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiState& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);
    const float w = CalcItemWidth();

    const ImVec2 label_size = CalcTextSize(label, NULL, true);
    const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(w, label_size.y) + style.FramePadding*2.0f);
    const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0.0f));

    // NB- we don't call ItemSize() yet because we may turn into a text edit box below
    if (!ItemAdd(total_bb, &id))
    {
        ItemSize(total_bb, style.FramePadding.y);
        return false;
    }

    const bool hovered = IsHovered(frame_bb, id);
    if (hovered)
        g.HoveredId = id;

    if (!display_format)
        display_format = "%.3f";
    int decimal_precision = ParseFormatPrecision(display_format, 3);

    // Tabbing or CTRL-clicking on Slider turns it into an input box
    bool start_text_input = false;
    const bool tab_focus_requested = FocusableItemRegister(window, g.ActiveId == id);
    if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
    {
        SetActiveID(id, window);
        FocusWindow(window);

        if (tab_focus_requested || g.IO.KeyCtrl)
        {
            start_text_input = true;
            g.ScalarAsInputTextId = 0;
        }
    }
    if (start_text_input || (g.ActiveId == id && g.ScalarAsInputTextId == id))
        return InputScalarAsWidgetReplacement(frame_bb, label, ImGuiDataType_Float, v, id, decimal_precision);

    ItemSize(total_bb, style.FramePadding.y);

    // Actual slider behavior + render grab
    const bool value_changed = SliderBehavior(frame_bb, id, v, v_min, v_max, power, decimal_precision, true);

    // Display value using user-provided display format so user can add prefix/suffix/decorations to the value.
    char value_buf[64];
    const char* value_buf_end = value_buf + ImFormatString(value_buf, IM_ARRAYSIZE(value_buf), display_format, *v);
    RenderTextClipped(frame_bb.Min, frame_bb.Max, value_buf, value_buf_end, NULL, ImGuiAlign_Center|ImGuiAlign_VCenter);

    if (label_size.x > 0.0f)
        RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movss %xmm1, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movss %xmm2, -0x2c(%rbp)
callq 0x2e220
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
testb $0x1, 0x74(%rax)
je 0x207d2
movb $0x0, -0x1(%rbp)
jmp 0x20bec
movq 0x58ce7(%rip), %rax     # 0x794c0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x13e8, %rax           # imm = 0x13E8
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x138(%rbp)
callq 0xbc60
movl %eax, -0x4c(%rbp)
callq 0x185e0
movq -0x138(%rbp), %rsi
movss %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movss 0x3a854(%rip), %xmm0    # 0x5b07c
callq 0x10930
movlpd %xmm0, -0x58(%rbp)
movq -0x38(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x128(%rbp)
movss -0x50(%rbp), %xmm0
movss -0x54(%rbp), %xmm1
leaq -0x80(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x2d280
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdi
callq 0xc7e0
movlpd %xmm0, -0x78(%rbp)
movq -0x48(%rbp), %rdi
addq $0x20, %rdi
movss 0x3a833(%rip), %xmm0    # 0x5b0b8
callq 0xe4b0
movlpd %xmm0, -0x88(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xc7e0
movq -0x128(%rbp), %rsi
movlpd %xmm0, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x2eb40
leaq -0x68(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x68(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x118(%rbp)
movss -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x208fa
movq -0x48(%rbp), %rax
movss 0x34(%rax), %xmm0
addss -0x58(%rbp), %xmm0
movss %xmm0, -0x13c(%rbp)
jmp 0x20907
xorps %xmm0, %xmm0
movss %xmm0, -0x13c(%rbp)
jmp 0x20907
movss -0x13c(%rbp), %xmm0
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x148(%rbp)
xorps %xmm1, %xmm1
callq 0x2d280
movq -0x118(%rbp), %rdi
movq -0x148(%rbp), %rsi
callq 0xc7e0
movq -0x120(%rbp), %rsi
movlpd %xmm0, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x2eb40
leaq -0x98(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0xc0a0
testb $0x1, %al
jne 0x2098c
movq -0x48(%rbp), %rax
movss 0x24(%rax), %xmm0
leaq -0x98(%rbp), %rdi
callq 0xc060
movb $0x0, -0x1(%rbp)
jmp 0x20bec
movl -0x4c(%rbp), %esi
leaq -0x68(%rbp), %rdi
xorl %edx, %edx
callq 0xc3f0
andb $0x1, %al
movb %al, -0xa9(%rbp)
testb $0x1, -0xa9(%rbp)
je 0x209b8
movl -0x4c(%rbp), %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x1788(%rax)
cmpq $0x0, -0x28(%rbp)
jne 0x209ca
leaq 0x3bb14(%rip), %rax     # 0x5c4da
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl $0x3, %esi
callq 0x1fbf0
movl %eax, -0xb0(%rbp)
movb $0x0, -0xb1(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rax
movl 0x1790(%rax), %eax
cmpl -0x4c(%rbp), %eax
sete %al
movzbl %al, %esi
andl $0x1, %esi
movl $0x1, %edx
callq 0xc4e0
andb $0x1, %al
movb %al, -0xb2(%rbp)
testb $0x1, -0xb2(%rbp)
jne 0x20a30
testb $0x1, -0xa9(%rbp)
je 0x20a72
movq -0x40(%rbp), %rax
testb $0x1, 0x354(%rax)
je 0x20a72
movl -0x4c(%rbp), %edi
movq -0x38(%rbp), %rsi
callq 0xbe60
movq -0x38(%rbp), %rdi
callq 0xef00
testb $0x1, -0xb2(%rbp)
jne 0x20a5b
movq -0x40(%rbp), %rax
testb $0x1, 0x105(%rax)
je 0x20a70
movb $0x1, -0xb1(%rbp)
movq -0x40(%rbp), %rax
movl $0x0, 0x27a0(%rax)
jmp 0x20a72
testb $0x1, -0xb1(%rbp)
jne 0x20a99
movq -0x40(%rbp), %rax
movl 0x1790(%rax), %eax
cmpl -0x4c(%rbp), %eax
jne 0x20ac4
movq -0x40(%rbp), %rax
movl 0x27a0(%rax), %eax
cmpl -0x4c(%rbp), %eax
jne 0x20ac4
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl -0x4c(%rbp), %r8d
movl -0xb0(%rbp), %r9d
leaq -0x68(%rbp), %rdi
movl $0x1, %edx
callq 0x1cd70
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x20bec
movq -0x48(%rbp), %rax
movss 0x24(%rax), %xmm0
leaq -0x98(%rbp), %rdi
callq 0xc060
movl -0x4c(%rbp), %esi
movq -0x18(%rbp), %rdx
movss -0x1c(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
movl -0xb0(%rbp), %ecx
leaq -0x68(%rbp), %rdi
movl $0x1, %r8d
callq 0x1fdd0
andb $0x1, %al
movb %al, -0xb3(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x100(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x40, %esi
movb $0x1, %al
callq 0x95a0
movl %eax, %ecx
movq -0x150(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x108(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x68(%rbp), %rsi
addq $0x8, %rsi
leaq -0x100(%rbp), %rdx
movq -0x108(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movl $0x12, %r9d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x105f0
movss -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x20be1
movss -0x64(%rbp), %xmm1
movss -0x60(%rbp), %xmm0
movq -0x48(%rbp), %rax
movss 0x24(%rax), %xmm2
movss 0x34(%rax), %xmm3
addss %xmm3, %xmm0
addss %xmm2, %xmm1
leaq -0x110(%rbp), %rdi
callq 0x2d280
movq -0x10(%rbp), %rdi
movsd -0x110(%rbp), %xmm0
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x10100
movb -0xb3(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw (%rax,%rax)