// File: /workspace/github_c_makefile_star2_O1/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 0x3dadb
movq 0x4a53a(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x342cc(%rip), %rsi     # 0x71d8c
leaq 0x342e3(%rip), %rdx     # 0x71daa
movl $0x5ae6, %ecx           # imm = 0x5AE6
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x4780(%rbx)
jne 0x3db11
movq 0x4a504(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x34296(%rip), %rsi     # 0x71d8c
leaq 0x342ad(%rip), %rdx     # 0x71daa
movl $0x5ae7, %ecx           # imm = 0x5AE7
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x3db4e
movq 0x4a4c7(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x34259(%rip), %rsi     # 0x71d8c
leaq 0x34270(%rip), %rdx     # 0x71daa
movl $0x5ae8, %ecx           # imm = 0x5AE8
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
xorl %ebp, %ebp
testq %rbx, %rbx
je 0x3dd57
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x3dd57
cmpq $0x0, 0xa8(%rax)
je 0x3dd57
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42a3d
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)
testb $-0x80, 0x5(%r12)
je 0x3dbf5
movq 0x4a422(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x341b3(%rip), %rsi     # 0x71d8c
leaq 0x341ca(%rip), %rdx     # 0x71daa
movl $0x5af8, %ecx           # imm = 0x5AF8
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
testb $0x20, 0x5(%r12)
je 0x3dc2b
movq 0x4a3ec(%rip), %r13     # 0x87ff0
movq (%r13), %rdi
leaq 0x3417d(%rip), %rsi     # 0x71d8c
leaq 0x34194(%rip), %rdx     # 0x71daa
movl $0x5af9, %ecx           # imm = 0x5AF9
xorl %eax, %eax
callq 0x12d80
movq (%r13), %rdi
callq 0x13780
testb $0x40, 0x5(%r12)
je 0x3dc61
movq 0x4a3b6(%rip), %r12     # 0x87ff0
movq (%r12), %rdi
leaq 0x34147(%rip), %rsi     # 0x71d8c
leaq 0x3415e(%rip), %rdx     # 0x71daa
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 0x3dcde
xorps %xmm5, %xmm5
testb $0x2, %al
je 0x3dceb
shufps $0x55, %xmm8, %xmm8     # xmm8 = xmm8[1,1,1,1]
movaps %xmm8, %xmm2
ucomiss %xmm1, %xmm7
jbe 0x3dd57
ucomiss %xmm6, %xmm4
jbe 0x3dd57
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
shufps $0x55, %xmm7, %xmm7     # xmm7 = xmm7[1,1,1,1]
ucomiss %xmm1, %xmm7
jbe 0x3dd57
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
ucomiss %xmm3, %xmm4
jbe 0x3dd57
movl $0x3, %ebp
cmpl $0x0, 0x1b0(%r15)
jne 0x3dd57
movss 0x144(%rbx), %xmm1
ucomiss %xmm0, %xmm1
movl $0x2, %ebp
jb 0x3dd57
addss %xmm0, %xmm5
ucomiss %xmm1, %xmm5
jbe 0x3dd57
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