// File: /workspace/github_cpp_makefile_star2_O3/Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::zscan(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, 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>>>>>&)
int32_t Redis::zscan(const std::string& key, int32_t cursor, const std::string& pattern, int32_t count, std::map<std::string, std::string>& score_member)
{
    
     if(_context==NULL)
    {
        //DEBUG<<"NULL"<<std::endl;
        return -1;
    }
    
    if (count <= 0)
    {
        // DEBUG
        return 0;
    }
    std::string cmd = "ZSCAN " + key + " " + num2str<int32_t>(cursor)
                    + (pattern.empty() ? "" : (" MATCH " + pattern))
                    + (count < 0 ? "" : " COUNT " + num2str<int32_t>(count));
    
    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]);
    uint32_t len = sub_reply->elements;
    score_member.clear();
    if(len & 0x01)
    {
        //DEBUG<<"return not match"<<std::endl;
        return -4;
    }
    for(uint32_t i=0;i<len;i=i+2)
    {
        std::string mem(sub_reply->element[i]->str, sub_reply->element[i]->len);
        std::string sco(sub_reply->element[i+1]->str, sub_reply->element[i+1]->len);
        score_member[sco] = mem;
    }
    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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %r9, 0x78(%rsp)
movl %edx, 0x54(%rsp)
movl %r8d, 0x2c(%rsp)
cmpq $0x0, 0x8(%rdi)
je 0x881e
testl %r8d, %r8d
jle 0x8828
movq %rcx, %r15
movq %rsi, %rax
movq %rdi, %r13
leaq 0xba02(%rip), %rsi      # 0x141cd
leaq 0x128(%rsp), %r12
movq %r12, %rdi
movq %rax, %rdx
callq 0xa64c
leaq 0xc40d(%rip), %rsi      # 0x14bf2
movq %r12, %rdi
callq 0x3600
leaq 0xd0(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x882f
movq %rdx, 0xc0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd0(%rsp)
jmp 0x8837
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x8da6
xorl %ebp, %ebp
jmp 0x8da6
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0xc8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x54(%rsp), %rdx
movq %r13, %rsi
callq 0x41be
movq 0xc0(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq 0xf0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x8895
movq 0xd0(%rsp), %rdi
movq 0xe8(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x88c1
leaq 0xf8(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x88bc
movq 0xf8(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x88d0
leaq 0xc0(%rsp), %rdi
callq 0x3110
jmp 0x88e1
leaq 0xe8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33e0
leaq 0x40(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x8905
movq %rsi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x890b
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
cmpq $0x0, 0x8(%r15)
je 0x8948
leaq 0xb7df(%rip), %rsi      # 0x14115
leaq 0xa0(%rsp), %rdi
movq %r15, %rdx
callq 0xa64c
jmp 0x896b
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb947(%rip), %rdx      # 0x142a2
leaq 0xa0(%rsp), %rdi
movq %rdx, %rsi
callq 0x42ba
leaq 0x40(%rsp), %rsi
movq -0x10(%rsi), %rcx
movq -0x8(%rsi), %r8
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rsi, %rcx
je 0x8993
movq 0x40(%rsp), %rdi
movq 0xa0(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x89bf
leaq 0xb0(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x89ba
movq 0xb0(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x89cb
leaq 0x30(%rsp), %rdi
callq 0x3110
jmp 0x89dc
leaq 0xa0(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33e0
leaq 0x18(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x8a00
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x8a06
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movl 0x2c(%rsp), %ebp
testl %ebp, %ebp
js 0x8a85
leaq 0x108(%rsp), %rdi
leaq 0x2c(%rsp), %rdx
movq %r13, %rsi
callq 0x41be
leaq 0xb6d6(%rip), %rcx      # 0x1411d
leaq 0x108(%rsp), %rdi
movl $0x7, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x33e0
leaq 0x68(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x8aa4
movq %rsi, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x8aaa
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb80d(%rip), %rdx      # 0x142a2
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0x42ba
jmp 0x8ac2
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x18(%rsp), %rsi
movq -0x10(%rsi), %rcx
movq -0x8(%rsi), %r8
movq 0x60(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rsi, %rcx
je 0x8ae7
movq 0x18(%rsp), %rdi
movq 0x58(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x8b0a
leaq 0x68(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x8b05
movq 0x68(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x8b16
leaq 0x8(%rsp), %rdi
callq 0x3110
jmp 0x8b24
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x33e0
leaq 0x90(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x8b51
movq %rsi, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x8b57
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8b8a
callq 0x3350
testl %ebp, %ebp
js 0x8ba4
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8ba4
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8bb8
callq 0x3350
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8bce
callq 0x3350
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8be2
callq 0x3350
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8bf8
callq 0x3350
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x8c0a
callq 0x3350
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c20
callq 0x3350
movq 0x8(%r13), %rdi
movq 0x80(%rsp), %rsi
xorl %eax, %eax
callq 0xe1b0
movq %rax, %r15
testq %rax, %rax
je 0x8d7c
cmpl $0x2, (%r15)
jne 0x8d83
movq 0x28(%r15), %rax
movq 0x8(%rax), %rbx
movq 0x20(%rbx), %r14
movq 0x78(%rsp), %rdi
callq 0xae64
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testb $0x1, %r14b
jne 0x8d90
movq %r13, 0xe0(%rsp)
testl %r14d, %r14d
je 0x8d26
xorl %ebp, %ebp
leaq 0x8(%rsp), %r12
leaq 0x30(%rsp), %r13
movq 0x28(%rbx), %rax
movl %ebp, %ecx
movq (%rax,%rcx,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 0x42ba
movq 0x28(%rbx), %rax
leal 0x1(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r13, %rdi
callq 0x42ba
movq 0x78(%rsp), %rdi
movq %r13, %rsi
callq 0xab6e
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8d06
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8d1a
callq 0x3350
addl $0x2, %ebp
cmpl %r14d, %ebp
jb 0x8c8b
movq 0x28(%r15), %rax
movq (%rax), %rax
movq 0x18(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
movq %rax, (%rdi)
callq 0x42ba
leaq 0x8(%rsp), %rsi
movq 0xe0(%rsp), %rdi
callq 0xa8e4
movl %eax, %ebp
movq %r15, %rdi
callq 0xbb00
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8d90
callq 0x3350
jmp 0x8d90
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x8d90
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
movq %r15, %rdi
callq 0xbb00
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8da6
callq 0x3350
movl %ebp, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8e89
jmp 0x8e8e
jmp 0x8dcb
movq %rax, %rbx
jmp 0x8dea
movq %rax, %rbx
jmp 0x8e00
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8de6
callq 0x3350
testl %ebp, %ebp
js 0x8e00
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e00
callq 0x3350
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e18
callq 0x3350
jmp 0x8e18
movq %rax, %rbx
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e33
callq 0x3350
jmp 0x8e33
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e4b
callq 0x3350
jmp 0x8e4b
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e66
callq 0x3350
jmp 0x8e66
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x8e7d
callq 0x3350
jmp 0x8e7d
movq %rax, %rbx
leaq 0x138(%rsp), %rax
jmp 0x8ec6
jmp 0x8e89
movq %rax, %rbx
jmp 0x8ebe
movq %rax, %rbx
jmp 0x8eaa
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8eaa
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8ebe
callq 0x3350
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8ed4
callq 0x3350
movq %rbx, %rdi
callq 0x35b0