// File: /workspace/github_c_makefile_star2_O1/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 0x6ad8
movq %rax, %r14
movq %r15, %rdi
callq 0x5651
movl %eax, %r12d
movq %r15, %rdi
callq 0x567b
movl %eax, %r13d
movzwl 0x20(%r15), %eax
movl %eax, 0x14(%rsp)
movzwl 0x22(%r15), %ebx
movq %r15, %rdi
callq 0x69cc
movb %al, 0xf(%rsp)
leaq 0x4920f(%rip), %rsi     # 0x5ff18
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x798d
movb 0x5f(%r14), %al
movb %al, 0x40(%r15)
movzwl 0x5c(%r14), %eax
movw %ax, 0x3e(%r15)
movq %r14, %rdi
callq 0x29e0b
testq %rax, %rax
je 0x16e93
movl %ebx, %r10d
movq %rax, %r15
movswl %r13w, %r11d
addl %r13d, %r10d
movswl %r12w, %eax
movl %eax, 0x20(%rsp)
movl %r10d, 0x1c(%rsp)
movl %r11d, 0x18(%rsp)
movzwl 0x8(%r15), %eax
movw %ax, 0x6c(%rsp)
testb $0x1, 0x5a(%r14)
jne 0x16d70
movzwl 0xa(%r15), %r12d
jmp 0x16d73
xorl %r12d, %r12d
movl 0x14(%rsp), %r9d
movw %r9w, 0x24(%rsp)
movw %r9w, 0x10(%rsp)
movq (%r15), %rax
movswq %r12w, %rcx
movswl (%rax,%rcx,2), %eax
movswl 0x18(%r14), %ecx
subl %ecx, %eax
imull %r11d, %eax
movswl 0x1a(%r14), %esi
subl %ecx, %esi
cltd
idivl %esi
movl %r10d, %ecx
subl %eax, %ecx
movw %cx, 0x12(%rsp)
movzwl 0x1e(%r14), %eax
cmpw $0x2, %ax
jb 0x16e72
movswl %r12w, %ebp
movl $0x1, %ebx
movl 0x20(%rsp), %r13d
movl 0x10(%rsp), %edx
movl %edx, 0x24(%rsp)
movzwl %ax, %esi
leal -0x1(%rsi), %edi
movl %r13d, %eax
cltd
idivl %edi
addl %r9d, %eax
movw %ax, 0x10(%rsp)
leal (%rbx,%rbp), %eax
cltd
idivl %esi
movq (%r15), %rsi
movswq %r12w, %rdi
movl %edx, %r12d
movswq %r12w, %rcx
movswl (%rsi,%rcx,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, 0x12(%rsp)
cmpw $0x83e8, (%rsi,%rdi,2)  # imm = 0x83E8
je 0x16e5e
cmpw $0x83e8, (%rsi,%rcx,2)  # imm = 0x83E8
je 0x16e5e
movzbl 0xf(%rsp), %r8d
leaq 0x24(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
callq 0x3a7b0
movl 0x18(%rsp), %r11d
movl 0x1c(%rsp), %r10d
movl 0x14(%rsp), %r9d
incl %ebx
movzwl 0x1e(%r14), %eax
addl 0x20(%rsp), %r13d
cmpl %eax, %ebx
jb 0x16dcb
movq %r14, %rdi
movq %r15, %rsi
callq 0x29cdb
movl 0x18(%rsp), %r11d
movl 0x1c(%rsp), %r10d
movq %rax, %r15
testq %rax, %rax
jne 0x16d58
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq