// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x381b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x167d0
movq -0x20(%rbp), %rsi
leaq 0x5187b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x167ce
cmpq $0x0, -0x20(%rbp)
jne 0x167e4
movq $0x0, -0x8(%rbp)
jmp 0x169bf
cmpq $0x0, 0x72bdc(%rip)     # 0x893c8
jne 0x167fe
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x72bca(%rip)     # 0x893c8
movq -0x20(%rbp), %rdi
movl $0x20, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x1682f
movq -0x28(%rbp), %rsi
leaq 0x5181c(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x1682d
cmpq $0x0, -0x28(%rbp)
jne 0x16843
movq $0x0, -0x8(%rbp)
jmp 0x169bf
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x28(%rbp), %rax
movw $0xc8, 0x18(%rax)
movq -0x20(%rbp), %rdi
leaq 0x160(%rip), %rsi       # 0x169d0
callq 0x9cc0
cmpq $0x0, -0x18(%rbp)
jne 0x1695e
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x29820
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x2aac0
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl $0x1, %esi
callq 0x2a4f0
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x51b2d(%rip), %rsi     # 0x683f8
callq 0x2a630
movq -0x20(%rbp), %rdi
movl $0x3, %esi
callq 0x385a0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x16bf0
movq -0x20(%rbp), %rdi
movl $0xc8, %esi
callq 0x8430
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0x8500
movq -0x20(%rbp), %rdi
leaq 0x313(%rip), %rsi       # 0x16c30
callq 0x9b00
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1694a
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x1e8(%rax), %rdx
xorl %esi, %esi
callq 0x16c80
jmp 0x1695c
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x72721(%rip), %rdx     # 0x89078
callq 0x16c80
jmp 0x169b7
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x29820
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x169ae
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x35980
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)