// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_preload.c
// Function: lv_preload_set_type
void lv_preload_set_type(lv_obj_t * preload, lv_preload_type_t type)
{
    LV_ASSERT_OBJ(preload, LV_OBJX_NAME);

    lv_preload_ext_t * ext = lv_obj_get_ext_attr(preload);

    /*delete previous animation*/
    lv_anim_del(preload, NULL);
    switch(type) {
        case LV_PRELOAD_TYPE_FILLSPIN_ARC: {
            ext->anim_type = LV_PRELOAD_TYPE_FILLSPIN_ARC;
            lv_anim_t a;
            a.var = preload;
            if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) {
                /* Clockwise */
                a.start = 360;
                a.end   = 0;
            } else {
                a.start = 0;
                a.end   = 360;
            }
            a.exec_cb        = (lv_anim_exec_xcb_t)lv_preload_spinner_anim;
            a.path_cb        = lv_anim_path_ease_in_out;
            a.ready_cb       = NULL;
            a.act_time       = 0;
            a.time           = ext->time;
            a.playback       = 0;
            a.playback_pause = 0;
            a.repeat         = 1;
            a.repeat_pause   = 0;
            lv_anim_create(&a);

            lv_anim_t b;
            b.var = preload;
            if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) {
                /* Clockwise */
                b.start = 360 - ext->arc_length;
                b.end   = ext->arc_length;
            } else {
                b.start = ext->arc_length;
                b.end   = 360 - ext->arc_length;
            }
            b.exec_cb        = (lv_anim_exec_xcb_t)lv_preload_set_arc_length;
            b.path_cb        = lv_anim_path_ease_in_out;
            b.ready_cb       = NULL;
            b.act_time       = 0;
            b.time           = ext->time;
            b.playback       = 1;
            b.playback_pause = 0;
            b.repeat         = 1;
            b.repeat_pause   = 0;
            lv_anim_create(&b);
            break;
        }
        case LV_PRELOAD_TYPE_CONSTANT_ARC:
        case LV_PRELOAD_TYPE_SPINNING_ARC:
        default: {
            ext->anim_type = type;
            lv_anim_t a;
            a.var = preload;
            if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) {
                /* Clockwise */
                a.start = 360;
                a.end   = 0;
            } else {
                a.start = 0;
                a.end   = 360;
            }
            a.exec_cb        = (lv_anim_exec_xcb_t)lv_preload_spinner_anim;
            a.path_cb        = (LV_PRELOAD_TYPE_CONSTANT_ARC == type ?
                                lv_anim_path_linear : lv_anim_path_ease_in_out);
            a.ready_cb       = NULL;
            a.act_time       = 0;
            a.time           = ext->time;
            a.playback       = 0;
            a.playback_pause = 0;
            a.repeat         = 1;
            a.repeat_pause   = 0;
            lv_anim_create(&a);
            break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebp
movq %rdi, %r14
callq 0x80d4
testb %al, %al
je 0xe55d
movq %r14, %rdi
callq 0x6ad8
movq %rax, %rbx
xorl %r15d, %r15d
movq %r14, %rdi
xorl %esi, %esi
callq 0x295b1
movb 0x8(%rbx), %al
cmpb $0x1, %bpl
jne 0xe56e
andb $-0x4, %al
incb %al
movb %al, 0x8(%rbx)
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
testb $0x4, 0x8(%rbx)
movl $0x168, %ebp            # imm = 0x168
movl $0x0, %eax
cmovel %ebp, %eax
cmovnel %ebp, %r15d
movl %eax, 0x20(%rdi)
movl %r15d, 0x24(%rdi)
leaq 0x1af(%rip), %rax       # 0xe6ba
movq %rax, 0x8(%rdi)
leaq 0x1b21b(%rip), %r15     # 0x29731
movq %r15, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movw $0x0, 0x2a(%rdi)
movzwl 0x6(%rbx), %eax
movw %ax, 0x28(%rdi)
movb 0x30(%rdi), %al
movl $0x0, 0x2c(%rdi)
andb $-0x4, %al
orb $0x2, %al
movb %al, 0x30(%rdi)
callq 0x29521
movq %r14, 0x40(%rsp)
testb $0x4, 0x8(%rbx)
movswl 0x4(%rbx), %eax
jne 0xe5b7
subl %eax, %ebp
movl %ebp, 0x60(%rsp)
jmp 0xe5bf
leaq 0x30bd0(%rip), %rdi     # 0x3f134
movq %r14, %rsi
callq 0x829e
jmp 0xe56c
movl %ebp, %ecx
andb $0x3, %cl
andb $-0x4, %al
orb %cl, %al
movb %al, 0x8(%rbx)
movq %r14, 0x8(%rsp)
testb $0x4, 0x8(%rbx)
movl $0x168, %eax            # imm = 0x168
movl $0x0, %ecx
cmovel %eax, %ecx
cmovel %r15d, %eax
movl %ecx, 0x28(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x117(%rip), %rax       # 0xe6ba
movq %rax, 0x10(%rsp)
cmpb $0x2, %bpl
jne 0xe5f9
leaq 0x1af40(%rip), %rax     # 0x294f5
jmp 0xe600
movl %eax, 0x60(%rsp)
subl %eax, %ebp
movl %ebp, %eax
leaq 0x40(%rsp), %rdi
movl %eax, 0x24(%rdi)
leaq 0x72(%rip), %rax        # 0xe640
movq %rax, 0x8(%rdi)
movq %r15, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movw $0x0, 0x2a(%rdi)
movzwl 0x6(%rbx), %eax
movw %ax, 0x28(%rdi)
movl $0x0, 0x2c(%rdi)
orb $0x3, 0x30(%rdi)
jmp 0xe630
leaq 0x1b131(%rip), %rax     # 0x29731
leaq 0x8(%rsp), %rdi
movq %rax, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movw $0x0, 0x2a(%rdi)
movzwl 0x6(%rbx), %eax
movw %ax, 0x28(%rdi)
movb 0x30(%rdi), %al
movl $0x0, 0x2c(%rdi)
andb $-0x4, %al
orb $0x2, %al
movb %al, 0x30(%rdi)
callq 0x29521
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq