// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_gauge.c
// Function: lv_gauge_set_needle_count
void lv_gauge_set_needle_count(lv_obj_t * gauge, uint8_t needle_cnt, const lv_color_t colors[])
{
    LV_ASSERT_OBJ(gauge, LV_OBJX_NAME);

    lv_gauge_ext_t * ext = lv_obj_get_ext_attr(gauge);

    if(ext->needle_count != needle_cnt) {
        if(ext->values != NULL) {
            lv_mem_free(ext->values);
            ext->values = NULL;
        }

        ext->values = lv_mem_realloc(ext->values, needle_cnt * sizeof(int16_t));
        LV_ASSERT_MEM(ext->values);
        if(ext->values == NULL) return;

        int16_t min = lv_gauge_get_min_value(gauge);
        uint8_t n;
        for(n = ext->needle_count; n < needle_cnt; n++) {
            ext->values[n] = min;
        }

        ext->needle_count = needle_cnt;
    }

    ext->needle_colors = colors;
    lv_obj_invalidate(gauge);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
callq 0x80e4
testb %al, %al
je 0x19d7a
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r15
cmpb %bpl, 0x20(%rax)
je 0x19d66
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x19a6b
callq 0x2a006
movq $0x0, 0x10(%r15)
movzbl %bpl, %r12d
leal (%r12,%r12), %esi
xorl %edi, %edi
callq 0x2a06f
movq %rax, 0x10(%r15)
movq %rax, %rdi
callq 0x80e4
movq 0x10(%r15), %rsi
testb %al, %al
je 0x19d8b
testq %rsi, %rsi
je 0x19d99
movq %rbx, %rdi
callq 0x252dd
movzbl 0x20(%r15), %edx
cmpb %bpl, %dl
jae 0x19d62
movq 0x10(%r15), %rsi
subq %rdx, %r12
leaq 0x7(%r12), %rcx
andq $-0x8, %rcx
decq %r12
movq %r12, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rsi,%rdx,2), %rdx
addq $0xe, %rdx
xorl %esi, %esi
movdqa 0x25d30(%rip), %xmm1    # 0x3f810
movdqa 0x25d38(%rip), %xmm2    # 0x3f820
movdqa 0x25af0(%rip), %xmm3    # 0x3f5e0
movdqa 0x25af8(%rip), %xmm4    # 0x3f5f0
movdqa 0x25b00(%rip), %xmm5    # 0x3f600
pxor %xmm5, %xmm0
pcmpeqd %xmm6, %xmm6
movq %rsi, %xmm7
pshufd $0x44, %xmm7, %xmm7     # xmm7 = xmm7[0,1,0,1]
movdqa %xmm7, %xmm8
por %xmm4, %xmm8
pxor %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm9    # xmm9 = xmm10[0,0,2,2]
pshuflw $0xe8, %xmm9, %xmm11    # xmm11 = xmm9[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm8
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm8, %xmm12    # xmm12 = xmm8[0,2,2,3,4,5,6,7]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pshuflw $0xe8, %xmm10, %xmm11   # xmm11 = xmm10[0,2,2,3,4,5,6,7]
por %xmm12, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
movd %xmm11, %edi
testb $0x1, %dil
je 0x19b78
movw %ax, -0xe(%rdx,%rsi,2)
pand %xmm9, %xmm8
por %xmm10, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
movd %xmm8, %edi
shrl $0x10, %edi
testb $0x1, %dil
je 0x19ba4
movw %ax, -0xc(%rdx,%rsi,2)
movdqa %xmm7, %xmm9
por %xmm3, %xmm9
pxor %xmm5, %xmm9
movdqa %xmm9, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm8    # xmm8 = xmm10[0,0,2,2]
pcmpeqd %xmm0, %xmm9
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
movdqa %xmm9, %xmm11
pand %xmm8, %xmm11
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
por %xmm10, %xmm11
packssdw %xmm11, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x2, %xmm11, %edi
testb $0x1, %dil
je 0x19c03
movw %ax, -0xa(%rdx,%rsi,2)
pshufhw $0x84, %xmm8, %xmm8     # xmm8 = xmm8[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm9, %xmm9     # xmm9 = xmm9[0,1,2,3,4,5,4,6]
pand %xmm8, %xmm9
pshufhw $0x84, %xmm10, %xmm8    # xmm8 = xmm10[0,1,2,3,4,5,4,6]
por %xmm9, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x3, %xmm8, %edi
testb $0x1, %dil
je 0x19c3a
movw %ax, -0x8(%rdx,%rsi,2)
movdqa %xmm7, %xmm8
por %xmm2, %xmm8
pxor %xmm5, %xmm8
movdqa %xmm8, %xmm10
pcmpgtd %xmm0, %xmm10
pshufd $0xa0, %xmm10, %xmm9    # xmm9 = xmm10[0,0,2,2]
pshuflw $0xe8, %xmm9, %xmm11    # xmm11 = xmm9[0,2,2,3,4,5,6,7]
pcmpeqd %xmm0, %xmm8
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
pshuflw $0xe8, %xmm8, %xmm12    # xmm12 = xmm8[0,2,2,3,4,5,6,7]
pand %xmm11, %xmm12
pshufd $0xf5, %xmm10, %xmm10   # xmm10 = xmm10[1,1,3,3]
pshuflw $0xe8, %xmm10, %xmm11   # xmm11 = xmm10[0,2,2,3,4,5,6,7]
por %xmm12, %xmm11
pxor %xmm6, %xmm11
packssdw %xmm11, %xmm11
pextrw $0x4, %xmm11, %edi
testb $0x1, %dil
je 0x19ca1
movw %ax, -0x6(%rdx,%rsi,2)
pand %xmm9, %xmm8
por %xmm10, %xmm8
packssdw %xmm8, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm8
pextrw $0x5, %xmm8, %edi
testb $0x1, %dil
je 0x19ccb
movw %ax, -0x4(%rdx,%rsi,2)
por %xmm1, %xmm7
pxor %xmm5, %xmm7
movdqa %xmm7, %xmm9
pcmpgtd %xmm0, %xmm9
pshufd $0xa0, %xmm9, %xmm8     # xmm8 = xmm9[0,0,2,2]
pcmpeqd %xmm0, %xmm7
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
movdqa %xmm7, %xmm10
pand %xmm8, %xmm10
pshufd $0xf5, %xmm9, %xmm9     # xmm9 = xmm9[1,1,3,3]
por %xmm9, %xmm10
packssdw %xmm10, %xmm10
pxor %xmm6, %xmm10
packssdw %xmm10, %xmm10
pextrw $0x6, %xmm10, %edi
testb $0x1, %dil
je 0x19d21
movw %ax, -0x2(%rdx,%rsi,2)
pshufhw $0x84, %xmm8, %xmm8     # xmm8 = xmm8[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm7, %xmm7     # xmm7 = xmm7[0,1,2,3,4,5,4,6]
pand %xmm8, %xmm7
pshufhw $0x84, %xmm9, %xmm8     # xmm8 = xmm9[0,1,2,3,4,5,4,6]
por %xmm7, %xmm8
pxor %xmm6, %xmm8
packssdw %xmm8, %xmm7
pextrw $0x7, %xmm7, %edi
testb $0x1, %dil
je 0x19d55
movw %ax, (%rdx,%rsi,2)
addq $0x8, %rsi
cmpq %rsi, %rcx
jne 0x19b08
movb %bpl, 0x20(%r15)
movq %r14, 0x18(%r15)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4c4d
leaq 0x25463(%rip), %rdi     # 0x3f1e4
movq %rbx, %rsi
callq 0x8294
jmp 0x19d89
leaq 0x2533e(%rip), %rdi     # 0x3f0d0
callq 0x8294
jmp 0x19d97
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq