// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x19d10
movq -0x20(%rbp), %rsi
leaq 0x4e33b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x19d0e
cmpq $0x0, -0x20(%rbp)
jne 0x19d24
movq $0x0, -0x8(%rbp)
jmp 0x19f79
movq -0x20(%rbp), %rdi
movl $0x48, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x19d55
movq -0x28(%rbp), %rsi
leaq 0x4e2f6(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x19d53
cmpq $0x0, -0x28(%rbp)
jne 0x19d69
movq $0x0, -0x8(%rbp)
jmp 0x19f79
cmpq $0x0, 0x6f67f(%rip)     # 0x893f0
jne 0x19d83
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x6f66d(%rip)     # 0x893f0
cmpq $0x0, 0x6f66d(%rip)     # 0x893f8
jne 0x19d9d
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x6f65b(%rip)     # 0x893f8
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
leaq 0x6f234(%rip), %rcx     # 0x88fe8
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
leaq 0x6f225(%rip), %rcx     # 0x88fe8
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
leaq 0x6f216(%rip), %rcx     # 0x88fe8
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
leaq 0x6f207(%rip), %rcx     # 0x88fe8
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movw $0x0, (%rax)
movq -0x28(%rbp), %rax
movw $0x0, 0x2(%rax)
movw $0x0, -0x2a(%rbp)
movzwl -0x2a(%rbp), %eax
cmpl $0xc, %eax
jge 0x19e24
movq -0x28(%rbp), %rax
movzwl -0x2a(%rbp), %ecx
movw $0x64, 0x30(%rax,%rcx,2)
movw -0x2a(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x2a(%rbp)
jmp 0x19dfe
movq -0x20(%rbp), %rdi
leaq 0x161(%rip), %rsi       # 0x19f90
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x271(%rip), %rsi       # 0x1a0b0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x19efa
callq 0x4cfc0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x19edb
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x310(%rax), %rdx
xorl %esi, %esi
callq 0x1a7d0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x318(%rax), %rdx
movl $0x1, %esi
callq 0x1a7d0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x318(%rax), %rdx
movl $0x2, %esi
callq 0x1a7d0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x318(%rax), %rdx
movl $0x3, %esi
callq 0x1a7d0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x318(%rax), %rdx
movl $0x4, %esi
callq 0x1a7d0
jmp 0x19eed
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x6f148(%rip), %rdx     # 0x89030
callq 0x1a7d0
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x94b0
jmp 0x19f71
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x1a8b0
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movzwl (%rax), %esi
callq 0x1a9f0
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)