// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_chart.c
// Function: lv_chart_draw_areas
static void lv_chart_draw_areas(lv_obj_t * chart, const lv_area_t * mask)
{
    lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);

    uint16_t i;
    lv_point_t p1;
    lv_point_t p2;
    lv_coord_t w     = lv_obj_get_width(chart);
    lv_coord_t h     = lv_obj_get_height(chart);
    lv_coord_t x_ofs = chart->coords.x1;
    lv_coord_t y_ofs = chart->coords.y1;
    int32_t y_tmp;
    lv_coord_t p_prev;
    lv_coord_t p_act;
    lv_chart_series_t * ser;
    lv_opa_t opa_scale = lv_obj_get_opa_scale(chart);
    lv_style_t style;
    lv_style_copy(&style, &lv_style_plain);

    /*Go through all data lines*/
    LV_LL_READ_BACK(ext->series_ll, ser)
    {
        lv_coord_t start_point = ext->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;
        style.body.main_color  = ser->color;
        style.body.opa         = ext->series.opa;

        p2.x = 0 + x_ofs;

        p_prev = start_point;
        y_tmp  = (int32_t)((int32_t)ser->points[p_prev] - ext->ymin) * h;
        y_tmp  = y_tmp / (ext->ymax - ext->ymin);
        p2.y   = h - y_tmp + y_ofs;

        for(i = 1; i < ext->point_cnt; i++) {
            p1.x = p2.x;
            p1.y = p2.y;

            p_act = (start_point + i) % ext->point_cnt;
            p2.x  = ((w * i) / (ext->point_cnt - 1)) + x_ofs;

            y_tmp = (int32_t)((int32_t)ser->points[p_act] - ext->ymin) * h;
            y_tmp = y_tmp / (ext->ymax - ext->ymin);
            p2.y  = h - y_tmp + y_ofs;

            if(ser->points[p_prev] != LV_CHART_POINT_DEF && ser->points[p_act] != LV_CHART_POINT_DEF) {
                lv_point_t triangle_points[3];
                triangle_points[0]   = p1;
                triangle_points[1]   = p2;
                triangle_points[2].x = p1.x;
                triangle_points[2].y = chart->coords.y2;
                lv_draw_triangle(triangle_points, mask, &style, opa_scale);
                triangle_points[2].x = p2.x;
                triangle_points[0].y = chart->coords.y2;
                lv_draw_triangle(triangle_points, mask, &style, opa_scale);
            }
            p_prev = p_act;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, -0x26(%rbp)
movq -0x8(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movw 0x22(%rax), %ax
movw %ax, -0x2a(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa710
movb %al, -0x41(%rbp)
leaq -0x90(%rbp), %rdi
leaq 0x638ac(%rip), %rsi     # 0x88fe8
callq 0xc550
movq -0x18(%rbp), %rdi
callq 0x458e0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x259ae
movq -0x18(%rbp), %rax
movb 0x5a(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x2577a
movq -0x40(%rbp), %rax
movzwl 0xa(%rax), %eax
movl %eax, -0xa4(%rbp)
jmp 0x25784
xorl %eax, %eax
movl %eax, -0xa4(%rbp)
jmp 0x25784
movl -0xa4(%rbp), %eax
movw %ax, -0x92(%rbp)
movq -0x40(%rbp), %rax
movw 0x8(%rax), %ax
movw %ax, -0x8e(%rbp)
movq -0x18(%rbp), %rax
movb 0x5f(%rax), %al
movb %al, -0x88(%rbp)
movswl -0x28(%rbp), %eax
addl $0x0, %eax
movw %ax, -0x22(%rbp)
movw -0x92(%rbp), %ax
movw %ax, -0x32(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movswq -0x32(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movq -0x18(%rbp), %rcx
movswl 0x18(%rcx), %ecx
subl %ecx, %eax
movswl -0x26(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x1a(%rcx), %ecx
movq -0x18(%rbp), %rdx
movswl 0x18(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
movswl -0x26(%rbp), %eax
subl -0x30(%rbp), %eax
movswl -0x2a(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x20(%rbp)
movw $0x1, -0x1a(%rbp)
movzwl -0x1a(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x1e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x25996
movw -0x22(%rbp), %ax
movw %ax, -0x1e(%rbp)
movw -0x20(%rbp), %ax
movw %ax, -0x1c(%rbp)
movswl -0x92(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movzwl 0x1e(%rcx), %ecx
cltd
idivl %ecx
movw %dx, %ax
movw %ax, -0x34(%rbp)
movswl -0x24(%rbp), %eax
movzwl -0x1a(%rbp), %ecx
imull %ecx, %eax
movq -0x18(%rbp), %rcx
movzwl 0x1e(%rcx), %ecx
subl $0x1, %ecx
cltd
idivl %ecx
movswl -0x28(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x22(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movswq -0x34(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movq -0x18(%rbp), %rcx
movswl 0x18(%rcx), %ecx
subl %ecx, %eax
movswl -0x26(%rbp), %ecx
imull %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x1a(%rcx), %ecx
movq -0x18(%rbp), %rdx
movswl 0x18(%rdx), %edx
subl %edx, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
movswl -0x26(%rbp), %eax
subl -0x30(%rbp), %eax
movswl -0x2a(%rbp), %ecx
addl %ecx, %eax
movw %ax, -0x20(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rax
movswq -0x32(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl $0xffff83e8, %eax       # imm = 0xFFFF83E8
je 0x2597d
movq -0x40(%rbp), %rax
movq (%rax), %rax
movswq -0x34(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl $0xffff83e8, %eax       # imm = 0xFFFF83E8
je 0x2597d
movl -0x1e(%rbp), %eax
movl %eax, -0x9e(%rbp)
movl -0x22(%rbp), %eax
movl %eax, -0x9a(%rbp)
movw -0x1e(%rbp), %ax
movw %ax, -0x96(%rbp)
movq -0x8(%rbp), %rax
movw 0x26(%rax), %ax
movw %ax, -0x94(%rbp)
leaq -0x9e(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movzbl -0x41(%rbp), %ecx
callq 0x63fd0
movw -0x22(%rbp), %ax
movw %ax, -0x96(%rbp)
movq -0x8(%rbp), %rax
movw 0x26(%rax), %ax
movw %ax, -0x9c(%rbp)
leaq -0x9e(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movzbl -0x41(%rbp), %ecx
callq 0x63fd0
movw -0x34(%rbp), %ax
movw %ax, -0x32(%rbp)
movw -0x1a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x1a(%rbp)
jmp 0x25819
jmp 0x25998
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x45690
movq %rax, -0x40(%rbp)
jmp 0x2574e
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)