// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1fe90
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x3a940
movq -0x20(%rbp), %rsi
leaq 0x2d70b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x3a93e
cmpq $0x0, -0x20(%rbp)
jne 0x3a954
movq $0x0, -0x8(%rbp)
jmp 0x3aa4a
movq -0x20(%rbp), %rdi
movl $0x68, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x3a985
movq -0x28(%rbp), %rsi
leaq 0x2d6c6(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x3a983
cmpq $0x0, -0x28(%rbp)
jne 0x3a999
movq $0x0, -0x8(%rbp)
jmp 0x3aa4a
cmpq $0x0, 0x4eb6f(%rip)     # 0x89510
jne 0x3a9b3
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x4eb5d(%rip)     # 0x89510
cmpq $0x0, 0x4eb5d(%rip)     # 0x89518
jne 0x3a9cd
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x4eb4b(%rip)     # 0x89518
movq -0x28(%rbp), %rdi
addq $0x38, %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x2090
movq -0x28(%rbp), %rax
movb $0x0, 0x60(%rax)
movq -0x20(%rbp), %rdi
leaq 0x6c(%rip), %rsi        # 0x3aa60
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0xec(%rip), %rsi        # 0x3aaf0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x3aa12
jmp 0x3aa42
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
addq $0x38, %rdi
movq -0x30(%rbp), %rsi
addq $0x38, %rsi
movl $0x28, %edx
callq 0x20e0
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)