// File: /workspace/github_c_makefile_star2_O3/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, %r12d
movl %ecx, %r13d
movl %edx, %r15d
movl %esi, 0x40(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
testq %rdi, %rdi
jne 0x4f413
movq 0x37c02(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x219a4(%rip), %rsi     # 0x70d9c
leaq 0x219bb(%rip), %rdx     # 0x70dba
movl $0x6fba, %ecx           # imm = 0x6FBA
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
testq %rax, %rax
jne 0x4f452
movq 0x37bca(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x2196c(%rip), %rsi     # 0x70d9c
leaq 0x21983(%rip), %rdx     # 0x70dba
movl $0x6fbb, %ecx           # imm = 0x6FBB
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x4f49a
movq 0x37b8d(%rip), %r14     # 0x86ff0
movq (%r14), %rdi
leaq 0x2192f(%rip), %rsi     # 0x70d9c
leaq 0x21946(%rip), %rdx     # 0x70dba
xorl %ebp, %ebp
movl $0x6fbc, %ecx           # imm = 0x6FBC
xorl %eax, %eax
callq 0x12d80
movq (%r14), %rdi
callq 0x13780
movq 0x4780(%rbx), %rax
testq %rax, %rax
je 0x4f817
cmpq $0x0, 0xa8(%rax)
je 0x4f536
movl %r12d, 0x28(%rsp)
movl %r15d, 0x2c(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x128e0
movq 0x4780(%rbx), %r14
movq 0xa8(%r14), %r15
leaq 0xf8(%r15), %r12
testl %eax, %eax
je 0x4f53d
movq %r12, %rbp
andq $0x3, %rbp
je 0x4f587
movq %r14, 0x50(%rsp)
movl %r13d, %r14d
movl $0x4, %r13d
subq %rbp, %r13
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x12b50
leaq (%r12,%r13), %rdi
movl $0xc0, %edx
xorl %esi, %esi
callq 0x12b50
leaq (%r12,%r13), %rdi
addq $0xc0, %rdi
movl %r14d, %r13d
movq 0x50(%rsp), %r14
xorl %esi, %esi
movq %rbp, %rdx
callq 0x12b50
movl (%r12), %r12d
jmp 0x4f59d
xorl %ebp, %ebp
jmp 0x4f817
movq %r12, %rbx
andq $0x3, %rbx
je 0x4f806
movl $0x4, %r14d
subq %rbx, %r14
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x12b50
leaq (%r12,%r14), %rdi
movl $0xc0, %edx
xorl %esi, %esi
callq 0x12b50
leaq (%r12,%r14), %rdi
addq $0xc0, %rdi
xorl %esi, %esi
movq %rbx, %rdx
jmp 0x4f812
leaq 0x10c(%r15), %rdi
xorl %r12d, %r12d
movl $0xb0, %edx
xorl %esi, %esi
callq 0x12b50
movsd 0x10(%rsp), %xmm0
movsd 0x1664(%rbx), %xmm1
addps %xmm1, %xmm0
movlps %xmm0, 0xfc(%r15)
movsd 0x18(%rsp), %xmm0
addps %xmm1, %xmm1
subps %xmm1, %xmm0
maxps %xmm0, %xmm1
movlps %xmm1, 0x104(%r15)
leal 0x1(%r12), %eax
movl %eax, 0xf8(%r15)
movslq %r12d, %rax
imulq $0x2c, %rax, %r12
movl 0x40(%rsp), %eax
movl %eax, 0x10c(%r15,%r12)
movl 0x28(%rsp), %eax
movl %eax, 0x124(%r15,%r12)
movss 0x166c(%rbx), %xmm0
movl 0x2c(%rsp), %edi
callq 0x13e60
movl %eax, 0x110(%r15,%r12)
movl %r13d, 0x114(%r15,%r12)
movss 0xc(%rsp), %xmm2
movaps %xmm2, %xmm0
movss 0x30(%rsp), %xmm1
minss %xmm1, %xmm0
movss %xmm0, 0x118(%r15,%r12)
maxss %xmm2, %xmm1
movss %xmm1, 0x11c(%r15,%r12)
subss %xmm0, %xmm1
movss %xmm1, 0x120(%r15,%r12)
movl 0x1674(%rbx), %eax
movl %eax, 0x134(%r15,%r12)
movl 0x1628(%rbx), %eax
movl $0x1, %ebp
testl %eax, %eax
je 0x4f74f
cmpl $0x2, %eax
je 0x4f6e8
cmpl $0x1, %eax
jne 0x4f817
addq $0x68, %r14
movss 0x166c(%rbx), %xmm0
addq $0x1630, %rbx           # imm = 0x1630
movss 0x1e20c(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x1e1f2(%rip), %xmm0    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x134d0
jmp 0x4f817
addq $0x68, %r14
movss 0x166c(%rbx), %xmm0
addq $0x1630, %rbx           # imm = 0x1630
movss 0x1e1a5(%rip), %xmm1    # 0x6d8a8
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0xff, %ecx
andl %ecx, %eax
ucomiss 0x1e18b(%rip), %xmm0    # 0x6d8a4
cmovnel %eax, %ecx
cmovpl %eax, %ecx
movl %ecx, %eax
shll $0x10, %eax
movl %ecx, %edx
shll $0x8, %edx
orl %eax, %edx
addl %ecx, %edx
addl $0xff000000, %edx       # imm = 0xFF000000
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x13fe0
jmp 0x4f817
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 0x4f817
xorl %ebp, %ebp
movl $0xc4, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x12b50
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq