// File: /workspace/github_cpp_makefile_star2_O3/zimpha[P]MiniSQL/CatalogManager.cc
// Function: CatalogManager::dropTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void CatalogManager::dropTable(const std::string &tableName) {
    assert(hasTable(tableName));
    std::string name = tableName.substr(0, tableName.find('.'));
    Table nt = loadTable(tableName);
    std::vector<AttrType> &attr = nt.attributes;
    for (size_t i = 0; i < attr.size(); ++ i) {
        bool flag = false;
        for (auto &x : attr[i].indices) {
            flag = true;
            dropIndex(x);
        }
        if (flag) {
            BFM bm;
            std::string indexFileName = name + "." + attr[i].name + ".index";
            bm.deleteFile(indexFileName);
        }
    }

    remove((tableName).c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0xde1c
testb %al, %al
je 0xe42f
movq %rbx, %rdi
movl $0x2e, %esi
xorl %edx, %edx
callq 0x3370
leaq -0xb8(%rbp), %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x32c0
leaq -0x100(%rbp), %rdi
movq %rbx, -0x38(%rbp)
movq %rbx, %rdx
callq 0xdf7e
movq -0xd8(%rbp), %rax
movq -0xd0(%rbp), %rcx
cmpq %rax, %rcx
je 0xe3d8
xorl %r13d, %r13d
leaq (,%r13,2), %r12
addq %r13, %r12
shlq $0x5, %r12
leaq (%rax,%r12), %r15
addq $0x38, %r15
movq 0x10(%r15), %rbx
cmpq %r15, %rbx
je 0xe3b4
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xe4d4
movq %rbx, %rdi
callq 0x3320
movq %rax, %rbx
cmpq %r15, %rax
jne 0xe267
leaq -0x88(%rbp), %r15
movq %r15, -0x98(%rbp)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rbx
movq %rbx, %rdi
callq 0x88b4
movq %rbx, %rdi
leaq 0x6015(%rip), %rsi      # 0x142d0
callq 0x34f0
movq %rbx, %rdi
leaq -0x68(%rbp), %rbx
movq -0xd8(%rbp), %rax
movq (%rax,%r12), %rsi
movq 0x8(%rax,%r12), %rdx
callq 0x30c0
leaq -0x48(%rbp), %r12
movq %r12, -0x58(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe300
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0xe308
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x50(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x58(%rbp), %rdi
leaq 0x5e13(%rip), %rsi      # 0x1413d
callq 0x34f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe34f
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0xe355
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0xe37a
callq 0x3270
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0xe38b
callq 0x3270
leaq -0x29(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x9a9a
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe3a6
callq 0x3270
movq -0xd8(%rbp), %rax
movq -0xd0(%rbp), %rcx
incq %r13
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rdx, %r13
jb 0xe243
leaq -0xd8(%rbp), %rbx
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x34a0
movq %rbx, %rdi
callq 0x844c
movq -0x20(%rbx), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xe408
callq 0x3270
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe41d
callq 0x3270
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5fbb(%rip), %rdi      # 0x143f1
leaq 0x5fc8(%rip), %rsi      # 0x14405
leaq 0x605e(%rip), %rcx      # 0x144a2
movl $0x32, %edx
callq 0x31a0
movq %rax, %rbx
jmp 0xe4b6
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0xe48d
callq 0x3270
jmp 0xe48d
movq %rbx, %rcx
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %rcx, %rdi
jne 0xe4a0
jmp 0xe4aa
jmp 0xe4a7
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
jne 0xe4a0
jmp 0xe4aa
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xe4aa
callq 0x3270
jmp 0xe4aa
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x7a3c
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe4cb
callq 0x3270
movq %rbx, %rdi
callq 0x3480
nop