// File: /workspace/github_cpp_makefile_star2_O2/Sherhang[P]redis-for-cpp/demo2.cpp
// Function: main
int main()
{
    Redis redis;
    string ip="127.0.0.1";
    int port = 6379;
    string password="";
    redis.init(ip, port, password);//init
    redis.connect();//connect
    vector<string> keys={"str1","str2","str3","str4","str5"};
    vector<string> values={"1s","2s","3s","4s","5s"};
    redis.mset(keys,values);//
    keys.clear();
    redis.keys("str?", keys);
    sort(keys.begin(),keys.end());
    cout<<"all keys are:"<<endl;
    copy(keys.begin(),keys.end(),ostream_iterator<string>(cout," "));
    cout<<endl;
    vector<string> v;
    redis.mget(keys,v);//
    cout<<"values ars"<<endl;
    copy(v.begin(), v.end(),ostream_iterator<string>(cout, " "));cout<<endl;
    cout<<"delete all keys like str?"<<endl;
    for(int i=0;i<keys.size();++i)
    {
        redis.del(keys[i]);//
    }
    string key = "str1";
    string t = redis.type(key);//
    cout<<"type of str1 is "<<t<<endl;
    {
        cout<<"hash操作："<<endl;
        vector<string> fields={"f1","f2","f3","f4","f5"};
        vector<string> values={"hv1","hv2","hv3","hv4","hv5"};
        redis.hmset("hash_test",fields,values);//
        map<string,string> hash;
        redis.hgetall("hash_test",hash);//
        for(map<string,string>::iterator it=hash.begin();it!=hash.end();++it)
        {
            cout<<it->first<<" "<<it->second<<endl;
        }
        cout<<endl;
        values.clear();
        redis.hmget("hash_test",fields,values);//
        cout<<"hmget"<<endl;
        copy(values.begin(),values.end(),ostream_iterator<string>(cout," "));cout<<endl;
        redis.del("hash_test");
    }
    cout<<"获取string类型的keys:"<<endl;
    vector<string> ks;
    redis.getKeys("strinG", "", 35,ks);//
    cout<<"共获取keys个数："<<ks.size()<<endl;
    copy(ks.begin(),ks.end(),ostream_iterator<string>(cout," "));cout<<endl;

    //while(1);
    redis.disconnect();
    redis.disconnect();//重复dis看看
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
leaq 0x190(%rsp), %rdi
callq 0x4e60
leaq 0xe846(%rip), %rsi      # 0x12004
leaq 0x218(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x3120
leaq 0xeb7e(%rip), %rsi      # 0x12358
leaq 0x1f8(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x218(%rsp), %rsi
leaq 0x1f8(%rsp), %rcx
movl $0x18eb, %edx           # imm = 0x18EB
callq 0x4f1e
leaq 0x190(%rsp), %rdi
callq 0x4f4a
leaq 0xe7e9(%rip), %rsi      # 0x1200e
leaq 0x80(%rsp), %r14
leaq 0x138(%rsp), %rdx
movq %r14, %rdi
callq 0x3120
leaq 0xa0(%rsp), %r15
leaq 0xe7c7(%rip), %rsi      # 0x12013
leaq 0x170(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xc0(%rsp), %r15
leaq 0xe7ad(%rip), %rsi      # 0x12018
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xe0(%rsp), %r15
leaq 0xe796(%rip), %rsi      # 0x1201d
leaq 0x158(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x100(%rsp), %r15
leaq 0xe77c(%rip), %rsi      # 0x12022
leaq 0x120(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x50(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x5
popq %rdx
leaq 0x30(%rsp), %rcx
callq 0x4370
movl $0x80, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x38d5
leaq 0xe731(%rip), %rsi      # 0x12027
leaq 0x80(%rsp), %r14
leaq 0x138(%rsp), %rdx
movq %r14, %rdi
callq 0x3120
leaq 0xa0(%rsp), %r15
leaq 0xe70d(%rip), %rsi      # 0x1202a
leaq 0x170(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xc0(%rsp), %r15
leaq 0xe6f1(%rip), %rsi      # 0x1202d
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xe0(%rsp), %r15
leaq 0xe6d8(%rip), %rsi      # 0x12030
leaq 0x120(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x100(%rsp), %r15
leaq 0xe6bc(%rip), %rsi      # 0x12033
leaq 0x30(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x158(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x5
popq %rdx
leaq 0x68(%rsp), %rcx
callq 0x4370
movl $0x80, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x39a6
leaq 0x190(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x158(%rsp), %rdx
callq 0x6282
leaq 0x50(%rsp), %rdi
callq 0x43aa
leaq 0xe679(%rip), %rsi      # 0x12064
leaq 0x80(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x566c
leaq 0x80(%rsp), %rdi
callq 0x3160
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rsi
callq 0x45f5
movq 0x1559b(%rip), %rbx     # 0x18fd8
leaq 0xe5f2(%rip), %rsi      # 0x12036
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x3180
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x268(%rsp), %rcx
movq %rbx, (%rcx)
leaq 0xf242(%rip), %r14      # 0x12cb2
movq %r14, 0x8(%rcx)
leaq 0x80(%rsp), %rdi
callq 0x43b2
movq 0x15550(%rip), %rdi     # 0x18fd8
callq 0x3180
xorps %xmm0, %xmm0
leaq 0x120(%rsp), %rdx
movaps %xmm0, (%rdx)
andq $0x0, 0x10(%rdx)
leaq 0x190(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x638e
movq 0x1551f(%rip), %rbx     # 0x18fd8
leaq 0xe584(%rip), %rsi      # 0x12044
movq %rbx, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x3180
movq 0x120(%rsp), %rsi
movq 0x128(%rsp), %rdx
leaq 0x258(%rsp), %rcx
movq %rbx, (%rcx)
movq %r14, 0x8(%rcx)
leaq 0x80(%rsp), %rdi
callq 0x43b2
movq 0x154d5(%rip), %rdi     # 0x18fd8
callq 0x3180
movq 0x154c9(%rip), %rdi     # 0x18fd8
leaq 0xe539(%rip), %rsi      # 0x1204f
callq 0x3350
movq %rax, %rdi
callq 0x3180
xorl %r14d, %r14d
leaq 0x190(%rsp), %rbx
xorl %r15d, %r15d
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x3b5b
addq %r14, %rsi
movq %rbx, %rdi
callq 0x526a
incq %r15
addq $0x20, %r14
jmp 0x3b31
leaq 0xe4ac(%rip), %rsi      # 0x1200e
leaq 0x138(%rsp), %rdi
leaq 0x80(%rsp), %rdx
callq 0x3120
leaq 0x170(%rsp), %rdi
leaq 0x190(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0x5ea6
movq 0x1543d(%rip), %rdi     # 0x18fd8
leaq 0xe4c7(%rip), %rsi      # 0x12069
callq 0x3350
leaq 0x170(%rsp), %rsi
movq %rax, %rdi
callq 0x3320
movq %rax, %rdi
callq 0x3180
movq 0x15412(%rip), %rdi     # 0x18fd8
leaq 0xe4ad(%rip), %rsi      # 0x1207a
callq 0x3350
movq %rax, %rdi
callq 0x3180
leaq 0xe4a7(%rip), %rsi      # 0x12088
leaq 0x80(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x3120
leaq 0xa0(%rsp), %r15
leaq 0xe486(%rip), %rsi      # 0x1208b
leaq 0x68(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xc0(%rsp), %r15
leaq 0xe46d(%rip), %rsi      # 0x1208e
leaq 0xb(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xe0(%rsp), %r15
leaq 0xe454(%rip), %rsi      # 0x12091
leaq 0xe(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x100(%rsp), %r15
leaq 0xe43b(%rip), %rsi      # 0x12094
leaq 0xd(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x30(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x5
popq %rdx
leaq 0xc(%rsp), %rcx
callq 0x4370
movl $0x80, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x3c85
leaq 0xe3f1(%rip), %rsi      # 0x12097
leaq 0x80(%rsp), %r14
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0x3120
leaq 0xa0(%rsp), %r15
leaq 0xe3d1(%rip), %rsi      # 0x1209b
leaq 0xb(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xc0(%rsp), %r15
leaq 0xe3b9(%rip), %rsi      # 0x1209f
leaq 0xe(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0xe0(%rsp), %r15
leaq 0xe3a1(%rip), %rsi      # 0x120a3
leaq 0xd(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x100(%rsp), %r15
leaq 0xe389(%rip), %rsi      # 0x120a7
leaq 0xc(%rsp), %rdx
movq %r15, %rdi
callq 0x3120
leaq 0x68(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x5
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x4370
movl $0x80, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x3d4a
leaq 0xe340(%rip), %rsi      # 0x120ab
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x7c08
leaq 0x80(%rsp), %rdi
callq 0x3160
leaq 0x88(%rsp), %r12
andl $0x0, (%r12)
andq $0x0, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
andq $0x0, 0x20(%r12)
leaq 0xe2d8(%rip), %rsi      # 0x120ab
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x7ee8
leaq 0x10(%rsp), %rdi
callq 0x3160
movq 0x98(%rsp), %r15
movq 0x151c3(%rip), %r14     # 0x18fd8
leaq 0xee96(%rip), %rbx      # 0x12cb2
cmpq %r12, %r15
je 0x3e59
leaq 0x20(%r15), %rsi
movq %r14, %rdi
callq 0x3320
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3350
leaq 0x40(%r15), %rsi
movq %rax, %rdi
callq 0x3320
movq %rax, %rdi
callq 0x3180
movq %r15, %rdi
callq 0x3250
movq %rax, %r15
jmp 0x3e1c
movq 0x15178(%rip), %rdi     # 0x18fd8
callq 0x3180
leaq 0x68(%rsp), %rdi
callq 0x43aa
leaq 0xe235(%rip), %rsi      # 0x120ab
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x7dde
leaq 0x10(%rsp), %rdi
callq 0x3160
movq 0x15126(%rip), %r14     # 0x18fd8
leaq 0xe1fc(%rip), %rsi      # 0x120b5
movq %r14, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x3180
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x248(%rsp), %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
leaq 0x10(%rsp), %rdi
callq 0x43b2
movq 0x150e5(%rip), %rdi     # 0x18fd8
callq 0x3180
leaq 0xe1ac(%rip), %rsi      # 0x120ab
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x526a
leaq 0x10(%rsp), %rdi
callq 0x3160
leaq 0x80(%rsp), %rdi
callq 0x43fe
leaq 0x68(%rsp), %rdi
callq 0x43d2
leaq 0x30(%rsp), %rdi
callq 0x43d2
movq 0x15086(%rip), %rdi     # 0x18fd8
leaq 0xe162(%rip), %rsi      # 0x120bb
callq 0x3350
movq %rax, %rdi
callq 0x3180
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0xe15b(%rip), %rsi      # 0x120d6
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x3120
leaq 0xe3c4(%rip), %rsi      # 0x12358
leaq 0x10(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x3120
leaq 0x190(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x10(%rsp), %rdx
pushq $0x23
popq %rcx
leaq 0x30(%rsp), %r8
callq 0x5ad6
leaq 0x10(%rsp), %rdi
callq 0x3160
leaq 0x80(%rsp), %rdi
callq 0x3160
movq 0x14ff5(%rip), %r14     # 0x18fd8
leaq 0xe0f3(%rip), %rsi      # 0x120dd
movq %r14, %rdi
callq 0x3350
movq 0x38(%rsp), %rsi
subq 0x30(%rsp), %rsi
sarq $0x5, %rsi
movq %rax, %rdi
callq 0x3240
movq %rax, %rdi
callq 0x3180
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x238(%rsp), %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
leaq 0x80(%rsp), %rdi
callq 0x43b2
movq 0x14f9b(%rip), %rdi     # 0x18fd8
callq 0x3180
leaq 0x190(%rsp), %rdi
callq 0x5220
leaq 0x190(%rsp), %rdi
callq 0x5220
leaq 0x30(%rsp), %rdi
callq 0x43d2
leaq 0x170(%rsp), %rdi
callq 0x3160
leaq 0x138(%rsp), %rdi
callq 0x3160
leaq 0x120(%rsp), %rdi
callq 0x43d2
leaq 0x158(%rsp), %rdi
callq 0x43d2
leaq 0x50(%rsp), %rdi
callq 0x43d2
leaq 0x1f8(%rsp), %rdi
callq 0x3160
leaq 0x218(%rsp), %rdi
callq 0x3160
leaq 0x190(%rsp), %rdi
callq 0x4ecc
xorl %eax, %eax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x42ce
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3160
jmp 0x40f3
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3160
jmp 0x42f9
jmp 0x42ce
jmp 0x411d
jmp 0x42df
jmp 0x42df
jmp 0x411d
jmp 0x42df
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3160
jmp 0x42e2
jmp 0x42df
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3160
jmp 0x42ef
movq %rax, %rbx
jmp 0x42ef
movq %rax, %rbx
movl $0x80, %r14d
leaq (%rsp,%r14), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x415a
jmp 0x42f9
jmp 0x417f
jmp 0x417f
jmp 0x417f
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x3160
cmpq %r14, %r15
jne 0x4182
jmp 0x42f9
jmp 0x42ce
movq %rax, %rbx
movl $0x80, %r14d
leaq (%rsp,%r14), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x41a6
jmp 0x4303
jmp 0x41cb
jmp 0x41cb
jmp 0x41cb
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x3160
cmpq %r14, %r15
jne 0x41ce
jmp 0x4303
jmp 0x42d5
movq %rax, %rbx
jmp 0x4310
jmp 0x42da
jmp 0x42da
jmp 0x42c9
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x3160
jmp 0x432a
jmp 0x42c9
movq %rax, %rbx
movl $0x80, %r14d
leaq (%rsp,%r14), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x4223
jmp 0x4337
jmp 0x4248
jmp 0x4248
jmp 0x4248
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x3160
cmpq %r14, %r15
jne 0x424b
jmp 0x4337
movq %rax, %rbx
jmp 0x4337
movq %rax, %rbx
movl $0x80, %r14d
leaq (%rsp,%r14), %rdi
addq $0x80, %rdi
callq 0x3160
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x4272
jmp 0x4341
jmp 0x4297
jmp 0x4297
jmp 0x4297
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x3160
cmpq %r14, %r15
jne 0x429a
jmp 0x4341
jmp 0x42c2
movq %rax, %rbx
jmp 0x434e
movq %rax, %rbx
jmp 0x435b
movq %rax, %rbx
jmp 0x4341
jmp 0x42df
movq %rax, %rbx
jmp 0x432a
movq %rax, %rbx
jmp 0x42f9
jmp 0x42da
movq %rax, %rbx
jmp 0x4303
movq %rax, %rbx
jmp 0x431d
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x43fe
leaq 0x68(%rsp), %rdi
callq 0x43d2
leaq 0x30(%rsp), %rdi
callq 0x43d2
leaq 0x170(%rsp), %rdi
callq 0x3160
leaq 0x138(%rsp), %rdi
callq 0x3160
leaq 0x120(%rsp), %rdi
callq 0x43d2
leaq 0x158(%rsp), %rdi
callq 0x43d2
leaq 0x50(%rsp), %rdi
callq 0x43d2
leaq 0x1f8(%rsp), %rdi
callq 0x3160
leaq 0x218(%rsp), %rdi
callq 0x3160
leaq 0x190(%rsp), %rdi
callq 0x4ecc
movq %rbx, %rdi
callq 0x3560