// File: /workspace/github_c_makefile_star2_O1/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 0x22398
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0xd832
testq %rbx, %rbx
je 0xd843
cmpq $0x0, 0x52b60(%rip)     # 0x602f8
jne 0xd7a9
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x52b4f(%rip)     # 0x602f8
movq %rbx, %rdi
movl $0x20, %esi
callq 0x64bc
movq %rax, %r15
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0xd854
testq %r15, %r15
je 0xd843
movq %r15, %r12
addq $0x8, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movw $0xc8, 0x18(%r15)
leaq 0x12d(%rip), %rsi       # 0xd918
movq %rbx, %rdi
callq 0x645c
testq %r14, %r14
je 0xd865
movq %r14, %rdi
callq 0x6ad8
movq %rax, %r14
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x196f4
movq %rax, (%r12)
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xd828
movq %rbx, %rdi
callq 0x20cb8
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x5e38
jmp 0xd845
leaq 0x31807(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0xd841
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x317e5(%rip), %rdi     # 0x3f040
movq %r15, %rsi
callq 0x829e
jmp 0xd863
movq %rbx, %rdi
xorl %esi, %esi
callq 0x196f4
movq %rax, (%r12)
movq %rax, %rdi
movl $0x1, %esi
callq 0x1a196
movq (%r12), %rdi
movl $0x1, %esi
callq 0x19e3d
movq (%r12), %rdi
leaq 0x31c53(%rip), %rsi     # 0x3f4ec
callq 0x19f13
movq %rbx, %rdi
movl $0x3, %esi
callq 0x2259a
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x22602
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x56f1
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x576d
leaq 0x196(%rip), %rsi       # 0xda7d
movq %rbx, %rdi
callq 0x6344
callq 0x2e244
testq %rax, %rax
je 0xd902
movq 0x1e8(%rax), %rdx
jmp 0xd909
leaq 0x5269f(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
xorl %esi, %esi
callq 0xda9e
jmp 0xd845