// File: /workspace/github_c_makefile_star2_O1/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 0x8870
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0xe231
testq %rbx, %rbx
je 0xe242
movq %rbx, %rdi
movl $0xa, %esi
callq 0x64bc
movq %rax, %r14
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0xe246
testq %r14, %r14
je 0xe242
cmpq $0x0, 0x5215e(%rip)     # 0x60300
jne 0xe1b3
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x5214d(%rip)     # 0x60300
cmpq $0x0, 0x5214d(%rip)     # 0x60308
jne 0xe1cc
movq %rbx, %rdi
callq 0x6a90
movq %rax, 0x5213c(%rip)     # 0x60308
movw $0x3c, 0x4(%r14)
andb $-0x8, 0x8(%r14)
leaq 0xd6(%rip), %rsi        # 0xe2b5
movq %rbx, %rdi
callq 0x645c
leaq 0xff(%rip), %rsi        # 0xe2ed
movq %rbx, %rdi
callq 0x648c
testq %r15, %r15
je 0xe257
movq %r15, %rdi
callq 0x6ad8
movzwl 0x4(%rax), %ecx
movw %cx, 0x4(%r14)
movzwl 0x6(%rax), %ecx
movw %cx, 0x6(%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 0x5e38
jmp 0xe29c
leaq 0x30e08(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0xe240
xorl %ebx, %ebx
jmp 0xe2ac
leaq 0x30df3(%rip), %rdi     # 0x3f040
movq %r14, %rsi
callq 0x829e
jmp 0xe255
movq %rbx, %rdi
movl $0x32, %esi
movl $0x32, %edx
callq 0x553f
callq 0x2e244
testq %rax, %rax
je 0xe286
movq 0xe8(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe457
jmp 0xe295
leaq 0x51d63(%rip), %rsi     # 0x5fff0
movq %rbx, %rdi
callq 0x5d83
movw $0x3e8, 0x6(%r14)       # imm = 0x3E8
movzbl 0x8(%r14), %esi
andl $0x3, %esi
movq %rbx, %rdi
callq 0xe498
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq