// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x28
popq %rcx
cmoveq %rax, %rcx
testb $0x20, %sil
movl $0xd0, %r15d
cmoveq %r8, %r15
movq %rdi, %r14
pushq $0x50
popq %rax
cmoveq %rcx, %rax
leaq (%rdx,%rax), %rsi
addq %rdx, %r15
movl (%rdx,%rax), %eax
testl %eax, %eax
je 0x52360
cmpl $0x2, %eax
je 0x52343
cmpl $0x1, %eax
jne 0x523ae
addq $0x8, %rsi
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
pushq $-0x1
popq %rdx
movq %r14, %rdi
callq 0x13660
jmp 0x523ae
addq $0x8, %rsi
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
pushq $-0x1
popq %rdx
movq %r14, %rdi
callq 0x14230
jmp 0x523ae
movss 0x100(%r12), %xmm2
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movl 0x8(%rsi), %esi
movq %r14, %rdi
callq 0x12f00
movss 0x100(%r12), %xmm2
movss 0xfc(%r12), %xmm3
movsd (%r13), %xmm0
movsd 0x8(%r13), %xmm1
movl 0x78(%r12), %esi
movq %r14, %rdi
callq 0x12070
movl (%r15), %eax
testl %eax, %eax
je 0x5240b
cmpl $0x2, %eax
je 0x523e7
cmpl $0x1, %eax
jne 0x52460
addq $0x8, %r15
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x13660
addq $0x8, %r15
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x14230
movss 0x108(%r12), %xmm2
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movl 0x8(%r15), %esi
movq %r14, %rdi
callq 0x12f00
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 0x12070
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq