// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_img.c
// Function: lv_img_create
lv_obj_t * lv_img_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("image create started");

    lv_obj_t * new_img = NULL;

    /*Create a basic object*/
    new_img = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_img);
    if(new_img == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_img);

    /*Extend the basic object to image object*/
    lv_img_ext_t * ext = lv_obj_allocate_ext_attr(new_img, sizeof(lv_img_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->src       = NULL;
    ext->src_type  = LV_IMG_SRC_UNKNOWN;
    ext->cf        = LV_IMG_CF_UNKNOWN;
    ext->w         = lv_obj_get_width(new_img);
    ext->h         = lv_obj_get_height(new_img);
    ext->auto_size = 1;
    ext->offset.x  = 0;
    ext->offset.y  = 0;

    /*Init the new object*/
    lv_obj_set_signal_cb(new_img, lv_img_signal);
    lv_obj_set_design_cb(new_img, lv_img_design);

    if(copy == NULL) {
        lv_obj_set_click(new_img, false);
        /* Enable auto size for non screens
         * because image screens are wallpapers
         * and must be screen sized*/
        if(par != NULL) {
            ext->auto_size = 1;
            lv_obj_set_style(new_img, NULL); /*Inherit the style  by default*/
        } else {
            ext->auto_size = 0;
            lv_obj_set_style(new_img, &lv_style_plain); /*Set a style for screens*/
        }
    } else {
        lv_img_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->auto_size          = copy_ext->auto_size;
        lv_img_set_src(new_img, copy_ext->src);

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_img);
    }

    LV_LOG_INFO("image created");

    return new_img;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
callq 0x455f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x23613
testq %rbx, %rbx
je 0x23624
cmpq $0x0, 0x3cef5(%rip)     # 0x60438
jne 0x23554
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x3cee4(%rip)     # 0x60438
movq %rbx, %rdi
movl $0x18, %esi
callq 0x64bc
movq %rax, %r12
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x23635
testq %r12, %r12
je 0x23624
movq $0x0, (%r12)
movb 0x10(%r12), %al
andb $0x4, %al
orb $0x3, %al
movb %al, 0x10(%r12)
movq %rbx, %rdi
callq 0x5651
movw %ax, 0xc(%r12)
movq %rbx, %rdi
callq 0x567b
movw %ax, 0xe(%r12)
orb $0x4, 0x10(%r12)
movl $0x0, 0x8(%r12)
leaq 0xbb(%rip), %rsi        # 0x23680
movq %rbx, %rdi
callq 0x645c
leaq 0x143(%rip), %rsi       # 0x23717
movq %rbx, %rdi
callq 0x648c
testq %r15, %r15
je 0x23646
movq %r15, %rdi
callq 0x6ad8
movb 0x10(%rax), %cl
andb $0x4, %cl
movb 0x10(%r12), %dl
andb $-0x5, %dl
orb %cl, %dl
movb %dl, 0x10(%r12)
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x23916
movq %rbx, %rdi
callq 0x5e38
jmp 0x23626
leaq 0x1ba26(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x23622
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1ba04(%rip), %rdi     # 0x3f040
movq %r12, %rsi
callq 0x829e
jmp 0x23644
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5fd8
movb 0x10(%r12), %al
testq %r14, %r14
je 0x23668
orb $0x4, %al
movb %al, 0x10(%r12)
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x23679
andb $-0x5, %al
movb %al, 0x10(%r12)
leaq 0x3c8a2(%rip), %rsi     # 0x5ff18
movq %rbx, %rdi
callq 0x5d83
jmp 0x23626