// File: zimpha[P]MiniSQL/API.cc
// Function: API::dropIndex(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
Response API::dropIndex(const std::string &indexName) {
    if (!cm.hasIndex(indexName)) {
        return Response("Index does not exist");
    }
    std::pair<std::string, int> psi = cm.getIndex(indexName);
    std::string tableName = psi.first;
    int attrIndex = psi.second;
    Table nt = cm.loadTable(tableName + ".table");
    assert(nt.attributes[attrIndex].indices.count(indexName));
    nt.attributes[attrIndex].indices.erase(indexName);
    nt.write();
    cm.dropIndex(indexName);
    if (nt.attributes[attrIndex].indices.size() == 0) {
        bm.deleteFile(tableName + "." + nt.attributes[attrIndex].name + ".index");
    }
    return Response();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x180(%rbp)
movq %rdi, %rax
movq %rax, -0x178(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x170(%rbp)
movq -0x18(%rbp), %rsi
callq 0x1be40
testb $0x1, %al
jne 0x42c7
leaq -0x39(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x3500
movq -0x188(%rbp), %rdx
leaq 0x22e44(%rip), %rsi     # 0x270a6
leaq -0x38(%rbp), %rdi
callq 0x3400
jmp 0x426d
movq -0x180(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x24ba0
jmp 0x427f
leaq -0x38(%rbp), %rdi
callq 0x35b8
leaq -0x39(%rbp), %rdi
callq 0x3320
jmp 0x45c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x42b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x35b8
leaq -0x39(%rbp), %rdi
callq 0x3320
jmp 0x45d2
movq -0x170(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x78(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x1bf10
movq -0x190(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x3130
jmp 0x42f7
movq -0x170(%rbp), %rax
movl -0x58(%rbp), %ecx
movl %ecx, -0x9c(%rbp)
movq %rax, -0x198(%rbp)
leaq 0x22d20(%rip), %rdx     # 0x27035
leaq -0x108(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x76d0
jmp 0x432a
movq -0x198(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rdx
callq 0x1b750
jmp 0x4346
leaq -0x108(%rbp), %rdi
callq 0x35b8
leaq -0xc0(%rbp), %rdi
movslq -0x9c(%rbp), %rsi
callq 0x7810
movq %rax, %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rsi
callq 0x7950
movq %rax, -0x1a0(%rbp)
jmp 0x437e
movq -0x1a0(%rbp), %rax
cmpq $0x0, %rax
je 0x438d
jmp 0x43fc
leaq 0x22d27(%rip), %rdi     # 0x270bb
leaq 0x22d52(%rip), %rsi     # 0x270ed
movl $0x3a, %edx
leaq 0x22d4d(%rip), %rcx     # 0x270f4
callq 0x31f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x45b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x45ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x35b8
jmp 0x45ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x459f
leaq -0xc0(%rbp), %rdi
movslq -0x9c(%rbp), %rsi
callq 0x7810
movq %rax, %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rsi
callq 0x79b0
jmp 0x4421
leaq -0xe8(%rbp), %rdi
callq 0x240c0
jmp 0x442f
movq -0x170(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1bdb0
jmp 0x4441
leaq -0xe8(%rbp), %rdi
addq $0x28, %rdi
movslq -0x9c(%rbp), %rsi
callq 0x7810
movq %rax, %rdi
addq $0x30, %rdi
callq 0x7880
cmpq $0x0, %rax
jne 0x456e
movq -0x170(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x1a8(%rbp)
leaq 0x22e01(%rip), %rdx     # 0x2728a
leaq -0x168(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x76d0
jmp 0x449e
leaq -0xc0(%rbp), %rdi
movslq -0x9c(%rbp), %rsi
callq 0x7810
movq %rax, %rdx
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x78a0
jmp 0x44c9
leaq 0x22c51(%rip), %rdx     # 0x27121
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x79e0
jmp 0x44e5
movq -0x1a8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0xf740
jmp 0x44fa
leaq -0x128(%rbp), %rdi
callq 0x35b8
leaq -0x148(%rbp), %rdi
callq 0x35b8
leaq -0x168(%rbp), %rdi
callq 0x35b8
jmp 0x456e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4560
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4554
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x35b8
leaq -0x148(%rbp), %rdi
callq 0x35b8
leaq -0x168(%rbp), %rdi
callq 0x35b8
jmp 0x459f
movq -0x180(%rbp), %rdi
callq 0x24b60
jmp 0x457c
leaq -0xe8(%rbp), %rdi
callq 0x7920
leaq -0x98(%rbp), %rdi
callq 0x35b8
leaq -0x78(%rbp), %rdi
callq 0x7a30
jmp 0x45c2
leaq -0xe8(%rbp), %rdi
callq 0x7920
leaq -0x98(%rbp), %rdi
callq 0x35b8
leaq -0x78(%rbp), %rdi
callq 0x7a30
jmp 0x45d2
movq -0x178(%rbp), %rax
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x34f0
nopl (%rax,%rax)