// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_nonblock_begin
NK_LIB nk_bool
nk_nonblock_begin(struct nk_context *ctx,
    nk_flags flags, struct nk_rect body, struct nk_rect header,
    enum nk_panel_type panel_type)
{
    struct nk_window *popup;
    struct nk_window *win;
    struct nk_panel *panel;
    int is_active = nk_true;

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

    /* popups cannot have popups */
    win = ctx->current;
    panel = win->layout;
    NK_ASSERT(!((int)panel->type & (int)NK_PANEL_SET_POPUP));
    (void)panel;
    popup = win->popup.win;
    if (!popup) {
        /* create window for nonblocking popup */
        popup = (struct nk_window*)nk_create_window(ctx);
        popup->parent = win;
        win->popup.win = popup;
        win->popup.type = panel_type;
        nk_command_buffer_init(&popup->buffer, &ctx->memory, NK_CLIPPING_ON);
    } else {
        /* close the popup if user pressed outside or in the header */
        int pressed, in_body, in_header;
#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
        pressed = nk_input_is_mouse_released(&ctx->input, NK_BUTTON_LEFT);
#else
        pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
#endif
        in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
        in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header);
        if (pressed && (!in_body || in_header))
            is_active = nk_false;
    }
    win->popup.header = header;

    if (!is_active) {
        /* remove read only mode from all parent panels */
        struct nk_panel *root = win->layout;
        while (root) {
            root->flags |= NK_WINDOW_REMOVE_ROM;
            root = root->parent;
        }
        return is_active;
    }
    popup->bounds = body;
    popup->parent = win;
    popup->layout = (struct nk_panel*)nk_create_panel(ctx);
    popup->flags = flags;
    popup->flags |= NK_WINDOW_BORDER;
    popup->flags |= NK_WINDOW_DYNAMIC;
    popup->seq = ctx->seq;
    win->popup.active = 1;
    NK_ASSERT(popup->layout);

    nk_start_popup(ctx, win);
    popup->buffer = win->buffer;
    nk_push_scissor(&popup->buffer, nk_null_rect);
    ctx->current = popup;

    nk_panel_begin(ctx, 0, panel_type);
    win->buffer = popup->buffer;
    popup->layout->parent = win->layout;
    popup->layout->offset_x = &popup->scrollbar.x;
    popup->layout->offset_y = &popup->scrollbar.y;

    /* set read only mode to all parent panels */
    {struct nk_panel *root;
    root = win->layout;
    while (root) {
        root->flags |= NK_WINDOW_ROM;
        root = root->parent;
    }}
    return is_active;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movaps %xmm3, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
