// File: /workspace/github_c_makefile_star2_O1/0x0203[P]schack_poc/./nuklear.h
// Function: nk_chart_begin_colored
NK_API int
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 = color;
    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;}

    /* draw chart background */
    background = &style->background;
    if (background->type == NK_STYLE_ITEM_IMAGE) {
        nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white);
    } else {
        nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color);
        nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
            style->rounding, style->background.data.color);
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
xorps %xmm2, %xmm2
movaps %xmm2, (%rsp)
testq %rdi, %rdi
je 0x1c5ef
movq %rdi, %r15
movq 0x3fe8(%rdi), %rax
testq %rax, %rax
je 0x1c60e
movl %esi, 0x18(%rsp)
movl %edx, 0x1c(%rsp)
movss %xmm0, 0x20(%rsp)
movss %xmm1, 0x24(%rsp)
cmpq $0x0, 0xa8(%rax)
je 0x1c62d
movl %r8d, %r12d
movl %ecx, %ebp
movq %rsp, %rdi
movq %r15, %rsi
callq 0xfda9
movq 0x3fe8(%r15), %r14
movq 0xa8(%r14), %r13
leaq 0xf8(%r13), %rbx
testl %eax, %eax
je 0x1c38f
movl %r12d, 0x10(%rsp)
movl %ebp, 0x14(%rsp)
movq %rbx, %rbp
andq $0x3, %rbp
je 0x1c3c1
movl $0x4, %r12d
subq %rbp, %r12
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3070
orq $0xb0, %rbp
addq %r12, %rbx
jmp 0x1c3c6
movq %rbx, %r14
andq $0x3, %r14
je 0x1c5aa
movl $0x4, %r15d
subq %r14, %r15
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3070
orq $0xb0, %r14
addq %r15, %rbx
jmp 0x1c5b0
movl $0xb4, %ebp
movl %ebp, %r12d
andl $-0x4, %r12d
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3070
andq $0x3, %rbp
je 0x1c3f0
addq %r12, %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x3070
movss 0x12c4(%r15), %xmm0
movss (%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0xfc(%r13)
movss 0x12c8(%r15), %xmm1
movss 0x4(%rsp), %xmm2
addss %xmm1, %xmm2
movss %xmm2, 0x100(%r13)
movss 0x8(%rsp), %xmm2
addss %xmm0, %xmm0
subss %xmm0, %xmm2
movss %xmm2, 0x104(%r13)
movss 0xc(%rsp), %xmm3
addss %xmm1, %xmm1
subss %xmm1, %xmm3
maxss %xmm2, %xmm0
movss %xmm0, 0x104(%r13)
maxss %xmm3, %xmm1
movss %xmm1, 0x108(%r13)
movslq 0xf8(%r13), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0xf8(%r13)
leaq (%rax,%rax,4), %rax
movl 0x18(%rsp), %ecx
movl %ecx, 0x10c(%r13,%rax,8)
movl 0x10(%rsp), %ecx
movl %ecx, 0x124(%r13,%rax,8)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x110(%r13,%rax,8)
movl 0x14(%rsp), %ecx
movl %ecx, 0x114(%r13,%rax,8)
movss 0x20(%rsp), %xmm2
movaps %xmm2, %xmm0
movss 0x24(%rsp), %xmm1
minss %xmm1, %xmm0
movss %xmm0, 0x118(%r13,%rax,8)
maxss %xmm2, %xmm1
movss %xmm1, 0x11c(%r13,%rax,8)
subss %xmm0, %xmm1
movss %xmm1, 0x120(%r13,%rax,8)
addq $0x68, %r14
cmpl $0x1, 0x1290(%r15)
jne 0x1c519
addq $0x1298, %r15           # imm = 0x1298
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r14, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7b23
jmp 0x1c5a3
movss 0x12c0(%r15), %xmm2
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movl 0x12b0(%r15), %esi
movq %r14, %rdi
callq 0x6fee
movss 0x12bc(%r15), %xmm2
movsd (%rsp), %xmm3
movsd 0x8(%rsp), %xmm0
movaps %xmm2, %xmm4
addss %xmm2, %xmm4
movaps %xmm4, %xmm1
maxss %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
maxss %xmm0, %xmm4
movaps %xmm2, %xmm0
addss %xmm3, %xmm0
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
addss %xmm2, %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
mulss 0xbe2c(%rip), %xmm2     # 0x283ac
addss %xmm2, %xmm1
addss %xmm4, %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movss 0x12c0(%r15), %xmm2
movl 0x1298(%r15), %esi
movq %r14, %rdi
callq 0x6fee
movl $0x1, %ebp
jmp 0x1c5de
movl $0xb4, %r14d
movl %r14d, %r15d
andl $-0x4, %r15d
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3070
andq $0x3, %r14
je 0x1c5de
addq %r15, %rbx
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x3070
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xff1f(%rip), %rdi      # 0x2c515
leaq 0xd086(%rip), %rsi      # 0x29683
leaq 0x1117c(%rip), %rcx     # 0x2d780
movl $0x5d1c, %edx           # imm = 0x5D1C
callq 0x3100
leaq 0xeb32(%rip), %rdi      # 0x2b147
leaq 0xd067(%rip), %rsi      # 0x29683
leaq 0x1115d(%rip), %rcx     # 0x2d780
movl $0x5d1d, %edx           # imm = 0x5D1D
callq 0x3100
leaq 0xec8f(%rip), %rdi      # 0x2b2c3
leaq 0xd048(%rip), %rsi      # 0x29683
leaq 0x1113e(%rip), %rcx     # 0x2d780
movl $0x5d1e, %edx           # imm = 0x5D1E
callq 0x3100