// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_drag_behavior
NK_LIB void
nk_drag_behavior(nk_flags *state, const struct nk_input *in,
    struct nk_rect drag, struct nk_property_variant *variant,
    float inc_per_pixel)
{
    int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
    int left_mouse_click_in_cursor = in &&
        nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, drag, nk_true);

    nk_widget_state_reset(state);
    if (nk_input_is_mouse_hovering_rect(in, drag))
        *state = NK_WIDGET_STATE_HOVERED;

    if (left_mouse_down && left_mouse_click_in_cursor) {
        float delta, pixels;
        pixels = in->mouse.delta.x;
        delta = pixels * inc_per_pixel;
        switch (variant->kind) {
        default: break;
        case NK_PROPERTY_INT:
            variant->value.i = variant->value.i + (int)delta;
            variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
            break;
        case NK_PROPERTY_FLOAT:
            variant->value.f = variant->value.f + (float)delta;
            variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
            break;
        case NK_PROPERTY_DOUBLE:
            variant->value.d = variant->value.d + (double)delta;
            variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
            break;
        }
        *state = NK_WIDGET_STATE_ACTIVE;
    }
    if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, drag))
        *state |= NK_WIDGET_STATE_ENTERED;
    else if (nk_input_is_mouse_prev_hovering_rect(in, drag))
        *state |= NK_WIDGET_STATE_LEFT;
}

// Assembly:
subq $0x78, %rsp
movlpd %xmm0, 0x68(%rsp)
movlpd %xmm1, 0x70(%rsp)
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movss %xmm2, 0x4c(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x58(%rsp)
movb %al, 0x3b(%rsp)
je 0x90936
movq 0x58(%rsp), %rax
cmpl $0x0, 0x104(%rax)
setne %al
movb %al, 0x3b(%rsp)
movb 0x3b(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x48(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x58(%rsp)
movb %al, 0x3a(%rsp)
je 0x9097a
movq 0x58(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
xorl %eax, %eax
xorl %esi, %esi
movl $0x1, %edx
callq 0x13780
cmpl $0x0, %eax
setne %al
movb %al, 0x3a(%rsp)
movb 0x3a(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x44(%rsp)
movq 0x60(%rsp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x909a3
movq 0x60(%rsp), %rax
movl $0x6, (%rax)
jmp 0x909ae
movq 0x60(%rsp), %rax
movl $0x4, (%rax)
movq 0x58(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
callq 0x15440
cmpl $0x0, %eax
je 0x909d4
movq 0x60(%rsp), %rax
movl $0x12, (%rax)
cmpl $0x0, 0x48(%rsp)
je 0x90caa
cmpl $0x0, 0x44(%rsp)
je 0x90caa
movq 0x58(%rsp), %rax
movss 0x154(%rax), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm0
movss 0x4c(%rsp), %xmm1
mulss %xmm1, %xmm0
movss %xmm0, 0x40(%rsp)
movq 0x50(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x34(%rsp)
testl %eax, %eax
je 0x90a47
jmp 0x90a24
movl 0x34(%rsp), %eax
subl $0x1, %eax
je 0x90aec
jmp 0x90a33
movl 0x34(%rsp), %eax
subl $0x2, %eax
je 0x90bc4
jmp 0x90a42
jmp 0x90c9f
movq 0x50(%rsp), %rax
movl 0x8(%rax), %ecx
cvttss2si 0x40(%rsp), %eax
addl %eax, %ecx
movq 0x50(%rsp), %rax
movl %ecx, 0x8(%rax)
movq 0x50(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x50(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x90a7f
movq 0x50(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x30(%rsp)
jmp 0x90a8b
movq 0x50(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x30(%rsp)
movl 0x30(%rsp), %eax
movq 0x50(%rsp), %rcx
cmpl 0x10(%rcx), %eax
jge 0x90aa7
movq 0x50(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x2c(%rsp)
jmp 0x90adb
movq 0x50(%rsp), %rax
movl 0x8(%rax), %eax
movq 0x50(%rsp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x90ac7
movq 0x50(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x28(%rsp)
jmp 0x90ad3
movq 0x50(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x28(%rsp)
movl 0x28(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x2c(%rsp), %ecx
movq 0x50(%rsp), %rax
movl %ecx, 0x8(%rax)
jmp 0x90c9f
movq 0x50(%rsp), %rax
movss 0x8(%rax), %xmm0
addss 0x40(%rsp), %xmm0
movq 0x50(%rsp), %rax
movss %xmm0, 0x8(%rax)
movq 0x50(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x50(%rsp), %rax
movss 0x18(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x90b31
movq 0x50(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0x90b41
movq 0x50(%rsp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm1
movq 0x50(%rsp), %rax
movss 0x10(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x90b68
movq 0x50(%rsp), %rax
movss 0x10(%rax), %xmm0
movss %xmm0, 0x20(%rsp)
jmp 0x90baf
movq 0x50(%rsp), %rax
movss 0x8(%rax), %xmm1
movq 0x50(%rsp), %rax
movss 0x18(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x90b93
movq 0x50(%rsp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0x90ba3
movq 0x50(%rsp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x20(%rsp), %xmm0
movq 0x50(%rsp), %rax
movss %xmm0, 0x8(%rax)
jmp 0x90c9f
movq 0x50(%rsp), %rax
movsd 0x8(%rax), %xmm0
movss 0x40(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
addsd %xmm1, %xmm0
movq 0x50(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x50(%rsp), %rax
movsd 0x8(%rax), %xmm1
movq 0x50(%rsp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x90c12
movq 0x50(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0x90c22
movq 0x50(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x10(%rsp), %xmm1
movq 0x50(%rsp), %rax
movsd 0x10(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x90c4a
movq 0x50(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x90c8f
movq 0x50(%rsp), %rax
movsd 0x8(%rax), %xmm1
movq 0x50(%rsp), %rax
movsd 0x18(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x90c75
movq 0x50(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, (%rsp)
jmp 0x90c84
movq 0x50(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, (%rsp)
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movq 0x50(%rsp), %rax
movsd %xmm0, 0x8(%rax)
movq 0x60(%rsp), %rax
movl $0x22, (%rax)
movq 0x60(%rsp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x90ce2
movq 0x58(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
callq 0x14d70
cmpl $0x0, %eax
jne 0x90ce2
movq 0x60(%rsp), %rax
movl (%rax), %ecx
orl $0x8, %ecx
movl %ecx, (%rax)
jmp 0x90d0b
movq 0x58(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
movsd 0x70(%rsp), %xmm1
callq 0x14d70
cmpl $0x0, %eax
je 0x90d09
movq 0x60(%rsp), %rax
movl (%rax), %ecx
orl $0x40, %ecx
movl %ecx, (%rax)
jmp 0x90d0b
addq $0x78, %rsp
retq