// File: /workspace/github_c_makefile_star2_O1/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_page.c
// Function: lv_page_create
lv_obj_t * lv_page_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("page create started");

    /*Create the ancestor object*/
    lv_obj_t * new_page = lv_cont_create(par, copy);
    LV_ASSERT_MEM(new_page);
    if(new_page == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_page);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_page);

    /*Allocate the object type specific extended data*/
    lv_page_ext_t * ext = lv_obj_allocate_ext_attr(new_page, sizeof(lv_page_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->scrl        = NULL;
    ext->sb.hor_draw = 0;
    ext->sb.ver_draw = 0;
    ext->sb.style    = &lv_style_pretty;
    ext->sb.mode     = LV_SB_MODE_AUTO;
#if LV_USE_ANIMATION
    ext->edge_flash.enabled   = 0;
    ext->edge_flash.bottom_ip = 0;
    ext->edge_flash.top_ip    = 0;
    ext->edge_flash.left_ip   = 0;
    ext->edge_flash.right_ip  = 0;
    ext->edge_flash.state     = 0;
    ext->edge_flash.style     = &lv_style_plain_color;
    ext->anim_time            = LV_PAGE_DEF_ANIM_TIME;
#endif
    ext->scroll_prop    = 0;
    ext->scroll_prop_ip = 0;

    /*Init the new page object*/
    if(copy == NULL) {
        ext->scrl = lv_cont_create(new_page, NULL);
        lv_obj_set_signal_cb(ext->scrl, lv_page_scrollable_signal);
        lv_obj_set_design_cb(ext->scrl, lv_scrl_design);
        lv_obj_set_drag(ext->scrl, true);
        lv_obj_set_drag_throw(ext->scrl, true);
        lv_obj_set_protect(ext->scrl, LV_PROTECT_PARENT | LV_PROTECT_PRESS_LOST);
        lv_cont_set_fit4(ext->scrl, LV_FIT_FILL, LV_FIT_FILL, LV_FIT_FILL, LV_FIT_FILL);
        lv_obj_set_event_cb(ext->scrl, scrl_def_event_cb); /*Propagate some event to the background
                                                              object by default for convenience */

        /* Add the signal function only if 'scrolling' is created
         * because everything has to be ready before any signal is received*/
        lv_obj_set_signal_cb(new_page, lv_page_signal);
        lv_obj_set_design_cb(new_page, lv_page_design);

        lv_page_set_sb_mode(new_page, ext->sb.mode);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            if(par == NULL) { /*Different styles if it is screen*/
                lv_page_set_style(new_page, LV_PAGE_STYLE_BG, th->style.bg);
                lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, &lv_style_transp);
            } else {
                lv_page_set_style(new_page, LV_PAGE_STYLE_BG, th->style.page.bg);
                lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, th->style.page.scrl);
            }
            lv_page_set_style(new_page, LV_PAGE_STYLE_SB, th->style.page.sb);
        } else {
            lv_page_set_style(new_page, LV_PAGE_STYLE_BG, &lv_style_pretty_color);
            lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, &lv_style_pretty);
            lv_page_set_style(new_page, LV_PAGE_STYLE_SB, &lv_style_pretty_color);
        }

    } else {
        lv_page_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->scrl                = lv_cont_create(new_page, copy_ext->scrl);
        lv_obj_set_signal_cb(ext->scrl, lv_page_scrollable_signal);

        lv_page_set_sb_mode(new_page, copy_ext->sb.mode);

        lv_page_set_style(new_page, LV_PAGE_STYLE_BG, lv_page_get_style(copy, LV_PAGE_STYLE_BG));
        lv_page_set_style(new_page, LV_PAGE_STYLE_SCRL, lv_page_get_style(copy, LV_PAGE_STYLE_SCRL));
        lv_page_set_style(new_page, LV_PAGE_STYLE_SB, lv_page_get_style(copy, LV_PAGE_STYLE_SB));

        /* Add the signal function only if 'scrolling' is created
         * because everything has to be ready before any signal is received*/
        lv_obj_set_signal_cb(new_page, lv_page_signal);
        lv_obj_set_design_cb(new_page, lv_page_design);

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

    lv_page_sb_refresh(new_page);

    LV_LOG_INFO("page created");

    return new_page;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
callq 0x22398
movq %rax, %rbx
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x24e34
testq %rbx, %rbx
je 0x24e45
cmpq $0x0, 0x3b795(%rip)     # 0x60468
jne 0x24ce4
movq %rbx, %rdi
callq 0x6a6c
movq %rax, 0x3b784(%rip)     # 0x60468
cmpq $0x0, 0x3b784(%rip)     # 0x60470
jne 0x24cfd
movq %rbx, %rdi
callq 0x6a90
movq %rax, 0x3b773(%rip)     # 0x60470
movq %rbx, %rdi
movl $0x50, %esi
callq 0x64bc
movq %rax, %r12
movq %rax, %rdi
callq 0x80d4
testb %al, %al
je 0x24e4c
testq %r12, %r12
je 0x24e45
movq $0x0, 0x8(%r12)
movb 0x28(%r12), %al
leaq 0x3b26d(%rip), %rcx     # 0x5ffa8
movq %rcx, 0x10(%r12)
andb $-0x20, %al
orb $0xc, %al
movb %al, 0x28(%r12)
andb $-0x20, 0x40(%r12)
movw $0x0, 0x30(%r12)
leaq 0x3b202(%rip), %rax     # 0x5ff60
movq %rax, 0x38(%r12)
movw $0x190, 0x48(%r12)      # imm = 0x190
andb $-0x4, 0x4a(%r12)
testq %r15, %r15
je 0x24e5d
movq %r15, %rdi
callq 0x6ad8
movq %rax, %r14
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x22398
movq %rax, 0x8(%r12)
leaq 0x22c(%rip), %rsi       # 0x24fc9
movq %rax, %rdi
callq 0x645c
movzbl 0x28(%r14), %esi
shrl $0x2, %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x25c83
movq %r15, %rdi
xorl %esi, %esi
callq 0x25ddf
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x25d1f
movq %r15, %rdi
movl $0x1, %esi
callq 0x25ddf
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0x25d1f
movq %r15, %rdi
movl $0x2, %esi
callq 0x25ddf
movq %rbx, %rdi
movl $0x2, %esi
movq %rax, %rdx
callq 0x25d1f
leaq 0x80a(%rip), %rsi       # 0x2561a
movq %rbx, %rdi
callq 0x645c
leaq 0xb85(%rip), %rsi       # 0x259a4
movq %rbx, %rdi
callq 0x648c
movq %rbx, %rdi
callq 0x5e38
jmp 0x24fb2
leaq 0x1a205(%rip), %rdi     # 0x3f040
movq %rbx, %rsi
callq 0x829e
jmp 0x24e43
xorl %ebx, %ebx
jmp 0x24fba
leaq 0x1a1ed(%rip), %rdi     # 0x3f040
movq %r12, %rsi
callq 0x829e
jmp 0x24e5b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x22398
movq %rax, 0x8(%r12)
leaq 0x156(%rip), %rsi       # 0x24fc9
movq %rax, %rdi
callq 0x645c
movq 0x8(%r12), %rdi
leaq 0x663(%rip), %rsi       # 0x254ea
callq 0x648c
movq 0x8(%r12), %rdi
movl $0x1, %esi
callq 0x604d
movq 0x8(%r12), %rdi
movl $0x1, %esi
callq 0x60fa
movq 0x8(%r12), %rdi
movl $0x12, %esi
callq 0x62e7
movq 0x8(%r12), %rdi
movl $0x3, %esi
movl $0x3, %edx
movl $0x3, %ecx
movl $0x3, %r8d
callq 0x22602
movq 0x8(%r12), %rdi
leaq 0x701(%rip), %rsi       # 0x255e5
callq 0x6344
leaq 0x72a(%rip), %rsi       # 0x2561a
movq %rbx, %rdi
callq 0x645c
leaq 0xaa5(%rip), %rsi       # 0x259a4
movq %rbx, %rdi
callq 0x648c
movzbl 0x28(%r12), %esi
shrl $0x2, %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x25c83
callq 0x2e244
testq %rax, %rax
je 0x24f47
movq %rax, %r15
testq %r14, %r14
je 0x24f7c
movq 0x208(%r15), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x25d1f
movq 0x210(%r15), %rdx
jmp 0x24f91
leaq 0x3b0a2(%rip), %r14     # 0x5fff0
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x25d1f
leaq 0x3b046(%rip), %rdx     # 0x5ffa8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25d1f
movq %rbx, %rdi
movl $0x2, %esi
movq %r14, %rdx
jmp 0x24fad
movq 0x8(%r15), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x25d1f
leaq 0x3b0a7(%rip), %rdx     # 0x60038
movq %rbx, %rdi
movl $0x1, %esi
callq 0x25d1f
movq 0x218(%r15), %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0x25d1f
movq %rbx, %rdi
callq 0x25e4c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq