// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_cpicker.c
// Function: refr_indic_pos
static void refr_indic_pos(lv_obj_t * cpicker)
{
    invalidate_indic(cpicker);

    lv_cpicker_ext_t * ext = lv_obj_get_ext_attr(cpicker);
    lv_coord_t w = lv_obj_get_width(cpicker);
    lv_coord_t h = lv_obj_get_height(cpicker);

    if(ext->type == LV_CPICKER_TYPE_RECT) {
        lv_coord_t ind_pos = 0;
        switch(ext->color_mode) {
        case LV_CPICKER_COLOR_MODE_HUE:
            ind_pos += (ext->hsv.h * w) / 360;
            break;
        case LV_CPICKER_COLOR_MODE_SATURATION:
            ind_pos += (ext->hsv.s * w) / 100;
            break;
        case LV_CPICKER_COLOR_MODE_VALUE:
            ind_pos += (ext->hsv.v * w) / 100;
            break;
        }

        ext->indic.pos.x = ind_pos;
        ext->indic.pos.y = h / 2;
    } else if(ext->type == LV_CPICKER_TYPE_DISC) {
        const lv_style_t * style_main = lv_cpicker_get_style(cpicker, LV_CPICKER_STYLE_MAIN);
        lv_coord_t r = w / 2 - style_main->line.width / 2;
        uint16_t angle = get_angle(cpicker);
        ext->indic.pos.x = (((int32_t)r * lv_trigo_sin(angle)) >> LV_TRIGO_SHIFT);
        ext->indic.pos.y = (((int32_t)r * lv_trigo_sin(angle + 90)) >> LV_TRIGO_SHIFT);
        ext->indic.pos.x = ext->indic.pos.x + w / 2;
        ext->indic.pos.y = ext->indic.pos.y + h / 2;
    }

    invalidate_indic(cpicker);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xa699
movq %rbx, %rdi
callq 0x6747
movq %rax, %r14
movq %rbx, %rdi
callq 0x5308
movl %eax, %r15d
movq %rbx, %rdi
callq 0x5332
movl %eax, %ebp
movzbl 0x24(%r14), %eax
testb $0x8, %al
jne 0xa28f
andl $0x3, %eax
leaq 0x30fcf(%rip), %rcx     # 0x3b240
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl (%r14), %ecx
movswl %r15w, %eax
imull %ecx, %eax
movl $0x168, %ecx            # imm = 0x168
jmp 0xa360
movq %rbx, %rdi
xorl %esi, %esi
callq 0xa76b
movq %rax, %rcx
movw $0x2, %si
movl %r15d, %eax
cwtd
idivw %si
movl %eax, %r15d
movzwl 0x3e(%rcx), %eax
cwtd
movw $0xfffe, %cx            # imm = 0xFFFE
idivw %cx
movl %eax, %r12d
addl %r15d, %r12d
movq %rbx, %rdi
callq 0x6747
movzbl 0x24(%rax), %ecx
andl $0x3, %ecx
leaq 0x30f5c(%rip), %rdx     # 0x3b230
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzwl (%rax), %r13d
jmp 0xa308
movzbl 0x3(%r14), %ecx
jmp 0xa356
movzbl 0x2(%rax), %eax
jmp 0xa2f8
xorl %eax, %eax
jmp 0xa363
movzbl 0x3(%rax), %eax
imull $0x168, %eax, %eax      # imm = 0x168
pushq $0x64
popq %rcx
xorl %edx, %edx
divl %ecx
movl %eax, %r13d
movswl %r12w, %r12d
movswl %r13w, %edi
callq 0x28d8c
cwtl
imull %r12d, %eax
shrl $0xf, %eax
movw %ax, 0x10(%r14)
leal 0x5a(%r13), %eax
movswl %ax, %edi
callq 0x28d8c
movswl %ax, %ecx
imull %r12d, %ecx
shrl $0xf, %ecx
addw %r15w, 0x10(%r14)
movw $0x2, %si
movl %ebp, %eax
cwtd
idivw %si
addl %ecx, %eax
movw %ax, 0x12(%r14)
jmp 0xa378
movzbl 0x2(%r14), %ecx
movswl %r15w, %eax
imull %ecx, %eax
pushq $0x64
popq %rcx
cltd
idivl %ecx
movw %ax, 0x10(%r14)
movl %ebp, %eax
cwtd
movw $0x2, %cx
idivw %cx
movw %ax, 0x12(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa699