// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_chart.c
// Function: lv_chart_set_point_count
void lv_chart_set_point_count(lv_obj_t * chart, uint16_t point_cnt)
{
    LV_ASSERT_OBJ(chart, LV_OBJX_NAME);

    lv_chart_ext_t * ext = lv_obj_get_ext_attr(chart);
    if(ext->point_cnt == point_cnt) return;

    lv_chart_series_t * ser;
    uint16_t point_cnt_old = ext->point_cnt;
    uint16_t i;
    lv_coord_t def = LV_CHART_POINT_DEF;

    if(point_cnt < 1) point_cnt = 1;

    LV_LL_READ_BACK(ext->series_ll, ser)
    {
        if(ser->start_point != 0) {
            lv_coord_t * new_points = lv_mem_alloc(sizeof(lv_coord_t) * point_cnt);
            LV_ASSERT_MEM(new_points);
            if(new_points == NULL) return;

            if(point_cnt >= point_cnt_old) {
                for(i = 0; i < point_cnt_old; i++) {
                    new_points[i] =
                        ser->points[(i + ser->start_point) % point_cnt_old]; /*Copy old contents to new array*/
                }
                for(i = point_cnt_old; i < point_cnt; i++) {
                    new_points[i] = def; /*Fill up the rest with default value*/
                }
            } else {
                for(i = 0; i < point_cnt; i++) {
                    new_points[i] =
                        ser->points[(i + ser->start_point) % point_cnt_old]; /*Copy old contents to new array*/
                }
            }

            /*Switch over pointer from old to new*/
            lv_mem_free(ser->points);
            ser->points = new_points;
        } else {
            ser->points = lv_mem_realloc(ser->points, sizeof(lv_coord_t) * point_cnt);
            LV_ASSERT_MEM(ser->points);
            if(ser->points == NULL) return;
            /*Initialize the new points*/
            if(point_cnt > point_cnt_old) {
                for(i = point_cnt_old - 1; i < point_cnt; i++) {
                    ser->points[i] = def;
                }
            }
        }

        ser->start_point = 0;
    }

    ext->point_cnt = point_cnt;

    lv_chart_refresh(chart);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, %ebp
movq %rdi, %rbx
callq 0x80e4
testb %al, %al
je 0x162d3
movq %rbx, 0x30(%rsp)
movq %rbx, %rdi
callq 0x6af7
movq %rax, 0x10(%rsp)
movzwl 0x1e(%rax), %r12d
cmpw %bp, %r12w
jne 0x162e4
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28f0a(%rip), %rdi     # 0x3f1e4
movq %rbx, %rsi
callq 0x8294
jmp 0x162e2
cmpw $0x2, %bp
movl $0x1, %eax
cmovael %ebp, %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rdi
callq 0x2a458
testq %rax, %rax
je 0x16977
movq %rax, %r15
movzwl 0xc(%rsp), %r14d
cmpw %r12w, %r14w
setbe %cl
leal -0x1(%r12), %eax
cmpw %r14w, %ax
setae %sil
movzwl %bp, %edx
movzwl %ax, %eax
orb %cl, %sil
movb %sil, 0xb(%rsp)
leaq 0x1(%rax), %rcx
cmpq %rdx, %rcx
cmovbeq %rdx, %rcx
leal (%r14,%r14), %esi
movq %rsi, 0x18(%rsp)
movl %r12d, %ebp
subq %rax, %rcx
leaq 0x1(%rbp), %rsi
cmpq %rdx, %rsi
cmovaq %rsi, %rdx
subq %rbp, %rdx
leaq 0x7(%rdx), %rsi
andq $-0x8, %rsi
movq %rsi, 0x38(%rsp)
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, 0x40(%rsp)
leaq 0x7(%rcx), %rbx
andq $-0x8, %rbx
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq 0xe(,%rbp,2), %rcx
movq %rcx, 0x20(%rsp)
leaq 0xe(,%rax,2), %rax
movq %rax, 0x28(%rsp)
pxor 0x2924f(%rip), %xmm0    # 0x3f600
movdqa %xmm0, 0x50(%rsp)
cmpw $0x0, 0xa(%r15)
je 0x16430
movq 0x18(%rsp), %rdi
callq 0x29f85
movq %rax, %r13
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x1699c
testq %r13, %r13
movdqa 0x29208(%rip), %xmm11   # 0x3f5f0
movdqa 0x2920f(%rip), %xmm12   # 0x3f600
pcmpeqd %xmm13, %xmm13
je 0x162c4
cmpw %r12w, 0xc(%rsp)
jae 0x166c4
movq (%r15), %rcx
xorl %esi, %esi
movzwl 0xa(%r15), %eax
addl %esi, %eax
xorl %edx, %edx
divl %r12d
movzwl (%rcx,%rdx,2), %eax
movw %ax, (%r13,%rsi,2)
incq %rsi
cmpq %rsi, %r14
jne 0x1640d
jmp 0x1694c
movq (%r15), %rdi
movq 0x18(%rsp), %rsi
callq 0x2a06f
movq %rax, (%r15)
movq %rax, %rdi
callq 0x80e4
movq (%r15), %rsi
testb %al, %al
je 0x169ad
testq %rsi, %rsi
movdqa 0x29191(%rip), %xmm10   # 0x3f5f0
movdqa 0x29198(%rip), %xmm11   # 0x3f600
pcmpeqd %xmm12, %xmm12
je 0x162c4
cmpb $0x0, 0xb(%rsp)
movdqa 0x50(%rsp), %xmm6
movdqa 0x2938a(%rip), %xmm7    # 0x3f810
movdqa 0x29391(%rip), %xmm8    # 0x3f820
movdqa 0x29148(%rip), %xmm9    # 0x3f5e0
jne 0x16957
addq 0x28(%rsp), %rsi
xorl %eax, %eax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm10, %xmm1
pxor %xmm11, %xmm1
movdqa %xmm1, %xmm3
pcmpgtd %xmm6, %xmm3
pshufd $0xa0, %xmm3, %xmm2     # xmm2 = xmm3[0,0,2,2]
pshuflw $0xe8, %xmm2, %xmm4     # xmm4 = xmm2[0,2,2,3,4,5,6,7]
pcmpeqd %xmm6, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pshuflw $0xe8, %xmm1, %xmm5     # xmm5 = xmm1[0,2,2,3,4,5,6,7]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pshuflw $0xe8, %xmm3, %xmm4     # xmm4 = xmm3[0,2,2,3,4,5,6,7]
por %xmm5, %xmm4
pxor %xmm12, %xmm4
packssdw %xmm4, %xmm4
movd %xmm4, %ecx
testb $0x1, %cl
je 0x16508
movw $0x83e8, -0xe(%rsi,%rax,2) # imm = 0x83E8
pand %xmm2, %xmm1
por %xmm3, %xmm1
packssdw %xmm1, %xmm1
pxor %xmm12, %xmm1
packssdw %xmm1, %xmm1
movd %xmm1, %ecx
shrl $0x10, %ecx
testb $0x1, %cl
je 0x16530
movw $0x83e8, -0xc(%rsi,%rax,2) # imm = 0x83E8
movdqa %xmm0, %xmm2
por %xmm9, %xmm2
pxor %xmm11, %xmm2
movdqa %xmm2, %xmm3
pcmpgtd %xmm6, %xmm3
pshufd $0xa0, %xmm3, %xmm1     # xmm1 = xmm3[0,0,2,2]
pcmpeqd %xmm6, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
movdqa %xmm2, %xmm4
pand %xmm1, %xmm4
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
por %xmm3, %xmm4
packssdw %xmm4, %xmm4
pxor %xmm12, %xmm4
packssdw %xmm4, %xmm4
pextrw $0x2, %xmm4, %ecx
testb $0x1, %cl
je 0x16583
movw $0x83e8, -0xa(%rsi,%rax,2) # imm = 0x83E8
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pand %xmm1, %xmm2
pshufhw $0x84, %xmm3, %xmm1     # xmm1 = xmm3[0,1,2,3,4,5,4,6]
por %xmm2, %xmm1
pxor %xmm12, %xmm1
packssdw %xmm1, %xmm1
pextrw $0x3, %xmm1, %ecx
testb $0x1, %cl
je 0x165b4
movw $0x83e8, -0x8(%rsi,%rax,2) # imm = 0x83E8
movdqa %xmm0, %xmm1
por %xmm8, %xmm1
pxor %xmm11, %xmm1
movdqa %xmm1, %xmm3
pcmpgtd %xmm6, %xmm3
pshufd $0xa0, %xmm3, %xmm2     # xmm2 = xmm3[0,0,2,2]
pshuflw $0xe8, %xmm2, %xmm4     # xmm4 = xmm2[0,2,2,3,4,5,6,7]
pcmpeqd %xmm6, %xmm1
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pshuflw $0xe8, %xmm1, %xmm5     # xmm5 = xmm1[0,2,2,3,4,5,6,7]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
pshuflw $0xe8, %xmm3, %xmm4     # xmm4 = xmm3[0,2,2,3,4,5,6,7]
por %xmm5, %xmm4
pxor %xmm12, %xmm4
packssdw %xmm4, %xmm4
pextrw $0x4, %xmm4, %ecx
testb $0x1, %cl
je 0x1660e
movw $0x83e8, -0x6(%rsi,%rax,2) # imm = 0x83E8
pand %xmm2, %xmm1
por %xmm3, %xmm1
packssdw %xmm1, %xmm1
pxor %xmm12, %xmm1
packssdw %xmm1, %xmm1
pextrw $0x5, %xmm1, %ecx
testb $0x1, %cl
je 0x16634
movw $0x83e8, -0x4(%rsi,%rax,2) # imm = 0x83E8
por %xmm7, %xmm0
pxor %xmm11, %xmm0
movdqa %xmm0, %xmm2
pcmpgtd %xmm6, %xmm2
pshufd $0xa0, %xmm2, %xmm1     # xmm1 = xmm2[0,0,2,2]
pcmpeqd %xmm6, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
movdqa %xmm0, %xmm3
pand %xmm1, %xmm3
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
por %xmm2, %xmm3
packssdw %xmm3, %xmm3
pxor %xmm12, %xmm3
packssdw %xmm3, %xmm3
pextrw $0x6, %xmm3, %ecx
testb $0x1, %cl
je 0x16682
movw $0x83e8, -0x2(%rsi,%rax,2) # imm = 0x83E8
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
pand %xmm1, %xmm0
pshufhw $0x84, %xmm2, %xmm1     # xmm1 = xmm2[0,1,2,3,4,5,4,6]
por %xmm0, %xmm1
pxor %xmm12, %xmm1
packssdw %xmm1, %xmm0
pextrw $0x7, %xmm0, %ecx
testb $0x1, %cl
je 0x166b2
movw $0x83e8, (%rsi,%rax,2)  # imm = 0x83E8
addq $0x8, %rax
cmpq %rax, %rbx
jne 0x164a5
jmp 0x16957
testl %r12d, %r12d
movq 0x38(%rsp), %rdi
movdqa 0x40(%rsp), %xmm7
movdqa 0x29135(%rip), %xmm8    # 0x3f810
movdqa 0x2913c(%rip), %xmm9    # 0x3f820
movdqa 0x28ef3(%rip), %xmm10   # 0x3f5e0
je 0x16712
movq (%r15), %rcx
xorl %esi, %esi
movzwl 0xa(%r15), %eax
addl %esi, %eax
xorl %edx, %edx
divl %r12d
movzwl (%rcx,%rdx,2), %eax
movw %ax, (%r13,%rsi,2)
incq %rsi
cmpq %rsi, %rbp
jne 0x166f4
cmpw 0xc(%rsp), %r12w
jae 0x1694c
movq %r13, %rax
addq 0x20(%rsp), %rax
xorl %ecx, %ecx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm2
por %xmm11, %xmm2
movdqa %xmm7, %xmm1
pxor %xmm12, %xmm1
pxor %xmm12, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm13, %xmm5
packssdw %xmm5, %xmm5
movd %xmm5, %edx
testb $0x1, %dl
je 0x16794
movw $0x83e8, -0xe(%rax,%rcx,2) # imm = 0x83E8
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm13, %xmm2
packssdw %xmm2, %xmm2
movd %xmm2, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x167bc
movw $0x83e8, -0xc(%rax,%rcx,2) # imm = 0x83E8
movdqa %xmm0, %xmm3
por %xmm10, %xmm3
pxor %xmm12, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm2     # xmm2 = xmm4[0,0,2,2]
pcmpeqd %xmm1, %xmm3
pshufd $0xf5, %xmm3, %xmm3     # xmm3 = xmm3[1,1,3,3]
movdqa %xmm3, %xmm5
pand %xmm2, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
por %xmm4, %xmm5
packssdw %xmm5, %xmm5
pxor %xmm13, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x2, %xmm5, %edx
testb $0x1, %dl
je 0x1680f
movw $0x83e8, -0xa(%rax,%rcx,2) # imm = 0x83E8
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm3, %xmm3     # xmm3 = xmm3[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm3
pshufhw $0x84, %xmm4, %xmm2     # xmm2 = xmm4[0,1,2,3,4,5,4,6]
por %xmm3, %xmm2
pxor %xmm13, %xmm2
packssdw %xmm2, %xmm2
pextrw $0x3, %xmm2, %edx
testb $0x1, %dl
je 0x16840
movw $0x83e8, -0x8(%rax,%rcx,2) # imm = 0x83E8
movdqa %xmm0, %xmm2
por %xmm9, %xmm2
pxor %xmm12, %xmm2
movdqa %xmm2, %xmm4
pcmpgtd %xmm1, %xmm4
pshufd $0xa0, %xmm4, %xmm3     # xmm3 = xmm4[0,0,2,2]
pshuflw $0xe8, %xmm3, %xmm5     # xmm5 = xmm3[0,2,2,3,4,5,6,7]
pcmpeqd %xmm1, %xmm2
pshufd $0xf5, %xmm2, %xmm2     # xmm2 = xmm2[1,1,3,3]
pshuflw $0xe8, %xmm2, %xmm6     # xmm6 = xmm2[0,2,2,3,4,5,6,7]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pshuflw $0xe8, %xmm4, %xmm5     # xmm5 = xmm4[0,2,2,3,4,5,6,7]
por %xmm6, %xmm5
pxor %xmm13, %xmm5
packssdw %xmm5, %xmm5
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x1689a
movw $0x83e8, -0x6(%rax,%rcx,2) # imm = 0x83E8
pand %xmm3, %xmm2
por %xmm4, %xmm2
packssdw %xmm2, %xmm2
pxor %xmm13, %xmm2
packssdw %xmm2, %xmm2
pextrw $0x5, %xmm2, %edx
testb $0x1, %dl
je 0x168c0
movw $0x83e8, -0x4(%rax,%rcx,2) # imm = 0x83E8
por %xmm8, %xmm0
pxor %xmm12, %xmm0
movdqa %xmm0, %xmm3
pcmpgtd %xmm1, %xmm3
pshufd $0xa0, %xmm3, %xmm2     # xmm2 = xmm3[0,0,2,2]
pcmpeqd %xmm1, %xmm0
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
movdqa %xmm0, %xmm4
pand %xmm2, %xmm4
pshufd $0xf5, %xmm3, %xmm1     # xmm1 = xmm3[1,1,3,3]
por %xmm1, %xmm4
packssdw %xmm4, %xmm3
pxor %xmm13, %xmm3
packssdw %xmm3, %xmm3
pextrw $0x6, %xmm3, %edx
testb $0x1, %dl
je 0x1690f
movw $0x83e8, -0x2(%rax,%rcx,2) # imm = 0x83E8
pshufhw $0x84, %xmm2, %xmm2     # xmm2 = xmm2[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm0, %xmm0     # xmm0 = xmm0[0,1,2,3,4,5,4,6]
pand %xmm2, %xmm0
pshufhw $0x84, %xmm1, %xmm1     # xmm1 = xmm1[0,1,2,3,4,5,4,6]
por %xmm0, %xmm1
pxor %xmm13, %xmm1
packssdw %xmm1, %xmm0
pextrw $0x7, %xmm0, %edx
testb $0x1, %dl
je 0x1693f
movw $0x83e8, (%rax,%rcx,2)  # imm = 0x83E8
addq $0x8, %rcx
cmpq %rcx, %rdi
jne 0x16728
movq (%r15), %rdi
callq 0x2a006
movq %r13, (%r15)
movw $0x0, 0xa(%r15)
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x2a369
movq %rax, %r15
testq %rax, %rax
jne 0x163b7
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
movw %cx, 0x1e(%rax)
movq 0x30(%rsp), %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1621b
leaq 0x2872d(%rip), %rdi     # 0x3f0d0
movq %r13, %rsi
callq 0x8294
jmp 0x169ab
leaq 0x2871c(%rip), %rdi     # 0x3f0d0
callq 0x8294
jmp 0x169b9