// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x9b0a
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0xafa6
movq 0x8(%r14), %rdi
movq (%rbx), %rdx
leaq 0xa7b7(%rip), %rsi      # 0x141e9
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xe300
testq %rax, %rax
je 0x9b21
movq %rax, %r14
movl (%rax), %eax
cmpl $0x6, %eax
je 0x9b0e
cmpl $0x2, %eax
jne 0x9b12
movb $0x1, %bl
cmpq $0x0, 0x20(%r14)
je 0x9b19
leaq 0x38(%rsp), %rbx
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %r13
movq 0x28(%r14), %rax
movq (%rax,%rbp,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x42a6
movq 0x28(%r14), %rax
movq 0x8(%rax,%rbp,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %rbx, 0x28(%rsp)
movq %r13, %rdi
callq 0x42a6
movq %r15, %rdi
movq %r12, %rsi
callq 0xac78
movq %rax, %rdi
movq %r13, %rsi
callq 0x3200
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x9ae4
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9af8
callq 0x3350
addq $0x2, %rbp
cmpq 0x20(%r14), %rbp
jb 0x9a79
movb $0x1, %bl
jmp 0x9b19
xorl %ebx, %ebx
jmp 0x9b21
xorl %ebx, %ebx
jmp 0x9b19
xorl %ebx, %ebx
testq %r14, %r14
je 0x9b21
movq %r14, %rdi
callq 0xbc50
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x9b49
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x9b49
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x9b5d
callq 0x3350
movq %r14, %rdi
callq 0x35b0
nop