// File: /workspace/github_c_makefile_star2_O1/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, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x52a14
movq 0x35601(%rip), %r14     # 0x87ff0
movq (%r14), %rdi
leaq 0x1f393(%rip), %rsi     # 0x71d8c
leaq 0x1f3aa(%rip), %rdx     # 0x71daa
movl $0x72c3, %ecx           # imm = 0x72C3
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
cmpq $0x0, 0x4780(%rbx)
jne 0x52a4a
movq 0x355cb(%rip), %r14     # 0x87ff0
movq (%r14), %rdi
leaq 0x1f35d(%rip), %rsi     # 0x71d8c
leaq 0x1f374(%rip), %rdx     # 0x71daa
movl $0x72c4, %ecx           # imm = 0x72C4
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x52a87
movq 0x3558e(%rip), %r14     # 0x87ff0
movq (%r14), %rdi
leaq 0x1f320(%rip), %rsi     # 0x71d8c
leaq 0x1f337(%rip), %rdx     # 0x71daa
movl $0x72c5, %ecx           # imm = 0x72C5
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x52e14
movq 0x4780(%rbx), %r14
testq %r14, %r14
je 0x52e14
cmpq $0x0, 0xa8(%r14)
je 0x52e14
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
testl %eax, %eax
je 0x52e14
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 0x521be
movl %eax, %r13d
xorl %esi, %esi
testl %eax, %eax
setne %al
movl 0x2598(%rbx), %edx
testb $0x20, %dl
jne 0x52b31
leaq 0x20a4(%rbx), %rcx
testb $0x10, %dl
jne 0x52b41
leaq 0x2018(%rbx), %r12
jmp 0x52b48
leaq 0x2068(%rbx), %r12
leaq 0x20a8(%rbx), %rcx
jmp 0x52b48
leaq 0x2040(%rbx), %r12
movb %al, %sil
movl %esi, 0x38(%rsp)
movl (%rcx), %edi
movss 0x21b4(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x13e60
movl (%r12), %ecx
testl %ecx, %ecx
movl %ebp, 0x3c(%rsp)
je 0x52c3b
cmpl $0x2, %ecx
je 0x52bdb
cmpl $0x1, %ecx
jne 0x52cd2
addq $0x8, %r12
movss 0xc(%rsp), %xmm0
ucomiss 0x1bd21(%rip), %xmm0    # 0x6e8b4
mulss 0x1bd1d(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %edx
movl $0xff, %ecx
cmovnel %edx, %ecx
cmovpl %edx, %ecx
leaq 0x68(%r14), %rdi
movzbl %cl, %esi
movl %esi, %ecx
shll $0x10, %ecx
movl %esi, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %esi, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %r12, %rsi
movl %eax, %ebp
callq 0x134d0
jmp 0x52c32
addq $0x8, %r12
movss 0xc(%rsp), %xmm0
ucomiss 0x1bcc8(%rip), %xmm0    # 0x6e8b4
mulss 0x1bcc4(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %edx
movl $0xff, %ecx
cmovnel %edx, %ecx
cmovpl %edx, %ecx
leaq 0x68(%r14), %rdi
movzbl %cl, %esi
movl %esi, %ecx
shll $0x10, %ecx
movl %esi, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %esi, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movaps 0x40(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movq %r12, %rsi
movl %eax, %ebp
callq 0x13fe0
movl %ebp, %eax
xorl %edx, %edx
jmp 0x52cd2
movl 0x8(%r12), %r12d
leaq 0x68(%r14), %r15
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x34(%rsp)
movl %r12d, %edi
movss 0xc(%rsp), %xmm0
movl %eax, %ebp
callq 0x13e60
movq %r15, %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 %r15, %rdi
movss 0x20(%rsp), %xmm2
movss 0x40(%rsp), %xmm3
movl %eax, %esi
callq 0x12060
movl %r12d, %edx
movl %ebp, %eax
xorl %ecx, %ecx
testl %r13d, %r13d
setne %cl
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r12
movaps %xmm0, (%r12)
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), %r15
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 0x78(%rsp), %r13
movups %xmm6, (%r13)
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
movss %xmm1, 0xc(%r12)
movlps %xmm0, (%r12)
subss %xmm0, %xmm2
movss %xmm2, 0x8(%r12)
leaq 0x68(%r14), %rbp
movq 0x168(%rbx), %r8
movsd 0x8(%r12), %xmm1
movss 0x1baf8(%rip), %xmm2    # 0x6e8b4
movq %rbp, %rdi
movl 0x3c(%rsp), %esi
movl %eax, %ecx
callq 0x52e29
movl 0x2598(%rbx), %ecx
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %r8
movl 0x20(%rsp), %r9d
callq 0x522f0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x50(%rsp), %xmm0
movl 0x38(%rsp), %edx
callq 0x52392
movl %eax, %r15d
movl %r15d, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq