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

    /*Create the ancestor of image button*/
    lv_obj_t * new_imgbtn = lv_btn_create(par, copy);
    LV_ASSERT_MEM(new_imgbtn);
    if(new_imgbtn == NULL) return NULL;

    /*Allocate the image button type specific extended data*/
    lv_imgbtn_ext_t * ext = lv_obj_allocate_ext_attr(new_imgbtn, sizeof(lv_imgbtn_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_imgbtn);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_imgbtn);

        /*Initialize the allocated 'ext' */
#if LV_IMGBTN_TILED == 0
    memset((void*)ext->img_src, 0, sizeof(ext->img_src));
#else
    memset(ext->img_src_left, 0, sizeof(ext->img_src_left));
    memset(ext->img_src_mid, 0, sizeof(ext->img_src_mid));
    memset(ext->img_src_right, 0, sizeof(ext->img_src_right));
#endif

    ext->act_cf = LV_IMG_CF_UNKNOWN;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_imgbtn, lv_imgbtn_signal);
    lv_obj_set_design_cb(new_imgbtn, lv_imgbtn_design);

    /*Init the new image button image button*/
    if(copy == NULL) {

    }
    /*Copy an existing image button*/
    else {
        lv_imgbtn_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
#if LV_IMGBTN_TILED == 0
        memcpy((void*)ext->img_src, copy_ext->img_src, sizeof(ext->img_src));
#else
        memcpy((void*)ext->img_src_left, copy_ext->img_src_left, sizeof(ext->img_src_left));
        memcpy((void*)ext->img_src_mid, copy_ext->img_src_mid, sizeof(ext->img_src_mid));
        memcpy((void*)ext->img_src_right, copy_ext->img_src_right, sizeof(ext->img_src_right));
#endif
        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_imgbtn);
    }

    LV_LOG_INFO("image button created");

    return new_imgbtn;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x122f0
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x222ba
testq %rbx, %rbx
je 0x222cb
pushq $0x68
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x222d6
testq %r15, %r15
je 0x222cb
cmpq $0x0, 0x3c214(%rip)     # 0x5e440
jne 0x2223d
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x3c203(%rip)     # 0x5e440
cmpq $0x0, 0x3c203(%rip)     # 0x5e448
jne 0x22256
movq %rbx, %rdi
callq 0x66ff
movq %rax, 0x3c1f2(%rip)     # 0x5e448
xorps %xmm0, %xmm0
movups %xmm0, 0x51(%r15)
movups %xmm0, 0x48(%r15)
movups %xmm0, 0x38(%r15)
leaq 0x78(%rip), %rsi        # 0x222e7
movq %rbx, %rdi
callq 0x60e6
leaq 0xc5(%rip), %rsi        # 0x22343
movq %rbx, %rdi
callq 0x6116
testq %r14, %r14
je 0x222cd
addq $0x38, %r15
movq %r14, %rdi
callq 0x6747
movups 0x38(%rax), %xmm0
movups 0x48(%rax), %xmm1
movups %xmm0, (%r15)
movups %xmm1, 0x10(%r15)
movq 0x58(%rax), %rax
movq %rax, 0x20(%r15)
movq %rbx, %rdi
callq 0x5ae7
jmp 0x222cd
leaq 0x18d7f(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x222c9
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x18d63(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0x222e5