// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_combo_begin_color
NK_API nk_bool
nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_vec2 size)
{
    struct nk_window *win;
    struct nk_style *style;
    const struct nk_input *in;

    struct nk_rect header;
    int is_clicked = nk_false;
    enum nk_widget_layout_states s;
    const struct nk_style_item *background;

    NK_ASSERT(ctx);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);
    if (!ctx || !ctx->current || !ctx->current->layout)
        return 0;

    win = ctx->current;
    style = &ctx->style;
    s = nk_widget(&header, ctx);
    if (s == NK_WIDGET_INVALID)
        return 0;

    in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_DISABLED || s == NK_WIDGET_ROM)? 0: &ctx->input;
    if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
        is_clicked = nk_true;

    /* draw combo box header background and border */
    if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED)
        background = &style->combo.active;
    else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
        background = &style->combo.hover;
    else background = &style->combo.normal;

    switch(background->type) {
        case NK_STYLE_ITEM_IMAGE:
            nk_draw_image(&win->buffer, header, &background->data.image, nk_rgb_factor(nk_white, style->combo.color_factor));
            break;
        case NK_STYLE_ITEM_NINE_SLICE:
            nk_draw_nine_slice(&win->buffer, header, &background->data.slice, nk_rgb_factor(nk_white, style->combo.color_factor));
            break;
        case NK_STYLE_ITEM_COLOR:
            nk_fill_rect(&win->buffer, header, style->combo.rounding, nk_rgb_factor(background->data.color, style->combo.color_factor));
            nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, nk_rgb_factor(style->combo.border_color, style->combo.color_factor));
            break;
    }
    {
        struct nk_rect content;
        struct nk_rect button;
        struct nk_rect bounds;
        int draw_button_symbol;

        enum nk_symbol_type sym;
        if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
            sym = style->combo.sym_hover;
        else if (is_clicked)
            sym = style->combo.sym_active;
        else sym = style->combo.sym_normal;

        /* represents whether or not the combo's button symbol should be drawn */
        draw_button_symbol = sym != NK_SYMBOL_NONE;

        /* calculate button */
        button.w = header.h - 2 * style->combo.button_padding.y;
        button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
        button.y = header.y + style->combo.button_padding.y;
        button.h = button.w;

        content.x = button.x + style->combo.button.padding.x;
        content.y = button.y + style->combo.button.padding.y;
        content.w = button.w - 2 * style->combo.button.padding.x;
        content.h = button.h - 2 * style->combo.button.padding.y;

        /* draw color */
        bounds.h = header.h - 4 * style->combo.content_padding.y;
        bounds.y = header.y + 2 * style->combo.content_padding.y;
        bounds.x = header.x + 2 * style->combo.content_padding.x;
        if (draw_button_symbol)
            bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x;
        else
            bounds.w = header.w - 4 * style->combo.content_padding.x;
        nk_fill_rect(&win->buffer, bounds, 0, nk_rgb_factor(color, style->combo.color_factor));

        /* draw open/close button */
        if (draw_button_symbol)
            nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
                &ctx->style.combo.button, sym, style->font);
    }
    return nk_combo_begin(ctx, win, size, is_clicked, header);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movaps %xmm0, 0x70(%rsp)
movl %esi, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x519ff
movq 0x35616(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x1f3b8(%rip), %rsi     # 0x70d9c
leaq 0x1f3cf(%rip), %rdx     # 0x70dba
movl $0x7266, %ecx           # imm = 0x7266
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
testq %r14, %r14
jne 0x51a3e
movq 0x355de(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x1f380(%rip), %rsi     # 0x70d9c
leaq 0x1f397(%rip), %rdx     # 0x70dba
movl $0x7267, %ecx           # imm = 0x7267
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
cmpq $0x0, 0xa8(%r14)
jne 0x51a87
movq 0x355a1(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x1f343(%rip), %rsi     # 0x70d9c
leaq 0x1f35a(%rip), %rdx     # 0x70dba
xorl %r15d, %r15d
movl $0x7268, %ecx           # imm = 0x7268
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
testq %r14, %r14
je 0x51e18
xorl %r15d, %r15d
cmpq $0x0, 0xa8(%r14)
je 0x51e18
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
testl %eax, %eax
je 0x51e18
movq 0xa8(%r14), %rcx
movl $0x1000, %edx           # imm = 0x1000
andl 0x4(%rcx), %edx
xorl $0x1, %eax
xorl %ecx, %ecx
orl %edx, %eax
movq %rbx, %rsi
cmovneq %rcx, %rsi
leaq 0x2598(%rbx), %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movaps %xmm0, 0x20(%rsp)
movaps %xmm1, 0x30(%rsp)
xorl %edx, %edx
callq 0x5160c
movl %eax, %r12d
xorl %r15d, %r15d
testl %eax, %eax
setne 0xf(%rsp)
movl 0x2598(%rbx), %eax
testb $0x10, %al
movl $0x2018, %ecx           # imm = 0x2018
movl $0x2040, %edx           # imm = 0x2040
cmoveq %rcx, %rdx
testb $0x20, %al
movl $0x2068, %eax           # imm = 0x2068
cmoveq %rdx, %rax
leaq (%rbx,%rax), %rsi
movl (%rbx,%rax), %eax
testl %eax, %eax
je 0x51bf1
cmpl $0x2, %eax
je 0x51b95
cmpl $0x1, %eax
jne 0x51c7e
addq $0x8, %rsi
movss 0x21b4(%rbx), %xmm0
movss 0x1bd5b(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x1bd41(%rip), %xmm0    # 0x6d8a4
leaq 0x68(%r14), %rdi
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
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
callq 0x134d0
jmp 0x51c7e
addq $0x8, %rsi
movss 0x21b4(%rbx), %xmm0
movss 0x1bcff(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x1bce5(%rip), %xmm0    # 0x6d8a4
leaq 0x68(%r14), %rdi
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
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
callq 0x13fe0
jmp 0x51c7e
leaq 0x68(%r14), %r13
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x4c(%rsp)
movss 0x21b4(%rbx), %xmm0
movl 0x8(%rsi), %edi
callq 0x13e60
movq %r13, %rdi
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movss 0x4c(%rsp), %xmm2
movl %eax, %esi
callq 0x12de0
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x2194(%rbx), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x21b4(%rbx), %xmm0
movl 0x2090(%rbx), %edi
callq 0x13e60
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r13, %rdi
movss 0x30(%rsp), %xmm2
movss 0x20(%rsp), %xmm3
movl %eax, %esi
callq 0x12060
xorl %eax, %eax
testl %r12d, %r12d
setne %al
testb $0x10, 0x2598(%rbx)
leaq 0x2188(,%rax,8), %rax
movl $0x218c, %ecx           # imm = 0x218C
cmoveq %rax, %rcx
movl (%rbx,%rcx), %r12d
movss 0x1c(%rsp), %xmm0
movss 0x21a8(%rbx), %xmm2
movsd 0x10(%rsp), %xmm1
movaps %xmm1, %xmm3
shufps $0x55, %xmm1, %xmm3     # xmm3 = xmm3[1,1],xmm1[1,1]
addss %xmm2, %xmm3
addss %xmm2, %xmm2
movaps %xmm0, %xmm4
subss %xmm2, %xmm4
movss %xmm4, 0x58(%rsp)
movss 0x18(%rsp), %xmm2
movaps %xmm1, %xmm8
addss %xmm2, %xmm8
subss %xmm0, %xmm8
subss 0x21a4(%rbx), %xmm8
movss %xmm4, 0x5c(%rsp)
movsd 0x2150(%rbx), %xmm5
movaps %xmm5, %xmm6
shufps $0x55, %xmm5, %xmm6     # xmm6 = xmm6[1,1],xmm5[1,1]
unpcklps %xmm4, %xmm4            # xmm4 = xmm4[0,0,1,1]
movaps %xmm8, %xmm7
addss %xmm5, %xmm7
addps %xmm5, %xmm5
subps %xmm5, %xmm4
movlps %xmm4, 0x68(%rsp)
movss %xmm8, 0x50(%rsp)
movss %xmm3, 0x54(%rsp)
movss %xmm7, 0x60(%rsp)
addss %xmm6, %xmm3
movss %xmm3, 0x64(%rsp)
movsd 0x219c(%rbx), %xmm4
movaps %xmm4, %xmm3
shufps $0x55, %xmm4, %xmm3     # xmm3 = xmm3[1,1],xmm4[1,1]
mulss 0x1bbda(%rip), %xmm3    # 0x6d928
addss %xmm0, %xmm3
movaps %xmm4, %xmm0
addps %xmm4, %xmm0
addps %xmm1, %xmm0
testl %r12d, %r12d
movaps %xmm0, 0x30(%rsp)
je 0x51d79
addss 0x21ac(%rbx), %xmm4
subss %xmm4, %xmm8
subss %xmm0, %xmm8
jmp 0x51d89
mulss 0x1bba7(%rip), %xmm4    # 0x6d928
addss %xmm2, %xmm4
movaps %xmm4, %xmm8
unpcklps %xmm3, %xmm8            # xmm8 = xmm8[0],xmm3[0],xmm8[1],xmm3[1]
movaps %xmm8, 0x20(%rsp)
movb 0xf(%rsp), %al
movb %al, %r15b
leaq 0x68(%r14), %r13
movss 0x21b4(%rbx), %xmm0
movl %ebp, %edi
callq 0x13e60
xorps %xmm2, %xmm2
movq %r13, %rdi
movaps 0x30(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movl %eax, %esi
callq 0x12de0
testl %r12d, %r12d
je 0x51df6
leaq 0x20b0(%rbx), %r8
movl 0x2598(%rbx), %ecx
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
leaq 0x50(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %r13, %rdi
movl %r12d, %r9d
callq 0x5173c
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x70(%rsp), %xmm0
movl %r15d, %edx
callq 0x517de
movl %eax, %r15d
movl %r15d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq