// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::exec(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::exec(const std::string& cmd, std::vector<std::string>& values)
{
    values.clear();
    if(_context==NULL) 
    {
        return false;
    }
    redisReply* _reply = (redisReply*)::redisCommand(_context, cmd.c_str());
    if(isError(_reply))
    {
        freeReply(_reply);
        return false;
    }
    //DEBUG<<"_reply->type = "<<_reply->type<<std::endl;
    switch (_reply->type)
    {
        case REDIS_REPLY_ERROR:
        {
            freeReply(_reply);
            return false;
        }
        break;

        case REDIS_REPLY_ARRAY:
        {
            int32_t elements = _reply->elements;
            values.reserve(elements);
            for(int32_t i=0; i<elements; ++i)
            {
                std::string strTemp(_reply->element[i]->str, _reply->element[i]->len);
                values.push_back(strTemp);
            }
            freeReply(_reply);
            return true;
        }
        break;
        
        case REDIS_REPLY_INTEGER:
        {
            std::string num = num2str<int64_t>(_reply->integer);
            values.push_back(num);
            freeReply(_reply);
            return true;
        }
        break;

        case REDIS_REPLY_STRING:
        {
            std::string tmp = _reply->str;
            values.push_back(tmp);
            freeReply(_reply);
            return true;
        }
        break;

        case REDIS_REPLY_STATUS:
        {
            std::string tmp = _reply->str;
            values.push_back(tmp);
            freeReply(_reply);
            return true;
        }
        break;

        case REDIS_REPLY_NIL:
        {
            freeReply(_reply);
            return true;
        }
        break;

        default:
        {
            freeReply(_reply);
            return false;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rdi
callq 0x79b8
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x4268
movq (%rbx), %rsi
xorl %eax, %eax
callq 0xb190
testq %rax, %rax
je 0x4252
movq %rax, %rbx
movl (%rax), %eax
decl %eax
cmpl $0x5, %eax
ja 0x4260
leaq 0xce54(%rip), %rcx      # 0x11074
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rbx), %rsi
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x3140
movq %rsp, %rsi
movq %r14, %rdi
callq 0x7a4c
movq %rbx, %rdi
callq 0x8ae0
jmp 0x432e
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x43f8
jmp 0x4338
movq %rbx, %rdi
callq 0x8ae0
xorl %ebx, %ebx
jmp 0x4338
movq 0x8(%rbx), %rax
leaq 0x20(%rsp), %rdx
movq %rax, (%rdx)
movq %rsp, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x791e
movq %r14, %rdi
movq %r12, %rsi
callq 0x7a4c
movq %rbx, %rdi
callq 0x8ae0
jmp 0x432e
movq 0x20(%rbx), %rax
movslq %eax, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x79c0
leaq 0x10(%rsp), %r13
xorl %ebp, %ebp
testl %r15d, %r15d
cmovlel %ebp, %r15d
movq %rsp, %r12
cmpq %rbp, %r15
je 0x4300
movq 0x28(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %r13, (%rsp)
movq %r12, %rdi
callq 0x7cd0
movq %r14, %rdi
movq %r12, %rsi
callq 0x7a4c
movq %r12, %rdi
callq 0x3180
incq %rbp
jmp 0x42c4
movq %rbx, %rdi
callq 0x8ae0
jmp 0x4336
movq 0x18(%rbx), %rsi
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x3140
movq %rsp, %rsi
movq %r14, %rdi
callq 0x7a4c
movq %rbx, %rdi
callq 0x8ae0
movq %rsp, %rdi
callq 0x3180
movb $0x1, %bl
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4353
jmp 0x4353
jmp 0x4358
jmp 0x4358
jmp 0x4358
movq %rax, %rbx
jmp 0x4363
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3180
movq %rbx, %rdi
callq 0x35a0
nop