// File: /workspace/github_c_makefile_star2_O3/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, (%rsp)
movaps %xmm1, 0x30(%rsp)
movl %esi, %ebp
movq %rdi, %r14
movq 0x4780(%rdi), %r12
testq %r12, %r12
movaps %xmm0, 0x20(%rsp)
movaps %xmm2, 0x10(%rsp)
jne 0x3dfb9
movq 0x4906d(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x32e0f(%rip), %rsi     # 0x70d9c
leaq 0x32e26(%rip), %rdx     # 0x70dba
movl $0x5216, %ecx           # imm = 0x5216
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm0
movq 0x4780(%r14), %r12
cmpq $0x0, 0xa8(%r12)
jne 0x3e00b
movq 0x49025(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x32dc6(%rip), %rsi     # 0x70d9c
leaq 0x32ddd(%rip), %rdx     # 0x70dba
xorl %r15d, %r15d
movl $0x5217, %ecx           # imm = 0x5217
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm0
movq 0x4780(%r14), %r12
testq %r12, %r12
je 0x3e07f
movq 0xa8(%r12), %rax
testq %rax, %rax
je 0x3e07c
testb $-0xc, (%rax)
je 0x3e053
movq 0x48fcc(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x32d6e(%rip), %rsi     # 0x70d9c
leaq 0x32d85(%rip), %rdx     # 0x70dba
movl $0x521e, %ecx           # imm = 0x521E
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movaps 0x10(%rsp), %xmm2
movaps 0x20(%rsp), %xmm0
movq 0x120(%r12), %r15
testq %r15, %r15
je 0x3e110
cmpl $0x0, 0x104(%r14)
je 0x3e091
cmpl $0x0, 0x108(%r14)
je 0x3e091
xorl %eax, %eax
jmp 0x3e093
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
movss 0x144(%r14), %xmm3
ucomiss %xmm0, %xmm3
movb $0x1, %cl
jb 0x3e0d8
movaps %xmm0, %xmm1
addss 0x30(%rsp), %xmm1
ucomiss %xmm3, %xmm1
jbe 0x3e0d8
movaps %xmm0, %xmm4
shufps $0x55, %xmm0, %xmm4     # xmm4 = xmm4[1,1],xmm0[1,1]
movss 0x148(%r14), %xmm1
ucomiss %xmm4, %xmm1
jb 0x3e0d8
movaps %xmm0, %xmm4
addps 0x30(%rsp), %xmm4
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
ucomiss %xmm1, %xmm4
setbe %cl
xorl %edx, %edx
ucomiss %xmm2, %xmm3
jb 0x3e190
movaps %xmm2, %xmm1
addss (%rsp), %xmm1
ucomiss %xmm3, %xmm1
jbe 0x3e190
movaps %xmm2, %xmm1
shufps $0x55, %xmm2, %xmm1     # xmm1 = xmm1[1,1],xmm2[1,1]
movss 0x148(%r14), %xmm3
ucomiss %xmm1, %xmm3
jae 0x3e17f
xorl %edx, %edx
jmp 0x3e190
movq %r14, %rdi
callq 0x56b07
movq %rax, %r15
testq %rax, %rax
je 0x3e12a
movl 0x4794(%r14), %eax
movl %eax, (%r15)
movq %r12, 0x1d8(%r15)
movq %r15, 0x120(%r12)
movl %ebx, 0x128(%r12)
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)
movaps 0x20(%rsp), %xmm0
movaps 0x10(%rsp), %xmm2
jmp 0x3e198
movaps %xmm2, %xmm1
addps (%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
ucomiss %xmm3, %xmm1
seta %dl
testb %al, %al
je 0x3e32d
unpcklpd (%rsp), %xmm2           # xmm2 = xmm2[0],mem[0]
movups %xmm2, 0x170(%r12)
unpcklpd 0x30(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0]
movups %xmm0, 0x4c(%r15)
movq %r12, 0x1d8(%r15)
movq %r14, %rdi
callq 0x3a740
movq %rax, 0xa8(%r15)
orl $0x801, %ebp            # imm = 0x801
movl %ebp, 0x48(%r15)
movl 0x4794(%r14), %ecx
movl %ecx, (%r15)
movl $0x1, 0x15c(%r12)
testq %rax, %rax
jne 0x3e21a
movq 0x48dfd(%rip), %r13     # 0x86ff0
movq (%r13), %rdi
leaq 0x32b9e(%rip), %rsi     # 0x70d9c
leaq 0x32bb5(%rip), %rdx     # 0x70dba
movl $0x5248, %ecx           # imm = 0x5248
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movdqu 0x98(%r12), %xmm0
movdqu %xmm0, 0x130(%r12)
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqu %xmm0, 0x140(%r12)
movl $0x1, 0x150(%r12)
leaq 0x68(%r15), %rdi
movups 0x68(%r12), %xmm0
movups 0x78(%r12), %xmm1
movups 0x88(%r12), %xmm2
movups 0x98(%r12), %xmm3
movups %xmm3, 0x98(%r15)
movups %xmm2, 0x88(%r15)
movups %xmm1, 0x78(%r15)
movups %xmm0, 0x68(%r15)
movaps 0x2f264(%rip), %xmm0    # 0x6d4f0
movaps 0x2f26d(%rip), %xmm1    # 0x6d500
callq 0x13a50
movq %r15, 0x4780(%r14)
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x3a7b3
movups 0x68(%r15), %xmm0
movups 0x78(%r15), %xmm1
movups 0x88(%r15), %xmm2
movups 0x98(%r15), %xmm3
movups %xmm0, 0x68(%r12)
movups %xmm1, 0x78(%r12)
movups %xmm2, 0x88(%r12)
movups %xmm3, 0x98(%r12)
movq 0xa8(%r12), %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(%r12), %rax
movl $0x1, %r15d
testq %rax, %rax
je 0x3e07f
orb $0x10, 0x5(%rax)
movq 0x1c8(%rax), %rax
jmp 0x3e317
orb %dl, %cl
unpcklpd (%rsp), %xmm2           # xmm2 = xmm2[0],mem[0]
movups %xmm2, 0x170(%r12)
testb $0x1, %cl
je 0x3e1a6
movq 0xa8(%r12), %rax
xorl %r15d, %r15d
testq %rax, %rax
je 0x3e07f
orb $0x1, 0x6(%rax)
movq 0x1c8(%rax), %rax
jmp 0x3e351