// File: /workspace/github_c_makefile_star2_O3/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 0x454f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x23d43
testq %rbx, %rbx
je 0x23d54
cmpq $0x0, 0x3c7c5(%rip)     # 0x60438
jne 0x23c84
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x3c7b4(%rip)     # 0x60438
movq %rbx, %rdi
movl $0x18, %esi
callq 0x64db
movq %rax, %r12
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0x23d65
testq %r12, %r12
je 0x23d54
movq $0x0, (%r12)
movb 0x10(%r12), %al
andb $0x4, %al
orb $0x3, %al
movb %al, 0x10(%r12)
movq %rbx, %rdi
callq 0x566d
movw %ax, 0xc(%r12)
movq %rbx, %rdi
callq 0x5697
movw %ax, 0xe(%r12)
orb $0x4, 0x10(%r12)
movl $0x0, 0x8(%r12)
leaq 0xbb(%rip), %rsi        # 0x23db0
movq %rbx, %rdi
callq 0x647b
leaq 0x145(%rip), %rsi       # 0x23e49
movq %rbx, %rdi
callq 0x64ab
testq %r15, %r15
je 0x23d76
movq %r15, %rdi
callq 0x6af7
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 0x24066
movq %rbx, %rdi
callq 0x5e54
jmp 0x23d56
leaq 0x1b386(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0x23d52
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b364(%rip), %rdi     # 0x3f0d0
movq %r12, %rsi
callq 0x8294
jmp 0x23d74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5ff7
movb 0x10(%r12), %al
testq %r14, %r14
je 0x23d98
orb $0x4, %al
movb %al, 0x10(%r12)
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x23da9
andb $-0x5, %al
movb %al, 0x10(%r12)
leaq 0x3c172(%rip), %rsi     # 0x5ff18
movq %rbx, %rdi
callq 0x5d9f
jmp 0x23d56