LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::deleteAllSegments()
void DS_MultiVolume_Impl::deleteAllSegments() {
    std::unique_lock<std::mutex> lck_seg_map(segMapMtx_);
    for (int i = 0; i< shardsNum_; i++) {
        SegForReq* seg = segMap_[i];
        delete seg;
        std::mutex *seg_mtx = segMtxVec_[i];
        delete seg_mtx;
    }
    segMap_.clear();
    segMtxVec_.clear();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x60(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0xe40a
movb $0x1, 0x8(%r14)
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x58(%rbx)
jle 0xc3b4
leaq 0x88(%rbx), %r14
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xe3a6
movq (%rax), %r12
testq %r12, %r12
je 0xc38b
movq %r12, %rdi
callq 0x1c3c6
movq %r12, %rdi
callq 0x6400
movslq 0x4(%rsp), %rax
movq 0xb8(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0xc3a5
callq 0x6400
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
cmpl 0x58(%rbx), %eax
jl 0xc368
leaq 0x88(%rbx), %rdi
callq 0xfc78
movq 0xb8(%rbx), %rax
cmpq %rax, 0xc0(%rbx)
je 0xc3d7
movq %rax, 0xc0(%rbx)
leaq 0x8(%rsp), %rdi
callq 0xdf86
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xdf86
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::InitSegmentBuffer()
void DS_MultiVolume_Impl::InitSegmentBuffer() {
    std::unique_lock<std::mutex> lck_seg_map(segMapMtx_);
    for (int i = 0; i < shardsNum_; i++) {
        int vol_id = pickVol();
        SegForReq * seg = new SegForReq(volMap_[vol_id], idxMgr_, options_.expired_time);
        segMap_.insert(make_pair(i, seg));

        std::mutex *seg_mtx = new mutex();
        segMtxVec_.push_back(seg_mtx);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x60(%rdi), %rax
leaq 0x28(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0xe40a
movb $0x1, 0x8(%r14)
cmpl $0x0, 0x58(%rbx)
jle 0xc575
leaq 0x28(%rbx), %r14
leaq 0x88(%rbx), %r15
leaq 0xb8(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x18(%rsp), %rbp
movq %rbx, %rdi
callq 0xc5b6
movl %eax, 0xc(%rsp)
movl $0xd8, %edi
callq 0x6420
movq %rax, %r12
movq %r14, %rdi
leaq 0xc(%rsp), %rsi
callq 0xdf22
movq (%rax), %rsi
movq 0x8(%rbx), %rax
movq 0x20(%rbx), %rdx
movl 0x10(%rax), %ecx
movq %r12, %rdi
callq 0x1c56c
movl %r13d, 0x18(%rsp)
movq %r12, 0x20(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0xebc0
movl $0x28, %edi
callq 0x6420
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rax, 0x18(%rsp)
movq 0xc0(%rbx), %rsi
cmpq 0xc8(%rbx), %rsi
je 0xc55b
movq %rax, (%rsi)
addq $0x8, 0xc0(%rbx)
jmp 0xc568
movq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0xecfe
incl %r13d
cmpl 0x58(%rbx), %r13d
jl 0xc4cc
leaq 0x28(%rsp), %rdi
callq 0xdf86
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc594
jmp 0xc594
jmp 0xc594
movq %rax, %rbx
jmp 0xc5a4
movq %rax, %rbx
movq %r12, %rdi
callq 0x6400
leaq 0x28(%rsp), %rdi
callq 0xdf86
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::pickVol()
int DS_MultiVolume_Impl::pickVol() {
    std::lock_guard <std::mutex> l(volIdMtx_);
    if ( pickVolId_ == (int)(volNum_ - 1) ){
        pickVolId_ = 0;
    }
    else {
        pickVolId_++;
    }
    return pickVolId_;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0xf8(%rdi), %rbx
movq %rbx, %rdi
callq 0x6590
testl %eax, %eax
jne 0xc600
movl 0xe0(%r14), %eax
movl 0xf0(%r14), %ecx
decl %eax
leal 0x1(%rcx), %edx
xorl %ebp, %ebp
cmpl %eax, %ecx
cmovnel %edx, %ebp
movl %ebp, 0xf0(%r14)
movq %rbx, %rdi
callq 0x6360
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %eax, %edi
callq 0x62c0
nop
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::StopThds()
void DS_MultiVolume_Impl::StopThds() {
    for (uint32_t i = 0; i < volNum_; i++) {
        volMap_[i]->StopThds();
    }

    segTimeoutT_stop_.store(true);
    segTimeoutT_.join();

    for (int i = 0; i < shardsNum_; i++) {
        ReqsMergeWQ *req_wq = reqWQVec_[i];
        req_wq->Stop();
        delete req_wq;
    }
    reqWQVec_.clear();

    if (segWteWQ_) {
        segWteWQ_->Stop();
        delete segWteWQ_;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0xe0(%rdi)
je 0xcaa5
leaq 0x28(%rbx), %r14
xorl %ebp, %ebp
leaq 0x4(%rsp), %r15
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xe16e
movq (%rax), %rdi
callq 0x20cd4
incl %ebp
cmpl 0xe0(%rbx), %ebp
jb 0xca84
movb $0x1, %al
xchgb %al, 0x168(%rbx)
leaq 0x160(%rbx), %rdi
callq 0x6660
cmpl $0x0, 0x58(%rbx)
jle 0xcaea
xorl %r15d, %r15d
movq 0x140(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0xe1d2
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
incq %r15
movslq 0x58(%rbx), %rax
cmpq %rax, %r15
jl 0xcac2
movq 0x140(%rbx), %rax
cmpq %rax, 0x148(%rbx)
je 0xcb01
movq %rax, 0x148(%rbx)
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
je 0xcb24
callq 0xe216
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
je 0xcb24
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::WriteData(hlkvds::KVSlice&, bool)
Status DS_MultiVolume_Impl::WriteData(KVSlice& slice, bool immediately) {
    if (slice.GetDataLen() > maxValueLen_) {
        return Status::NotSupported("Data length cann't be longer than max segment size");
    }

    if (options_.aggregate_request == 1 && !immediately) {
        return writeDataAggregate(slice);
    }
    else {
        return writeDataImmediately(slice);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzwl 0x18(%rdx), %eax
cmpl %eax, 0xdc(%rsi)
jae 0xcbb4
leaq 0x1590f(%rip), %rdx     # 0x224b4
movq %rbx, %rdi
movl $0x3, %esi
callq 0x1de18
jmp 0xcbd0
movq 0x8(%rsi), %rax
movb 0x38(%rax), %al
xorb $0x1, %al
movq %rbx, %rdi
orb %cl, %al
je 0xcbcb
callq 0xcc72
jmp 0xcbd0
callq 0xcbd6
movq %rbx, %rax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::writeDataAggregate(hlkvds::KVSlice&)
Status DS_MultiVolume_Impl::writeDataAggregate(KVSlice& slice) {

    Request *req = new Request(slice);

    int shards_id = calcShardId(slice);
    req->SetShardsWQId(shards_id);
    ReqsMergeWQ *req_wq = reqWQVec_[shards_id];
    req_wq->Add_task(req);

    req->Wait();
    Status s = updateMeta(req);
    delete req;
    return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movl $0x78, %edi
callq 0x6420
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
callq 0x1bbde
movq 0x20(%r12), %rdi
callq 0x12d5e
xorl %edx, %edx
divl 0x58(%r15)
movl %edx, 0x70(%r14)
movslq %edx, %rax
movq 0x140(%r15), %rcx
movq (%rcx,%rax,8), %rdi
movq %r14, %rsi
callq 0xe25a
movq %r14, %rdi
callq 0x1bc50
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xdbe4
movq %r14, %rdi
callq 0x1bb6e
movq %r14, %rdi
callq 0x6400
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x6400
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::writeDataImmediately(hlkvds::KVSlice&)
Status DS_MultiVolume_Impl::writeDataImmediately(KVSlice& slice) {
    uint32_t seg_id = 0;
    bool ret = false;

    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.");
        }
    }

    SegLatencyFriendly *seg = new SegLatencyFriendly(vol, idxMgr_);
    seg->Put(&slice);
    seg->SegSegId(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 0xc5b6
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x28(%r13), %rdi
callq 0xdf22
movq (%rax), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x20ce2
testb %al, %al
jne 0xccd5
movq %r14, %rdi
callq 0x20dda
testb %al, %al
jne 0xccb0
movq %rbx, %rdi
callq 0x6b8d
jmp 0xcd50
movl $0x48, %edi
callq 0x6420
movq %rax, %r12
movq 0x20(%r13), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1cb78
movq %r12, %rdi
movq %r15, %rsi
callq 0x1cbca
movl 0x8(%rsp), %eax
movl %eax, 0x10(%r12)
movq %r12, %rdi
callq 0x1cc8c
testb %al, %al
je 0xcd61
movl 0x14(%r12), %edx
subl 0x20(%r12), %edx
addl $-0x20, %edx
movl 0x8(%rsp), %esi
movq %r14, %rdi
callq 0x20dd0
movq %r12, %rdi
callq 0x1cf78
movq %r12, %rdi
callq 0x1caf4
movq %r12, %rdi
callq 0x6400
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 0x6c04
jmp 0xcd50
movq %rax, %rbx
movq %r12, %rdi
callq 0x6400
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc5b6
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x28(%r13), %rdi
callq 0xdf22
movq (%rax), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x20ce2
testb %al, %al
jne 0xcdf0
movq %r14, %rdi
callq 0x20dda
testb %al, %al
jne 0xcdc8
movq %rbx, %rdi
callq 0x6cb2
jmp 0xce8a
movl $0x50, %edi
callq 0x6420
movq %rax, %r12
movq 0x20(%r13), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1c9e0
movq (%r15), %r13
cmpq %r15, %r13
je 0xce3a
movq 0x10(%r13), %rsi
movq %r12, %rdi
callq 0x1be30
testb %al, %al
je 0xceb0
movq 0x10(%r13), %rsi
movq %r12, %rdi
callq 0x1be4a
movq (%r13), %r13
jmp 0xce0f
movl 0x8(%rsp), %eax
movl %eax, (%r12)
movq %r12, %rdi
callq 0x1bf16
testb %al, %al
je 0xce9b
movl 0x18(%r12), %edx
subl 0x14(%r12), %edx
movl 0x8(%rsp), %esi
movq %r14, %rdi
callq 0x20dd0
movq %r12, %rdi
callq 0x1ca1a
movq %r12, %rdi
callq 0x1bd18
movq %r12, %rdi
callq 0x6400
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 0x6dbd
jmp 0xce8a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6d27
jmp 0xce8a
movq %rax, %rbx
movq %r12, %rdi
callq 0x6400
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdf22
movq (%rax), %r13
movq %rsp, %rdx
movq $0x0, (%rdx)
movq %r13, %rdi
movq %r15, %rsi
callq 0x20e14
testb %al, %al
je 0xcf77
movq (%r15), %rax
movzwl 0x16(%rax), %r15d
testq %r15, %r15
je 0xcf88
movq %r15, %rdi
callq 0x6040
movq %rax, %r12
movq (%rsp), %rcx
movq %r13, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x20d00
testb %al, %al
je 0xcfad
movq 0x8(%r14), %rdx
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
movq %r15, %r8
callq 0x65e0
movq %r12, %rdi
callq 0x64e0
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
jmp 0xcf9c
leaq 0x1564c(%rip), %rdx     # 0x225ca
movq %rbx, %rdi
movl $0x7, %esi
jmp 0xcf97
leaq 0x15659(%rip), %rdx     # 0x225e8
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1de18
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6e6b
jmp 0xcf9c
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd03e
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x6260
movq 0x120(%r15), %rax
movq %rax, (%r14)
movl 0x124(%r15), %r12d
movq %r15, %rdi
callq 0xd052
testq %r12, %r12
je 0xd03e
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 0x6390
addq $0x108, %r13            # imm = 0x108
cmpq %r13, %r12
jne 0xd01a
cmpq $0xfc3, %rbx            # imm = 0xFC3
sete %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd15c
movq %rsi, %r14
movq %rdi, %r15
movq (%rsi), %rax
movq %rax, 0x120(%rdi)
movl 0x124(%rdi), %ebp
testl %ebp, %ebp
je 0xd15c
addq $0x8, %r14
leaq 0x128(%r15), %r12
movq %rsp, %r13
movl $0x108, %edx            # imm = 0x108
movq %r13, %rdi
movq %r14, %rsi
callq 0x6390
movq 0x130(%r15), %rsi
cmpq 0x138(%r15), %rsi
je 0xd146
movl $0x108, %edx            # imm = 0x108
movq %rsi, %rdi
movq %r14, %rsi
callq 0x6610
addq $0x108, 0x130(%r15) # imm = 0x108
jmp 0xd151
movq %r12, %rdi
movq %r13, %rdx
callq 0xf6bc
addq $0x108, %r14            # imm = 0x108
decl %ebp
jne 0xd109
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_O1/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 0xd225
movq 0xd0(%r14), %rdi
callq 0x209ec
movq 0xd0(%r14), %rdi
callq 0x209e0
movq %rax, (%rbx)
cmpl $0x0, 0xe0(%r14)
sete %bpl
je 0xd227
addq $0x8, %rbx
leaq 0x28(%r14), %r15
xorl %r13d, %r13d
movl %r13d, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe16e
movq (%rax), %rdi
callq 0x20d7e
movq %rax, %r12
movl %r13d, (%rsp)
movq %r15, %rdi
movq %rsp, %rsi
callq 0xe16e
movq (%rax), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x20cec
testb %al, %al
je 0xd227
addq %r12, %rbx
incl %r13d
cmpl 0xe0(%r14), %r13d
setae %bpl
jb 0xd1d2
jmp 0xd227
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd2d9
movq (%rbx), %rsi
movq 0xd0(%r14), %rdi
callq 0x209d4
cmpl $0x0, 0xe0(%r14)
sete %bpl
je 0xd2db
addq $0x8, %rbx
leaq 0x28(%r14), %r15
xorl %r13d, %r13d
movl %r13d, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe16e
movq (%rax), %rdi
callq 0x20d7e
movq %rax, %r12
movl %r13d, (%rsp)
movq %r15, %rdi
movq %rsp, %rsi
callq 0xe16e
movq (%rax), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x20cf6
testb %al, %al
je 0xd2db
addq %r12, %rbx
incl %r13d
cmpl 0xe0(%r14), %r13d
setae %bpl
jb 0xd286
jmp 0xd2db
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x66b0
movslq %eax, %r12
cvtsi2sd %r13, %xmm0
callq 0x6690
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 0xd52c
movl %esi, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd6bc
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 0x6260
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xe16e
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x20d6c
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x6390
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xe16e
movq (%rax), %rax
movl 0x3c(%rax), %eax
movl %eax, 0x130(%rsp)
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xe16e
movq (%rax), %rdi
callq 0x20d64
movl %eax, 0x134(%rsp)
movq 0x130(%rbx), %rsi
cmpq 0x138(%rbx), %rsi
je 0xd68b
movl $0x108, %edx            # imm = 0x108
movq %rsi, %rdi
movq %r12, %rsi
callq 0x6390
addq $0x108, 0x130(%rbx) # imm = 0x108
jmp 0xd698
movq 0x8(%rsp), %rdi
movq %r12, %rdx
callq 0xf6bc
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xd6ac
callq 0x6400
incl %r15d
cmpl 0xe0(%rbx), %r15d
jb 0xd5e6
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd6d2
jmp 0xd6d2
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xd6e9
callq 0x6400
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O1/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), %eax
movq 0x10(%rdi), %rcx
movq 0x8(%rcx), %rdx
subq (%rcx), %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jne 0xd9a8
movq %rdi, %rbx
cmpl $0x0, 0xe0(%rdi)
sete %bpl
je 0xd9aa
leaq 0x18(%rsp), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x128(%rbx), %rax
leaq (%rax,%r15), %r13
movq %r14, 0x8(%rsp)
testq %rax, %rax
je 0xd91a
movq %r13, %rdi
callq 0x61a0
movq %rax, %rdx
addq %r13, %rdx
jmp 0xd91f
movl $0x1, %edx
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xa6dc
movq 0x10(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rsi
movq (%rsi), %rax
leaq 0x28(%rsp), %rdi
callq *0x28(%rax)
movq 0x10(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0xd9bf
testq %rdx, %rdx
je 0xd966
movq 0x28(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x6430
testl %eax, %eax
jne 0xd9bf
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xd97a
callq 0x6400
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xd989
callq 0x6400
incq %r12
movl 0xe0(%rbx), %eax
addq $0x108, %r15            # imm = 0x108
cmpq %rax, %r12
setae %bpl
jb 0xd8f5
jmp 0xd9aa
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x6fbd
jmp 0xd9aa
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0xd9e5
callq 0x6400
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdf22
movq (%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20e3e
testb %al, %al
je 0xdabe
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 0x20d00
testb %al, %al
je 0xdae6
movq %r14, %rdx
addq %r12, %rdx
movb $0x0, (%r14,%r12)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa6dc
movq %r14, %rdi
callq 0x64e0
jmp 0xdad7
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x15120(%rip), %rdx     # 0x22bec
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa6dc
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7053
jmp 0xdad7
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdf22
movq (%rax), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x20e14
testb %al, %al
je 0xdb99
movq (%r14), %rax
movzwl 0x16(%rax), %r12d
testq %r12, %r12
je 0xdb99
leaq 0x1(%r12), %rdi
callq 0x6040
movq %rax, %r14
movq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x20d00
testb %al, %al
je 0xdbc1
movq %r14, %rdx
addq %r12, %rdx
movb $0x0, (%r14,%r12)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xa6dc
movq %r14, %rdi
callq 0x64e0
jmp 0xdbb2
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x15045(%rip), %rdx     # 0x22bec
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa6dc
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x70e8
jmp 0xdbb2
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdc2a
movq %rdx, %r15
movq %rsi, %r14
movq 0x8(%rdx), %rsi
movq 0x20(%r14), %rdi
xorl %edx, %edx
callq 0x115cc
movq 0x68(%r15), %rsi
lock
decl 0x7c(%rsi)
jne 0xdc1a
movq 0x20(%r14), %rdi
callq 0x1216e
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
jmp 0xdc3e
leaq 0x14aa9(%rip), %rdx     # 0x226da
movq %rbx, %rdi
movl $0x7, %esi
callq 0x1de18
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xdc96
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 0xe16e
movq (%rax), %rdi
callq 0x20d8a
addl %eax, %ebp
incl %r12d
cmpl 0xe0(%rbx), %r12d
jb 0xdc6e
jmp 0xdc98
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_O1/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 0xe40a
movb $0x1, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
callq 0xe40a
leaq 0x88(%r14), %r15
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
callq 0xe3a6
movq (%rax), %r12
leaq 0x10(%rsp), %rdi
callq 0xe446
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1c656
testb %al, %al
je 0xdd3a
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1c67c
jmp 0xde13
movq %r12, %rdi
callq 0x1c6dc
movq 0x158(%r14), %rdi
movq %r12, %rsi
callq 0xe46e
movq %r14, %rdi
callq 0xc5b6
movl %eax, 0x24(%rsp)
movl $0xd8, %edi
callq 0x6420
movq %rax, %r12
leaq 0x28(%r14), %rdi
leaq 0x24(%rsp), %rsi
callq 0xdf22
movq (%rax), %rsi
movq 0x8(%r14), %rax
movq 0x20(%r14), %rdx
movl 0x10(%rax), %ecx
movq %r12, %rdi
callq 0x1c56c
leaq 0x10(%rsp), %rdi
callq 0xe40a
movq 0x98(%r14), %rcx
addq $0x90, %r14
movq %r14, %rax
testq %rcx, %rcx
je 0xddcc
movl 0xc(%rsp), %edx
movq %r14, %rax
xorl %esi, %esi
cmpl %edx, 0x20(%rcx)
setl %sil
cmovgeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0xddb5
cmpq %r14, %rax
je 0xdddc
movl 0xc(%rsp), %ecx
cmpl 0x20(%rax), %ecx
cmovgeq %rax, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xfe9e
movl 0xc(%rsp), %eax
leaq 0x38(%rsp), %rsi
movl %eax, (%rsi)
movq %r12, 0x8(%rsi)
movq %r15, %rdi
callq 0xebc0
leaq 0x10(%rsp), %rdi
callq 0xe446
movq %r12, %rdi
movq %rbx, %rsi
callq 0x1c67c
leaq 0x28(%rsp), %rdi
callq 0xdf86
leaq 0x10(%rsp), %rdi
callq 0xdf86
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0xde4d
movq %rax, %rbx
movq %r12, %rdi
callq 0x6400
jmp 0xde50
jmp 0xde4d
movq %rax, %rbx
jmp 0xde5a
jmp 0xde4d
jmp 0xde4d
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xdf86
leaq 0x10(%rsp), %rdi
callq 0xdf86
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O1/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 0x20ce2
testb %al, %al
je 0xdec6
movl 0x14(%rbx), %r12d
movl 0x18(%rbx), %r15d
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movq %rbx, %rdi
callq 0x1bf16
movl %eax, %ebp
testb %al, %al
je 0xdef2
subl %r12d, %r15d
movl 0xc(%rsp), %esi
movq %r14, %rdi
movl %r15d, %edx
callq 0x20dd0
jmp 0xdefe
leaq 0xc(%rsp), %r15
movq %r14, %rdi
callq 0x20dda
testb %al, %al
je 0xdee8
movq %r14, %rdi
movq %r15, %rsi
callq 0x20ce2
testb %al, %al
je 0xdecb
jmp 0xde96
movq %rbx, %rdi
callq 0x717d
jmp 0xded7
movl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0x20dbc
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x1c6e8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6650
movq 0xb0(%r14), %rbx
movq 0xb8(%r14), %r14
cmpq %r14, %rbx
je 0xe20e
movq %rbx, %rdi
callq 0x6660
addq $0x8, %rbx
jmp 0xe1fb
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xe40a
movq $0x3e8, 0x10(%rsp)      # imm = 0x3E8
movq %r14, %rdi
movq %r12, %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rcx
callq 0xf122
movb 0xcc(%rbx), %al
testb $0x1, %al
je 0xee98
movq 0x38(%rbx), %rax
cmpq 0x18(%rbx), %rax
je 0xeed5
movq 0x18(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0xeec3
movq (%rax), %rbp
movq %r15, %rdi
callq 0xf1ee
movq %r12, %rdi
callq 0xe446
movq (%rbx), %rax
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x10(%rax)
jmp 0xeecb
movq %r12, %rdi
callq 0xe446
movq %r12, %rdi
callq 0xdf86
jmp 0xee57
movq %rsp, %rdi
callq 0xe446
movq %rsp, %rdi
callq 0xdf86
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xeefa
jmp 0xeefa
jmp 0xeefa
movq %rax, %rbx
movq %rsp, %rdi
callq 0xdf86
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xff1b
testl %r8d, %r8d
jne 0xff49
movl $0x170, %edi            # imm = 0x170
callq 0x6420
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xc128
jmp 0xff3c
movl $0x48, %edi
callq 0x6420
movq %rax, %rbx
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xbb68
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x7260
xorl %ebx, %ebx
jmp 0xff3c
jmp 0xff54
movq %rax, %r14
movq %rbx, %rdi
callq 0x6400
movq %r14, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O1/yangwanyuan[P]HLKVDS/src/GcManager.cc
// Function: hlkvds::GcManager::GcManager(hlkvds::IndexManager*, hlkvds::Volume*, hlkvds::Options&)
GcManager::GcManager(IndexManager* im, Volume* vol, Options &opt) :
    options_(opt), dataBuf_(NULL) {
    idxMgr_ = im;
    vol_ = vol;

    uint32_t seg_size = vol_->GetSegmentSize();
    posix_memalign((void **)&dataBuf_, 4096, seg_size);
}

// Assembly:
movq %rcx, 0x10(%rdi)
leaq 0x40(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rdi)
movups %xmm0, 0x28(%rdi)
movups %xmm0, 0x38(%rdi)
movq %rsi, 0x8(%rdi)
movq %rdx, (%rdi)
movl 0x38(%rdx), %edx
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
jmp 0x6200
// File: /workspace/github_cpp_makefile_star2_O1/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 0x6590
testl %eax, %eax
jne 0x10079
movq (%r14), %rdi
callq 0x20d8a
movb $0x1, %bpl
cmpl $0x2, %eax
ja 0x10060
movq %rbx, (%rsp)
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0x8(%rsp), %r15
xorl %ebp, %ebp
testl %ebp, %ebp
jne 0x10056
movl $0x0, 0x10(%rsp)
movq %r12, 0x18(%rsp)
movq %r13, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movq %r12, 0x30(%rsp)
movq (%r14), %rdi
movq 0x10(%r14), %rax
movsd 0x20(%rax), %xmm0
movq %r15, %rsi
callq 0x20d9e
movq 0x30(%rsp), %rbx
testq %rbx, %rbx
je 0x10049
movq %r14, %rdi
movq %r15, %rsi
callq 0x100a8
movl %eax, %ebp
movq %r15, %rdi
callq 0x10ba8
movq %r15, %rdi
callq 0x10b5e
testq %rbx, %rbx
jne 0xfff6
testl %ebp, %ebp
setne %bpl
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x6360
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62c0
movq %rbx, (%rsp)
movq %rax, %r14
jmp 0x10096
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x10b5e
movq (%rsp), %rdi
callq 0x6360
movq %r14, %rdi
callq 0x6680
nop