// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x80d4
testb %al, %al
je 0x166ca
movq %rbx, %rdi
callq 0x80d4
testb %al, %al
je 0x166db
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r15
movq (%rbx), %rax
movzwl 0xa(%rbx), %ecx
testb $0x1, 0x5a(%r15)
movw %bp, (%rax,%rcx,2)
jne 0x166ec
movzwl 0xa(%rbx), %eax
incl %eax
movzwl 0x1e(%r15), %ecx
xorl %edx, %edx
divl %ecx
movw %dx, 0xa(%rbx)
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16216
leaq 0x28a63(%rip), %rdi     # 0x3f134
movq %r14, %rsi
callq 0x829e
jmp 0x166d9
leaq 0x28a52(%rip), %rdi     # 0x3f134
movq %rbx, %rsi
callq 0x829e
jmp 0x166ea
testb $0x1, 0x20(%r15)
je 0x166ff
movzwl 0xa(%rbx), %esi
movq %r14, %rdi
callq 0x1684c
testb $0x2, 0x20(%r15)
je 0x16783
movzwl 0xa(%rbx), %ebp
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r12
movq %r14, %rdi
callq 0x5651
movswl %ax, %ecx
movzbl 0x5e(%r12), %esi
incl %esi
movzwl 0x1e(%r12), %edi
imull %edi, %esi
movl %ecx, %eax
cltd
idivl %esi
movl %eax, %r12d
movl %eax, %esi
shrl $0x1f, %esi
addl %eax, %esi
sarl %esi
imull %ecx, %ebp
movl %ebp, %eax
cltd
idivl %edi
movzwl 0x20(%r14), %ebp
addl %eax, %ebp
addl %esi, %ebp
leaq 0x10(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
callq 0x5427
movw %bp, (%r13)
addl %r12d, %ebp
movw %bp, 0x4(%r13)
movq %r14, %rdi
callq 0x5033
movq %rax, %rdi
movq %r13, %rsi
callq 0x7184
testb $0x4, 0x20(%r15)
je 0x16804
movzwl 0xa(%rbx), %eax
movl %eax, 0xc(%rsp)
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r13
movq %r14, %rdi
callq 0x5651
movl %eax, %ebp
movzwl 0x20(%r14), %eax
movw %ax, 0xa(%rsp)
leaq 0x10(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x5427
movswl %bp, %eax
imull 0xc(%rsp), %eax
movzwl 0x1e(%r13), %ecx
decl %ecx
cltd
idivl %ecx
addw 0xa(%rsp), %ax
movw %ax, (%r12)
movl 0x5c(%r13), %ecx
leal (%rax,%rcx), %edx
movw %dx, 0x4(%r12)
subl %ecx, %eax
movw %ax, (%r12)
movq %r14, %rdi
callq 0x5033
movq %rax, %rdi
movq %r12, %rsi
callq 0x7184
testb $0x8, 0x20(%r15)
je 0x16817
movzwl 0xa(%rbx), %esi
movq %r14, %rdi
callq 0x1684c
testb $0x10, 0x20(%r15)
je 0x1682a
movzwl 0xa(%rbx), %esi
movq %r14, %rdi
callq 0x1684c
movzwl 0xa(%rbx), %eax
incl %eax
movzwl 0x1e(%r15), %ecx
xorl %edx, %edx
divl %ecx
movw %dx, 0xa(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq