// File: Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::execScan(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>>>>&)
int32_t Redis::execScan(const std::string& cmd, std::vector<std::string>& values)
{
    if(_context==NULL)
    {
        //DEBUG<<"NULL"<<std::endl;
        return -1;
    }
    redisReply* _reply = (redisReply*)::redisCommand(_context, cmd.c_str());
    if(isError(_reply))
    {
        //DEBUG<<"isError"<<std::endl;
        freeReply(_reply);
        return -2;
    }
    //DEBUG<<"_reply->type "<<_reply->type<<std::endl;
    if(_reply->type != REDIS_REPLY_ARRAY)
    {
        //DEBUG<<"not array"<<std::endl;
        freeReply(_reply);
        return -3;
    }
    redisReply* sub_reply = (_reply->element[1]);
    int32_t len = sub_reply->elements;
    values.clear();//
    values.reserve(len);
    for(int32_t i=0;i<len;++i)
    {
        std::string strTemp(sub_reply->element[i]->str, sub_reply->element[i]->len);
        values.push_back(strTemp);
    }
    int32_t ret = -1;
    std::string strTemp(_reply->element[0]->str, _reply->element[0]->len);
    ret = str2num<int32_t>(strTemp);
    freeReply(_reply);
    return ret;
}

// 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, -0xa0(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x6665
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x68d1
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3190
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x11a60
movq -0xa0(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
callq 0x59f0
testb $0x1, %al
jne 0x66ab
jmp 0x66c7
movq -0xa0(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x59c0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x68d1
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
je 0x66ec
movq -0xa0(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x59c0
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x68d1
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
callq 0xb890
movq -0x20(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0xb8b0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x67e9
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xb8(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xc0(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x3670
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq -0xb0(%rbp), %rcx
leaq -0x58(%rbp), %rdi
callq 0x3450
jmp 0x6786
leaq -0x59(%rbp), %rdi
callq 0x3410
movq -0x20(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xb9b0
jmp 0x679e
leaq -0x58(%rbp), %rdi
callq 0x3290
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x6724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x3410
jmp 0x68dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3290
jmp 0x68dd
movl $0xffffffff, -0x70(%rbp) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0xd0(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xd8(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3670
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
movq -0xc8(%rbp), %rcx
leaq -0x90(%rbp), %rdi
callq 0x3450
jmp 0x6847
leaq -0x91(%rbp), %rdi
callq 0x3410
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xba20
movl %eax, -0xdc(%rbp)
jmp 0x686e
movq -0xa0(%rbp), %rdi
movl -0xdc(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x28(%rbp), %rsi
callq 0x59c0
jmp 0x6889
movl -0x70(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3290
jmp 0x68d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x3410
jmp 0x68dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3290
jmp 0x68dd
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x3660
nopw %cs:(%rax,%rax)