// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
jne 0x3d2c0
movq 0x49d55(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x33af7(%rip), %rsi     # 0x70d9c
leaq 0x33b0e(%rip), %rdx     # 0x70dba
movl $0x5ae6, %ecx           # imm = 0x5AE6
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
testq %rax, %rax
jne 0x3d2ff
movq 0x49d1d(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x33abf(%rip), %rsi     # 0x70d9c
leaq 0x33ad6(%rip), %rdx     # 0x70dba
movl $0x5ae7, %ecx           # imm = 0x5AE7
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x3d347
movq 0x49ce0(%rip), %r15     # 0x86ff0
movq (%r15), %rdi
leaq 0x33a82(%rip), %rsi     # 0x70d9c
leaq 0x33a99(%rip), %rdx     # 0x70dba
xorl %ebp, %ebp
movl $0x5ae8, %ecx           # imm = 0x5AE8
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x3d53f
xorl %ebp, %ebp
cmpq $0x0, 0xa8(%rax)
je 0x3d53f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42153
movq 0x4780(%rbx), %r15
movq 0xa8(%r15), %r12
movss 0x44(%r12), %xmm0
movaps %xmm0, 0x20(%rsp)
movss 0x48(%r12), %xmm0
movaps %xmm0, 0x30(%rsp)
movss 0x4c(%r12), %xmm0
movaps %xmm0, (%rsp)
movss 0x50(%r12), %xmm0
movaps %xmm0, 0x10(%rsp)
movl 0x4(%r12), %eax
testw %ax, %ax
jns 0x3d3dc
movq 0x49c40(%rip), %r13     # 0x86ff0
movq (%r13), %rdi
leaq 0x339e1(%rip), %rsi     # 0x70d9c
leaq 0x339f8(%rip), %rdx     # 0x70dba
movl $0x5af8, %ecx           # imm = 0x5AF8
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movl 0x4(%r12), %eax
btl $0xd, %eax
jae 0x3d415
movq 0x49c07(%rip), %r13     # 0x86ff0
movq (%r13), %rdi
leaq 0x339a8(%rip), %rsi     # 0x70d9c
leaq 0x339bf(%rip), %rdx     # 0x70dba
movl $0x5af9, %ecx           # imm = 0x5AF9
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
movl 0x4(%r12), %eax
btl $0xe, %eax
jae 0x3d449
movq 0x49bce(%rip), %r12     # 0x86ff0
movq (%r12), %rdi
leaq 0x3396f(%rip), %rsi     # 0x70d9c
leaq 0x33986(%rip), %rdx     # 0x70dba
movl $0x5afa, %ecx           # imm = 0x5AFA
xorl %eax, %eax
callq 0x12d80
movq (%r12), %rdi
callq 0x13780
movups (%r14), %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2ps %xmm0, %xmm1
movups %xmm1, (%r14)
movaps 0x20(%rsp), %xmm0
unpcklps (%rsp), %xmm0           # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
cvttps2dq %xmm0, %xmm0
movaps 0x30(%rsp), %xmm2
unpcklps 0x10(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
cvttps2dq %xmm2, %xmm2
cvtdq2ps %xmm0, %xmm6
cvtdq2ps %xmm2, %xmm3
movaps %xmm1, %xmm4
unpckhpd %xmm1, %xmm4            # xmm4 = xmm4[1],xmm1[1]
addps %xmm1, %xmm4
movaps %xmm6, %xmm2
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movaps %xmm1, %xmm0
maxps %xmm2, %xmm0
movaps %xmm3, %xmm7
shufps $0x11, %xmm6, %xmm7     # xmm7 = xmm7[1,0],xmm6[1,0]
shufps $0xe2, %xmm6, %xmm7     # xmm7 = xmm7[2,0],xmm6[2,3]
addps %xmm2, %xmm7
movaps %xmm7, %xmm8
minps %xmm4, %xmm8
subps %xmm0, %xmm8
xorps %xmm2, %xmm2
cmpltps %xmm8, %xmm2
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
movmskpd %xmm2, %eax
xorps %xmm2, %xmm2
movaps %xmm8, %xmm5
testb $0x1, %al
jne 0x3d4c6
xorps %xmm5, %xmm5
testb $0x2, %al
je 0x3d4d3
shufps $0x55, %xmm8, %xmm8     # xmm8 = xmm8[1,1,1,1]
movaps %xmm8, %xmm2
ucomiss %xmm1, %xmm7
jbe 0x3d53f
ucomiss %xmm6, %xmm4
jbe 0x3d53f
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
shufps $0x55, %xmm7, %xmm7     # xmm7 = xmm7[1,1,1,1]
ucomiss %xmm1, %xmm7
jbe 0x3d53f
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
ucomiss %xmm3, %xmm4
jbe 0x3d53f
movl $0x3, %ebp
cmpl $0x0, 0x1b0(%r15)
jne 0x3d53f
movss 0x144(%rbx), %xmm1
ucomiss %xmm0, %xmm1
movl $0x2, %ebp
jb 0x3d53f
addss %xmm0, %xmm5
ucomiss %xmm1, %xmm5
jbe 0x3d53f
movss 0x148(%rbx), %xmm1
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss %xmm0, %xmm2
cmpleps %xmm1, %xmm0
cmpltps %xmm2, %xmm1
andps %xmm0, %xmm1
movd %xmm1, %ebp
addl $0x2, %ebp
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq