// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
callq 0x209c8
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0xcd2c
testq %rbx, %rbx
je 0xcd3d
cmpq $0x0, 0x51664(%rip)     # 0x5e2f8
jne 0xcca5
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x51653(%rip)     # 0x5e2f8
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r15
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0xcd4b
testq %r15, %r15
je 0xcd3d
movq %r15, %r12
addq $0x8, %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movw $0xc8, 0x18(%r15)
leaq 0x11f(%rip), %rsi       # 0xce04
movq %rbx, %rdi
callq 0x60e6
testq %r14, %r14
je 0xcd5c
movq %r14, %rdi
callq 0x6747
movq %rax, %r14
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x182f0
movq %rax, (%r12)
movq 0x10(%r14), %rsi
testq %rsi, %rsi
je 0xcd22
movq %rbx, %rdi
callq 0x1f420
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x5ae7
jmp 0xcd3f
leaq 0x2e30d(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0xcd3b
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e2ee(%rip), %rdi     # 0x3b040
movq %r15, %rsi
callq 0x7b01
jmp 0xcd5a
movq %rbx, %rdi
xorl %esi, %esi
callq 0x182f0
movq %rax, (%r12)
pushq $0x1
popq %rbp
movq %rax, %rdi
movl %ebp, %esi
callq 0x18d16
movq (%r12), %rdi
movl %ebp, %esi
callq 0x189c5
movq (%r12), %rdi
leaq 0x2e76f(%rip), %rsi     # 0x3b4fc
callq 0x18a9a
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x20bca
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %ebp, %ecx
movl %ebp, %r8d
callq 0x20c30
movq %rbx, %rdi
movl $0xc8, %esi
callq 0x53a8
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5424
leaq 0x1a9(%rip), %rsi       # 0xcf7c
movq %rbx, %rdi
callq 0x5fce
callq 0x2be75
testq %rax, %rax
je 0xcdee
movq 0x1e8(%rax), %rdx
jmp 0xcdf5
leaq 0x511b3(%rip), %rdx     # 0x5dfa8
movq %rbx, %rdi
xorl %esi, %esi
callq 0xcf9d
jmp 0xcd3f