// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_combo_begin_symbol
NK_API nk_bool
nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, 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;
    struct nk_color sym_background;
    struct nk_color symbol_color;

    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;
        symbol_color = style->combo.symbol_active;
    } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
        background = &style->combo.hover;
        symbol_color = style->combo.symbol_hover;
    } else {
        background = &style->combo.normal;
        symbol_color = style->combo.symbol_hover;
    }

    symbol_color = nk_rgb_factor(symbol_color, style->combo.color_factor);

    switch(background->type) {
        case NK_STYLE_ITEM_IMAGE:
            sym_background = nk_rgba(0, 0, 0, 0);
            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:
            sym_background = nk_rgba(0, 0, 0, 0);
            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:
            sym_background = background->data.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 bounds = {0,0,0,0};
        struct nk_rect content;
        struct nk_rect button;

        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;

        /* calculate button */
        button.w = header.h - 2 * style->combo.button_padding.y;
        button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
        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 symbol */
        bounds.h = header.h - 2 * style->combo.content_padding.y;
        bounds.y = header.y + style->combo.content_padding.y;
        bounds.x = header.x + style->combo.content_padding.x;
        bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
        nk_draw_symbol(&win->buffer, symbol, bounds, sym_background, symbol_color,
            1.0f, style->font);

        /* draw open/close button */
        nk_draw_button_symbol(&win->buffer, &bounds, &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, 0x50(%rsp)
movl %esi, %r15d
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x51e7a
movq 0x3519b(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x1ef3d(%rip), %rsi     # 0x70d9c
leaq 0x1ef54(%rip), %rdx     # 0x70dba
movl $0x72c3, %ecx           # imm = 0x72C3
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
testq %r14, %r14
jne 0x51eb9
movq 0x35163(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x1ef05(%rip), %rsi     # 0x70d9c
leaq 0x1ef1c(%rip), %rdx     # 0x70dba
movl $0x72c4, %ecx           # imm = 0x72C4
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
cmpq $0x0, 0xa8(%r14)
jne 0x51f01
movq 0x35126(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x1eec8(%rip), %rsi     # 0x70d9c
leaq 0x1eedf(%rip), %rdx     # 0x70dba
xorl %ebp, %ebp
movl $0x72c5, %ecx           # imm = 0x72C5
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
testq %r14, %r14
je 0x5226c
xorl %ebp, %ebp
cmpq $0x0, 0xa8(%r14)
je 0x5226c
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
testl %eax, %eax
je 0x5226c
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, 0x40(%rsp)
movaps %xmm1, 0x20(%rsp)
xorl %edx, %edx
callq 0x5160c
movl %eax, %r13d
xorl %esi, %esi
testl %eax, %eax
setne %al
movl 0x2598(%rbx), %edx
testb $0x20, %dl
jne 0x51f91
leaq 0x20a4(%rbx), %rcx
testb $0x10, %dl
jne 0x51fa1
leaq 0x2018(%rbx), %rbp
jmp 0x51fa8
leaq 0x2068(%rbx), %rbp
leaq 0x20a8(%rbx), %rcx
jmp 0x51fa8
leaq 0x2040(%rbx), %rbp
movb %al, %sil
movl %esi, 0x38(%rsp)
movl (%rcx), %edi
movss 0x21b4(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x13e60
movl (%rbp), %ecx
testl %ecx, %ecx
movl %r15d, 0x3c(%rsp)
je 0x520a1
cmpl $0x2, %ecx
je 0x5203e
cmpl $0x1, %ecx
jne 0x52137
addq $0x8, %rbp
movss 0x1b8ba(%rip), %xmm0    # 0x6d8a8
movss 0xc(%rsp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %edx
movl $0xff, %ecx
andl %ecx, %edx
ucomiss 0x1b89a(%rip), %xmm1    # 0x6d8a4
leaq 0x68(%r14), %rdi
cmovnel %edx, %ecx
cmovpl %edx, %ecx
movl %ecx, %esi
shll $0x10, %esi
movl %ecx, %edx
shll $0x8, %edx
orl %esi, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %rbp, %rsi
movl %eax, %ebp
callq 0x134d0
jmp 0x52098
addq $0x8, %rbp
movss 0x1b85e(%rip), %xmm0    # 0x6d8a8
movss 0xc(%rsp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %edx
movl $0xff, %ecx
andl %ecx, %edx
ucomiss 0x1b83e(%rip), %xmm1    # 0x6d8a4
leaq 0x68(%r14), %rdi
cmovnel %edx, %ecx
cmovpl %edx, %ecx
movl %ecx, %esi
shll $0x10, %esi
movl %ecx, %edx
shll $0x8, %edx
orl %esi, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %rbp, %rsi
movl %eax, %ebp
callq 0x13fe0
movl %ebp, %eax
xorl %edx, %edx
jmp 0x52137
movl 0x8(%rbp), %r15d
leaq 0x68(%r14), %r12
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x34(%rsp)
movl %r15d, %edi
movss 0xc(%rsp), %xmm0
movl %eax, %ebp
callq 0x13e60
movq %r12, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movss 0x34(%rsp), %xmm2
movl %eax, %esi
callq 0x12de0
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x2194(%rbx), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x21b4(%rbx), %xmm0
movl 0x2090(%rbx), %edi
callq 0x13e60
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r12, %rdi
movss 0x20(%rsp), %xmm2
movss 0x40(%rsp), %xmm3
movl %eax, %esi
callq 0x12060
movl %r15d, %edx
movl %ebp, %eax
xorl %ecx, %ecx
testl %r13d, %r13d
setne %cl
testb $0x10, 0x2598(%rbx)
leaq 0x2188(,%rcx,8), %rsi
movl $0x218c, %ecx           # imm = 0x218C
cmoveq %rsi, %rcx
movl (%rbx,%rcx), %ecx
movl %ecx, 0x20(%rsp)
movss 0x1c(%rsp), %xmm1
movss 0x21a8(%rbx), %xmm3
movsd 0x10(%rsp), %xmm0
movss 0x18(%rsp), %xmm2
addss %xmm0, %xmm2
subss %xmm1, %xmm2
subss %xmm3, %xmm2
movaps %xmm0, %xmm4
shufps $0x55, %xmm0, %xmm4     # xmm4 = xmm4[1,1],xmm0[1,1]
addss %xmm3, %xmm4
addss %xmm3, %xmm3
movaps %xmm1, %xmm5
subss %xmm3, %xmm5
leaq 0x20b0(%rbx), %r13
movsd 0x2150(%rbx), %xmm3
unpcklps %xmm5, %xmm5            # xmm5 = xmm5[0,0,1,1]
movaps %xmm2, %xmm6
unpcklps %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0],xmm6[1],xmm4[1]
addps %xmm3, %xmm6
addps %xmm3, %xmm3
subps %xmm3, %xmm5
movlhps %xmm5, %xmm6            # xmm6 = xmm6[0],xmm5[0]
leaq 0x68(%rsp), %r12
movups %xmm6, (%r12)
movsd 0x219c(%rbx), %xmm3
addps %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
subss %xmm3, %xmm2
addss %xmm3, %xmm3
subss %xmm3, %xmm1
leaq 0x78(%rsp), %r15
movss %xmm1, 0xc(%r15)
movlps %xmm0, (%r15)
subss %xmm0, %xmm2
movss %xmm2, 0x8(%r15)
leaq 0x68(%r14), %rbp
movq 0x168(%rbx), %r8
movsd 0x8(%r15), %xmm1
movss 0x1b68f(%rip), %xmm2    # 0x6d8a4
movq %rbp, %rdi
movl 0x3c(%rsp), %esi
movl %eax, %ecx
callq 0x52280
movl 0x2598(%rbx), %ecx
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %r8
movl 0x20(%rsp), %r9d
callq 0x5173c
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x50(%rsp), %xmm0
movl 0x38(%rsp), %edx
callq 0x517de
movl %eax, %ebp
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq