// File: /workspace/github_c_makefile_star2_O2/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 0x52a16
testb $0x20, %sil
jne 0x52a37
testb $0x10, %sil
jne 0x52a52
leaq 0x78(%r12), %r13
movl $0xfc, %eax
jmp 0x52a5f
testb $0x20, %sil
jne 0x52a46
andl $0x10, %esi
movl %esi, %eax
shrl $0x2, %eax
orq $0xf0, %rax
leaq 0x28(%r12), %r13
testl %esi, %esi
cmoveq %r12, %r13
jmp 0x52a5f
leaq 0xc8(%r12), %r13
movl $0x104, %eax            # imm = 0x104
jmp 0x52a5f
leaq 0x50(%r12), %r13
movl $0xf8, %eax
jmp 0x52a5f
leaq 0xa0(%r12), %r13
movl $0x100, %eax            # imm = 0x100
movl (%r12,%rax), %edi
movss 0x12c(%r12), %xmm0
movss %xmm0, 0x14(%rsp)
callq 0x140a0
movl %eax, %ebp
movl %eax, 0x24(%rsp)
movl (%r13), %eax
testl %eax, %eax
je 0x52af9
cmpl $0x2, %eax
je 0x52ac5
cmpl $0x1, %eax
jne 0x52b22
andl $0x0, 0x20(%rsp)
addq $0x8, %r13
pushq $-0x1
popq %rdi
movss 0x14(%rsp), %xmm0
callq 0x140a0
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x13660
jmp 0x52af4
andl $0x0, 0x20(%rsp)
addq $0x8, %r13
pushq $-0x1
popq %rdi
movss 0x14(%rsp), %xmm0
callq 0x140a0
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x14230
xorl %r14d, %r14d
jmp 0x52b22
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 0x12f00
movq 0x88(%rsp), %r9
movl 0x80(%rsp), %r8d
movl 0x78(%rsp), %edx
movq 0x70(%rsp), %rsi
testq %r15, %r15
je 0x52bbb
movq 0x60(%rsp), %r13
testq %r13, %r13
je 0x52b7b
movss 0x12c(%r12), %xmm0
pushq $-0x1
popq %rdi
movq %r9, %r14
callq 0x140a0
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x13660
jmp 0x52ba7
movl 0x68(%rsp), %esi
movsd (%r15), %xmm0
movsd 0x8(%r15), %xmm1
movss 0x13ca2(%rip), %xmm2    # 0x66834
movq 0x8(%rsp), %rdi
movl %r14d, %edx
movl %ebp, %ecx
movq %r9, %r8
movq %r9, %r14
callq 0x4d54c
movq %r14, %r9
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
callq 0x41852
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq