// File: /workspace/github_c_makefile_star2_O3/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_contextual_end
NK_API void
nk_contextual_end(struct nk_context *ctx)
{
    struct nk_window *popup;
    struct nk_panel *panel;
    NK_ASSERT(ctx);
    NK_ASSERT(ctx->current);
    if (!ctx || !ctx->current) return;

    popup = ctx->current;
    panel = popup->layout;
    NK_ASSERT(popup->parent);
    NK_ASSERT((int)panel->type & (int)NK_PANEL_SET_POPUP);
    if (panel->flags & NK_WINDOW_DYNAMIC) {
        /* Close behavior
        This is a bit of a hack solution since we do not know before we end our popup
        how big it will be. We therefore do not directly know when a
        click outside the non-blocking popup must close it at that direct frame.
        Instead it will be closed in the next frame.*/
        struct nk_rect body = {0,0,0,0};
        if (panel->at_y < (panel->bounds.y + panel->bounds.h)) {
            struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type);
            body = panel->bounds;
            body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height);
            body.h = (panel->bounds.y + panel->bounds.h) - body.y;
        }
        {int pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
        int in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
        if (pressed && in_body)
            popup->flags |= NK_WINDOW_HIDDEN;
        }
    }
    if (popup->flags & NK_WINDOW_HIDDEN)
        popup->seq = 0;
    nk_popup_end(ctx);
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x3f30c
movq 0x47d09(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x31aab(%rip), %rsi     # 0x70d9c
leaq 0x31ac2(%rip), %rdx     # 0x70dba
movl $0x536c, %ecx           # imm = 0x536C
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
testq %r14, %r14
jne 0x3f354
movq 0x47cd1(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x31a73(%rip), %rsi     # 0x70d9c
leaq 0x31a8a(%rip), %rdx     # 0x70dba
movl $0x536d, %ecx           # imm = 0x536D
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %r14
testq %r14, %r14
je 0x3f4d1
movq 0xa8(%r14), %r15
cmpq $0x0, 0x1d8(%r14)
jne 0x3f393
movq 0x47c84(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x31a25(%rip), %rsi     # 0x70d9c
leaq 0x31a3c(%rip), %rdx     # 0x70dba
movl $0x5372, %ecx           # imm = 0x5372
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
testb $-0xc, (%r15)
jne 0x3f3c7
movq 0x47c50(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x319f1(%rip), %rsi     # 0x70d9c
leaq 0x31a08(%rip), %rdx     # 0x70dba
movl $0x5373, %ecx           # imm = 0x5373
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
testb $0x8, 0x5(%r15)
jne 0x3f3ef
testb $0x20, 0x49(%r14)
je 0x3f3dc
movl $0x0, (%r14)
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x13280
movss 0xc(%r15), %xmm0
movss 0x2c(%r15), %xmm3
addss 0x14(%r15), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm3, %xmm0
xorps %xmm2, %xmm2
jbe 0x3f461
leaq 0x168(%rbx), %rdi
movl (%r15), %esi
movaps %xmm0, 0x10(%rsp)
movss %xmm3, 0xc(%rsp)
callq 0x3f4dd
movsd 0x8(%r15), %xmm1
movss 0xc(%rsp), %xmm2
addss 0x34(%r15), %xmm2
addss 0x3c(%r15), %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss %xmm2, %xmm0
addss 0x78(%r15), %xmm0
movsd 0x10(%r15), %xmm2
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps 0x10(%rsp), %xmm3
subss %xmm0, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
cmpl $0x0, 0x104(%rbx)
je 0x3f475
movb $0x1, %al
cmpl $0x0, 0x108(%rbx)
jne 0x3f477
xorl %eax, %eax
movss 0x144(%rbx), %xmm0
ucomiss %xmm1, %xmm0
jb 0x3f3ce
movaps %xmm1, %xmm3
addss %xmm2, %xmm3
ucomiss %xmm0, %xmm3
jbe 0x3f3ce
movaps %xmm1, %xmm3
shufps $0x55, %xmm1, %xmm3     # xmm3 = xmm3[1,1],xmm1[1,1]
movss 0x148(%rbx), %xmm0
ucomiss %xmm3, %xmm0
jb 0x3f3ce
addps %xmm2, %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm0, %xmm1
seta %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x3f3ce
orb $0x20, 0x49(%r14)
jmp 0x3f3ce
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq