// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, %r13
movq %r8, %r12
movq %rcx, %rbx
movss %xmm5, 0x40(%rsp)
movss %xmm4, 0x50(%rsp)
movss %xmm3, 0x20(%rsp)
movss %xmm2, 0x18(%rsp)
movl %edx, 0x3c(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
movups %xmm0, 0x28(%rsp)
testq %rsi, %rsi
jne 0x579c7
movq 0x30650(%rip), %rbp     # 0x87ff0
movq (%rbp), %rdi
leaq 0x1a3e1(%rip), %rsi     # 0x71d8c
leaq 0x1a3f8(%rip), %rdx     # 0x71daa
movl $0x65c2, %ecx           # imm = 0x65C2
xorl %eax, %eax
callq 0x12d80
movq (%rbp), %rdi
callq 0x13780
testq %rbx, %rbx
jne 0x579fa
movq 0x3061d(%rip), %rbp     # 0x87ff0
movq (%rbp), %rdi
leaq 0x1a3ae(%rip), %rsi     # 0x71d8c
leaq 0x1a3c5(%rip), %rdx     # 0x71daa
movl $0x65c3, %ecx           # imm = 0x65C3
xorl %eax, %eax
callq 0x12d80
movq (%rbp), %rdi
callq 0x13780
testq %r15, %r15
jne 0x57a2d
movq 0x305ea(%rip), %rbp     # 0x87ff0
movq (%rbp), %rdi
leaq 0x1a37b(%rip), %rsi     # 0x71d8c
leaq 0x1a392(%rip), %rdx     # 0x71daa
movl $0x65c4, %ecx           # imm = 0x65C4
xorl %eax, %eax
callq 0x12d80
movq (%rbp), %rdi
callq 0x13780
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
xorps %xmm0, %xmm0
orb %al, %cl
jne 0x57d9d
movsd 0x30(%rsp), %xmm1
movss 0x16e61(%rip), %xmm9    # 0x6e8b4
maxps %xmm1, %xmm9
movaps %xmm9, %xmm2
shufps $0x55, %xmm9, %xmm2     # xmm2 = xmm2[1,1],xmm9[1,1]
movlps %xmm9, 0x30(%rsp)
ucomiss 0x20(%rsp), %xmm2
jae 0x57d9d
cmpl $0x0, 0x11c(%rbx)
je 0x57bba
movaps %xmm9, %xmm1
shufps $0x0, %xmm9, %xmm1      # xmm1 = xmm1[0,0],xmm9[0,0]
movaps %xmm9, 0x60(%rsp)
movaps %xmm9, %xmm0
addss %xmm9, %xmm0
movaps %xmm2, 0x90(%rsp)
subss %xmm0, %xmm2
movss %xmm2, 0x38(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x50(%rsp), %xmm0
minss 0x40(%rsp), %xmm0
movss %xmm0, 0x24(%rsp)
movsd 0x28(%rsp), %xmm0
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
movaps %xmm2, 0x40(%rsp)
movl 0x2d4(%rbx), %edx
leaq 0x1f8(%rbx), %r8
movq %r13, (%rsp)
leaq 0xa8(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rsi
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movl $0x1, %ecx
movq %r12, %r9
callq 0x40888
testl %eax, %eax
je 0x57b24
movss 0x18(%rsp), %xmm0
subss 0x24(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movss 0x1c(%rsp), %xmm0
maxss 0x38(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movaps 0x90(%rsp), %xmm0
addss 0x40(%rsp), %xmm0
subss 0x60(%rsp), %xmm0
movl 0x2d0(%rbx), %edx
leaq 0x120(%rbx), %r8
movq %r13, (%rsp)
movaps 0x70(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movq %rbp, %rdi
movq %r14, %rsi
movaps 0x80(%rsp), %xmm1
movl $0x1, %ecx
movq %r12, %r9
callq 0x40888
testl %eax, %eax
je 0x57b98
movss 0x18(%rsp), %xmm0
addss 0x24(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movaps 0x60(%rsp), %xmm9
movaps 0x40(%rsp), %xmm0
addss %xmm9, %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0x34(%rsp)
leaq 0x28(%rsp), %rcx
movss 0xc(%rcx), %xmm5
movss 0x50(%rsp), %xmm2
minss %xmm5, %xmm2
movss 0x20(%rsp), %xmm6
movaps %xmm6, %xmm0
subss %xmm5, %xmm0
movss 0x18(%rsp), %xmm3
minss %xmm0, %xmm3
xorps %xmm11, %xmm11
xorps %xmm0, %xmm0
maxss %xmm3, %xmm0
movaps %xmm5, %xmm4
movaps %xmm5, %xmm10
divss %xmm6, %xmm4
movaps %xmm0, %xmm8
divss %xmm6, %xmm8
movaps %xmm6, %xmm1
movss 0xfc(%rbx), %xmm3
movss 0x110(%rbx), %xmm6
movsd (%rcx), %xmm5
movaps %xmm5, %xmm7
shufps $0x55, %xmm5, %xmm7     # xmm7 = xmm7[1,1],xmm5[1,1]
mulss %xmm10, %xmm8
addss %xmm7, %xmm8
movaps %xmm7, %xmm12
addss %xmm3, %xmm8
addss %xmm6, %xmm8
addss %xmm6, %xmm6
movaps %xmm3, %xmm7
addss %xmm3, %xmm7
addss %xmm7, %xmm6
mulss %xmm10, %xmm4
movss %xmm10, 0x40(%rsp)
subss %xmm6, %xmm4
xorps %xmm6, %xmm6
maxss %xmm4, %xmm6
leaq 0xb8(%rsp), %r13
movss %xmm6, 0xc(%r13)
movss 0x10c(%rbx), %xmm4
addss %xmm5, %xmm3
addss %xmm4, %xmm3
addss %xmm4, %xmm4
addss %xmm7, %xmm4
movaps %xmm9, %xmm7
subss %xmm4, %xmm7
movss %xmm7, 0x8(%r13)
movss %xmm8, 0x4(%r13)
movss %xmm3, (%r13)
leaq 0xa8(%rsp), %r9
movsd %xmm5, (%r9)
movss %xmm9, 0x8(%r9)
addss %xmm8, %xmm6
movaps %xmm12, 0x50(%rsp)
subss %xmm12, %xmm8
xorps %xmm3, %xmm3
maxss %xmm8, %xmm3
movss %xmm3, 0xc(%r9)
leaq 0xc8(%rsp), %rax
movss %xmm5, (%rax)
movss %xmm6, 0x4(%rax)
movss %xmm9, 0x8(%rax)
movaps %xmm10, %xmm3
addss %xmm12, %xmm3
subss %xmm6, %xmm3
maxss %xmm3, %xmm11
movss %xmm11, 0xc(%rax)
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl 0x3c(%rsp), %edx
movq %r13, %r8
callq 0x57daf
movss %xmm0, 0x18(%rsp)
divss 0x20(%rsp), %xmm0
mulss 0x40(%rsp), %xmm0
addss 0x50(%rsp), %xmm0
addss 0x104(%rbx), %xmm0
addss 0x110(%rbx), %xmm0
movss %xmm0, 0x4(%r13)
movq 0x2e0(%rbx), %rax
testq %rax, %rax
je 0x57d64
movq 0x2d8(%rbx), %rsi
movq %r14, %rdi
callq *%rax
movl (%r15), %esi
leaq 0x28(%rsp), %rcx
leaq 0xb8(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rdx
callq 0x58207
movq 0x2e8(%rbx), %rax
testq %rax, %rax
je 0x57d97
movq 0x2d8(%rbx), %rsi
movq %r14, %rdi
callq *%rax
movss 0x18(%rsp), %xmm0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq