// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x5676
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq %rax, -0x38(%rbp)
movq %rdx, %rdi
callq 0x79b8
movq 0x8(%r15), %r12
subq (%r15), %r12
sarq $0x5, %r12
movl %r12d, %esi
movq %rbx, %rdi
callq 0x79c0
movq %rsp, -0x30(%rbp)
incl %r12d
leaq 0xf(,%r12,8), %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, %rsp
movq $0x4, (%rcx)
movq %rsp, %rdx
subq %rax, %rdx
movq %rdx, %rsp
leaq -0x40(%rbp), %rax
movb $0x0, 0x4(%rax)
movl $0x5445474d, (%rax)     # imm = 0x5445474D
movq %rax, (%rdx)
movq (%r15), %rsi
movq 0x8(%r15), %rax
subq %rsi, %rax
sarq $0x5, %rax
addq $0x8, %rsi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x55eb
movq (%rsi), %r8
movq %r8, 0x8(%rcx,%rdi,8)
movq -0x8(%rsi), %r8
movq %r8, 0x8(%rdx,%rdi,8)
incq %rdi
addq $0x20, %rsi
jmp 0x55cc
leal 0x1(%rax), %esi
movq 0x8(%r14), %rdi
callq 0xb250
movq %rax, %r14
testq %rax, %rax
je 0x5666
cmpl $0x2, (%r14)
jne 0x5666
xorl %r12d, %r12d
leaq -0x50(%rbp), %r13
leaq -0x60(%rbp), %r15
movl %r12d, %r12d
cmpq %r12, 0x20(%r14)
jbe 0x5666
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %r13, -0x60(%rbp)
movq %r15, %rdi
callq 0x7cd0
cmpq $0x0, -0x58(%rbp)
jne 0x564e
movq %r15, %rdi
leaq 0xbc5b(%rip), %rsi      # 0x112a4
callq 0x35f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7a4c
movq %r15, %rdi
callq 0x3180
incl %r12d
jmp 0x5610
movq %r14, %rsi
callq 0x43f8
movq -0x30(%rbp), %rsp
movq -0x38(%rbp), %rax
testq %rax, %rax
setne %al
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
nop