// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_tileview.c
// Function: lv_tileview_create
lv_obj_t * lv_tileview_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("tileview create started");

    /*Create the ancestor of tileview*/
    lv_obj_t * new_tileview = lv_page_create(par, copy);
    LV_ASSERT_MEM(new_tileview);
    if(new_tileview == NULL) return NULL;

    /*Allocate the tileview type specific extended data*/
    lv_tileview_ext_t * ext = lv_obj_allocate_ext_attr(new_tileview, sizeof(lv_tileview_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_tileview);
    if(ancestor_scrl_signal == NULL) ancestor_scrl_signal = lv_obj_get_signal_cb(lv_page_get_scrl(new_tileview));
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_tileview);

        /*Initialize the allocated 'ext' */
#if LV_USE_ANIMATION
    ext->anim_time = LV_TILEVIEW_DEF_ANIM_TIME;
#endif
    ext->act_id.x      = 0;
    ext->act_id.y      = 0;
    ext->valid_pos     = NULL;
    ext->valid_pos_cnt = 0;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_tileview, lv_tileview_signal);
    lv_obj_set_signal_cb(lv_page_get_scrl(new_tileview), lv_tileview_scrl_signal);

    /*Init the new tileview*/
    if(copy == NULL) {
        /* Set a size which fits into the parent.
         * Don't use `par` directly because if the tileview is created on a page it is moved to the
         * scrollable so the parent has changed */
        lv_obj_set_size(new_tileview, lv_obj_get_width_fit(lv_obj_get_parent(new_tileview)),
                        lv_obj_get_height_fit(lv_obj_get_parent(new_tileview)));

        lv_obj_set_drag_throw(lv_page_get_scrl(new_tileview), false);
        lv_page_set_scrl_fit(new_tileview, LV_FIT_TIGHT);
        lv_obj_set_event_cb(ext->page.scrl, tileview_scrl_event_cb);
        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_page_set_style(new_tileview, LV_PAGE_STYLE_BG, th->style.tileview.bg);
            lv_page_set_style(new_tileview, LV_PAGE_STYLE_SCRL, th->style.tileview.scrl);
            lv_page_set_style(new_tileview, LV_PAGE_STYLE_SB, th->style.tileview.sb);
        } else {
            lv_page_set_style(new_tileview, LV_PAGE_STYLE_BG, &lv_style_transp_tight);
            lv_page_set_style(new_tileview, LV_PAGE_STYLE_SCRL, &lv_style_transp_tight);
        }
    }
    /*Copy an existing tileview*/
    else {
        lv_tileview_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->act_id.x                = copy_ext->act_id.x;
        ext->act_id.y                = copy_ext->act_id.y;
        ext->valid_pos               = copy_ext->valid_pos;
        ext->valid_pos_cnt           = copy_ext->valid_pos_cnt;
#if LV_USE_ANIMATION
        ext->anim_time = copy_ext->anim_time;
#endif

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

    LV_LOG_INFO("tileview created");

    return new_tileview;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3c400
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x1ea90
movq -0x20(%rbp), %rsi
leaq 0x495bb(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x1ea8e
cmpq $0x0, -0x20(%rbp)
jne 0x1eaa4
movq $0x0, -0x8(%rbp)
jmp 0x1ed0d
movq -0x20(%rbp), %rdi
movl $0x68, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x1ead5
movq -0x28(%rbp), %rsi
leaq 0x49576(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x1ead3
cmpq $0x0, -0x28(%rbp)
jne 0x1eae9
movq $0x0, -0x8(%rbp)
jmp 0x1ed0d
cmpq $0x0, 0x6a927(%rip)     # 0x89418
jne 0x1eb03
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x6a915(%rip)     # 0x89418
cmpq $0x0, 0x6a915(%rip)     # 0x89420
jne 0x1eb25
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
callq 0xa830
movq %rax, 0x6a8fb(%rip)     # 0x89420
cmpq $0x0, 0x6a8fb(%rip)     # 0x89428
jne 0x1eb3f
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x6a8e9(%rip)     # 0x89428
movq -0x28(%rbp), %rax
movw $0x12c, 0x5a(%rax)      # imm = 0x12C
movq -0x28(%rbp), %rax
movw $0x0, 0x5c(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x5e(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x58(%rax)
movq -0x20(%rbp), %rdi
leaq 0x1a2(%rip), %rsi       # 0x1ed20
callq 0x9cc0
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
leaq 0x20a(%rip), %rsi       # 0x1eda0
callq 0x9cc0
cmpq $0x0, -0x18(%rbp)
jne 0x1ec9f
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x71b0
movq %rax, %rdi
callq 0xa1e0
movw %ax, -0x3a(%rbp)
movq -0x20(%rbp), %rdi
callq 0x71b0
movq %rax, %rdi
callq 0xa240
movq -0x48(%rbp), %rdi
movw -0x3a(%rbp), %cx
movswl %cx, %esi
movswl %ax, %edx
callq 0x8180
movq -0x20(%rbp), %rdi
callq 0x3e970
movq %rax, %rdi
xorl %esi, %esi
callq 0x96c0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x1f470
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x889(%rip), %rsi       # 0x1f4a0
callq 0x9b00
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1ec76
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x2f8(%rax), %rdx
xorl %esi, %esi
callq 0x3dff0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x300(%rax), %rdx
movl $0x1, %esi
callq 0x3dff0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x308(%rax), %rdx
movl $0x2, %esi
callq 0x3dff0
jmp 0x1ec9d
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x6a515(%rip), %rdx     # 0x89198
callq 0x3dff0
movq -0x20(%rbp), %rdi
movl $0x1, %esi
leaq 0x6a500(%rip), %rdx     # 0x89198
callq 0x3dff0
jmp 0x1ed05
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movw 0x5c(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x5c(%rax)
movq -0x38(%rbp), %rax
movw 0x5e(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x5e(%rax)
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x38(%rbp), %rax
movw 0x58(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x58(%rax)
movq -0x38(%rbp), %rax
movw 0x5a(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x5a(%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)