// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_anim.c
// Function: anim_task
static void anim_task(lv_task_t * param)
{
    (void)param;

    lv_anim_t * a;
    LV_LL_READ(LV_GC_ROOT(_lv_anim_ll), a)
    {
        a->has_run = 0;
    }

    uint32_t elaps = lv_tick_elaps(last_task_run);

    a = lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll));

    while(a != NULL) {
        /*It can be set by `lv_anim_del()` typically in `end_cb`. If set then an animation delete
         * happened in `anim_ready_handler` which could make this linked list reading corrupt
         * because the list is changed meanwhile
         */
        anim_list_changed = false;

        if(!a->has_run) {
            a->has_run = 1; /*The list readying might be reseted so need to know which anim has run already*/
            a->act_time += elaps;
            if(a->act_time >= 0) {
                if(a->act_time > a->time) a->act_time = a->time;

                int32_t new_value;
                new_value = a->path_cb(a);

                /*Apply the calculated value*/
                if(a->exec_cb) a->exec_cb(a->var, new_value);

                /*If the time is elapsed the animation is ready*/
                if(a->act_time >= a->time) {
                    anim_ready_handler(a);
                }
            }
        }

        /* If the linked list changed due to anim. delete then it's not safe to continue
         * the reading of the list from here -> start from the head*/
        if(anim_list_changed)
            a = lv_ll_get_head(&LV_GC_ROOT(_lv_anim_ll));
        else
            a = lv_ll_get_next(&LV_GC_ROOT(_lv_anim_ll), a);
    }

    last_task_run = lv_tick_get();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x4d3c5(%rip), %rdi     # 0x91628
callq 0x45660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x44299
movq -0x10(%rbp), %rax
movb 0x30(%rax), %cl
andb $-0x9, %cl
orb $0x0, %cl
movb %cl, 0x30(%rax)
movq -0x10(%rbp), %rsi
leaq 0x4d39a(%rip), %rdi     # 0x91628
callq 0x458a0
movq %rax, -0x10(%rbp)
jmp 0x4426c
movl 0x452ed(%rip), %edi     # 0x8958c
callq 0xe010
movl %eax, -0x14(%rbp)
leaq 0x4d37a(%rip), %rdi     # 0x91628
callq 0x45660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x443bc
movb $0x0, 0x452c7(%rip)     # 0x89590
movq -0x10(%rbp), %rax
movb 0x30(%rax), %al
shrb $0x3, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x44388
movq -0x10(%rbp), %rax
movb 0x30(%rax), %cl
andb $-0x9, %cl
orb $0x8, %cl
movb %cl, 0x30(%rax)
movl -0x14(%rbp), %edx
movq -0x10(%rbp), %rax
movswl 0x2a(%rax), %ecx
addl %edx, %ecx
movw %cx, 0x2a(%rax)
movq -0x10(%rbp), %rax
movswl 0x2a(%rax), %eax
cmpl $0x0, %eax
jl 0x44386
movq -0x10(%rbp), %rax
movswl 0x2a(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x28(%rcx), %ecx
cmpl %ecx, %eax
jle 0x44333
movq -0x10(%rbp), %rax
movw 0x28(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x2a(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
cwtl
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x44367
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
movl -0x18(%rbp), %ecx
movswl %cx, %esi
callq *%rax
movq -0x10(%rbp), %rax
movswl 0x2a(%rax), %eax
movq -0x10(%rbp), %rcx
movzwl 0x28(%rcx), %ecx
cmpl %ecx, %eax
jl 0x44384
movq -0x10(%rbp), %rdi
callq 0x44b70
jmp 0x44386
jmp 0x44388
testb $0x1, 0x45201(%rip)     # 0x89590
je 0x443a3
leaq 0x4d290(%rip), %rdi     # 0x91628
callq 0x45660
movq %rax, -0x10(%rbp)
jmp 0x443b7
movq -0x10(%rbp), %rsi
leaq 0x4d27a(%rip), %rdi     # 0x91628
callq 0x458a0
movq %rax, -0x10(%rbp)
jmp 0x442b7
callq 0xdfe0
movl %eax, 0x451c5(%rip)     # 0x8958c
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)