// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x39cf8
movq -0x20(%rbp), %rsi
leaq 0x2e353(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x39cf6
cmpq $0x0, -0x20(%rbp)
jne 0x39d0c
movq $0x0, -0x8(%rbp)
jmp 0x39eac
cmpq $0x0, 0x4f7f4(%rip)     # 0x89508
jne 0x39d26
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x4f7e2(%rip)     # 0x89508
movq -0x20(%rbp), %rdi
movl $0x18, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x39d57
movq -0x28(%rbp), %rsi
leaq 0x2e2f4(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x39d55
cmpq $0x0, -0x28(%rbp)
jne 0x39d6b
movq $0x0, -0x8(%rbp)
jmp 0x39eac
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movb 0x10(%rax), %cl
andb $-0x4, %cl
orb $0x3, %cl
movb %cl, 0x10(%rax)
movq -0x28(%rbp), %rax
movb 0x10(%rax), %cl
andb $0x7, %cl
orb $0x0, %cl
movb %cl, 0x10(%rax)
movq -0x20(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x20(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movq -0x28(%rbp), %rax
movw %cx, 0xe(%rax)
movq -0x28(%rbp), %rax
movb 0x10(%rax), %cl
andb $-0x5, %cl
orb $0x4, %cl
movb %cl, 0x10(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0xa(%rax)
movq -0x20(%rbp), %rdi
leaq 0xd3(%rip), %rsi        # 0x39ec0
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x1d3(%rip), %rsi       # 0x39fd0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x39e5c
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x94b0
cmpq $0x0, -0x10(%rbp)
je 0x39e3a
movq -0x28(%rbp), %rax
movb 0x10(%rax), %cl
andb $-0x5, %cl
orb $0x4, %cl
movb %cl, 0x10(%rax)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9150
jmp 0x39e5a
movq -0x28(%rbp), %rax
movb 0x10(%rax), %cl
andb $-0x5, %cl
orb $0x0, %cl
movb %cl, 0x10(%rax)
movq -0x20(%rbp), %rdi
leaq 0x4f193(%rip), %rsi     # 0x88fe8
callq 0x9150
jmp 0x39ea4
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb 0x10(%rax), %dl
shrb $0x2, %dl
andb $0x1, %dl
movq -0x28(%rbp), %rax
movb 0x10(%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, 0x10(%rax)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0x3a2c0
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)