// File: /workspace/github_c_makefile_star2_O2/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_widget
NK_API enum nk_widget_layout_states
nk_widget(struct nk_rect *bounds, const struct nk_context *ctx)
{
    struct nk_rect c, v;
    struct nk_window *win;
    struct nk_panel *layout;
    const struct nk_input *in;

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

    /* allocate space and check if the widget needs to be updated and drawn */
    nk_panel_alloc_space(bounds, ctx);
    win = ctx->current;
    layout = win->layout;
    in = &ctx->input;
    c = layout->clip;

    /*  if one of these triggers you forgot to add an `if` condition around either
        a window, group, popup, combobox or contextual menu `begin` and `end` block.
        Example:
            if (nk_begin(...) {...} nk_end(...); or
            if (nk_group_begin(...) { nk_group_end(...);} */
    NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
    NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
    NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));

    /* need to convert to int here to remove floating point errors */
    bounds->x = (float)((int)bounds->x);
    bounds->y = (float)((int)bounds->y);
    bounds->w = (float)((int)bounds->w);
    bounds->h = (float)((int)bounds->h);

    c.x = (float)((int)c.x);
    c.y = (float)((int)c.y);
    c.w = (float)((int)c.w);
    c.h = (float)((int)c.h);

    nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h);
    if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h))
        return NK_WIDGET_INVALID;
    if (win->widgets_disabled)
        return NK_WIDGET_DISABLED;
    if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h))
        return NK_WIDGET_ROM;
    return NK_WIDGET_VALID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
jne 0x39d75
movq 0x4b2a0(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x2ffb2(%rip), %rsi     # 0x69d0c
leaq 0x2ffc9(%rip), %rdx     # 0x69d2a
movl $0x5ae6, %ecx           # imm = 0x5AE6
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
testq %rax, %rax
jne 0x39db4
movq 0x4b268(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x2ff7a(%rip), %rsi     # 0x69d0c
leaq 0x2ff91(%rip), %rdx     # 0x69d2a
movl $0x5ae7, %ecx           # imm = 0x5AE7
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x39dfc
movq 0x4b22b(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x2ff3d(%rip), %rsi     # 0x69d0c
leaq 0x2ff54(%rip), %rdx     # 0x69d2a
xorl %ebp, %ebp
movl $0x5ae8, %ecx           # imm = 0x5AE8
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x39fc1
xorl %ebp, %ebp
cmpq $0x0, 0xa8(%rax)
je 0x39fc1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3e99a
movq 0x4780(%rbx), %r15
movq 0xa8(%r15), %r12
movups 0x44(%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movl 0x4(%r12), %eax
testw %ax, %ax
jns 0x39e6d
movq 0x4b1af(%rip), %r13     # 0x84ff0
movq (%r13), %rdi
leaq 0x2fec0(%rip), %rsi     # 0x69d0c
leaq 0x2fed7(%rip), %rdx     # 0x69d2a
movl $0x5af8, %ecx           # imm = 0x5AF8
xorl %eax, %eax
callq 0x12ea0
movq (%r13), %rdi
callq 0x13960
movl 0x4(%r12), %eax
btl $0xd, %eax
jae 0x39ea6
movq 0x4b176(%rip), %r13     # 0x84ff0
movq (%r13), %rdi
leaq 0x2fe87(%rip), %rsi     # 0x69d0c
leaq 0x2fe9e(%rip), %rdx     # 0x69d2a
movl $0x5af9, %ecx           # imm = 0x5AF9
xorl %eax, %eax
callq 0x12ea0
movq (%r13), %rdi
callq 0x13960
movl 0x4(%r12), %eax
btl $0xe, %eax
jae 0x39eda
movq 0x4b13d(%rip), %r12     # 0x84ff0
movq (%r12), %rdi
leaq 0x2fe4e(%rip), %rsi     # 0x69d0c
leaq 0x2fe65(%rip), %rdx     # 0x69d2a
movl $0x5afa, %ecx           # imm = 0x5AFA
xorl %eax, %eax
callq 0x12ea0
movq (%r12), %rdi
callq 0x13960
movups (%r14), %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm0
movups %xmm0, (%r14)
leaq 0x20(%rsp), %rsi
cvttps2dq (%rsi), %xmm1
cvtdq2ps %xmm1, %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm1, (%rsi)
movaps %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addss %xmm0, %xmm2
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movaps %xmm0, %xmm3
shufps $0xff, %xmm0, %xmm3     # xmm3 = xmm3[3,3],xmm0[3,3]
addss %xmm1, %xmm3
movq %rsp, %rdi
callq 0x3fbfa
movaps 0x10(%rsp), %xmm2
movss (%r14), %xmm0
movaps %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
addss %xmm2, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x39fc1
addss 0x8(%r14), %xmm0
ucomiss %xmm2, %xmm0
jbe 0x39fc1
movss 0x4(%r14), %xmm0
movaps %xmm2, %xmm1
shufps $0x55, %xmm2, %xmm1     # xmm1 = xmm1[1,1],xmm2[1,1]
shufps $0xff, %xmm2, %xmm2     # xmm2 = xmm2[3,3,3,3]
addss %xmm1, %xmm2
ucomiss %xmm0, %xmm2
jbe 0x39fc1
addss 0xc(%r14), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x39fc1
cmpl $0x0, 0x1b0(%r15)
je 0x39f7f
pushq $0x3
popq %rbp
jmp 0x39fc1
movss (%rsp), %xmm0
movss 0x144(%rbx), %xmm1
pushq $0x2
popq %rbp
ucomiss %xmm0, %xmm1
jb 0x39fc1
addss 0x8(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x39fc1
movss 0x4(%rsp), %xmm0
movss 0x148(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jb 0x39fc1
addss 0xc(%rsp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x39fc1
pushq $0x1
jmp 0x39f7c
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq