// File: /workspace/github_c_makefile_star2_O3/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 0x80e4
testb %al, %al
je 0x16bf3
movq %rbx, %rdi
callq 0x80e4
testb %al, %al
je 0x16c04
movq %r14, %rdi
callq 0x6af7
movq %rax, %r15
movq (%rbx), %rax
movzwl 0xa(%rbx), %ecx
testb $0x1, 0x5a(%r15)
movw %bp, (%rax,%rcx,2)
jne 0x16c15
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 0x1621b
leaq 0x285ea(%rip), %rdi     # 0x3f1e4
movq %r14, %rsi
callq 0x8294
jmp 0x16c02
leaq 0x285d9(%rip), %rdi     # 0x3f1e4
movq %rbx, %rsi
callq 0x8294
jmp 0x16c13
movb 0x20(%r15), %al
testb $0x1, %al
je 0x16c2d
movzwl 0xa(%rbx), %esi
movq %r14, %rdi
callq 0x16d85
movb 0x20(%r15), %al
testb $0x2, %al
je 0x16cc4
movzwl 0xa(%rbx), %ebp
movq %r14, %rdi
callq 0x6af7
movq %rax, %r12
movq %r14, %rdi
callq 0x566d
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 $0xffff, %eax           # imm = 0xFFFF
movl %r12d, %edx
andl %eax, %edx
shrl $0xf, %edx
addl %r12d, %edx
movswl %dx, %esi
shrl %esi
andl %eax, %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 0x542b
movw %bp, (%r13)
addl %r12d, %ebp
movw %bp, 0x4(%r13)
movq %r14, %rdi
callq 0x5061
movq %rax, %rdi
movq %r13, %rsi
callq 0x7170
movb 0x20(%r15), %al
testb $0x4, %al
je 0x16d3f
movzwl 0xa(%rbx), %r12d
movq %r14, %rdi
callq 0x6af7
movq %rax, %r13
movq %r14, %rdi
callq 0x566d
movl %eax, %ebp
movzwl 0x20(%r14), %eax
movw %ax, 0xe(%rsp)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x542b
movswl %bp, %eax
imull %r12d, %eax
movzwl 0x1e(%r13), %ecx
decl %ecx
cltd
idivl %ecx
addw 0xe(%rsp), %ax
movl 0x5c(%r13), %ecx
leal (%rax,%rcx), %edx
leaq 0x10(%rsp), %r12
movw %dx, 0x4(%r12)
subl %ecx, %eax
movw %ax, (%r12)
movq %r14, %rdi
callq 0x5061
movq %rax, %rdi
movq %r12, %rsi
callq 0x7170
movb 0x20(%r15), %al
testb $0x8, %al
je 0x16d53
movzwl 0xa(%rbx), %esi
movq %r14, %rdi
callq 0x16d85
movb 0x20(%r15), %al
testb $0x10, %al
je 0x16d63
movzwl 0xa(%rbx), %esi
movq %r14, %rdi
callq 0x16d85
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