// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_do_scrollbarv
NK_LIB float
nk_do_scrollbarv(nk_flags *state,
    struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
    float offset, float target, float step, float button_pixel_inc,
    const struct nk_style_scrollbar *style, struct nk_input *in,
    const struct nk_user_font *font)
{
    struct nk_rect empty_north;
    struct nk_rect empty_south;
    struct nk_rect cursor;

    float scroll_step;
    float scroll_offset;
    float scroll_off;
    float scroll_ratio;

    NK_ASSERT(out);
    NK_ASSERT(style);
    NK_ASSERT(state);
    if (!out || !style) return 0;

    scroll.w = NK_MAX(scroll.w, 1);
    scroll.h = NK_MAX(scroll.h, 0);
    if (target <= scroll.h) return 0;

    /* optional scrollbar buttons */
    if (style->show_buttons) {
        nk_flags ws;
        float scroll_h;
        struct nk_rect button;

        button.x = scroll.x;
        button.w = scroll.w;
        button.h = scroll.w;

        scroll_h = NK_MAX(scroll.h - 2 * button.h,0);
        scroll_step = NK_MIN(step, button_pixel_inc);

        /* decrement button */
        button.y = scroll.y;
        if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
            NK_BUTTON_REPEATER, &style->dec_button, in, font))
            offset = offset - scroll_step;

        /* increment button */
        button.y = scroll.y + scroll.h - button.h;
        if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
            NK_BUTTON_REPEATER, &style->inc_button, in, font))
            offset = offset + scroll_step;

        scroll.y = scroll.y + button.h;
        scroll.h = scroll_h;
    }

    /* calculate scrollbar constants */
    scroll_step = NK_MIN(step, scroll.h);
    scroll_offset = NK_CLAMP(0, offset, target - scroll.h);
    scroll_ratio = scroll.h / target;
    scroll_off = scroll_offset / target;

    /* calculate scrollbar cursor bounds */
    cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0);
    cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y;
    cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
    cursor.x = scroll.x + style->border + style->padding.x;

    /* calculate empty space around cursor */
    empty_north.x = scroll.x;
    empty_north.y = scroll.y;
    empty_north.w = scroll.w;
    empty_north.h = NK_MAX(cursor.y - scroll.y, 0);

    empty_south.x = scroll.x;
    empty_south.y = cursor.y + cursor.h;
    empty_south.w = scroll.w;
    empty_south.h = NK_MAX((scroll.y + scroll.h) - (cursor.y + cursor.h), 0);

    /* update scrollbar */
    scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
        &empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL);
    scroll_off = scroll_offset / target;
    cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y;

    /* draw scrollbar */
    if (style->draw_begin) style->draw_begin(out, style->userdata);
    nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
    if (style->draw_end) style->draw_end(out, style->userdata);
    return scroll_offset;
}

// Assembly:
subq $0xf8, %rsp
movlpd %xmm0, 0xe4(%rsp)
movlpd %xmm1, 0xec(%rsp)
movq %rdi, 0xd8(%rsp)
movq %rsi, 0xd0(%rsp)
movl %edx, 0xcc(%rsp)
movss %xmm2, 0xc8(%rsp)
movss %xmm3, 0xc4(%rsp)
movss %xmm4, 0xc0(%rsp)
movss %xmm5, 0xbc(%rsp)
movq %rcx, 0xb0(%rsp)
movq %r8, 0xa8(%rsp)
movq %r9, 0xa0(%rsp)
cmpq $0x0, 0xd0(%rsp)
jne 0x85e2a
movq 0x3f1f2(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x2b598(%rip), %rsi     # 0xb13a0
leaq 0x2b5af(%rip), %rdx     # 0xb13be
movl $0x65c2, %ecx           # imm = 0x65C2
movb $0x0, %al
callq 0x13ec0
movq 0x3f1ce(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x85e2c
jmp 0x85e2e
cmpq $0x0, 0xb0(%rsp)
jne 0x85e6c
movq 0x3f1b0(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x2b556(%rip), %rsi     # 0xb13a0
leaq 0x2b56d(%rip), %rdx     # 0xb13be
movl $0x65c3, %ecx           # imm = 0x65C3
movb $0x0, %al
callq 0x13ec0
movq 0x3f18c(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x85e6e
jmp 0x85e70
cmpq $0x0, 0xd8(%rsp)
jne 0x85eae
movq 0x3f16e(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x2b514(%rip), %rsi     # 0xb13a0
leaq 0x2b52b(%rip), %rdx     # 0xb13be
movl $0x65c4, %ecx           # imm = 0x65C4
movb $0x0, %al
callq 0x13ec0
movq 0x3f14a(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x85eb0
cmpq $0x0, 0xd0(%rsp)
je 0x85ec6
cmpq $0x0, 0xb0(%rsp)
jne 0x85ed7
xorps %xmm0, %xmm0
movss %xmm0, 0xf4(%rsp)
jmp 0x866c7
movss 0x27609(%rip), %xmm0    # 0xad4e8
ucomiss 0xec(%rsp), %xmm0
jbe 0x85ef9
movss 0x275f7(%rip), %xmm0    # 0xad4e8
movss %xmm0, 0x44(%rsp)
jmp 0x85f08
movss 0xec(%rsp), %xmm0
movss %xmm0, 0x44(%rsp)
movss 0x44(%rsp), %xmm0
movss %xmm0, 0xec(%rsp)
xorps %xmm0, %xmm0
ucomiss 0xf0(%rsp), %xmm0
jbe 0x85f2f
xorps %xmm0, %xmm0
movss %xmm0, 0x40(%rsp)
jmp 0x85f3e
movss 0xf0(%rsp), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x40(%rsp), %xmm0
movss %xmm0, 0xf0(%rsp)
movss 0xc4(%rsp), %xmm1
movss 0xf0(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x85f75
xorps %xmm0, %xmm0
movss %xmm0, 0xf4(%rsp)
jmp 0x866c7
movq 0xb0(%rsp), %rax
cmpl $0x0, 0x11c(%rax)
je 0x86181
movss 0xe4(%rsp), %xmm0
movss %xmm0, 0x48(%rsp)
movss 0xec(%rsp), %xmm0
movss %xmm0, 0x50(%rsp)
movss 0xec(%rsp), %xmm0
movss %xmm0, 0x54(%rsp)
movss 0xf0(%rsp), %xmm1
movss 0x54(%rsp), %xmm0
addss %xmm0, %xmm0
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x85fe1
xorps %xmm0, %xmm0
movss %xmm0, 0x3c(%rsp)
jmp 0x85ffe
movss 0xf0(%rsp), %xmm0
movss 0x54(%rsp), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x3c(%rsp)
movss 0x3c(%rsp), %xmm0
movss %xmm0, 0x58(%rsp)
movss 0xc0(%rsp), %xmm1
movss 0xbc(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86032
movss 0xc0(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
jmp 0x86041
movss 0xbc(%rsp), %xmm0
movss %xmm0, 0x38(%rsp)
movss 0x38(%rsp), %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0xe8(%rsp), %xmm0
movss %xmm0, 0x4c(%rsp)
movq 0xd0(%rsp), %rsi
movq 0xb0(%rsp), %r8
movl 0x2d4(%r8), %edx
addq $0x1f8, %r8             # imm = 0x1F8
movq 0xa8(%rsp), %r9
movq 0xa0(%rsp), %rcx
movsd 0x48(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movq %rsp, %rax
movq %rcx, (%rax)
leaq 0x5c(%rsp), %rdi
movl $0x1, %ecx
callq 0x5e910
cmpl $0x0, %eax
je 0x860c8
movss 0xc8(%rsp), %xmm0
subss 0x6c(%rsp), %xmm0
movss %xmm0, 0xc8(%rsp)
movss 0xe8(%rsp), %xmm0
movss 0xf0(%rsp), %xmm1
addss %xmm1, %xmm0
movss 0x54(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x4c(%rsp)
movq 0xd0(%rsp), %rsi
movq 0xb0(%rsp), %r8
movl 0x2d0(%r8), %edx
addq $0x120, %r8             # imm = 0x120
movq 0xa8(%rsp), %r9
movq 0xa0(%rsp), %rcx
movsd 0x48(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movq %rsp, %rax
movq %rcx, (%rax)
leaq 0x5c(%rsp), %rdi
movl $0x1, %ecx
callq 0x5e910
cmpl $0x0, %eax
je 0x8615a
movss 0xc8(%rsp), %xmm0
addss 0x6c(%rsp), %xmm0
movss %xmm0, 0xc8(%rsp)
movss 0xe8(%rsp), %xmm0
addss 0x54(%rsp), %xmm0
movss %xmm0, 0xe8(%rsp)
movss 0x58(%rsp), %xmm0
movss %xmm0, 0xf0(%rsp)
movss 0xc0(%rsp), %xmm1
movss 0xf0(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x861a9
movss 0xc0(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
jmp 0x861b8
movss 0xf0(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
movss 0x34(%rsp), %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0xc8(%rsp), %xmm1
movss 0xc4(%rsp), %xmm0
subss 0xf0(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x861f5
movss 0xc8(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
jmp 0x8620d
movss 0xc4(%rsp), %xmm0
subss 0xf0(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x30(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86226
xorps %xmm0, %xmm0
movss %xmm0, 0x2c(%rsp)
jmp 0x8627b
movss 0xc8(%rsp), %xmm1
movss 0xc4(%rsp), %xmm0
subss 0xf0(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86257
movss 0xc8(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
jmp 0x8626f
movss 0xc4(%rsp), %xmm0
subss 0xf0(%rsp), %xmm0
movss %xmm0, 0x28(%rsp)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0x68(%rsp)
movss 0xf0(%rsp), %xmm0
divss 0xc4(%rsp), %xmm0
movss %xmm0, 0x60(%rsp)
movss 0x68(%rsp), %xmm0
divss 0xc4(%rsp), %xmm0
movss %xmm0, 0x64(%rsp)
movss 0x60(%rsp), %xmm1
movss 0xf0(%rsp), %xmm2
movq 0xb0(%rsp), %rax
movss 0xfc(%rax), %xmm0
movq 0xb0(%rsp), %rax
movss 0x27201(%rip), %xmm3    # 0xad4e4
mulss 0x110(%rax), %xmm3
addss %xmm0, %xmm0
addss %xmm3, %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x8631b
xorps %xmm0, %xmm0
movss %xmm0, 0x24(%rsp)
jmp 0x86375
movss 0x60(%rsp), %xmm0
movss 0xf0(%rsp), %xmm2
movq 0xb0(%rsp), %rax
movss 0xfc(%rax), %xmm1
movq 0xb0(%rsp), %rax
movss 0x2719a(%rip), %xmm3    # 0xad4e4
mulss 0x110(%rax), %xmm3
addss %xmm1, %xmm1
addss %xmm3, %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x24(%rsp), %xmm0
movss %xmm0, 0x7c(%rsp)
movss 0xe8(%rsp), %xmm1
movss 0x64(%rsp), %xmm0
movss 0xf0(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0xb0(%rsp), %rax
addss 0xfc(%rax), %xmm0
movq 0xb0(%rsp), %rax
addss 0x110(%rax), %xmm0
movss %xmm0, 0x74(%rsp)
movss 0xec(%rsp), %xmm0
movq 0xb0(%rsp), %rax
movss 0xfc(%rax), %xmm1
movq 0xb0(%rsp), %rax
movss 0x270f4(%rip), %xmm2    # 0xad4e4
mulss 0x10c(%rax), %xmm2
addss %xmm1, %xmm1
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x78(%rsp)
movss 0xe4(%rsp), %xmm0
movq 0xb0(%rsp), %rax
addss 0xfc(%rax), %xmm0
movq 0xb0(%rsp), %rax
addss 0x10c(%rax), %xmm0
movss %xmm0, 0x70(%rsp)
movss 0xe4(%rsp), %xmm0
movss %xmm0, 0x90(%rsp)
movss 0xe8(%rsp), %xmm0
movss %xmm0, 0x94(%rsp)
movss 0xec(%rsp), %xmm0
movss %xmm0, 0x98(%rsp)
movss 0x74(%rsp), %xmm1
subss 0xe8(%rsp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86491
xorps %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
jmp 0x864a6
movss 0x74(%rsp), %xmm0
subss 0xe8(%rsp), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x20(%rsp), %xmm0
movss %xmm0, 0x9c(%rsp)
movss 0xe4(%rsp), %xmm0
movss %xmm0, 0x80(%rsp)
movss 0x74(%rsp), %xmm0
addss 0x7c(%rsp), %xmm0
movss %xmm0, 0x84(%rsp)
movss 0xec(%rsp), %xmm0
movss %xmm0, 0x88(%rsp)
movss 0xe8(%rsp), %xmm1
addss 0xf0(%rsp), %xmm1
movss 0x74(%rsp), %xmm0
addss 0x7c(%rsp), %xmm0
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x86523
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0x8654b
movss 0xe8(%rsp), %xmm0
addss 0xf0(%rsp), %xmm0
movss 0x74(%rsp), %xmm1
addss 0x7c(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x8c(%rsp)
movq 0xd8(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0xcc(%rsp), %edx
movss 0x68(%rsp), %xmm0
movss 0xc4(%rsp), %xmm1
movss 0x6c(%rsp), %xmm2
leaq 0xe4(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x90(%rsp), %r9
leaq 0x80(%rsp), %rax
xorl %r10d, %r10d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x87170
movss %xmm0, 0x68(%rsp)
movss 0x68(%rsp), %xmm0
divss 0xc4(%rsp), %xmm0
movss %xmm0, 0x64(%rsp)
movss 0xe8(%rsp), %xmm1
movss 0x64(%rsp), %xmm0
movss 0xf0(%rsp), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq 0xb0(%rsp), %rax
addss 0x104(%rax), %xmm0
movq 0xb0(%rsp), %rax
addss 0x110(%rax), %xmm0
movss %xmm0, 0x74(%rsp)
movq 0xb0(%rsp), %rax
cmpq $0x0, 0x2e0(%rax)
je 0x86652
movq 0xb0(%rsp), %rax
movq 0x2e0(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xb0(%rsp), %rcx
movq 0x2d8(%rcx), %rsi
callq *%rax
movq 0xd0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movl (%rax), %esi
movq 0xb0(%rsp), %rdx
leaq 0xe4(%rsp), %rcx
leaq 0x70(%rsp), %r8
callq 0x87b40
movq 0xb0(%rsp), %rax
cmpq $0x0, 0x2e8(%rax)
je 0x866b8
movq 0xb0(%rsp), %rax
movq 0x2e8(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xb0(%rsp), %rcx
movq 0x2d8(%rcx), %rsi
callq *%rax
movss 0x68(%rsp), %xmm0
movss %xmm0, 0xf4(%rsp)
movss 0xf4(%rsp), %xmm0
addq $0xf8, %rsp
retq
nopl (%rax,%rax)