// File: /workspace/github_c_makefile_star2_O0/space222[P]silo/./nuklear.h
// Function: nk_combo_begin_text
NK_API int
nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len,
    struct nk_vec2 size)
{
    const struct nk_input *in;
    struct nk_window *win;
    struct nk_style *style;

    enum nk_widget_layout_states s;
    int is_clicked = nk_false;
    struct nk_rect header;
    const struct nk_style_item *background;
    struct nk_text text;

    NK_ASSERT(ctx);
    NK_ASSERT(selected);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);
    if (!ctx || !ctx->current || !ctx->current->layout || !selected)
        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;
        text.text = style->combo.label_active;
    } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
        background = &style->combo.hover;
        text.text = style->combo.label_hover;
    } else {
        background = &style->combo.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);
    }
    {
        /* print currently selected text item */
        struct nk_rect label;
        struct nk_rect button;
        struct nk_rect content;

        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;

        /* draw selected label */
        text.padding = nk_vec2(0,0);
        label.x = header.x + style->combo.content_padding.x;
        label.y = header.y + style->combo.content_padding.y;
        label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.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, ctx->style.font);

        /* draw open/close button */
        nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
            &ctx->style.combo.button, sym, style->font);
    }
    return nk_combo_begin(ctx, win, size, is_clicked, header);
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movlpd %xmm0, 0x15c(%rsp)
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movl %edx, 0x144(%rsp)
movl $0x0, 0x120(%rsp)
cmpq $0x0, 0x150(%rsp)
je 0x3317f
jmp 0x3319e
leaq 0x15399(%rip), %rdi     # 0x4851f
leaq 0x12226(%rip), %rsi     # 0x453b3
movl $0x6010, %edx           # imm = 0x6010
leaq 0x16883(%rip), %rcx     # 0x49a1c
callq 0x20a0
cmpq $0x0, 0x148(%rsp)
je 0x331ab
jmp 0x331ca
leaq 0x168ba(%rip), %rdi     # 0x49a6c
leaq 0x121fa(%rip), %rsi     # 0x453b3
movl $0x6011, %edx           # imm = 0x6011
leaq 0x16857(%rip), %rcx     # 0x49a1c
callq 0x20a0
movq 0x150(%rsp), %rax
cmpq $0x0, 0x3fe8(%rax)
je 0x331de
jmp 0x331fd
leaq 0x13d14(%rip), %rdi     # 0x46ef9
leaq 0x121c7(%rip), %rsi     # 0x453b3
movl $0x6012, %edx           # imm = 0x6012
leaq 0x16824(%rip), %rcx     # 0x49a1c
callq 0x20a0
movq 0x150(%rsp), %rax
movq 0x3fe8(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x33218
jmp 0x33237
leaq 0x13e56(%rip), %rdi     # 0x47075
leaq 0x1218d(%rip), %rsi     # 0x453b3
movl $0x6013, %edx           # imm = 0x6013
leaq 0x167ea(%rip), %rcx     # 0x49a1c
callq 0x20a0
cmpq $0x0, 0x150(%rsp)
je 0x33278
movq 0x150(%rsp), %rax
cmpq $0x0, 0x3fe8(%rax)
je 0x33278
movq 0x150(%rsp), %rax
movq 0x3fe8(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x33278
cmpq $0x0, 0x148(%rsp)
jne 0x33288
movl $0x0, 0x164(%rsp)
jmp 0x338ac
movq 0x150(%rsp), %rax
movq 0x3fe8(%rax), %rax
movq %rax, 0x130(%rsp)
movq 0x150(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0x128(%rsp)
movq 0x150(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x1cd90
movl %eax, 0x124(%rsp)
cmpl $0x0, 0x124(%rsp)
jne 0x332eb
movl $0x0, 0x164(%rsp)
jmp 0x338ac
movq 0x130(%rsp), %rax
movq 0xa8(%rax), %rax
movl 0x4(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x33311
cmpl $0x2, 0x124(%rsp)
jne 0x3331a
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x33327
movq 0x150(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x138(%rsp)
movq 0x150(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
movups 0x110(%rsp), %xmm0
movaps %xmm0, 0xe0(%rsp)
movq 0x138(%rsp), %rsi
movsd 0xe0(%rsp), %xmm0
movsd 0xe8(%rsp), %xmm1
xorl %edx, %edx
callq 0x338c0
cmpl $0x0, %eax
je 0x33384
movl $0x1, 0x120(%rsp)
movq 0x150(%rsp), %rax
movl 0x1f70(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x333cb
movq 0x128(%rsp), %rax
addq $0x1948, %rax           # imm = 0x1948
addq $0x40, %rax
movq %rax, 0x108(%rsp)
movq 0x128(%rsp), %rax
movl 0x19b4(%rax), %eax
movl %eax, 0x104(%rsp)
jmp 0x3343f
movq 0x150(%rsp), %rax
movl 0x1f70(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x33412
movq 0x128(%rsp), %rax
addq $0x1948, %rax           # imm = 0x1948
addq $0x20, %rax
movq %rax, 0x108(%rsp)
movq 0x128(%rsp), %rax
movl 0x19b0(%rax), %eax
movl %eax, 0x104(%rsp)
jmp 0x3343d
movq 0x128(%rsp), %rax
addq $0x1948, %rax           # imm = 0x1948
movq %rax, 0x108(%rsp)
movq 0x128(%rsp), %rax
movl 0x19ac(%rax), %eax
movl %eax, 0x104(%rsp)
jmp 0x3343f
movq 0x108(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x334c4
xorl %ecx, %ecx
movl %ecx, %edi
movl %ecx, %esi
movl %ecx, %edx
callq 0x57b0
movl %eax, 0xdc(%rsp)
movl 0xdc(%rsp), %eax
movl %eax, 0x100(%rsp)
movq 0x130(%rsp), %rdi
addq $0x68, %rdi
movups 0x110(%rsp), %xmm0
movaps %xmm0, 0xc0(%rsp)
movq 0x108(%rsp), %rsi
addq $0x8, %rsi
movl $0xffffffff, 0xbc(%rsp) # imm = 0xFFFFFFFF
movsd 0xc0(%rsp), %xmm0
movsd 0xc8(%rsp), %xmm1
movl 0xbc(%rsp), %edx
callq 0xc3c0
jmp 0x3358b
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x100(%rsp)
movq 0x130(%rsp), %rdi
addq $0x68, %rdi
movups 0x110(%rsp), %xmm0
movaps %xmm0, 0xa0(%rsp)
movq 0x128(%rsp), %rax
movss 0x1a88(%rax), %xmm2
movq 0x108(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x9c(%rsp)
movsd 0xa0(%rsp), %xmm0
movsd 0xa8(%rsp), %xmm1
movl 0x9c(%rsp), %esi
callq 0xb130
movq 0x130(%rsp), %rdi
addq $0x68, %rdi
movups 0x110(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
movq 0x128(%rsp), %rax
movss 0x1a84(%rax), %xmm3
movss 0x1a88(%rax), %xmm2
movl 0x19a8(%rax), %eax
movl %eax, 0x7c(%rsp)
movsd 0x80(%rsp), %xmm0
movsd 0x88(%rsp), %xmm1
movl 0x7c(%rsp), %esi
callq 0xaf00
movq 0x150(%rsp), %rax
movl 0x1f70(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x335b5
movq 0x128(%rsp), %rax
movl 0x1a7c(%rax), %eax
movl %eax, 0x48(%rsp)
jmp 0x335e7
cmpl $0x0, 0x120(%rsp)
je 0x335d3
movq 0x128(%rsp), %rax
movl 0x1a80(%rax), %eax
movl %eax, 0x48(%rsp)
jmp 0x335e5
movq 0x128(%rsp), %rax
movl 0x1a78(%rax), %eax
movl %eax, 0x48(%rsp)
jmp 0x335e7
movss 0x11c(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a98(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x64(%rsp)
movss 0x110(%rsp), %xmm0
movss 0x118(%rsp), %xmm1
addss %xmm1, %xmm0
movss 0x11c(%rsp), %xmm1
subss %xmm1, %xmm0
movq 0x128(%rsp), %rax
movss 0x1a94(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x5c(%rsp)
movss 0x114(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a98(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x60(%rsp)
movss 0x64(%rsp), %xmm0
movss %xmm0, 0x68(%rsp)
movss 0x5c(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a48(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x4c(%rsp)
movss 0x60(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a4c(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x50(%rsp)
movss 0x64(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a48(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x54(%rsp)
movss 0x68(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a4c(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x58(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x41b0
movlpd %xmm0, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0xf8(%rsp)
movss 0x110(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a8c(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x114(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a90(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x70(%rsp)
movss 0x5c(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a8c(%rax), %xmm1
movss 0x1a9c(%rax), %xmm2
addss %xmm2, %xmm1
subss %xmm1, %xmm0
movss 0x6c(%rsp), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x11c(%rsp), %xmm0
movq 0x128(%rsp), %rax
movss 0x1a90(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x78(%rsp)
movq 0x130(%rsp), %rdi
addq $0x68, %rdi
movups 0x6c(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x148(%rsp), %rsi
movl 0x144(%rsp), %edx
movq 0x150(%rsp), %rax
movq 0x168(%rax), %r9
movsd 0x30(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
leaq 0xf8(%rsp), %rcx
movl $0x11, %r8d
callq 0x24820
movq 0x130(%rsp), %rdi
addq $0x68, %rdi
movq 0x150(%rsp), %r8
movl 0x1f70(%r8), %ecx
addq $0x1b30, %r8            # imm = 0x1B30
movl 0x48(%rsp), %r9d
movq 0x128(%rsp), %rax
movq (%rax), %rdx
movq %rsp, %rax
movq %rdx, (%rax)
leaq 0x5c(%rsp), %rsi
leaq 0x4c(%rsp), %rdx
callq 0x33a70
movq 0x150(%rsp), %rdi
movq 0x130(%rsp), %rsi
movq 0x15c(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x120(%rsp), %edx
movups 0x110(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
callq 0x33b70
movl %eax, 0x164(%rsp)
movl 0x164(%rsp), %eax
addq $0x168, %rsp            # imm = 0x168
retq
nopl (%rax,%rax)