// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_draw_scrollbar
NK_LIB void
nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state,
    const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
    const struct nk_rect *scroll)
{
    const struct nk_style_item *background;
    const struct nk_style_item *cursor;

    /* select correct colors/images to draw */
    if (state & NK_WIDGET_STATE_ACTIVED) {
        background = &style->active;
        cursor = &style->cursor_active;
    } else if (state & NK_WIDGET_STATE_HOVER) {
        background = &style->hover;
        cursor = &style->cursor_hover;
    } else {
        background = &style->normal;
        cursor = &style->cursor_normal;
    }

    /* draw background */
    switch (background->type) {
        case NK_STYLE_ITEM_IMAGE:
            nk_draw_image(out, *bounds, &background->data.image, nk_white);
            break;
        case NK_STYLE_ITEM_NINE_SLICE:
            nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_white);
            break;
        case NK_STYLE_ITEM_COLOR:
            nk_fill_rect(out, *bounds, style->rounding, background->data.color);
            nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
            break;
    }

    /* draw cursor */
    switch (cursor->type) {
        case NK_STYLE_ITEM_IMAGE:
            nk_draw_image(out, *scroll, &cursor->data.image, nk_white);
            break;
        case NK_STYLE_ITEM_NINE_SLICE:
            nk_draw_nine_slice(out, *scroll, &cursor->data.slice, nk_white);
            break;
        case NK_STYLE_ITEM_COLOR:
            nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color);
            nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color);
            break;
    }
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movl 0x3c(%rsp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x87b88
movq 0x30(%rsp), %rax
addq $0x50, %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
addq $0xd0, %rax
movq %rax, 0x10(%rsp)
jmp 0x87bd0
movl 0x3c(%rsp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x87bb4
movq 0x30(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
addq $0xa8, %rax
movq %rax, 0x10(%rsp)
jmp 0x87bce
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
addq $0x80, %rax
movq %rax, 0x10(%rsp)
jmp 0x87bd0
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x87c4f
jmp 0x87be1
movl 0xc(%rsp), %eax
subl $0x1, %eax
je 0x87bfa
jmp 0x87bec
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x87c26
jmp 0x87cac
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rsi
addq $0x8, %rsi
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movl 0x29694(%rip), %edx     # 0xb12b0
callq 0x14690
jmp 0x87cac
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rax
movq 0x18(%rsp), %rsi
addq $0x8, %rsi
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movl 0x29668(%rip), %edx     # 0xb12b0
callq 0x152a0
jmp 0x87cac
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movss 0x100(%rax), %xmm2
movq 0x18(%rsp), %rax
movsd (%rcx), %xmm0
movsd 0x8(%rcx), %xmm1
movl 0x8(%rax), %esi
callq 0x13f10
movq 0x40(%rsp), %rdi
movq 0x28(%rsp), %rcx
movq 0x30(%rsp), %rax
movss 0xfc(%rax), %xmm3
movss 0x100(%rax), %xmm2
movsd (%rcx), %xmm0
movsd 0x8(%rcx), %xmm1
movl 0x78(%rax), %esi
callq 0x13070
movq 0x10(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x8(%rsp)
testl %eax, %eax
je 0x87d2b
jmp 0x87cbd
movl 0x8(%rsp), %eax
subl $0x1, %eax
je 0x87cd6
jmp 0x87cc8
movl 0x8(%rsp), %eax
subl $0x2, %eax
je 0x87d02
jmp 0x87d8b
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movl 0x295b8(%rip), %edx     # 0xb12b0
callq 0x14690
jmp 0x87d8b
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rax
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
movsd (%rax), %xmm0
movsd 0x8(%rax), %xmm1
movl 0x2958c(%rip), %edx     # 0xb12b0
callq 0x152a0
jmp 0x87d8b
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movss 0x108(%rax), %xmm2
movq 0x10(%rsp), %rax
movsd (%rcx), %xmm0
movsd 0x8(%rcx), %xmm1
movl 0x8(%rax), %esi
callq 0x13f10
movq 0x40(%rsp), %rdi
movq 0x20(%rsp), %rcx
movq 0x30(%rsp), %rax
movss 0x104(%rax), %xmm3
movss 0x108(%rax), %xmm2
movsd (%rcx), %xmm0
movsd 0x8(%rcx), %xmm1
movl 0xf8(%rax), %esi
callq 0x13070
addq $0x48, %rsp
retq