// File: /workspace/github_c_makefile_star2_O1/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r13
xorl %eax, %eax
testb $0x10, %sil
movl $0x80, %ecx
movl $0xa8, %r8d
cmoveq %rcx, %r8
movq %rdx, %r12
movl $0x28, %ecx
cmoveq %rax, %rcx
testb $0x20, %sil
movl $0xd0, %r15d
cmoveq %r8, %r15
movq %rdi, %r14
movl $0x50, %eax
cmoveq %rcx, %rax
leaq (%rdx,%rax), %rsi
addq %rdx, %r15
movl (%rdx,%rax), %eax
testl %eax, %eax
je 0x582ab
cmpl $0x2, %eax
je 0x5828c
cmpl $0x1, %eax
jne 0x582f9
addq $0x8, %rsi
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x134d0
jmp 0x582f9
addq $0x8, %rsi
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x13fe0
jmp 0x582f9
movss 0x100(%r12), %xmm2
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movl 0x8(%rsi), %esi
movq %r14, %rdi
callq 0x12de0
movss 0x100(%r12), %xmm2
movss 0xfc(%r12), %xmm3
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movl 0x78(%r12), %esi
movq %r14, %rdi
callq 0x12060
movl (%r15), %eax
testl %eax, %eax
je 0x5835a
cmpl $0x2, %eax
je 0x58334
cmpl $0x1, %eax
jne 0x583af
addq $0x8, %r15
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x134d0
addq $0x8, %r15
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x13fe0
movss 0x108(%r12), %xmm2
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movl 0x8(%r15), %esi
movq %r14, %rdi
callq 0x12de0
movss 0x108(%r12), %xmm2
movss 0x104(%r12), %xmm3
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movl 0xf8(%r12), %esi
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x12060
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq