// File: /workspace/github_c_makefile_star2_O2/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 0x4cd59
movq 0x382bc(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x1cfce(%rip), %rsi     # 0x69d0c
leaq 0x1cfe5(%rip), %rdx     # 0x69d2a
movl $0x7266, %ecx           # imm = 0x7266
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %r14
testq %r14, %r14
jne 0x4cd98
movq 0x38284(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x1cf96(%rip), %rsi     # 0x69d0c
leaq 0x1cfad(%rip), %rdx     # 0x69d2a
movl $0x7267, %ecx           # imm = 0x7267
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %r14
cmpq $0x0, 0xa8(%r14)
jne 0x4cde1
movq 0x38247(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x1cf59(%rip), %rsi     # 0x69d0c
leaq 0x1cf70(%rip), %rdx     # 0x69d2a
xorl %r15d, %r15d
movl $0x7268, %ecx           # imm = 0x7268
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %r14
testq %r14, %r14
je 0x4d13b
xorl %r15d, %r15d
cmpq $0x0, 0xa8(%r14)
je 0x4d13b
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x12990
testl %eax, %eax
je 0x4d13b
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 0x4c99d
movl %eax, %r12d
xorl %r15d, %r15d
testl %eax, %eax
setne 0xb(%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), %r13
movl (%rbx,%rax), %eax
testl %eax, %eax
je 0x4cf0b
cmpl $0x2, %eax
je 0x4cecf
cmpl $0x1, %eax
jne 0x4cfa1
movl %ebp, 0xc(%rsp)
leaq 0x68(%r14), %rbp
addq $0x8, %r13
movss 0x21b4(%rbx), %xmm0
pushq $-0x1
popq %rdi
callq 0x140a0
movq %rbp, %rdi
movl 0xc(%rsp), %ebp
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movq %r13, %rsi
movl %eax, %edx
callq 0x13660
jmp 0x4cfa1
movl %ebp, 0xc(%rsp)
leaq 0x68(%r14), %rbp
addq $0x8, %r13
movss 0x21b4(%rbx), %xmm0
pushq $-0x1
popq %rdi
callq 0x140a0
movq %rbp, %rdi
movl 0xc(%rsp), %ebp
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movq %r13, %rsi
movl %eax, %edx
callq 0x14230
jmp 0x4cfa1
movl %ebp, 0xc(%rsp)
leaq 0x68(%r14), %rbp
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x4c(%rsp)
movss 0x21b4(%rbx), %xmm0
movl 0x8(%r13), %edi
callq 0x140a0
movq %rbp, %rdi
movaps 0x20(%rsp), %xmm0
movaps 0x30(%rsp), %xmm1
movss 0x4c(%rsp), %xmm2
movl %eax, %esi
callq 0x12f00
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 0x140a0
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rbp, %rdi
movl 0xc(%rsp), %ebp
movss 0x30(%rsp), %xmm2
movss 0x20(%rsp), %xmm3
movl %eax, %esi
callq 0x12070
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 0x19843(%rip), %xmm3    # 0x668b4
addss %xmm0, %xmm3
movaps %xmm4, %xmm0
addps %xmm4, %xmm0
addps %xmm1, %xmm0
testl %r12d, %r12d
movaps %xmm0, 0x30(%rsp)
je 0x4d09c
addss 0x21ac(%rbx), %xmm4
subss %xmm4, %xmm8
subss %xmm0, %xmm8
jmp 0x4d0ac
mulss 0x19810(%rip), %xmm4    # 0x668b4
addss %xmm2, %xmm4
movaps %xmm4, %xmm8
unpcklps %xmm3, %xmm8            # xmm8 = xmm8[0],xmm3[0],xmm8[1],xmm3[1]
movaps %xmm8, 0x20(%rsp)
movb 0xb(%rsp), %al
movb %al, %r15b
leaq 0x68(%r14), %r13
movss 0x21b4(%rbx), %xmm0
movl %ebp, %edi
callq 0x140a0
xorps %xmm2, %xmm2
movq %r13, %rdi
movaps 0x30(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movl %eax, %esi
callq 0x12f00
testl %r12d, %r12d
je 0x4d119
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 0x4ca9a
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x70(%rsp), %xmm0
movl %r15d, %edx
callq 0x4cb3c
movl %eax, %r15d
movl %r15d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq