// File: /workspace/github_c_makefile_star2_O3/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 0x205a2
testb $0x20, %sil
jne 0x205bd
testb $0x10, %sil
jne 0x205d8
leaq 0x60(%rdx), %r12
movl 0xcc(%rdx), %ebp
jmp 0x205f1
testb $0x20, %sil
jne 0x205cc
testb $0x10, %sil
jne 0x205e7
movl 0xc0(%rdx), %ebp
movl %ebp, 0x14(%rsp)
movq %rdx, %r12
jmp 0x205f5
leaq 0xa0(%rdx), %r12
movl 0xd4(%rdx), %ebp
jmp 0x205f1
leaq 0x40(%rdx), %r12
movl 0xc8(%rdx), %ebp
jmp 0x205f1
leaq 0x80(%rdx), %r12
movl 0xd0(%rdx), %ebp
jmp 0x205f1
leaq 0x20(%rdx), %r12
movl 0xc4(%rdx), %ebp
movl %ebp, 0x14(%rsp)
cmpl $0x1, (%r12)
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
jne 0x2061d
addq $0x8, %r12
movq %r14, %rdi
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7c36
xorl %edx, %edx
jmp 0x20637
movss 0xe0(%rdx), %xmm2
movl 0x8(%r12), %esi
movq %r14, %rdi
callq 0x7178
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 0x20699
movq 0x50(%rsp), %rsi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
testq %rsi, %rsi
je 0x20677
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7c36
jmp 0x20690
movl 0x58(%rsp), %esi
movss 0x29a1(%rip), %xmm2     # 0x23024
movq %r14, %rdi
movl %ebp, %ecx
movq %r12, %r8
callq 0x1df4b
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 0x13fa7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq