// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_roller.c
// Function: refr_position
static void refr_position(lv_obj_t * roller, lv_anim_enable_t anim_en)
{
#if LV_USE_ANIMATION == 0
    anim_en = LV_ANIM_OFF;
#endif

    lv_obj_t * roller_scrl         = lv_page_get_scrl(roller);
    lv_roller_ext_t * ext          = lv_obj_get_ext_attr(roller);
    const lv_style_t * style_label = lv_obj_get_style(ext->ddlist.label);
    const lv_font_t * font         = style_label->text.font;
    lv_coord_t font_h              = lv_font_get_line_height(font);
    lv_coord_t h                   = lv_obj_get_height(roller);
    uint16_t anim_time             = lv_roller_get_anim_time(roller);

    /* Normally the animtaion's `end_cb` sets correct position of the roller is infinite.
     * But without animations do it manually*/
    if(anim_en == LV_ANIM_OFF || anim_time == 0) {
        inf_normalize(roller_scrl);
    }

    int32_t id = ext->ddlist.sel_opt_id;
    lv_coord_t line_y1 =
        id * (font_h + style_label->text.line_space) + ext->ddlist.label->coords.y1 - roller_scrl->coords.y1;
    lv_coord_t new_y = -line_y1 + (h - font_h) / 2;

    if(anim_en == LV_ANIM_OFF || anim_time == 0) {
        lv_obj_set_y(roller_scrl, new_y);
    } else {
#if LV_USE_ANIMATION
        lv_anim_t a;
        a.var            = roller_scrl;
        a.start          = lv_obj_get_y(roller_scrl);
        a.end            = new_y;
        a.exec_cb        = (lv_anim_exec_xcb_t)lv_obj_set_y;
        a.path_cb        = lv_anim_path_linear;
        a.ready_cb       = scroll_anim_ready_cb;
        a.act_time       = 0;
        a.time           = anim_time;
        a.playback       = 0;
        a.playback_pause = 0;
        a.repeat         = 0;
        a.repeat_pause   = 0;
        lv_anim_create(&a);
#endif
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3e970
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xa080
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x19680
movzbl %al, %eax
movw %ax, -0x32(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
callq 0x19b40
movw %ax, -0x36(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
je 0x19568
movzwl -0x36(%rbp), %eax
cmpl $0x0, %eax
jne 0x19571
movq -0x18(%rbp), %rdi
callq 0x19b60
movq -0x20(%rbp), %rax
movzwl 0x62(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movswl -0x32(%rbp), %ecx
movq -0x28(%rbp), %rdx
movswl 0x32(%rdx), %edx
addl %edx, %ecx
imull %ecx, %eax
movq -0x20(%rbp), %rcx
movq 0x50(%rcx), %rcx
movswl 0x22(%rcx), %ecx
addl %ecx, %eax
movq -0x18(%rbp), %rcx
movswl 0x22(%rcx), %ecx
subl %ecx, %eax
movw %ax, -0x3e(%rbp)
movswl -0x3e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
movswl -0x34(%rbp), %eax
movswl -0x32(%rbp), %ecx
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x7c(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x40(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
je 0x195e6
movzwl -0x36(%rbp), %eax
cmpl $0x0, %eax
jne 0x195f5
movq -0x18(%rbp), %rdi
movswl -0x40(%rbp), %esi
callq 0x8120
jmp 0x19669
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
callq 0x73c0
cwtl
movl %eax, -0x58(%rbp)
movswl -0x40(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq -0x114f8(%rip), %rax    # 0x8120
movq %rax, -0x70(%rbp)
leaq 0x2ae0d(%rip), %rax     # 0x44430
movq %rax, -0x68(%rbp)
leaq 0x662(%rip), %rax       # 0x19c90
movq %rax, -0x60(%rbp)
movw $0x0, -0x4e(%rbp)
movw -0x36(%rbp), %ax
movw %ax, -0x50(%rbp)
movb -0x48(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x48(%rbp)
movw $0x0, -0x4c(%rbp)
movb -0x48(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x48(%rbp)
movw $0x0, -0x4a(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x444a0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)