// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_combo_separator
NK_API int
nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator,
    int separator, int selected, int count, int item_height, struct nk_vec2 size)
{
    int i;
    int max_height;
    struct nk_vec2 item_spacing;
    struct nk_vec2 window_padding;
    const char *current_item;
    const char *iter;
    int length = 0;

    NK_ASSERT(ctx);
    NK_ASSERT(items_separated_by_separator);
    if (!ctx || !items_separated_by_separator)
        return selected;

    /* calculate popup window */
    item_spacing = ctx->style.window.spacing;
    window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
    max_height = count * item_height + count * (int)item_spacing.y;
    max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
    size.y = NK_MIN(size.y, (float)max_height);

    /* find selected item */
    current_item = items_separated_by_separator;
    for (i = 0; i < count; ++i) {
        iter = current_item;
        while (*iter && *iter != separator) iter++;
        length = (int)(iter - current_item);
        if (i == selected) break;
        current_item = iter + 1;
    }

    if (nk_combo_begin_text(ctx, current_item, length, size)) {
        current_item = items_separated_by_separator;
        nk_layout_row_dynamic(ctx, (float)item_height, 1);
        for (i = 0; i < count; ++i) {
            iter = current_item;
            while (*iter && *iter != separator) iter++;
            length = (int)(iter - current_item);
            if (nk_combo_item_text(ctx, current_item, length, NK_TEXT_LEFT))
                selected = i;
            current_item = current_item + length + 1;
        }
        nk_combo_end(ctx);
    }
    return selected;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movaps %xmm0, 0x10(%rsp)
movl %r9d, %r13d
movl %r8d, 0xc(%rsp)
movl %ecx, %ebx
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %rbp
testq %rdi, %rdi
jne 0x541ab
movq 0x33e6a(%rip), %r14     # 0x87ff0
movq (%r14), %rdi
leaq 0x1dbfc(%rip), %rsi     # 0x71d8c
leaq 0x1dc13(%rip), %rdx     # 0x71daa
movl $0x74a8, %ecx           # imm = 0x74A8
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
testq %r12, %r12
jne 0x541dc
movq 0x33e39(%rip), %r14     # 0x87ff0
movq (%r14), %rdi
leaq 0x1dbcb(%rip), %rsi     # 0x71d8c
leaq 0x1dbe2(%rip), %rdx     # 0x71daa
movl $0x74a9, %ecx           # imm = 0x74A9
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
testq %r12, %r12
sete %al
testq %rbp, %rbp
sete %cl
orb %al, %cl
jne 0x54320
leaq 0x168(%rbp), %rdi
movq 0x4780(%rbp), %rax
movq 0xa8(%rax), %rax
movl (%rax), %esi
cvttss2si 0x24b8(%rbp), %r14d
callq 0x3fd90
leal (%r14,%r13), %eax
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvttss2si %xmm0, %ecx
movl 0xc(%rsp), %edx
imull %edx, %eax
addl %r14d, %ecx
leal (%rax,%rcx,2), %eax
movaps 0x10(%rsp), %xmm2
movaps %xmm2, %xmm0
shufps $0x55, %xmm2, %xmm0     # xmm0 = xmm0[1,1],xmm2[1,1]
cvtsi2ss %eax, %xmm1
minss %xmm1, %xmm0
movlhps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0]
shufps $0xe2, %xmm2, %xmm0     # xmm0 = xmm0[2,0],xmm2[2,3]
testl %edx, %edx
jle 0x5427c
xorl %eax, %eax
movq %r12, %rcx
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movsbl (%rsi), %edi
incq %rsi
incl %edx
testl %edi, %edi
je 0x5426b
cmpl %r15d, %edi
jne 0x5425a
cmpl %ebx, %eax
je 0x54283
incl %eax
movq %rsi, %rcx
cmpl 0xc(%rsp), %eax
jne 0x54255
jmp 0x54286
xorl %edx, %edx
movq %r12, %rsi
jmp 0x54286
movq %rcx, %rsi
movq %rbp, %rdi
callq 0x12e80
testl %eax, %eax
je 0x54320
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
xorl %r13d, %r13d
movq %rbp, 0x10(%rsp)
movq %rbp, %rdi
xorl %esi, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x41057
cmpl $0x0, 0xc(%rsp)
jle 0x54316
movabsq $0x100000000, %r14      # imm = 0x100000000
xorl %edx, %edx
movabsq $-0x100000000, %rbp     # imm = 0xFFFFFFFF00000000
addq %r14, %rbp
movsbl (%r12,%rdx), %eax
incq %rdx
testl %eax, %eax
je 0x542e8
cmpl %r15d, %eax
jne 0x542d4
decl %edx
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movl $0x11, %ecx
callq 0x13860
testl %eax, %eax
cmovnel %r13d, %ebx
sarq $0x20, %rbp
addq %rbp, %r12
incq %r12
incl %r13d
cmpl 0xc(%rsp), %r13d
jne 0x542c8
movq 0x10(%rsp), %rdi
callq 0x12860
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq