// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x11790
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movb 0x24(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x11194
movw $0x0, -0x16(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x24(%rax), %eax
andl $0x3, %eax
movl %eax, -0x28(%rbp)
je 0x11100
jmp 0x110ec
movl -0x28(%rbp), %eax
subl $0x1, %eax
je 0x11124
jmp 0x110f6
movl -0x28(%rbp), %eax
subl $0x2, %eax
je 0x11149
jmp 0x1116c
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
movswl -0x12(%rbp), %ecx
imull %ecx, %eax
movl $0x168, %ecx            # imm = 0x168
cltd
idivl %ecx
movl %eax, %ecx
movswl -0x16(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x16(%rbp)
jmp 0x1116c
movq -0x10(%rbp), %rax
movzbl 0x2(%rax), %eax
movswl -0x12(%rbp), %ecx
imull %ecx, %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movswl -0x16(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x16(%rbp)
jmp 0x1116c
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %eax
movswl -0x12(%rbp), %ecx
imull %ecx, %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movswl -0x16(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x16(%rbp)
movw -0x16(%rbp), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x10(%rax)
movswl -0x14(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x12(%rax)
jmp 0x112a0
movq -0x10(%rbp), %rax
movb 0x24(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x1129e
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x11900
movq %rax, -0x20(%rbp)
movswl -0x12(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movswl 0x3e(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x3c(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x22(%rbp)
movq -0x8(%rbp), %rdi
callq 0x12b40
movw %ax, -0x24(%rbp)
movswl -0x22(%rbp), %eax
movl %eax, -0x38(%rbp)
movswl -0x24(%rbp), %edi
callq 0x47220
movw %ax, %cx
movl -0x38(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
sarl $0xf, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x10(%rax)
movswl -0x22(%rbp), %eax
movl %eax, -0x34(%rbp)
movzwl -0x24(%rbp), %eax
addl $0x5a, %eax
movswl %ax, %edi
callq 0x47220
movw %ax, %cx
movl -0x34(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
sarl $0xf, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x12(%rax)
movq -0x10(%rbp), %rax
movswl 0x10(%rax), %eax
movl %eax, -0x30(%rbp)
movswl -0x12(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x30(%rbp), %eax
addl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x10(%rax)
movq -0x10(%rbp), %rax
movswl 0x12(%rax), %eax
movl %eax, -0x2c(%rbp)
movswl -0x14(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x12(%rax)
jmp 0x112a0
movq -0x8(%rbp), %rdi
callq 0x11790
addq $0x40, %rsp
popq %rbp
retq
nop