// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_combo_begin
NK_INTERN nk_bool
nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
    struct nk_vec2 size, nk_bool is_clicked, struct nk_rect header)
{
    struct nk_window *popup;
    int is_open = 0;
    int is_active = 0;
    struct nk_rect body;
    nk_hash hash;

    NK_ASSERT(ctx);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);
    if (!ctx || !ctx->current || !ctx->current->layout)
        return 0;

    popup = win->popup.win;
    body.x = header.x;
    body.w = size.x;
    body.y = header.y + header.h-ctx->style.window.combo_border;
    body.h = size.y;

    hash = win->popup.combo_count++;
    is_open = (popup) ? nk_true:nk_false;
    is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_COMBO);
    if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
        (!is_open && !is_active && !is_clicked)) return 0;
    if (!nk_nonblock_begin(ctx, 0, body,
        (is_clicked && is_open)?nk_rect(0,0,0,0):header, NK_PANEL_COMBO)) return 0;

    win->popup.type = NK_PANEL_COMBO;
    win->popup.name = hash;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movaps %xmm2, 0x10(%rsp)
movl %edx, %ebp
movaps %xmm0, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x4780(%rdi)
jne 0x523ee
movq 0x35c2f(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x1f9c1(%rip), %rsi     # 0x71d8c
leaq 0x1f9d8(%rip), %rdx     # 0x71daa
movl $0x71d2, %ecx           # imm = 0x71D2
xorl %eax, %eax
movaps %xmm1, (%rsp)
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps (%rsp), %xmm1
movq 0x4780(%r14), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x52433
movq 0x35bea(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x1f97c(%rip), %rsi     # 0x71d8c
leaq 0x1f993(%rip), %rdx     # 0x71daa
movl $0x71d3, %ecx           # imm = 0x71D3
xorl %eax, %eax
movaps %xmm1, (%rsp)
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps (%rsp), %xmm1
movq 0x4780(%r14), %rax
xorl %r15d, %r15d
testq %rax, %rax
je 0x5250f
cmpq $0x0, 0xa8(%rax)
je 0x5250f
movq 0x120(%rbx), %rax
movaps %xmm1, %xmm0
addps 0x10(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
subss 0x2494(%r14), %xmm0
movl 0x160(%rbx), %r12d
leal 0x1(%r12), %ecx
movl %ecx, 0x160(%rbx)
xorl %r15d, %r15d
testq %rax, %rax
je 0x5249f
cmpl %r12d, 0x158(%rbx)
jne 0x5249f
cmpl $0x20, 0x128(%rbx)
sete %cl
jmp 0x524a1
xorl %ecx, %ecx
testq %rax, %rax
sete %dl
testl %ebp, %ebp
sete %sil
testb %dl, %sil
jne 0x5250f
orb %cl, %dl
testb $0x1, %dl
je 0x5250f
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
testl %ebp, %ebp
setne %cl
testq %rax, %rax
setne %al
xorps %xmm3, %xmm3
xorps %xmm2, %xmm2
testb %al, %cl
jne 0x524dd
movaps 0x10(%rsp), %xmm3
movaps %xmm1, %xmm2
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
movaps 0x20(%rsp), %xmm1
movl $0x20, %edx
callq 0x3e7a8
testl %eax, %eax
je 0x5250f
movl $0x20, 0x128(%rbx)
movl %r12d, 0x158(%rbx)
movl $0x1, %r15d
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq