// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_slider_behavior
NK_LIB float
nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor,
    struct nk_rect *visual_cursor, struct nk_input *in,
    struct nk_rect bounds, float slider_min, float slider_max, float slider_value,
    float slider_step, float slider_steps)
{
    int left_mouse_down;
    int left_mouse_click_in_cursor;

    /* check if visual cursor is being dragged */
    nk_widget_state_reset(state);
    left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
    left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
            NK_BUTTON_LEFT, *visual_cursor, nk_true);

    if (left_mouse_down && left_mouse_click_in_cursor) {
        float ratio = 0;
        const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f);
        const float pxstep = bounds.w / slider_steps;

        /* only update value if the next slider step is reached */
        *state = NK_WIDGET_STATE_ACTIVE;
        if (NK_ABS(d) >= pxstep) {
            const float steps = (float)((int)(NK_ABS(d) / pxstep));
            slider_value += (d > 0) ? (slider_step*steps) : -(slider_step*steps);
            slider_value = NK_CLAMP(slider_min, slider_value, slider_max);
            ratio = (slider_value - slider_min)/slider_step;
            logical_cursor->x = bounds.x + (logical_cursor->w * ratio);
            in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x;
        }
    }

    /* slider widget state */
    if (nk_input_is_mouse_hovering_rect(in, bounds))
        *state = NK_WIDGET_STATE_HOVERED;
    if (*state & NK_WIDGET_STATE_HOVER &&
        !nk_input_is_mouse_prev_hovering_rect(in, bounds))
        *state |= NK_WIDGET_STATE_ENTERED;
    else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
        *state |= NK_WIDGET_STATE_LEFT;
    return slider_value;
}

// Assembly:
subq $0x78, %rsp
movlpd %xmm0, 0x68(%rsp)
movlpd %xmm1, 0x70(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movss %xmm2, 0x44(%rsp)
movss %xmm3, 0x40(%rsp)
movss %xmm4, 0x3c(%rsp)
movss %xmm5, 0x38(%rsp)
movss %xmm6, 0x34(%rsp)
movq 0x60(%rsp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x8a68e
movq 0x60(%rsp), %rax
movl $0x6, (%rax)
jmp 0x8a699
movq 0x60(%rsp), %rax
movl $0x4, (%rax)
xorl %eax, %eax
cmpq $0x0, 0x48(%rsp)
movb %al, 0x1b(%rsp)
je 0x8a6ba
movq 0x48(%rsp), %rax
cmpl $0x0, 0x104(%rax)
setne %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x30(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x48(%rsp)
movb %al, 0x1a(%rsp)
je 0x8a700
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rax
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
xorl %eax, %eax
xorl %esi, %esi
movl $0x1, %edx
callq 0x13780
cmpl $0x0, %eax
setne %al
movb %al, 0x1a(%rsp)
movb 0x1a(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x30(%rsp)
je 0x8a944
cmpl $0x0, 0x2c(%rsp)
je 0x8a944
xorps %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
movq 0x48(%rsp), %rax
movss 0x144(%rax), %xmm0
movq 0x50(%rsp), %rax
movss (%rax), %xmm2
movq 0x50(%rsp), %rax
movss 0x8(%rax), %xmm1
movss 0x22dc0(%rip), %xmm3    # 0xad514
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x70(%rsp), %xmm0
divss 0x34(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movq 0x60(%rsp), %rax
movl $0x22, (%rax)
xorps %xmm0, %xmm0
ucomiss 0x24(%rsp), %xmm0
jbe 0x8a7a8
movss 0x24(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, 0x14(%rsp)
jmp 0x8a7b4
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x14(%rsp), %xmm0
ucomiss 0x20(%rsp), %xmm0
jb 0x8a942
xorps %xmm0, %xmm0
ucomiss 0x24(%rsp), %xmm0
jbe 0x8a7ea
movss 0x24(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, 0x10(%rsp)
jmp 0x8a7f6
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x10(%rsp), %xmm0
divss 0x20(%rsp), %xmm0
cvttss2si %xmm0, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x24(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x8a832
movss 0x38(%rsp), %xmm0
mulss 0x1c(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
jmp 0x8a851
movss 0x38(%rsp), %xmm0
mulss 0x1c(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, 0xc(%rsp)
movss 0xc(%rsp), %xmm0
addss 0x3c(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm1
movss 0x40(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8a882
movss 0x3c(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
jmp 0x8a88e
movss 0x40(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x8(%rsp), %xmm1
movss 0x44(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8a8ad
movss 0x44(%rsp), %xmm0
movss %xmm0, 0x4(%rsp)
jmp 0x8a8e1
movss 0x3c(%rsp), %xmm1
movss 0x40(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8a8cb
movss 0x3c(%rsp), %xmm0
movss %xmm0, (%rsp)
jmp 0x8a8d6
movss 0x40(%rsp), %xmm0
movss %xmm0, (%rsp)
movss (%rsp), %xmm0
movss %xmm0, 0x4(%rsp)
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm0
subss 0x44(%rsp), %xmm0
divss 0x38(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x68(%rsp), %xmm1
movq 0x58(%rsp), %rax
movss 0x8(%rax), %xmm0
movss 0x28(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0x58(%rsp), %rax
movss %xmm0, (%rax)
movq 0x58(%rsp), %rax
movss (%rax), %xmm0
movq 0x48(%rsp), %rax
movss %xmm0, 0x10c(%rax)
jmp 0x8a944
movq 0x48(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
callq 0x15440
cmpl $0x0, %eax
je 0x8a96a
movq 0x60(%rsp), %rax
movl $0x12, (%rax)
movq 0x60(%rsp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x8a9a2
movq 0x48(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
callq 0x14d70
cmpl $0x0, %eax
jne 0x8a9a2
movq 0x60(%rsp), %rax
movl (%rax), %ecx
orl $0x8, %ecx
movl %ecx, (%rax)
jmp 0x8a9cb
movq 0x48(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
callq 0x14d70
cmpl $0x0, %eax
je 0x8a9c9
movq 0x60(%rsp), %rax
movl (%rax), %ecx
orl $0x40, %ecx
movl %ecx, (%rax)
jmp 0x8a9cb
movss 0x3c(%rsp), %xmm0
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)