movl %esi, %ebp
movq %rdi, %r14
cmpq $0x0, 0x4780(%rdi)
movaps %xmm0, 0x10(%rsp)
movaps %xmm2, (%rsp)
jne 0x3e80f
movq 0x4980f(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x335a1(%rip), %rsi     # 0x71d8c
leaq 0x335b8(%rip), %rdx     # 0x71daa
movl $0x5216, %ecx           # imm = 0x5216
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm0
movq 0x4780(%r14), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x3e855
movq 0x497c9(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x3355b(%rip), %rsi     # 0x71d8c
leaq 0x33572(%rip), %rdx     # 0x71daa
movl $0x5217, %ecx           # imm = 0x5217
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm0
movq 0x4780(%r14), %r13
xorl %r12d, %r12d
testq %r13, %r13
je 0x3eb92
movq 0xa8(%r13), %rax
testq %rax, %rax
je 0x3eb92
testb $-0xc, (%rax)
je 0x3e8b2
movq 0x4976c(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x334fe(%rip), %rsi     # 0x71d8c
leaq 0x33515(%rip), %rdx     # 0x71daa
movl $0x521e, %ecx           # imm = 0x521E
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm0
movq 0x120(%r13), %r15
testq %r15, %r15
je 0x3e8e3
movb $0x1, %al
movb $0x1, %cl
testq %r14, %r14
je 0x3e94f
cmpl $0x0, 0x104(%r14)
je 0x3e94d
cmpl $0x0, 0x108(%r14)
je 0x3e94d
xorl %ecx, %ecx
jmp 0x3e94f
movq %r14, %rdi
callq 0x576fb
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm0
movq %rax, %r15
movl 0x4794(%r14), %eax
movl %eax, (%r15)
movq %r13, 0x1d8(%r15)
movq %r15, 0x120(%r13)
movl %ebx, 0x128(%r13)
leaq 0x2508(%r14), %rax
movq %rax, 0x68(%r15)
movl $0x1, 0x80(%r15)
movq 0x2560(%r14), %rax
movq %rax, 0x90(%r15)
movq %rax, 0x98(%r15)
movq %rax, 0xa0(%r15)
jmp 0x3e9e9
movb $0x1, %cl
testq %r14, %r14
je 0x3e997
movss 0x144(%r14), %xmm3
ucomiss %xmm0, %xmm3
jb 0x3e997
movaps %xmm0, %xmm1
addss 0x20(%rsp), %xmm1
ucomiss %xmm3, %xmm1
jbe 0x3e997
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movss 0x148(%r14), %xmm3
ucomiss %xmm1, %xmm3
jb 0x3e997
movaps %xmm0, %xmm1
addps 0x20(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm3, %xmm1
setbe %al
testq %r14, %r14
je 0x3e9cf
movss 0x144(%r14), %xmm3
xorl %edx, %edx
ucomiss %xmm2, %xmm3
jb 0x3e9e5
movaps %xmm2, %xmm1
addss 0x30(%rsp), %xmm1
ucomiss %xmm3, %xmm1
jbe 0x3e9e5
movaps %xmm2, %xmm1
shufps $0x55, %xmm2, %xmm1     # xmm1 = xmm1[1,1],xmm2[1,1]
movss 0x148(%r14), %xmm3
ucomiss %xmm1, %xmm3
jae 0x3e9d3
xorl %edx, %edx
jmp 0x3e9e5
movaps %xmm2, %xmm1
addps 0x30(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm3, %xmm1
seta %dl
testb %cl, %cl
je 0x3e9ed
xorl %eax, %eax
jmp 0x3e9ef
orb %dl, %al
unpcklpd 0x30(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0]
movups %xmm2, 0x170(%r13)
testb $0x1, %al
je 0x3ea1e
movq 0xa8(%r13), %rax
testq %rax, %rax
je 0x3eb92
orb $0x1, 0x6(%rax)
movq 0x1c8(%rax), %rax
jmp 0x3ea08
unpcklpd 0x20(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0]
movups %xmm0, 0x4c(%r15)
movq %r13, 0x1d8(%r15)
movq %r14, %rdi
callq 0x3aec3
movq %rax, 0xa8(%r15)
orl $0x801, %ebp            # imm = 0x801
movl %ebp, 0x48(%r15)
movl 0x4794(%r14), %ecx
movl %ecx, (%r15)
movl $0x1, 0x15c(%r13)
testq %rax, %rax
jne 0x3ea91
movq 0x49586(%rip), %r12     # 0x87ff0
movq (%r12), %rdi
leaq 0x33317(%rip), %rsi     # 0x71d8c
leaq 0x3332e(%rip), %rdx     # 0x71daa
movl $0x5248, %ecx           # imm = 0x5248
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movdqu 0x98(%r13), %xmm0
movdqu %xmm0, 0x130(%r13)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqu %xmm0, 0x140(%r13)
movl $0x1, 0x150(%r13)
leaq 0x68(%r15), %rdi
movups 0x68(%r13), %xmm0
movups 0x78(%r13), %xmm1
movups 0x88(%r13), %xmm2
movups 0x98(%r13), %xmm3
movups %xmm3, 0x98(%r15)
movups %xmm2, 0x88(%r15)
movups %xmm1, 0x78(%r15)
movups %xmm0, 0x68(%r15)
movaps 0x2f9f5(%rip), %xmm0    # 0x6e4f0
movaps 0x2f9fe(%rip), %xmm1    # 0x6e500
callq 0x13a50
movq %r15, 0x4780(%r14)
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x3af4c
movups 0x68(%r15), %xmm0
movups 0x78(%r15), %xmm1
movups 0x88(%r15), %xmm2
movups 0x98(%r15), %xmm3
movups %xmm0, 0x68(%r13)
movups %xmm1, 0x78(%r13)
movups %xmm2, 0x88(%r13)
movups %xmm3, 0x98(%r13)
movq 0xa8(%r13), %rax
movq 0xa8(%r15), %rcx
movq %rax, 0x1c8(%rcx)
leaq 0x5c(%r15), %rax
movq %rax, 0x18(%rcx)
addq $0x60, %r15
movq %r15, 0x20(%rcx)
movq 0xa8(%r13), %rax
movl $0x1, %r12d
testq %rax, %rax
je 0x3eb92
orb $0x10, 0x5(%rax)
movq 0x1c8(%rax), %rax
jmp 0x3eb80
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq