// File: Rjerk[P]ratabase/RatabaseManager.cpp
// Function: ratabase::RatabaseManager::deleteDB(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool RatabaseManager::deleteDB(const string& dbname)
{
    resetMsg();
    size_t id;
    if (searchDB(dbname, id)) {
        if (current_db == dbtable[id])
            current_db = dbtable[0];
        delete dbtable[id];
        dbtable[id] = nullptr;
        --dbcount;
        msg << "delete " << dbname << " [" << std::to_string(id) << "] ok." << endl;
        LOG_INFO << msg.str();
        return true;
    } else {
        msg << "\"" << dbname << "\" doesn't exist." << endl;
        LOG_INFO << msg.str();
        return false;
    }
}

// Assembly:
subq $0x408, %rsp            # imm = 0x408
movq %rdi, 0x3f8(%rsp)
movq %rsi, 0x3f0(%rsp)
movq 0x3f8(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0xda10
movq 0x60(%rsp), %rdi
movq 0x3f0(%rsp), %rsi
leaq 0x3e8(%rsp), %rdx
callq 0xd910
testb $0x1, %al
jne 0xcebc
jmp 0xd0f3
movq 0x60(%rsp), %rcx
movq 0x8(%rcx), %rax
movq (%rcx), %rcx
movq 0x3e8(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
jne 0xcee5
movq 0x60(%rsp), %rax
movq (%rax), %rcx
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq 0x3e8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0xcf18
movq 0x58(%rsp), %rdi
callq 0xde50
movq 0x58(%rsp), %rdi
callq 0x3370
movq 0x60(%rsp), %rdi
movq (%rdi), %rax
movq 0x3e8(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movq 0x10(%rdi), %rax
decq %rax
movq %rax, 0x10(%rdi)
addq $0x18, %rdi
leaq 0x757b(%rip), %rsi      # 0x144c1
callq 0x3390
movq %rax, %rdi
movq 0x3f0(%rsp), %rsi
callq 0x3350
movq %rax, %rdi
leaq 0x7531(%rip), %rsi      # 0x14496
callq 0x3390
movq %rax, 0x40(%rsp)
movq 0x3e8(%rsp), %rsi
leaq 0x3c8(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xdaa0
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x3350
movq %rax, 0x50(%rsp)
jmp 0xcf9f
movq 0x50(%rsp), %rdi
leaq 0x74ee(%rip), %rsi      # 0x14499
callq 0x3390
movq %rax, 0x38(%rsp)
jmp 0xcfb7
movq 0x38(%rsp), %rdi
movq 0xdffd(%rip), %rsi      # 0x1afc0
callq 0x33c0
jmp 0xcfca
leaq 0x3c8(%rsp), %rdi
callq 0x3280
callq 0x12170
cmpl $0x2, %eax
jg 0xd0e6
leaq 0x7461(%rip), %rsi      # 0x1444d
leaq 0x74d6(%rip), %rcx      # 0x144c9
leaq 0x230(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movl $0x65, %edx
movl $0x2, %r8d
callq 0x11e00
movq 0x28(%rsp), %rdi
callq 0x121a0
movq %rax, 0x30(%rsp)
jmp 0xd021
movq 0x60(%rsp), %rsi
movq 0x30(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x20(%rsp)
addq $0x18, %rsi
leaq 0x210(%rsp), %rdi
callq 0x33b0
jmp 0xd047
movq 0x20(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0x3350
jmp 0xd05b
leaq 0x210(%rsp), %rdi
callq 0x3280
leaq 0x230(%rsp), %rdi
callq 0x12060
jmp 0xd0e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x3c8(%rsp), %rdi
callq 0x3280
jmp 0xd229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0xd0d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x210(%rsp), %rdi
callq 0x3280
leaq 0x230(%rsp), %rdi
callq 0x12060
jmp 0xd229
movb $0x1, 0x407(%rsp)
jmp 0xd218
movq 0x60(%rsp), %rdi
addq $0x18, %rdi
leaq 0x7267(%rip), %rsi      # 0x1436a
callq 0x3390
movq %rax, %rdi
movq 0x3f0(%rsp), %rsi
callq 0x3350
movq %rax, %rdi
leaq 0x738e(%rip), %rsi      # 0x144b0
callq 0x3390
movq %rax, %rdi
movq 0xde8f(%rip), %rsi      # 0x1afc0
callq 0x33c0
callq 0x12170
cmpl $0x2, %eax
jg 0xd210
leaq 0x7302(%rip), %rsi      # 0x1444d
leaq 0x7377(%rip), %rcx      # 0x144c9
leaq 0x88(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movl $0x69, %edx
movl $0x2, %r8d
callq 0x11e00
movq 0x10(%rsp), %rdi
callq 0x121a0
movq %rax, 0x18(%rsp)
jmp 0xd180
movq 0x60(%rsp), %rsi
movq 0x18(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x8(%rsp)
addq $0x18, %rsi
leaq 0x68(%rsp), %rdi
callq 0x33b0
jmp 0xd1a3
movq 0x8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x3350
jmp 0xd1b4
leaq 0x68(%rsp), %rdi
callq 0x3280
leaq 0x88(%rsp), %rdi
callq 0x12060
jmp 0xd210
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
jmp 0xd201
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3c0(%rsp)
movl %eax, 0x3bc(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x3280
leaq 0x88(%rsp), %rdi
callq 0x12060
jmp 0xd229
movb $0x0, 0x407(%rsp)
movb 0x407(%rsp), %al
andb $0x1, %al
addq $0x408, %rsp            # imm = 0x408
retq
movq 0x3c0(%rsp), %rdi
callq 0x3590
nopw %cs:(%rax,%rax)