// File: /workspace/github_cpp_makefile_star2_O2/yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::OpenAllComponents()
bool DS_MultiVolume_Impl::OpenAllComponents() {
    volNum_ = sbResHeader_.volume_num;
    segSize_ = sbResHeader_.segment_size;
    maxValueLen_ = segSize_ - SegBase::SizeOfSegOnDisk() - IndexManager::SizeOfHashEntryOnDisk();
    sstLengthOnDisk_ = sbMgr_->GetSSTRegionLength();

    BlockDevice *meta_bdev = bdVec_[0];
    uint32_t meta_seg_num = sbResVolVec_[0].segment_num;
    uint32_t meta_cur_seg_id = sbResVolVec_[0].cur_seg_id;

    if (!verifyTopology()) {
        __ERROR("The Device Topoloygy is inconsistent");
        return false;
    }

    //Create Meta Volume
    uint64_t start_off = sbMgr_->GetSSTRegionOffset() + sstLengthOnDisk_;

    Volume *meta_vol = new Volume(meta_bdev, idxMgr_, options_, 0, start_off, segSize_, meta_seg_num, meta_cur_seg_id);
    volMap_.insert( pair<int, Volume *>(0, meta_vol) );

    segTotalNum_ += meta_seg_num;

    //Create Pure Volumes
    if (volNum_ > 1) {
        for (uint32_t i = 1 ; i < volNum_; i++) {
            BlockDevice *bdev = bdVec_[i];
            uint32_t seg_num = sbResVolVec_[i].segment_num;
            uint32_t cur_seg_id = sbResVolVec_[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 $0x28, %rsp
movq %rdi, %r14
movl 0x124(%rdi), %eax
movl %eax, 0xe0(%rdi)
movl 0x120(%rdi), %eax
movl %eax, 0xd8(%rdi)
addl $-0x4a, %eax
movl %eax, 0xdc(%rdi)
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
movq 0x24(%rcx), %rcx
movq %rcx, 0xe8(%rdi)
movq (%rax), %rax
movq (%rax), %rbx
movq 0x128(%rdi), %rax
movl 0x100(%rax), %r13d
movl 0x104(%rax), %ebp
callq 0xa812
movb %al, 0x7(%rsp)
testb %al, %al
je 0xa78c
movq 0x18(%r14), %rax
movq 0xe8(%r14), %r15
addq 0x1c(%rax), %r15
pushq $0x58
popq %rdi
callq 0x6410
movq %rax, %r12
movq 0x8(%r14), %rcx
movq 0x20(%r14), %rdx
movl 0xd8(%r14), %eax
subq $0x8, %rsp
movq %r12, %rdi
movq %rbx, %rsi
xorl %r8d, %r8d
movq %r15, %r9
pushq %rbp
pushq %r13
pushq %rax
callq 0x1dc4c
addq $0x20, %rsp
leaq 0x28(%r14), %rdi
leaq 0x18(%rsp), %rsi
andl $0x0, (%rsi)
movq %r12, 0x8(%rsi)
movq %rdi, 0x8(%rsp)
callq 0xccc8
addl %r13d, 0xe4(%r14)
movl 0xe0(%r14), %eax
cmpl $0x2, %eax
jb 0xa7e3
pushq $0x1
popq %r12
movl $0x20c, %ebp            # imm = 0x20C
movl %eax, %eax
cmpq %rax, %r12
jae 0xa7e3
movq 0x10(%r14), %rax
movq 0x128(%r14), %rcx
movq (%rax), %rax
movq (%rax,%r12,8), %r13
movl -0x4(%rcx,%rbp), %r15d
movl (%rcx,%rbp), %eax
movq %rax, 0x10(%rsp)
pushq $0x58
popq %rdi
callq 0x6410
movq %rax, %rbx
movq 0x8(%r14), %rcx
movq 0x20(%r14), %rdx
movl 0xd8(%r14), %eax
subq $0x8, %rsp
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %r8d
xorl %r9d, %r9d
pushq 0x18(%rsp)
pushq %r15
pushq %rax
callq 0x1dc4c
addq $0x20, %rsp
movl %r12d, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xccc8
addl %r15d, 0xe4(%r14)
incq %r12
movl 0xe0(%r14), %eax
addq $0x108, %rbp            # imm = 0x108
jmp 0xa6f2
movq 0x27845(%rip), %r14     # 0x31fd8
movq (%r14), %rbx
callq 0x63c0
leaq 0x14b03(%rip), %rsi     # 0x1f2a5
leaq 0x14b1c(%rip), %rcx     # 0x1f2c5
leaq 0x14bb0(%rip), %r8      # 0x1f360
movq %rbx, %rdi
movq %rax, %rdx
movl $0x161, %r9d            # imm = 0x161
xorl %eax, %eax
callq 0x6580
movq (%r14), %rcx
leaq 0x14e8d(%rip), %rdi     # 0x1f65a
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x6750
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x64b0
movb 0x7(%rsp), %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r12, %rdi
jmp 0xa804
movq %rax, %r14
movq %rbx, %rdi
callq 0x63f0
movq %r14, %rdi
callq 0x6680
nop