// File: Sherhang[P]redis-for-cpp/credis.cpp
// Function: Redis::scan(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, 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::scan(int32_t cursor, const std::string& pattern, int32_t count, std::vector<std::string>& keys)
{
    std::string cmd = "SCAN "  + num2str<int32_t>(cursor)
                    + (pattern.empty() ? "" : (" MATCH " + pattern))
                    + (count < 0 ? "" : " COUNT " + num2str<int32_t>(count));
    return execScan(cmd, keys);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x140(%rbp)
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq -0xc(%rbp), %rdx
callq 0x4560
movq -0x138(%rbp), %rdx
leaq 0x11eb0(%rip), %rsi     # 0x181cd
leaq -0x88(%rbp), %rdi
callq 0xb840
jmp 0x632b
movq -0x18(%rbp), %rdi
callq 0x3610
movb $0x0, -0xda(%rbp)
testb $0x1, %al
jne 0x6341
jmp 0x6379
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x3670
movq -0x148(%rbp), %rdx
movb $0x1, -0xda(%rbp)
leaq 0x11f11(%rip), %rsi     # 0x1827a
leaq -0xd8(%rbp), %rdi
callq 0x3510
jmp 0x6377
jmp 0x6394
movq -0x18(%rbp), %rdx
leaq 0x11d69(%rip), %rsi     # 0x180ed
leaq -0xd8(%rbp), %rdi
callq 0xb510
jmp 0x6392
jmp 0x6394
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0xb620
jmp 0x63ad
movl -0x1c(%rbp), %eax
movb $0x0, -0x102(%rbp)
movb $0x0, -0x129(%rbp)
cmpl $0x0, %eax
jge 0x63fb
leaq -0x101(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x3670
movq -0x150(%rbp), %rdx
movb $0x1, -0x102(%rbp)
leaq 0x11e8f(%rip), %rsi     # 0x1827a
leaq -0x100(%rbp), %rdi
callq 0x3510
jmp 0x63f9
jmp 0x6439
movq -0x140(%rbp), %rsi
leaq -0x128(%rbp), %rdi
leaq -0x1c(%rbp), %rdx
callq 0x4560
jmp 0x6414
movb $0x1, -0x129(%rbp)
leaq 0x11cd3(%rip), %rsi     # 0x180f5
leaq -0x100(%rbp), %rdi
leaq -0x128(%rbp), %rdx
callq 0xb840
jmp 0x6437
jmp 0x6439
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0xb620
jmp 0x644f
leaq -0x100(%rbp), %rdi
callq 0x3290
testb $0x1, -0x129(%rbp)
jne 0x6466
jmp 0x6472
leaq -0x128(%rbp), %rdi
callq 0x3290
testb $0x1, -0x102(%rbp)
jne 0x647d
jmp 0x6489
leaq -0x101(%rbp), %rdi
callq 0x3410
leaq -0x68(%rbp), %rdi
callq 0x3290
leaq -0xd8(%rbp), %rdi
callq 0x3290
testb $0x1, -0xda(%rbp)
jne 0x64a9
jmp 0x64b5
leaq -0xd9(%rbp), %rdi
callq 0x3410
leaq -0x88(%rbp), %rdi
callq 0x3290
leaq -0xa8(%rbp), %rdi
callq 0x3290
movq -0x140(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq -0x48(%rbp), %rsi
callq 0x6630
movl %eax, -0x154(%rbp)
jmp 0x64e9
leaq -0x48(%rbp), %rdi
callq 0x3290
movl -0x154(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x65f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x65ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x65c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x65a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
jmp 0x6589
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x3290
testb $0x1, -0x129(%rbp)
jne 0x6594
jmp 0x65a0
leaq -0x128(%rbp), %rdi
callq 0x3290
jmp 0x65a2
testb $0x1, -0x102(%rbp)
jne 0x65ad
jmp 0x65b9
leaq -0x101(%rbp), %rdi
callq 0x3410
leaq -0x68(%rbp), %rdi
callq 0x3290
leaq -0xd8(%rbp), %rdi
callq 0x3290
testb $0x1, -0xda(%rbp)
jne 0x65d9
jmp 0x65e5
leaq -0xd9(%rbp), %rdi
callq 0x3410
leaq -0x88(%rbp), %rdi
callq 0x3290
leaq -0xa8(%rbp), %rdi
callq 0x3290
jmp 0x661a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb0(%rbp)
movl %eax, -0xb4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x3290
movq -0xb0(%rbp), %rdi
callq 0x3660
nopw %cs:(%rax,%rax)