// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/tools/LoadDB.cc
// Function: Open_DB_Test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Open_DB_Test(string filename) {

    Options opts;
    KVDS *db = KVDS::Open_KVDS(filename.c_str(), opts);

    Iterator* it = db->NewIterator();
    cout << "Iterator the db: First to Last" << endl;
    for(it->SeekToFirst(); it->Valid(); it->Next()) {
        cout << it->Key() << ": " << it->Value() << endl;
    }
    sleep(3);
    cout << "Iterator the db: Last to First" << endl;
    for(it->SeekToLast(); it->Valid(); it->Prev()) {
        cout << it->Key() << ": " << it->Value() << endl;
    }
    delete it;
    delete db;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
leaq 0x98(%rsp), %r14
movq %r14, %rdi
callq 0x16a50
movq (%rbx), %rax
movl $0xa, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x130ca
movq %rax, 0x90(%rsp)
movq %rax, %rdi
callq 0x13088
movq %rax, %r14
movq 0x2954d(%rip), %rbx     # 0x32fd0
leaq 0x1757a(%rip), %rsi     # 0x21004
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x6450
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x6400
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62c0
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
je 0x9bae
leaq 0x70(%rsp), %r12
movq 0x294ec(%rip), %r13     # 0x32fd0
leaq 0x17f26(%rip), %rbp     # 0x21a11
leaq 0x50(%rsp), %rbx
movq (%r14), %rax
movq %r12, %rdi
movq %r14, %rsi
callq *0x38(%rax)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r13, %rdi
callq 0x6450
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x6450
movq (%r14), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x40(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r15, %rdi
callq 0x6450
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x6400
movsbl %al, %esi
movq %r15, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9b7d
callq 0x63f0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9b94
callq 0x63f0
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
jne 0x9af0
movl $0x3, %edi
callq 0x6340
leaq 0x17464(%rip), %rsi     # 0x21023
movl $0x1e, %edx
movq 0x29405(%rip), %rbx     # 0x32fd0
movq %rbx, %rdi
callq 0x6450
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x6400
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62c0
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
je 0x9cea
leaq 0x70(%rsp), %r15
movq 0x293b0(%rip), %r12     # 0x32fd0
leaq 0x17dea(%rip), %r13     # 0x21a11
leaq 0x50(%rsp), %rbx
movq (%r14), %rax
movq %r15, %rdi
movq %r14, %rsi
callq *0x38(%rax)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r12, %rdi
callq 0x6450
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x6450
movq (%r14), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x40(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rbp, %rdi
callq 0x6450
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6400
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9cb9
callq 0x63f0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9cd0
callq 0x63f0
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
jne 0x9c2c
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
movq 0x90(%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9d19
jmp 0x9d19
jmp 0x9d19
movq %rax, %rbx
jmp 0x9d37
jmp 0x9d20
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9d37
callq 0x63f0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9d4e
callq 0x63f0
movq %rbx, %rdi
callq 0x6670