// File: /workspace/github_c_makefile_star2_O2/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 0x4d19d
movq 0x37e78(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x1cb8a(%rip), %rsi     # 0x69d0c
leaq 0x1cba1(%rip), %rdx     # 0x69d2a
movl $0x72c3, %ecx           # imm = 0x72C3
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %r14
testq %r14, %r14
jne 0x4d1dc
movq 0x37e40(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x1cb52(%rip), %rsi     # 0x69d0c
leaq 0x1cb69(%rip), %rdx     # 0x69d2a
movl $0x72c4, %ecx           # imm = 0x72C4
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %r14
cmpq $0x0, 0xa8(%r14)
jne 0x4d224
movq 0x37e03(%rip), %r14     # 0x84ff0
movq (%r14), %rdi
leaq 0x1cb15(%rip), %rsi     # 0x69d0c
leaq 0x1cb2c(%rip), %rdx     # 0x69d2a
xorl %ebp, %ebp
movl $0x72c5, %ecx           # imm = 0x72C5
xorl %eax, %eax
callq 0x12ea0
movq (%r14), %rdi
callq 0x13960
movq 0x4780(%rbx), %r14
testq %r14, %r14
je 0x4d538
xorl %ebp, %ebp
cmpq $0x0, 0xa8(%r14)
je 0x4d538
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x12990
testl %eax, %eax
je 0x4d538
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 0x4c99d
movl %eax, %r13d
xorl %esi, %esi
testl %eax, %eax
setne %al
movl 0x2598(%rbx), %edx
testb $0x20, %dl
jne 0x4d2b4
leaq 0x20a4(%rbx), %rcx
testb $0x10, %dl
jne 0x4d2c4
leaq 0x2018(%rbx), %rbp
jmp 0x4d2cb
leaq 0x2068(%rbx), %rbp
leaq 0x20a8(%rbx), %rcx
jmp 0x4d2cb
leaq 0x2040(%rbx), %rbp
movb %al, %sil
movl %esi, 0x38(%rsp)
movl (%rcx), %edi
movss 0x21b4(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x140a0
movl (%rbp), %ecx
testl %ecx, %ecx
movl %r15d, 0x3c(%rsp)
je 0x4d36d
cmpl $0x2, %ecx
je 0x4d333
cmpl $0x1, %ecx
jne 0x4d403
leaq 0x68(%r14), %r12
addq $0x8, %rbp
pushq $-0x1
popq %rdi
movss 0xc(%rsp), %xmm0
movl %eax, %r15d
callq 0x140a0
movq %r12, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %rbp, %rsi
movl %eax, %edx
callq 0x13660
jmp 0x4d363
leaq 0x68(%r14), %r12
addq $0x8, %rbp
pushq $-0x1
popq %rdi
movss 0xc(%rsp), %xmm0
movl %eax, %r15d
callq 0x140a0
movq %r12, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %rbp, %rsi
movl %eax, %edx
callq 0x14230
movl %r15d, %eax
xorl %edx, %edx
jmp 0x4d403
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 0x140a0
movq %r12, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movss 0x34(%rsp), %xmm2
movl %eax, %esi
callq 0x12f00
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 0x140a0
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r12, %rdi
movss 0x20(%rsp), %xmm2
movss 0x40(%rsp), %xmm3
movl %eax, %esi
callq 0x12070
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), %rbp
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), %r13
movq 0x168(%rbx), %r8
movsd 0x8(%r15), %xmm1
movss 0x19353(%rip), %xmm2    # 0x66834
movq %r13, %rdi
movl 0x3c(%rsp), %esi
movl %eax, %ecx
callq 0x4d54c
movl 0x2598(%rbx), %ecx
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %r8
movl 0x20(%rsp), %r9d
callq 0x4ca9a
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x50(%rsp), %xmm0
movl 0x38(%rsp), %edx
callq 0x4cb3c
movl %eax, %ebp
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq