// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_combo_begin_text
NK_API nk_bool
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_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;
        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;
    }

    text.text = nk_rgb_factor(text.text, style->combo.color_factor);

    switch(background->type) {
        case NK_STYLE_ITEM_IMAGE:
            text.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:
            text.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:
            text.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;
    }
    {
        /* print currently selected text item */
        struct nk_rect label;
        struct nk_rect button;
        struct nk_rect content;
        int draw_button_symbol;

        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;

        /* represents whether or not the combo's button symbol should be drawn */
        draw_button_symbol = sym != NK_SYMBOL_NONE;

        /* 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.h = header.h - 2 * style->combo.content_padding.y;
        if (draw_button_symbol)
            label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;
        else
            label.w = header.w - 2 * style->combo.content_padding.x;
        nk_widget_text(&win->buffer, label, selected, len, &text,
            NK_TEXT_LEFT, ctx->style.font);

        /* draw open/close button */
        if (draw_button_symbol)
            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 $0x128, %rsp            # imm = 0x128
movlpd %xmm0, 0x11c(%rsp)
movq %rdi, 0x110(%rsp)
movq %rsi, 0x108(%rsp)
movl %edx, 0x104(%rsp)
movl $0x0, 0xe0(%rsp)
cmpq $0x0, 0x110(%rsp)
jne 0x77760
movq 0x4d8bc(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x39c62(%rip), %rsi     # 0xb13a0
leaq 0x39c79(%rip), %rdx     # 0xb13be
movl $0x71f7, %ecx           # imm = 0x71F7
movb $0x0, %al
callq 0x13ec0
movq 0x4d898(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x77762
jmp 0x77764
cmpq $0x0, 0x108(%rsp)
jne 0x777a2
movq 0x4d87a(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x39c20(%rip), %rsi     # 0xb13a0
leaq 0x39c37(%rip), %rdx     # 0xb13be
movl $0x71f8, %ecx           # imm = 0x71F8
movb $0x0, %al
callq 0x13ec0
movq 0x4d856(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x777a4
jmp 0x777a6
movq 0x110(%rsp), %rax
cmpq $0x0, 0x4780(%rax)
jne 0x777eb
movq 0x4d831(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x39bd7(%rip), %rsi     # 0xb13a0
leaq 0x39bee(%rip), %rdx     # 0xb13be
movl $0x71f9, %ecx           # imm = 0x71F9
movb $0x0, %al
callq 0x13ec0
movq 0x4d80d(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x777ed
jmp 0x777ef
movq 0x110(%rsp), %rax
movq 0x4780(%rax), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x7783b
movq 0x4d7e1(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
leaq 0x39b87(%rip), %rsi     # 0xb13a0
leaq 0x39b9e(%rip), %rdx     # 0xb13be
movl $0x71fa, %ecx           # imm = 0x71FA
movb $0x0, %al
callq 0x13ec0
movq 0x4d7bd(%rip), %rax     # 0xc4ff0
movq (%rax), %rdi
callq 0x149a0
jmp 0x7783d
cmpq $0x0, 0x110(%rsp)
je 0x7787e
movq 0x110(%rsp), %rax
cmpq $0x0, 0x4780(%rax)
je 0x7787e
movq 0x110(%rsp), %rax
movq 0x4780(%rax), %rax
cmpq $0x0, 0xa8(%rax)
je 0x7787e
cmpq $0x0, 0x108(%rsp)
jne 0x7788e
movl $0x0, 0x124(%rsp)
jmp 0x7804f
movq 0x110(%rsp), %rax
movq 0x4780(%rax), %rax
movq %rax, 0xf0(%rsp)
movq 0x110(%rsp), %rax
addq $0x168, %rax            # imm = 0x168
movq %rax, 0xe8(%rsp)
movq 0x110(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x139c0
movl %eax, 0xe4(%rsp)
cmpl $0x0, 0xe4(%rsp)
jne 0x778f1
movl $0x0, 0x124(%rsp)
jmp 0x7804f
movq 0xf0(%rsp), %rax
movq 0xa8(%rax), %rax
movl 0x4(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x77921
cmpl $0x3, 0xe4(%rsp)
je 0x77921
cmpl $0x2, 0xe4(%rsp)
jne 0x7792a
xorl %eax, %eax
movq %rax, 0x50(%rsp)
jmp 0x77937
movq 0x110(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x110(%rsp), %rdi
addq $0x2598, %rdi           # imm = 0x2598
movq 0xf8(%rsp), %rsi
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
xorl %edx, %edx
callq 0x78060
cmpl $0x0, %eax
je 0x77984
movl $0x1, 0xe0(%rsp)
movq 0x110(%rsp), %rax
movl 0x2598(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x779cb
movq 0xe8(%rsp), %rax
addq $0x1eb0, %rax           # imm = 0x1EB0
addq $0x50, %rax
movq %rax, 0xc8(%rsp)
movq 0xe8(%rsp), %rax
movl 0x1f34(%rax), %eax
movl %eax, 0xc4(%rsp)
jmp 0x77a3f
movq 0x110(%rsp), %rax
movl 0x2598(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x77a12
movq 0xe8(%rsp), %rax
addq $0x1eb0, %rax           # imm = 0x1EB0
addq $0x28, %rax
movq %rax, 0xc8(%rsp)
movq 0xe8(%rsp), %rax
movl 0x1f30(%rax), %eax
movl %eax, 0xc4(%rsp)
jmp 0x77a3d
movq 0xe8(%rsp), %rax
addq $0x1eb0, %rax           # imm = 0x1EB0
movq %rax, 0xc8(%rsp)
movq 0xe8(%rsp), %rax
movl 0x1f2c(%rax), %eax
movl %eax, 0xc4(%rsp)
jmp 0x77a3f
movq 0xe8(%rsp), %rax
movss 0x204c(%rax), %xmm0
movl 0xc4(%rsp), %edi
callq 0x15100
movl %eax, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
movl %eax, 0xc4(%rsp)
movq 0xc8(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x4c(%rsp)
testl %eax, %eax
je 0x77bcb
jmp 0x77a88
movl 0x4c(%rsp), %eax
subl $0x1, %eax
je 0x77aa5
jmp 0x77a93
movl 0x4c(%rsp), %eax
subl $0x2, %eax
je 0x77b38
jmp 0x77cca
xorl %ecx, %ecx
movl %ecx, %edi
movl %ecx, %esi
movl %ecx, %edx
callq 0x14680
movl %eax, 0xb0(%rsp)
movl 0xb0(%rsp), %eax
movl %eax, 0xc0(%rsp)
movq 0xf0(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x38(%rsp)
movq 0xc8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq 0xe8(%rsp), %rax
movss 0x204c(%rax), %xmm0
movl 0x397b1(%rip), %edi     # 0xb12b0
callq 0x15100
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %eax, 0xac(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movl 0xac(%rsp), %edx
callq 0x14690
jmp 0x77cca
xorl %ecx, %ecx
movl %ecx, %edi
movl %ecx, %esi
movl %ecx, %edx
callq 0x14680
movl %eax, 0xa8(%rsp)
movl 0xa8(%rsp), %eax
movl %eax, 0xc0(%rsp)
movq 0xf0(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x28(%rsp)
movq 0xc8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x30(%rsp)
movq 0xe8(%rsp), %rax
movss 0x204c(%rax), %xmm0
movl 0x3971e(%rip), %edi     # 0xb12b0
callq 0x15100
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movl %eax, 0xa4(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movl 0xa4(%rsp), %edx
callq 0x152a0
jmp 0x77cca
movq 0xc8(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc0(%rsp)
movq 0xf0(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x8(%rsp)
movq 0xe8(%rsp), %rcx
movq 0xc8(%rsp), %rax
movss 0x2030(%rcx), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0x204c(%rcx), %xmm0
movl 0x8(%rax), %edi
callq 0x15100
movq 0x8(%rsp), %rdi
movss 0x14(%rsp), %xmm2
movl %eax, 0xa0(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movl 0xa0(%rsp), %esi
callq 0x13f10
movq 0xf0(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x18(%rsp)
movq 0xe8(%rsp), %rax
movss 0x2030(%rax), %xmm0
movss %xmm0, 0x20(%rsp)
movss 0x202c(%rax), %xmm0
movss %xmm0, 0x24(%rsp)
movss 0x204c(%rax), %xmm0
movl 0x1f28(%rax), %edi
callq 0x15100
movq 0x18(%rsp), %rdi
movss 0x20(%rsp), %xmm2
movss 0x24(%rsp), %xmm3
movl %eax, 0x9c(%rsp)
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movl 0x9c(%rsp), %esi
callq 0x13070
movq 0x110(%rsp), %rax
movl 0x2598(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x77cf4
movq 0xe8(%rsp), %rax
movl 0x2024(%rax), %eax
movl %eax, 0x64(%rsp)
jmp 0x77d26
cmpl $0x0, 0xe0(%rsp)
je 0x77d12
movq 0xe8(%rsp), %rax
movl 0x2028(%rax), %eax
movl %eax, 0x64(%rsp)
jmp 0x77d24
movq 0xe8(%rsp), %rax
movl 0x2020(%rax), %eax
movl %eax, 0x64(%rsp)
jmp 0x77d26
movl 0x64(%rsp), %eax
testl %eax, %eax
setne %al
movzbl %al, %eax
movl %eax, 0x68(%rsp)
movss 0xdc(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x2040(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x84(%rsp)
movss 0xd0(%rsp), %xmm0
movss 0xd8(%rsp), %xmm1
addss %xmm1, %xmm0
movss 0xdc(%rsp), %xmm1
subss %xmm1, %xmm0
movq 0xe8(%rsp), %rax
movss 0x203c(%rax), %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x7c(%rsp)
movss 0xd4(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x2040(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x80(%rsp)
movss 0x84(%rsp), %xmm0
movss %xmm0, 0x88(%rsp)
movss 0x7c(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x1fe8(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x6c(%rsp)
movss 0x80(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x1fec(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, 0x70(%rsp)
movss 0x84(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x1fe8(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x74(%rsp)
movss 0x88(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x1fec(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x78(%rsp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x13460
movlpd %xmm0, 0x5c(%rsp)
movq 0x5c(%rsp), %rax
movq %rax, 0xb8(%rsp)
movss 0xd0(%rsp), %xmm0
movq 0xe8(%rsp), %rax
addss 0x2034(%rax), %xmm0
movss %xmm0, 0x8c(%rsp)
movss 0xd4(%rsp), %xmm0
movq 0xe8(%rsp), %rax
addss 0x2038(%rax), %xmm0
movss %xmm0, 0x90(%rsp)
movss 0xdc(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x2038(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x98(%rsp)
cmpl $0x0, 0x68(%rsp)
je 0x77f37
movss 0x7c(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x2034(%rax), %xmm1
movq 0xe8(%rsp), %rax
addss 0x2044(%rax), %xmm1
subss %xmm1, %xmm0
subss 0x8c(%rsp), %xmm0
movss %xmm0, 0x94(%rsp)
jmp 0x77f61
movss 0xd8(%rsp), %xmm0
movq 0xe8(%rsp), %rax
movss 0x2034(%rax), %xmm1
addss %xmm1, %xmm1
subss %xmm1, %xmm0
movss %xmm0, 0x94(%rsp)
movq 0xf0(%rsp), %rdi
addq $0x68, %rdi
movq 0x108(%rsp), %rsi
movl 0x104(%rsp), %edx
movq 0x110(%rsp), %rax
movq 0x168(%rax), %r9
movsd 0x8c(%rsp), %xmm0
movsd 0x94(%rsp), %xmm1
leaq 0xb8(%rsp), %rcx
movl $0x11, %r8d
callq 0x66ac0
cmpl $0x0, 0x68(%rsp)
je 0x78011
movq 0xf0(%rsp), %rdi
addq $0x68, %rdi
movq 0x110(%rsp), %rax
movl 0x2598(%rax), %ecx
movq 0x110(%rsp), %r8
addq $0x168, %r8             # imm = 0x168
addq $0x1eb0, %r8            # imm = 0x1EB0
addq $0x98, %r8
movl 0x64(%rsp), %r9d
movq 0xe8(%rsp), %rax
movq (%rax), %rax
leaq 0x7c(%rsp), %rsi
leaq 0x6c(%rsp), %rdx
movq %rax, (%rsp)
callq 0x781d0
movq 0x110(%rsp), %rdi
movq 0xf0(%rsp), %rsi
movl 0xe0(%rsp), %edx
movsd 0x11c(%rsp), %xmm0
movsd 0xd0(%rsp), %xmm1
movsd 0xd8(%rsp), %xmm2
callq 0x782e0
movl %eax, 0x124(%rsp)
movl 0x124(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
retq
nop