// File: /workspace/github_c_makefile_star2_O1/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: nk_chart_begin_colored
NK_API nk_bool
nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
    struct nk_color color, struct nk_color highlight,
    int count, float min_value, float max_value)
{
    struct nk_window *win;
    struct nk_chart *chart;
    const struct nk_style *config;
    const struct nk_style_chart *style;

    const struct nk_style_item *background;
    struct nk_rect bounds = {0, 0, 0, 0};

    NK_ASSERT(ctx);
    NK_ASSERT(ctx->current);
    NK_ASSERT(ctx->current->layout);

    if (!ctx || !ctx->current || !ctx->current->layout) return 0;
    if (!nk_widget(&bounds, ctx)) {
        chart = &ctx->current->layout->chart;
        nk_zero(chart, sizeof(*chart));
        return 0;
    }

    win = ctx->current;
    config = &ctx->style;
    chart = &win->layout->chart;
    style = &config->chart;

    /* setup basic generic chart  */
    nk_zero(chart, sizeof(*chart));
    chart->x = bounds.x + style->padding.x;
    chart->y = bounds.y + style->padding.y;
    chart->w = bounds.w - 2 * style->padding.x;
    chart->h = bounds.h - 2 * style->padding.y;
    chart->w = NK_MAX(chart->w, 2 * style->padding.x);
    chart->h = NK_MAX(chart->h, 2 * style->padding.y);

    /* add first slot into chart */
    {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
    slot->type = type;
    slot->count = count;
    slot->color = nk_rgb_factor(color, style->color_factor);
    slot->highlight = highlight;
    slot->min = NK_MIN(min_value, max_value);
    slot->max = NK_MAX(min_value, max_value);
    slot->range = slot->max - slot->min;
    slot->show_markers = style->show_markers;}

    /* draw chart background */
    background = &style->background;

    switch(background->type) {
        case NK_STYLE_ITEM_IMAGE:
            nk_draw_image(&win->buffer, bounds, &background->data.image, nk_rgb_factor(nk_white, style->color_factor));
            break;
        case NK_STYLE_ITEM_NINE_SLICE:
            nk_draw_nine_slice(&win->buffer, bounds, &background->data.slice, nk_rgb_factor(nk_white, style->color_factor));
            break;
        case NK_STYLE_ITEM_COLOR:
            nk_fill_rect(&win->buffer, bounds, style->rounding, nk_rgb_factor(style->border_color, style->color_factor));
            nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
                style->rounding, nk_rgb_factor(style->background.data.color, style->color_factor));
            break;
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movss %xmm1, 0x30(%rsp)
movss %xmm0, 0xc(%rsp)
movl %r8d, %r13d
movl %ecx, %r12d
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
testq %rdi, %rdi
jne 0x4fff6
movq 0x3801f(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x21db1(%rip), %rsi     # 0x71d8c
leaq 0x21dc8(%rip), %rdx     # 0x71daa
movl $0x6fba, %ecx           # imm = 0x6FBA
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
cmpq $0x0, 0x4780(%rbx)
jne 0x5002c
movq 0x37fe9(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x21d7b(%rip), %rsi     # 0x71d8c
leaq 0x21d92(%rip), %rdx     # 0x71daa
movl $0x6fbb, %ecx           # imm = 0x6FBB
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x50069
movq 0x37fac(%rip), %r15     # 0x87ff0
movq (%r15), %rdi
leaq 0x21d3e(%rip), %rsi     # 0x71d8c
leaq 0x21d55(%rip), %rdx     # 0x71daa
movl $0x6fbc, %ecx           # imm = 0x6FBC
xorl %eax, %eax
callq 0x12d80
movq (%r15), %rdi
callq 0x13780
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x503fd
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x503fd
cmpq $0x0, 0xa8(%rax)
je 0x503fd
movl %r13d, 0x2c(%rsp)
movl %ebp, 0x40(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
movq 0x4780(%rbx), %rcx
movq 0xa8(%rcx), %r13
leaq 0xf8(%r13), %rbp
testl %eax, %eax
je 0x500f7
movl %r12d, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq %rbp, %r15
andq $0x3, %r15
je 0x50129
movl $0x4, %r12d
subq %r15, %r12
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x12b50
orq $0xc0, %r15
addq %r12, %rbp
jmp 0x5012f
movq %rbp, %rbx
andq $0x3, %rbx
je 0x503c8
movl $0x4, %r14d
subq %rbx, %r14
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x12b50
orq $0xc0, %rbx
addq %r14, %rbp
jmp 0x503cd
movl $0xc4, %r15d
movl %r15d, %r12d
andl $-0x4, %r12d
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x12b50
andq $0x3, %r15
je 0x50159
addq %r12, %rbp
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x12b50
movsd 0x10(%rsp), %xmm0
movsd 0x1664(%rbx), %xmm1
addps %xmm1, %xmm0
movlps %xmm0, 0xfc(%r13)
movsd 0x18(%rsp), %xmm0
addps %xmm1, %xmm1
subps %xmm1, %xmm0
maxps %xmm0, %xmm1
movlps %xmm1, 0x104(%r13)
movslq 0xf8(%r13), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0xf8(%r13)
imulq $0x2c, %rax, %r15
movl %r14d, 0x10c(%r13,%r15)
movl 0x2c(%rsp), %eax
movl %eax, 0x124(%r13,%r15)
movss 0x166c(%rbx), %xmm0
movl 0x40(%rsp), %edi
callq 0x13e60
movl %eax, 0x110(%r13,%r15)
movl 0x28(%rsp), %eax
movl %eax, 0x114(%r13,%r15)
movss 0xc(%rsp), %xmm2
movaps %xmm2, %xmm0
movss 0x30(%rsp), %xmm1
minss %xmm1, %xmm0
movss %xmm0, 0x118(%r13,%r15)
maxss %xmm2, %xmm1
movss %xmm1, 0x11c(%r13,%r15)
subss %xmm0, %xmm1
movss %xmm1, 0x120(%r13,%r15)
movl 0x1674(%rbx), %eax
movl %eax, 0x134(%r13,%r15)
movl 0x1628(%rbx), %eax
movl $0x1, %r15d
testl %eax, %eax
je 0x5030c
cmpl $0x2, %eax
je 0x502a6
cmpl $0x1, %eax
jne 0x503fd
movq 0x20(%rsp), %rdi
addq $0x68, %rdi
movss 0x166c(%rbx), %xmm0
addq $0x1630, %rbx           # imm = 0x1630
ucomiss 0x1e655(%rip), %xmm0    # 0x6e8b4
mulss 0x1e651(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %eax
movl $0xff, %ecx
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movzbl %cl, %eax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %eax, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rbx, %rsi
callq 0x134d0
jmp 0x503fd
movq 0x20(%rsp), %rdi
addq $0x68, %rdi
movss 0x166c(%rbx), %xmm0
addq $0x1630, %rbx           # imm = 0x1630
ucomiss 0x1e5ef(%rip), %xmm0    # 0x6e8b4
mulss 0x1e5eb(%rip), %xmm0    # 0x6e8b8
cvttss2si %xmm0, %eax
movl $0xff, %ecx
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movzbl %cl, %eax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shll $0x8, %edx
orl %ecx, %edx
addl %eax, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %rbx, %rsi
callq 0x13fe0
jmp 0x503fd
movq 0x20(%rsp), %r14
addq $0x68, %r14
movss 0x1660(%rbx), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x166c(%rbx), %xmm0
movl 0x1650(%rbx), %edi
callq 0x13e60
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r14, %rdi
movss 0x30(%rsp), %xmm2
movl %eax, %esi
callq 0x12de0
movss 0x165c(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
movaps %xmm0, %xmm3
shufps $0x0, %xmm0, %xmm3      # xmm3 = xmm3[0,0],xmm0[0,0]
addps %xmm1, %xmm3
movaps %xmm3, 0x30(%rsp)
addss %xmm0, %xmm0
shufps $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movaps %xmm0, %xmm1
maxps %xmm2, %xmm1
subps %xmm0, %xmm1
movaps %xmm1, 0x40(%rsp)
movss 0x1660(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x166c(%rbx), %xmm0
movl 0x1630(%rbx), %edi
callq 0x13e60
movq %r14, %rdi
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movss 0xc(%rsp), %xmm2
movl %eax, %esi
callq 0x12de0
jmp 0x503fd
movl $0xc4, %ebx
movl %ebx, %r14d
andl $-0x4, %r14d
xorl %r15d, %r15d
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x12b50
andq $0x3, %rbx
je 0x503fd
addq %r14, %rbp
xorl %r15d, %r15d
movq %rbp, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x12b50
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq