// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_bar.c
// Function: lv_bar_set_value
void lv_bar_set_value(lv_obj_t * bar, int16_t value, lv_anim_enable_t anim)
{
    LV_ASSERT_OBJ(bar, LV_OBJX_NAME);

#if LV_USE_ANIMATION == 0
    anim = false;
#endif
    lv_bar_ext_t * ext = lv_obj_get_ext_attr(bar);
    if(ext->cur_value == value) return;

    int16_t new_value;
    new_value = value > ext->max_value ? ext->max_value : value;
    new_value = new_value < ext->min_value ? ext->min_value : new_value;

    if(ext->cur_value == new_value) return;

    if(anim == LV_ANIM_OFF) {
        ext->cur_value = new_value;
        lv_obj_invalidate(bar);
    } else {
#if LV_USE_ANIMATION
        /*No animation in progress -> simply set the values*/
        if(ext->anim_state == LV_BAR_ANIM_STATE_INV) {
            ext->anim_start = ext->cur_value;
            ext->anim_end   = new_value;
        }
        /*Animation in progress. Start from the animation end value*/
        else {
            ext->anim_start = ext->anim_end;
            ext->anim_end   = new_value;
        }

        lv_anim_t a;
        a.var            = bar;
        a.start          = LV_BAR_ANIM_STATE_START;
        a.end            = LV_BAR_ANIM_STATE_END;
        a.exec_cb        = (lv_anim_exec_xcb_t)lv_bar_anim;
        a.path_cb        = lv_anim_path_linear;
        a.ready_cb       = lv_bar_anim_ready;
        a.act_time       = 0;
        a.time           = ext->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 $0x60, %rsp
movb %dl, %al
movw %si, %cx
movq %rdi, -0x8(%rbp)
movw %cx, -0xa(%rbp)
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0xf187
movq -0x8(%rbp), %rsi
leaq 0x58f7c(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0xf185
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movswl (%rax), %eax
movswl -0xa(%rbp), %ecx
cmpl %ecx, %eax
jne 0xf1a8
jmp 0xf2ec
movswl -0xa(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x4(%rcx), %ecx
cmpl %ecx, %eax
jle 0xf1c5
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x5c(%rbp)
jmp 0xf1cc
movswl -0xa(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movw %ax, -0x1a(%rbp)
movswl -0x1a(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x2(%rcx), %ecx
cmpl %ecx, %eax
jge 0xf1f0
movq -0x18(%rbp), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x60(%rbp)
jmp 0xf1f7
movswl -0x1a(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movw %ax, -0x1a(%rbp)
movq -0x18(%rbp), %rax
movswl (%rax), %eax
movswl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jne 0xf212
jmp 0xf2ec
movzbl -0xb(%rbp), %eax
cmpl $0x0, %eax
jne 0xf234
movw -0x1a(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
movq -0x8(%rbp), %rdi
callq 0x7430
jmp 0xf2ec
movq -0x18(%rbp), %rax
movswl 0xa(%rax), %eax
cmpl $-0x1, %eax
jne 0xf25e
movq -0x18(%rbp), %rax
movw (%rax), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x6(%rax)
movw -0x1a(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x8(%rax)
jmp 0xf27a
movq -0x18(%rbp), %rax
movw 0x8(%rax), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x6(%rax)
movw -0x1a(%rbp), %cx
movq -0x18(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x100, -0x34(%rbp)     # imm = 0x100
leaq 0xf9(%rip), %rax        # 0xf390
movq %rax, -0x50(%rbp)
leaq 0x3518e(%rip), %rax     # 0x44430
movq %rax, -0x48(%rbp)
leaq 0x123(%rip), %rax       # 0xf3d0
movq %rax, -0x40(%rbp)
movw $0x0, -0x2e(%rbp)
movq -0x18(%rbp), %rax
movw 0xc(%rax), %ax
movw %ax, -0x30(%rbp)
movb -0x28(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x28(%rbp)
movw $0x0, -0x2c(%rbp)
movb -0x28(%rbp), %al
andb $-0x3, %al
orb $0x0, %al
movb %al, -0x28(%rbp)
movw $0x0, -0x2a(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x444a0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)