// File: /workspace/github_c_makefile_star2_O0/CkTD[P]btree/table.c
// Function: table_content_new_from_file
static TableContent *table_content_new_from_file(const char *dir)
{
    TableContent *content;
    TableRows    *rows;
    TableRow     *row;
    int           i;
    ssize_t       rtv;

    content = (TableContent *)malloc(sizeof(TableContent));

    content->file_fd = -1;
    content->file_path = table_content_get_path(dir);
    table_content_open_file(content);

    rtv = lseek(content->file_fd, 0, SEEK_SET);
    assert(rtv == 0);
    rtv = read(content->file_fd, &content->meta, sizeof(TableMeta));
    assert(rtv == sizeof(TableMeta));
    assert(content->meta.file_magic == TABLE_FILE_MAGIC);

    content->next_rowid_to_flush = content->meta.row_counts;

    rows = table_rows_new_empty();
    for(i = 0; i < content->meta.row_counts; i ++)
    {
        row = (TableRow *)malloc(sizeof(TableRow));
        rtv = read(content->file_fd, row, sizeof(TableRow));
        assert(rtv == sizeof(TableRow));
        table_rows_append_row(rows, row);
    }
    content->rows = rows;

    return content;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x350, %edi            # imm = 0x350
callq 0x1100
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rdi
callq 0x5040
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x50a0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x10a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4e80
jmp 0x4e9f
leaq 0x1b50(%rip), %rdi      # 0x69d7
leaq 0x1afd(%rip), %rsi      # 0x698b
movl $0xee, %edx
leaq 0x1c18(%rip), %rcx      # 0x6ab2
callq 0x10b0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x10(%rbp), %rsi
addq $0x20, %rsi
movl $0x330, %edx            # imm = 0x330
callq 0x10d0
movq %rax, -0x30(%rbp)
cmpq $0x330, -0x30(%rbp)     # imm = 0x330
jne 0x4ec8
jmp 0x4ee7
leaq 0x1c1b(%rip), %rdi      # 0x6aea
leaq 0x1ab5(%rip), %rsi      # 0x698b
movl $0xf0, %edx
leaq 0x1bd0(%rip), %rcx      # 0x6ab2
callq 0x10b0
movq -0x10(%rbp), %rax
movl $0xaaaaaaaa, %ecx       # imm = 0xAAAAAAAA
cmpq %rcx, 0x20(%rax)
jne 0x4ef8
jmp 0x4f17
leaq 0x1c04(%rip), %rdi      # 0x6b03
leaq 0x1a85(%rip), %rsi      # 0x698b
movl $0xf1, %edx
leaq 0x1ba0(%rip), %rcx      # 0x6ab2
callq 0x10b0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
callq 0x4dc0
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x4faf
movl $0x320, %edi            # imm = 0x320
callq 0x1100
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x20(%rbp), %rsi
movl $0x320, %edx            # imm = 0x320
callq 0x10d0
movq %rax, -0x30(%rbp)
cmpq $0x320, -0x30(%rbp)     # imm = 0x320
jne 0x4f78
jmp 0x4f97
leaq 0x1bb1(%rip), %rdi      # 0x6b30
leaq 0x1a05(%rip), %rsi      # 0x698b
movl $0xfa, %edx
leaq 0x1b20(%rip), %rcx      # 0x6ab2
callq 0x10b0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4d50
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4f37
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)