// File: /workspace/github_c_makefile_star2_O1/0x0203[P]schack_poc/./nuklear.h
// Function: nk_draw_selectable
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 0x2603c
testb $0x20, %sil
jne 0x26057
testb $0x10, %sil
jne 0x26072
leaq 0x60(%rdx), %r12
movl 0xcc(%rdx), %eax
jmp 0x2608b
testb $0x20, %sil
jne 0x26066
testb $0x10, %sil
jne 0x26081
movl 0xc0(%rdx), %eax
movl %eax, 0x14(%rsp)
movq %rdx, %r12
jmp 0x2608f
leaq 0xa0(%rdx), %r12
movl 0xd4(%rdx), %eax
jmp 0x2608b
leaq 0x40(%rdx), %r12
movl 0xc8(%rdx), %eax
jmp 0x2608b
leaq 0x80(%rdx), %r12
movl 0xd0(%rdx), %eax
jmp 0x2608b
leaq 0x20(%rdx), %r12
movl 0xc4(%rdx), %eax
movl %eax, 0x14(%rsp)
cmpl $0x1, (%r12)
jne 0x260bd
addq $0x8, %r12
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
movl $0x0, 0x10(%rsp)
jmp 0x260e4
movss 0xe0(%rdx), %xmm2
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movl 0x8(%r12), %esi
movq %r14, %rdi
callq 0x6fee
movl 0x8(%r12), %eax
movl %eax, 0x10(%rsp)
movq 0x78(%rsp), %r12
movl 0x70(%rsp), %r8d
movl 0x68(%rsp), %r13d
movq 0x60(%rsp), %rbp
testq %r15, %r15
je 0x26150
movq 0x50(%rsp), %rsi
testq %rsi, %rsi
je 0x26121
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
jmp 0x2614b
movl 0x58(%rsp), %esi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
movss 0x2244(%rip), %xmm2     # 0x28384
movq %r14, %rdi
movq %r12, %r8
callq 0x1e971
movl 0x70(%rsp), %r8d
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %rbp, %rsi
movl %r13d, %edx
movq %r12, %r9
callq 0x13f12
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq