// File: /workspace/github_c_makefile_star2_O3/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, %xmm4
movl %edx, %ebp
movaps %xmm0, 0x20(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movq 0x4780(%rdi), %rax
testq %rax, %rax
jne 0x5184b
movq 0x357e3(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x1f585(%rip), %rsi     # 0x70d9c
leaq 0x1f59c(%rip), %rdx     # 0x70dba
movl $0x71d2, %ecx           # imm = 0x71D2
xorl %eax, %eax
movaps %xmm1, 0x10(%rsp)
movaps %xmm4, (%rsp)
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps (%rsp), %xmm4
movaps 0x10(%rsp), %xmm1
movq 0x4780(%r14), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x518a8
movq 0x35794(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x1f535(%rip), %rsi     # 0x70d9c
leaq 0x1f54c(%rip), %rdx     # 0x70dba
xorl %r15d, %r15d
movl $0x71d3, %ecx           # imm = 0x71D3
xorl %eax, %eax
movaps %xmm1, 0x10(%rsp)
movaps %xmm4, (%rsp)
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movaps (%rsp), %xmm4
movaps 0x10(%rsp), %xmm1
movq 0x4780(%r14), %rax
testq %rax, %rax
je 0x51972
cmpq $0x0, 0xa8(%rax)
je 0x5196f
movq 0x120(%rbx), %rax
movaps %xmm1, %xmm0
addps %xmm4, %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 0x518ff
cmpl %r12d, 0x158(%rbx)
jne 0x518ff
cmpl $0x20, 0x128(%rbx)
sete %cl
jmp 0x51901
xorl %ecx, %ecx
testq %rax, %rax
sete %dl
testl %ebp, %ebp
sete %sil
testb %dl, %sil
jne 0x51972
orb %cl, %dl
testb $0x1, %dl
je 0x51972
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 0x5193b
movaps %xmm4, %xmm3
movaps %xmm1, %xmm2
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
movaps 0x20(%rsp), %xmm1
movl $0x20, %edx
callq 0x3df48
testl %eax, %eax
je 0x51972
movl $0x20, 0x128(%rbx)
movl %r12d, 0x158(%rbx)
movl $0x1, %r15d
jmp 0x51972
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq