// File: /workspace/github_c_makefile_star2_O2/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, 0x14(%rsp)
movss %xmm4, 0x1c(%rsp)
movss %xmm3, 0x18(%rsp)
movss %xmm2, 0x10(%rsp)
movl %edx, 0x4c(%rsp)
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, %xmm6
movq %rsi, %r14
movq %rdi, %r15
movlps %xmm0, 0x50(%rsp)
testq %rsi, %rsi
movaps %xmm0, 0x20(%rsp)
jne 0x51a37
movq 0x335e5(%rip), %rbp     # 0x84ff0
movq (%rbp), %rdi
leaq 0x182f6(%rip), %rsi     # 0x69d0c
leaq 0x1830d(%rip), %rdx     # 0x69d2a
movl $0x65c2, %ecx           # imm = 0x65C2
xorl %eax, %eax
callq 0x12ea0
movq (%rbp), %rdi
callq 0x13960
movaps 0x20(%rsp), %xmm6
testq %rbx, %rbx
jne 0x51a6f
movq 0x335ad(%rip), %rbp     # 0x84ff0
movq (%rbp), %rdi
leaq 0x182be(%rip), %rsi     # 0x69d0c
leaq 0x182d5(%rip), %rdx     # 0x69d2a
movl $0x65c3, %ecx           # imm = 0x65C3
xorl %eax, %eax
callq 0x12ea0
movq (%rbp), %rdi
callq 0x13960
movaps 0x20(%rsp), %xmm6
testq %r15, %r15
jne 0x51aa7
movq 0x33575(%rip), %rbp     # 0x84ff0
movq (%rbp), %rdi
leaq 0x18286(%rip), %rsi     # 0x69d0c
leaq 0x1829d(%rip), %rdx     # 0x69d2a
movl $0x65c4, %ecx           # imm = 0x65C4
xorl %eax, %eax
callq 0x12ea0
movq (%rbp), %rdi
callq 0x13960
movaps 0x20(%rsp), %xmm6
testq %rbx, %rbx
sete %al
testq %r14, %r14
sete %cl
xorps %xmm0, %xmm0
orb %al, %cl
jne 0x51e0e
movss 0x14d6d(%rip), %xmm9    # 0x66834
maxps 0x30(%rsp), %xmm9
movaps %xmm9, %xmm4
shufps $0x55, %xmm9, %xmm4     # xmm4 = xmm4[1,1],xmm9[1,1]
movlps %xmm9, 0x58(%rsp)
ucomiss 0x18(%rsp), %xmm4
jae 0x51e0e
cmpl $0x0, 0x11c(%rbx)
je 0x51c33
movaps 0x50(%rsp), %xmm2
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 %xmm4, 0xa0(%rsp)
subss %xmm0, %xmm4
movss %xmm4, 0x48(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x1c(%rsp), %xmm0
minss 0x14(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movaps %xmm2, %xmm0
shufps $0x55, %xmm2, %xmm0     # xmm0 = xmm0[1,1],xmm2[1,1]
movaps %xmm0, 0x20(%rsp)
movl 0x2d4(%rbx), %edx
leaq 0x1f8(%rbx), %r8
movq %r13, (%rsp)
leaq 0x70(%rsp), %rdi
pushq $0x1
popq %rbp
movq %r14, %rsi
movaps %xmm2, 0x80(%rsp)
movaps %xmm2, %xmm0
movaps %xmm1, 0x90(%rsp)
movl %ebp, %ecx
movq %r12, %r9
callq 0x3c90b
testl %eax, %eax
je 0x51b99
movss 0x10(%rsp), %xmm0
subss 0x14(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movss 0x30(%rsp), %xmm0
maxss 0x48(%rsp), %xmm0
movss %xmm0, 0x30(%rsp)
movaps 0xa0(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
subss 0x60(%rsp), %xmm0
movl 0x2d0(%rbx), %edx
leaq 0x120(%rbx), %r8
movq %r13, (%rsp)
movaps 0x80(%rsp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
movaps 0x90(%rsp), %xmm1
movl %ebp, %ecx
movq %r12, %r9
callq 0x3c90b
testl %eax, %eax
je 0x51c0f
movss 0x10(%rsp), %xmm0
addss 0x14(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movaps 0x20(%rsp), %xmm6
movaps 0x60(%rsp), %xmm9
addss %xmm9, %xmm6
movss %xmm6, 0x54(%rsp)
movss 0x30(%rsp), %xmm4
movss %xmm4, 0x5c(%rsp)
jmp 0x51c37
shufps $0x55, %xmm6, %xmm6     # xmm6 = xmm6[1,1,1,1]
movss 0x1c(%rsp), %xmm2
minss %xmm4, %xmm2
movss 0x18(%rsp), %xmm7
movaps %xmm7, %xmm0
subss %xmm4, %xmm0
movss 0x10(%rsp), %xmm3
minss %xmm0, %xmm3
xorps %xmm11, %xmm11
xorps %xmm0, %xmm0
maxss %xmm3, %xmm0
movaps %xmm4, %xmm5
movaps %xmm4, %xmm10
divss %xmm7, %xmm5
movaps %xmm0, %xmm8
divss %xmm7, %xmm8
movaps %xmm7, %xmm1
movss 0xfc(%rbx), %xmm3
movss 0x110(%rbx), %xmm4
mulss %xmm10, %xmm8
addss %xmm6, %xmm8
addss %xmm3, %xmm8
addss %xmm4, %xmm8
addss %xmm4, %xmm4
movaps %xmm6, %xmm12
movaps %xmm3, %xmm6
addss %xmm3, %xmm6
addss %xmm6, %xmm4
mulss %xmm10, %xmm5
movss %xmm10, 0x30(%rsp)
subss %xmm4, %xmm5
xorps %xmm4, %xmm4
maxss %xmm5, %xmm4
leaq 0xb8(%rsp), %r13
movss %xmm4, 0xc(%r13)
movss %xmm8, 0x4(%r13)
movss 0x10c(%rbx), %xmm5
leaq 0x50(%rsp), %rcx
movss (%rcx), %xmm7
addss %xmm7, %xmm3
addss %xmm5, %xmm3
addss %xmm5, %xmm5
addss %xmm6, %xmm5
movaps %xmm9, %xmm6
subss %xmm5, %xmm6
movss %xmm6, 0x8(%r13)
movss %xmm3, (%r13)
leaq 0x70(%rsp), %r9
movss %xmm7, (%r9)
movss %xmm12, 0x4(%r9)
movss %xmm9, 0x8(%r9)
addss %xmm8, %xmm4
subss %xmm12, %xmm8
movaps %xmm12, 0x20(%rsp)
xorps %xmm3, %xmm3
maxss %xmm8, %xmm3
movss %xmm3, 0xc(%r9)
leaq 0xc8(%rsp), %rax
movss %xmm7, (%rax)
movss %xmm4, 0x4(%rax)
movss %xmm9, 0x8(%rax)
movaps %xmm10, %xmm3
addss %xmm12, %xmm3
subss %xmm4, %xmm3
maxss %xmm3, %xmm11
movss %xmm11, 0xc(%rax)
movq %rax, (%rsp)
andl $0x0, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movl 0x4c(%rsp), %edx
movq %r13, %r8
callq 0x51e20
movss %xmm0, 0x10(%rsp)
divss 0x18(%rsp), %xmm0
mulss 0x30(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
addss 0x104(%rbx), %xmm0
addss 0x110(%rbx), %xmm0
movss %xmm0, 0x4(%r13)
movq 0x2e0(%rbx), %rax
testq %rax, %rax
je 0x51dd5
movq 0x2d8(%rbx), %rsi
movq %r14, %rdi
callq *%rax
movl (%r15), %esi
leaq 0x50(%rsp), %rcx
leaq 0xb8(%rsp), %r8
movq %r14, %rdi
movq %rbx, %rdx
callq 0x522c4
movq 0x2e8(%rbx), %rax
testq %rax, %rax
je 0x51e08
movq 0x2d8(%rbx), %rsi
movq %r14, %rdi
callq *%rax
movss 0x10(%rsp), %xmm0
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq