// File: /workspace/github_cpp_makefile_star2_O1/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 0x88a2
testl %r8d, %r8d
jle 0x88ac
movq %rcx, %r15
movq %rsi, %rax
movq %rdi, %r13
leaq 0xb97e(%rip), %rsi      # 0x141cd
leaq 0x128(%rsp), %r12
movq %r12, %rdi
movq %rax, %rdx
callq 0xa756
leaq 0xc389(%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 0x88b3
movq %rdx, 0xc0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd0(%rsp)
jmp 0x88bb
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x8e31
xorl %ebp, %ebp
jmp 0x8e31
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 0x41b0
movq 0xc0(%rsp), %rcx
movq 0xc8(%rsp), %r8
movq 0xf0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x8919
movq 0xd0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x893e
leaq 0xf8(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x8939
movq 0xf8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x8955
movq 0xe8(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0x3110
jmp 0x8966
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 0x898a
movq %rsi, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x8990
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 0x89cd
leaq 0xb75a(%rip), %rsi      # 0x14115
leaq 0xa0(%rsp), %rdi
movq %r15, %rdx
callq 0xa756
jmp 0x89f0
leaq 0xb0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb8c2(%rip), %rdx      # 0x142a2
leaq 0xa0(%rsp), %rdi
movq %rdx, %rsi
callq 0x42a6
leaq 0x40(%rsp), %rdi
movq -0x10(%rdi), %rcx
movq -0x8(%rdi), %r8
movq 0xa8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rdi, %rcx
je 0x8a18
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x8a3d
leaq 0xb0(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x8a38
movq 0xb0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x8a51
movq 0xa0(%rsp), %rsi
leaq 0x30(%rsp), %rdi
callq 0x3110
jmp 0x8a62
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 0x8a86
movq %rsi, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x8a8c
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
setns %r15b
js 0x8b0f
leaq 0x108(%rsp), %rdi
leaq 0x2c(%rsp), %rdx
movq %r13, %rsi
callq 0x41b0
leaq 0xb64c(%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 0x8b2e
movq %rsi, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x8b34
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb783(%rip), %rdx      # 0x142a2
leaq 0x58(%rsp), %rdi
movq %rdx, %rsi
callq 0x42a6
jmp 0x8b4c
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), %rdi
movq -0x10(%rdi), %rcx
movq -0x8(%rdi), %r8
movq 0x60(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rdi, %rcx
je 0x8b71
movq 0x18(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x8b90
leaq 0x68(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x8b8b
movq 0x68(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x8ba1
movq 0x58(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3110
jmp 0x8baf
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 0x8bdc
movq %rsi, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x8be2
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 0x8c15
callq 0x3350
testl %ebp, %ebp
js 0x8c2f
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c2f
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8c43
callq 0x3350
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c59
callq 0x3350
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8c6d
callq 0x3350
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8c83
callq 0x3350
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x8c95
callq 0x3350
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8cab
callq 0x3350
movq 0x8(%r13), %rdi
movq 0x80(%rsp), %rsi
xorl %eax, %eax
callq 0xe300
movq %rax, %r15
testq %rax, %rax
je 0x8e07
cmpl $0x2, (%r15)
jne 0x8e0e
movq 0x28(%r15), %rax
movq 0x8(%rax), %rbx
movq 0x20(%rbx), %r14
movq 0x78(%rsp), %rdi
callq 0xafa6
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
testb $0x1, %r14b
jne 0x8e1b
movq %r13, 0xe0(%rsp)
testl %r14d, %r14d
je 0x8db1
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 0x42a6
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 0x42a6
movq 0x78(%rsp), %rdi
movq %r13, %rsi
callq 0xac78
movq %rax, %rdi
movq %r12, %rsi
callq 0x3200
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8d91
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8da5
callq 0x3350
addl $0x2, %ebp
cmpl %r14d, %ebp
jb 0x8d16
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 0x42a6
leaq 0x8(%rsp), %rsi
movq 0xe0(%rsp), %rdi
callq 0xa9ee
movl %eax, %ebp
movq %r15, %rdi
callq 0xbc50
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8e1b
callq 0x3350
jmp 0x8e1b
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x8e1b
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
movq %r15, %rdi
callq 0xbc50
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e31
callq 0x3350
movl %ebp, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8f21
jmp 0x8f26
movq %rax, %rbx
jmp 0x8e98
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x8e7a
movq %rax, %rbx
movb $0x1, %r15b
jmp 0x8e95
movq %rax, %rbx
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e7a
callq 0x3350
testb %r15b, %r15b
je 0x8e95
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8e95
callq 0x3350
testb %r15b, %r15b
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8eb0
callq 0x3350
jmp 0x8eb0
movq %rax, %rbx
leaq 0xb0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8ecb
callq 0x3350
jmp 0x8ecb
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8ee3
callq 0x3350
jmp 0x8ee3
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8efe
callq 0x3350
jmp 0x8efe
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x8f15
callq 0x3350
jmp 0x8f15
movq %rax, %rbx
leaq 0x138(%rsp), %rax
jmp 0x8f5e
jmp 0x8f21
movq %rax, %rbx
jmp 0x8f56
movq %rax, %rbx
jmp 0x8f42
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x8f42
callq 0x3350
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x8f56
callq 0x3350
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8f6c
callq 0x3350
movq %rbx, %rdi
callq 0x35b0