// File: yangwanyuan[P]HLKVDS/src/DS_MultiVolume_Impl.cc
// Function: hlkvds::DS_MultiVolume_Impl::GetValueByHashEntry[abi:cxx11](hlkvds::HashEntry*)
string DS_MultiVolume_Impl::GetValueByHashEntry(HashEntry *entry) {
    uint64_t data_offset = 0;

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

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

    return res;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq 0xa8(%rsp), %rdi
movq %rdi, 0x58(%rsp)
movq $0x0, 0x98(%rsp)
movq 0xa0(%rsp), %rsi
callq 0x13530
movq 0x58(%rsp), %rdi
movl %eax, 0x94(%rsp)
addq $0x28, %rdi
leaq 0x94(%rsp), %rsi
callq 0x15a50
movq (%rax), %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
movq 0xa0(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x51320
testb $0x1, %al
jne 0x14eb7
leaq 0x87(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x8830
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rdx
leaq 0x3df48(%rip), %rsi     # 0x52dc6
callq 0x8680
jmp 0x14e85
leaq 0x87(%rsp), %rdi
callq 0x8540
jmp 0x150f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x87(%rsp), %rdi
callq 0x8540
jmp 0x15104
movq 0xa0(%rsp), %rdi
callq 0x16580
movw %ax, 0x72(%rsp)
movzwl 0x72(%rsp), %eax
cmpl $0x0, %eax
jne 0x14f26
leaq 0x71(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x8830
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rdx
leaq 0x3ded3(%rip), %rsi     # 0x52dc6
callq 0x8680
jmp 0x14efa
leaq 0x71(%rsp), %rdi
callq 0x8540
jmp 0x150f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x71(%rsp), %rdi
callq 0x8540
jmp 0x15104
movzwl 0x72(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movq $-0x1, %rax
cmpq $0x0, %rdi
cmovlq %rax, %rdi
callq 0x8040
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rdi
movq 0x68(%rsp), %rsi
movzwl 0x72(%rsp), %eax
movl %eax, %edx
movq 0x98(%rsp), %rcx
callq 0x50ed0
testb $0x1, %al
jne 0x15050
jmp 0x14f75
movq 0x5c05c(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, 0x30(%rsp)
callq 0x8480
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x3d519(%rip), %rsi     # 0x524b1
leaq 0x3d8e3(%rip), %rcx     # 0x52882
leaq 0x3d5ab(%rip), %r8      # 0x52551
movl $0x1ab, %r9d            # imm = 0x1AB
movb $0x0, %al
callq 0x86f0
movq 0x5c01e(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x3d810(%rip), %rsi     # 0x527d4
movb $0x0, %al
callq 0x86f0
movq 0x5c006(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x3dde9(%rip), %rsi     # 0x52dc5
movb $0x0, %al
callq 0x86f0
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x14ffd
movq 0x28(%rsp), %rdi
callq 0x8610
leaq 0x67(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x8830
movq 0x48(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x3dda9(%rip), %rsi     # 0x52dc6
callq 0x8680
jmp 0x15024
leaq 0x67(%rsp), %rdi
callq 0x8540
jmp 0x150f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x67(%rsp), %rdi
callq 0x8540
jmp 0x15104
movq 0x68(%rsp), %rax
movzwl 0x72(%rsp), %ecx
movb $0x0, (%rax,%rcx)
movb $0x0, 0x66(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movzwl 0x72(%rsp), %eax
movq %rax, 0x10(%rsp)
leaq 0x65(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x8830
movq 0x48(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x8570
jmp 0x150a1
leaq 0x65(%rsp), %rdi
callq 0x8540
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x150c3
movq (%rsp), %rdi
callq 0x8610
movb $0x1, 0x66(%rsp)
testb $0x1, 0x66(%rsp)
jne 0x150f5
jmp 0x150eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x65(%rsp), %rdi
callq 0x8540
jmp 0x15104
movq 0x48(%rsp), %rdi
callq 0x8928
jmp 0x150f7
movq 0x50(%rsp), %rax
addq $0xb8, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x8820
nop