// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/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, nk_bool 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;
        }
    }

    text.text = nk_rgb_factor(text.text, style->color_factor);

    /* draw selectable background and text */
    switch (background->type) {
        case NK_STYLE_ITEM_IMAGE:
            text.background = nk_rgba(0, 0, 0, 0);
            nk_draw_image(out, *bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
            break;
        case NK_STYLE_ITEM_NINE_SLICE:
            text.background = nk_rgba(0, 0, 0, 0);
            nk_draw_nine_slice(out, *bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
            break;
        case NK_STYLE_ITEM_COLOR:
            text.background = background->data.color;
            nk_fill_rect(out, *bounds, style->rounding, background->data.color);
            break;
    }
    if (icon) {
        if (img) nk_draw_image(out, *icon, img, nk_rgb_factor(nk_white, style->color_factor));
        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 %rdx, %r12
movq %rdi, %r14
movq 0x114(%rdx), %rax
movq %rax, (%rsp)
testl %ecx, %ecx
je 0x58981
testb $0x20, %sil
jne 0x5899e
testb $0x10, %sil
jne 0x589bf
leaq 0x78(%r12), %r13
movl 0xfc(%r12), %eax
jmp 0x589de
testb $0x20, %sil
jne 0x589b0
testb $0x10, %sil
jne 0x589d1
movl 0xf0(%r12), %eax
movl %eax, 0xc(%rsp)
movq %r12, %r13
jmp 0x589e2
leaq 0xc8(%r12), %r13
movl 0x104(%r12), %eax
jmp 0x589de
leaq 0x50(%r12), %r13
movl 0xf8(%r12), %eax
jmp 0x589de
leaq 0xa0(%r12), %r13
movl 0x100(%r12), %eax
jmp 0x589de
leaq 0x28(%r12), %r13
movl 0xf4(%r12), %eax
movl %eax, 0xc(%rsp)
movss 0x12c(%r12), %xmm0
movl 0xc(%rsp), %edi
movss %xmm0, 0x14(%rsp)
callq 0x13e60
movl %eax, 0xc(%rsp)
movl (%r13), %eax
testl %eax, %eax
je 0x58ad6
cmpl $0x2, %eax
je 0x58a79
cmpl $0x1, %eax
jne 0x58af9
addq $0x8, %r13
movss 0x14(%rsp), %xmm0
ucomiss 0x15e8a(%rip), %xmm0    # 0x6e8b4
mulss 0x15e86(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %eax
movl $0xff, %ecx
cmovnel %eax, %ecx
movl $0x0, 0x8(%rsp)
cmovpl %eax, %ecx
movzbl %cl, %eax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %eax, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
movq %r13, %rsi
callq 0x134d0
jmp 0x58af9
addq $0x8, %r13
movss 0x14(%rsp), %xmm0
ucomiss 0x15e2a(%rip), %xmm0    # 0x6e8b4
mulss 0x15e26(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %eax
movl $0xff, %ecx
cmovnel %eax, %ecx
movl $0x0, 0x8(%rsp)
cmovpl %eax, %ecx
movzbl %cl, %eax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %eax, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
movq %r13, %rsi
callq 0x13fe0
jmp 0x58af9
movl 0x8(%r13), %esi
movl %esi, 0x8(%rsp)
movss 0x110(%r12), %xmm2
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %r14, %rdi
callq 0x12de0
movq 0x78(%rsp), %r13
movl 0x70(%rsp), %r8d
movl 0x68(%rsp), %edx
movq 0x60(%rsp), %rbp
testq %r15, %r15
je 0x58ba6
movq 0x50(%rsp), %rsi
testq %rsi, %rsi
je 0x58b73
movss 0x12c(%r12), %xmm0
ucomiss 0x15d84(%rip), %xmm0    # 0x6e8b4
mulss 0x15d80(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %eax
movl $0xff, %ecx
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movzbl %cl, %eax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %eax, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movq %r14, %rdi
callq 0x134d0
jmp 0x58b9d
movl 0x58(%rsp), %esi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movss 0x15d22(%rip), %xmm2    # 0x6e8b4
movq %r14, %rdi
movq %r13, %r8
callq 0x52e29
movl 0x70(%rsp), %r8d
movl 0x68(%rsp), %edx
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq %rsp, %rcx
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %r9
callq 0x45d79
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq