// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rdx, %r12
movq %rdi, 0x8(%rsp)
movq 0x114(%rdx), %rax
movq %rax, 0x18(%rsp)
testl %ecx, %ecx
je 0x57dbb
testb $0x20, %sil
jne 0x57ddc
testb $0x10, %sil
jne 0x57df7
leaq 0x78(%r12), %r13
movl $0xfc, %eax
jmp 0x57e04
testb $0x20, %sil
jne 0x57deb
andl $0x10, %esi
movl %esi, %eax
shrl $0x2, %eax
orq $0xf0, %rax
leaq 0x28(%r12), %r13
testl %esi, %esi
cmoveq %r12, %r13
jmp 0x57e04
leaq 0xc8(%r12), %r13
movl $0x104, %eax            # imm = 0x104
jmp 0x57e04
leaq 0x50(%r12), %r13
movl $0xf8, %eax
jmp 0x57e04
leaq 0xa0(%r12), %r13
movl $0x100, %eax            # imm = 0x100
movl (%r12,%rax), %edi
movss 0x12c(%r12), %xmm0
movss %xmm0, 0x14(%rsp)
callq 0x13e60
movl %eax, %ebp
movl %eax, 0x24(%rsp)
movl (%r13), %eax
testl %eax, %eax
je 0x57f04
cmpl $0x2, %eax
je 0x57e9f
cmpl $0x1, %eax
jne 0x57f2d
movl $0x0, 0x20(%rsp)
addq $0x8, %r13
movss 0x15a57(%rip), %xmm0    # 0x6d8a8
movss 0x14(%rsp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x15a37(%rip), %xmm1    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x134d0
jmp 0x57eff
movl $0x0, 0x20(%rsp)
addq $0x8, %r13
movss 0x159f5(%rip), %xmm0    # 0x6d8a8
movss 0x14(%rsp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x159d5(%rip), %xmm1    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x13fe0
xorl %r14d, %r14d
jmp 0x57f2d
movl 0x8(%r13), %r14d
movl %r14d, 0x20(%rsp)
movss 0x110(%r12), %xmm2
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq 0x8(%rsp), %rdi
movl %r14d, %esi
callq 0x12de0
movq 0x88(%rsp), %r13
movl 0x80(%rsp), %r8d
movl 0x78(%rsp), %edx
movq 0x70(%rsp), %rsi
testq %r15, %r15
je 0x57fec
movq 0x60(%rsp), %rsi
testq %rsi, %rsi
je 0x57fb2
movss 0x12c(%r12), %xmm0
movss 0x1593d(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x15923(%rip), %xmm0    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movq 0x8(%rsp), %rdi
callq 0x134d0
jmp 0x57fdb
movl 0x68(%rsp), %esi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movss 0x158db(%rip), %xmm2    # 0x6d8a4
movq 0x8(%rsp), %rdi
movl %r14d, %edx
movl %ebp, %ecx
movq %r13, %r8
callq 0x52280
movl 0x80(%rsp), %r8d
movl 0x78(%rsp), %edx
movq 0x70(%rsp), %rsi
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
leaq 0x18(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq %r13, %r9
callq 0x451c6
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq