// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movaps %xmm0, 0x80(%rsp)
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x5114a
movq 0x35ecb(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x1fc6d(%rip), %rsi     # 0x70d9c
leaq 0x1fc84(%rip), %rdx     # 0x70dba
movl $0x71f7, %ecx           # imm = 0x71F7
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
testq %r14, %r14
jne 0x5117b
movq 0x35e9a(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x1fc3c(%rip), %rsi     # 0x70d9c
leaq 0x1fc53(%rip), %rdx     # 0x70dba
movl $0x71f8, %ecx           # imm = 0x71F8
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %r15
testq %r15, %r15
jne 0x511ba
movq 0x35e62(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x1fc04(%rip), %rsi     # 0x70d9c
leaq 0x1fc1b(%rip), %rdx     # 0x70dba
movl $0x71f9, %ecx           # imm = 0x71F9
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %r15
cmpq $0x0, 0xa8(%r15)
jne 0x51202
movq 0x35e25(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x1fbc7(%rip), %rsi     # 0x70d9c
leaq 0x1fbde(%rip), %rdx     # 0x70dba
xorl %ebp, %ebp
movl $0x71fa, %ecx           # imm = 0x71FA
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %r15
testq %r15, %r15
je 0x515f8
xorl %ebp, %ebp
testq %r14, %r14
je 0x515f8
cmpq $0x0, 0xa8(%r15)
je 0x515f8
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
testl %eax, %eax
je 0x515f8
movl %r12d, 0x14(%rsp)
movq 0xa8(%r15), %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 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x50(%rsp)
xorl %edx, %edx
callq 0x5160c
movl %eax, %r13d
testl %eax, %eax
setne 0x10(%rsp)
movl 0x2598(%rbx), %eax
movl %eax, %ecx
andl $0x10, %ecx
movl $0x2018, %edx           # imm = 0x2018
movl $0x2040, %esi           # imm = 0x2040
cmoveq %rdx, %rsi
shrl $0x2, %ecx
addq $0x2094, %rcx           # imm = 0x2094
testb $0x20, %al
movl $0x2068, %r12d          # imm = 0x2068
cmoveq %rsi, %r12
movl $0x209c, %eax           # imm = 0x209C
cmoveq %rcx, %rax
leaq (%rbx,%r12), %rbp
movl (%rbx,%rax), %edi
movss 0x21b4(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
callq 0x13e60
movl %eax, 0x3c(%rsp)
movl (%rbx,%r12), %eax
testl %eax, %eax
je 0x513ba
cmpl $0x2, %eax
je 0x51355
cmpl $0x1, %eax
jne 0x51449
addq $0x8, %rbp
movss 0x1c5ac(%rip), %xmm0    # 0x6d8a8
movss 0xc(%rsp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x1c58c(%rip), %xmm1    # 0x6d8a4
movl $0x0, 0x38(%rsp)
leaq 0x68(%r15), %rdi
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movq %rbp, %rsi
callq 0x134d0
jmp 0x51449
addq $0x8, %rbp
movss 0x1c547(%rip), %xmm0    # 0x6d8a8
movss 0xc(%rsp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x1c527(%rip), %xmm1    # 0x6d8a4
movl $0x0, 0x38(%rsp)
leaq 0x68(%r15), %rdi
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movq %rbp, %rsi
callq 0x13fe0
jmp 0x51449
movl 0x8(%rbp), %edi
movl %edi, 0x38(%rsp)
leaq 0x68(%r15), %rbp
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x2c(%rsp)
movss 0xc(%rsp), %xmm0
callq 0x13e60
movq %rbp, %rdi
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movss 0x2c(%rsp), %xmm2
movl %eax, %esi
callq 0x12de0
movss 0x2198(%rbx), %xmm0
movss %xmm0, 0x50(%rsp)
movss 0x2194(%rbx), %xmm0
movss %xmm0, 0x40(%rsp)
movss 0x21b4(%rbx), %xmm0
movl 0x2090(%rbx), %edi
callq 0x13e60
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movq %rbp, %rdi
movss 0x50(%rsp), %xmm2
movss 0x40(%rsp), %xmm3
movl %eax, %esi
callq 0x12060
xorl %ebp, %ebp
movb 0x10(%rsp), %al
movb %al, %bpl
xorl %eax, %eax
testl %r13d, %r13d
setne %al
testb $0x10, 0x2598(%rbx)
leaq 0x2188(,%rax,8), %rax
movl $0x218c, %ecx           # imm = 0x218C
cmoveq %rax, %rcx
movl (%rbx,%rcx), %r13d
movss 0x24(%rsp), %xmm1
movss 0x21a8(%rbx), %xmm2
movsd 0x18(%rsp), %xmm0
movaps %xmm0, %xmm4
shufps $0x55, %xmm0, %xmm4     # xmm4 = xmm4[1,1],xmm0[1,1]
addss %xmm2, %xmm4
addss %xmm2, %xmm2
movaps %xmm1, %xmm5
subss %xmm2, %xmm5
movss %xmm5, 0x68(%rsp)
movss 0x20(%rsp), %xmm3
movaps %xmm0, %xmm2
addss %xmm3, %xmm2
subss %xmm1, %xmm2
subss 0x21a4(%rbx), %xmm2
movss %xmm5, 0x6c(%rsp)
movsd 0x2150(%rbx), %xmm6
movaps %xmm6, %xmm7
shufps $0x55, %xmm6, %xmm7     # xmm7 = xmm7[1,1],xmm6[1,1]
unpcklps %xmm5, %xmm5            # xmm5 = xmm5[0,0,1,1]
movaps %xmm2, %xmm8
addss %xmm6, %xmm8
addps %xmm6, %xmm6
subps %xmm6, %xmm5
movlps %xmm5, 0x78(%rsp)
movq $0x0, 0x30(%rsp)
movss %xmm2, 0x60(%rsp)
movss %xmm4, 0x64(%rsp)
movss %xmm8, 0x70(%rsp)
addss %xmm7, %xmm4
movss %xmm4, 0x74(%rsp)
movsd 0x219c(%rbx), %xmm4
movaps %xmm4, %xmm5
shufps $0x55, %xmm4, %xmm5     # xmm5 = xmm5[1,1],xmm4[1,1]
addps %xmm4, %xmm0
addss %xmm5, %xmm5
subss %xmm5, %xmm1
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
testl %r13d, %r13d
je 0x515a7
movl %ebp, 0x10(%rsp)
leaq 0x20b0(%rbx), %rbp
addss 0x21ac(%rbx), %xmm4
subss %xmm4, %xmm2
subss %xmm0, %xmm2
leaq 0x68(%r15), %r12
movq 0x168(%rbx), %r9
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
leaq 0x30(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rsi
movl 0x14(%rsp), %edx
movl $0x11, %r8d
callq 0x451c6
movl 0x2598(%rbx), %ecx
movq 0x168(%rbx), %rax
movq %rax, (%rsp)
leaq 0x60(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %r8
movl 0x10(%rsp), %ebp
movl %r13d, %r9d
callq 0x5173c
jmp 0x515d5
addss %xmm4, %xmm4
subss %xmm4, %xmm3
leaq 0x68(%r15), %rdi
movq 0x168(%rbx), %r9
movss %xmm3, %xmm1            # xmm1 = xmm3[0],xmm1[1,2,3]
leaq 0x30(%rsp), %rcx
movq %r14, %rsi
movl 0x14(%rsp), %edx
movl $0x11, %r8d
callq 0x451c6
movsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movq %rbx, %rdi
movq %r15, %rsi
movaps 0x80(%rsp), %xmm0
movl %ebp, %edx
callq 0x517de
movl %eax, %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq