// File: /workspace/github_c_makefile_star2_O1/0x0203[P]schack_poc/./nuklear.h
// Function: nk_combo_begin_symbol_text
NK_API int
nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len,
    enum nk_symbol_type symbol, struct nk_vec2 size)
{
    struct nk_window *win;
    struct nk_style *style;
    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 symbol_color;
    struct nk_text text;

    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) 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;
        text.text = style->combo.label_active;
    } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
        background = &style->combo.hover;
        symbol_color = style->combo.symbol_hover;
        text.text = style->combo.label_hover;
    } else {
        background = &style->combo.normal;
        symbol_color = style->combo.symbol_normal;
        text.text = style->combo.label_normal;
    }
    if (background->type == NK_STYLE_ITEM_IMAGE) {
        text.background = nk_rgba(0,0,0,0);
        nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
    } else {
        text.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 content;
        struct nk_rect button;
        struct nk_rect label;
        struct nk_rect image;

        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.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;
        nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
            &ctx->style.combo.button, sym, style->font);

        /* draw symbol */
        image.x = header.x + style->combo.content_padding.x;
        image.y = header.y + style->combo.content_padding.y;
        image.h = header.h - 2 * style->combo.content_padding.y;
        image.w = image.h;
        nk_draw_symbol(&win->buffer, symbol, image, text.background, symbol_color,
            1.0f, style->font);

        /* draw label */
        text.padding = nk_vec2(0,0);
        label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
        label.y = header.y + style->combo.content_padding.y;
        label.w = (button.x - style->combo.content_padding.x) - label.x;
        label.h = header.h - 2 * style->combo.content_padding.y;
        nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, 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 $0xa8, %rsp
