// File: /workspace/github_c_makefile_star2_O3/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 0x6af7
movq %rax, %r14
movq %r15, %rdi
callq 0x566d
movl %eax, %r12d
movq %r15, %rdi
callq 0x5697
movl %eax, %r13d
movzwl 0x20(%r15), %eax
movl %eax, 0x14(%rsp)
movzwl 0x22(%r15), %eax
movl %eax, 0x18(%rsp)
movq %r15, %rdi
callq 0x69eb
movb %al, 0xf(%rsp)
leaq 0x48cd2(%rip), %rsi     # 0x5ff18
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x799d
movb 0x5f(%r14), %al
movb %al, 0x40(%r15)
movzwl 0x5c(%r14), %eax
movw %ax, 0x3e(%r15)
movq %r14, %rdi
callq 0x2a458
testq %rax, %rax
je 0x173c4
movq %rax, %r15
movswl %r13w, %eax
movl %eax, 0x20(%rsp)
addl %r13d, 0x18(%rsp)
movswl %r12w, %eax
movl %eax, 0x1c(%rsp)
movzwl 0x8(%r15), %eax
movw %ax, 0x6c(%rsp)
testb $0x1, 0x5a(%r14)
jne 0x172a6
movzwl 0xa(%r15), %r13d
jmp 0x172a9
xorl %r13d, %r13d
movl 0x14(%rsp), %r11d
movw %r11w, 0x24(%rsp)
movw %r11w, 0x10(%rsp)
movq (%r15), %rax
movswq %r13w, %rcx
movswl (%rax,%rcx,2), %eax
movswl 0x18(%r14), %ecx
subl %ecx, %eax
imull 0x20(%rsp), %eax
movswl 0x1a(%r14), %esi
subl %ecx, %esi
cltd
idivl %esi
movl 0x18(%rsp), %ecx
subl %eax, %ecx
movw %cx, 0x12(%rsp)
movzwl 0x1e(%r14), %ecx
cmpw $0x2, %cx
jb 0x173ad
movswl %r13w, %ebp
movl $0x1, %ebx
movl 0x1c(%rsp), %r12d
movl %r13d, %edi
movl 0x10(%rsp), %eax
movl %eax, 0x24(%rsp)
movzwl %cx, %esi
leal -0x1(%rsi), %r8d
movl %r12d, %eax
cltd
idivl %r8d
addl %r11d, %eax
movw %ax, 0x10(%rsp)
leal (%rbx,%rbp), %eax
cltd
idivl %esi
movq (%r15), %r8
movl %edx, %r13d
movswq %r13w, %r9
movswl (%r8,%r9,2), %eax
movswl 0x18(%r14), %edx
subl %edx, %eax
imull 0x20(%rsp), %eax
movswl 0x1a(%r14), %r10d
subl %edx, %r10d
cltd
idivl %r10d
movl 0x18(%rsp), %edx
subl %eax, %edx
movw %dx, 0x12(%rsp)
movswq %di, %rax
cmpw $0x83e8, (%r8,%rax,2)   # imm = 0x83E8
je 0x1739e
cmpw $0x83e8, (%r8,%r9,2)    # imm = 0x83E8
je 0x1739e
movzbl 0xf(%rsp), %r8d
leaq 0x24(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x3ad34
movl 0x14(%rsp), %r11d
movzwl 0x1e(%r14), %ecx
movzwl %cx, %esi
incl %ebx
addl 0x1c(%rsp), %r12d
cmpl %esi, %ebx
jb 0x17303
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a369
movq %rax, %r15
testq %rax, %rax
jne 0x1728e
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq