// File: /workspace/github_c_makefile_star2_O2/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, 0x40(%rsp)
movl %r8d, %r14d
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
testq %rdi, %rdi
jne 0x4ae83
movq 0x3a192(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x1eea4(%rip), %rsi     # 0x69d0c
leaq 0x1eebb(%rip), %rdx     # 0x69d2a
movl $0x6fba, %ecx           # imm = 0x6FBA
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
testq %rax, %rax
jne 0x4aec2
movq 0x3a15a(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x1ee6c(%rip), %rsi     # 0x69d0c
leaq 0x1ee83(%rip), %rdx     # 0x69d2a
movl $0x6fbb, %ecx           # imm = 0x6FBB
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x4af0a
movq 0x3a11d(%rip), %r15     # 0x84ff0
movq (%r15), %rdi
leaq 0x1ee2f(%rip), %rsi     # 0x69d0c
leaq 0x1ee46(%rip), %rdx     # 0x69d2a
xorl %ebp, %ebp
movl $0x6fbc, %ecx           # imm = 0x6FBC
xorl %eax, %eax
callq 0x12ea0
movq (%r15), %rdi
callq 0x13960
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x4b164
xorl %ebp, %ebp
cmpq $0x0, 0xa8(%rax)
je 0x4b164
movl %r12d, %r15d
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x12990
movq 0x4780(%rbx), %rcx
movq %rcx, 0x28(%rsp)
movq 0xa8(%rcx), %r12
leaq 0xf8(%r12), %rdi
movl $0xc4, %esi
testl %eax, %eax
je 0x4b078
callq 0x23ed0
movsd 0x10(%rsp), %xmm0
movsd 0x1664(%rbx), %xmm1
addps %xmm1, %xmm0
movlps %xmm0, 0xfc(%r12)
movsd 0x18(%rsp), %xmm0
addps %xmm1, %xmm1
subps %xmm1, %xmm0
maxps %xmm0, %xmm1
movlps %xmm1, 0x104(%r12)
movslq 0xf8(%r12), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0xf8(%r12)
imulq $0x2c, %rax, %rbp
movl 0xc(%rsp), %eax
movl %eax, 0x10c(%r12,%rbp)
movl %r14d, 0x124(%r12,%rbp)
movss 0x166c(%rbx), %xmm0
movl %r13d, %edi
callq 0x140a0
movl %eax, 0x110(%r12,%rbp)
movl %r15d, 0x114(%r12,%rbp)
movss 0x40(%rsp), %xmm2
movaps %xmm2, %xmm0
movss 0x30(%rsp), %xmm1
minss %xmm1, %xmm0
movss %xmm0, 0x118(%r12,%rbp)
maxss %xmm2, %xmm1
movss %xmm1, 0x11c(%r12,%rbp)
subss %xmm0, %xmm1
movss %xmm1, 0x120(%r12,%rbp)
movl 0x1674(%rbx), %eax
movl %eax, 0x134(%r12,%rbp)
movl 0x1628(%rbx), %eax
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x4b0c0
cmpl $0x2, %eax
je 0x4b082
cmpl $0x1, %eax
jne 0x4b164
movq 0x28(%rsp), %r14
addq $0x68, %r14
movss 0x166c(%rbx), %xmm0
addq $0x1630, %rbx           # imm = 0x1630
pushq $-0x1
popq %rdi
callq 0x140a0
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x13660
jmp 0x4b164
callq 0x23ed0
jmp 0x4b164
movq 0x28(%rsp), %r14
addq $0x68, %r14
movss 0x166c(%rbx), %xmm0
addq $0x1630, %rbx           # imm = 0x1630
pushq $-0x1
popq %rdi
callq 0x140a0
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x14230
jmp 0x4b164
movq 0x28(%rsp), %r14
addq $0x68, %r14
movss 0x1660(%rbx), %xmm0
movss %xmm0, 0x30(%rsp)
movss 0x166c(%rbx), %xmm0
movl 0x1650(%rbx), %edi
callq 0x140a0
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r14, %rdi
movss 0x30(%rsp), %xmm2
movl %eax, %esi
callq 0x12f00
movss 0x165c(%rbx), %xmm2
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x4b175
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movss 0x1660(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
movss 0x166c(%rbx), %xmm0
movl 0x1630(%rbx), %edi
callq 0x140a0
movq %r14, %rdi
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movss 0xc(%rsp), %xmm2
movl %eax, %esi
callq 0x12f00
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq