LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::GetKeyByHashEntry[abi:cxx11](hlkvds::HashEntry*)
std::string FastTier::GetKeyByHashEntry(HashEntry *entry) {
    uint64_t key_offset = 0;

    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 %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
movq 0x1d8(%rsi), %rdi
movq %r14, %rsi
callq 0x1dff0
testb %al, %al
je 0x1c19d
movq (%r14), %rax
movzwl 0x14(%rax), %r12d
leaq 0x1(%r12), %rdi
callq 0x6040
movq %rax, %r14
movq 0x1d8(%r15), %rdi
movq 0x10(%rsp), %rcx
movq %rax, %rsi
movq %r12, %rdx
callq 0x1de02
testb %al, %al
je 0x1c1c0
movq %r14, %rdx
addq %r12, %rdx
movb $0x0, (%r14,%r12)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcd5c
movq %r14, %rdi
callq 0x64c0
jmp 0x1c1b1
leaq 0x3a58(%rip), %rsi      # 0x1fbfc
leaq 0xf(%rsp), %rdx
movq %rbx, %rdi
callq 0x6150
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x15e11(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0x30ce(%rip), %rsi      # 0x1f2a5
leaq 0x34a1(%rip), %rcx      # 0x1f67f
leaq 0x51e3(%rip), %r8       # 0x213c8
movq %r15, %rdi
movq %rax, %rdx
movl $0x138, %r9d            # imm = 0x138
xorl %eax, %eax
callq 0x6580
movq (%r12), %rcx
leaq 0x33e0(%rip), %rdi      # 0x1f5e3
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x64c0
leaq 0x39d3(%rip), %rsi      # 0x1fbfc
leaq 0xe(%rsp), %rdx
jmp 0x1c1a9
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::GetValueByHashEntry[abi:cxx11](hlkvds::HashEntry*)
std::string FastTier::GetValueByHashEntry(HashEntry *entry) {
    uint64_t data_offset = 0;

    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 %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
movq 0x1d8(%rsi), %rdi
movq %r14, %rsi
callq 0x1dfc6
testb %al, %al
je 0x1c2c0
movq (%r14), %rax
movzwl 0x16(%rax), %r12d
testq %r12, %r12
je 0x1c2ce
leaq 0x1(%r12), %rdi
callq 0x6040
movq %rax, %r14
movq 0x1d8(%r15), %rdi
movq 0x10(%rsp), %rcx
movq %rax, %rsi
movq %r12, %rdx
callq 0x1de02
testb %al, %al
je 0x1c2f1
movq %r14, %rdx
addq %r12, %rdx
movb $0x0, (%r14,%r12)
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcd5c
movq %r14, %rdi
callq 0x64c0
jmp 0x1c2e2
leaq 0x3935(%rip), %rsi      # 0x1fbfc
leaq 0xf(%rsp), %rdx
jmp 0x1c2da
leaq 0x3927(%rip), %rsi      # 0x1fbfc
leaq 0xe(%rsp), %rdx
movq %rbx, %rdi
callq 0x6150
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x15ce0(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0x2f9d(%rip), %rsi      # 0x1f2a5
leaq 0x3382(%rip), %rcx      # 0x1f691
leaq 0x50b2(%rip), %r8       # 0x213c8
movq %r15, %rdi
movq %rax, %rdx
movl $0x151, %r9d            # imm = 0x151
xorl %eax, %eax
callq 0x6580
movq (%r12), %rcx
leaq 0x32af(%rip), %rdi      # 0x1f5e3
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x64c0
leaq 0x38a2(%rip), %rsi      # 0x1fbfc
leaq 0xd(%rsp), %rdx
jmp 0x1c2da
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::PickVolForMigrate()
uint32_t MediumTier::PickVolForMigrate() {
    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, %rbx
leaq 0x80(%rdi), %r14
movq %r14, %rdi
callq 0xbc3a
movl 0x40(%rbx), %eax
movl 0x78(%rbx), %ecx
decl %eax
leal 0x1(%rcx), %edx
xorl %ebp, %ebp
cmpl %eax, %ecx
cmovnel %edx, %ebp
movl %ebp, 0x78(%rbx)
movq %r14, %rdi
callq 0x6340
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::ReqMerge(hlkvds::Request*)
void FastTier::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);

        seg = new SegForReq(vol_, 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 $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movslq 0x70(%rsi), %rax
movl %eax, 0x4(%rsp)
leaq 0x128(%rdi), %rcx
movq %rcx, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq 0x180(%rdi), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x18(%rsp), %rdi
callq 0xaf4e
leaq 0x8(%rsp), %rdi
callq 0xb49c
leaq 0x150(%r15), %r14
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xb444
movq (%rax), %r12
leaq 0x8(%rsp), %rdi
callq 0xb4c6
movq %r12, %rdi
movq %rbx, %rsi
callq 0x19152
testb %al, %al
je 0x1c499
movq %r12, %rdi
movq %rbx, %rsi
callq 0x19164
jmp 0x1c524
movq %r12, %rdi
callq 0x191b2
movq 0x208(%r15), %rdi
movq %r12, %rsi
callq 0xb4ec
movl $0xd8, %edi
callq 0x6410
movq %rax, %r12
movq 0x1d8(%r15), %rsi
movq (%r15), %rax
movq 0x10(%r15), %rdx
movl 0x10(%rax), %ecx
movq %r12, %rdi
callq 0x190a0
leaq 0x8(%rsp), %rdi
callq 0xb49c
leaq 0x4(%rsp), %rsi
movq %r14, %rdi
callq 0xd420
movq %r14, %rdi
movq %rax, %rsi
callq 0xd454
movl 0x4(%rsp), %eax
leaq 0x28(%rsp), %rsi
movl %eax, (%rsi)
movq %r12, 0x8(%rsi)
movq %r14, %rdi
callq 0xbf28
leaq 0x8(%rsp), %rdi
callq 0xb4c6
movq %r12, %rdi
movq %rbx, %rsi
callq 0x19164
leaq 0x18(%rsp), %rdi
callq 0xafd0
leaq 0x8(%rsp), %rdi
callq 0xafd0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1c55c
movq %rax, %rbx
movq %r12, %rdi
callq 0x63f0
jmp 0x1c55f
jmp 0x1c55c
movq %rax, %rbx
jmp 0x1c569
jmp 0x1c55c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xafd0
leaq 0x8(%rsp), %rdi
callq 0xafd0
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::FastTier::SegWrite(hlkvds::SegForReq*)
void FastTier::SegWrite(SegForReq *seg) {
    uint32_t seg_id = 0;
    bool ret = false;

    ret = allocSegment(seg_id);
    if (!ret) {
        __ERROR("Cann't get a new Empty Segment.\n");
        seg->Notify(ret);
        return ;
    }

    uint32_t free_size = seg->GetFreeSize();
    seg->SetSegId(seg_id);
    ret = seg->WriteSegToDevice();
    if (ret) {
        vol_->Use(seg_id, free_size);
    } else {
        vol_->FreeForFailed(seg_id);
    }
    seg->Notify(ret);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
callq 0x1ba7e
testb %al, %al
je 0x1c5fc
movl 0x14(%rbx), %r12d
movl 0x18(%rbx), %r15d
movl 0xc(%rsp), %eax
movl %eax, (%rbx)
movq %rbx, %rdi
callq 0x18a22
movl %eax, %ebp
testb %al, %al
je 0x1c5d3
subl %r12d, %r15d
movq 0x1d8(%r14), %rdi
movl 0xc(%rsp), %esi
movl %r15d, %edx
callq 0x1df82
jmp 0x1c5e3
movq 0x1d8(%r14), %rdi
movl 0xc(%rsp), %esi
callq 0x1df6e
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x191be
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x159d5(%rip), %r15     # 0x31fd8
movq (%r15), %r14
callq 0x63c0
leaq 0x2c93(%rip), %rsi      # 0x1f2a5
leaq 0x30de(%rip), %rcx      # 0x1f6f7
leaq 0x4da8(%rip), %r8       # 0x213c8
xorl %ebp, %ebp
movq %r14, %rdi
movq %rax, %rdx
movl $0x1f3, %r9d            # imm = 0x1F3
xorl %eax, %eax
callq 0x6580
movq (%r15), %rcx
leaq 0x2e97(%rip), %rdi      # 0x1f4d6
pushq $0x20
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1c5e3
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::deleteAllVolume()
void MediumTier::deleteAllVolume() {
    map<int, Volume *>::iterator iter;
    for (iter = volMap_.begin(); iter != volMap_.end(); ) {
        Volume *vol = iter->second;
        delete vol;
        volMap_.erase(iter++);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
movq 0x60(%rdi), %r15
addq $0x50, %rbx
cmpq %rbx, %r15
je 0x1c720
movq 0x28(%r15), %r12
testq %r12, %r12
je 0x1c6fd
movq %r12, %rdi
callq 0x1dd10
movq %r12, %rdi
callq 0x63f0
movq %r15, %rdi
callq 0x62c0
movq %rax, %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0xd01a
movq %r12, %r15
jmp 0x1c6e7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::printDeviceTopologyInfo()
void MediumTier::printDeviceTopologyInfo() {
    __INFO( "\n\t Medium Tier Infomation:\n"
            "\t Medium Tier Seg Size          : %d\n"
            "\t Medium Tier Vol Num           : %d",
            sbResMediumTierHeader_.segment_size, sbResMediumTierHeader_.volume_num);

    for (uint32_t i = 0 ; i < volNum_; i++) {
        __INFO("\n\t Medium Tier Volume[%d] : dev_path = %s, segment_num = %d, cur_seg_id = %d",
                i, sbResMediumTierVolVec_[i].dev_path,
                sbResMediumTierVolVec_[i].segment_num,
                sbResMediumTierVolVec_[i].cur_seg_id);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x15817(%rip), %r13     # 0x31fd8
movq (%r13), %r15
callq 0x63c0
movq %rax, %r14
leaq 0x29dc(%rip), %rsi      # 0x1f1b0
leaq 0x29f5(%rip), %rcx      # 0x1f1d0
leaq 0x4be6(%rip), %r8       # 0x213c8
movq %r15, %rdi
movq %rax, %rdx
movl $0x25e, %r9d            # imm = 0x25E
xorl %eax, %eax
callq 0x6580
movq (%r13), %rdi
movl 0x18(%rbx), %edx
movl 0x1c(%rbx), %ecx
leaq 0x4cd9(%rip), %rsi      # 0x214df
xorl %eax, %eax
callq 0x6580
movq (%r13), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x64b0
xorl %r15d, %r15d
xorl %r12d, %r12d
movl 0x40(%rbx), %eax
cmpq %rax, %r12
jae 0x1c896
movq (%r13), %rdi
leaq 0x297c(%rip), %rsi      # 0x1f1b0
movq %r14, %rdx
leaq 0x2992(%rip), %rcx      # 0x1f1d0
leaq 0x4b83(%rip), %r8       # 0x213c8
movl $0x264, %r9d            # imm = 0x264
xorl %eax, %eax
callq 0x6580
movq (%r13), %rdi
movq 0x20(%rbx), %rax
leaq (%rax,%r15), %rcx
movl 0x100(%rax,%r15), %r8d
movl 0x104(%rax,%r15), %r9d
leaq 0x4ccf(%rip), %rsi      # 0x21544
movl %r12d, %edx
xorl %eax, %eax
callq 0x6580
movq (%r13), %rsi
movl %ebp, %edi
callq 0x64b0
incq %r12
addq $0x108, %r15            # imm = 0x108
jmp 0x1c821
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::GetSBReservedContent(char*, unsigned long)
bool MediumTier::GetSBReservedContent(char* buf, uint64_t length) {
    uint32_t except_length = sizeof(MultiTierDS_SB_Reserved_MediumTier_Header) +
                            volNum_ * sizeof(MultiTierDS_SB_Reserved_MediumTier_Content);
    if (length != except_length) {
        return false;
    }

    updateAllVolSBRes();

    char* buf_ptr = buf;
    uint64_t medium_tier_header_size = sizeof(MultiTierDS_SB_Reserved_MediumTier_Header);
    memcpy((void*)buf, (const void *)&sbResMediumTierHeader_, medium_tier_header_size);
    __DEBUG("MultiTierDS_SB_Reserved_MediumTier_Header: segment_size = %d, volume_num = %d",
            sbResMediumTierHeader_.segment_size, sbResMediumTierHeader_.volume_num);
    buf_ptr += medium_tier_header_size;

    //Get sbResVolVec_
    uint64_t sb_res_item_size = sizeof(MultiTierDS_SB_Reserved_MediumTier_Content);
    for (uint32_t i = 0; i < volNum_; i++) {
        memcpy((void*)buf_ptr, (const void*)&sbResMediumTierVolVec_[i], sb_res_item_size);
        buf_ptr += sb_res_item_size;
        __DEBUG("MultiTierDS_SB_Reserved_MediumTier_Content[%d]: device_path = %s, segment_num = %d, current_seg_id = %d",
            i, sbResMediumTierVolVec_[i].dev_path, sbResMediumTierVolVec_[i].segment_num,
            sbResMediumTierVolVec_[i].cur_seg_id);

    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
imull $0x108, 0x40(%rdi), %r12d # imm = 0x108
addl $0x8, %r12d
cmpq %rdx, %r12
jne 0x1ca70
movq %rsi, %r14
movq %rdi, %r15
callq 0x1ca86
movq 0x18(%r15), %rax
movq %rax, (%r14)
addq $0x8, %r14
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0x40(%r15), %eax
cmpq %rax, %rbp
jae 0x1ca70
leaq (%r14,%r13), %rdi
movq 0x20(%r15), %rsi
addq %r13, %rsi
movl $0x108, %edx            # imm = 0x108
callq 0x6370
incq %rbp
addq $0x108, %r13            # imm = 0x108
jmp 0x1ca46
cmpq %rbx, %r12
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_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::SetSBReservedContent(char*, unsigned long)
bool MediumTier::SetSBReservedContent(char* buf, uint64_t length) {
    char* buf_ptr = buf;
    uint64_t medium_tier_header_size = sizeof(MultiTierDS_SB_Reserved_MediumTier_Header);
    memcpy((void*)&sbResMediumTierHeader_, (const void *)buf_ptr, medium_tier_header_size);
    __DEBUG("MultiTierDS_SB_Reserved_MediumTier_Header: segment_size = %d, volume_num = %d",
            sbResMediumTierHeader_.segment_size, sbResMediumTierHeader_.volume_num);
    buf_ptr += medium_tier_header_size;

    uint64_t except_length = sizeof(MultiTierDS_SB_Reserved_MediumTier_Header) +
                            sbResMediumTierHeader_.volume_num * sizeof(MultiTierDS_SB_Reserved_MediumTier_Content);
    if (length != except_length) {
        __INFO("!!!!!length = %ld, except_length = %ld, volNum_ = %d", length, except_length, volNum_);
        return false;
    }

    //Get sbResVolVec_
    uint64_t sb_res_item_size = sizeof(MultiTierDS_SB_Reserved_MediumTier_Content);
    for (uint32_t i = 0; i < sbResMediumTierHeader_.volume_num; i++) {
        MultiTierDS_SB_Reserved_MediumTier_Content sb_res_item;
        memcpy((void*)&sb_res_item, (const void*)buf_ptr, sb_res_item_size);
        sbResMediumTierVolVec_.push_back(sb_res_item);
        buf_ptr += sb_res_item_size;
        __DEBUG("MultiTierDS_SB_Reserved_MediumTier_Content[%d]: device_path = %s, segment_num = %d, current_seg_id = %d",
            i, sbResMediumTierVolVec_[i].dev_path, sbResMediumTierVolVec_[i].segment_num,
            sbResMediumTierVolVec_[i].cur_seg_id);
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %r15
movq (%rsi), %rax
movq %rax, 0x18(%rdi)
shrq $0x20, %rax
imulq $0x108, %rax, %r14      # imm = 0x108
addq $0x8, %r14
cmpq %rdx, %r14
movq %rdx, 0x8(%rsp)
jne 0x1cb62
movq %rsi, %r12
addq $0x8, %r12
leaq 0x20(%r15), %r13
xorl %ebx, %ebx
leaq 0x10(%rsp), %rbp
cmpl %eax, %ebx
jae 0x1cbc2
movl $0x108, %edx            # imm = 0x108
movq %rbp, %rdi
movq %r12, %rsi
callq 0x6370
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1d6ea
addq $0x108, %r12            # imm = 0x108
incl %ebx
movl 0x1c(%r15), %eax
jmp 0x1cb30
movq %rdx, %r13
movq 0x1546c(%rip), %rbx     # 0x31fd8
movq (%rbx), %r12
callq 0x63c0
leaq 0x2635(%rip), %rsi      # 0x1f1b0
leaq 0x4a0f(%rip), %rcx      # 0x21591
leaq 0x483f(%rip), %r8       # 0x213c8
movq %r12, %rdi
movq %rax, %rdx
movl $0x2bc, %r9d            # imm = 0x2BC
xorl %eax, %eax
callq 0x6580
movq (%rbx), %rdi
movl 0x40(%r15), %r8d
leaq 0x49fc(%rip), %rsi      # 0x215a6
movq %r13, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x6580
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
cmpq 0x8(%rsp), %r14
sete %al
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::GetSST(char*, unsigned long)
bool MediumTier::GetSST(char* buf, uint64_t length) {
    char* buf_ptr = buf;
    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 %rsi, %rbx
movq %rdi, %r14
leaq 0x48(%rdi), %r15
xorl %r12d, %r12d
movl 0x40(%r14), %r13d
cmpl %r13d, %r12d
jae 0x1cc43
movl %r12d, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xb220
movq (%rax), %rdi
callq 0x1df34
movq %rax, %rbp
movl %r12d, (%rsp)
movq %r15, %rdi
movq %rsp, %rsi
callq 0xb220
movq (%rax), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1ddee
testb %al, %al
je 0x1cc43
addq %rbp, %rbx
incl %r12d
jmp 0x1cbf4
cmpl %r13d, %r12d
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::SetSST(char*, unsigned long)
bool MediumTier::SetSST(char* buf, uint64_t length) {
    char* buf_ptr = buf;
    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 %rsi, %rbx
movq %rdi, %r14
leaq 0x48(%rdi), %r15
xorl %r12d, %r12d
movl 0x40(%r14), %r13d
cmpl %r13d, %r12d
jae 0x1ccbf
movl %r12d, 0x4(%rsp)
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0xb220
movq (%rax), %rdi
callq 0x1df34
movq %rax, %rbp
movl %r12d, (%rsp)
movq %r15, %rdi
movq %rsp, %rsi
callq 0xb220
movq (%rax), %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x1ddf8
testb %al, %al
je 0x1ccbf
addq %rbp, %rbx
incl %r12d
jmp 0x1cc70
cmpl %r13d, %r12d
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::CreateVolume(std::vector<hlkvds::BlockDevice*, std::allocator<hlkvds::BlockDevice*>>&)
bool MediumTier::CreateVolume(std::vector<BlockDevice*> &bd_vec) {

    segSize_ = options_.secondary_seg_size;
    uint32_t align_bit = log2(ALIGNED_SIZE);
    if (segSize_ != (segSize_ >> align_bit) << align_bit) {
        __ERROR("Medium Tier Segment Size is not page aligned!");
        return false;
    }

    int fast_tier_device_num = hlkvds::FastTierVolNum;
    volNum_ = bd_vec.size() - fast_tier_device_num;

    for (uint32_t i = 0; i < volNum_; i++ ) {
        BlockDevice *bdev = bd_vec[i + fast_tier_device_num];
        uint64_t device_capacity = bdev->GetDeviceCapacity();
        uint32_t seg_num = DS_MultiTier_Impl::CalcSegNumForMediumTierVolume(device_capacity, segSize_);
        Volume *vol = new Volume(bdev, idxMgr_, options_, i, 0, segSize_, seg_num, 0);
        volMap_.insert( pair<int, Volume*>(i, vol) );
        segTotalNum_ += seg_num;
    }

    initSBReservedContentForCreate();
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq (%rdi), %rax
movl 0x48(%rax), %ebp
movl %ebp, 0x38(%rdi)
testw $0xfff, %bp             # imm = 0xFFF
jne 0x1cdc7
movq %rdi, %rbx
movl %ebp, 0xc(%rsp)
movq 0x8(%rsi), %rax
subq (%rsi), %rax
shrq $0x3, %rax
decl %eax
movl %eax, 0x40(%rdi)
leaq 0x48(%rdi), %rcx
movq %rcx, 0x10(%rsp)
xorl %r12d, %r12d
movl %eax, %eax
cmpq %rax, %r12
jae 0x1cda4
movq %rsi, %r15
movq (%rsi), %rax
movq 0x8(%rax,%r12,8), %r14
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movl 0x38(%rbx), %esi
movq %rax, %rdi
callq 0x8e10
movl %eax, %r13d
pushq $0x58
popq %rdi
callq 0x6410
movq %rax, %rbp
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
movl 0x38(%rbx), %eax
subq $0x8, %rsp
movq %rbp, %rdi
movq %r14, %rsi
movl %r12d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq %r13
pushq %rax
callq 0x1dc4c
addq $0x20, %rsp
movl %r12d, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xccc8
addl %r13d, 0x3c(%rbx)
movl 0x40(%rbx), %eax
incq %r12
movq %r15, %rsi
jmp 0x1cd19
movq %rbx, %rdi
callq 0x1ce34
movl 0xc(%rsp), %ebp
testw $0xfff, %bp             # imm = 0xFFF
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1520a(%rip), %r14     # 0x31fd8
movq (%r14), %rbx
callq 0x63c0
leaq 0x24c8(%rip), %rsi      # 0x1f2a5
leaq 0x4695(%rip), %rcx      # 0x21479
leaq 0x45dd(%rip), %r8       # 0x213c8
movq %rbx, %rdi
movq %rax, %rdx
movl $0x2eb, %r9d            # imm = 0x2EB
xorl %eax, %eax
callq 0x6580
movq (%r14), %rcx
leaq 0x47d3(%rip), %rdi      # 0x215db
pushq $0x2d
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1cdb0
movq %rax, %rbx
movq %rbp, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::initSBReservedContentForCreate()
void MediumTier::initSBReservedContentForCreate() {
    sbResMediumTierHeader_.segment_size = segSize_;
    sbResMediumTierHeader_.volume_num = volNum_;
    for (uint32_t i = 0; i < volNum_; i++) {
        MultiTierDS_SB_Reserved_MediumTier_Content sb_res_item;
        string dev_path = volMap_[i]->GetDevicePath();
        memcpy((void*)&sb_res_item.dev_path, (const void*)dev_path.c_str(), dev_path.size());
        sb_res_item.segment_num = volMap_[i]->GetNumberOfSeg();
        sb_res_item.cur_seg_id = volMap_[i]->GetCurSegId();
        sbResMediumTierVolVec_.push_back(sb_res_item);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
movl 0x38(%rdi), %ecx
movl 0x40(%rdi), %eax
movl %ecx, 0x18(%rdi)
movl %eax, 0x1c(%rdi)
leaq 0x48(%rdi), %r14
leaq 0x20(%rdi), %rcx
movq %rcx, 0x8(%rsp)
xorl %r15d, %r15d
leaq 0x30(%rsp), %r12
leaq 0x4(%rsp), %r13
leaq 0x10(%rsp), %rbp
cmpl %eax, %r15d
jae 0x1cf14
movl $0x108, %edx            # imm = 0x108
movq %r12, %rdi
xorl %esi, %esi
callq 0x6250
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xb220
movq (%rax), %rsi
movq %rbp, %rdi
callq 0x1df22
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r12, %rdi
callq 0x6370
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xb220
movq (%rax), %rax
movl 0x3c(%rax), %eax
movl %eax, 0x130(%rsp)
movl %r15d, 0x4(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xb220
movq (%rax), %rdi
callq 0x1df1a
movl %eax, 0x134(%rsp)
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x1d6ea
movq %rbp, %rdi
callq 0x6788
incl %r15d
movl 0x40(%rbx), %eax
jmp 0x1ce73
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1cf2a
jmp 0x1cf2a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6788
movq %rbx, %rdi
callq 0x6680
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::OpenVolume(std::vector<hlkvds::BlockDevice*, std::allocator<hlkvds::BlockDevice*>>&)
bool MediumTier::OpenVolume(std::vector<BlockDevice*> &bd_vec) {
    int fast_tier_device_num = hlkvds::FastTierVolNum;

    segSize_ = sbResMediumTierHeader_.segment_size;
    volNum_ = sbResMediumTierHeader_.volume_num;

    if (!verifyTopology(bd_vec)) {
        __ERROR("TheDevice Topology is inconsistent");
        return false;
    }

    for (uint32_t i = 0; i < volNum_; i++) {
        BlockDevice *bdev = bd_vec[i + fast_tier_device_num];
        uint32_t seg_num = sbResMediumTierVolVec_[i].segment_num;
        uint32_t cur_seg_id = sbResMediumTierVolVec_[i].cur_seg_id;
        Volume *vol = new Volume(bdev, idxMgr_, options_, i, 0, segSize_, seg_num, cur_seg_id);
        volMap_.insert( pair<int, Volume*>(i, vol) );
        segTotalNum_ += seg_num;
    }
    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r15
movl 0x18(%rdi), %eax
movl 0x1c(%rdi), %ecx
movl %eax, 0x38(%rdi)
movl %ecx, 0x40(%rdi)
movq %rsi, 0x18(%rsp)
callq 0x1d090
movb %al, 0xf(%rsp)
testb %al, %al
je 0x1d013
leaq 0x48(%r15), %rax
movq %rax, 0x10(%rsp)
movl $0x104, %r14d           # imm = 0x104
xorl %r13d, %r13d
movl 0x40(%r15), %eax
cmpq %rax, %r13
jae 0x1d06a
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax,%r13,8), %rbx
movq 0x20(%r15), %rax
movl -0x4(%rax,%r14), %r12d
movl (%rax,%r14), %eax
movq %rax, 0x20(%rsp)
pushq $0x58
popq %rdi
callq 0x6410
movq %rax, %rbp
movq (%r15), %rcx
movq 0x10(%r15), %rdx
movl 0x38(%r15), %eax
subq $0x8, %rsp
movq %rbp, %rdi
movq %rbx, %rsi
movl %r13d, %r8d
xorl %r9d, %r9d
pushq 0x28(%rsp)
pushq %r12
pushq %rax
callq 0x1dc4c
addq $0x20, %rsp
movl %r13d, 0x28(%rsp)
movq %rbp, 0x30(%rsp)
movq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0xccc8
addl %r12d, 0x3c(%r15)
addq $0x108, %r14            # imm = 0x108
incq %r13
jmp 0x1cf85
movq 0x14fbe(%rip), %r14     # 0x31fd8
movq (%r14), %rbx
callq 0x63c0
leaq 0x227c(%rip), %rsi      # 0x1f2a5
leaq 0x4481(%rip), %rcx      # 0x214b1
leaq 0x4391(%rip), %r8       # 0x213c8
movq %rbx, %rdi
movq %rax, %rdx
movl $0x306, %r9d            # imm = 0x306
xorl %eax, %eax
callq 0x6580
movq (%r14), %rcx
leaq 0x4468(%rip), %rdi      # 0x214bc
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movb 0xf(%rsp), %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rbp, %rdi
callq 0x63f0
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::verifyTopology(std::vector<hlkvds::BlockDevice*, std::allocator<hlkvds::BlockDevice*>>&)
bool MediumTier::verifyTopology(std::vector<BlockDevice*> &bd_vec) {
    int fast_tier_device_num = hlkvds::FastTierVolNum;

    // Verify MediumTier Volume Number
    if (volNum_ != bd_vec.size() - fast_tier_device_num) {
        __ERROR("record MediumTierVolNum_ = %d, total block device number: %d", volNum_, (int)bd_vec.size() );
        return false;
    }

    // Verify MediumTier every Volume
    for (uint32_t i = 0; i < volNum_; i++) {
        string record_path = string(sbResMediumTierVolVec_[i].dev_path);
        string device_path = bd_vec[i + fast_tier_device_num]->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
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rcx
subq (%rsi), %rcx
movl 0x40(%rdi), %eax
sarq $0x3, %rcx
decq %rcx
cmpq %rax, %rcx
jne 0x1d13e
xorl %r13d, %r13d
leaq 0x8(%rsp), %r15
leaq 0x28(%rsp), %r12
xorl %ebp, %ebp
movl %eax, %eax
cmpq %rax, %rbp
jae 0x1d12a
movq 0x20(%r14), %rsi
addq %r13, %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x6150
movq (%rbx), %rax
movq 0x8(%rax,%rbp,8), %rsi
movq (%rsi), %rax
movq %r12, %rdi
callq *0x28(%rax)
movq %r15, %rdi
movq %r12, %rsi
callq 0xb492
testb %al, %al
jne 0x1d1a7
movq %r12, %rdi
callq 0x6788
movq %r15, %rdi
callq 0x6788
movl 0x40(%r14), %eax
addq $0x108, %r13            # imm = 0x108
incq %rbp
jmp 0x1d0cd
movb $0x1, %bpl
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x14e93(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0x2150(%rip), %rsi      # 0x1f2a5
leaq 0x256b(%rip), %rcx      # 0x1f6c7
leaq 0x4265(%rip), %r8       # 0x213c8
xorl %ebp, %ebp
movq %r15, %rdi
movq %rax, %rdx
movl $0x39f, %r9d            # imm = 0x39F
xorl %eax, %eax
callq 0x6580
movq (%r12), %rdi
movl 0x40(%r14), %edx
movq 0x8(%rbx), %rcx
subq (%rbx), %rcx
shrq $0x3, %rcx
leaq 0x4477(%rip), %rsi      # 0x21609
xorl %eax, %eax
callq 0x6580
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1d12d
movq 0x14e2a(%rip), %r15     # 0x31fd8
movq (%r15), %rbx
callq 0x63c0
leaq 0x20e8(%rip), %rsi      # 0x1f2a5
leaq 0x2503(%rip), %rcx      # 0x1f6c7
leaq 0x41fd(%rip), %r8       # 0x213c8
xorl %ebp, %ebp
movq %rbx, %rdi
movq %rax, %rdx
movl $0x3a8, %r9d            # imm = 0x3A8
xorl %eax, %eax
callq 0x6580
movq (%r15), %rdi
leaq 0x8(%rsp), %rbx
movq (%rbx), %rdx
leaq 0x28(%rsp), %r14
movq (%r14), %rcx
leaq 0x24dc(%rip), %rsi      # 0x1f6d6
xorl %eax, %eax
callq 0x6580
movq (%r15), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq %r14, %rdi
callq 0x6788
movq %rbx, %rdi
callq 0x6788
jmp 0x1d12d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x6788
movq %rbx, %rdi
callq 0x6680
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::GetTotalFreeSegs()
uint32_t MediumTier::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
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
xorl %ebp, %ebp
leaq 0xc(%rsp), %r15
xorl %r12d, %r12d
cmpl 0x40(%rbx), %r12d
jae 0x1d278
movl %r12d, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xb220
movq (%rax), %rdi
callq 0x1df3c
addl %eax, %ebp
incl %r12d
jmp 0x1d253
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::GetTotalUsedSegs()
uint32_t MediumTier::GetTotalUsedSegs() {
    uint32_t used_num = 0;
    for (uint32_t i = 0; i < volNum_; i++) {
        used_num += volMap_[i]->GetTotalUsedSegs();
    }
    return used_num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
xorl %ebp, %ebp
leaq 0xc(%rsp), %r15
xorl %r12d, %r12d
cmpl 0x40(%rbx), %r12d
jae 0x1d2ca
movl %r12d, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xb220
movq (%rax), %rdi
callq 0x1df46
addl %eax, %ebp
incl %r12d
jmp 0x1d2a5
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Tier.cc
// Function: hlkvds::MediumTier::GetSSTLength()
uint64_t MediumTier::GetSSTLength() {
    uint64_t length = 0;
    for (uint32_t i = 0; i < volNum_; i++) {
        length += volMap_[i]->GetSSTLength();
    }
    return length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x48(%rdi), %r15
xorl %r14d, %r14d
leaq 0xc(%rsp), %r12
xorl %ebp, %ebp
cmpl 0x40(%rbx), %ebp
jae 0x1d31a
movl %ebp, 0xc(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xb220
movq (%rax), %rdi
callq 0x1df34
addq %rax, %r14
incl %ebp
jmp 0x1d2f7
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Utils.cc
// Function: hlkvds::Thread::Start()
int Thread::Start() {
    int result = pthread_create(&tid_, NULL, runThread, (void *) this);
    if (result == 0) {
        running_ = 1;
    }
    return result;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
addq $0x8, %rdi
leaq -0x2f(%rip), %rdx       # 0x1db92
xorl %esi, %esi
movq %rbx, %rcx
callq 0x66e0
testl %eax, %eax
jne 0x1dbd6
movl $0x1, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Utils.cc
// Function: hlkvds::Thread::Join()
int Thread::Join() {
    int result = -1;
    if (running_ == 1) {
        result = pthread_join(tid_, NULL);
        if (result == 0) {
            detached_ = 0;
        }
    }
    return result;
}

// Assembly:
cmpl $0x1, 0x10(%rdi)
jne 0x1dbf9
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
xorl %esi, %esi
callq 0x63d0
testl %eax, %eax
jne 0x1dbf7
andl $0x0, 0x14(%rbx)
xorl %eax, %eax
popq %rbx
retq
pushq $-0x1
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Utils.cc
// Function: hlkvds::Thread::Detach()
int Thread::Detach() {
    int result = -1;
    if (running_ == 1 && detached_ == 0) {
        result = pthread_detach(tid_);
        if (result == 0) {
            detached_ = 1;
        }
    }
    return result;
}

// Assembly:
pushq $-0x1
popq %rax
cmpl $0x1, 0x10(%rdi)
jne 0x1dc28
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x14(%rdi)
jne 0x1dc27
movq 0x8(%rbx), %rdi
callq 0x62e0
testl %eax, %eax
jne 0x1dc27
movl $0x1, 0x14(%rbx)
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Volume.cc
// Function: hlkvds::Volume::GCThdEntry()
void Volume::GCThdEntry() {
    __DEBUG("GC thread start!!");
    while (!gcT_stop_) {
        gcMgr_->BackGC();
        usleep(1000000);
    } __DEBUG("GC thread stop!!");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb 0x50(%rbx), %al
testb $0x1, %al
jne 0x1ddd4
movq 0x10(%rbx), %rdi
callq 0xda6c
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x6570
jmp 0x1ddb8
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Volume.cc
// Function: hlkvds::Volume::Read(char*, unsigned long, long)
bool Volume::Read(char* data, size_t count, off_t offset) {
    uint64_t phy_offset = offset + startOff_;
    if (bdev_->pRead(data, count, phy_offset) != (ssize_t)count) {
        __ERROR("Read data error!!!");
        return false;
    }
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
addq 0x30(%rdi), %rcx
movq (%rdi), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, %r14
cmpq %rbx, %rax
jne 0x1de34
cmpq %rbx, %r14
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1419d(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0x145a(%rip), %rsi      # 0x1f2a5
leaq 0x389a(%rip), %rcx      # 0x216ec
leaq 0x3898(%rip), %r8       # 0x216f1
pushq $0x40
popq %r9
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r12), %rcx
leaq 0x388a(%rip), %rdi      # 0x216ff
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1de22
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Volume.cc
// Function: hlkvds::Volume::Write(char*, unsigned long, long)
bool Volume::Write(char* data, size_t count, off_t offset) {
    uint64_t phy_offset = offset + startOff_;
    if (bdev_->pWrite(data, count, phy_offset) != (ssize_t)count) {
        __ERROR("Write data error!!!");
        return false;
    }
    return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
addq 0x30(%rdi), %rcx
movq (%rdi), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movq %rax, %r14
cmpq %rbx, %rax
jne 0x1dec0
cmpq %rbx, %r14
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x14111(%rip), %r12     # 0x31fd8
movq (%r12), %r15
callq 0x63c0
leaq 0x13ce(%rip), %rsi      # 0x1f2a5
leaq 0x181c(%rip), %rcx      # 0x1f6fa
leaq 0x380c(%rip), %r8       # 0x216f1
pushq $0x49
popq %r9
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x6580
movq (%r12), %rcx
leaq 0x3811(%rip), %rdi      # 0x21712
pushq $0x13
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r12), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
jmp 0x1deae
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/./src/include/Volume.h
// Function: hlkvds::Volume::CalcSegOffsetFromOffset(unsigned long, unsigned long&)
inline bool CalcSegIdFromOffset(uint64_t offset, uint32_t& seg_id) {
        seg_id = offset >> segSizeBit_;
        if (seg_id >= segNum_) {
            return false;
        }
        return true;
    }

// Assembly:
movl 0x3c(%rdi), %eax
movl 0x40(%rdi), %ecx
shrq %cl, %rsi
cmpl %esi, %eax
jbe 0x1dfbf
movl %esi, %edi
shlq %cl, %rdi
movq %rdi, (%rdx)
cmpl %esi, %eax
seta %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Volume.cc
// Function: hlkvds::Volume::ModifyDeathEntry(hlkvds::HashEntry&)
void Volume::ModifyDeathEntry(HashEntry &entry) {
    uint32_t seg_id;
    uint64_t offset = entry.GetHeaderOffset();
    if (!CalcSegIdFromOffset(offset, seg_id)) {
        __ERROR("Calculate Seg Id Wrong!!! offset = %ld", offset);
    }

    uint16_t data_size = entry.GetDataSize();
    uint32_t death_size = (uint32_t) data_size
            + (uint32_t) IndexManager::SizeOfDataHeader();

    segMgr_->AddDeathSize(seg_id, death_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x22(%rax), %r12
movb 0x40(%rdi), %cl
movq %r12, %r14
shrq %cl, %r14
cmpl %r14d, 0x3c(%rdi)
jbe 0x1e047
movzwl 0x16(%rax), %edx
addl $0x20, %edx
movq 0x8(%rbx), %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1a3da
movq %rsi, %r15
movq 0x13f87(%rip), %rbp     # 0x31fd8
movq (%rbp), %r13
callq 0x63c0
leaq 0x1244(%rip), %rsi      # 0x1f2a5
leaq 0x36be(%rip), %rcx      # 0x21726
leaq 0x3682(%rip), %r8       # 0x216f1
movq %r13, %rdi
movq %rax, %rdx
movl $0xac, %r9d
xorl %eax, %eax
callq 0x6580
movq (%rbp), %rdi
leaq 0x36aa(%rip), %rsi      # 0x21737
movq %r12, %rdx
xorl %eax, %eax
callq 0x6580
movq (%rbp), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movq (%r15), %rax
jmp 0x1e026
nop
// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/Write_batch.cc
// Function: hlkvds::WriteBatch::clear()
void WriteBatch::clear() {
    while(!batch_.empty()) {
        KVSlice *slice = batch_.front();
        batch_.pop_front();
        delete slice;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rax
cmpq %rbx, %rax
je 0x1e1c6
movq 0x10(%rax), %r14
movq %rbx, %rdi
callq 0xe078
testq %r14, %r14
je 0x1e1bc
movq %r14, %rdi
callq 0x1835a
movq %r14, %rdi
callq 0x63f0
jmp 0x1e19b
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/eecs280staff[P]unit_test_framework/test/sequence_equal.cpp
// Function: array_vector_equal()
TEST(array_vector_equal) {
  int a[] = { 1, 2 };
  std::vector<double> b = { 1.0, 2.0 };
  ASSERT_SEQUENCE_EQUAL(a, b);
  ASSERT_SEQUENCE_EQUAL(b, a);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movabsq $0x200000001, %rax      # imm = 0x200000001
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movaps 0x2a02(%rip), %xmm0     # 0x5010
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x18(%rsp), %r14
pushq $0x2
popq %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
callq 0x30c0
leaq 0x2a5a(%rip), %rcx      # 0x508c
pushq $0xd
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30f6
leaq 0x2a98(%rip), %rcx      # 0x50df
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0xe
popq %rdx
callq 0x33da
leaq 0x18(%rsp), %rdi
callq 0x371a
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x371a
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/eecs280staff[P]unit_test_framework/test/sequence_equal.cpp
// Function: array_vector_unequal()
TEST(array_vector_unequal) {
  int a[] = { 1, 2 };
  std::vector<double> b = { 1.0, 2.0, -2.1 };
  ASSERT_SEQUENCE_EQUAL(a, b);
  ASSERT_SEQUENCE_EQUAL(b, a);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movabsq $0x200000001, %rax      # imm = 0x200000001
leaq 0x10(%rsp), %rbx
movq %rax, (%rbx)
movups 0x2d24(%rip), %xmm0     # 0x5400
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
movabsq $-0x3fff333333333333, %rax # imm = 0xC000CCCCCCCCCCCD
movq %rax, 0x10(%rsi)
leaq 0x18(%rsp), %r14
pushq $0x3
popq %rdx
leaq 0xf(%rsp), %rcx
movq %r14, %rdi
callq 0x30c0
leaq 0x297e(%rip), %rcx      # 0x508c
pushq $0x1a
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30f6
leaq 0x29bc(%rip), %rcx      # 0x50df
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
pushq $0x1b
popq %rdx
callq 0x33da
leaq 0x18(%rsp), %rdi
callq 0x371a
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x371a
movq %rbx, %rdi
callq 0x2320
// File: /workspace/github_cpp_makefile_star2_O2/eecs280staff[P]unit_test_framework/./unit_test_framework.hpp
// Function: decltype(print(fp, (*std::begin(fp0), *std::end(fp0))))& unit_test_framework::Diagnostic::print_sequence_helper<std::vector<double, std::allocator<double>>>(std::ostream&, std::vector<double, std::allocator<double>> const&)
static auto print_sequence_helper(std::ostream &os, const Sequence& seq)
      -> decltype(print(os, (*std::begin(seq), *std::end(seq))))& {
      if (std::begin(seq) == std::end(seq)) {
        return os << "{}";
      }

      auto it = std::begin(seq);
      os << "{ ";
      print(os, *it);
      for (++it; it != std::end(seq); ++it) {
        os << ", ";
        print(os, *it);
      }
      return os << " }";
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rsi), %r12
cmpq 0x8(%rsi), %r12
je 0x37fd
movq %rsi, %r14
leaq 0x190c(%rip), %rsi      # 0x50d9
leaq 0x19c9(%rip), %r13      # 0x519d
leaq 0x1901(%rip), %r15      # 0x50dc
movq %rbx, %rdi
callq 0x21c0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x37a4
addq $0x8, %r12
movq %r13, %rsi
cmpq 0x8(%r14), %r12
jne 0x37db
jmp 0x3804
leaq 0x18d2(%rip), %r15      # 0x50d6
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21c0
// File: /workspace/github_cpp_makefile_star2_O2/zengfenfei[P]codility/src/MinAvgTwoSlice.cpp
// Function: solution(std::vector<int, std::allocator<int>>&)
int solution(vector<int> &A) {
	int n = A.size();
	int minI = 0;
	double minAvg = (A[0] + A[1]) / 2.0;
	for (int i = 0; i < n - 2; i++) {
		double avg = (A[i] + A[i + 1]) / 2.0;
		if (avg < minAvg) {
			minAvg = avg;
			minI = i;
		}
		avg = (A[i] + A[i + 1] + A[i + 2]) / 3.0;
		if (avg < minAvg) {
			minAvg = avg;
			minI = i;
		}
	}
	if (n > 2) {	// Check the last 2 elements
		double avg = (A[n - 2] + A[n - 1]) / 2.0;
		if (avg < minAvg) {
			minAvg = avg;
			minI = n - 2;
		}
	}
	return minI;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
movl (%rcx), %r9d
movl 0x4(%rcx), %eax
addl %r9d, %eax
cvtsi2sd %eax, %xmm0
mulsd 0xdb5(%rip), %xmm0      # 0x2008
leal -0x2(%rdx), %esi
xorl %r8d, %r8d
testl %esi, %esi
movl $0x0, %edi
cmovgl %esi, %edi
movsd 0xd9d(%rip), %xmm1      # 0x2008
movsd 0xd9d(%rip), %xmm2      # 0x2010
xorl %eax, %eax
cmpq %r8, %rdi
je 0x12c1
movl 0x4(%rcx,%r8,4), %r10d
addl %r10d, %r9d
cvtsi2sd %r9d, %xmm3
mulsd %xmm1, %xmm3
movapd %xmm3, %xmm4
addl 0x8(%rcx,%r8,4), %r9d
cvtsi2sd %r9d, %xmm5
minsd %xmm0, %xmm4
divsd %xmm2, %xmm5
ucomisd %xmm5, %xmm4
cmoval %r8d, %eax
ucomisd %xmm3, %xmm0
cmoval %r8d, %eax
incq %r8
minsd %xmm4, %xmm5
movl %r10d, %r9d
movapd %xmm5, %xmm0
jmp 0x1275
cmpl $0x2, %edx
jle 0x12e3
movl %esi, %edi
decl %edx
movl (%rcx,%rdx,4), %edx
addl (%rcx,%rdi,4), %edx
cvtsi2sd %edx, %xmm1
mulsd 0xd2c(%rip), %xmm1      # 0x2008
ucomisd %xmm1, %xmm0
cmoval %esi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/zengfenfei[P]codility/src/MinAvgTwoSlice.cpp
// Function: main
int main() {
	vector<int> A(7);
	A[0] = 4;
	A[1] = 2;
	A[2] = 2;
	A[3] = 5;
	A[4] = 1;
	A[5] = 5;
	A[6] = 8;

	cout << solution(A) << '\n';	// 1
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
leaq -0x28(%rbp), %rbx
pushq $0x7
popq %rsi
leaq -0x9(%rbp), %rdx
movq %rbx, %rdi
callq 0x136a
movq (%rbx), %rax
movaps 0xd15(%rip), %xmm0      # 0x2020
movups %xmm0, (%rax)
movabsq $0x500000001, %rcx      # imm = 0x500000001
movq %rcx, 0x10(%rax)
movl $0x8, 0x18(%rax)
movq %rbx, %rdi
callq 0x122c
movq 0x2ca6(%rip), %rdi      # 0x3fd8
movl %eax, %esi
callq 0x10d0
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x10b0
leaq -0x28(%rbp), %rdi
callq 0x13f6
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x28(%rbp), %rdi
callq 0x13f6
movq %rbx, %rdi
callq 0x10e0
// File: /workspace/github_cpp_makefile_star2_O2/robertomaldonado[P]HypercubeTopologyRouting/links.cpp
// Function: create_map(std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&)
void create_map(  map<int, vector<int> > &nodes_map){

    vector<int> vector_nodes;
    vector<int> x_ors;
    vector<int> tmp_neighbors;

    //Initialize the vector for nodes
    for(int i=0; i < total_nodes; i++)
        vector_nodes.push_back(i);
    //Initialize the bits to Xor against
    int last_bit = 1;
    for(int i=0; i < bits_for_node; i++){
        x_ors.push_back(last_bit);
        last_bit = last_bit << 1;
    }
    //For each node, get the neighbors
    for(int j=0; j < vector_nodes.size(); j++){
        //Generate the neighbors
        for(int i=0; i < x_ors.size(); i++)
            tmp_neighbors.push_back( vector_nodes[j]^x_ors[i] );
        //Add node and neigborg to map
        nodes_map[ vector_nodes[j] ] = tmp_neighbors;
        tmp_neighbors.clear();
    }
    vector_nodes.clear();
    x_ors.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq -0x90(%rbp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
andq $0x0, -0x40(%rbp)
movaps %xmm0, (%r14)
andq $0x0, -0x60(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x70(%rbp)
xorl %eax, %eax
leaq -0x2c(%rbp), %r15
movl %eax, -0x2c(%rbp)
cmpl 0x55fd(%rip), %eax      # 0x8170
jge 0x2b87
movq %r14, %rdi
movq %r15, %rsi
callq 0x3138
movl -0x2c(%rbp), %eax
incl %eax
jmp 0x2b6a
leaq -0x2c(%rbp), %r14
movl $0x1, (%r14)
xorl %r12d, %r12d
leaq -0x50(%rbp), %r15
cmpl 0x55d4(%rip), %r12d     # 0x8174
jge 0x2bb5
movq %r15, %rdi
movq %r14, %rsi
callq 0x3138
shll -0x2c(%rbp)
incl %r12d
jmp 0x2b99
xorl %r12d, %r12d
leaq -0x70(%rbp), %r14
leaq -0x30(%rbp), %r15
movq -0x90(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %r12, %rdx
jbe 0x2c4e
xorl %r13d, %r13d
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x2c16
movq -0x90(%rbp), %rcx
movl (%rax,%r13,4), %eax
xorl (%rcx,%r12,4), %eax
movl %eax, -0x30(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x3cd6
incq %r13
jmp 0x2be0
leaq (,%r12,4), %rsi
addq -0x90(%rbp), %rsi
movq %rbx, %rdi
callq 0x3330
movq %rax, %rdi
movq %r14, %rsi
callq 0x3264
movq -0x70(%rbp), %rax
cmpq %rax, -0x68(%rbp)
je 0x2c46
movq %rax, -0x68(%rbp)
incq %r12
jmp 0x2bc0
cmpq %rax, %rcx
je 0x2c5a
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rax
cmpq %rax, -0x48(%rbp)
je 0x2c68
movq %rax, -0x48(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x35fc
leaq -0x50(%rbp), %rdi
callq 0x35fc
leaq -0x90(%rbp), %rdi
callq 0x35fc
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c9b
jmp 0x2c9b
jmp 0x2c9b
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x35fc
leaq -0x50(%rbp), %rdi
callq 0x35fc
leaq -0x90(%rbp), %rdi
callq 0x35fc
movq %rbx, %rdi
callq 0x2250