// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_chart.c
// Function: lv_chart_draw_lines
static void lv_chart_draw_lines(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);
    style.line.opa   = ext->series.opa;
    style.line.width = ext->series.width;

    /*Go through all data lines*/
    LV_LL_READ_BACK(ext->series_ll, ser)
    {
        style.line.color = ser->color;

        lv_coord_t start_point = ext->update_mode == LV_CHART_UPDATE_MODE_SHIFT ? ser->start_point : 0;

        p1.x = 0 + x_ofs;
        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;

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

            p_act = (start_point + i) % ext->point_cnt;

            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_draw_line(&p1, &p2, mask, &style, opa_scale);

            p_prev = p_act;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, 0x28(%rsp)
movq %rdi, %r15
callq 0x6747
movq %rax, %r14
movq %r15, %rdi
callq 0x5308
movl %eax, %ebp
movq %r15, %rdi
callq 0x5332
movl %eax, %r13d
movzwl 0x20(%r15), %eax
movl %eax, 0x14(%rsp)
movzwl 0x22(%r15), %eax
addw %r13w, %ax
movl %eax, 0x10(%rsp)
movq %r15, %rdi
callq 0x6649
movl %eax, %r15d
leaq 0x4837a(%rip), %rsi     # 0x5df18
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x74d4
movb 0x5f(%r14), %al
movb %al, 0x40(%rbx)
movzwl 0x5c(%r14), %eax
movw %ax, 0x3e(%rbx)
movq %r14, %rdi
callq 0x27ea3
movq %rax, %r12
movswl %r13w, %r11d
movswl %bp, %eax
movl %eax, 0x1c(%rsp)
movzbl %r15b, %eax
movl %eax, 0x24(%rsp)
movl %r11d, 0x18(%rsp)
testq %r12, %r12
je 0x15d15
movzwl 0x8(%r12), %eax
movw %ax, 0x6c(%rsp)
testb $0x1, 0x5a(%r14)
jne 0x15c01
movzwl 0xa(%r12), %ecx
jmp 0x15c03
xorl %ecx, %ecx
movl 0x14(%rsp), %r9d
movl 0x10(%rsp), %r10d
movw %r9w, 0x20(%rsp)
movw %r9w, 0xc(%rsp)
movq (%r12), %rax
movswq %cx, %rsi
movswl (%rax,%rsi,2), %eax
movswl 0x18(%r14), %edx
subl %edx, %eax
imull %r11d, %eax
movswl 0x1a(%r14), %edi
subl %edx, %edi
cltd
idivl %edi
movl %r10d, %edx
subl %eax, %edx
movw %dx, 0xe(%rsp)
movswl %si, %ebp
movl 0x1c(%rsp), %r13d
pushq $0x1
popq %rax
movl %eax, %ebx
movzwl 0x1e(%r14), %esi
cmpl %esi, %ebx
jae 0x15cfd
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rsp)
leal -0x1(%rsi), %edi
movl %r13d, %eax
cltd
idivl %edi
addl %r9d, %eax
movw %ax, 0xc(%rsp)
leal (%rbx,%rbp), %eax
cltd
idivl %esi
movl %edx, %r15d
movq (%r12), %rsi
movswq %r15w, %rdi
movswl (%rsi,%rdi,2), %eax
movswl 0x18(%r14), %edx
subl %edx, %eax
imull %r11d, %eax
movswl 0x1a(%r14), %r8d
subl %edx, %r8d
cltd
idivl %r8d
movl %r10d, %edx
subl %eax, %edx
movw %dx, 0xe(%rsp)
movswq %cx, %rax
cmpw $0x83e8, (%rsi,%rax,2)  # imm = 0x83E8
je 0x15cee
cmpw $0x83e8, (%rsi,%rdi,2)  # imm = 0x83E8
je 0x15cee
leaq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movl 0x24(%rsp), %r8d
callq 0x37138
movl 0x18(%rsp), %r11d
movl 0x10(%rsp), %r10d
movl 0x14(%rsp), %r9d
incl %ebx
addl 0x1c(%rsp), %r13d
movl %r15d, %ecx
jmp 0x15c51
movq %r14, %rdi
movq %r12, %rsi
callq 0x27dc6
movl 0x18(%rsp), %r11d
movq %rax, %r12
jmp 0x15bde
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq