// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_task.c
// Function: lv_task_create_basic
lv_task_t * lv_task_create_basic(void)
{
    lv_task_t * new_task = NULL;
    lv_task_t * tmp;

    /*Create task lists in order of priority from high to low*/
    tmp = lv_ll_get_head(&LV_GC_ROOT(_lv_task_ll));

    /*It's the first task*/
    if(NULL == tmp) {
        new_task = lv_ll_ins_head(&LV_GC_ROOT(_lv_task_ll));
        LV_ASSERT_MEM(new_task);
        if(new_task == NULL) return NULL;
    }
    /*Insert the new task to proper place according to its priority*/
    else {
        do {
            if(tmp->prio <= DEF_PRIO) {
                new_task = lv_ll_ins_prev(&LV_GC_ROOT(_lv_task_ll), tmp);
                LV_ASSERT_MEM(new_task);
                if(new_task == NULL) return NULL;
                break;
            }
            tmp = lv_ll_get_next(&LV_GC_ROOT(_lv_task_ll), tmp);
        } while(tmp != NULL);

        /*Only too high priority tasks were found. Add the task to the end*/
        if(tmp == NULL) {
            new_task = lv_ll_ins_tail(&LV_GC_ROOT(_lv_task_ll));
            LV_ASSERT_MEM(new_task);
            if(new_task == NULL) return NULL;
        }
    }

    new_task->period  = DEF_PERIOD;
    new_task->task_cb = NULL;
    new_task->prio    = DEF_PRIO;

    new_task->once     = 0;
    new_task->last_run = lv_tick_get();

    new_task->user_data = NULL;

    task_created = true;

    return new_task;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq $0x0, -0x10(%rbp)
leaq 0x4e669(%rip), %rdi     # 0x915b0
callq 0x45660
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
jne 0x42fa0
leaq 0x4e651(%rip), %rdi     # 0x915b0
callq 0x453f0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x42f87
movq -0x10(%rbp), %rsi
leaq 0x250c4(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x42f85
cmpq $0x0, -0x10(%rbp)
jne 0x42f9b
movq $0x0, -0x8(%rbp)
jmp 0x430c1
jmp 0x43062
jmp 0x42fa2
movq -0x18(%rbp), %rax
movb 0x18(%rax), %al
andb $0x7, %al
movzbl %al, %eax
cmpl $0x3, %eax
jg 0x42ffc
movq -0x18(%rbp), %rsi
leaq 0x4e5f2(%rip), %rdi     # 0x915b0
callq 0x45570
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x42fe6
movq -0x10(%rbp), %rsi
leaq 0x25065(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x42fe4
cmpq $0x0, -0x10(%rbp)
jne 0x42ffa
movq $0x0, -0x8(%rbp)
jmp 0x430c1
jmp 0x43017
movq -0x18(%rbp), %rsi
leaq 0x4e5a9(%rip), %rdi     # 0x915b0
callq 0x458a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x42fa2
cmpq $0x0, -0x18(%rbp)
jne 0x43060
leaq 0x4e58b(%rip), %rdi     # 0x915b0
callq 0x456d0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x4304d
movq -0x10(%rbp), %rsi
leaq 0x24ffe(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x4304b
cmpq $0x0, -0x10(%rbp)
jne 0x4305e
movq $0x0, -0x8(%rbp)
jmp 0x430c1
jmp 0x43060
jmp 0x43062
movq -0x10(%rbp), %rax
movl $0x1f4, (%rax)          # imm = 0x1F4
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x8, %cl
orb $0x3, %cl
movb %cl, 0x18(%rax)
movq -0x10(%rbp), %rax
movb 0x18(%rax), %cl
andb $-0x9, %cl
orb $0x0, %cl
movb %cl, 0x18(%rax)
callq 0xdfe0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movb $0x1, 0x464d1(%rip)     # 0x8958a
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)