LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::WriteBatchData(hlkvds::WriteBatch*)
Status DS_MultiVolume_Impl::WriteBatchData(WriteBatch *batch) {
    uint32_t seg_id = 0;
    bool ret;

    int vol_id = pickVol();
    Volume *vol = volMap_[vol_id];

    //TODO: use GcSegment first, need abstract segment.
    while (!vol->Alloc(seg_id)) {
        ret = vol->ForeGC();
        if (!ret) {
            __ERROR("Cann't get a new Empty Segment.\n");
            return Status::Aborted("Can't allocate a Empty Segment.");
        }
    }

    SegForSlice *seg = new SegForSlice(vol, idxMgr_);
    for (std::list<KVSlice *>::iterator iter = batch->batch_.begin();
            iter != batch->batch_.end(); iter++) {
        if (seg->TryPut(*iter)) {
            seg->Put(*iter);
        }
        else {
            __ERROR("The Batch is too large, can't put in one segment");
            delete seg;
            return Status::Aborted("Batch is too large.");
        }
    }

    seg->SetSegId(seg_id);
    ret = seg->WriteSegToDevice();
    if(!ret) {
        __ERROR("Write batch segment to device failed");
        vol->FreeForFailed(seg_id);
        delete seg;
        return Status::IOError("could not write batch segment to device ");
    }

    uint32_t free_size = seg->GetFreeSize();
    vol->Use(seg_id, free_size);
    seg->UpdateToIndex();
    delete seg;
    return Status::OK();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movl $0x0, (%r12)
movq %rsi, %rdi
callq 0xc756
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x28(%r13), %rdi
callq 0xe0a8
movq (%rax), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x20c92
testb %al, %al
jne 0xcf8c
movq %r14, %rdi
callq 0x20d8a
testb %al, %al
jne 0xcf64
movq %rbx, %rdi
callq 0x6c66
jmp 0xd026
movl $0x50, %edi
callq 0x6410
movq %rax, %r12
movq 0x20(%r13), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1ca02
movq (%r15), %r13
cmpq %r15, %r13
je 0xcfd6
movq 0x10(%r13), %rsi
movq %r12, %rdi
callq 0x1be5c
testb %al, %al
je 0xd04c
movq 0x10(%r13), %rsi
movq %r12, %rdi
callq 0x1be76
movq (%r13), %r13
jmp 0xcfab
movl 0x8(%rsp), %eax
movl %eax, (%r12)
movq %r12, %rdi
callq 0x1bf42
testb %al, %al
je 0xd037
movl 0x18(%r12), %edx
subl 0x14(%r12), %edx
movl 0x8(%rsp), %esi
movq %r14, %rdi
callq 0x20d80
movq %r12, %rdi
callq 0x1ca3c
movq %r12, %rdi
callq 0x1bd44
movq %r12, %rdi
callq 0x63f0
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x6d71
jmp 0xd026
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6cdb
jmp 0xd026
movq %rax, %rbx
movq %r12, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::ReadData(hlkvds::KVSlice&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
Status DS_MultiVolume_Impl::ReadData(KVSlice &slice, string &data) {
    HashEntry *entry;
    entry = &slice.GetHashEntry();

    int vol_id = getVolIdFromEntry(entry);
    Volume *vol = volMap_[vol_id];

    uint64_t data_offset = 0;
    if (!vol->CalcDataOffsetPhyFromEntry(entry, data_offset)) {
        return Status::Aborted("Calculate data offset failed.");
    }

    uint16_t data_len = entry->GetDataSize();

    if (data_len == 0) {
        //The key is not exist
        return Status::NotFound("Key is not found.");
    }

    char *mdata = new char[data_len];
    if (!vol->Read(mdata, data_len, data_offset)) {
        __ERROR("Could not read data at position");
        delete[] mdata;
        return Status::IOError("Could not read data at position.");
    }
    data.assign(mdata, data_len);
    delete[] mdata;

    __DEBUG("get key: %s, data offset %ld, head_offset is %ld", slice.GetKeyStr().c_str(), data_offset, entry->GetHeaderOffset());

    return Status::OK();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdi, %rbx
movq 0x28(%rdx), %r15
movq (%r15), %rax
movzwl 0x20(%rax), %ecx
leaq 0xc(%rsp), %rax
movl %ecx, (%rax)
leaq 0x28(%rsi), %rdi
movq %rax, %rsi
callq 0xe0a8
movq (%rax), %r13
movq %rsp, %rdx
movq $0x0, (%rdx)
movq %r13, %rdi
movq %r15, %rsi
callq 0x20dc4
testb %al, %al
je 0xd113
movq (%r15), %rax
movzwl 0x16(%rax), %r15d
testq %r15, %r15
je 0xd124
movq %r15, %rdi
callq 0x6040
movq %rax, %r12
movq (%rsp), %rcx
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x20cb0
testb %al, %al
je 0xd149
movq 0x8(%r14), %rdx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
movq %r15, %r8
callq 0x65d0
movq %r12, %rdi
callq 0x64d0
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
jmp 0xd138
leaq 0x154b0(%rip), %rdx     # 0x225ca
movq %rbx, %rdi
movl $0x7, %esi
jmp 0xd133
leaq 0x154bd(%rip), %rdx     # 0x225e8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1de28
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6e1f
jmp 0xd138
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::GetSBReservedContent(char*, unsigned long)
bool DS_MultiVolume_Impl::GetSBReservedContent(char* buf, uint64_t length) {
    if (length != SuperBlockManager::ReservedRegionLength()) {
        return false;
    }
    memset((void*)buf, 0, length);

    //Get sbResHeader_
    uint64_t header_size = sizeof(MultiVolumeDS_SB_Reserved_Header);
    memcpy((void*)buf, (const void*)&sbResHeader_, header_size);
    __DEBUG("SB_RESERVED_HEADER: volume_num= %d, segment_size = %d", sbResHeader_.volume_num, sbResHeader_.segment_size);

    //Get sbResVolVec_
    uint64_t sb_res_vol_size = sizeof(MultiVolumeDS_SB_Reserved_Volume);
    uint32_t vol_num = sbResHeader_.volume_num;
    char * sb_res_vol_ptr = buf + header_size;

    updateAllVolSBRes();

    for (uint32_t i = 0; i < vol_num; i++) {
        memcpy((void*)(sb_res_vol_ptr), (const void*)&sbResVolVec_[i], sb_res_vol_size);
        sb_res_vol_ptr += sb_res_vol_size;
        __DEBUG("Volume [%d], device_path= %s, segment_num = %d, current_seg_id = %d", i, sbResVolVec_[i].dev_path, sbResVolVec_[i].segment_num, sbResVolVec_[i].cur_seg_id);
    }

    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
cmpq $0xfc3, %rdx            # imm = 0xFC3
jne 0xd1dc
movq %rsi, %r14
movq %rdi, %r15
movl $0xfc3, %edx            # imm = 0xFC3
movq %rsi, %rdi
xorl %esi, %esi
callq 0x6250
movq 0x120(%r15), %rax
movq %rax, (%r14)
movl 0x124(%r15), %r12d
movq %r15, %rdi
callq 0xd1f0
testq %r12, %r12
je 0xd1dc
addq $0x8, %r14
movq %r12, %rax
shlq $0x8, %rax
leaq (%rax,%r12,8), %r12
xorl %r13d, %r13d
leaq (%r14,%r13), %rdi
movq 0x128(%r15), %rsi
addq %r13, %rsi
movl $0x108, %edx            # imm = 0x108
callq 0x6380
addq $0x108, %r13            # imm = 0x108
cmpq %r13, %r12
jne 0xd1b8
cmpq $0xfc3, %rbx            # imm = 0xFC3
sete %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::SetSBReservedContent(char*, unsigned long)
bool DS_MultiVolume_Impl::SetSBReservedContent(char* buf, uint64_t length) {
    if (length != SuperBlockManager::ReservedRegionLength()) {
        return false;
    }

    //Set sbResHeader_
    uint64_t header_size = sizeof(MultiVolumeDS_SB_Reserved_Header);
    memcpy((void*)&sbResHeader_, (const void*)buf, header_size);
    __DEBUG("SB_RESERVED_HEADER: volume_num= %d, segment_size = %d", sbResHeader_.volume_num, sbResHeader_.segment_size);

    //Set sbResVolVec_
    uint64_t sb_res_vol_size = sizeof(MultiVolumeDS_SB_Reserved_Volume);
    uint32_t vol_num = sbResHeader_.volume_num;
    char * sb_res_vol_ptr = buf + header_size;

    for (uint32_t i = 0; i < vol_num; i++) {
        MultiVolumeDS_SB_Reserved_Volume sb_res_vol;
        memcpy((void*)&sb_res_vol, (const void*)sb_res_vol_ptr, sb_res_vol_size);
        sbResVolVec_.push_back(sb_res_vol);
        sb_res_vol_ptr += sb_res_vol_size;
        __DEBUG("Volume [%d], device_path= %s, segment_num = %d, current_seg_id = %d", i, sbResVolVec_[i].dev_path, sbResVolVec_[i].segment_num, sbResVolVec_[i].cur_seg_id);
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdx, %rbx
cmpq $0xfc3, %rdx            # imm = 0xFC3
jne 0xd2f6
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rbp
movq %rbp, 0x120(%rdi)
shrq $0x20, %rbp
je 0xd2f6
addq $0x8, %r14
leaq 0x128(%r15), %r12
movq %rsp, %r13
movl $0x108, %edx            # imm = 0x108
movq %r13, %rdi
movq %r14, %rsi
callq 0x6380
movq 0x130(%r15), %rsi
cmpq 0x138(%r15), %rsi
je 0xd2e0
movl $0x108, %edx            # imm = 0x108
movq %rsi, %rdi
movq %r14, %rsi
callq 0x6600
addq $0x108, 0x130(%r15) # imm = 0x108
jmp 0xd2eb
movq %r12, %rdi
movq %r13, %rdx
callq 0xf842
addq $0x108, %r14            # imm = 0x108
decl %ebp
jne 0xd2a3
cmpq $0xfc3, %rbx            # imm = 0xFC3
sete %al
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::GetAllSSTs(char*, unsigned long)
bool DS_MultiVolume_Impl::GetAllSSTs(char* buf, uint64_t length) {
    uint64_t sst_total_length = GetSSTsLengthOnDisk();
    if (length != sst_total_length) {
        return false;
    }
    char *buf_ptr = buf;

    //Copy TS
    int64_t time_len = KVTime::SizeOf();
    lastTime_->Update();
    time_t t = lastTime_->GetTime();
    memcpy((void *)buf_ptr, (const void *)&t, time_len);
    buf_ptr += time_len;
    __DEBUG("memcpy timestamp: %s at %p, at %ld", KVTime::ToChar(*lastTime_), (void *)buf_ptr, (int64_t)(buf_ptr-buf));

    //Copy SST
    for (uint32_t i = 0; i < volNum_; i++) {
        uint64_t vol_sst_length = volMap_[i]->GetSSTLength();
        if ( !volMap_[i]->GetSST(buf_ptr, vol_sst_length) ) {
            return false;
        }
        buf_ptr += vol_sst_length;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x98(%rax)
cmpq %r15, %rax
jne 0xd3ba
movq 0xd0(%r14), %rdi
callq 0x209a4
movq 0xd0(%r14), %rdi
callq 0x20998
movq %rax, (%rbx)
cmpl $0x0, 0xe0(%r14)
je 0xd3be
addq $0x8, %rbx
leaq 0x28(%r14), %r15
xorl %r12d, %r12d
movq %rsp, %r13
movl %r12d, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe2e4
movq (%rax), %rdi
callq 0x20d2e
movq %rax, %rbp
movl %r12d, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xe2e4
movq (%rax), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x20c9c
testb %al, %al
je 0xd3c0
addq %rbp, %rbx
incl %r12d
cmpl 0xe0(%r14), %r12d
jb 0xd36b
jmp 0xd3c0
xorl %eax, %eax
jmp 0xd3c0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::SetAllSSTs(char*, unsigned long)
bool DS_MultiVolume_Impl::SetAllSSTs(char* buf, uint64_t length) {
    uint64_t sst_total_length = GetSSTsLengthOnDisk();
    if (length != sst_total_length) {
        return false;
    }
    char *buf_ptr = buf;

    //Set TS
    int64_t time_len = KVTime::SizeOf();
    time_t t;
    memcpy((void *)&t, (const void *)buf_ptr, time_len);
    lastTime_->SetTime(t);
    buf_ptr += time_len;
    __DEBUG("memcpy timestamp: %s at %p, at %ld", KVTime::ToChar(*lastTime_), (void *)buf_ptr, (int64_t)(buf_ptr-buf));

    //Set SST
    for (uint32_t i = 0; i < volNum_; i++) {
        uint64_t vol_sst_length = volMap_[i]->GetSSTLength();
        if ( !volMap_[i]->SetSST(buf_ptr, vol_sst_length) ) {
            return false;
        }
        buf_ptr += vol_sst_length;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x98(%rax)
cmpq %r15, %rax
jne 0xd468
movq (%rbx), %rsi
movq 0xd0(%r14), %rdi
callq 0x2098c
cmpl $0x0, 0xe0(%r14)
je 0xd46c
addq $0x8, %rbx
leaq 0x28(%r14), %r15
xorl %r12d, %r12d
movq %rsp, %r13
movl %r12d, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe2e4
movq (%rax), %rdi
callq 0x20d2e
movq %rax, %rbp
movl %r12d, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xe2e4
movq (%rax), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x20ca6
testb %al, %al
je 0xd46e
addq %rbp, %rbx
incl %r12d
cmpl 0xe0(%r14), %r12d
jb 0xd419
jmp 0xd46e
xorl %eax, %eax
jmp 0xd46e
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::calcSegNumForMetaVolume(unsigned long, unsigned long, unsigned int, unsigned int)
uint32_t DS_MultiVolume_Impl::calcSegNumForMetaVolume(uint64_t capacity, uint64_t sst_offset, uint32_t total_buddy_seg_num, uint32_t seg_size) {
    uint64_t valid_capacity = capacity - sst_offset;
    uint32_t seg_num_candidate = valid_capacity / seg_size;

    uint32_t seg_num_total = seg_num_candidate + total_buddy_seg_num;
    uint64_t sst_length = calcSSTsLengthOnDiskBySegNum( seg_num_total );

    uint32_t seg_size_bit = log2(seg_size);

    while( sst_length + ((uint64_t) seg_num_candidate << seg_size_bit) > valid_capacity) {
         seg_num_candidate--;
         seg_num_total = seg_num_candidate + total_buddy_seg_num;
         sst_length = calcSSTsLengthOnDiskBySegNum( seg_num_total );
    }
    return seg_num_candidate;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movq %rsi, %r14
subq %rdx, %r14
movl %r8d, %r13d
movq %r14, %rax
xorl %edx, %edx
divq %r13
movq %rax, %r15
callq 0x66a0
movslq %eax, %r12
cvtsi2sd %r13, %xmm0
callq 0x6680
cvttsd2si %xmm0, %rax
movl %eax, %ecx
movl %r15d, %esi
leal (%rsi,%rbx), %eax
leaq (%rax,%rax,2), %rax
leaq 0x8(,%rax,4), %rax
xorl %edx, %edx
divq %r12
incq %rax
movl %r15d, %edx
shlq %cl, %rdx
imulq %r12, %rax
addq %rax, %rdx
leal -0x1(%rsi), %r15d
cmpq %r14, %rdx
ja 0xd6ba
movl %esi, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::initSBReservedContentForCreate()
void DS_MultiVolume_Impl::initSBReservedContentForCreate() {
    sbResHeader_.segment_size = segSize_;
    sbResHeader_.volume_num = volNum_;

    for(uint32_t i = 0; i < volNum_; i++)
    {
        MultiVolumeDS_SB_Reserved_Volume sb_res_vol;

        string dev_path = volMap_[i]->GetDevicePath();
        memcpy((void*)&sb_res_vol.dev_path, (const void*)dev_path.c_str(), dev_path.size());

        sb_res_vol.segment_num = volMap_[i]->GetNumberOfSeg();
        sb_res_vol.cur_seg_id = volMap_[i]->GetCurSegId();

        sbResVolVec_.push_back(sb_res_vol);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movl 0xd8(%rdi), %eax
movl 0xe0(%rdi), %ecx
movl %eax, 0x120(%rdi)
movl %ecx, 0x124(%rdi)
testl %ecx, %ecx
je 0xd84a
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
leaq 0x128(%rdi), %rax
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0x30(%rsp), %r12
leaq 0x4(%rsp), %r13
leaq 0x10(%rsp), %rbp
movl $0x108, %edx            # imm = 0x108
movq %r12, %rdi
xorl %esi, %esi
callq 0x6250
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xe2e4
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x20d1c
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x6380
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xe2e4
movq (%rax), %rax
movl 0x3c(%rax), %eax
movl %eax, 0x130(%rsp)
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xe2e4
movq (%rax), %rdi
callq 0x20d14
movl %eax, 0x134(%rsp)
movq 0x130(%rbx), %rsi
cmpq 0x138(%rbx), %rsi
je 0xd819
movl $0x108, %edx            # imm = 0x108
movq %rsi, %rdi
movq %r12, %rsi
callq 0x6380
addq $0x108, 0x130(%rbx) # imm = 0x108
jmp 0xd826
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0xf842
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xd83a
callq 0x63f0
incl %r15d
cmpl 0xe0(%rbx), %r15d
jb 0xd774
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd860
jmp 0xd860
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xd877
callq 0x63f0
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::verifyTopology()
bool DS_MultiVolume_Impl::verifyTopology() {
    if (volNum_ != bdVec_.size()) {
        return false;
    }
    for (uint32_t i = 0; i < volNum_; i++) {
        string record_path = string(sbResVolVec_[i].dev_path);
        string device_path = bdVec_[i]->GetDevicePath();
        if (record_path != device_path) {
            __ERROR("record_path: %s, device_path:%s ", record_path.c_str(), device_path.c_str());
            return false;
        }
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl 0xe0(%rdi), %esi
movq 0x10(%rdi), %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jne 0xdb4f
movb $0x1, %al
testl %esi, %esi
je 0xdb51
movq %rdi, %r14
leaq 0x18(%rsp), %r15
xorl %r12d, %r12d
leaq 0x28(%rsp), %rbp
xorl %r13d, %r13d
movq 0x128(%r14), %rax
leaq (%rax,%r12), %rbx
movq %r15, 0x8(%rsp)
testq %rax, %rax
je 0xdaac
movq %rbx, %rdi
callq 0x61a0
movq %rax, %rdx
addq %rbx, %rdx
jmp 0xdab1
movl $0x1, %edx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xa862
movq 0x10(%r14), %rax
movq (%rax), %rax
movq (%rax,%r13,8), %rsi
movq (%rsi), %rax
movq %rbp, %rdi
callq *0x28(%rax)
movq 0x10(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0xdb38
movq 0x28(%rsp), %rbx
testq %rdx, %rdx
je 0xdaf9
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x6420
testl %eax, %eax
jne 0xdb38
leaq 0x38(%rsp), %rax
cmpq %rax, %rbx
je 0xdb0b
movq %rbx, %rdi
callq 0x63f0
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xdb1a
callq 0x63f0
incq %r13
movl 0xe0(%r14), %eax
addq $0x108, %r12            # imm = 0x108
cmpq %rax, %r13
jb 0xda87
movb $0x1, %al
jmp 0xdb51
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %r15, %rcx
callq 0x6f71
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0xdb72
callq 0x63f0
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::GetKeyByHashEntry[abi:cxx11](hlkvds::HashEntry*)
string DS_MultiVolume_Impl::GetKeyByHashEntry(HashEntry *entry) {
    uint64_t key_offset = 0;

    int vol_id = getVolIdFromEntry(entry);
    Volume *vol = volMap_[vol_id];

    if (!vol->CalcKeyOffsetPhyFromEntry(entry, key_offset)) {
        return "";
    }
    __DEBUG("key offset: %lu",key_offset);
    uint16_t key_len = entry->GetKeySize();
    char *mkey = new char[key_len+1];
    if (!vol->Read(mkey, key_len, key_offset)) {
        __ERROR("Could not read data at position");
        delete[] mkey;
        return "";
    }
    mkey[key_len] = '\0';
    string res(mkey, key_len);
    //__INFO("Iterator key is %s, key_offset = %lu, key_len = %u", mkey, key_offset, key_len);
    delete[] mkey;

    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movq $0x0, (%r12)
movq (%rdx), %rax
movzwl 0x20(%rax), %ecx
leaq 0x14(%rsp), %rax
movl %ecx, (%rax)
leaq 0x28(%rsi), %rdi
movq %rax, %rsi
callq 0xe0a8
movq (%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20dee
testb %al, %al
je 0xdc4a
movq (%r14), %rax
movzwl 0x14(%rax), %r12d
leaq 0x1(%r12), %rdi
callq 0x6040
movq %rax, %r14
movq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x20cb0
testb %al, %al
je 0xdc72
movq %r14, %rdx
addq %r12, %rdx
movb $0x0, (%r14,%r12)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa862
movq %r14, %rdi
callq 0x64d0
jmp 0xdc63
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14f94(%rip), %rdx     # 0x22bec
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa862
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x700f
jmp 0xdc63
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::GetValueByHashEntry[abi:cxx11](hlkvds::HashEntry*)
string DS_MultiVolume_Impl::GetValueByHashEntry(HashEntry *entry) {
    uint64_t data_offset = 0;

    int vol_id = getVolIdFromEntry(entry);
    Volume *vol = volMap_[vol_id];

    if (!vol->CalcDataOffsetPhyFromEntry(entry, data_offset)) {
        return "";
    }
    __DEBUG("data offset: %lu",data_offset);
    uint16_t data_len = entry->GetDataSize();
    if ( data_len ==0 ) {
        return "";
    }
    char *mdata = new char[data_len+1];
    if (!vol->Read(mdata, data_len, data_offset)) {
        __ERROR("Could not read data at position");
        delete[] mdata;
        return "";
    }
    mdata[data_len]= '\0';
    string res(mdata, data_len);
    //__INFO("Iterator value is %s, data_offset = %lu, data_len = %u", mdata, data_offset, data_len);
    delete[] mdata;

    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movq $0x0, (%r12)
movq (%rdx), %rax
movzwl 0x20(%rax), %ecx
leaq 0x14(%rsp), %rax
movl %ecx, (%rax)
leaq 0x28(%rsi), %rdi
movq %rax, %rsi
callq 0xe0a8
movq (%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20dc4
testb %al, %al
je 0xdd25
movq (%r14), %rax
movzwl 0x16(%rax), %r12d
testq %r12, %r12
je 0xdd25
leaq 0x1(%r12), %rdi
callq 0x6040
movq %rax, %r14
movq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x20cb0
testb %al, %al
je 0xdd4d
movq %r14, %rdx
addq %r12, %rdx
movb $0x0, (%r14,%r12)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa862
movq %r14, %rdi
callq 0x64d0
jmp 0xdd3e
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x14eb9(%rip), %rdx     # 0x22bec
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa862
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x70a4
jmp 0xdd3e
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::updateMeta(hlkvds::Request*)
Status DS_MultiVolume_Impl::updateMeta(Request *req) {
    bool res = req->GetWriteStat();
    // update index
    if (!res) {
        return Status::Aborted("Write failed");
    }
    KVSlice *slice = &req->GetSlice();
    res = idxMgr_->UpdateIndex(slice);
    // minus the segment delete counter
    SegForReq *seg = req->GetSeg();
    if (!seg->CommitedAndGetNum()) {
        idxMgr_->AddToReaper(seg);
    }
    return Status::OK();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x2, 0x4(%rdx)
jne 0xddb6
movq %rdx, %r15
movq %rsi, %r14
movq 0x8(%rdx), %rsi
movq 0x20(%r14), %rdi
xorl %edx, %edx
callq 0x116fe
movq 0x68(%r15), %rsi
lock
decl 0x7c(%rsi)
jne 0xdda6
movq 0x20(%r14), %rdi
callq 0x122a2
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
jmp 0xddca
leaq 0x1491d(%rip), %rdx     # 0x226da
movq %rbx, %rdi
movl $0x7, %esi
callq 0x1de28
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::getTotalFreeSegs()
uint32_t DS_MultiVolume_Impl::getTotalFreeSegs() {
    uint32_t free_num = 0;
    for (uint32_t i = 0; i < volNum_; i++) {
        free_num += volMap_[i]->GetTotalFreeSegs();
    }
    return free_num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x0, 0xe0(%rdi)
je 0xde22
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
xorl %r12d, %r12d
leaq 0xc(%rsp), %r15
xorl %ebp, %ebp
movl %r12d, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xe2e4
movq (%rax), %rdi
callq 0x20d3a
addl %eax, %ebp
incl %r12d
cmpl 0xe0(%rbx), %r12d
jb 0xddfa
jmp 0xde24
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::ReqMerge(hlkvds::Request*)
void DS_MultiVolume_Impl::ReqMerge(Request* req) {
    int shard_id = req->GetShardsWQId();

    std::unique_lock<std::mutex> lck_seg_map(segMapMtx_, std::defer_lock);

    std::mutex *seg_mtx = segMtxVec_[shard_id];
    std::unique_lock<std::mutex> lck_seg(*seg_mtx);

    lck_seg_map.lock();
    SegForReq *seg = segMap_[shard_id];
    lck_seg_map.unlock();

    if (seg->TryPut(req)) {
        seg->Put(req);
    } else {
        seg->Completion();
        segWteWQ_->Add_task(seg);

        int vol_id = pickVol();
        seg = new SegForReq(volMap_[vol_id], idxMgr_, options_.expired_time);

        lck_seg_map.lock();
        std::map<int, SegForReq*>::iterator iter = segMap_.find(shard_id);
        segMap_.erase(iter);
        segMap_.insert( make_pair(shard_id, seg) );
        lck_seg_map.unlock();

        seg->Put(req);
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movslq 0x70(%rsi), %rax
movl %eax, 0xc(%rsp)
leaq 0x60(%rdi), %rcx
movq %rcx, 0x10(%rsp)
xorl %ecx, %ecx
movb %cl, 0x18(%rsp)
movq 0xb8(%rdi), %rdx
movq (%rdx,%rax,8), %rax
leaq 0x28(%rsp), %rdi
movq %rax, (%rdi)
movb %cl, 0x8(%rdi)
callq 0xe58e
movb $0x1, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xe58e
leaq 0x88(%r14), %r15
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
callq 0xe528
movq (%rax), %r12
leaq 0x10(%rsp), %rdi
callq 0xe5ca
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1c678
testb %al, %al
je 0xdec6
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1c69e
jmp 0xdf98
movq %r12, %rdi
callq 0x1c6fe
movq 0x158(%r14), %rdi
movq %r12, %rsi
callq 0xe5f2
movq %r14, %rdi
callq 0xc756
movl %eax, 0x24(%rsp)
movl $0xd8, %edi
callq 0x6410
movq %rax, %r12
leaq 0x28(%r14), %rdi
leaq 0x24(%rsp), %rsi
callq 0xe0a8
movq (%rax), %rsi
movq 0x8(%r14), %rax
movq 0x20(%r14), %rdx
movl 0x10(%rax), %ecx
movq %r12, %rdi
callq 0x1c58e
leaq 0x10(%rsp), %rdi
callq 0xe58e
movq 0x98(%r14), %rax
addq $0x90, %r14
testq %rax, %rax
je 0xdf61
movl 0xc(%rsp), %ecx
movq %r14, %rdx
xorl %esi, %esi
cmpl %ecx, 0x20(%rax)
setl %sil
cmovgeq %rax, %rdx
movq 0x10(%rax,%rsi,8), %rax
testq %rax, %rax
jne 0xdf3e
cmpq %r14, %rdx
je 0xdf61
cmpl 0x20(%rdx), %ecx
cmovgeq %rdx, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x10024
movl 0xc(%rsp), %eax
leaq 0x38(%rsp), %rsi
movl %eax, (%rsi)
movq %r12, 0x8(%rsi)
movq %r15, %rdi
callq 0xed58
leaq 0x10(%rsp), %rdi
callq 0xe5ca
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1c69e
leaq 0x28(%rsp), %rdi
callq 0xe10e
leaq 0x10(%rsp), %rdi
callq 0xe10e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xdfd2
movq %rax, %rbx
movq %r12, %rdi
callq 0x63f0
jmp 0xdfd5
jmp 0xdfd2
movq %rax, %rbx
jmp 0xdfdf
jmp 0xdfd2
jmp 0xdfd2
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xe10e
leaq 0x10(%rsp), %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::SegWrite(hlkvds::SegForReq*)
void DS_MultiVolume_Impl::SegWrite(SegForReq *seg) {
    Volume *vol =  seg->GetSelfVolume();

    uint32_t seg_id = 0;
    bool res;
    while (!vol->Alloc(seg_id)) {
        res = vol->ForeGC();
        if (!res) {
            __ERROR("Cann't get a new Empty Segment.\n");
            seg->Notify(res);
        }
    }
    uint32_t free_size = seg->GetFreeSize();
    seg->SetSegId(seg_id);
    res = seg->WriteSegToDevice();
    if (res) {
        vol->Use(seg_id, free_size);
    } else {
        vol->FreeForFailed(seg_id);
    }
    seg->Notify(res);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %r14
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
movq %r14, %rdi
callq 0x20c92
testb %al, %al
je 0xe04c
movl 0x14(%rbx), %r12d
movl 0x18(%rbx), %r15d
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movq %rbx, %rdi
callq 0x1bf42
movl %eax, %ebp
testb %al, %al
je 0xe078
subl %r12d, %r15d
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %r15d, %edx
callq 0x20d80
jmp 0xe084
leaq 0xc(%rsp), %r15
movq %r14, %rdi
callq 0x20d8a
testb %al, %al
je 0xe06e
movq %r14, %rdi
movq %r15, %rsi
callq 0x20c92
testb %al, %al
je 0xe051
jmp 0xe01c
movq %rbx, %rdi
callq 0x7139
jmp 0xe05d
movl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0x20d6c
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x1c70a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/./src/include/WorkQueue.h
// Function: dslab::WorkQueue<hlkvds::Request>::Stop()
void Stop() {
        stop_.store(true);
        cv_.notify_all();
        for (auto &t : threads_) {
            t.join();
        }
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movb $0x1, %al
xchgb %al, 0xcc(%rdi)
addq $0x80, %rdi
callq 0x6640
movq 0xb0(%r14), %rbx
movq 0xb8(%r14), %r14
cmpq %r14, %rbx
je 0xe386
movq %rbx, %rdi
callq 0x6650
addq $0x8, %rbx
jmp 0xe373
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/./src/include/WorkQueue.h
// Function: dslab::WorkQueue<hlkvds::Request>::worker()
void worker()
    {
        while(1) {
            std::unique_lock<std::mutex> lck(mtx_, std::defer_lock);
            lck.lock();
            cv_.wait_for(lck, std::chrono::milliseconds(1000), [this] {return !dataQueue_.empty();});

            if (this->stop_.load() && this->dataQueue_.empty()) {
                lck.unlock();
                return;
            }
                
            if  (!this->dataQueue_.empty()) {
                T* data = dataQueue_.front();
                dataQueue_.pop();
                lck.unlock();
                _void_process(data);
            }
            else {
                lck.unlock();
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x58(%rdi), %r13
leaq 0x80(%rdi), %r14
leaq 0x8(%rdi), %r15
movq %rsp, %r12
movq %r13, (%rsp)
movb $0x0, 0x8(%rsp)
movq %r12, %rdi
callq 0xe58e
movq $0x3e8, 0x10(%rsp)      # imm = 0x3E8
movq %r14, %rdi
movq %r12, %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rcx
callq 0xf2b2
movb 0xcc(%rbx), %dl
movq 0x18(%rbx), %rax
movq 0x38(%rbx), %rcx
cmpq %rax, %rcx
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
je 0xf073
cmpq %rax, %rcx
je 0xf05e
movq (%rax), %rbp
movq %r15, %rdi
callq 0xf37e
movq %r12, %rdi
callq 0xe5ca
movq (%rbx), %rax
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x10(%rax)
jmp 0xf066
movq %r12, %rdi
callq 0xe5ca
movq %r12, %rdi
callq 0xe10e
jmp 0xefed
movq %rsp, %rdi
callq 0xe5ca
movq %rsp, %rdi
callq 0xe10e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xf098
jmp 0xf098
jmp 0xf098
movq %rax, %rbx
movq %rsp, %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/DataStor.cc
// Function: hlkvds::DataStor::Create(hlkvds::Options&, std::vector<hlkvds::BlockDevice*, std::allocator<hlkvds::BlockDevice*>>&, hlkvds::SuperBlockManager*, hlkvds::IndexManager*, int)
DataStor* DataStor::Create(Options &opts, std::vector<BlockDevice*> &dev_vec, SuperBlockManager* sb, IndexManager* idx, int datastor_type) {

    switch (datastor_type) {
        case 0:
            return new DS_MultiVolume_Impl(opts, dev_vec, sb, idx);
        case 1:
            return new DS_MultiTier_Impl(opts, dev_vec, sb, idx);
        default:
            __ERROR("UnKnow DataStor Type!");
            return NULL;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
cmpl $0x1, %r8d
je 0x1009f
testl %r8d, %r8d
jne 0x100cd
movl $0x170, %edi            # imm = 0x170
callq 0x6410
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xc2b4
jmp 0x100c0
movl $0x48, %edi
callq 0x6410
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xbcf4
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x721c
xorl %ebx, %ebx
jmp 0x100c0
jmp 0x100d8
movq %rax, %r14
movq %rbx, %rdi
callq 0x63f0
movq %r14, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/GcManager.cc
// Function: hlkvds::GcManager::ForeGC()
bool GcManager::ForeGC() {
    std::lock_guard < std::mutex > lck_gc(gcMtx_);
    //check free segment;
    uint32_t free_seg_num = vol_->GetTotalFreeSegs();
    if (free_seg_num > SEG_RESERVED_FOR_GC) {
        __DEBUG("some thread already called doForeGC, ignore this call!");
        return true;
    }

    free_seg_num = 0;
    __DEBUG("Begin Fore GC !");
    while (!free_seg_num) {
        std::multimap < uint32_t, uint32_t > cands_map;
        vol_->SortSegsByUtils(cands_map, options_.seg_full_rate);
        if (cands_map.empty()) {
            break;
        }
        free_seg_num = doMerge(cands_map);
        cands_map.clear();
        __DEBUG("Once merge total free %d segments!", free_seg_num);
    }
    return free_seg_num ? true : false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
leaq 0x18(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x101fa
movq %rbx, (%rsp)
movq (%r14), %rdi
callq 0x20d3a
movb $0x1, %bpl
cmpl $0x2, %eax
ja 0x101e0
leaq 0x10(%rsp), %r13
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movl $0x0, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movq (%r14), %rdi
movq 0x10(%r14), %rax
movsd 0x20(%rax), %xmm0
movq %r15, %rsi
callq 0x20d4e
cmpq $0x0, 0x30(%rsp)
je 0x101d4
movq %r14, %rdi
movq %r15, %rsi
callq 0x10224
movl %eax, %r12d
movq %r15, %rdi
callq 0x10cdc
movq %r15, %rdi
callq 0x10c92
testl %r12d, %r12d
je 0x10177
jmp 0x101e0
leaq 0x8(%rsp), %rdi
callq 0x10c92
xorl %ebp, %ebp
movq (%rsp), %rdi
callq 0x6350
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
movq %rax, %r14
jmp 0x10213
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x10c92
movq (%rsp), %rdi
callq 0x6350
movq %r14, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/GcManager.cc
// Function: hlkvds::GcManager::FullGC()
void GcManager::FullGC() {
    std::unique_lock < std::mutex > lck_gc(gcMtx_, std::defer_lock);

    __DEBUG("Begin do Full GC!");
    uint32_t free_before = vol_->GetTotalFreeSegs();
    uint32_t free_after = 0;
    uint32_t used_total = 0;

    uint32_t seg_num = vol_->GetNumberOfSeg();
    uint32_t total_free = 0;
    uint64_t theory_size = 0;
    uint32_t free_seg_num = 0;
    uint32_t used_seg_num = 0;
    uint64_t used_size = 0;

    while (true) {
        lck_gc.lock();
        std::multimap < uint32_t, uint32_t > cands_map;
        vol_->SortSegsByUtils(cands_map, options_.seg_full_rate);
        if (cands_map.size() < SEG_RESERVED_FOR_GC) {
            free_after = vol_->GetTotalFreeSegs();
            used_total = vol_->GetNumberOfSeg() - free_after;
            __DEBUG("End do Full GC! befor have %u segment free, after do full GC now have %u segments free, now used %u segments!", free_before, free_after, used_total);
            break;
        }

        total_free = doMerge(cands_map);
        theory_size = idxMgr_->GetDataTheorySize();
        free_seg_num = vol_->GetTotalFreeSegs();
        used_seg_num = seg_num - free_seg_num;
        used_size = (uint64_t) vol_->GetSegmentSize()
                * (uint64_t) used_seg_num;

        __DEBUG("complete once merge, and this merge free %u segments, theory_size is %lu Byte, used Segments total is %u, occur space is %lu, total seg is %u, free seg is %u", total_free, theory_size, used_seg_num, used_size, seg_num, free_seg_num);
        cands_map.clear();
        lck_gc.unlock();
    } __DEBUG("End do Full GC! total free %u segments", free_after - free_before);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, (%rsp)
movb $0x0, 0x8(%rsp)
movq (%rdi), %rdi
callq 0x20d3a
leaq 0x18(%rsp), %r12
movq %rsp, %r14
xorl %r13d, %r13d
leaq 0x10(%rsp), %r15
movq %r14, %rdi
callq 0xe58e
movl $0x0, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq %r13, 0x38(%rsp)
movq (%rbx), %rdi
movq 0x10(%rbx), %rax
movsd 0x20(%rax), %xmm0
movq %r15, %rsi
callq 0x20d4e
cmpq $0x1, 0x38(%rsp)
jbe 0x1092b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x10224
movq 0x8(%rbx), %rdi
callq 0x11fd4
movq (%rbx), %rdi
callq 0x20d3a
movq %r15, %rdi
callq 0x10cdc
movq %r14, %rdi
callq 0xe5ca
movq %r15, %rdi
callq 0x10c92
jmp 0x108b5
movq (%rbx), %rdi
callq 0x20d3a
leaq 0x10(%rsp), %rdi
callq 0x10c92
movq %rsp, %rdi
callq 0xe10e
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x1095c
jmp 0x10957
movq %rax, %rbx
jmp 0x10969
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x10c92
movq %rsp, %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/GcManager.cc
// Function: hlkvds::GcManager::loadKvList(unsigned int, std::__cxx11::list<hlkvds::KVSlice*, std::allocator<hlkvds::KVSlice*>>&)
bool GcManager::loadKvList(uint32_t seg_id, std::list<KVSlice*> &slice_list) {
    uint64_t seg_phy_off;
    vol_->CalcSegOffsetFromId(seg_id, seg_phy_off);

    uint32_t seg_size = vol_->GetSegmentSize();
    if (!vol_->Read(dataBuf_, seg_size, seg_phy_off)) {
        return false;
    }

    SegHeaderOnDisk seg_header;
    memcpy(&seg_header, dataBuf_, SegBase::SizeOfSegOnDisk());

    uint32_t num_keys = seg_header.number_keys;

    loadSegKV(slice_list, num_keys, seg_phy_off);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
cmpl %esi, 0x3c(%rdi)
jbe 0x1099d
movl %esi, %r15d
movb 0x40(%rdi), %cl
shlq %cl, %r15
movl 0x38(%rdi), %edx
movq 0x40(%r14), %rsi
movq %r15, %rcx
callq 0x20cb0
movl %eax, %ebp
testb %al, %al
je 0x109ee
movq %rsp, %r12
movq %r12, %rdi
callq 0x1b740
movq 0x40(%r14), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0x10(%r12)
movaps %xmm0, (%r12)
movl 0x1c(%r12), %edx
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rcx
callq 0x10a72
movq %rsp, %rdi
callq 0x1b74c
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1b74c
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::HashEntry::~HashEntry()
HashEntry::~HashEntry() {
    cachePtr_ = NULL;
    if (entryPtr_) {
        delete entryPtr_;
    }
    if (stampPtr_) {
        delete stampPtr_;
    }
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, 0x10(%rdi)
movq (%rdi), %r14
testq %r14, %r14
je 0x111c1
movq %r14, %rdi
callq 0x10f66
movq %r14, %rdi
callq 0x63f0
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
je 0x111e1
movq %rbx, %rdi
callq 0x20a32
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x63f0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::HashEntry::operator=(hlkvds::HashEntry const&)
HashEntry& HashEntry::operator=(const HashEntry& toBeCopied) {
    *entryPtr_ = *toBeCopied.entryPtr_;
    *stampPtr_ = *toBeCopied.stampPtr_;
    cachePtr_ = toBeCopied.cachePtr_;
    return *this;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %r15
movq (%rdi), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x12d02
movl 0x1c(%r15), %eax
movl %eax, 0x1c(%r12)
movq 0x14(%r15), %rax
movq %rax, 0x14(%r12)
movq 0x20(%r15), %rax
movq %rax, 0x20(%r12)
movzwl 0x28(%r15), %eax
movw %ax, 0x28(%r12)
movq 0x8(%rbx), %r15
movq 0x8(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x209bc
movl 0x10(%r15), %eax
movl %eax, 0x10(%r12)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::IndexManager::InitMeta(unsigned int, unsigned long, unsigned long, unsigned int)
void IndexManager::InitMeta(uint32_t ht_size, uint64_t ondisk_size, uint64_t data_theory_size, uint32_t element_num) {
    htSize_ = ht_size;
    sizeOndisk_ = ondisk_size;
    initHashTable();

    //Set dataTheorySize
    dataTheorySize_ = data_theory_size;
    keyCounter_ = element_num;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdi, %r15
movl %esi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
callq 0x1135a
movq %r14, 0x20(%r15)
movl %ebx, 0x18(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::IndexManager::Get(char*, unsigned long)
bool IndexManager::Get(char* buff, uint64_t length) {
    if (length != sizeOndisk_) {
        return false;
    }
    char* buf_ptr = buff;

    //Copy TS
    int64_t time_len = KVTime::SizeOf();
    lastTime_->Update();
    time_t t = lastTime_->GetTime();
    memcpy((void *)buf_ptr, (const void*)&t, time_len);
    buf_ptr += time_len;
    __DEBUG("memcpy timestamp: %s at %p, at %ld", KVTime::ToChar(*lastTime_), (void *)buf_ptr, (int64_t)(buf_ptr-buff));

    //Copy Counter Table
    __DEBUG("memcpy Counter at %p, at %ld", (void *)buf_ptr, (int64_t)(buf_ptr-buff));
    for (uint32_t i = 0; i < htSize_; i++) {
        int counter = hashtable_[i].entryList_->get_size();
        memcpy((void *)buf_ptr, (const void*)&counter, sizeof(int));
        buf_ptr += sizeof(int);
    }

    //Copy Index
    __DEBUG("memcpy Index at %p, at %ld", (void *)buf_ptr, (int64_t)(buf_ptr-buff));
    uint64_t entry_len = IndexManager::SizeOfHashEntryOnDisk();
    for (uint32_t i = 0; i < htSize_; i++) {
        int slot_num = hashtable_[i].entryList_->get_size();
        if (slot_num > 0) {
            vector<HashEntry> tmp_vec = hashtable_[i].entryList_->get();
            for (vector<HashEntry>::iterator iter = tmp_vec.begin(); iter != tmp_vec.end(); iter++) {
                memcpy((void *)buf_ptr, (const void*)&(iter->GetEntryOnDisk()), entry_len);
                buf_ptr += entry_len;
            }
        }
    }

    __DEBUG("memcpy complete at %p, at %ld", (void *)buf_ptr, (int64_t)(buf_ptr-buff));

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rax
movq %rdx, 0x8(%rsp)
movq %rax, (%rsp)
cmpq %rdx, %rax
jne 0x1154a
movq %rsi, %r14
movq %rdi, %r15
movq 0x40(%rdi), %rdi
callq 0x209a4
movq 0x40(%r15), %rdi
callq 0x20998
movq %rax, (%r14)
cmpl $0x0, 0x8(%r15)
je 0x1154a
addq $0x8, %r14
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
movq (%r15), %rax
movq (%rax,%rdx), %rax
movl 0x8(%rax), %eax
movl %eax, (%r14,%rsi,4)
incq %rsi
movl 0x8(%r15), %eax
addq $0x30, %rdx
addq $0x4, %rcx
cmpq %rax, %rsi
jb 0x11484
testl %eax, %eax
je 0x1154a
addq %rcx, %r14
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
movq (%r15), %rcx
leaq (%rbx,%rbx,2), %rdx
shlq $0x4, %rdx
movq (%rcx,%rdx), %rsi
cmpl $0x0, 0x8(%rsi)
jle 0x1153c
movq %r12, %rdi
callq 0x122ea
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %rbp
cmpq %rbp, %r13
je 0x1152b
movq %r13, %rax
movq (%rax), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x1a(%rcx), %xmm2
movups %xmm2, 0x1a(%r14)
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
addq $0x2a, %r14
addq $0x18, %rax
cmpq %rbp, %rax
jne 0x114e7
cmpq %rbp, %r13
je 0x1152b
movq %r13, %rdi
callq 0x1119a
addq $0x18, %r13
cmpq %rbp, %r13
jne 0x11515
movq 0x10(%rsp), %r13
testq %r13, %r13
je 0x11538
movq %r13, %rdi
callq 0x63f0
movl 0x8(%r15), %eax
incq %rbx
movl %eax, %ecx
cmpq %rcx, %rbx
jb 0x114b8
movq (%rsp), %rax
cmpq 0x8(%rsp), %rax
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::IndexManager::IsSameInMem(hlkvds::HashEntry&)
bool IndexManager::IsSameInMem(HashEntry &entry)
{
    Kvdb_Digest digest = entry.GetKeyDigest();
    uint32_t hash_index = KeyDigestHandle::Hash(&digest) % htSize_;

    std::lock_guard<std::mutex> l(hashtable_[hash_index].slotMtx_);
    LinkedList<HashEntry> *entry_list = hashtable_[hash_index].entryList_;

    bool is_exist = entry_list->search(entry);
    if (!is_exist) {
        __DEBUG("Not Same, because entry is not exist!");
        return false;
    } else {
        HashEntry *entry_inMem = entry_list->getRef(entry);
        if (entry_inMem->GetHeaderAddress() == entry.GetHeaderAddress()) {
            __DEBUG("Same, because entry is same with in memory!");
            return true;
        }
    }

    __DEBUG("Not Same, because entry is not same with in memory!");
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rsi
leaq 0x1c(%rsp), %rbx
movq %rbx, %rdi
callq 0x12cf2
movq %rbx, %rdi
callq 0x12e82
xorl %edx, %edx
divl 0x8(%r15)
movq (%r15), %rax
leaq (%rdx,%rdx,2), %r12
shlq $0x4, %r12
leaq (%rax,%r12), %rbx
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x11b3b
movq (%r15), %rax
movq (%rax,%r12), %r12
movq (%r12), %r15
testq %r15, %r15
je 0x11abc
movq %r15, %rdi
movq %r14, %rsi
callq 0x111ea
testb %al, %al
jne 0x11ac0
movq 0x18(%r15), %r15
jmp 0x11aa2
xorl %ebp, %ebp
jmp 0x11b1a
movq %rsp, %rdi
movq %r14, %rsi
callq 0x11134
movq (%r12), %r15
testq %r15, %r15
je 0x11aef
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x111ea
testb %al, %al
jne 0x11af2
movq 0x18(%r15), %r15
testq %r15, %r15
jne 0x11ad7
xorl %r15d, %r15d
movq %rsp, %rdi
callq 0x1119a
movq (%r15), %rax
movq (%r14), %rcx
movzwl 0x20(%rax), %edx
cmpw 0x20(%rcx), %dx
sete %dl
movq 0x22(%rcx), %rcx
cmpq %rcx, 0x22(%rax)
sete %bpl
andb %dl, %bpl
movq %rbx, %rdi
callq 0x6350
leaq 0x1c(%rsp), %rdi
callq 0x12d00
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
jmp 0x11b58
jmp 0x11b46
movq %rax, %r14
jmp 0x11b63
movq %rax, %r14
movq %rsp, %rdi
callq 0x1119a
jmp 0x11b5b
movq %rax, %r14
movq %rbx, %rdi
callq 0x6350
leaq 0x1c(%rsp), %rdi
callq 0x12d00
movq %r14, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/IndexManager.cc
// Function: hlkvds::IndexManager::UpdateIndexes(std::__cxx11::list<hlkvds::KVSlice*, std::allocator<hlkvds::KVSlice*>>&)
void IndexManager::UpdateIndexes(list<KVSlice*> &slice_list) {
    std::lock_guard<std::mutex> l(batch_mtx_);
    for (list<KVSlice *>::iterator iter = slice_list.begin(); iter
            != slice_list.end(); iter++) {
        KVSlice *slice = *iter;
        UpdateIndex(slice);
    } __DEBUG("UpdateToIndex Success!");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x70(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x11bc4
movq %r14, %r12
movq (%r12), %r12
cmpq %r14, %r12
je 0x11bb1
movq 0x10(%r12), %rsi
movq %r15, %rdi
xorl %edx, %edx
callq 0x116fe
jmp 0x11b97
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6350
movl %eax, %edi
callq 0x62b0
movq %rax, %r14
movq %rbx, %rdi
callq 0x6350
movq %r14, %rdi
callq 0x6670