// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::DragFloat(char const*, float*, float, float, float, char const*, float)
bool ImGui::DragFloat(const char* label, float* v, float v_speed, 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 inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
    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 Drag 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] | g.IO.MouseDoubleClicked[0])))
    {
        SetActiveID(id, window);
        FocusWindow(window);

        if (tab_focus_requested || g.IO.KeyCtrl || g.IO.MouseDoubleClicked[0])
        {
            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);

    // Actual drag behavior
    ItemSize(total_bb, style.FramePadding.y);
    const bool value_changed = DragBehavior(frame_bb, id, v, v_speed, v_min, v_max, decimal_precision, power);

    // 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, inner_bb.Min.y), label);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movss %xmm1, -0x20(%rbp)
movss %xmm2, -0x24(%rbp)
movq %rdx, -0x30(%rbp)
movss %xmm3, -0x34(%rbp)
callq 0x2e220
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
testb $0x1, 0x74(%rax)
je 0x21e57
movb $0x0, -0x1(%rbp)
jmp 0x222e9
movq 0x57662(%rip), %rax     # 0x794c0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0x13e8, %rax           # imm = 0x13E8
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x160(%rbp)
callq 0xbc60
movl %eax, -0x54(%rbp)
callq 0x185e0
movq -0x160(%rbp), %rsi
movss %xmm0, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movss 0x391cf(%rip), %xmm0    # 0x5b07c
callq 0x10930
movlpd %xmm0, -0x60(%rbp)
movq -0x40(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x150(%rbp)
movss -0x58(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
leaq -0x88(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x2d280
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdi
callq 0xc7e0
movlpd %xmm0, -0x80(%rbp)
movq -0x50(%rbp), %rdi
addq $0x20, %rdi
movss 0x391ab(%rip), %xmm0    # 0x5b0b8
callq 0xe4b0
movlpd %xmm0, -0x90(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xc7e0
movq -0x150(%rbp), %rsi
movlpd %xmm0, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
movq %rdi, -0x148(%rbp)
leaq -0x78(%rbp), %rdx
callq 0x2eb40
movq -0x148(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x20, %rsi
callq 0xc7e0
movlpd %xmm0, -0xa8(%rbp)
leaq -0x68(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x20, %rsi
callq 0xdf20
movlpd %xmm0, -0xb0(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x2eb40
leaq -0x70(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0x70(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x138(%rbp)
movss -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x21fd8
movq -0x50(%rbp), %rax
movss 0x34(%rax), %xmm0
addss -0x60(%rbp), %xmm0
movss %xmm0, -0x164(%rbp)
jmp 0x21fe5
xorps %xmm0, %xmm0
movss %xmm0, -0x164(%rbp)
jmp 0x21fe5
movss -0x164(%rbp), %xmm0
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x170(%rbp)
xorps %xmm1, %xmm1
callq 0x2d280
movq -0x138(%rbp), %rdi
movq -0x170(%rbp), %rsi
callq 0xc7e0
movq -0x140(%rbp), %rsi
movlpd %xmm0, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0xc8(%rbp), %rdx
callq 0x2eb40
leaq -0xc0(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xc0a0
testb $0x1, %al
jne 0x2206a
movq -0x50(%rbp), %rax
movss 0x24(%rax), %xmm0
leaq -0xc0(%rbp), %rdi
callq 0xc060
movb $0x0, -0x1(%rbp)
jmp 0x222e9
movl -0x54(%rbp), %esi
leaq -0x70(%rbp), %rdi
xorl %edx, %edx
callq 0xc3f0
andb $0x1, %al
movb %al, -0xd1(%rbp)
testb $0x1, -0xd1(%rbp)
je 0x22096
movl -0x54(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x1788(%rax)
cmpq $0x0, -0x30(%rbp)
jne 0x220a8
leaq 0x3a436(%rip), %rax     # 0x5c4da
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x3, %esi
callq 0x1fbf0
movl %eax, -0xd8(%rbp)
movb $0x0, -0xd9(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rax
movl 0x1790(%rax), %eax
cmpl -0x54(%rbp), %eax
sete %al
movzbl %al, %esi
andl $0x1, %esi
movl $0x1, %edx
callq 0xc4e0
andb $0x1, %al
movb %al, -0xda(%rbp)
testb $0x1, -0xda(%rbp)
jne 0x22127
testb $0x1, -0xd1(%rbp)
je 0x22176
movq -0x48(%rbp), %rax
movb 0x354(%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x48(%rbp), %rcx
movb 0x398(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
cmpl $0x0, %eax
je 0x22176
movl -0x54(%rbp), %edi
movq -0x40(%rbp), %rsi
callq 0xbe60
movq -0x40(%rbp), %rdi
callq 0xef00
testb $0x1, -0xda(%rbp)
jne 0x2215f
movq -0x48(%rbp), %rax
testb $0x1, 0x105(%rax)
jne 0x2215f
movq -0x48(%rbp), %rax
testb $0x1, 0x398(%rax)
je 0x22174
movb $0x1, -0xd9(%rbp)
movq -0x48(%rbp), %rax
movl $0x0, 0x27a0(%rax)
jmp 0x22176
testb $0x1, -0xd9(%rbp)
jne 0x2219d
movq -0x48(%rbp), %rax
movl 0x1790(%rax), %eax
cmpl -0x54(%rbp), %eax
jne 0x221c8
movq -0x48(%rbp), %rax
movl 0x27a0(%rax), %eax
cmpl -0x54(%rbp), %eax
jne 0x221c8
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rcx
movl -0x54(%rbp), %r8d
movl -0xd8(%rbp), %r9d
leaq -0x70(%rbp), %rdi
movl $0x1, %edx
callq 0x1cd70
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x222e9
movq -0x50(%rbp), %rax
movss 0x24(%rax), %xmm0
leaq -0xc0(%rbp), %rdi
callq 0xc060
movl -0x54(%rbp), %esi
movq -0x18(%rbp), %rdx
movss -0x1c(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
movss -0x24(%rbp), %xmm2
movl -0xd8(%rbp), %ecx
movss -0x34(%rbp), %xmm3
leaq -0x70(%rbp), %rdi
callq 0x21940
andb $0x1, %al
movb %al, -0xdb(%rbp)
leaq -0x120(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x120(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movl $0x40, %esi
movb $0x1, %al
callq 0x95a0
movl %eax, %ecx
movq -0x178(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x70(%rbp), %rsi
addq $0x8, %rsi
leaq -0x120(%rbp), %rdx
movq -0x128(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movl $0x12, %r9d
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
callq 0x105f0
movss -0x60(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x222de
movss -0x68(%rbp), %xmm0
movq -0x50(%rbp), %rax
movss 0x34(%rax), %xmm1
addss %xmm1, %xmm0
movss -0x9c(%rbp), %xmm1
leaq -0x130(%rbp), %rdi
callq 0x2d280
movq -0x10(%rbp), %rdi
movsd -0x130(%rbp), %xmm0
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x10100
movb -0xdb(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw (%rax,%rax)