// File: /workspace/github_c_makefile_star2_O3/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 0xafb9
movq %rbx, %rdi
callq 0x6af7
movq %rax, %r14
movq %rbx, %rdi
callq 0x566d
movl %eax, %r15d
movq %rbx, %rdi
callq 0x5697
movl %eax, %ebp
movzbl 0x24(%r14), %eax
testb $0x8, %al
jne 0xab90
andl $0x3, %eax
leaq 0x34783(%rip), %rcx     # 0x3f2e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl (%r14), %eax
movswl %r15w, %ecx
imull %eax, %ecx
movslq %ecx, %rax
imulq $-0x49f49f49, %rax, %rcx # imm = 0xB60B60B7
shrq $0x20, %rcx
addl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
shrl $0x8, %eax
addl %ecx, %eax
jmp 0xac7b
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb08b
movzwl %r15w, %ecx
shrl $0xf, %ecx
addl %r15d, %ecx
movswl %cx, %r15d
shrl %r15d
movzwl 0x3e(%rax), %eax
movl %eax, %ecx
shrl $0xf, %ecx
addl %eax, %ecx
movswl %cx, %eax
sarl %eax
movl %r15d, %r12d
subl %eax, %r12d
movq %rbx, %rdi
callq 0x6af7
movzbl 0x24(%rax), %ecx
andl $0x3, %ecx
leaq 0x346f9(%rip), %rdx     # 0x3f2d0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movzwl (%rax), %r13d
jmp 0xac0f
movzbl 0x3(%r14), %eax
jmp 0xac5d
movzbl 0x2(%rax), %eax
jmp 0xabfe
xorl %eax, %eax
jmp 0xac7b
movzbl 0x3(%rax), %eax
imull $0x168, %eax, %eax      # imm = 0x168
imulq $0x28f5c29, %rax, %r13  # imm = 0x28F5C29
shrq $0x20, %r13
movswl %r12w, %r12d
movswl %r13w, %edi
callq 0x2b4d8
cwtl
imull %r12d, %eax
shrl $0xf, %eax
movw %ax, 0x10(%r14)
leal 0x5a(%r13), %eax
movswl %ax, %edi
callq 0x2b4d8
cwtl
imull %r12d, %eax
addw %r15w, 0x10(%r14)
shrl $0xf, %eax
movzwl %bp, %ecx
shrl $0xf, %ecx
addl %ebp, %ecx
movswl %cx, %ecx
sarl %ecx
addl %eax, %ecx
movw %cx, 0x12(%r14)
jmp 0xac90
movzbl 0x2(%r14), %eax
movswl %r15w, %ecx
imull %eax, %ecx
movslq %ecx, %rax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x25, %rax
addl %ecx, %eax
movw %ax, 0x10(%r14)
movzwl %bp, %eax
shrl $0xf, %eax
addl %ebp, %eax
cwtl
shrl %eax
movw %ax, 0x12(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xafb9