// File: /workspace/github_c_makefile_star2_O2/CkTD[P]btree/table.c
// Function: table_open
Table *table_open(TableOpenFlag flag)
{
    if(access(flag.dir, F_OK) != -1)
    {
        if(flag.error_if_exist)
            return NULL;
        return table_new_from_file(flag.dir);
    }
    else
    {
        // table not exist!
        if(!flag.create_if_missing)
            return NULL;
        return table_new_empty(flag.dir);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %esi, %esi
callq 0x1170
cmpl $-0x1, %eax
je 0x2bd5
shrq $0x20, %rbx
jne 0x2cec
pushq $0x40
popq %rdi
callq 0x1130
movq %rax, %rbx
movq %r14, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
callq 0x1130
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
movq %r15, (%rbx)
movl $0x350, %edi            # imm = 0x350
callq 0x1130
movq %rax, %r15
orl $-0x1, 0x8(%rax)
movq %r14, %rdi
callq 0x30ce
movq %rax, (%r15)
movq %r15, %rdi
callq 0x3114
movl 0x8(%r15), %ebp
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x10c0
testq %rax, %rax
jne 0x2d1f
leaq 0x20(%r15), %r12
movl $0x330, %edx            # imm = 0x330
movl %ebp, %edi
movq %r12, %rsi
callq 0x10f0
cmpq $0x330, %rax            # imm = 0x330
jne 0x2d3e
movl $0xaaaaaaaa, %eax       # imm = 0xAAAAAAAA
cmpq %rax, (%r12)
jne 0x2d5d
movq 0x28(%r15), %rbp
movq %rbp, 0x10(%r15)
callq 0x30c3
movq %rax, %r12
subq $0x1, %rbp
jb 0x2c8d
movl $0x320, %edi            # imm = 0x320
callq 0x1130
movq %rax, %r13
movl 0x8(%r15), %edi
movl $0x320, %edx            # imm = 0x320
movq %rax, %rsi
callq 0x10f0
cmpq $0x320, %rax            # imm = 0x320
jne 0x2d00
movq %r12, %rdi
movq %r13, %rsi
callq 0x308c
jmp 0x2b94
testl %ebx, %ebx
je 0x2cec
pushq $0x40
popq %rdi
callq 0x1130
movq %rax, %rbx
movq %r14, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
callq 0x1130
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1050
movq %r15, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x1060
testl %eax, %eax
jne 0x2d7c
movq %r15, (%rbx)
movl $0x350, %edi            # imm = 0x350
callq 0x1130
movq %rax, %r15
movq %r14, %rdi
callq 0x30ce
movq %rax, (%r15)
orl $-0x1, 0x8(%r15)
andq $0x0, 0x10(%r15)
callq 0x30c3
movq %rax, 0x18(%r15)
movl $0xaaaaaaaa, %eax       # imm = 0xAAAAAAAA
movq %rax, 0x20(%r15)
leaq 0x28(%r15), %rdi
movl $0x328, %edx            # imm = 0x328
xorl %esi, %esi
callq 0x10e0
movq %r15, 0x10(%rbx)
movl $0x648, %edi            # imm = 0x648
callq 0x1130
movq %rax, %r15
movq %r14, (%rax)
leaq 0x8(%rax), %rdi
movl $0x640, %edx            # imm = 0x640
xorl %esi, %esi
callq 0x10e0
movq %r15, 0x8(%rbx)
jmp 0x2cd2
movq %r12, 0x18(%r15)
movq %r15, 0x10(%rbx)
movl $0x648, %edi            # imm = 0x648
callq 0x1130
movq %rax, %r12
movq %r14, (%rax)
leaq 0x328(%rax), %rdi
movl $0x320, %edx            # imm = 0x320
xorl %esi, %esi
callq 0x10e0
leaq 0x8(%r12), %rdi
addq $0x30, %r15
movl $0x320, %edx            # imm = 0x320
movq %r15, %rsi
callq 0x1110
movq %r12, 0x8(%rbx)
movq %rbx, %rdi
addq $0x18, %rdi
xorl %esi, %esi
callq 0x1190
testl %eax, %eax
je 0x2cee
movq %rbx, %rdi
callq 0x2f47
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1def(%rip), %rdi      # 0x4af6
leaq 0x1c43(%rip), %rsi      # 0x4951
leaq 0x1d63(%rip), %rcx      # 0x4a78
movl $0xfa, %edx
callq 0x10d0
leaq 0x1c77(%rip), %rdi      # 0x499d
leaq 0x1c24(%rip), %rsi      # 0x4951
leaq 0x1d44(%rip), %rcx      # 0x4a78
movl $0xee, %edx
callq 0x10d0
leaq 0x1d6b(%rip), %rdi      # 0x4ab0
leaq 0x1c05(%rip), %rsi      # 0x4951
leaq 0x1d25(%rip), %rcx      # 0x4a78
movl $0xf0, %edx
callq 0x10d0
leaq 0x1d65(%rip), %rdi      # 0x4ac9
leaq 0x1be6(%rip), %rsi      # 0x4951
leaq 0x1d06(%rip), %rcx      # 0x4a78
movl $0xf1, %edx
callq 0x10d0
leaq 0x1c1a(%rip), %rdi      # 0x499d
leaq 0x1bc7(%rip), %rsi      # 0x4951
leaq 0x1dc8(%rip), %rcx      # 0x4b59
movl $0x259, %edx            # imm = 0x259
callq 0x10d0