// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_preload.c
// Function: lv_preload_create
lv_obj_t * lv_preload_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("preload create started");

    /*Create the ancestor of pre loader*/
    lv_obj_t * new_preload = lv_arc_create(par, copy);
    LV_ASSERT_MEM(new_preload);
    if(new_preload == NULL) return NULL;

    /*Allocate the pre loader type specific extended data*/
    lv_preload_ext_t * ext = lv_obj_allocate_ext_attr(new_preload, sizeof(lv_preload_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_preload);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_preload);

    /*Initialize the allocated 'ext' */
    ext->arc_length = LV_PRELOAD_DEF_ARC_LENGTH;
    ext->anim_type  = LV_PRELOAD_DEF_ANIM;
    ext->anim_dir   = LV_PRELOAD_DIR_FORWARD;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_preload, lv_preload_signal);
    lv_obj_set_design_cb(new_preload, lv_preload_design);

    /*Init the new pre loader pre loader*/
    if(copy == NULL) {
        lv_obj_set_size(new_preload, LV_DPI / 2, LV_DPI / 2);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_preload_set_style(new_preload, LV_PRELOAD_STYLE_MAIN, th->style.preload);
        } else {
            lv_obj_set_style(new_preload, &lv_style_pretty_color);
        }

        ext->time = LV_PRELOAD_DEF_SPIN_TIME;

    }
    /*Copy an existing pre loader*/
    else {
        lv_preload_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->arc_length             = copy_ext->arc_length;
        ext->time                   = copy_ext->time;
        ext->anim_dir               = copy_ext->anim_dir;
        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_preload);
    }

    lv_preload_set_type(new_preload, ext->anim_type);

    LV_LOG_INFO("preload created");

    return new_preload;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xe060
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x177d0
movq -0x20(%rbp), %rsi
leaq 0x5087b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x177ce
cmpq $0x0, -0x20(%rbp)
jne 0x177e4
movq $0x0, -0x8(%rbp)
jmp 0x17977
movq -0x20(%rbp), %rdi
movl $0xa, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x17815
movq -0x28(%rbp), %rsi
leaq 0x50836(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x17813
cmpq $0x0, -0x28(%rbp)
jne 0x17829
movq $0x0, -0x8(%rbp)
jmp 0x17977
cmpq $0x0, 0x71b9f(%rip)     # 0x893d0
jne 0x17843
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x71b8d(%rip)     # 0x893d0
cmpq $0x0, 0x71b8d(%rip)     # 0x893d8
jne 0x1785d
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x71b7b(%rip)     # 0x893d8
movq -0x28(%rbp), %rax
movw $0x3c, 0x4(%rax)
movq -0x28(%rbp), %rax
movb 0x8(%rax), %cl
andb $-0x4, %cl
orb $0x0, %cl
movb %cl, 0x8(%rax)
movq -0x28(%rbp), %rax
movb 0x8(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x8(%rax)
movq -0x20(%rbp), %rdi
leaq 0xfe(%rip), %rsi        # 0x17990
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x16e(%rip), %rsi       # 0x17a10
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x17902
movq -0x20(%rbp), %rdi
movl $0x32, %edx
movl %edx, %esi
callq 0x8180
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x178e6
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xe8(%rax), %rdx
xorl %esi, %esi
callq 0x17c30
jmp 0x178f6
movq -0x20(%rbp), %rdi
leaq 0x717cf(%rip), %rsi     # 0x890c0
callq 0x9150
movq -0x28(%rbp), %rax
movw $0x3e8, 0x6(%rax)       # imm = 0x3E8
jmp 0x1795a
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x38(%rbp), %rax
movw 0x6(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x6(%rax)
movq -0x38(%rbp), %rax
movb 0x8(%rax), %dl
shrb $0x2, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x8(%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rax
movb 0x8(%rax), %al
andb $0x3, %al
movzbl %al, %esi
callq 0x17c90
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)