// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
callq 0x87e8
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xe17e
testq %rbx, %rbx
je 0xe18f
movq %rbx, %rdi
movl $0xa, %esi
callq 0x64db
movq %rax, %r14
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xe193
testq %r14, %r14
je 0xe18f
cmpq $0x0, 0x52206(%rip)     # 0x60300
jne 0xe10b
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x521f5(%rip)     # 0x60300
cmpq $0x0, 0x521f5(%rip)     # 0x60308
jne 0xe124
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x521e4(%rip)     # 0x60308
movw $0x3c, 0x4(%r14)
andb $-0x8, 0x8(%r14)
leaq 0xcb(%rip), %rsi        # 0xe202
movq %rbx, %rdi
callq 0x647b
leaq 0xf4(%rip), %rsi        # 0xe23a
movq %rbx, %rdi
callq 0x64ab
testq %r15, %r15
je 0xe1a4
movq %r15, %rdi
callq 0x6af7
movl 0x4(%rax), %ecx
movl %ecx, 0x4(%r14)
movb 0x8(%rax), %al
andb $0x4, %al
movb 0x8(%r14), %cl
andb $-0x5, %cl
orb %al, %cl
movb %cl, 0x8(%r14)
movq %rbx, %rdi
callq 0x5e54
jmp 0xe1e9
leaq 0x30f4b(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0xe18d
xorl %ebx, %ebx
jmp 0xe1f9
leaq 0x30f36(%rip), %rdi     # 0x3f0d0
movq %r14, %rsi
callq 0x8294
jmp 0xe1a2
movq %rbx, %rdi
movl $0x32, %esi
movl $0x32, %edx
callq 0x5557
callq 0x2e91c
testq %rax, %rax
je 0xe1d3
movq 0xe8(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe3a7
jmp 0xe1e2
leaq 0x51e16(%rip), %rsi     # 0x5fff0
movq %rbx, %rdi
callq 0x5d9f
movw $0x3e8, 0x6(%r14)       # imm = 0x3E8
movzbl 0x8(%r14), %esi
andl $0x3, %esi
movq %rbx, %rdi
callq 0xe3e8
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq