// File: /workspace/github_c_makefile_star2_O3/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_table.c
// Function: lv_table_create
lv_obj_t * lv_table_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("table create started");

    /*Create the ancestor of table*/
    lv_obj_t * new_table = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_table);
    if(new_table == NULL) return NULL;

    /*Allocate the table type specific extended data*/
    lv_table_ext_t * ext = lv_obj_allocate_ext_attr(new_table, sizeof(lv_table_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;
    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_table);
    if(ancestor_scrl_design == NULL) ancestor_scrl_design = lv_obj_get_design_cb(new_table);

    /*Initialize the allocated 'ext' */
    ext->cell_data     = NULL;
    ext->cell_style[0] = &lv_style_plain;
    ext->cell_style[1] = &lv_style_plain;
    ext->cell_style[2] = &lv_style_plain;
    ext->cell_style[3] = &lv_style_plain;
    ext->col_cnt       = 0;
    ext->row_cnt       = 0;

    uint16_t i;
    for(i = 0; i < LV_TABLE_COL_MAX; i++) {
        ext->col_w[i] = LV_DPI;
    }

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_table, lv_table_signal);
    lv_obj_set_design_cb(new_table, lv_table_design);

    /*Init the new table table*/
    if(copy == NULL) {
        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_table_set_style(new_table, LV_TABLE_STYLE_BG, th->style.table.bg);
            lv_table_set_style(new_table, LV_TABLE_STYLE_CELL1, th->style.table.cell);
            lv_table_set_style(new_table, LV_TABLE_STYLE_CELL2, th->style.table.cell);
            lv_table_set_style(new_table, LV_TABLE_STYLE_CELL3, th->style.table.cell);
            lv_table_set_style(new_table, LV_TABLE_STYLE_CELL4, th->style.table.cell);
        } else {
            lv_table_set_style(new_table, LV_TABLE_STYLE_BG, &lv_style_plain_color);
        }
        lv_obj_set_click(new_table, false); /*Can be removed if click support is added*/
    }
    /*Copy an existing table*/
    else {
        lv_table_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->cell_style[0]        = copy_ext->cell_style[0];
        ext->cell_style[1]        = copy_ext->cell_style[1];
        ext->cell_style[2]        = copy_ext->cell_style[2];
        ext->cell_style[3]        = copy_ext->cell_style[3];
        lv_table_set_row_cnt(new_table, copy_ext->row_cnt);
        lv_table_set_col_cnt(new_table, copy_ext->col_cnt);

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

    LV_LOG_INFO("table created");

    return new_table;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x454f
movq %rax, %rbx
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xf999
testq %rbx, %rbx
je 0xf9aa
movq %rbx, %rdi
movl $0x48, %esi
callq 0x64db
movq %rax, %r15
movq %rax, %rdi
callq 0x80e4
testb %al, %al
je 0xf9b5
testq %r15, %r15
je 0xf9aa
cmpq $0x0, 0x50b0e(%rip)     # 0x60320
jne 0xf823
movq %rbx, %rdi
callq 0x6a8b
movq %rax, 0x50afd(%rip)     # 0x60320
cmpq $0x0, 0x50afd(%rip)     # 0x60328
jne 0xf83c
movq %rbx, %rdi
callq 0x6aaf
movq %rax, 0x50aec(%rip)     # 0x60328
movq $0x0, 0x8(%r15)
leaq 0x506cd(%rip), %rax     # 0x5ff18
movq %rax, 0x10(%r15)
movq %rax, 0x18(%r15)
movq %rax, 0x20(%r15)
movq %rax, 0x28(%r15)
movl $0x0, (%r15)
movdqa 0x2fd76(%rip), %xmm0    # 0x3f5e0
movdqa 0x2fd7e(%rip), %xmm1    # 0x3f5f0
xorl %eax, %eax
movdqa 0x2fd84(%rip), %xmm2    # 0x3f600
movdqa 0x2fd8c(%rip), %xmm3    # 0x3f610
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
movdqa 0x2fd8f(%rip), %xmm5    # 0x3f620
movdqa %xmm1, %xmm6
pxor %xmm2, %xmm6
movdqa %xmm3, %xmm7
pcmpgtd %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pcmpeqd %xmm4, %xmm6
pand %xmm7, %xmm6
movd %xmm6, %ecx
testb $0x1, %cl
je 0xf8bf
movw $0x64, 0x30(%r15,%rax,2)
pextrw $0x4, %xmm6, %ecx
testb $0x1, %cl
je 0xf8d1
movw $0x64, 0x32(%r15,%rax,2)
movdqa %xmm0, %xmm6
pxor %xmm2, %xmm6
movdqa %xmm3, %xmm7
pcmpgtd %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
pcmpeqd %xmm4, %xmm6
pand %xmm7, %xmm6
pextrw $0x0, %xmm6, %ecx
testb $0x1, %cl
je 0xf900
movw $0x64, 0x34(%r15,%rax,2)
pextrw $0x4, %xmm6, %ecx
testb $0x1, %cl
je 0xf912
movw $0x64, 0x36(%r15,%rax,2)
addq $0x4, %rax
paddq %xmm5, %xmm1
paddq %xmm5, %xmm0
cmpq $0xc, %rax
jne 0xf891
leaq 0x122(%rip), %rsi       # 0xfa51
movq %rbx, %rdi
callq 0x647b
leaq 0x1e1(%rip), %rsi       # 0xfb1f
movq %rbx, %rdi
callq 0x64ab
testq %r14, %r14
je 0xf9c6
movq %r14, %rdi
callq 0x6af7
movq %rax, %r14
movq 0x10(%rax), %rax
movq %rax, 0x10(%r15)
movq 0x18(%r14), %rax
movq %rax, 0x18(%r15)
movq 0x20(%r14), %rax
movq %rax, 0x20(%r15)
movq 0x28(%r14), %rax
movq %rax, 0x28(%r15)
movzwl 0x2(%r14), %esi
movq %rbx, %rdi
callq 0xfff0
movzwl (%r14), %esi
movq %rbx, %rdi
callq 0x100a0
movq %rbx, %rdi
callq 0x5e54
jmp 0xf9ac
leaq 0x2f730(%rip), %rdi     # 0x3f0d0
movq %rbx, %rsi
callq 0x8294
jmp 0xf9a8
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2f714(%rip), %rdi     # 0x3f0d0
movq %r15, %rsi
callq 0x8294
jmp 0xf9c4
callq 0x2e91c
testq %rax, %rax
je 0xfa31
movq %rax, %r14
movq 0x310(%rax), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0xff74
movq 0x318(%r14), %rdx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xff74
movq 0x318(%r14), %rdx
movq %rbx, %rdi
movl $0x2, %esi
callq 0xff74
movq 0x318(%r14), %rdx
movq %rbx, %rdi
movl $0x3, %esi
callq 0xff74
movq 0x318(%r14), %rdx
movq %rbx, %rdi
movl $0x4, %esi
jmp 0xfa3d
leaq 0x50528(%rip), %rdx     # 0x5ff60
movq %rbx, %rdi
xorl %esi, %esi
callq 0xff74
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5ff7
jmp 0xf9ac