// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/demo5.cpp
// Function: main
int main()
{
    Redis redis;
    redis.init("127.0.0.1",6379,"");
    redis.connect();
    for(char k='a';k<='z';++k)
    {
    vector<string> keys(50000);
    vector<string> vals(50000);
    for (int i =0; i<keys.size(); ++i)
    {
        keys[i] = redis.num2str<int>(i);
        if(keys[i].size()<8)
        {
            string num = "00000000";
            keys[i]=num.substr(keys[i].size()) + keys[i] + k ;
        }
        vals[i]= keys[i];
        for(int j =0;j<vals[i].size();++j)
        {
            if(vals[i][j]<='9'&& vals[i][j]>='0')
                vals[i][j]=vals[i][j]-'0'+'a';
        }
        random_shuffle(vals[i].begin(),vals[i].end());//打乱
    }
    //cout<<keys[987]<<" "<<vals[987]<<endl;
    redis.mset(keys,vals);

    }
    vector<string> v;
    redis.getKeys("string", "", 10000, v);
    //redis.keys("*",v);
    
    ofstream file_for_write;
    file_for_write.open("./file/data.txt", ios::trunc);
    file_for_write << "get all keys:"<<endl;
    int ka=1;
    for(int i=0;i<v.size();++i,++ka)
    {
        file_for_write << v[i] <<" ";
        if(ka%10 ==0)
            file_for_write<<endl;
    }
    file_for_write<<endl<<endl<<endl<<endl;
    vector<string> vs;
    redis.mget(v, vs);
    file_for_write<<"get values:"<<endl;
    int kt=1;
    for(int i=0;i<vs.size();++i,++kt)
    {
        file_for_write << vs[i] << " ";
        if(kt >= 10)
        {
            kt = 0x01;
            file_for_write<<endl;
        }
    }

    cout<<endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
leaq 0xb0(%rsp), %rdi
callq 0x4004
leaq 0xd803(%rip), %rsi      # 0x11004
leaq 0x118(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x3140
leaq 0xda8a(%rip), %rsi      # 0x112a4
leaq 0x30(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x3140
leaq 0xb0(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movl $0x18eb, %edx           # imm = 0x18EB
callq 0x40c2
leaq 0x30(%rsp), %rdi
callq 0x3180
leaq 0x118(%rsp), %rdi
callq 0x3180
leaq 0xb0(%rsp), %rdi
callq 0x40ee
movb $0x61, %al
leaq 0x118(%rsp), %r14
leaq 0xb0(%rsp), %r12
leaq 0x30(%rsp), %rbx
leaq 0x90(%rsp), %rbp
movb %al, 0xb(%rsp)
cmpb $0x7b, %al
je 0x3a65
movl $0xc350, %esi           # imm = 0xC350
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
callq 0x3d92
movl $0xc350, %esi           # imm = 0xC350
leaq 0x78(%rsp), %rdi
movq %r14, %rdx
callq 0x3d92
xorl %eax, %eax
movsbl 0xb(%rsp), %ecx
movl %ecx, 0x2c(%rsp)
movl %eax, 0xc(%rsp)
cltq
movq 0x18(%rsp), %rcx
subq 0x10(%rsp), %rcx
sarq $0x5, %rcx
cmpq %rax, %rcx
jbe 0x3a2c
movq %r14, %rdi
movq %r12, %rsi
leaq 0xc(%rsp), %rdx
callq 0x3de4
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3410
movq %r14, %rdi
callq 0x3180
movslq 0xc(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rdi, %rax
shlq $0x5, %rax
cmpq $0x7, 0x8(%rsi,%rax)
ja 0x39d4
movq %r14, %rdi
leaq 0xd6d3(%rip), %rsi      # 0x1100e
movq %rbx, %rdx
callq 0x3140
movslq 0xc(%rsp), %rax
movq 0x10(%rsp), %rcx
shlq $0x5, %rax
movq 0x8(%rcx,%rax), %rdx
movq %rbp, %r15
movq %rbp, %rdi
movq %r14, %rsi
pushq $-0x1
popq %rcx
callq 0x3370
movslq 0xc(%rsp), %rdx
shlq $0x5, %rdx
addq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x3e7c
movq %rbx, %rdi
movq %r13, %rsi
movl 0x2c(%rsp), %edx
callq 0x3e5a
movslq 0xc(%rsp), %rdi
shlq $0x5, %rdi
addq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x3410
movq %rbx, %rdi
callq 0x3180
movq %r13, %rdi
callq 0x3180
movq %rbp, %rdi
callq 0x3180
movq %r14, %rdi
callq 0x3180
movslq 0xc(%rsp), %rdi
movq 0x10(%rsp), %rsi
shlq $0x5, %rdi
addq %rdi, %rsi
addq 0x78(%rsp), %rdi
callq 0x31e0
xorl %eax, %eax
movslq 0xc(%rsp), %rcx
movq 0x78(%rsp), %rdx
shlq $0x5, %rcx
movq (%rdx,%rcx), %rdi
movq 0x8(%rdx,%rcx), %rsi
cmpq %rax, %rsi
jbe 0x3a19
movb (%rdi,%rax), %cl
leal -0x30(%rcx), %edx
cmpb $0x9, %dl
ja 0x3a14
addb $0x31, %cl
movb %cl, (%rdi,%rax)
incq %rax
jmp 0x39e7
addq %rdi, %rsi
callq 0x3e9b
movl 0xc(%rsp), %eax
incl %eax
jmp 0x38c9
movq %r12, %r15
movq %r12, %rdi
leaq 0x10(%rsp), %r13
movq %r13, %rsi
leaq 0x78(%rsp), %r12
movq %r12, %rdx
callq 0x5426
movq %r12, %rdi
callq 0x3eee
movq %r13, %rdi
callq 0x3eee
movb 0xb(%rsp), %al
incb %al
movq %r15, %r12
jmp 0x388e
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
leaq 0xd892(%rip), %rsi      # 0x1130c
leaq 0x118(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x3140
leaq 0xd80e(%rip), %rsi      # 0x112a4
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3140
leaq 0xb0(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x50(%rsp), %r8
movl $0x2710, %ecx           # imm = 0x2710
callq 0x4c7a
leaq 0x30(%rsp), %rdi
callq 0x3180
leaq 0x118(%rsp), %rdi
callq 0x3180
leaq 0x118(%rsp), %rdi
callq 0x3580
leaq 0xd523(%rip), %rsi      # 0x11017
leaq 0x118(%rsp), %rdi
pushq $0x20
popq %rdx
callq 0x3050
leaq 0xd51c(%rip), %rsi      # 0x11027
leaq 0x118(%rsp), %rdi
callq 0x3350
movq %rax, %rdi
callq 0x31a0
pushq $0x1
popq %rbx
xorl %r12d, %r12d
pushq $0xa
popq %r13
leaq 0x118(%rsp), %r14
xorl %r15d, %r15d
movl %ebx, %eax
xorl %edx, %edx
divl %r13d
movl %eax, %ebp
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x3b8f
addq %r12, %rsi
movq %r14, %rdi
callq 0x3320
movq %rax, %rdi
leaq 0xe089(%rip), %rsi      # 0x11bf2
callq 0x3350
imull $0xa, %ebp, %eax
addl $-0x2, %eax
incq %rax
cmpl %r15d, %eax
jne 0x3b84
movq %r14, %rdi
callq 0x31a0
incq %r15
incl %ebx
addq $0x20, %r12
jmp 0x3b35
leaq 0x118(%rsp), %rdi
callq 0x31a0
movq %rax, %rdi
callq 0x31a0
movq %rax, %rdi
callq 0x31a0
movq %rax, %rdi
callq 0x31a0
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0xb0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x5532
leaq 0xd458(%rip), %rsi      # 0x11035
leaq 0x118(%rsp), %rdi
callq 0x3350
movq %rax, %rdi
callq 0x31a0
pushq $0x1
popq %rbp
xorl %r15d, %r15d
leaq 0x118(%rsp), %rbx
leaq 0xdfeb(%rip), %r14      # 0x11bf2
xorl %r12d, %r12d
movl %ebp, %r13d
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x3c56
addq %r15, %rsi
movq %rbx, %rdi
callq 0x3320
movq %rax, %rdi
movq %r14, %rsi
callq 0x3350
cmpl $0xa, %r13d
jl 0x3c4a
movq %rbx, %rdi
callq 0x31a0
movl %ebp, %r13d
incq %r12
incl %r13d
addq $0x20, %r15
jmp 0x3c0d
movq 0x1337b(%rip), %rdi     # 0x16fd8
callq 0x31a0
leaq 0x30(%rsp), %rdi
callq 0x3eee
leaq 0x118(%rsp), %rdi
callq 0x34c0
leaq 0x50(%rsp), %rdi
callq 0x3eee
leaq 0xb0(%rsp), %rdi
callq 0x4070
xorl %eax, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3d08
jmp 0x3cc9
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3180
jmp 0x3cba
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x3180
jmp 0x3d27
movq %rax, %rbx
jmp 0x3d27
jmp 0x3cfe
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3180
jmp 0x3ce2
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x3180
jmp 0x3d7c
jmp 0x3cfe
jmp 0x3d08
jmp 0x3d17
jmp 0x3d17
jmp 0x3d65
movq %rax, %rbx
jmp 0x3d7c
movq %rax, %rbx
jmp 0x3d72
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x3eee
jmp 0x3d1a
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x34c0
leaq 0x50(%rsp), %rdi
jmp 0x3d77
movq %rax, %rbx
jmp 0x3d54
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3180
jmp 0x3d47
jmp 0x3d65
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x3180
leaq 0x118(%rsp), %rdi
callq 0x3180
jmp 0x3d68
jmp 0x3d65
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x3eee
leaq 0x10(%rsp), %rdi
callq 0x3eee
leaq 0xb0(%rsp), %rdi
callq 0x4070
movq %rbx, %rdi
callq 0x35a0
nop