// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: anim_ready_handler
static bool anim_ready_handler(lv_anim_t * a)
{

    /*Delete the animation if
     * - no repeat and no play back (simple one shot animation)
     * - no repeat, play back is enabled and play back is ready */
    if((a->repeat == 0 && a->playback == 0) || (a->repeat == 0 && a->playback == 1 && a->playback_now == 1)) {

        /*Create copy from the animation and delete the animation from the list.
         * This way the `ready_cb` will see the animations like it's animation is ready deleted*/
        lv_anim_t a_tmp;
        memcpy(&a_tmp, a, sizeof(lv_anim_t));
        lv_ll_rem(&LV_GC_ROOT(_lv_anim_ll), a);
        lv_mem_free(a);
        anim_list_changed = true;

        /* Call the callback function at the end*/
        if(a_tmp.ready_cb != NULL) a_tmp.ready_cb(&a_tmp);
    }
    /*If the animation is not deleted then restart it*/
    else {
        a->act_time = -a->repeat_pause; /*Restart the animation*/
        /*Swap the start and end values in play back mode*/
        if(a->playback != 0) {
            /*If now turning back use the 'playback_pause*/
            if(a->playback_now == 0) a->act_time = -a->playback_pause;

            /*Toggle the play back state*/
            a->playback_now = a->playback_now == 0 ? 1 : 0;
            /*Swap the start and end values*/
            int32_t tmp;
            tmp      = a->start;
            a->start = a->end;
            a->end   = tmp;
        }
    }

    return anim_list_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x44ba0
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x44bd8
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x44c1d
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x44c1d
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x44c1d
movq -0x8(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movl $0x38, %edx
callq 0x20e0
movq -0x8(%rbp), %rsi
leaq 0x4ca33(%rip), %rdi     # 0x91628
callq 0x45790
movq -0x8(%rbp), %rdi
callq 0x44ec0
movb $0x1, 0x44986(%rip)     # 0x89590
cmpq $0x0, -0x28(%rbp)
je 0x44c18
leaq -0x40(%rbp), %rdi
callq *-0x28(%rbp)
jmp 0x44ccb
movq -0x8(%rbp), %rax
movzwl 0x2e(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2a(%rax)
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x44cc9
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x44c74
movq -0x8(%rbp), %rax
movzwl 0x2c(%rax), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2a(%rax)
movq -0x8(%rbp), %rax
movb 0x30(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movb 0x30(%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movl -0x44(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x44ccb
movb 0x448bf(%rip), %al      # 0x89590
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)