// File: Rjerk[P]ratabase/RatabaseManager.cpp
// Function: ratabase::RatabaseManager::selectDB(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool RatabaseManager::selectDB(const string& dbname)
{
    resetMsg();
    size_t id;
    if (searchDB(dbname, id)) {
        current_db = dbtable[id];
        msg << "select " << 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 $0x3f8, %rsp            # imm = 0x3F8
movq %rdi, 0x3e8(%rsp)
movq %rsi, 0x3e0(%rsp)
movq 0x3e8(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xda10
movq 0x50(%rsp), %rdi
movq 0x3e0(%rsp), %rsi
leaq 0x3d8(%rsp), %rdx
callq 0xd910
testb $0x1, %al
jne 0xcb5c
jmp 0xcd2c
movq 0x50(%rsp), %rdi
movq (%rdi), %rax
movq 0x3d8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rdi)
addq $0x18, %rdi
leaq 0x7920(%rip), %rsi      # 0x1449f
callq 0x3390
movq %rax, %rdi
movq 0x3e0(%rsp), %rsi
callq 0x3350
movq %rax, %rdi
leaq 0x78f8(%rip), %rsi      # 0x14496
callq 0x3390
movq %rax, 0x38(%rsp)
movq 0x3d8(%rsp), %rsi
leaq 0x3b8(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xdaa0
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x3350
movq %rax, 0x48(%rsp)
jmp 0xcbd8
movq 0x48(%rsp), %rdi
leaq 0x78b5(%rip), %rsi      # 0x14499
callq 0x3390
movq %rax, 0x30(%rsp)
jmp 0xcbf0
movq 0x30(%rsp), %rdi
movq 0xe3c4(%rip), %rsi      # 0x1afc0
callq 0x33c0
jmp 0xcc03
leaq 0x3b8(%rsp), %rdi
callq 0x3280
callq 0x12170
cmpl $0x2, %eax
jg 0xcd1f
leaq 0x7828(%rip), %rsi      # 0x1444d
leaq 0x787b(%rip), %rcx      # 0x144a7
leaq 0x220(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movl $0x51, %edx
movl $0x2, %r8d
callq 0x11e00
movq 0x20(%rsp), %rdi
callq 0x121a0
movq %rax, 0x28(%rsp)
jmp 0xcc5a
movq 0x50(%rsp), %rsi
movq 0x28(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
addq $0x18, %rsi
leaq 0x200(%rsp), %rdi
callq 0x33b0
jmp 0xcc80
movq 0x18(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x3350
jmp 0xcc94
leaq 0x200(%rsp), %rdi
callq 0x3280
leaq 0x220(%rsp), %rdi
callq 0x12060
jmp 0xcd1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x3b8(%rsp), %rdi
callq 0x3280
jmp 0xce57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0xcd0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x3280
leaq 0x220(%rsp), %rdi
callq 0x12060
jmp 0xce57
movb $0x1, 0x3f7(%rsp)
jmp 0xce46
movq 0x50(%rsp), %rdi
addq $0x18, %rdi
leaq 0x762e(%rip), %rsi      # 0x1436a
callq 0x3390
movq %rax, %rdi
movq 0x3e0(%rsp), %rsi
callq 0x3350
movq %rax, %rdi
leaq 0x7755(%rip), %rsi      # 0x144b0
callq 0x3390
movq %rax, %rdi
movq 0xe256(%rip), %rsi      # 0x1afc0
callq 0x33c0
callq 0x12170
cmpl $0x2, %eax
jg 0xce3e
leaq 0x76c9(%rip), %rsi      # 0x1444d
leaq 0x771c(%rip), %rcx      # 0x144a7
leaq 0x78(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movl $0x55, %edx
movl $0x2, %r8d
callq 0x11e00
movq 0x8(%rsp), %rdi
callq 0x121a0
movq %rax, 0x10(%rsp)
jmp 0xcdb6
movq 0x50(%rsp), %rsi
movq 0x10(%rsp), %rax
addq $0x10, %rax
movq %rax, (%rsp)
addq $0x18, %rsi
leaq 0x58(%rsp), %rdi
callq 0x33b0
jmp 0xcdd8
movq (%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3350
jmp 0xcde8
leaq 0x58(%rsp), %rdi
callq 0x3280
leaq 0x78(%rsp), %rdi
callq 0x12060
jmp 0xce3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0xce32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x3280
leaq 0x78(%rsp), %rdi
callq 0x12060
jmp 0xce57
movb $0x0, 0x3f7(%rsp)
movb 0x3f7(%rsp), %al
andb $0x1, %al
addq $0x3f8, %rsp            # imm = 0x3F8
retq
movq 0x3b0(%rsp), %rdi
callq 0x3590
nopw %cs:(%rax,%rax)