// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x17cc4
movq -0x8(%rbp), %rsi
leaq 0x5043f(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x17cc2
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x44560
movzbl -0x9(%rbp), %eax
movl %eax, -0xc4(%rbp)
testl %eax, %eax
je 0x17e72
jmp 0x17cf2
movl -0xc4(%rbp), %eax
subl $0x1, %eax
je 0x17d13
jmp 0x17cff
movl -0xc4(%rbp), %eax
subl $0x2, %eax
je 0x17e72
jmp 0x17e74
movq -0x18(%rbp), %rax
movb 0x8(%rax), %cl
andb $-0x4, %cl
orb $0x1, %cl
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movb 0x8(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x17d4f
movl $0x168, -0x30(%rbp)     # imm = 0x168
movl $0x0, -0x2c(%rbp)
jmp 0x17d5d
movl $0x0, -0x30(%rbp)
movl $0x168, -0x2c(%rbp)     # imm = 0x168
leaq 0x2dc(%rip), %rax       # 0x18040
movq %rax, -0x48(%rbp)
leaq 0x2cac1(%rip), %rax     # 0x44830
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movw $0x0, -0x26(%rbp)
movq -0x18(%rbp), %rax
movw 0x6(%rax), %ax
movw %ax, -0x28(%rbp)
movb -0x20(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x20(%rbp)
movw $0x0, -0x24(%rbp)
movb -0x20(%rbp), %al
andb $-0x3, %al
orb $0x2, %al
movb %al, -0x20(%rbp)
movw $0x0, -0x22(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x444a0
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movb 0x8(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x17df4
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %ecx
movl $0x168, %eax            # imm = 0x168
subl %ecx, %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x64(%rbp)
jmp 0x17e11
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %ecx
movl $0x168, %eax            # imm = 0x168
subl %ecx, %eax
movl %eax, -0x64(%rbp)
leaq 0x158(%rip), %rax       # 0x17f70
movq %rax, -0x80(%rbp)
leaq 0x2ca0d(%rip), %rax     # 0x44830
movq %rax, -0x78(%rbp)
movq $0x0, -0x70(%rbp)
movw $0x0, -0x5e(%rbp)
movq -0x18(%rbp), %rax
movw 0x6(%rax), %ax
movw %ax, -0x60(%rbp)
movb -0x58(%rbp), %al
andb $-0x2, %al
orb $0x1, %al
movb %al, -0x58(%rbp)
movw $0x0, -0x5c(%rbp)
movb -0x58(%rbp), %al
andb $-0x3, %al
orb $0x2, %al
movb %al, -0x58(%rbp)
movw $0x0, -0x5a(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x444a0
jmp 0x17f65
jmp 0x17e74
movb -0x9(%rbp), %dl
movq -0x18(%rbp), %rax
movb 0x8(%rax), %cl
andb $0x3, %dl
andb $-0x4, %cl
orb %dl, %cl
movb %cl, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movb 0x8(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x17ebe
movl $0x168, -0xa0(%rbp)     # imm = 0x168
movl $0x0, -0x9c(%rbp)
jmp 0x17ed2
movl $0x0, -0xa0(%rbp)
movl $0x168, -0x9c(%rbp)     # imm = 0x168
leaq 0x167(%rip), %rax       # 0x18040
movq %rax, -0xb8(%rbp)
movzbl -0x9(%rbp), %esi
movl $0x2, %edx
leaq 0x2c940(%rip), %rax     # 0x44830
leaq 0x2c539(%rip), %rcx     # 0x44430
cmpl %esi, %edx
cmoveq %rcx, %rax
movq %rax, -0xb0(%rbp)
movq $0x0, -0xa8(%rbp)
movw $0x0, -0x96(%rbp)
movq -0x18(%rbp), %rax
movw 0x6(%rax), %ax
movw %ax, -0x98(%rbp)
movb -0x90(%rbp), %al
andb $-0x2, %al
orb $0x0, %al
movb %al, -0x90(%rbp)
movw $0x0, -0x94(%rbp)
movb -0x90(%rbp), %al
andb $-0x3, %al
orb $0x2, %al
movb %al, -0x90(%rbp)
movw $0x0, -0x92(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x444a0
addq $0xd0, %rsp
popq %rbp
retq
nop