// File: /workspace/github_c_makefile_star2_O2/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 0x42c9
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x21b27
testq %rbx, %rbx
je 0x21b38
cmpq $0x0, 0x3c9d9(%rip)     # 0x5e438
jne 0x21a70
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x3c9c8(%rip)     # 0x5e438
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r12
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x21b49
testq %r12, %r12
je 0x21b38
andq $0x0, (%r12)
movb 0x10(%r12), %al
andb $0x4, %al
orb $0x3, %al
movb %al, 0x10(%r12)
movq %rbx, %rdi
callq 0x5308
movw %ax, 0xc(%r12)
movq %rbx, %rdi
callq 0x5332
movw %ax, 0xe(%r12)
orb $0x4, 0x10(%r12)
andl $0x0, 0x8(%r12)
leaq 0xbb(%rip), %rsi        # 0x21b94
movq %rbx, %rdi
callq 0x60e6
leaq 0x142(%rip), %rsi       # 0x21c2a
movq %rbx, %rdi
callq 0x6116
testq %r15, %r15
je 0x21b5a
movq %r15, %rdi
callq 0x6747
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 0x21e19
movq %rbx, %rdi
callq 0x5ae7
jmp 0x21b3a
leaq 0x19512(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x21b36
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x194f0(%rip), %rdi     # 0x3b040
movq %r12, %rsi
callq 0x7b01
jmp 0x21b58
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5c6f
movb 0x10(%r12), %al
testq %r14, %r14
je 0x21b7c
orb $0x4, %al
movb %al, 0x10(%r12)
movq %rbx, %rdi
xorl %esi, %esi
jmp 0x21b8d
andb $-0x5, %al
movb %al, 0x10(%r12)
leaq 0x3c38e(%rip), %rsi     # 0x5df18
movq %rbx, %rdi
callq 0x5a3d
jmp 0x21b3a