// File: /workspace/github_cpp_makefile_star2_O1/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 0xdd18
testb %al, %al
je 0xe31b
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 0xde70
movq -0xd8(%rbp), %rax
cmpq %rax, -0xd0(%rbp)
je 0xe2c4
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 0xe295
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xe3c0
movq %rbx, %rdi
callq 0x3320
movq %rax, %rbx
cmpq %r15, %rax
jne 0xe156
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 0x8766
movq %rbx, %rdi
leaq 0x6126(%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 0xe1ef
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0xe1f7
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 0x5f24(%rip), %rsi      # 0x1413d
callq 0x34f0
movq %rbx, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xe23e
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0xe244
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 0xe269
callq 0x3270
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0xe27a
callq 0x3270
leaq -0x29(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x9946
movq -0x78(%rbp), %rdi
cmpq %rbx, %rdi
je 0xe295
callq 0x3270
incq %r13
movq -0xd8(%rbp), %rax
movq -0xd0(%rbp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rcx, %r13
jb 0xe132
leaq -0xd8(%rbp), %rbx
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x34a0
movq %rbx, %rdi
callq 0x8304
movq -0x20(%rbx), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xe2f4
callq 0x3270
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe309
callq 0x3270
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x60cf(%rip), %rdi      # 0x143f1
leaq 0x60dc(%rip), %rsi      # 0x14405
leaq 0x6172(%rip), %rcx      # 0x144a2
movl $0x32, %edx
callq 0x31a0
movq %rax, %rbx
jmp 0xe3a2
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0xe379
callq 0x3270
jmp 0xe379
movq %rbx, %rcx
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %rcx, %rdi
jne 0xe38c
jmp 0xe396
jmp 0xe393
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
jne 0xe38c
jmp 0xe396
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xe396
callq 0x3270
jmp 0xe396
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x78f8
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe3b7
callq 0x3270
movq %rbx, %rdi
callq 0x3480
nop