// File: 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:
subq $0xa8, %rsp
movq %rdi, 0x48(%rsp)
movq %rdi, %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x88(%rsp)
movq 0x1d8(%rax), %rdi
movq 0x90(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x51320
testb $0x1, %al
jne 0x4c181
leaq 0x87(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x8830
movq 0x48(%rsp), %rdi
movq 0x40(%rsp), %rdx
leaq 0x6c7e(%rip), %rsi      # 0x52dc6
callq 0x8680
jmp 0x4c14f
leaq 0x87(%rsp), %rdi
callq 0x8540
jmp 0x4c3c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x87(%rsp), %rdi
callq 0x8540
jmp 0x4c3d5
movq 0x90(%rsp), %rdi
callq 0x16580
movw %ax, 0x72(%rsp)
movzwl 0x72(%rsp), %eax
cmpl $0x0, %eax
jne 0x4c1f0
leaq 0x71(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x8830
movq 0x48(%rsp), %rdi
movq 0x38(%rsp), %rdx
leaq 0x6c09(%rip), %rsi      # 0x52dc6
callq 0x8680
jmp 0x4c1c4
leaq 0x71(%rsp), %rdi
callq 0x8540
jmp 0x4c3c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x71(%rsp), %rdi
callq 0x8540
jmp 0x4c3d5
movzwl 0x72(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movq $-0x1, %rax
cmpq $0x0, %rdi
cmovlq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x68(%rsp)
movq 0x1d8(%rax), %rdi
movq 0x68(%rsp), %rsi
movzwl 0x72(%rsp), %eax
movl %eax, %edx
movq 0x88(%rsp), %rcx
callq 0x50ed0
testb $0x1, %al
jne 0x4c321
jmp 0x4c246
movq 0x24d8b(%rip), %rax     # 0x70fd8
movq (%rax), %rax
movq %rax, 0x30(%rsp)
callq 0x8480
movq 0x30(%rsp), %rdi
movq %rax, %rdx
leaq 0x6248(%rip), %rsi      # 0x524b1
leaq 0x6612(%rip), %rcx      # 0x52882
leaq 0x826b(%rip), %r8       # 0x544e2
movl $0x151, %r9d            # imm = 0x151
movb $0x0, %al
callq 0x86f0
movq 0x24d4d(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x653f(%rip), %rsi      # 0x527d4
movb $0x0, %al
callq 0x86f0
movq 0x24d35(%rip), %rax     # 0x70fd8
movq (%rax), %rdi
leaq 0x6b18(%rip), %rsi      # 0x52dc5
movb $0x0, %al
callq 0x86f0
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x4c2ce
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 0x6ad8(%rip), %rsi      # 0x52dc6
callq 0x8680
jmp 0x4c2f5
leaq 0x67(%rsp), %rdi
callq 0x8540
jmp 0x4c3c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x67(%rsp), %rdi
callq 0x8540
jmp 0x4c3d5
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 0x4c372
leaq 0x65(%rsp), %rdi
callq 0x8540
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x4c394
movq (%rsp), %rdi
callq 0x8610
movb $0x1, 0x66(%rsp)
testb $0x1, 0x66(%rsp)
jne 0x4c3c6
jmp 0x4c3bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x65(%rsp), %rdi
callq 0x8540
jmp 0x4c3d5
movq 0x48(%rsp), %rdi
callq 0x8928
jmp 0x4c3c8
movq 0x50(%rsp), %rax
addq $0xa8, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x8820
nop