// File: 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
movq %rsp, %rbp
subq $0x530, %rsp            # imm = 0x530
movl $0x0, -0x4(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5160
leaq -0x91(%rbp), %rdi
movq %rdi, -0x468(%rbp)
callq 0x3670
movq -0x468(%rbp), %rdx
leaq 0x146d8(%rip), %rsi     # 0x18004
leaq -0x90(%rbp), %rdi
callq 0x3510
jmp 0x393a
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x470(%rbp)
callq 0x3670
movq -0x470(%rbp), %rdx
leaq 0x1491f(%rip), %rsi     # 0x1827a
leaq -0xc8(%rbp), %rdi
callq 0x3510
jmp 0x3969
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x18eb, %edx           # imm = 0x18EB
leaq -0xc8(%rbp), %rcx
callq 0x52c0
jmp 0x3987
leaq -0xc8(%rbp), %rdi
callq 0x3290
leaq -0xc9(%rbp), %rdi
callq 0x3410
leaq -0x90(%rbp), %rdi
callq 0x3290
leaq -0x91(%rbp), %rdi
callq 0x3410
leaq -0x70(%rbp), %rdi
callq 0x5310
jmp 0x39c2
movb $0x61, -0xca(%rbp)
movsbl -0xca(%rbp), %eax
cmpl $0x7a, %eax
jg 0x3fc9
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x4490
movq -0x478(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
movl $0xc350, %esi           # imm = 0xC350
callq 0x44b0
jmp 0x3a06
leaq -0xe9(%rbp), %rdi
callq 0x4520
leaq -0x109(%rbp), %rdi
movq %rdi, -0x480(%rbp)
callq 0x4490
movq -0x480(%rbp), %rdx
leaq -0x108(%rbp), %rdi
movl $0xc350, %esi           # imm = 0xC350
callq 0x44b0
jmp 0x3a3f
leaq -0x109(%rbp), %rdi
callq 0x4520
movl $0x0, -0x110(%rbp)
movslq -0x110(%rbp), %rax
movq %rax, -0x488(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x4540
movq %rax, %rcx
movq -0x488(%rbp), %rax
cmpq %rcx, %rax
jae 0x3f68
leaq -0x130(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x4560
jmp 0x3a9b
movslq -0x110(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
leaq -0x130(%rbp), %rsi
callq 0x34a0
leaq -0x130(%rbp), %rdi
callq 0x3290
movslq -0x110(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
callq 0x32d0
cmpq $0x8, %rax
jae 0x3d6a
leaq -0x151(%rbp), %rdi
movq %rdi, -0x490(%rbp)
callq 0x3670
movq -0x490(%rbp), %rdx
leaq 0x144ff(%rip), %rsi     # 0x1800e
leaq -0x150(%rbp), %rdi
callq 0x3510
jmp 0x3b1d
leaq -0x151(%rbp), %rdi
callq 0x3410
movslq -0x110(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
callq 0x32d0
movq %rax, %rdx
leaq -0x1b8(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movq $-0x1, %rcx
callq 0x33d0
jmp 0x3b63
movslq -0x110(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4660
movq %rax, %rdx
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x46d0
jmp 0x3b8e
movsbl -0xca(%rbp), %edx
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4680
jmp 0x3baa
movslq -0x110(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
leaq -0x178(%rbp), %rsi
callq 0x34a0
leaq -0x178(%rbp), %rdi
callq 0x3290
leaq -0x198(%rbp), %rdi
callq 0x3290
leaq -0x1b8(%rbp), %rdi
callq 0x3290
leaq -0x150(%rbp), %rdi
callq 0x3290
jmp 0x3d6a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3c5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3c47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x3290
leaq -0xc9(%rbp), %rdi
callq 0x3410
leaq -0x90(%rbp), %rdi
callq 0x3290
leaq -0x91(%rbp), %rdi
callq 0x3410
jmp 0x4471
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x4471
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0xe9(%rbp), %rdi
callq 0x4520
jmp 0x4471
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x109(%rbp), %rdi
callq 0x4520
jmp 0x3fb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3fac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x151(%rbp), %rdi
callq 0x3410
jmp 0x3fac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3d59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3d4d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3290
leaq -0x1b8(%rbp), %rdi
callq 0x3290
leaq -0x150(%rbp), %rdi
callq 0x3290
jmp 0x3fac
movslq -0x110(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4660
movq %rax, -0x498(%rbp)
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4660
movq -0x498(%rbp), %rsi
movq %rax, %rdi
callq 0x3050
jmp 0x3da8
movl $0x0, -0x1bc(%rbp)
movslq -0x1bc(%rbp), %rax
movq %rax, -0x4a0(%rbp)
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
callq 0x32d0
movq %rax, %rcx
movq -0x4a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x3ef2
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
movslq -0x1bc(%rbp), %rsi
callq 0x3700
movq %rax, -0x4a8(%rbp)
jmp 0x3e19
movq -0x4a8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
jg 0x3edc
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
movslq -0x1bc(%rbp), %rsi
callq 0x3700
movq %rax, -0x4b0(%rbp)
jmp 0x3e57
movq -0x4b0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x3edc
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
movslq -0x1bc(%rbp), %rsi
callq 0x3700
movq %rax, -0x4b8(%rbp)
jmp 0x3e91
movq -0x4b8(%rbp), %rax
movb (%rax), %al
addb $0x31, %al
movb %al, -0x4c1(%rbp)
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x4660
movq %rax, %rdi
movslq -0x1bc(%rbp), %rsi
callq 0x3700
movq %rax, -0x4c0(%rbp)
jmp 0x3ecd
movq -0x4c0(%rbp), %rax
movb -0x4c1(%rbp), %cl
movb %cl, (%rax)
jmp 0x3ede
movl -0x1bc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1bc(%rbp)
jmp 0x3db2
movslq -0x110(%rbp), %rsi
leaq -0x108(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x4660
movq %rax, %rdi
callq 0x3370
movq -0x4d0(%rbp), %rdi
movq %rax, -0x1c8(%rbp)
movslq -0x110(%rbp), %rsi
callq 0x4660
movq %rax, %rdi
callq 0x3240
movq %rax, -0x1d0(%rbp)
movq -0x1c8(%rbp), %rdi
movq -0x1d0(%rbp), %rsi
callq 0x4720
jmp 0x3f52
jmp 0x3f54
movl -0x110(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x3a55
leaq -0x70(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x7790
jmp 0x3f81
leaq -0x108(%rbp), %rdi
callq 0x47f0
leaq -0xe8(%rbp), %rdi
callq 0x47f0
movb -0xca(%rbp), %al
addb $0x1, %al
movb %al, -0xca(%rbp)
jmp 0x39c9
leaq -0x108(%rbp), %rdi
callq 0x47f0
leaq -0xe8(%rbp), %rdi
callq 0x47f0
jmp 0x4471
leaq -0x1e8(%rbp), %rdi
callq 0x4850
leaq -0x209(%rbp), %rdi
movq %rdi, -0x4d8(%rbp)
callq 0x3670
movq -0x4d8(%rbp), %rdx
leaq 0x142ec(%rip), %rsi     # 0x182e2
leaq -0x208(%rbp), %rdi
callq 0x3510
jmp 0x4004
leaq -0x231(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x3670
movq -0x4e0(%rbp), %rdx
leaq 0x14255(%rip), %rsi     # 0x1827a
leaq -0x230(%rbp), %rdi
callq 0x3510
jmp 0x4033
leaq -0x70(%rbp), %rdi
leaq -0x208(%rbp), %rsi
leaq -0x230(%rbp), %rdx
movl $0x2710, %ecx           # imm = 0x2710
leaq -0x1e8(%rbp), %r8
callq 0x68f0
jmp 0x4058
leaq -0x230(%rbp), %rdi
callq 0x3290
leaq -0x231(%rbp), %rdi
callq 0x3410
leaq -0x208(%rbp), %rdi
callq 0x3290
leaq -0x209(%rbp), %rdi
callq 0x3410
leaq -0x438(%rbp), %rdi
callq 0x3630
jmp 0x4096
leaq 0x13f7a(%rip), %rsi     # 0x18017
leaq -0x438(%rbp), %rdi
movl $0x20, %edx
callq 0x3070
jmp 0x40b0
leaq 0x13f70(%rip), %rsi     # 0x18027
leaq -0x438(%rbp), %rdi
callq 0x33b0
movq %rax, -0x4e8(%rbp)
jmp 0x40cc
movq -0x4e8(%rbp), %rdi
movq 0x1beee(%rip), %rsi     # 0x1ffc8
callq 0x33f0
jmp 0x40e1
movl $0x1, -0x43c(%rbp)
movl $0x0, -0x440(%rbp)
movslq -0x440(%rbp), %rax
movq %rax, -0x4f0(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4540
movq %rax, %rcx
movq -0x4f0(%rbp), %rax
cmpq %rcx, %rax
jae 0x4255
movslq -0x440(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x4660
movq %rax, %rsi
leaq -0x438(%rbp), %rdi
callq 0x3390
movq %rax, -0x4f8(%rbp)
jmp 0x414d
movq -0x4f8(%rbp), %rdi
leaq 0x14a77(%rip), %rsi     # 0x18bd2
callq 0x33b0
jmp 0x4162
movl -0x43c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x4230
movq 0x1be48(%rip), %rsi     # 0x1ffc8
leaq -0x438(%rbp), %rdi
callq 0x33f0
jmp 0x418e
jmp 0x4230
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x41f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x41d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x3290
leaq -0x231(%rbp), %rdi
callq 0x3410
leaq -0x208(%rbp), %rdi
callq 0x3290
leaq -0x209(%rbp), %rdi
callq 0x3410
jmp 0x4465
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x4465
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x4459
jmp 0x4232
movl -0x440(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x440(%rbp)
movl -0x43c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x43c(%rbp)
jmp 0x40f5
movq 0x1bd6c(%rip), %rsi     # 0x1ffc8
leaq -0x438(%rbp), %rdi
callq 0x33f0
movq %rax, -0x500(%rbp)
jmp 0x4271
movq -0x500(%rbp), %rdi
movq 0x1bd49(%rip), %rsi     # 0x1ffc8
callq 0x33f0
movq %rax, -0x508(%rbp)
jmp 0x428d
movq -0x508(%rbp), %rdi
movq 0x1bd2d(%rip), %rsi     # 0x1ffc8
callq 0x33f0
movq %rax, -0x510(%rbp)
jmp 0x42a9
movq -0x510(%rbp), %rdi
movq 0x1bd11(%rip), %rsi     # 0x1ffc8
callq 0x33f0
jmp 0x42be
leaq -0x458(%rbp), %rdi
movq %rdi, -0x518(%rbp)
callq 0x4850
movq -0x518(%rbp), %rdx
leaq -0x70(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x7a00
jmp 0x42ea
leaq 0x13d44(%rip), %rsi     # 0x18035
leaq -0x438(%rbp), %rdi
callq 0x33b0
movq %rax, -0x520(%rbp)
jmp 0x4306
movq -0x520(%rbp), %rdi
movq 0x1bcb4(%rip), %rsi     # 0x1ffc8
callq 0x33f0
jmp 0x431b
movl $0x1, -0x45c(%rbp)
movl $0x0, -0x460(%rbp)
movslq -0x460(%rbp), %rax
movq %rax, -0x528(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x4540
movq %rax, %rcx
movq -0x528(%rbp), %rax
cmpq %rcx, %rax
jae 0x440b
movslq -0x460(%rbp), %rsi
leaq -0x458(%rbp), %rdi
callq 0x4660
movq %rax, %rsi
leaq -0x438(%rbp), %rdi
callq 0x3390
movq %rax, -0x530(%rbp)
jmp 0x4387
movq -0x530(%rbp), %rdi
leaq 0x1483d(%rip), %rsi     # 0x18bd2
callq 0x33b0
jmp 0x439c
cmpl $0xa, -0x45c(%rbp)
jl 0x43e6
movl $0x1, -0x45c(%rbp)
movq 0x1bc12(%rip), %rsi     # 0x1ffc8
leaq -0x438(%rbp), %rdi
callq 0x33f0
jmp 0x43c4
jmp 0x43e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x458(%rbp), %rdi
callq 0x47f0
jmp 0x4459
jmp 0x43e8
movl -0x460(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x460(%rbp)
movl -0x45c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x45c(%rbp)
jmp 0x432f
movq 0x1bbc6(%rip), %rdi     # 0x1ffd8
movq 0x1bbaf(%rip), %rsi     # 0x1ffc8
callq 0x33f0
jmp 0x4420
leaq -0x458(%rbp), %rdi
callq 0x47f0
leaq -0x438(%rbp), %rdi
callq 0x3570
leaq -0x1e8(%rbp), %rdi
callq 0x47f0
leaq -0x70(%rbp), %rdi
callq 0x5220
movl -0x4(%rbp), %eax
addq $0x530, %rsp            # imm = 0x530
popq %rbp
retq
leaq -0x438(%rbp), %rdi
callq 0x3570
leaq -0x1e8(%rbp), %rdi
callq 0x47f0
leaq -0x70(%rbp), %rdi
callq 0x5220
movq -0xa0(%rbp), %rdi
callq 0x3660
nopw %cs:(%rax,%rax)