// File: /workspace/github_c_makefile_star2_O2/space222[P]silo/./nuklear.h
// Function: nk_draw_selectable(nk_command_buffer*, unsigned int, nk_style_selectable const*, int, nk_rect const*, nk_rect const*, nk_image const*, nk_symbol_type, char const*, int, unsigned int, nk_user_font const*)
NK_LIB void
nk_draw_selectable(struct nk_command_buffer *out,
    nk_flags state, const struct nk_style_selectable *style, int active,
    const struct nk_rect *bounds,
    const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym,
    const char *string, int len, nk_flags align, const struct nk_user_font *font)
{
    const struct nk_style_item *background;
    struct nk_text text;
    text.padding = style->padding;

    /* select correct colors/images */
    if (!active) {
        if (state & NK_WIDGET_STATE_ACTIVED) {
            background = &style->pressed;
            text.text = style->text_pressed;
        } else if (state & NK_WIDGET_STATE_HOVER) {
            background = &style->hover;
            text.text = style->text_hover;
        } else {
            background = &style->normal;
            text.text = style->text_normal;
        }
    } else {
        if (state & NK_WIDGET_STATE_ACTIVED) {
            background = &style->pressed_active;
            text.text = style->text_pressed_active;
        } else if (state & NK_WIDGET_STATE_HOVER) {
            background = &style->hover_active;
            text.text = style->text_hover_active;
        } else {
            background = &style->normal_active;
            text.text = style->text_normal_active;
        }
    }
    /* draw selectable background and text */
    if (background->type == NK_STYLE_ITEM_IMAGE) {
        nk_draw_image(out, *bounds, &background->data.image, nk_white);
        text.background = nk_rgba(0,0,0,0);
    } else {
        nk_fill_rect(out, *bounds, style->rounding, background->data.color);
        text.background = background->data.color;
    }
    if (icon) {
        if (img) nk_draw_image(out, *icon, img, nk_white);
        else nk_draw_symbol(out, sym, *icon, text.background, text.text, 1, font);
    }
    nk_widget_text(out, *bounds, string, len, &text, align, font);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rdi, %r14
movq 0xe4(%rdx), %rax
movq %rax, 0x8(%rsp)
testl %ecx, %ecx
je 0x1dbfd
testb $0x20, %sil
jne 0x1dc18
testb $0x10, %sil
jne 0x1dc33
leaq 0x60(%rdx), %r12
movl 0xcc(%rdx), %ebp
jmp 0x1dc4c
testb $0x20, %sil
jne 0x1dc27
testb $0x10, %sil
jne 0x1dc42
movl 0xc0(%rdx), %ebp
movl %ebp, 0x14(%rsp)
movq %rdx, %r12
jmp 0x1dc50
leaq 0xa0(%rdx), %r12
movl 0xd4(%rdx), %ebp
jmp 0x1dc4c
leaq 0x40(%rdx), %r12
movl 0xc8(%rdx), %ebp
jmp 0x1dc4c
leaq 0x80(%rdx), %r12
movl 0xd0(%rdx), %ebp
jmp 0x1dc4c
leaq 0x20(%rdx), %r12
movl 0xc4(%rdx), %ebp
movl %ebp, 0x14(%rsp)
cmpl $0x1, (%r12)
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
jne 0x1dc76
addq $0x8, %r12
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x72e2
xorl %edx, %edx
jmp 0x1dc90
movss 0xe0(%rdx), %xmm2
movl 0x8(%r12), %esi
movq %r14, %rdi
callq 0x6858
movl 0x8(%r12), %edx
movq 0x78(%rsp), %r12
movl 0x70(%rsp), %r8d
movl 0x68(%rsp), %eax
movq 0x60(%rsp), %r13
movl %edx, 0x10(%rsp)
testq %r15, %r15
je 0x1dcf0
movq 0x50(%rsp), %rsi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
testq %rsi, %rsi
je 0x1dcce
pushq $-0x1
popq %rdx
movq %r14, %rdi
callq 0x72e2
jmp 0x1dce7
movl 0x58(%rsp), %esi
movss 0x234a(%rip), %xmm2     # 0x20024
movq %r14, %rdi
movl %ebp, %ecx
movq %r12, %r8
callq 0x1b715
movl 0x70(%rsp), %r8d
movl 0x68(%rsp), %eax
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %r13, %rsi
movl %eax, %edx
movq %r12, %r9
callq 0x12660
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq