// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_chart.c
// Function: lv_chart_set_next
void lv_chart_set_next(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t y)
{
    LV_ASSERT_OBJ(chart, LV_OBJX_NAME);
    LV_ASSERT_NULL(ser);

    lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
    if(ext->update_mode == LV_CHART_UPDATE_MODE_SHIFT) {
        ser->points[ser->start_point] =
            y; /*This was the place of the former left most value, after shifting it is the rightmost*/
        ser->start_point = (ser->start_point + 1) % ext->point_cnt;
        lv_chart_refresh(chart);
    } else if(ext->update_mode == LV_CHART_UPDATE_MODE_CIRCULAR) {
        ser->points[ser->start_point] = y;

        if(ext->type & LV_CHART_TYPE_LINE) lv_chart_inv_lines(chart, ser->start_point);
        if(ext->type & LV_CHART_TYPE_COLUMN) lv_chart_inv_cols(chart, ser->start_point);
        if(ext->type & LV_CHART_TYPE_POINT) lv_chart_inv_points(chart, ser->start_point);
        if(ext->type & LV_CHART_TYPE_VERTICAL_LINE) lv_chart_inv_lines(chart, ser->start_point);
        if(ext->type & LV_CHART_TYPE_AREA) lv_chart_inv_lines(chart, ser->start_point);

        ser->start_point = (ser->start_point + 1) % ext->point_cnt; /*update the x for next incoming y*/
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x23f26
movq -0x8(%rbp), %rsi
leaq 0x441dd(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x23f24
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x23f45
movq -0x10(%rbp), %rsi
leaq 0x441be(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x23f43
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x5a(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x23fa9
movw -0x12(%rbp), %dx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
movw %dx, (%rax,%rcx,2)
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
movzwl 0x1e(%rcx), %ecx
cltd
idivl %ecx
movw %dx, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x8(%rbp), %rdi
callq 0x238d0
jmp 0x2409d
movq -0x20(%rbp), %rax
movb 0x5a(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x2409b
movw -0x12(%rbp), %dx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
movw %dx, (%rax,%rcx,2)
movq -0x20(%rbp), %rax
movzbl 0x20(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x23ff6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %esi
callq 0x240b0
movq -0x20(%rbp), %rax
movzbl 0x20(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x24017
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %esi
callq 0x24220
movq -0x20(%rbp), %rax
movzbl 0x20(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x24038
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %esi
callq 0x242f0
movq -0x20(%rbp), %rax
movzbl 0x20(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x24059
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %esi
callq 0x240b0
movq -0x20(%rbp), %rax
movzbl 0x20(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x2407a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %esi
callq 0x240b0
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
movzwl 0x1e(%rcx), %ecx
cltd
idivl %ecx
movw %dx, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
jmp 0x2409d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)