testq %rdi, %rdi
je 0x1eefe
movq %rdi, %rbx
movq 0x3fe8(%rdi), %r14
testq %r14, %r14
je 0x1ef1d
movaps %xmm0, 0x70(%rsp)
cmpq $0x0, 0xa8(%r14)
je 0x1ef3c
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r15
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xfda9
testl %eax, %eax
je 0x1ec5a
movl %r12d, 0x18(%rsp)
movq %r15, 0x58(%rsp)
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, %r15d
xorl %r12d, %r12d
testl %eax, %eax
setne %al
movl 0x1f70(%rbx), %ecx
testb $0x20, %cl
movl %ebp, 0x1c(%rsp)
jne 0x1ec61
testb $0x10, %cl
jne 0x1ec76
leaq 0x1ab0(%rbx), %rsi
movl 0x1b14(%rbx), %ecx
movl 0x1b20(%rbx), %ebp
jmp 0x1ec89
xorl %eax, %eax
jmp 0x1eeec
leaq 0x1af0(%rbx), %rsi
movl 0x1b1c(%rbx), %ecx
movl 0x1b28(%rbx), %ebp
jmp 0x1ec89
leaq 0x1ad0(%rbx), %rsi
movl 0x1b18(%rbx), %ecx
movl 0x1b24(%rbx), %ebp
movl %ecx, 0x54(%rsp)
movaps 0x30(%rsp), %xmm1
movaps 0x20(%rsp), %xmm0
movb %al, %r12b
cmpl $0x1, (%rsi)
jne 0x1ecbb
movl $0x0, 0x50(%rsp)
leaq 0x68(%r14), %rdi
addq $0x8, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
jmp 0x1ed00
movl 0x8(%rsi), %esi
movl %esi, 0x50(%rsp)
leaq 0x68(%r14), %r13
movss 0x1bf0(%rbx), %xmm2
movq %r13, %rdi
callq 0x6fee
movss 0x1bf0(%rbx), %xmm2
movss 0x1bec(%rbx), %xmm3
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movl 0x1b10(%rbx), %esi
movq %r13, %rdi
callq 0x6e96
xorl %eax, %eax
testl %r15d, %r15d
setne %al
movl 0x1f70(%rbx), %ecx
testb $0x10, %cl
leaq 0x1be0(,%rax,8), %rax
movl $0x1be4, %edx           # imm = 0x1BE4
cmoveq %rax, %rdx
movl (%rbx,%rdx), %r9d
movss 0x8(%rsp), %xmm3
movss 0x14(%rsp), %xmm0
movss 0x1c00(%rbx), %xmm1
movaps %xmm1, %xmm2
addss 0x10(%rsp), %xmm3
addss %xmm1, %xmm2
subss %xmm0, %xmm3
subss %xmm2, %xmm0
leaq 0x88(%rsp), %rsi
movss %xmm0, 0x8(%rsi)
subss 0x1bfc(%rbx), %xmm3
movaps %xmm3, 0x30(%rsp)
movss %xmm3, (%rsi)
addss 0xc(%rsp), %xmm1
movss %xmm1, 0x4(%rsi)
movss %xmm0, 0xc(%rsi)
leaq 0x1b30(%rbx), %r8
movss 0x1bb0(%rbx), %xmm2
addss %xmm2, %xmm3
leaq 0x98(%rsp), %rdx
movss %xmm3, (%rdx)
movss 0x1bb4(%rbx), %xmm3
addss %xmm3, %xmm1
movss %xmm1, 0x4(%rdx)
addss %xmm2, %xmm2
movaps %xmm0, %xmm1
subss %xmm2, %xmm1
movss %xmm1, 0x8(%rdx)
addss %xmm3, %xmm3
subss %xmm3, %xmm0
movss %xmm0, 0xc(%rdx)
leaq 0x68(%r14), %r15
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
movq %r15, %rdi
callq 0x1e149
movss 0x8(%rsp), %xmm0
movss 0x14(%rsp), %xmm2
addss 0x1bf4(%rbx), %xmm0
movaps %xmm0, %xmm3
movaps %xmm0, 0x20(%rsp)
movss 0x1bf8(%rbx), %xmm0
movss 0xc(%rsp), %xmm1
addss %xmm0, %xmm1
addss %xmm0, %xmm0
subss %xmm0, %xmm2
movaps %xmm2, 0x60(%rsp)
movq 0x168(%rbx), %r8
leaq 0x48(%rsp), %r13
movl 0x8(%r13), %edx
movaps %xmm3, %xmm0
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps %xmm2, %xmm1
shufps $0x0, %xmm2, %xmm1      # xmm1 = xmm1[0,0],xmm2[0,0]
movss 0x9543(%rip), %xmm2     # 0x28384
movq %r15, %rdi
movl 0x18(%rsp), %esi
movl %ebp, %ecx
callq 0x1e971
movq $0x0, (%r13)
movaps 0x60(%rsp), %xmm0
addss 0x20(%rsp), %xmm0
addss 0x1c04(%rbx), %xmm0
movss 0x1bf4(%rbx), %xmm4
addss %xmm4, %xmm0
movss 0x1bf8(%rbx), %xmm1
movss 0xc(%rsp), %xmm2
addss %xmm1, %xmm2
movaps 0x30(%rsp), %xmm3
subss %xmm4, %xmm3
subss %xmm0, %xmm3
movss 0x14(%rsp), %xmm4
addss %xmm1, %xmm1
subss %xmm1, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movaps %xmm3, %xmm1
movq 0x168(%rbx), %r9
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movq %r15, %rdi
movq 0x58(%rsp), %rsi
movl 0x1c(%rsp), %edx
movq %r13, %rcx
movl $0x11, %r8d
callq 0x13f12
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
movq %rbx, %rdi
movq %r14, %rsi
movaps 0x70(%rsp), %xmm0
movl %r12d, %edx
callq 0x1e1d0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd610(%rip), %rdi      # 0x2c515
leaq 0xa777(%rip), %rsi      # 0x29683
leaq 0xec4f(%rip), %rcx      # 0x2db62
movl $0x604b, %edx           # imm = 0x604B
callq 0x3100
leaq 0xc223(%rip), %rdi      # 0x2b147
leaq 0xa758(%rip), %rsi      # 0x29683
leaq 0xec30(%rip), %rcx      # 0x2db62
movl $0x604c, %edx           # imm = 0x604C
callq 0x3100
leaq 0xc380(%rip), %rdi      # 0x2b2c3
leaq 0xa739(%rip), %rsi      # 0x29683
leaq 0xec11(%rip), %rcx      # 0x2db62
movl $0x604d, %edx           # imm = 0x604D
callq 0x3100