LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::Notify(bool)
void SegForReq::Notify(bool stat) {
    std::lock_guard < std::mutex > l(mtx_);

    //Set logic timestamp to hashentry
    reqCommited_.store(GetKeyNum());

    int32_t keyNo = 0;
    persistTime_.Update();
    for (list<Request *>::iterator iter = reqList_.begin(); iter
            != reqList_.end(); iter++) {
        keyNo++;
        KVSlice *slice = &(*iter)->GetSlice();
        HashEntry &entry = slice->GetHashEntry();
        entry.SetLogicStamp(persistTime_, keyNo);

        if (!slice->GetData()) {
            delReqList_.push_back(entry);
        }
    }

    //notify and clean req.
    while (!reqList_.empty()) {
        Request *req = reqList_.front();
        reqList_.pop_front();
        req->SetWriteStat(stat);
        req->Signal();
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
leaq 0x98(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1c844
movq %rbx, 0x10(%rsp)
movl 0x1c(%r14), %eax
xchgl %eax, 0x7c(%r14)
leaq 0x68(%r14), %rdi
movq %rdi, 0x20(%rsp)
callq 0x209a4
leaq 0x80(%r14), %rbp
movq %r14, (%rsp)
movq 0x80(%r14), %r15
cmpq %rbp, %r15
je 0x1c822
movq (%rsp), %rax
addq $0xc0, %rax
movq %rax, 0x18(%rsp)
movl $0x1, %r13d
leaq 0x28(%rsp), %rbx
movq 0x10(%r15), %rax
movq 0x8(%rax), %r14
movq 0x28(%r14), %r12
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x209b4
movq %r12, %rdi
movq %rbx, %rsi
movl %r13d, %edx
callq 0x112de
movq %rbx, %rdi
callq 0x20a32
cmpq $0x0, 0x10(%r14)
jne 0x1c7e1
movq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x1d4b6
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x6080
movq (%rsp), %rax
incq 0xd0(%rax)
movq (%r15), %r15
incl %r13d
cmpq %rbp, %r15
jne 0x1c786
jmp 0x1c822
movq 0x10(%r15), %rbx
movq (%rsp), %rax
decq 0x90(%rax)
movq %r15, %rdi
callq 0x6610
movq %r15, %rdi
callq 0x63f0
movzbl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x1bc46
movq %rbx, %rdi
callq 0x1bcd2
movq (%rbp), %r15
cmpq %rbp, %r15
jne 0x1c7ee
movq 0x10(%rsp), %rdi
callq 0x6350
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
jmp 0x1c85e
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x20a32
jmp 0x1c861
jmp 0x1c85e
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x6350
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::IsExpired()
bool SegForReq::IsExpired() {
    KVTime nowTime;
    if (!hasReq_) {
        return false;
    }
    int64_t interval = nowTime - startTime_;
    return (interval > timeout_);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x209ac
cmpb $0x1, 0x79(%rbx)
jne 0x1c8a1
leaq 0x58(%rbx), %rsi
movq %rsp, %rdi
callq 0x20a18
movl 0x50(%rbx), %ecx
cmpq %rcx, %rax
setg %bl
jmp 0x1c8a3
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x20a32
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20a32
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForReq::CleanDeletedEntry()
void SegForReq::CleanDeletedEntry() {
    std::lock_guard < std::mutex > l(mtx_);
    for (list<HashEntry>::iterator iter = delReqList_.begin(); iter
            != delReqList_.end(); iter++) {
        idxMgr_->RemoveEntry(*iter);
    }
    delReqList_.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x98(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1c964
leaq 0xc0(%r14), %r15
movq 0xc0(%r14), %rbp
cmpq %r15, %rbp
je 0x1c92c
movq %rsp, %r12
movq 0x48(%r14), %r13
leaq 0x10(%rbp), %rsi
movq %r12, %rdi
callq 0x11134
movq %r13, %rdi
movq %r12, %rsi
callq 0x11bde
movq %r12, %rdi
callq 0x1119a
movq (%rbp), %rbp
cmpq %r15, %rbp
jne 0x1c900
movq %r15, %rdi
callq 0x1cfa2
movq %r15, 0xc8(%r14)
movq %r15, 0xc0(%r14)
movq $0x0, 0xd0(%r14)
movq %rbx, %rdi
callq 0x6350
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
movq %rax, %r14
jmp 0x1c97b
movq %rax, %r14
movq %rsp, %rdi
callq 0x1119a
movq %rbx, %rdi
callq 0x6350
movq %r14, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForSlice::operator=(hlkvds::SegForSlice const&)
SegForSlice& SegForSlice::operator=(const SegForSlice& toBeCopied) {
    if (this == &toBeCopied) {
        return *this;
    }
    SegBase::operator=(toBeCopied);
    idxMgr_ = toBeCopied.idxMgr_;
    return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x1c9f7
movq %rsi, %r14
movq %rbx, %rdi
callq 0x1bdb8
movq 0x48(%r14), %rax
movq %rax, 0x48(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegForMigrate::operator=(hlkvds::SegForMigrate const&)
SegForMigrate& SegForMigrate::operator=(const SegForMigrate& toBeCopied) {
    if (this == &toBeCopied) {
        return *this;
    }
    SegBase::operator=(toBeCopied);
    idxMgr_ = toBeCopied.idxMgr_;
    return *this;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x1ca97
movq %rsi, %r14
movq %rbx, %rdi
callq 0x1bdb8
movq 0x48(%r14), %rax
movq %rax, 0x48(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::Put(hlkvds::KVSlice*)
void SegLatencyFriendly::Put(KVSlice* slice) {
    headPos_ += IndexManager::SizeOfDataHeader() + slice->GetKeyLen() + slice->GetDataLen();
    keyNum_++;
    sliceList_.push_back(slice);
    __DEBUG("Put request key = %s", slice->GetKeyStr().c_str());
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x8(%rsi), %eax
movzwl 0x18(%rsi), %ecx
leal 0x20(%rax,%rcx), %eax
movd %eax, %xmm0
movq 0x18(%rdi), %xmm1
movaps 0x740d(%rip), %xmm2     # 0x24020
movss %xmm0, %xmm2            # xmm2 = xmm0[0],xmm2[1,2,3]
paddd %xmm1, %xmm2
movq %xmm2, 0x18(%rdi)
leaq 0x28(%rdi), %r15
movl $0x18, %edi
callq 0x6410
movq %rbx, 0x10(%rax)
movq %rax, %rdi
movq %r15, %rsi
callq 0x6080
incq 0x38(%r14)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::TryPutList(std::__cxx11::list<hlkvds::KVSlice*, std::allocator<hlkvds::KVSlice*>>&)
bool SegLatencyFriendly::TryPutList(std::list<KVSlice*> &slice_list) {
    uint32_t free_size = segSize_ - headPos_;
    uint32_t need_size = 0;
    for (list<KVSlice *>::iterator iter = slice_list.begin(); iter != slice_list.end(); iter++) {
        KVSlice *slice = *iter;
        need_size += slice->GetDataLen() + slice->GetKeyLen() + IndexManager::SizeOfDataHeader();
    }
    return free_size > need_size;
}

// Assembly:
movl 0x14(%rdi), %eax
movl 0x18(%rdi), %ecx
movq (%rsi), %rdi
xorl %edx, %edx
cmpq %rsi, %rdi
je 0x1cc78
movq 0x10(%rdi), %r8
movq (%rdi), %r9
movzwl 0x18(%r8), %edi
addl %edx, %edi
movzwl 0x8(%r8), %edx
addl %edi, %edx
addl $0x20, %edx
movq %r9, %rdi
cmpq %rsi, %r9
jne 0x1cc58
subl %ecx, %eax
cmpl %edx, %eax
seta %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::fillEntryToSlice()
void SegLatencyFriendly::fillEntryToSlice() {
    uint32_t head_pos = SegBase::SizeOfSegOnDisk();
    int vol_id = vol_->GetId();

    for (list<KVSlice *>::iterator iter = sliceList_.begin(); iter
            != sliceList_.end(); iter++) {
        KVSlice *slice = *iter;
        slice->SetSegId(segId_);

        uint32_t data_offset = head_pos + IndexManager::SizeOfDataHeader() + slice->GetKeyLen();
        uint32_t next_offset = head_pos + IndexManager::SizeOfDataHeader() + slice->GetKeyLen() + slice->GetDataLen();
        DataHeader data_header(slice->GetDigest(), slice->GetKeyLen(), slice->GetDataLen(),
                               data_offset, next_offset);
        uint64_t seg_offset = 0;
        vol_->CalcSegOffsetFromId(segId_, seg_offset);
        uint64_t header_offset = seg_offset + head_pos;

        DataHeaderAddress addrs(vol_id, header_offset);
        HashEntry hash_entry(data_header, addrs, NULL);
        slice->SetHashEntry(&hash_entry);

        head_pos += IndexManager::SizeOfDataHeader() + slice->GetKeyLen() + slice->GetDataLen();
        __DEBUG("SegmentSlice: key=%s, data_offset=%u, header_offset=%lu, seg_id=%u, head_pos=%u", slice->GetKey(), data_offset, header_offset, segId_, head_pos);
    }

    if (head_pos != headPos_ ) {
        __ERROR("Segment fillEntryToSlice  Failed!!! head_pos= %u, headPos_=%u", head_pos, headPos_);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq 0x28(%rdi), %r12
movq %rax, 0x18(%rsp)
cmpq %rax, %r12
je 0x1cdc4
movq (%rbx), %rax
movzwl 0x28(%rax), %eax
movw %ax, 0xc(%rsp)
movl $0x20, %r13d
leaq 0x38(%rsp), %r14
leaq 0x20(%rsp), %r15
movq 0x10(%r12), %rbp
movl 0x10(%rbx), %eax
movl %eax, 0x30(%rbp)
movzwl 0x8(%rbp), %edx
leal (%rdx,%r13), %eax
leal 0x20(%r13,%rdx), %r8d
movzwl 0x18(%rbp), %ecx
leal 0x20(%rcx,%rax), %r9d
movq 0x20(%rbp), %rsi
movq %r14, %rdi
callq 0x10e5a
movq (%rbx), %rcx
movl 0x10(%rbx), %eax
cmpl %eax, 0x3c(%rcx)
jbe 0x1cd53
movb 0x40(%rcx), %cl
shlq %cl, %rax
jmp 0x1cd55
xorl %eax, %eax
movl %r13d, %r13d
addq %r13, %rax
movzwl 0xc(%rsp), %ecx
movw %cx, 0xe(%rsp)
movq %rax, 0x10(%rsp)
movq %r15, %rdi
movq %r14, %rsi
leaq 0xe(%rsp), %rdx
xorl %ecx, %ecx
callq 0x110c0
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1bade
movzwl 0x8(%rbp), %eax
movzwl 0x18(%rbp), %ecx
addq %rcx, %r13
addq %rax, %r13
addq $0x20, %r13
movq %r15, %rdi
callq 0x1119a
leaq 0xe(%rsp), %rdi
callq 0x10ea2
movq %r14, %rdi
callq 0x10e96
movq (%r12), %r12
cmpq 0x18(%rsp), %r12
jne 0x1cd13
jmp 0x1cdca
movl $0x20, %r13d
cmpl %r13d, 0x18(%rbx)
jne 0x1cddf
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x18, %rbx
movq %rbx, %rdi
movl %r13d, %esi
callq 0x88b1
jmp 0x1cdd0
movq %rax, %rbx
jmp 0x1ce02
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x1119a
leaq 0xe(%rsp), %rdi
callq 0x10ea2
leaq 0x38(%rsp), %rdi
callq 0x10e96
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::_writeDataToDevice()
bool SegLatencyFriendly::_writeDataToDevice() {
    checksumSize_ = headPos_ - SegBase::SizeOfSegOnDisk();
    uint32_t pages_num = headPos_ / getpagesize();
    uint32_t aligned_size = ( pages_num + 1 ) * getpagesize();

    posix_memalign((void**)&dataBuf_, 4096, aligned_size);

    copyToDataBuf();
    uint64_t offset = 0;
    vol_->CalcSegOffsetFromId(segId_, offset);

    bool ret = vol_->Write(dataBuf_, aligned_size, offset);

    free(dataBuf_);
    dataBuf_ = NULL;


    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r12
movl 0x18(%rdi), %ebx
leal -0x20(%rbx), %eax
movl %eax, 0x20(%rdi)
callq 0x66a0
movl %eax, %ecx
xorl %r15d, %r15d
movl %ebx, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r14d
incl %r14d
imull %ecx, %r14d
leaq 0x40(%r12), %rbx
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %r14, %rdx
callq 0x6200
movq %r12, %rdi
callq 0x1ceaa
movq (%r12), %rdi
movl 0x10(%r12), %eax
cmpl %eax, 0x3c(%rdi)
jbe 0x1ce80
movb 0x40(%rdi), %cl
shlq %cl, %rax
movq %rax, %r15
movq (%rbx), %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x20ce2
movl %eax, %ebp
movq (%rbx), %rdi
callq 0x6480
movq $0x0, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Segment.cc
// Function: hlkvds::SegLatencyFriendly::copyToDataBuf()
void SegLatencyFriendly::copyToDataBuf() {
    uint64_t offset = 0;
    vol_->CalcSegOffsetFromId(segId_, offset);

    uint32_t offset_begin = 0;

    offset_begin += SegBase::SizeOfSegOnDisk();

    //aggregate iovec
    for (list<KVSlice *>::iterator iter = sliceList_.begin(); iter
            != sliceList_.end(); iter++) {
        KVSlice *slice = *iter;
        DataHeader *header =
                &slice->GetHashEntry().GetEntryOnDisk().GetDataHeader();
        char *data = (char *) slice->GetData();
        uint16_t data_len = slice->GetDataLen();

        char *key = (char *) slice->GetKey();
        uint16_t key_len = slice->GetKeyLen();
        memcpy(&(dataBuf_[offset_begin]), header, IndexManager::SizeOfDataHeader());
        __DEBUG("write key = %s, seg_id: %u, header offset: %u", slice->GetKey(), segId_, offset_begin);
        offset_begin += IndexManager::SizeOfDataHeader();
        memcpy(&(dataBuf_[offset_begin]), key, key_len);
        __DEBUG("write key = %s, key offset: %u", slice->GetKey(), offset_begin);
        offset_begin += key_len;
        memcpy(&(dataBuf_[offset_begin]), data, data_len);
        __DEBUG("write key = %s, data position: %u", slice->GetKey(), offset_begin);
        offset_begin += data_len;
    }

    // Generate SegHeaderOnDisk
    uint64_t timestamp = KVTime::GetNow();
    uint64_t trx_id = 0;
    uint32_t trx_segs = 0;
    uint32_t checksum_data = 0;
    SegHeaderOnDisk seg_header(timestamp, trx_id, trx_segs, checksum_data, checksumSize_, keyNum_);
    memcpy(dataBuf_, &seg_header, SegBase::SizeOfSegOnDisk());

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x28(%rdi), %rax
movq 0x28(%rdi), %rbp
cmpq %rax, %rbp
je 0x1cf40
movl $0x20, %r13d
movq %rax, 0x10(%rsp)
movq 0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq (%rcx), %rcx
movq (%rax), %rsi
movq 0x10(%rax), %r15
movzwl 0x18(%rax), %r14d
movzwl 0x8(%rax), %r12d
movq 0x40(%rbx), %rax
movl %r13d, %edx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax,%rdx)
movups %xmm0, (%rax,%rdx)
leal 0x20(%r13), %edi
addq 0x40(%rbx), %rdi
movq %r12, %rdx
callq 0x6380
addl %r12d, %r13d
addl $0x20, %r13d
movq 0x40(%rbx), %rdi
addq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x6380
movq 0x10(%rsp), %rax
addl %r14d, %r13d
movq (%rbp), %rbp
cmpq %rax, %rbp
jne 0x1ced3
callq 0x20948
movl 0x1c(%rbx), %ecx
movl 0x20(%rbx), %r9d
movl %ecx, (%rsp)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x1b770
movq 0x40(%rbx), %rax
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, %rdi
callq 0x1b74c
addq $0x38, %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/SegmentManager.cc
// Function: hlkvds::SegmentManager::Get(char*, unsigned long)
bool SegmentManager::Get(char* buf, uint64_t length) {
    uint64_t stat_size = SegmentManager::SizeOfSegmentStat();
    uint64_t stat_table_size = stat_size * segNum_;
    if (length != stat_table_size) {
        return false;
    }
    char *buf_ptr = buf;
    for (uint32_t seg_idx = 0; seg_idx < segNum_; seg_idx++) {
        if (segTable_[seg_idx].state != SegUseStat::RESERVED) {
            memcpy((void *)buf_ptr, (const void *)&segTable_[seg_idx], stat_size);
        } else {
            __WARN("Segment Maybe not write to device! seg_id = %d", seg_idx);
        }
        buf_ptr += stat_size;
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl 0x20(%rdi), %eax
testq %rax, %rax
sete %cl
shlq $0x2, %rax
leaq (%rax,%rax,2), %r13
cmpq %rdx, %r13
setne %al
orb %cl, %al
jne 0x1d560
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%r15), %rax
cmpl $0x2, (%rax,%rbp)
je 0x1d556
leaq (%r14,%rbp), %rcx
addq %rbp, %rax
movl 0x8(%rax), %edx
movl %edx, 0x8(%rcx)
movq (%rax), %rax
movq %rax, (%rcx)
incq %r12
movl 0x20(%r15), %eax
addq $0xc, %rbp
cmpq %rax, %r12
jb 0x1d528
jmp 0x1d560
movq %r12, %rdi
callq 0x8925
jmp 0x1d544
cmpq %rbx, %r13
sete %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/SegmentManager.cc
// Function: hlkvds::SegmentManager::Set(char*, unsigned long)
bool SegmentManager::Set(char* buf, uint64_t length) {
    uint64_t stat_size = SegmentManager::SizeOfSegmentStat();
    uint64_t stat_table_size = stat_size * segNum_;
    if (length != stat_table_size) {
        return false;
    }
    char* buf_ptr = buf;
    for (uint32_t seg_idx = 0; seg_idx < segNum_; seg_idx++) {
        SegmentStat seg_stat;
        memcpy((void *)&seg_stat, (const void *)buf_ptr, stat_size);
        if (seg_stat.state == SegUseStat::USED) {
            usedCounter_++;
            freedCounter_--;
        }
        segTable_.push_back(seg_stat);
        buf_ptr += stat_size;
    }

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movl 0x20(%rdi), %eax
testq %rax, %rax
sete %cl
shlq $0x2, %rax
leaq (%rax,%rax,2), %r13
cmpq %rdx, %r13
setne %al
orb %cl, %al
jne 0x1d5ef
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movl 0x8(%r14), %eax
movl %eax, 0x10(%rsp)
movq (%r14), %rax
movq %rax, 0x8(%rsp)
cmpl $0x1, %eax
jne 0x1d5d8
movq 0x28(%r15), %xmm0
paddd 0x6b4e(%rip), %xmm0     # 0x24120
movq %xmm0, 0x28(%r15)
movq %r15, %rdi
movq %r12, %rsi
callq 0x1db24
addq $0xc, %r14
incl %ebp
cmpl 0x20(%r15), %ebp
jb 0x1d5af
cmpq %rbx, %r13
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::Alloc(unsigned int&)
bool SegmentManager::Alloc(uint32_t& seg_id) {
    std::unique_lock <std::mutex> l(mtx_);
    if (freedCounter_ <= SEG_RESERVED_FOR_GC) {
        return false;
    }

    l.unlock();
    return AllocForGC(seg_id);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rdi), %rax
movq %rsp, %r15
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
movq %r15, %rdi
callq 0xe58e
movb $0x1, 0x8(%r15)
cmpl $0x3, 0x2c(%r14)
jae 0x1d63a
xorl %ebx, %ebx
jmp 0x1d64f
movq %rsp, %rdi
callq 0xe5ca
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1d676
movl %eax, %ebx
movq %rsp, %rdi
callq 0xe10e
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::AllocForGC(unsigned int&)
bool SegmentManager::AllocForGC(uint32_t& seg_id) {
    //for first use !!
    std::lock_guard <std::mutex> l(mtx_);
    if (segTable_[curSegId_].state == SegUseStat::FREE) {
        seg_id = curSegId_;
        segTable_[curSegId_].state = SegUseStat::RESERVED;

        reservedCounter_++;
        freedCounter_--;
        return true;
    }

    uint32_t seg_index = curSegId_ + 1;

    while (seg_index != curSegId_) {
        if (seg_index == segNum_) {
            seg_index = 0;
        }
        if (segTable_[seg_index].state == SegUseStat::FREE) {
            seg_id = seg_index;
            // set seg used
            curSegId_ = seg_id;
            segTable_[curSegId_].state = SegUseStat::RESERVED;

            reservedCounter_++;
            freedCounter_--;
            return true;
        }
        seg_index++;
    }
    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
leaq 0x40(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1d718
movl 0x24(%r14), %ecx
movq (%r14), %rax
leaq (%rcx,%rcx,2), %rdx
cmpl $0x0, (%rax,%rdx,4)
je 0x1d6d3
movl 0x20(%r14), %esi
xorl %edi, %edi
movl %ecx, %edx
incl %edx
cmpl %ecx, %edx
je 0x1d701
cmpl %esi, %edx
cmovel %edi, %edx
leaq (%rdx,%rdx,2), %r8
cmpl $0x0, (%rax,%r8,4)
jne 0x1d6b0
leaq (%rax,%r8,4), %rax
movl %edx, (%r15)
movl %edx, 0x24(%r14)
jmp 0x1d6e2
movl %ecx, (%r15)
movl 0x24(%r14), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,4), %rax
movl $0x2, (%rax)
movq 0x2c(%r14), %xmm0
paddd 0x6a3a(%rip), %xmm0     # 0x24130
movq %xmm0, 0x2c(%r14)
movb $0x1, %bpl
jmp 0x1d703
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x6350
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::FreeForFailed(unsigned int)
void SegmentManager::FreeForFailed(uint32_t seg_id) {
    std::lock_guard <std::mutex> l(mtx_);
    segTable_[seg_id].state = SegUseStat::FREE;
    segTable_[seg_id].free_size = 0;
    segTable_[seg_id].death_size = 0;

    reservedCounter_--;
    freedCounter_++;
    __DEBUG("Free Segment seg_id = %d", seg_id);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x40(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1d772
movl %ebp, %eax
movq (%r14), %rcx
leaq (%rax,%rax,2), %rax
movq $0x0, (%rcx,%rax,4)
movl $0x0, 0x8(%rcx,%rax,4)
movq 0x2c(%r14), %xmm0
paddd 0x69c0(%rip), %xmm0     # 0x24120
movq %xmm0, 0x2c(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x6350
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::FreeForGC(unsigned int)
void SegmentManager::FreeForGC(uint32_t seg_id) {
    std::lock_guard <std::mutex> l(mtx_);
    segTable_[seg_id].state = SegUseStat::FREE;
    segTable_[seg_id].free_size = 0;
    segTable_[seg_id].death_size = 0;

    usedCounter_--;
    freedCounter_++;
    __DEBUG("Free Segment For GC, seg_id = %d", seg_id);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x40(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1d7cc
movl %ebp, %eax
movq (%r14), %rcx
leaq (%rax,%rax,2), %rax
movq $0x0, (%rcx,%rax,4)
movl $0x0, 0x8(%rcx,%rax,4)
movq 0x28(%r14), %xmm0
paddd 0x6976(%rip), %xmm0     # 0x24130
movq %xmm0, 0x28(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x6350
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::Use(unsigned int, unsigned int)
void SegmentManager::Use(uint32_t seg_id, uint32_t free_size) {
    std::lock_guard <std::mutex> l(mtx_);
    segTable_[seg_id].state = SegUseStat::USED;
    segTable_[seg_id].free_size = free_size;

    reservedCounter_--;
    usedCounter_++;
    __DEBUG("Used Segment seg_id = %d, free_size = %d", seg_id, free_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
leaq 0x40(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1d822
movl %r15d, %eax
movq (%r14), %rcx
leaq (%rax,%rax,2), %rax
movl $0x1, (%rcx,%rax,4)
movl %ebp, 0x4(%rcx,%rax,4)
decl 0x30(%r14)
incl 0x28(%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6350
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::SortSegsByUtils(std::multimap<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>&, double)
void SegmentManager::SortSegsByUtils( std::multimap<uint32_t, uint32_t> &cand_map, double utils) {
    std::lock_guard <std::mutex> lck(mtx_);
    uint32_t used_size;
    uint32_t thld = (uint32_t)(segSize_ * utils);

    for (uint32_t index = 0; index < segNum_; index++) {
        if (segTable_[index].state == SegUseStat::USED) {
            used_size = segSize_ - (segTable_[index].free_size
                    + segTable_[index].death_size
                    + (uint32_t) SegBase::SizeOfSegOnDisk());
            if (used_size < thld) {
                cand_map.insert(std::pair<uint32_t, uint32_t>(used_size, index));
            }
        }
    } __DEBUG("There is tatal %lu segments utils under %f", cand_map.size(), utils);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x10(%rsp)
movq %rsi, %r14
movq %rdi, %r15
addq $0x40, %rdi
movq %rdi, (%rsp)
callq 0x6580
testl %eax, %eax
jne 0x1d988
movl 0x20(%r15), %eax
testl %eax, %eax
je 0x1d970
movl 0x18(%r15), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %r13
movl $0x8, %ebp
xorl %ebx, %ebx
leaq 0x8(%rsp), %r12
movq (%r15), %rcx
cmpl $0x1, -0x8(%rcx,%rbp)
jne 0x1d962
movl -0x4(%rcx,%rbp), %edx
addl (%rcx,%rbp), %edx
movl 0x18(%r15), %ecx
subl %edx, %ecx
addl $-0x20, %ecx
cmpl %r13d, %ecx
jae 0x1d962
movl %ecx, 0x8(%rsp)
movl %ebx, 0xc(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1dcd2
movl 0x20(%r15), %eax
incq %rbx
movl %eax, %ecx
addq $0xc, %rbp
cmpq %rcx, %rbx
jb 0x1d92c
movq (%rsp), %rdi
callq 0x6350
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
movq %rax, %r14
movq (%rsp), %rdi
callq 0x6350
movq %r14, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SegmentManager.cc
// Function: hlkvds::SegmentManager::SortSegsByTS(std::multimap<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>&, unsigned int)
void SegmentManager::SortSegsByTS(std::multimap<uint32_t, uint32_t> &cand_map, uint32_t max_seg_num)
{
    std::unique_lock<std::mutex> lck(mtx_, std::defer_lock);
    uint32_t used_size;

    lck.lock();
    std::multimap<uint32_t, uint32_t> used_map;
    for (uint32_t index = 0; index < segNum_; index++) {
        if (segTable_[index].state == SegUseStat::USED) {
            used_size = segSize_ - (segTable_[index].free_size
                    + segTable_[index].death_size
                    + (uint32_t) SegBase::SizeOfSegOnDisk());
            used_map.insert(std::pair<uint32_t, uint32_t>(used_size, index));
        }
    }
    lck.unlock();

    for(std::multimap<uint32_t, uint32_t>::iterator iter = used_map.begin(); iter != used_map.end(); iter++) {
        if (max_seg_num == 0) {
            break;
        }
        cand_map.insert(*iter);
        max_seg_num --;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x40(%rdi), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0xe58e
leaq 0x20(%rsp), %rbp
movl $0x0, (%rbp)
xorl %eax, %eax
movq %rax, 0x8(%rbp)
movq %rbp, 0x10(%rbp)
movq %rbp, 0x18(%rbp)
movq %rax, 0x20(%rbp)
movl 0x20(%r15), %eax
testl %eax, %eax
je 0x1da44
movl $0x8, %r12d
xorl %r13d, %r13d
movq (%r15), %rcx
cmpl $0x1, -0x8(%rcx,%r12)
jne 0x1da36
movl 0x18(%r15), %eax
movl -0x4(%rcx,%r12), %edx
addl (%rcx,%r12), %edx
negl %edx
addl %edx, %eax
addl $-0x20, %eax
movl %eax, (%rsp)
movl %r13d, 0x4(%rsp)
leaq 0x18(%rsp), %rdi
movq %rsp, %rsi
callq 0x1dcd2
movl 0x20(%r15), %eax
incq %r13
movl %eax, %ecx
addq $0xc, %r12
cmpq %rcx, %r13
jb 0x1d9fe
leaq 0x8(%rsp), %rdi
callq 0xe5ca
movq 0x30(%rsp), %r15
cmpq %rbp, %r15
sete %al
testl %ebx, %ebx
sete %cl
orb %al, %cl
jne 0x1da8a
decl %ebx
leaq 0x20(%r15), %rsi
movq %r14, %rdi
callq 0x1dda4
movq %r15, %rdi
callq 0x62d0
movq %rax, %r15
subl $0x1, %ebx
setb %al
cmpq %rbp, %r15
je 0x1da8a
testb %al, %al
je 0x1da64
leaq 0x18(%rsp), %rdi
callq 0x10c92
leaq 0x8(%rsp), %rdi
callq 0xe10e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1dab6
movq %rax, %rbx
jmp 0x1dac3
jmp 0x1dab6
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x10c92
leaq 0x8(%rsp), %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Status.cc
// Function: hlkvds::Status::Status(hlkvds::Status::Code, char const*)
Status::Status(Code _code, const char* msg) :
    code_(_code) {
    uint32_t size = strlen(msg);
    char* const result = new char[size + 1];
    memcpy(result, msg, size);
    result[size] = '\0';
    state_ = result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movl %esi, (%rdi)
movq %rdx, %rdi
callq 0x61a0
movq %rax, %r15
leal 0x1(%rax), %edi
callq 0x6040
movq %rax, %r12
movl %r15d, %r15d
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6380
movb $0x0, (%r12,%r15)
movq %r12, 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Status.cc
// Function: hlkvds::Status::ToString[abi:cxx11]() const
std::string Status::ToString() const {
    char tmp[30];
    const char* type;
    switch (code_) {
        case kOk:
            return "OK";
        case kNotFound:
            type = "NotFound: ";
            break;
        case kCorruption:
            type = "Corruption: ";
            break;
        case kNotSupported:
            type = "Not implemented: ";
            break;
        case kInvalidArgument:
            type = "Invalid argument: ";
            break;
        case kIOError:
            type = "IO error: ";
            break;
        case kTimedOut:
            type = "Operation timed out: ";
            break;
        case kAborted:
            type = "Operation aborted: ";
            break;
        case kBusy:
            type = "Resource busy: ";
            break;
        case kTryAgain:
            type = "Operation failed. Try again.: ";
            break;
        default:
            snprintf(tmp, sizeof(tmp), "Unknown code(%d): ",
                     static_cast<int> (code()));
            type = tmp;
            break;
    }
    std::string result(type);
    if (state_ != nullptr) {
        result.append(state_);
    }

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %ecx
cmpq $0x9, %rcx
ja 0x1df07
leaq 0x62f8(%rip), %rax      # 0x2418c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x6309(%rip), %rsi      # 0x241b4
leaq 0x6304(%rip), %rdx      # 0x241b6
movq %rbx, %rdi
callq 0xa862
jmp 0x1df58
leaq 0x631b(%rip), %r15      # 0x241e1
jmp 0x1df29
leaq 0x636a(%rip), %r15      # 0x24239
jmp 0x1df29
leaq 0x62ea(%rip), %r15      # 0x241c2
jmp 0x1df29
leaq 0x62ee(%rip), %r15      # 0x241cf
jmp 0x1df29
leaq 0x632b(%rip), %r15      # 0x24215
jmp 0x1df29
leaq 0x62c4(%rip), %r15      # 0x241b7
jmp 0x1df29
leaq 0x62f8(%rip), %r15      # 0x241f4
jmp 0x1df29
leaq 0x62fa(%rip), %r15      # 0x241ff
jmp 0x1df29
leaq 0x634a(%rip), %rdx      # 0x24258
movq %rsp, %r15
movl $0x1e, %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x65e0
jmp 0x1df29
leaq 0x6300(%rip), %r15      # 0x24229
leaq 0x10(%rbx), %r12
movq %r12, (%rbx)
movq %r15, %rdi
callq 0x61a0
leaq (%rax,%r15), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xa862
movq 0x8(%r14), %rsi
testq %rsi, %rsi
je 0x1df58
movq %rbx, %rdi
callq 0x6710
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x1df77
callq 0x63f0
movq %r14, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SuperBlockManager.cc
// Function: hlkvds::SuperBlockManager::Set(char*, unsigned long)
bool SuperBlockManager::Set(char* buff, uint64_t length) {
    if (length != SuperBlockManager::SuperBlockSizeOnDevice()) {
        return false;
    }
    memcpy((void*)&sb_, (const void*)buff, SuperBlockManager::SizeOfDBSuperBlock());

    uint64_t reserved_region_length = SuperBlockManager::ReservedRegionLength();
    char * cont_ptr = buff + SuperBlockManager::SizeOfDBSuperBlock();
    memcpy((void*)resCont_, (const void*)cont_ptr, reserved_region_length);

    return true;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
cmpq $0x1000, %rdx           # imm = 0x1000
jne 0x1e00d
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
movups 0x2d(%rsi), %xmm3
movups %xmm3, 0x2d(%rdi)
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
addq $0x3d, %rsi
movq 0x40(%rdi), %rdi
movl $0xfc3, %edx            # imm = 0xFC3
callq 0x6380
cmpq $0x1000, %rbx           # imm = 0x1000
sete %al
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SuperBlockManager.cc
// Function: hlkvds::SuperBlockManager::SetSuperBlock(hlkvds::DBSuperBlock&)
void SuperBlockManager::SetSuperBlock(DBSuperBlock& sb) {
    std::lock_guard<std::mutex> l(mtx_);
    sb_.magic_number            = sb.magic_number;
    sb_.index_ht_size           = sb.index_ht_size;
    sb_.index_region_offset     = sb.index_region_offset;
    sb_.index_region_length     = sb.index_region_length;
    sb_.sst_total_num           = sb.sst_total_num;
    sb_.sst_region_offset       = sb.sst_region_offset;
    sb_.sst_region_length       = sb.sst_region_length;
    sb_.data_store_type         = sb.data_store_type;
    sb_.entry_count             = sb.entry_count;
    sb_.entry_theory_data_size  = sb.entry_theory_data_size;
    sb_.grace_close_flag        = sb.grace_close_flag;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x50(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1e07c
movq (%r15), %rax
movq %rax, (%r14)
movups 0x8(%r15), %xmm0
movups %xmm0, 0x8(%r14)
movl 0x18(%r15), %eax
movl %eax, 0x18(%r14)
movups 0x1c(%r15), %xmm0
movups %xmm0, 0x1c(%r14)
movq 0x2c(%r15), %rax
movq %rax, 0x2c(%r14)
movq 0x34(%r15), %rax
movq %rax, 0x34(%r14)
movb 0x3c(%r15), %al
movb %al, 0x3c(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x6350
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SuperBlockManager.cc
// Function: hlkvds::SuperBlockManager::SetReservedContent(char*, unsigned long)
bool SuperBlockManager::SetReservedContent(char* content, uint64_t length) {
    std::lock_guard<std::mutex> l(mtx_);
    if (length != SuperBlockManager::ReservedRegionLength()) {
        return false;
    }
    memcpy((void*)resCont_, (const void*)content, length);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x50(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1e168
cmpq $0xfc3, %r14            # imm = 0xFC3
jne 0x1e14a
movq 0x40(%r12), %rdi
movl $0xfc3, %edx            # imm = 0xFC3
movq %r15, %rsi
callq 0x6380
cmpq $0xfc3, %r14            # imm = 0xFC3
sete %bpl
movq %rbx, %rdi
callq 0x6350
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/SuperBlockManager.cc
// Function: hlkvds::SuperBlockManager::GetReservedContent(char*, unsigned long)
bool SuperBlockManager::GetReservedContent(char* content, uint64_t length) {
    std::lock_guard<std::mutex> l(mtx_);
    if (length != SuperBlockManager::ReservedRegionLength()) {
        return false;
    }
    memcpy((void*)content,(const void*)resCont_, length);
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x50(%rdi), %rbx
movq %rbx, %rdi
callq 0x6580
testl %eax, %eax
jne 0x1e1ca
cmpq $0xfc3, %r14            # imm = 0xFC3
jne 0x1e1ac
movq 0x40(%r12), %rsi
movl $0xfc3, %edx            # imm = 0xFC3
movq %r15, %rdi
callq 0x6380
cmpq $0xfc3, %r14            # imm = 0xFC3
sete %bpl
movq %rbx, %rdi
callq 0x6350
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x62b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::deleteAllSegments()
void FastTier::deleteAllSegments() {
    delete mig_;

    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
movq 0x1e0(%rdi), %r14
testq %r14, %r14
je 0x1e388
movq %r14, %rdi
callq 0x16bc4
movq %r14, %rdi
callq 0x63f0
leaq 0x128(%rbx), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0xe58e
movb $0x1, 0x8(%r14)
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x124(%rbx)
jle 0x1e418
leaq 0x150(%rbx), %r14
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xe528
movq (%rax), %r12
testq %r12, %r12
je 0x1e3e9
movq %r12, %rdi
callq 0x1c3e8
movq %r12, %rdi
callq 0x63f0
movslq 0x4(%rsp), %rax
movq 0x180(%rbx), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x63f0
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
cmpl 0x124(%rbx), %eax
jl 0x1e3ce
leaq 0x150(%rbx), %rdi
callq 0xfdfe
movq 0x180(%rbx), %rax
cmpq %rax, 0x188(%rbx)
je 0x1e43b
movq %rax, 0x188(%rbx)
leaq 0x8(%rsp), %rdi
callq 0xe10e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::CreateAllSegments()
void FastTier::CreateAllSegments() {
    std::unique_lock<std::mutex> lck_seg_map(segMapMtx_);
    for (int i = 0; i < shardsNum_; i++) {
        SegForReq * seg = new SegForReq(vol_, idxMgr_, options_.expired_time);
        segMap_.insert(make_pair(i, seg));

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

    //Create Migrate;
    mig_ = new Migrate(idxMgr_, this, mt_, options_);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x128(%rdi), %rax
leaq 0x18(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0xe58e
movb $0x1, 0x8(%r14)
cmpl $0x0, 0x124(%rbx)
jle 0x1e54b
leaq 0x150(%rbx), %r14
leaq 0x180(%rbx), %r15
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
movl $0xd8, %edi
callq 0x6410
movq %rax, %r13
movq 0x1d8(%rbx), %rsi
movq (%rbx), %rax
movq 0x10(%rbx), %rdx
movl 0x10(%rax), %ecx
movq %r13, %rdi
callq 0x1c58e
movl %ebp, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0xed58
movl $0x28, %edi
callq 0x6410
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movq %rax, 0x8(%rsp)
movq 0x188(%rbx), %rsi
cmpq 0x190(%rbx), %rsi
je 0x1e532
movq %rax, (%rsi)
addq $0x8, 0x188(%rbx)
jmp 0x1e53d
movq %r15, %rdi
movq %r12, %rdx
callq 0xee94
incl %ebp
cmpl 0x124(%rbx), %ebp
jl 0x1e4ba
movl $0x58, %edi
callq 0x6410
movq %rax, %r14
movq (%rbx), %r8
movq 0x10(%rbx), %rsi
movq 0x1e8(%rbx), %rcx
movq %rax, %rdi
movq %rbx, %rdx
callq 0x16bdc
movq %r14, 0x1e0(%rbx)
leaq 0x18(%rsp), %rdi
callq 0xe10e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
jmp 0x1e5a3
jmp 0x1e5ac
jmp 0x1e5ac
movq %rax, %rbx
movq %r13, %rdi
callq 0x63f0
jmp 0x1e5af
jmp 0x1e5ac
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::SegTimeoutThdEntry()
void FastTier::SegTimeoutThdEntry() {
    __DEBUG("Segment Timeout thread start!!");
    std::unique_lock<std::mutex> lck_seg_map(segMapMtx_, std::defer_lock);

    while (!segTimeoutT_stop_) {
        for ( int i = 0; i < shardsNum_; i++) {
            std::mutex *mtx = segMtxVec_[i];
            std::unique_lock<std::mutex> l(*mtx);

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

            if (seg->IsExpired()) {
                seg->Completion();

                segWteWQ_->Add_task(seg);
                seg = new SegForReq(vol_, idxMgr_, options_.expired_time);

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

        usleep(options_.expired_time);
    } __DEBUG("Segment Timeout thread stop!!");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x128(%rdi), %rax
leaq 0x28(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
leaq 0x150(%rdi), %r15
leaq 0x158(%rdi), %r13
leaq 0x8(%rsp), %r12
movb 0x218(%rbx), %al
testb $0x1, %al
jne 0x1e9c7
movl $0x0, 0x4(%rsp)
cmpl $0x0, 0x124(%rbx)
jle 0x1e9b7
xorl %eax, %eax
cltq
movq 0x180(%rbx), %rcx
movq (%rcx,%rax,8), %rax
movq %rax, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq %r12, %rdi
callq 0xe58e
movb $0x1, 0x10(%rsp)
movq %r14, %rdi
callq 0xe58e
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xe528
movq (%rax), %rbp
movq %r14, %rdi
callq 0xe5ca
movq %rbp, %rdi
callq 0x1c874
testb %al, %al
je 0x1e999
movq %rbp, %rdi
callq 0x1c6fe
movq 0x208(%rbx), %rdi
movq %rbp, %rsi
callq 0xe5f2
movl $0xd8, %edi
callq 0x6410
movq %rax, %rbp
movq 0x1d8(%rbx), %rsi
movq (%rbx), %rax
movq 0x10(%rbx), %rdx
movl 0x10(%rax), %ecx
movq %rbp, %rdi
callq 0x1c58e
movq %r14, %rdi
callq 0xe58e
movq 0x160(%rbx), %rdx
movq %r13, %rsi
testq %rdx, %rdx
je 0x1e96f
movl 0x4(%rsp), %ecx
movq %r13, %rax
xorl %esi, %esi
cmpl %ecx, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rax
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x1e946
movq %r13, %rsi
cmpq %r13, %rax
je 0x1e96f
cmpl 0x20(%rax), %ecx
cmovlq %r13, %rax
movq %rax, %rsi
movq %r15, %rdi
callq 0x10024
movl 0x4(%rsp), %eax
movl %eax, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0xed58
movq %r14, %rdi
callq 0xe5ca
movq %r12, %rdi
callq 0xe10e
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
cmpl 0x124(%rbx), %eax
jl 0x1e897
movq (%rbx), %rax
movl 0x10(%rax), %edi
callq 0x6550
jmp 0x1e872
leaq 0x28(%rsp), %rdi
callq 0xe10e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e9f1
movq %rax, %rbx
movq %rbp, %rdi
callq 0x63f0
jmp 0x1e9fd
jmp 0x1e9fa
movq %rax, %rbx
jmp 0x1ea07
jmp 0x1e9fa
jmp 0x1e9fa
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xe10e
leaq 0x28(%rsp), %rdi
callq 0xe10e
movq %rbx, %rdi
callq 0x6670
nop
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::StopThds()
void FastTier::StopThds() {
    //vol_->StopThds();

    migrationT_stop_.store(true);
    migrationT_.join();

    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
movb $0x1, %bpl
movb $0x1, %al
xchgb %al, 0x228(%rdi)
addq $0x220, %rdi            # imm = 0x220
callq 0x6650
xchgb %bpl, 0x218(%rbx)
leaq 0x210(%rbx), %rdi
callq 0x6650
cmpl $0x0, 0x124(%rbx)
jle 0x1eaf9
xorl %r15d, %r15d
movq 0x1f0(%rbx), %rax
movq (%rax,%r15,8), %r14
movq %r14, %rdi
callq 0xe34a
movq (%r14), %rax
movq %r14, %rdi
callq *0x8(%rax)
incq %r15
movslq 0x124(%rbx), %rax
cmpq %rax, %r15
jl 0x1eace
movq 0x1f0(%rbx), %rax
cmpq %rax, 0x1f8(%rbx)
je 0x1eb10
movq %rax, 0x1f8(%rbx)
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
je 0x1eb3d
callq 0xe38e
movq 0x208(%rbx), %rdi
testq %rdi, %rdi
je 0x1eb3d
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::writeDataImmediately(hlkvds::KVSlice&)
Status FastTier::writeDataImmediately(KVSlice& slice){
    uint32_t seg_id = 0;
    bool ret = false;

    ret = allocSegment(seg_id);
    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 %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movl $0x0, (%rsi)
movq %r15, %rdi
callq 0x1ee42
testb %al, %al
je 0x1ecec
movl $0x48, %edi
callq 0x6410
movq %rax, %r14
movq 0x10(%r15), %rdx
movq 0x1d8(%r15), %rsi
movq %rax, %rdi
callq 0x1cb9a
addq $0x1d8, %r15            # imm = 0x1D8
movq %r14, %rdi
movq %r12, %rsi
callq 0x1cbec
movl 0x4(%rsp), %eax
movl %eax, 0x10(%r14)
movq %r14, %rdi
callq 0x1ccae
testb %al, %al
je 0x1ecf6
movl 0x14(%r14), %edx
subl 0x20(%r14), %edx
addl $-0x20, %edx
movq (%r15), %rdi
movl 0x4(%rsp), %esi
callq 0x20d80
movq %r14, %rdi
callq 0x1cf92
movq %r14, %rdi
callq 0x1cb16
movq %r14, %rdi
callq 0x63f0
movl $0x0, (%rbx)
movq $0x0, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x8b97
jmp 0x1ecdd
leaq 0x4(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x8c0e
jmp 0x1ecdd
movq %rax, %rbx
movq %r14, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x6670
// File: /workspace/github_cpp_makefile_star2_O3/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::WriteBatchData(hlkvds::WriteBatch*)
Status FastTier::WriteBatchData(WriteBatch *batch) {
    uint32_t seg_id = 0;
    bool ret = false;

    ret = allocSegment(seg_id);
    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, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc(%rsp), %rsi
movl $0x0, (%rsi)
movq %r15, %rdi
callq 0x1ee42
testb %al, %al
je 0x1ee03
movl $0x50, %edi
callq 0x6410
movq %rax, %r14
movq 0x10(%r15), %rdx
movq 0x1d8(%r15), %rsi
movq %rax, %rdi
callq 0x1ca02
movq (%r12), %r13
cmpq %r12, %r13
je 0x1ed9e
movq 0x10(%r13), %rsi
movq %r14, %rdi
callq 0x1be5c
testb %al, %al
je 0x1ee22
movq 0x10(%r13), %rsi
movq %r14, %rdi
callq 0x1be76
movq (%r13), %r13
jmp 0x1ed73
addq $0x1d8, %r15            # imm = 0x1D8
movl 0xc(%rsp), %eax
movl %eax, (%r14)
movq %r14, %rdi
callq 0x1bf42
testb %al, %al
je 0x1ee0d
movl 0x18(%r14), %edx
subl 0x14(%r14), %edx
movq (%r15), %rdi
movl 0xc(%rsp), %esi
callq 0x20d80
movq %r14, %rdi
callq 0x1ca3c
movq %r14, %rdi
callq 0x1bd44
movq %r14, %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
movq %rbx, %rdi
callq 0x8cbc
jmp 0x1edf2
leaq 0xc(%rsp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x8dc7
jmp 0x1edf2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8d31
jmp 0x1edf2
movq %rax, %rbx
movq %r14, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x6670