// File: Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::mget(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
bool Redis::mget(const std::vector<std::string>& keys, std::vector<std::string>& values)
{
    if(_context==NULL)
    {
        return false;
    }
    values.clear(); 
    uint32_t len = keys.size();
    values.reserve(len);
    uint32_t argc = 1;
    size_t argvlen[len+1];
    argvlen[0] = 4; 
    
    const char* argv[len+1];
    char argv1[] = "MGET";
    argv[0] = argv1;
    
    for(size_t t=0; t<keys.size(); t++)
    {
        argvlen[t+1] = keys[t].size();
        argv[t+1] = keys[t].c_str();
        argc++;
    }

    redisReply* _reply = (redisReply*)::redisCommandArgv(_context, argc, argv, argvlen);
    
    if (_reply && _reply->type == REDIS_REPLY_ARRAY)
    {
	    for (unsigned int i = 0; i < _reply->elements; i++)
	    {
                std::string strTemp(_reply->element[i]->str,_reply->element[i]->len);
                if(strTemp.size() <= 0)
                    strTemp="";
                values.push_back(strTemp);
	    }
    }

    freeReply(_reply);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x7a32
movb $0x0, -0x1(%rbp)
jmp 0x7cc9
movq -0x20(%rbp), %rdi
callq 0xb890
movq -0x18(%rbp), %rdi
callq 0x4540
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0xb8b0
movl $0x1, -0x28(%rbp)
movl -0x24(%rbp), %eax
incl %eax
movl %eax, %edx
movq %rsp, %rax
movq %rax, -0x30(%rbp)
leaq 0xf(,%rdx,8), %rcx
andq $-0x10, %rcx
movq %rsp, %rax
movq %rax, %rsi
subq %rcx, %rsi
movq %rsi, -0xb0(%rbp)
movq %rsi, %rsp
negq %rcx
movq %rdx, -0x38(%rbp)
movq $0x4, (%rax,%rcx)
movl -0x24(%rbp), %eax
incl %eax
movl %eax, %ecx
leaq 0xf(,%rcx,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rax
subq %rdx, %rax
movq %rax, -0xa8(%rbp)
movq %rax, %rsp
movq %rcx, -0x40(%rbp)
movl 0x10652(%rip), %ecx     # 0x18117
movl %ecx, -0x45(%rbp)
movb 0x1064d(%rip), %cl      # 0x1811b
movb %cl, -0x41(%rbp)
leaq -0x45(%rbp), %rcx
movq %rcx, (%rax)
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4540
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0x7b6d
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xbac0
movq %rax, %rdi
callq 0x32d0
movq %rax, %rdx
movq -0xb0(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xbac0
movq %rax, %rdi
callq 0x3190
movq %rax, %rdx
movq -0xa8(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x7ae0
movq -0xb0(%rbp), %rcx
movq -0xa8(%rbp), %rdx
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x28(%rbp), %esi
callq 0x11b20
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x7cae
movq -0x58(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x7cae
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x7cac
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x5c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xc8(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xd0(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x3670
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq -0xc0(%rbp), %rcx
leaq -0x80(%rbp), %rdi
callq 0x3450
jmp 0x7c1a
leaq -0x81(%rbp), %rdi
callq 0x3410
leaq -0x80(%rbp), %rdi
callq 0x32d0
cmpq $0x0, %rax
ja 0x7c86
leaq 0x1063e(%rip), %rsi     # 0x1827a
leaq -0x80(%rbp), %rdi
callq 0x3500
jmp 0x7c47
jmp 0x7c86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x81(%rbp), %rdi
callq 0x3410
jmp 0x7cd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x3290
jmp 0x7cd3
movq -0x20(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xb9b0
jmp 0x7c95
leaq -0x80(%rbp), %rdi
callq 0x3290
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x7bb1
jmp 0x7cae
movq -0xa0(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x59c0
movb $0x1, -0x1(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rsp
movb -0x1(%rbp), %al
andb $0x1, %al
movq %rbp, %rsp
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x3660
nop