// File: Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::hgetall(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>&)
bool Redis::hgetall(const std::string& key, std::map<std::string, std::string>& value)
{
    if(_context == NULL) 
    {
        return false;
    }

    value.clear();
    redisReply* _reply = (redisReply*)::redisCommand(_context, "HGETALL %s", key.c_str());
    if (!isError(_reply)) 
    {
        if (_reply->type == REDIS_REPLY_ERROR) 
        {
            freeReply(_reply);
            return false;
        }
        if (_reply->type == REDIS_REPLY_ARRAY) 
        {
            for (size_t i = 0; i < _reply->elements; i = i+2) 
            {
                std::string key(_reply->element[i]->str, _reply->element[i]->len);
                std::string val(_reply->element[i+1]->str, _reply->element[i+1]->len);
                value[key] = val;
            }
            freeReply(_reply);
            return true;
        }
    }
    freeReply(_reply);
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0xa632
movb $0x0, -0x1(%rbp)
jmp 0xa86c
movq -0x20(%rbp), %rdi
callq 0xbe70
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3190
movq -0xa0(%rbp), %rdi
movq %rax, %rdx
leaq 0xdb5a(%rip), %rsi      # 0x181c1
movb $0x0, %al
callq 0x11a60
movq -0x98(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
callq 0x59f0
testb $0x1, %al
jne 0xa858
movq -0x28(%rbp), %rax
cmpl $0x6, (%rax)
jne 0xa6ac
movq -0x98(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x59c0
movb $0x0, -0x1(%rbp)
jmp 0xa86c
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xa856
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0xa840
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xb0(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xb8(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x3670
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
leaq -0x50(%rbp), %rdi
callq 0x3450
jmp 0xa729
leaq -0x51(%rbp), %rdi
callq 0x3410
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x30(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xd0(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x3670
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq -0xc0(%rbp), %rcx
leaq -0x88(%rbp), %rdi
callq 0x3450
jmp 0xa78f
leaq -0x89(%rbp), %rdi
callq 0x3410
movq -0x20(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xbe90
movq %rax, -0xd8(%rbp)
jmp 0xa7b1
movq -0xd8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3050
jmp 0xa7c6
leaq -0x88(%rbp), %rdi
callq 0x3290
leaq -0x50(%rbp), %rdi
callq 0x3290
movq -0x30(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
jmp 0xa6c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x3410
jmp 0xa87a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x3410
jmp 0xa835
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3290
leaq -0x50(%rbp), %rdi
callq 0x3290
jmp 0xa87a
movq -0x98(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x59c0
movb $0x1, -0x1(%rbp)
jmp 0xa86c
jmp 0xa858
movq -0x98(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x59c0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3660
nopw %cs:(%rax,%rax)