// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_mbox.c
// Function: lv_mbox_create
lv_obj_t * lv_mbox_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("mesasge box create started");

    /*Create the ancestor message box*/
    lv_obj_t * new_mbox = lv_cont_create(par, copy);
    LV_ASSERT_MEM(new_mbox);
    if(new_mbox == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_mbox);

    /*Allocate the message box type specific extended data*/
    lv_mbox_ext_t * ext = lv_obj_allocate_ext_attr(new_mbox, sizeof(lv_mbox_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->text = NULL;
    ext->btnm = NULL;
#if LV_USE_ANIMATION
    ext->anim_time = LV_MBOX_CLOSE_ANIM_TIME;
#endif

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_mbox, lv_mbox_signal);

    /*Init the new message box message box*/
    if(copy == NULL) {
        ext->text = lv_label_create(new_mbox, NULL);
        lv_label_set_align(ext->text, LV_LABEL_ALIGN_CENTER);
        lv_label_set_long_mode(ext->text, LV_LABEL_LONG_BREAK);
        lv_label_set_text(ext->text, "Message");

        lv_cont_set_layout(new_mbox, LV_LAYOUT_COL_M);
        lv_cont_set_fit2(new_mbox, LV_FIT_NONE, LV_FIT_TIGHT);
        lv_obj_set_width(new_mbox, LV_DPI * 2);
        lv_obj_align(new_mbox, NULL, LV_ALIGN_CENTER, 0, 0);
        lv_obj_set_event_cb(new_mbox, lv_mbox_default_event_cb);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_mbox_set_style(new_mbox, LV_MBOX_STYLE_BG, th->style.mbox.bg);
        } else {
            lv_mbox_set_style(new_mbox, LV_MBOX_STYLE_BG, &lv_style_pretty);
        }

    }
    /*Copy an existing message box*/
    else {
        lv_mbox_ext_t * copy_ext = lv_obj_get_ext_attr(copy);

        ext->text = lv_label_create(new_mbox, copy_ext->text);

        /*Copy the buttons and the label on them*/
        if(copy_ext->btnm) ext->btnm = lv_btnm_create(new_mbox, copy_ext->btnm);

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_mbox);
    }

    LV_LOG_INFO("mesasge box created");

    return new_mbox;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
callq 0x22b18
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xd76e
testq %rbx, %rbx
je 0xd77f
cmpq $0x0, 0x52c24(%rip)     # 0x602f8
jne 0xd6e5
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x52c13(%rip)     # 0x602f8
movq %rbx, %rdi
movl $0x20, %esi
callq 0x64db
movq %rax, %r15
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xd790
testq %r15, %r15
je 0xd77f
movq %r15, %r12
addq $0x8, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movw $0xc8, 0x18(%r15)
leaq 0x12d(%rip), %rsi       # 0xd854
movq %rbx, %rdi
callq 0x647b
testq %r14, %r14
je 0xd7a1
movq %r14, %rdi
callq 0x6af7
movq %rax, %r14
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x19ed4
movq %rax, (%r12)
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xd764
movq %rbx, %rdi
callq 0x2148c
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x5e54
jmp 0xd781
leaq 0x3195b(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0xd77d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x31939(%rip), %rdi     # 0x3f0d0
movq %r15, %rsi
callq 0x8294
jmp 0xd79f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x19ed4
movq %rax, (%r12)
movq %rax, %rdi
movl $0x1, %esi
callq 0x1a95d
movq (%r12), %rdi
movl $0x1, %esi
callq 0x1a602
movq (%r12), %rdi
leaq 0x31dc7(%rip), %rsi     # 0x3f59c
callq 0x1a6da
movq %rbx, %rdi
movl $0x3, %esi
callq 0x22d1c
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22d84
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x570d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5789
leaq 0x1b1(%rip), %rsi       # 0xd9d4
movq %rbx, %rdi
callq 0x6363
callq 0x2e91c
testq %rax, %rax
je 0xd83e
movq 0x1e8(%rax), %rdx
jmp 0xd845
leaq 0x52763(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
xorl %esi, %esi
callq 0xd9f5
jmp 0xd781