// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_progress_behavior
NK_LIB nk_size
nk_progress_behavior(nk_flags *state, struct nk_input *in,
    struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, nk_bool modifiable)
{
    int left_mouse_down = 0;
    int left_mouse_click_in_cursor = 0;

    nk_widget_state_reset(state);
    if (!in || !modifiable) return value;
    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, cursor, nk_true);
    if (nk_input_is_mouse_hovering_rect(in, r))
        *state = NK_WIDGET_STATE_HOVERED;

    if (in && left_mouse_down && left_mouse_click_in_cursor) {
        if (left_mouse_down && left_mouse_click_in_cursor) {
            float ratio = NK_MAX(0, (float)(in->mouse.pos.x - cursor.x)) / (float)cursor.w;
            value = (nk_size)NK_CLAMP(0, (float)max * ratio, (float)max);
            in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor.x + cursor.w/2.0f;
            *state |= NK_WIDGET_STATE_ACTIVE;
        }
    }
    /* set progressbar widget state */
    if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, r))
        *state |= NK_WIDGET_STATE_ENTERED;
    else if (nk_input_is_mouse_prev_hovering_rect(in, r))
        *state |= NK_WIDGET_STATE_LEFT;
    return value;
}

// Assembly:
subq $0xa8, %rsp
movlpd %xmm0, 0x90(%rsp)
movlpd %xmm1, 0x98(%rsp)
movlpd %xmm2, 0x80(%rsp)
movlpd %xmm3, 0x88(%rsp)
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movq %rcx, 0x60(%rsp)
movl %r8d, 0x5c(%rsp)
movl $0x0, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movq 0x78(%rsp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x8b1a0
movq 0x78(%rsp), %rax
movl $0x6, (%rax)
jmp 0x8b1ab
movq 0x78(%rsp), %rax
movl $0x4, (%rax)
cmpq $0x0, 0x70(%rsp)
je 0x8b1ba
cmpl $0x0, 0x5c(%rsp)
jne 0x8b1cc
movq 0x60(%rsp), %rax
movq %rax, 0xa0(%rsp)
jmp 0x8b5fd
xorl %eax, %eax
cmpq $0x0, 0x70(%rsp)
movb %al, 0x4f(%rsp)
je 0x8b1ed
movq 0x70(%rsp), %rax
cmpl $0x0, 0x104(%rax)
setne %al
movb %al, 0x4f(%rsp)
movb 0x4f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x58(%rsp)
xorl %eax, %eax
cmpq $0x0, 0x70(%rsp)
movb %al, 0x4e(%rsp)
je 0x8b237
movq 0x70(%rsp), %rdi
movsd 0x80(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
xorl %eax, %eax
xorl %esi, %esi
movl $0x1, %edx
callq 0x13780
cmpl $0x0, %eax
setne %al
movb %al, 0x4e(%rsp)
movb 0x4e(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x54(%rsp)
movq 0x70(%rsp), %rdi
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
callq 0x15440
cmpl $0x0, %eax
je 0x8b271
movq 0x78(%rsp), %rax
movl $0x12, (%rax)
cmpq $0x0, 0x70(%rsp)
je 0x8b583
cmpl $0x0, 0x58(%rsp)
je 0x8b583
cmpl $0x0, 0x54(%rsp)
je 0x8b583
cmpl $0x0, 0x58(%rsp)
je 0x8b581
cmpl $0x0, 0x54(%rsp)
je 0x8b581
movq 0x70(%rsp), %rax
movss 0x144(%rax), %xmm0
subss 0x80(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x8b2e5
movq 0x70(%rsp), %rax
movss 0x144(%rax), %xmm0
subss 0x80(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
jmp 0x8b2f0
xorps %xmm0, %xmm0
movss %xmm0, 0x48(%rsp)
jmp 0x8b2f0
movss 0x48(%rsp), %xmm0
movss 0x88(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x50(%rsp)
movq 0x68(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x40(%rsp)
testq %rax, %rax
movss %xmm0, 0x44(%rsp)
js 0x8b347
movss 0x40(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x44(%rsp), %xmm0
movss 0x50(%rsp), %xmm2
movaps %xmm0, %xmm1
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x8b3b1
movq 0x68(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x38(%rsp)
testq %rax, %rax
movss %xmm0, 0x3c(%rsp)
js 0x8b39d
movss 0x38(%rsp), %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm0
mulss 0x50(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x8b3fb
movq 0x68(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x2c(%rsp)
testq %rax, %rax
movss %xmm0, 0x30(%rsp)
js 0x8b3ef
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x30(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x34(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8b417
xorps %xmm0, %xmm0
movss %xmm0, 0x28(%rsp)
jmp 0x8b515
movq 0x68(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x20(%rsp)
testq %rax, %rax
movss %xmm0, 0x24(%rsp)
js 0x8b455
movss 0x20(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm0
movss 0x50(%rsp), %xmm2
movaps %xmm0, %xmm1
mulss %xmm2, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x8b4bf
movq 0x68(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x18(%rsp)
testq %rax, %rax
movss %xmm0, 0x1c(%rsp)
js 0x8b4ab
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
mulss 0x50(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
jmp 0x8b509
movq 0x68(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0xc(%rsp)
testq %rax, %rax
movss %xmm0, 0x10(%rsp)
js 0x8b4fd
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x10(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x28(%rsp), %xmm0
movss 0x21fe5(%rip), %xmm2    # 0xad508
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
cvttss2si %xmm1, %rcx
cvttss2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x60(%rsp)
movss 0x80(%rsp), %xmm0
movss 0x88(%rsp), %xmm1
movss 0x21f84(%rip), %xmm2    # 0xad4e4
divss %xmm2, %xmm1
addss %xmm1, %xmm0
movq 0x70(%rsp), %rax
movss %xmm0, 0x10c(%rax)
movq 0x78(%rsp), %rax
movl (%rax), %ecx
orl $0x22, %ecx
movl %ecx, (%rax)
jmp 0x8b583
movq 0x78(%rsp), %rax
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x8b5c1
movq 0x70(%rsp), %rdi
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
callq 0x14d70
cmpl $0x0, %eax
jne 0x8b5c1
movq 0x78(%rsp), %rax
movl (%rax), %ecx
orl $0x8, %ecx
movl %ecx, (%rax)
jmp 0x8b5f0
movq 0x70(%rsp), %rdi
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
callq 0x14d70
cmpl $0x0, %eax
je 0x8b5ee
movq 0x78(%rsp), %rax
movl (%rax), %ecx
orl $0x40, %ecx
movl %ecx, (%rax)
jmp 0x8b5f0
movq 0x60(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
addq $0xa8, %rsp
retq
nopl (%rax)