// File: /workspace/github_cpp_makefile_star2_O1/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 0x16960
movq (%rbx), %rax
movl $0xa, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
callq 0x12fb8
movq %rax, 0x90(%rsp)
movq %rax, %rdi
callq 0x12f76
movq %rax, %r14
movq 0x296cd(%rip), %rbx     # 0x32fd0
leaq 0x176fa(%rip), %rsi     # 0x21004
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x6460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x6410
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62d0
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
je 0x9a2e
leaq 0x70(%rsp), %r12
movq 0x2966c(%rip), %r13     # 0x32fd0
leaq 0x180a6(%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 0x6460
movq %rax, %r15
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x6460
movq (%r14), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x40(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r15, %rdi
callq 0x6460
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x6410
movsbl %al, %esi
movq %r15, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62d0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x99fd
callq 0x6400
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9a14
callq 0x6400
movq (%r14), %rax
movq %r14, %rdi
callq *0x28(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
jne 0x9970
movl $0x3, %edi
callq 0x6350
leaq 0x175e4(%rip), %rsi     # 0x21023
movl $0x1e, %edx
movq 0x29585(%rip), %rbx     # 0x32fd0
movq %rbx, %rdi
callq 0x6460
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x6410
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62d0
movq (%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
je 0x9b6a
leaq 0x70(%rsp), %r15
movq 0x29530(%rip), %r12     # 0x32fd0
leaq 0x17f6a(%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 0x6460
movq %rax, %rbp
movl $0x2, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x6460
movq (%r14), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x40(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %rbp, %rdi
callq 0x6460
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x6410
movsbl %al, %esi
movq %rbp, %rdi
callq 0x6050
movq %rax, %rdi
callq 0x62d0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9b39
callq 0x6400
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9b50
callq 0x6400
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x48(%rax)
testb %al, %al
jne 0x9aac
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 0x9b99
jmp 0x9b99
jmp 0x9b99
movq %rax, %rbx
jmp 0x9bb7
jmp 0x9ba0
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x9bb7
callq 0x6400
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x9bce
callq 0x6400
movq %rbx, %rdi
callq 0x6680