// File: /workspace/github_c_makefile_star2_O1/0x0203[P]schack_poc/./nuklear.h
// Function: nk_combo_begin_symbol
NK_API int
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_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;
    }

    if (background->type == NK_STYLE_ITEM_IMAGE) {
        sym_background = nk_rgba(0,0,0,0);
        nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
    } else {
        sym_background = background->data.color;
        nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
        nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
    }
    {
        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 $0x78, %rsp
testq %rdi, %rdi
je 0x1e914
movq %rdi, %rbx
movq 0x3fe8(%rdi), %r14
testq %r14, %r14
je 0x1e933
movaps %xmm0, 0x40(%rsp)
cmpq $0x0, 0xa8(%r14)
je 0x1e952
movl %esi, %r15d
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xfda9
testl %eax, %eax
je 0x1e6fa
movq 0xa8(%r14), %rcx
xorl %edx, %edx
testl $0x1000, 0x4(%rcx)      # imm = 0x1000
movq %rbx, %rsi
cmovneq %rdx, %rsi
cmpl $0x2, %eax
cmoveq %rdx, %rsi
leaq 0x1f70(%rbx), %rdi
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movaps %xmm0, 0x20(%rsp)
movaps %xmm1, 0x30(%rsp)
xorl %edx, %edx
callq 0x1e017
movl %eax, %ebp
xorl %edi, %edi
testl %eax, %eax
setne %al
movl 0x1f70(%rbx), %edx
testb $0x20, %dl
jne 0x1e701
leaq 0x1b24(%rbx), %rcx
testb $0x10, %dl
jne 0x1e711
leaq 0x1ab0(%rbx), %rsi
jmp 0x1e718
xorl %eax, %eax
jmp 0x1e905
leaq 0x1af0(%rbx), %rsi
leaq 0x1b28(%rbx), %rcx
jmp 0x1e718
leaq 0x1ad0(%rbx), %rsi
movaps 0x30(%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
movb %al, %dil
movl (%rcx), %eax
cmpl $0x1, (%rsi)
movl %r15d, 0x1c(%rsp)
movl %edi, 0x30(%rsp)
movl %eax, 0x20(%rsp)
jne 0x1e74f
leaq 0x68(%r14), %rdi
addq $0x8, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
xorl %edx, %edx
jmp 0x1e797
movl 0x8(%rsi), %r15d
leaq 0x68(%r14), %r12
movss 0x1bf0(%rbx), %xmm2
movq %r12, %rdi
movl %r15d, %esi
callq 0x6fee
movss 0x1bf0(%rbx), %xmm2
movss 0x1bec(%rbx), %xmm3
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl 0x1b10(%rbx), %esi
movq %r12, %rdi
callq 0x6e96
movl %r15d, %edx
xorl %eax, %eax
testl %ebp, %ebp
setne %al
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rbp
movaps %xmm0, (%rbp)
testb $0x10, 0x1f70(%rbx)
leaq 0x1be0(,%rax,8), %rax
movl $0x1be4, %ecx           # imm = 0x1BE4
cmoveq %rax, %rcx
movl (%rbx,%rcx), %eax
movl %eax, 0x18(%rsp)
movss 0x14(%rsp), %xmm0
movss 0x1bb0(%rbx), %xmm4
movss 0x1c00(%rbx), %xmm5
movaps %xmm5, %xmm1
addss %xmm5, %xmm1
movaps %xmm0, %xmm6
subss %xmm1, %xmm6
movss 0x8(%rsp), %xmm1
movss 0xc(%rsp), %xmm3
movss 0x10(%rsp), %xmm2
addss %xmm1, %xmm2
subss %xmm0, %xmm2
subss %xmm5, %xmm2
addss %xmm3, %xmm5
movaps %xmm4, %xmm7
addss %xmm2, %xmm7
leaq 0x68(%rsp), %r13
movss %xmm7, (%r13)
movss 0x1bb4(%rbx), %xmm7
addss %xmm7, %xmm5
movss %xmm5, 0x4(%r13)
addss %xmm4, %xmm4
movaps %xmm6, %xmm5
subss %xmm4, %xmm5
movss %xmm5, 0x8(%r13)
addss %xmm7, %xmm7
subss %xmm7, %xmm6
movss %xmm6, 0xc(%r13)
movss 0x1bf8(%rbx), %xmm4
addss %xmm4, %xmm3
subss %xmm4, %xmm2
addss %xmm4, %xmm4
subss %xmm4, %xmm0
movss %xmm0, 0xc(%rbp)
movss %xmm3, 0x4(%rbp)
addss 0x1bf4(%rbx), %xmm1
leaq 0x1b30(%rbx), %r12
movss %xmm1, (%rbp)
subss %xmm1, %xmm2
movss %xmm2, 0x8(%rbp)
leaq 0x68(%r14), %r15
movq 0x168(%rbx), %r8
movsd (%rbp), %xmm0
movsd 0x8(%rbp), %xmm1
movss 0x9ad6(%rip), %xmm2     # 0x28384
movq %r15, %rdi
movl 0x1c(%rsp), %esi
movl 0x20(%rsp), %ecx
callq 0x1e971
movl 0x1f70(%rbx), %ecx
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %r8
movl 0x18(%rsp), %r9d
callq 0x1e149
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x40(%rsp), %xmm0
movl 0x30(%rsp), %edx
callq 0x1e1d0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xdbfa(%rip), %rdi      # 0x2c515
leaq 0xad61(%rip), %rsi      # 0x29683
leaq 0xf1e5(%rip), %rcx      # 0x2db0e
movl $0x5ff3, %edx           # imm = 0x5FF3
callq 0x3100
leaq 0xc80d(%rip), %rdi      # 0x2b147
leaq 0xad42(%rip), %rsi      # 0x29683
leaq 0xf1c6(%rip), %rcx      # 0x2db0e
movl $0x5ff4, %edx           # imm = 0x5FF4
callq 0x3100
leaq 0xc96a(%rip), %rdi      # 0x2b2c3
leaq 0xad23(%rip), %rsi      # 0x29683
leaq 0xf1a7(%rip), %rcx      # 0x2db0e
movl $0x5ff5, %edx           # imm = 0x5FF5
callq 0x3100