LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb.cc
// Function: hlkvds::DB::Delete(char const*, unsigned int)
Status DB::Delete(const char* key, uint32_t key_len) {
    Status s = kvds_->Delete(key, key_len);
    if (!s.ok()) {
        std::cout << "DB Delete failed" << std::endl;
    }
    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
callq 0x1141c
cmpl $0x0, (%rbx)
je 0x10625
movq 0x219bf(%rip), %rdi     # 0x31fd0
leaq 0xf79b(%rip), %rsi      # 0x1fdb3
callq 0x6400
movq %rax, %rdi
callq 0x61c0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb.cc
// Function: hlkvds::DB::Get(char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
Status DB::Get(const char* key, uint32_t key_len, string &data) {
    Status s = kvds_->Get(key, key_len, data);
    if (!s.ok()) {
        std::cout << "DB Get failed" << std::endl;
    }
    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
callq 0x1143c
cmpl $0x0, (%rbx)
je 0x10657
movq 0x2198d(%rip), %rdi     # 0x31fd0
leaq 0xf77a(%rip), %rsi      # 0x1fdc4
callq 0x6400
movq %rax, %rdi
callq 0x61c0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/KvdbIter.cc
// Function: hlkvds::KvdbIter::SeekToFirst()
void KvdbIter::SeekToFirst() {
    LinkedList<HashEntry> *entry_list;
    hashEntry_ = NULL;
    htSize_ = idxMgr_->GetHashTableSize();
    for (int i = 0; i < htSize_; i++) {
        entry_list = idxMgr_->GetEntryListByNo(i);
        int entry_list_size = entry_list->get_size();
        if (entry_list_size > 0) {
            hashTableCur_ = i;
            entryListCur_ = 0;
            hashEntry_ = entry_list->getByNo(entryListCur_);
            break;
        }
    }

    if (NULL != hashEntry_) {
        valid_ = true;
    } else {
        valid_ = false;
    }

    //status_ = Stats::OK()
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x20(%rdi)
movq 0x8(%rdi), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x38(%rdi)
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x10732
movq (%rax), %rdi
movq (%rdi,%rdx), %rdi
cmpl $0x0, 0x8(%rdi)
jg 0x10719
incq %rsi
addq $0x30, %rdx
jmp 0x106fe
movl %esi, 0x3c(%rbx)
andl $0x0, 0x40(%rbx)
xorl %esi, %esi
callq 0x10a76
movq %rax, 0x20(%rbx)
movb $0x1, %cl
testq %rax, %rax
jne 0x10734
xorl %ecx, %ecx
movb %cl, 0x18(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/KvdbIter.cc
// Function: hlkvds::KvdbIter::SeekToLast()
void KvdbIter::SeekToLast() {
    LinkedList<HashEntry> *entry_list;
    hashEntry_ = NULL;
    htSize_ = idxMgr_->GetHashTableSize();
    for (int i = htSize_ - 1; i >= 0; i--) {
        entry_list = idxMgr_->GetEntryListByNo(i);
        int entry_list_size = entry_list->get_size();
        //__INFO("entry_list_size=%d",entry_list_size);
        if (entry_list_size > 0) {
            hashTableCur_ = i;
            entryListCur_ = entry_list_size - 1;
            hashEntry_ = entry_list->getByNo(entryListCur_);
            break;
        }
    }

    if (NULL != hashEntry_) {
        valid_ = true;
    } else {
        valid_ = false;
    }
    //__INFO("hastTableCur_ = %d, entryListCur_ = %d", hashTableCur_, entryListCur_);

}

// Assembly:
pushq %rbx
movq %rdi, %rbx
andq $0x0, 0x20(%rdi)
movq 0x8(%rdi), %rcx
movl 0x8(%rcx), %eax
movl %eax, 0x38(%rdi)
imulq $0x30, %rax, %rdx
addq $-0x30, %rdx
testl %eax, %eax
jle 0x10785
movq (%rcx), %rsi
movq (%rsi,%rdx), %rdi
movl 0x8(%rdi), %esi
decl %eax
addq $-0x30, %rdx
testl %esi, %esi
jle 0x10755
movl %eax, 0x3c(%rbx)
decl %esi
movl %esi, 0x40(%rbx)
callq 0x10a76
movq %rax, 0x20(%rbx)
movb $0x1, %cl
testq %rax, %rax
jne 0x10787
xorl %ecx, %ecx
movb %cl, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/KvdbIter.cc
// Function: hlkvds::KvdbIter::Seek(char const*)
void KvdbIter::Seek(const char* key) {
    //need hashEntry;
    int key_len = strlen(key);
    KVSlice slice(key, key_len, NULL, 0);
    DataHeader data_header;
    data_header.SetDigest(slice.GetDigest());
    DataHeaderAddress addrs;
    HashEntry entry(data_header, addrs, NULL);
    
    LinkedList<HashEntry> *entry_list;
    hashEntry_ = NULL;
    for (int i = 0; i < htSize_; i++) {
        entry_list = idxMgr_->GetEntryListByNo(i);
        hashEntry_ = entry_list->getRef(entry);
        if (NULL != hashEntry_) {
            hashTableCur_ = i;
            entryListCur_ = entry_list->searchNo(entry);
            break;
        }
    }

    if (NULL != hashEntry_) {
        valid_ = true;
    } else {
        valid_ = false;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x6180
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movl %eax, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x18476
leaq 0x30(%rsp), %rdi
callq 0xe33c
movq 0x88(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0xe392
leaq 0xe(%rsp), %rdx
andw $0x0, (%rdx)
andq $0x0, 0x2(%rdx)
leaq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
xorl %ecx, %ecx
callq 0xe56a
andq $0x0, 0x20(%rbx)
xorl %r13d, %r13d
leaq 0x50(%rsp), %r14
leaq 0x18(%rsp), %r15
xorl %ebp, %ebp
movslq 0x38(%rbx), %rax
cmpq %rax, %rbp
jge 0x10873
movq 0x8(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r13), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0xe5d4
movq %r12, %rdi
movq %r14, %rsi
callq 0xf7b6
movq %rax, 0x20(%rbx)
movq %r14, %rdi
callq 0xe636
cmpq $0x0, 0x20(%rbx)
jne 0x10857
incq %rbp
addq $0x30, %r13
jmp 0x10811
movl %ebp, 0x3c(%rbx)
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
callq 0x10a90
movl %eax, 0x40(%rbx)
movb $0x1, %al
cmpq $0x0, 0x20(%rbx)
jne 0x10875
xorl %eax, %eax
movb %al, 0x18(%rbx)
leaq 0x18(%rsp), %rdi
callq 0xe636
leaq 0xe(%rsp), %rdi
callq 0xe398
leaq 0x30(%rsp), %rdi
callq 0xe38c
leaq 0x68(%rsp), %rdi
callq 0x1835a
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x108d2
movq %rax, %rbx
jmp 0x108df
movq %rax, %rbx
jmp 0x108e9
movq %rax, %rbx
jmp 0x108f3
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xe636
jmp 0x108d5
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xe636
leaq 0xe(%rsp), %rdi
callq 0xe398
leaq 0x30(%rsp), %rdi
callq 0xe38c
leaq 0x68(%rsp), %rdi
callq 0x1835a
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/KvdbIter.cc
// Function: hlkvds::KvdbIter::Next()
void KvdbIter::Next() {
    LinkedList<HashEntry> *entry_list;
    entry_list = idxMgr_->GetEntryListByNo(hashTableCur_);
    hashEntry_ = NULL;
    int entry_list_size = entry_list->get_size();
    if ( entryListCur_ < entry_list_size - 1) {
        entryListCur_++;
        hashEntry_ = entry_list->getByNo(entryListCur_);
    } else {
        hashTableCur_++;
        while (hashTableCur_ < htSize_) {
            entry_list = idxMgr_->GetEntryListByNo(hashTableCur_);
            entry_list_size = entry_list->get_size();
            if (entry_list_size  > 0) {
                entryListCur_ = 0;
                hashEntry_ = entry_list->getByNo(entryListCur_);
                break;
            }
            hashTableCur_++;
        }
    }

    if (NULL != hashEntry_) {
        valid_ = true;
    } else {
        valid_ = false;
    }
    //__INFO("hastTableCur_ = %d, entryListCur_ = %d", hashTableCur_, entryListCur_);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movl 0x3c(%rdi), %eax
movq (%rcx), %rcx
imulq $0x30, %rax, %rdx
movq (%rcx,%rdx), %rdi
andq $0x0, 0x20(%rbx)
movl 0x8(%rdi), %edx
movl 0x40(%rbx), %esi
decl %edx
cmpl %edx, %esi
jge 0x10934
incl %esi
movl %esi, 0x40(%rbx)
jmp 0x1095e
movl 0x38(%rbx), %edx
leal 0x1(%rax), %esi
cmpl %esi, %edx
cmovgl %edx, %esi
incl %eax
cmpl %edx, %eax
jge 0x10970
movl %eax, %edi
imulq $0x30, %rdi, %rdi
movq (%rcx,%rdi), %rdi
cmpl $0x0, 0x8(%rdi)
jle 0x1093f
movl %eax, 0x3c(%rbx)
andl $0x0, 0x40(%rbx)
xorl %esi, %esi
callq 0x10a76
movq %rax, 0x20(%rbx)
movb $0x1, %cl
testq %rax, %rax
jne 0x10975
jmp 0x10973
movl %esi, 0x3c(%rbx)
xorl %ecx, %ecx
movb %cl, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/KvdbIter.cc
// Function: hlkvds::KvdbIter::Prev()
void KvdbIter::Prev() {
    LinkedList<HashEntry> *entry_list;
    entry_list = idxMgr_->GetEntryListByNo(hashTableCur_);
    hashEntry_ = NULL;
    int entry_list_size = entry_list->get_size();
    if (entryListCur_ > 0) {
        entryListCur_--;
        hashEntry_ = entry_list->getByNo(entryListCur_);
    } else {
        hashTableCur_--;
        while (hashTableCur_ >= 0) {
            entry_list = idxMgr_->GetEntryListByNo(hashTableCur_);
            entry_list_size = entry_list->get_size();
            if ( entry_list_size > 0) {
                entryListCur_ = entry_list_size - 1;
                hashEntry_ = entry_list->getByNo(entryListCur_);
                break;
            }
            hashTableCur_--;
        }
    }

    if (NULL != hashEntry_) {
        valid_ = true;
    } else {
        valid_ = false;
    }
    //__INFO("hastTableCur_ = %d, entryListCur_ = %d", hashTableCur_, entryListCur_);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movl 0x3c(%rdi), %eax
movq (%rcx), %rcx
imulq $0x30, %rax, %rdx
movq (%rcx,%rdx), %rdi
andq $0x0, 0x20(%rbx)
movl 0x40(%rbx), %esi
testl %esi, %esi
jg 0x109ba
addq %rdx, %rcx
addq $-0x30, %rcx
testl %eax, %eax
jle 0x109d1
movq (%rcx), %rdi
movl 0x8(%rdi), %esi
decl %eax
addq $-0x30, %rcx
testl %esi, %esi
jle 0x109a3
movl %eax, 0x3c(%rbx)
decl %esi
movl %esi, 0x40(%rbx)
callq 0x10a76
movq %rax, 0x20(%rbx)
movb $0x1, %cl
testq %rax, %rax
jne 0x109d8
jmp 0x109d6
decl %eax
movl %eax, 0x3c(%rbx)
xorl %ecx, %ecx
movb %cl, 0x18(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/./src/include/LinkedList.h
// Function: hlkvds::LinkedList<hlkvds::HashEntry>::getByNo(int)
T* LinkedList<T>::getByNo(int no) {
    if (no > size_) {
        return NULL;
    }
    Node<T>* node = head_;
    while(no) {
        node = node->next;
        no--;
    }
    return &node->data;
}

// Assembly:
cmpl %esi, 0x8(%rdi)
jge 0x10a7e
xorl %eax, %eax
retq
movq %rdi, %rax
movq (%rax), %rax
subl $0x1, %esi
jb 0x10a7d
addq $0x18, %rax
jmp 0x10a81
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/./src/include/LinkedList.h
// Function: hlkvds::LinkedList<hlkvds::HashEntry>::searchNo(hlkvds::HashEntry&)
int LinkedList<T>::searchNo(T& toBeSearched) {
    int no = 0;
    Node<T>* curNode = head_;

    while (curNode != NULL) {
        if (curNode->data == toBeSearched) {
            return no;
        }
        curNode = curNode->next;
        no++;
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
pushq $-0x1
popq %rbx
movq (%r15), %r15
testq %r15, %r15
je 0x10ac3
movq %r15, %rdi
movq %r14, %rsi
callq 0xe682
testb %al, %al
jne 0x10ac1
addq $0x18, %r15
incl %ebp
jmp 0x10aa2
movl %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::Create_KVDS(char const*, hlkvds::Options)
KVDS* KVDS::Create_KVDS(const char* filename, Options opts) {
    if (filename == NULL) {
        return NULL;
    }

    KVDS* kvds = new KVDS(filename, opts);

    if (!kvds->openAllDevices(kvds->paths_)) {
        delete kvds;
        return NULL;
    }

    int datastor_type = opts.datastor_type;
    kvds->dataStor_ = DataStor::Create(kvds->options_, kvds->bdVec_, kvds->sbMgr_, kvds->idxMgr_, datastor_type);

    if (kvds->dataStor_ == NULL) {
        delete kvds;
        return NULL;
    }

    kvds->idxMgr_->InitDataStor(kvds->dataStor_);
    kvds->metaStor_->InitDataStor(kvds->dataStor_);

    if (!kvds->metaStor_->CreateMetaData()) {
        delete kvds;
        return NULL;
    }

    __INFO("\nCreate KVDS Success!!!");
    kvds->printDbStates();

    kvds->dataStor_->InitSegmentBuffer();
    kvds->startThds();

    kvds->isOpen_ = true;

    return kvds;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
testq %rdi, %rdi
je 0x10b96
movq %rdi, %r15
leaq 0xa0(%rsp), %r14
movl $0xc0, %edi
callq 0x6410
movq %rax, %rbx
pushq $0xa
popq %rcx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
movq %r15, %rsi
callq 0x111b8
leaq 0x8(%rbx), %rsi
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x6530
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10c44
movl %eax, %ebp
leaq 0x58(%rsp), %rdi
callq 0x6788
testb %bpl, %bpl
je 0x10b8d
movl 0x3c(%r14), %r8d
leaq 0x50(%rbx), %rdi
movq %rbx, %rsi
addq $0xa0, %rsi
movq 0x28(%rbx), %rdx
movq 0x30(%rbx), %rcx
callq 0xd4a0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x10b8d
movq 0x30(%rbx), %rdi
movq %rax, %rsi
callq 0xe782
movq 0x40(%rbx), %rdi
movq 0x48(%rbx), %rsi
callq 0x1311a
movq 0x40(%rbx), %rdi
callq 0x132e8
testb %al, %al
jne 0x10ba6
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2142b(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xe5f4(%rip), %rsi      # 0x1f1b0
leaq 0xf255(%rip), %rcx      # 0x1fe18
leaq 0xf25a(%rip), %r8       # 0x1fe24
pushq $0x30
popq %r9
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xf250(%rip), %rdi      # 0x1fe35
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq %rbx, %rdi
callq 0x10d64
movq 0x48(%rbx), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rbx, %rdi
callq 0x10d90
movb $0x1, 0xb8(%rbx)
jmp 0x10b98
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x6788
jmp 0x10c3b
movq %rax, %r14
movq %rbx, %rdi
callq 0x63f0
movq %r14, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::openAllDevices(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool KVDS::openAllDevices(string paths) {

    vector<string> fields;
    boost::split(fields, paths, boost::is_any_of(FileDelim));
    vector<string>::iterator iter;
    for(iter = fields.begin(); iter != fields.end(); iter++){
        BlockDevice *bdev = new KernelDevice();

        if (bdev->Open(*iter) < 0) {
            return false;
        }__DEBUG("Open Device %s Success!", (*iter).c_str());

        bdVec_.push_back(bdev);
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x217e4(%rip), %rsi     # 0x32450
leaq 0x20(%rsp), %rdi
callq 0x117c2
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x1173e
leaq 0x20(%rsp), %rdi
callq 0x117ec
movq (%rsp), %r14
addq $0xa0, %rbx
leaq 0x38(%rsp), %r12
pushq $0x1
popq %rbp
movq 0x8(%rsp), %r13
cmpq %r13, %r14
je 0x10d04
pushq $0x48
popq %rdi
callq 0x6410
movq %rax, %r15
movq %rax, %rdi
callq 0xfbd4
movq %r15, 0x18(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x6530
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq *0x18(%rax)
movl %eax, %r15d
movq %r12, %rdi
callq 0x6788
testl %r15d, %r15d
js 0x10d04
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
callq 0x11800
addq $0x20, %r14
jmp 0x10ca6
cmpq %r13, %r14
sete %bl
movq %rsp, %rdi
callq 0x1181e
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x117ec
jmp 0x10d53
jmp 0x10d50
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x6788
jmp 0x10d53
movq %rax, %rbx
movq %r15, %rdi
callq 0x63f0
jmp 0x10d53
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1181e
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::printDbStates()
void KVDS::printDbStates() {
    sbMgr_->printSBInfo();
    dataStor_->printDeviceTopologyInfo();

    idxMgr_->printDynamicInfo();
    dataStor_->printDynamicInfo();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x1ab18
movq 0x48(%rbx), %rdi
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x30(%rbx), %rdi
callq 0xe788
movq 0x48(%rbx), %rdi
movq (%rdi), %rax
popq %rbx
jmpq *0x38(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::Open_KVDS(char const*, hlkvds::Options)
KVDS* KVDS::Open_KVDS(const char* filename, Options opts) {
    KVDS *kvds = new KVDS(filename, opts);

    Status s = kvds->openDB();
    if (!s.ok()) {
        delete kvds;
        return NULL;
    }

    kvds->isOpen_ = true;
    return kvds;

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r14
movl $0xc0, %edi
callq 0x6410
movq %rax, %rbx
pushq $0xa
popq %rcx
leaq 0x80(%rsp), %rsi
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %rax, %rdi
movq %r14, %rsi
callq 0x111b8
leaq 0x58(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x10e64
cmpl $0x0, (%r14)
je 0x10e3e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %ebx, %ebx
jmp 0x10e45
movb $0x1, 0xb8(%rbx)
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x63f0
movq %r14, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::openDB()
Status KVDS::openDB() {
    if (!openAllDevices(paths_)) {
        return Status::IOError("Could not open all device");
    }

    int datastor_type = -1;
    if ( !metaStor_->TryLoadSB(datastor_type)) {
        return  Status::IOError("Could not load SB");
    }
    dataStor_ = DataStor::Create(options_, bdVec_, sbMgr_, idxMgr_, datastor_type);

    if (dataStor_ == NULL) {
        return Status::NotSupported("Could not support this data store");
    }

    idxMgr_->InitDataStor(dataStor_);
    metaStor_->InitDataStor(dataStor_);

    if (!metaStor_->LoadMetaData()) {
        return Status::IOError("Could not read meta data");
    }

    __INFO("\nOpen KVDS Success!!!");
    printDbStates();

    dataStor_->InitSegmentBuffer();
    startThds();
    return Status::OK();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x6530
movq %r14, %rdi
movq %r15, %rsi
callq 0x10c44
movl %eax, %ebp
leaq 0x10(%rsp), %rdi
callq 0x6788
testb %bpl, %bpl
je 0x10f0d
leaq 0xc(%rsp), %rsi
orl $-0x1, (%rsi)
movq 0x40(%r14), %rdi
callq 0x13130
testb %al, %al
je 0x10f16
leaq 0x50(%r14), %rdi
leaq 0xa0(%r14), %rsi
movq 0x28(%r14), %rdx
movq 0x30(%r14), %rcx
movl 0xc(%rsp), %r8d
callq 0xd4a0
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0x10f35
movq 0x30(%r14), %rdi
movq %rax, %rsi
callq 0xe782
movq 0x40(%r14), %rdi
movq 0x48(%r14), %rsi
callq 0x1311a
movq 0x40(%r14), %rdi
callq 0x1396c
testb %al, %al
jne 0x10f46
leaq 0xef90(%rip), %rsi      # 0x1fe9b
jmp 0x10f1d
leaq 0xef39(%rip), %rsi      # 0x1fe4d
jmp 0x10f1d
leaq 0xef4a(%rip), %rsi      # 0x1fe67
movq %rbx, %rdi
callq 0xb31e
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xef3d(%rip), %rsi      # 0x1fe79
movq %rbx, %rdi
callq 0xb2f6
jmp 0x10f25
movq 0x2108b(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0xe253(%rip), %rsi      # 0x1f1b0
leaq 0xef50(%rip), %rcx      # 0x1feb4
leaq 0xeeb9(%rip), %r8       # 0x1fe24
pushq $0x6c
popq %r9
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r12), %rcx
leaq 0xef34(%rip), %rdi      # 0x1febb
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x10d64
movq 0x48(%r14), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq %r14, %rdi
callq 0x10d90
andl $0x0, (%rbx)
andq $0x0, 0x8(%rbx)
jmp 0x10f25
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6788
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::closeDB()
Status KVDS::closeDB() {
    if (!metaStor_->PersistMetaData()) {
        __ERROR("Could not to write metadata to device\n");
        return Status::IOError("Could not to write metadata to device");
    }
    stopThds();
    return Status::OK();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x40(%rsi), %rdi
callq 0x13d92
testb %al, %al
je 0x1100b
movq %r14, %rdi
callq 0x11072
andl $0x0, (%rbx)
andq $0x0, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x20fc6(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xe284(%rip), %rsi      # 0x1f2a5
leaq 0xeea9(%rip), %rcx      # 0x1fed1
leaq 0xedf5(%rip), %r8       # 0x1fe24
pushq $0x76
popq %r9
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xee8f(%rip), %rdi      # 0x1fed9
pushq $0x26
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
leaq 0xee99(%rip), %rsi      # 0x1ff00
movq %rbx, %rdi
callq 0xb31e
jmp 0x11002
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::~KVDS()
KVDS::~KVDS() {
    if (isOpen_) {
        closeDB();
    }
    delete idxMgr_;
    delete sbMgr_;
    if(!options_.disable_cache){
        delete rdCache_;
    }
    delete metaStor_;
    if (dataStor_) {
        delete dataStor_;
    }
    closeAllDevices();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x20545(%rip), %rax     # 0x315e0
addq $0x10, %rax
movq %rax, (%rdi)
cmpb $0x1, 0xb8(%rdi)
jne 0x110b8
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x10fda
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x110c9
movq %r14, %rdi
callq 0xf41a
movq %r14, %rdi
callq 0x63f0
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x110e2
movq %r14, %rdi
callq 0x1acda
movq %r14, %rdi
callq 0x63f0
cmpb $0x0, 0x50(%rbx)
jne 0x11109
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x11101
movq %r14, %rdi
callq 0x14ca2
movq %r14, %rdi
callq 0x63f0
movq 0x40(%rbx), %r14
testq %r14, %r14
je 0x1111a
movq %r14, %rdi
callq 0x13118
movq %r14, %rdi
callq 0x63f0
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x11131
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x11162
leaq 0xa0(%rbx), %rdi
callq 0x1188e
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x6788
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0xaf43
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::closeAllDevices()
void KVDS::closeAllDevices() {
    vector<BlockDevice *>::iterator iter;
    for ( iter = bdVec_.begin() ; iter != bdVec_.end(); ) {
        BlockDevice *bdev = *iter;
        delete bdev;
        iter = bdVec_.erase(iter);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xa0(%rdi), %r14
movq 0xa0(%rdi), %r15
cmpq 0xa8(%rbx), %r15
je 0x1119f
movq (%r15), %rdi
testq %rdi, %rdi
je 0x1118f
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x11840
movq %rax, %r15
jmp 0x11178
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::KVDS(char const*, hlkvds::Options)
KVDS::KVDS(const char* filename, Options opts) :
    paths_(string(filename)), sbMgr_(NULL), idxMgr_(NULL), rdCache_(NULL), metaStor_(NULL), dataStor_(NULL), options_(opts), isOpen_(false) {

    sbMgr_ = new SuperBlockManager(options_);
    idxMgr_ = new IndexManager(sbMgr_, options_);

    if(!options_.disable_cache){
        rdCache_ = new ReadCache(CachePolicy(options_.cache_policy), (size_t) options_.cache_size, options_.slru_partition);
    }

    metaStor_ = new MetaStor(filename, bdVec_, sbMgr_, idxMgr_, options_);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r12
movq %rdi, %r15
leaq 0x2040d(%rip), %rax     # 0x315e0
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
leaq 0xf(%rsp), %rdx
movq %rdi, 0x10(%rsp)
callq 0x6150
leaq 0x50(%r15), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x28(%r15)
andq $0x0, 0x48(%r15)
pushq $0xa
popq %rcx
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xa0(%r15), %r14
movups %xmm0, 0xa9(%r15)
movups %xmm0, 0xa0(%r15)
pushq $0x78
popq %rdi
callq 0x6410
movq %rax, %rbp
movq %rax, %rdi
movq %r13, %rsi
callq 0x1ac90
leaq 0x28(%r15), %rax
movq %rbp, (%rax)
movl $0xa0, %edi
callq 0x6410
movq %rax, %rbx
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0xf39c
movq %rbx, 0x30(%r15)
cmpb $0x0, 0x50(%r15)
jne 0x11290
movl $0x1a8, %edi            # imm = 0x1A8
callq 0x6410
movq %rax, %rbp
movslq 0x54(%r15), %rdx
movl 0x58(%r15), %esi
movl 0x5c(%r15), %ecx
movq %rax, %rdi
callq 0x14bf0
movq %rbp, 0x38(%r15)
pushq $0x50
popq %rdi
callq 0x6410
movq %rax, %rbp
movq 0x28(%r15), %rcx
movq 0x30(%r15), %r8
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %r9
callq 0x130f0
movq %rbp, 0x40(%r15)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x112d3
jmp 0x112d3
movq %rax, %r15
movq %rbx, %rdi
jmp 0x112d9
movq %rax, %r15
movq %rbp, %rdi
callq 0x63f0
jmp 0x112e3
movq %rax, %r15
movq %r14, %rdi
callq 0x1188e
movq 0x10(%rsp), %rdi
callq 0x6788
movq %r15, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::Insert(char const*, unsigned int, char const*, unsigned short, bool)
Status KVDS::Insert(const char* key, uint32_t key_len, const char* data,
                      uint16_t length, bool immediately) {
    if (key == NULL || key[0] == '\0') {
        return Status::InvalidArgument("Key is null or empty.");
    }

    KVSlice slice(key, key_len, data, length);

    Status s = dataStor_->WriteData(slice, immediately);

    if (s.ok()) {
        if(!options_.disable_cache && !slice.GetDataLen()){
            rdCache_->Put(slice.GetKeyStr(),slice.GetDataStr());
        }
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x113c6
cmpb $0x0, (%rdx)
je 0x113c6
movq %rsi, %r14
movb 0xb0(%rsp), %bpl
movzwl %r9w, %eax
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
movl %ecx, %edx
movq %r8, %rcx
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x18476
movq 0x48(%r14), %rsi
movq (%rsi), %rax
movzbl %bpl, %ecx
movq %rbx, %rdi
movq %r15, %rdx
callq *0x40(%rax)
cmpl $0x0, (%rbx)
jne 0x113ba
cmpb $0x0, 0x50(%r14)
jne 0x113ba
cmpw $0x0, 0x60(%rsp)
jne 0x113ba
movq 0x38(%r14), %r14
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x18638
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x1865a
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x14cd4
leaq 0x8(%rsp), %rdi
callq 0x6788
leaq 0x28(%rsp), %rdi
callq 0x6788
leaq 0x48(%rsp), %rdi
callq 0x1835a
jmp 0x113d5
leaq 0xeb59(%rip), %rsi      # 0x1ff26
movq %rbx, %rdi
callq 0x1187a
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6788
jmp 0x113f8
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x6788
jmp 0x11409
jmp 0x11406
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x1835a
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::Get(char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
Status KVDS::Get(const char* key, uint32_t key_len, string &data) {
    bool res = false;
    if (key == NULL) {
        return Status::InvalidArgument("Key is null.");
    }

    KVSlice slice(key, key_len, NULL, 0);

    if(!options_.disable_cache) {
        if(rdCache_->Get(slice.GetKeyStr(), data)) {
            rdCache_->Put(slice.GetKeyStr(), data);
            return Status::OK();
        }
    }

    res = idxMgr_->GetHashEntry(&slice);
    if (!res) {
        //The key is not exist
        return Status::NotFound("Key is not found.");
    }

    Status s = dataStor_->ReadData(slice, data);

    if (s.ok()) {
        if(!options_.disable_cache) {
            rdCache_->Put(slice.GetKeyStr(), data);
        }
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x11596
movq %r8, %r14
movq %rsi, %r15
leaq 0xa0(%rsp), %rdi
movq %rdx, %rsi
movl %ecx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x18476
cmpb $0x0, 0x50(%r15)
jne 0x11518
movq 0x38(%r15), %r12
leaq 0x80(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x18638
leaq 0x80(%rsp), %rsi
movq %r12, %rdi
movq %r14, %rdx
callq 0x15198
movl %eax, %ebp
leaq 0x80(%rsp), %rdi
callq 0x6788
testb %bpl, %bpl
je 0x11518
movq 0x38(%r15), %r15
leaq 0x60(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x18638
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x6530
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r15, %rdi
callq 0x14cd4
leaq 0x40(%rsp), %rdi
callq 0x6788
leaq 0x60(%rsp), %rdi
callq 0x6788
andl $0x0, (%rbx)
andq $0x0, 0x8(%rbx)
jmp 0x115b6
movq 0x30(%r15), %rdi
leaq 0xa0(%rsp), %rsi
callq 0xf172
testb %al, %al
je 0x115a7
movq 0x48(%r15), %rsi
movq (%rsi), %rax
leaq 0xa0(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rcx
callq *0x50(%rax)
cmpl $0x0, (%rbx)
jne 0x115b6
cmpb $0x0, 0x50(%r15)
jne 0x115b6
movq 0x38(%r15), %r15
leaq 0x20(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x18638
movq %rsp, %rdi
movq %r14, %rsi
callq 0x6530
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %r15, %rdi
callq 0x14cd4
movq %rsp, %rdi
callq 0x6788
leaq 0x20(%rsp), %rdi
callq 0x6788
jmp 0x115b6
leaq 0xe99f(%rip), %rsi      # 0x1ff3c
movq %rbx, %rdi
callq 0x1187a
jmp 0x115c3
leaq 0xe01a(%rip), %rsi      # 0x1f5c8
movq %rbx, %rdi
callq 0xb332
leaq 0xa0(%rsp), %rdi
callq 0x1835a
movq %rbx, %rax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6788
jmp 0x115e6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x11613
jmp 0x1161a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6788
jmp 0x11601
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x11613
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x6788
jmp 0x1161d
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x1835a
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::InsertBatch(hlkvds::WriteBatch*)
Status KVDS::InsertBatch(WriteBatch *batch) {
    if (batch->batch_.empty()) {
        return Status::OK();
    }

    Status s = dataStor_->WriteBatchData(batch);

    if (s.ok()) {
        if(!options_.disable_cache) {
            for (std::list<KVSlice *>::iterator iter = batch->batch_.begin();
                    iter != batch->batch_.end(); iter++) {
                if(!(*iter)->GetDataLen()) {//no "" should be put in to the cache
                    rdCache_->Put((*iter)->GetKeyStr(), (*iter)->GetDataStr());
                }
            }
        }
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
cmpq %rdx, (%rdx)
je 0x116c7
movq %rdx, %r12
movq %rsi, (%rsp)
movq 0x48(%rsi), %rsi
movq (%rsi), %rax
movq %rbx, %rdi
callq *0x48(%rax)
cmpl $0x0, (%rbx)
jne 0x116cf
movq (%rsp), %rax
cmpb $0x0, 0x50(%rax)
jne 0x116cf
leaq 0x28(%rsp), %rbp
leaq 0x8(%rsp), %r13
movq %r12, %r14
movq (%r14), %r14
cmpq %r12, %r14
je 0x116cf
movq 0x10(%r14), %rsi
cmpw $0x0, 0x18(%rsi)
jne 0x11678
movq (%rsp), %rax
movq 0x38(%rax), %r15
movq %rbp, %rdi
callq 0x18638
movq 0x10(%r14), %rsi
movq %r13, %rdi
callq 0x1865a
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x14cd4
movq %r13, %rdi
callq 0x6788
movq %rbp, %rdi
callq 0x6788
jmp 0x11678
andl $0x0, (%rbx)
andq $0x0, 0x8(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x116f3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6788
leaq 0x28(%rsp), %rdi
callq 0x6788
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Kvdb_Impl.cc
// Function: hlkvds::KVDS::ClearReadCache()
void KVDS::ClearReadCache() {
    vector<BlockDevice*>::iterator iter;
    for (iter = bdVec_.begin(); iter != bdVec_.end(); iter++) {
        BlockDevice *bdev = *iter;
        bdev->ClearReadCache();
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xa0(%rdi), %r14
cmpq 0xa8(%rbx), %r14
je 0x11736
movq (%r14), %rdi
movq (%rdi), %rax
callq *0x68(%rax)
addq $0x8, %r14
jmp 0x1171e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::TryLoadSB(int&)
bool MetaStor::TryLoadSB(int &datastor_type) {
    verifyMetaDevice();

    //Load SuperBlock
    sbOff_ = 0;
    if (!loadSuperBlock()) {
        __ERROR("Load SuperBlock failed.");
        return false;
    }

    datastor_type = sbMgr_->GetDataStoreType();
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rdi), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, 0x10(%rdi)
andq $0x0, 0x38(%rdi)
callq 0x131c2
movl %eax, %ebx
testb %al, %al
je 0x1316b
movq 0x18(%r15), %rax
movl 0x2c(%rax), %eax
movl %eax, (%r14)
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x1ee66(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xc124(%rip), %rsi      # 0x1f2a5
leaq 0xceb1(%rip), %rcx      # 0x20039
leaq 0xceb4(%rip), %r8       # 0x20043
pushq $0x23
popq %r9
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xcea9(%rip), %rdi      # 0x20053
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x13163
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::loadSuperBlock()
bool MetaStor::loadSuperBlock() {
    uint64_t length = SuperBlockManager::SuperBlockSizeOnDevice();
    char *buff = new char[length];
    memset(buff, 0, length);

    if ((uint64_t) metaDev_->pRead(buff, length, sbOff_) != length){
        __ERROR("Could not read superblock from device at %ld\n", sbOff_);
        delete[] buff;
        return false;
    }

    if (!sbMgr_->Set(buff, length))
    {
        __ERROR("Can't Set SuperBlock, Load Failed!");
        delete[] buff;
        return false;
    }
    delete[] buff;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movl $0x1000, %edi           # imm = 0x1000
callq 0x6040
movq %rax, %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rax, %rdi
xorl %esi, %esi
callq 0x6250
movq 0x10(%r14), %rdi
movq 0x38(%r14), %rcx
movq (%rdi), %rax
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rsi
callq *0x50(%rax)
cmpq $0x1000, %rax           # imm = 0x1000
jne 0x13232
movq 0x18(%r14), %rdi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rsi
callq 0x1abec
movb $0x1, %bpl
testb %al, %al
je 0x13282
movq %rbx, %rdi
callq 0x64c0
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x1ed9f(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0xc05c(%rip), %rsi      # 0x1f2a5
leaq 0xcfb8(%rip), %rcx      # 0x20208
leaq 0xcdec(%rip), %r8       # 0x20043
movq %r15, %rdi
movq %rax, %rdx
movl $0xf1, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r12), %rdi
movq 0x38(%r14), %rdx
leaq 0xcf9e(%rip), %rsi      # 0x20217
xorl %eax, %eax
callq 0x6580
jmp 0x132ce
movq 0x1ed4f(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xc00d(%rip), %rsi      # 0x1f2a5
leaq 0xcf69(%rip), %rcx      # 0x20208
leaq 0xcd9d(%rip), %r8       # 0x20043
movq %r14, %rdi
movq %rax, %rdx
movl $0xf8, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xcf22(%rip), %rdi      # 0x201e5
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq 0x1ed03(%rip), %rax     # 0x31fd8
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
xorl %ebp, %ebp
jmp 0x1321f
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::createSuperBlock()
bool MetaStor::createSuperBlock() {
    uint64_t length = SuperBlockManager::SuperBlockSizeOnDevice();
    char *buff = new char[length];
    memset(buff, 0, length);

    if (!sbMgr_->Set(buff, length))
    {
        __ERROR("Can't Set SuperBlock, Load Failed!");
        delete[] buff;
        return false;
    }
    delete[] buff;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1000, %edi           # imm = 0x1000
callq 0x6040
movq %rax, %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rax, %rdi
xorl %esi, %esi
callq 0x6250
movq 0x18(%r14), %rdi
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rsi
callq 0x1abec
movl %eax, %ebp
testb %al, %al
je 0x135a2
movq %rbx, %rdi
callq 0x64c0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x1ea2f(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xbced(%rip), %rsi      # 0x1f2a5
leaq 0xcc15(%rip), %rcx      # 0x201d4
leaq 0xca7d(%rip), %r8       # 0x20043
movq %r14, %rdi
movq %rax, %rdx
movl $0xe3, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xcc02(%rip), %rdi      # 0x201e5
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1358d
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::createIndex(unsigned int, unsigned long)
bool MetaStor::createIndex(uint32_t ht_size, uint64_t index_size) {
    idxMgr_->InitMeta(ht_size, index_size, 0, 0);

    uint64_t length = index_size;
    char *buff = new char[length];
    memset(buff, 0, length);

    if(!idxMgr_->Set(buff, length)){
        __ERROR("Can't Set Index Region, Load Failed!");
        delete[] buff;
        return false;
    }

    delete[] buff;
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %r15
movq 0x20(%rdi), %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xe80c
movq %r14, %rdi
callq 0x6040
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x6250
movq 0x20(%r15), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xe9c6
movl %eax, %ebp
testb %al, %al
je 0x13659
movq %rbx, %rdi
callq 0x64c0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x1e978(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xbc36(%rip), %rsi      # 0x1f2a5
leaq 0xcc71(%rip), %rcx      # 0x202e7
leaq 0xc9c6(%rip), %r8       # 0x20043
movq %r14, %rdi
movq %rax, %rdx
movl $0x123, %r9d            # imm = 0x123
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xcc59(%rip), %rdi      # 0x202f3
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x13644
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::createDataStor()
bool MetaStor::createDataStor() {
    if (!dataStor_->CreateAllComponents(sstOff_)) {
        __ERROR("Can't Create DataStore");
        return false;
    }

    uint64_t length = dataStor_->GetSSTsLengthOnDisk();

    char *buff = new char[length];
    memset(buff, 0 , length);

    if (!dataStor_->SetAllSSTs(buff, length)) {
        __ERROR("Can't Set SST Region, Load Failed!");
        delete[] buff;
        return false;
    }

    delete[] buff;
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movq 0x48(%rbx), %rsi
movq (%rdi), %rax
callq *0x80(%rax)
testb %al, %al
je 0x13726
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
movq %rax, %r15
movq %rax, %rdi
callq 0x6040
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x6250
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movq %r15, %rdx
callq *0x78(%rax)
testb %al, %al
je 0x13781
movq %r14, %rdi
callq 0x64c0
movb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1e8ab(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xbb69(%rip), %rsi      # 0x1f2a5
leaq 0xcc9d(%rip), %rcx      # 0x203e0
leaq 0xc8f9(%rip), %r8       # 0x20043
xorl %ebx, %ebx
movq %r14, %rdi
movq %rax, %rdx
movl $0x162, %r9d            # imm = 0x162
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xcc86(%rip), %rdi      # 0x203ef
pushq $0x16
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x13718
movq 0x1e850(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0xbb0d(%rip), %rsi      # 0x1f2a5
leaq 0xcc41(%rip), %rcx      # 0x203e0
leaq 0xc89d(%rip), %r8       # 0x20043
xorl %ebx, %ebx
movq %r15, %rdi
movq %rax, %rdx
movl $0x16c, %r9d            # imm = 0x16C
xorl %eax, %eax
callq 0x6580
movq (%r12), %rcx
leaq 0xcc40(%rip), %rdi      # 0x20406
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x64c0
jmp 0x13718
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::zeroDeviceMetaRegion(unsigned long)
bool MetaStor::zeroDeviceMetaRegion(uint64_t meta_size) {
    if (meta_size % 4096 != 0) {
        return false;
    }

    char *align_buf;
    int block_size = metaDev_->GetBlockSize();
    block_size = (block_size > 4096? block_size : 4096);

    int ret = posix_memalign((void **)&align_buf, 4096, (size_t)block_size);
    if (ret < 0) {
        __ERROR("Can't allocate memory for SSTs, Persist Failed!");
        return false;
    }
    memset(align_buf, 0, block_size);

    uint64_t need_wte_bytes = meta_size;
    uint64_t wte_offset = 0;
    while (need_wte_bytes > 0) {
        uint64_t bytes_to_write = min(need_wte_bytes, (uint64_t)block_size);
        if ( !metaDev_->pWrite(align_buf, bytes_to_write, wte_offset) ) {
            __ERROR("error in fill_file_with_zeros write: %s\n", strerror(errno));
            free(align_buf);
            return false;
        }
        need_wte_bytes -= bytes_to_write;
        wte_offset += bytes_to_write;
    }
    free(align_buf);
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rax
shlq $0x34, %rax
je 0x13807
xorl %ebx, %ebx
jmp 0x1388b
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
cmpl $0x1001, %eax           # imm = 0x1001
movl $0x1000, %r15d          # imm = 0x1000
cmovgel %eax, %r15d
leaq 0x8(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdx
callq 0x6200
testl %eax, %eax
js 0x1389b
movq 0x8(%rsp), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
movq %r15, %rdx
callq 0x6250
testq %rbx, %rbx
je 0x1387f
cmpq %r15, %rbx
movq %r15, %r13
cmovbq %rbx, %r13
movq 0x10(%r14), %rdi
movq 0x8(%rsp), %rsi
movq (%rdi), %rax
movq %r13, %rdx
movq %r12, %rcx
callq *0x48(%rax)
testq %rax, %rax
je 0x138f6
subq %r13, %rbx
addq %r13, %r12
jmp 0x1384e
movq 0x8(%rsp), %rdi
callq 0x6470
movb $0x1, %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x1e736(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xb9f4(%rip), %rsi      # 0x1f2a5
leaq 0xc857(%rip), %rcx      # 0x2010f
leaq 0xc784(%rip), %r8       # 0x20043
xorl %ebx, %ebx
movq %r14, %rdi
movq %rax, %rdx
movl $0x9d, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0xc846(%rip), %rdi      # 0x20124
pushq $0x2f
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1388b
movq 0x1e6db(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0xb999(%rip), %rsi      # 0x1f2a5
leaq 0xc7fc(%rip), %rcx      # 0x2010f
leaq 0xc729(%rip), %r8       # 0x20043
xorl %ebx, %ebx
movq %r14, %rdi
movq %rax, %rdx
movl $0xa7, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r15), %r14
callq 0x6060
movl (%rax), %edi
callq 0x6110
leaq 0xc2cd(%rip), %rsi      # 0x1fc12
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq 0x8(%rsp), %rdi
callq 0x6470
jmp 0x1388b
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/MetaStor.cc
// Function: hlkvds::MetaStor::LoadMetaData()
bool MetaStor::LoadMetaData() {

    //Load Index
    uint32_t index_ht_size = sbMgr_->GetHTSize();
    uint64_t sb_region_length = SuperBlockManager::SuperBlockSizeOnDevice();
    uint64_t index_region_length = sbMgr_->GetIndexRegionLength();

    idxOff_ = sbOff_ + sb_region_length;
    if(!loadIndex(index_ht_size, index_region_length)) {
        __ERROR("Load Index failed.");
        return false;
    }

    //Load DataStor
    sstOff_ = idxOff_ + index_region_length;
    if (!loadDataStor()) {
        __ERROR("Load SSTs failed.");
        return false;
    }

    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movl 0x4(%rax), %esi
movq 0x10(%rax), %r14
movl $0x1000, %eax           # imm = 0x1000
addq 0x38(%rdi), %rax
movq %rax, 0x40(%rdi)
movq %r14, %rdx
callq 0x13a62
testb %al, %al
je 0x139b7
addq 0x40(%rbx), %r14
movq %r14, 0x48(%rbx)
movq %rbx, %rdi
callq 0x13b94
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0x139fc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x1e61a(%rip), %r14     # 0x31fd8
movq (%r14), %rbx
callq 0x63c0
leaq 0xb8d8(%rip), %rsi      # 0x1f2a5
leaq 0xc780(%rip), %rcx      # 0x20154
leaq 0xc668(%rip), %r8       # 0x20043
movq %rbx, %rdi
movq %rax, %rdx
movl $0xbb, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r14), %rcx
leaq 0xc769(%rip), %rdi      # 0x20161
pushq $0x12
jmp 0x13a3f
movq 0x1e5d5(%rip), %r14     # 0x31fd8
movq (%r14), %rbx
callq 0x63c0
leaq 0xb893(%rip), %rsi      # 0x1f2a5
leaq 0xc73b(%rip), %rcx      # 0x20154
leaq 0xc623(%rip), %r8       # 0x20043
movq %rbx, %rdi
movq %rax, %rdx
movl $0xc2, %r9d
xorl %eax, %eax
callq 0x6580
movq (%r14), %rcx
leaq 0xc737(%rip), %rdi      # 0x20174
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq 0x1e589(%rip), %rax     # 0x31fd8
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
xorl %eax, %eax
jmp 0x139af
nop