// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x209c8
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x23238
testq %rbx, %rbx
je 0x23249
cmpq $0x0, 0x3b385(%rip)     # 0x5e468
jne 0x230f4
movq %rbx, %rdi
callq 0x66db
movq %rax, 0x3b374(%rip)     # 0x5e468
cmpq $0x0, 0x3b374(%rip)     # 0x5e470
jne 0x2310d
movq %rbx, %rdi
callq 0x66ff
movq %rax, 0x3b363(%rip)     # 0x5e470
pushq $0x50
popq %rsi
movq %rbx, %rdi
callq 0x6146
movq %rax, %r12
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x23250
testq %r12, %r12
je 0x23249
andq $0x0, 0x8(%r12)
movb 0x28(%r12), %al
leaq 0x3ae62(%rip), %rcx     # 0x5dfa8
movq %rcx, 0x10(%r12)
andb $-0x20, %al
orb $0xc, %al
movb %al, 0x28(%r12)
andb $-0x20, 0x40(%r12)
andw $0x0, 0x30(%r12)
leaq 0x3adf8(%rip), %rax     # 0x5df60
movq %rax, 0x38(%r12)
movw $0x190, 0x48(%r12)      # imm = 0x190
andb $-0x4, 0x4a(%r12)
testq %r15, %r15
je 0x23261
movq %r15, %rdi
callq 0x6747
movq %rax, %r14
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x209c8
movq %rax, 0x8(%r12)
leaq 0x20b(%rip), %rsi       # 0x233b2
movq %rax, %rdi
callq 0x60e6
movzbl 0x28(%r14), %esi
shrl $0x2, %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x23fed
movq %r15, %rdi
xorl %esi, %esi
callq 0x24149
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x24089
pushq $0x1
popq %rbp
movq %r15, %rdi
movl %ebp, %esi
callq 0x24149
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x24089
pushq $0x2
popq %rbp
movq %r15, %rdi
movl %ebp, %esi
callq 0x24149
movq %rbx, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x24089
leaq 0x7c3(%rip), %rsi       # 0x239d7
movq %rbx, %rdi
callq 0x60e6
leaq 0xb1f(%rip), %rsi       # 0x23d42
movq %rbx, %rdi
callq 0x6116
movq %rbx, %rdi
callq 0x5ae7
jmp 0x2339e
leaq 0x17e01(%rip), %rdi     # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x23247
xorl %ebx, %ebx
jmp 0x233a6
leaq 0x17de9(%rip), %rdi     # 0x3b040
movq %r12, %rsi
callq 0x7b01
jmp 0x2325f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x209c8
movq %rax, 0x8(%r12)
leaq 0x13b(%rip), %rsi       # 0x233b2
movq %rax, %rdi
callq 0x60e6
movq 0x8(%r12), %rdi
leaq 0x626(%rip), %rsi       # 0x238b1
callq 0x6116
movq 0x8(%r12), %rdi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x5ce4
movq 0x8(%r12), %rdi
movl %ebp, %esi
callq 0x5d8d
movq 0x8(%r12), %rdi
pushq $0x12
popq %rsi
callq 0x5f71
movq 0x8(%r12), %rdi
pushq $0x3
popq %rcx
movl %ecx, %esi
movl %ecx, %edx
movl %ecx, %r8d
callq 0x20c30
movq 0x8(%r12), %rdi
leaq 0x6ca(%rip), %rsi       # 0x239a2
callq 0x5fce
leaq 0x6f3(%rip), %rsi       # 0x239d7
movq %rbx, %rdi
callq 0x60e6
leaq 0xa4f(%rip), %rsi       # 0x23d42
movq %rbx, %rdi
callq 0x6116
movzbl 0x28(%r12), %esi
shrl $0x2, %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x23fed
callq 0x2be75
testq %rax, %rax
je 0x2333b
movq %rax, %r15
testq %r14, %r14
je 0x2336c
movq 0x208(%r15), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x24089
movq 0x210(%r15), %rdx
jmp 0x23381
leaq 0x3acae(%rip), %r14     # 0x5dff0
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x24089
leaq 0x3ac52(%rip), %rdx     # 0x5dfa8
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x24089
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
jmp 0x23399
movq 0x8(%r15), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x24089
leaq 0x3acb7(%rip), %rdx     # 0x5e038
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x24089
movq 0x218(%r15), %rdx
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x24089
movq %rbx, %rdi
callq 0x241b6
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq