// File: /workspace/github_c_makefile_star2_O2/Genymobile[P]hiredis/test.c
// Function: test_throughput
static void test_throughput(struct config config) {
    redisContext *c = connect(config);
    redisReply **replies;
    int i, num;
    long long t1, t2;

    test("Throughput:\n");
    for (i = 0; i < 500; i++)
        freeReplyObject(redisCommand(c,"LPUSH mylist foo"));

    num = 1000;
    replies = malloc(sizeof(redisReply*)*num);
    t1 = usec();
    for (i = 0; i < num; i++) {
        replies[i] = redisCommand(c,"PING");
        assert(replies[i] != NULL && replies[i]->type == REDIS_REPLY_STATUS);
    }
    t2 = usec();
    for (i = 0; i < num; i++) freeReplyObject(replies[i]);
    free(replies);
    printf("\t(%dx PING: %.3fs)\n", num, (t2-t1)/1000000.0);

    replies = malloc(sizeof(redisReply*)*num);
    t1 = usec();
    for (i = 0; i < num; i++) {
        replies[i] = redisCommand(c,"LRANGE mylist 0 499");
        assert(replies[i] != NULL && replies[i]->type == REDIS_REPLY_ARRAY);
        assert(replies[i] != NULL && replies[i]->elements == 500);
    }
    t2 = usec();
    for (i = 0; i < num; i++) freeReplyObject(replies[i]);
    free(replies);
    printf("\t(%dx LRANGE with 500 elements: %.3fs)\n", num, (t2-t1)/1000000.0);

    num = 10000;
    replies = malloc(sizeof(redisReply*)*num);
    for (i = 0; i < num; i++)
        redisAppendCommand(c,"PING");
    t1 = usec();
    for (i = 0; i < num; i++) {
        assert(redisGetReply(c, (void*)&replies[i]) == REDIS_OK);
        assert(replies[i] != NULL && replies[i]->type == REDIS_REPLY_STATUS);
    }
    t2 = usec();
    for (i = 0; i < num; i++) freeReplyObject(replies[i]);
    free(replies);
    printf("\t(%dx PING (pipelined): %.3fs)\n", num, (t2-t1)/1000000.0);

    replies = malloc(sizeof(redisReply*)*num);
    for (i = 0; i < num; i++)
        redisAppendCommand(c,"LRANGE mylist 0 499");
    t1 = usec();
    for (i = 0; i < num; i++) {
        assert(redisGetReply(c, (void*)&replies[i]) == REDIS_OK);
        assert(replies[i] != NULL && replies[i]->type == REDIS_REPLY_ARRAY);
        assert(replies[i] != NULL && replies[i]->elements == 500);
    }
    t2 = usec();
    for (i = 0; i < num; i++) freeReplyObject(replies[i]);
    free(replies);
    printf("\t(%dx LRANGE with 500 elements (pipelined): %.3fs)\n", num, (t2-t1)/1000000.0);

    disconnect(c, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movaps 0x70(%rsp), %xmm0
movaps 0x80(%rsp), %xmm1
movaps 0x90(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4c46
movq %rax, %rbx
movl 0x99a2(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x999a(%rip)      # 0xe1d8
leaq 0x48c6(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5a20(%rip), %rdi      # 0xa273
callq 0x2090
movl $0x1f4, %ebp            # imm = 0x1F4
leaq 0x53ba(%rip), %r14      # 0x9c1e
subl $0x1, %ebp
jb 0x4880
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
jmp 0x4864
movl $0x1f40, %edi           # imm = 0x1F40
callq 0x2200
movq %rax, %r14
callq 0x4de4
movq %rax, %r15
leaq 0x526c(%rip), %r12      # 0x9b08
xorl %r13d, %r13d
cmpq $0x3e8, %r13            # imm = 0x3E8
je 0x48e5
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6044
movq %rax, (%r14,%r13,8)
testq %rax, %rax
je 0x48c6
incq %r13
cmpl $0x5, (%rax)
je 0x489f
leaq 0x57c9(%rip), %rdi      # 0xa096
leaq 0x4fa6(%rip), %rsi      # 0x987a
leaq 0x57f8(%rip), %rcx      # 0xa0d3
movl $0x23f, %edx            # imm = 0x23F
callq 0x2140
xorl %r13d, %r13d
callq 0x4de4
movq %rax, %r12
cmpq $0x3e8, %r13            # imm = 0x3E8
je 0x4907
movq (%r14,%r13,8), %rdi
callq 0x4e08
incq %r13
jmp 0x48f0
movq %r14, %rdi
callq 0x2040
subq %r15, %r12
cvtsi2sd %r12, %xmm0
divsd 0x46f1(%rip), %xmm0     # 0x9010
leaq 0x57d1(%rip), %rdi      # 0xa0f7
movl $0x3e8, %esi            # imm = 0x3E8
movb $0x1, %al
callq 0x2100
movl $0x1f40, %edi           # imm = 0x1F40
callq 0x2200
movq %rax, %r14
callq 0x4de4
movq %rax, %r15
leaq 0x57bd(%rip), %r12      # 0xa10b
xorl %r13d, %r13d
cmpq $0x3e8, %r13            # imm = 0x3E8
je 0x49a9
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x6044
movq %rax, (%r14,%r13,8)
testq %rax, %rax
je 0x4bca
cmpl $0x2, (%rax)
jne 0x4bca
incq %r13
cmpq $0x1f4, 0x20(%rax)      # imm = 0x1F4
je 0x4951
leaq 0x57ca(%rip), %rdi      # 0xa15b
leaq 0x4ee2(%rip), %rsi      # 0x987a
leaq 0x5734(%rip), %rcx      # 0xa0d3
movl $0x24b, %edx            # imm = 0x24B
callq 0x2140
xorl %r13d, %r13d
callq 0x4de4
movq %rax, %r12
cmpq $0x3e8, %r13            # imm = 0x3E8
je 0x49cb
movq (%r14,%r13,8), %rdi
callq 0x4e08
incq %r13
jmp 0x49b4
movq %r14, %rdi
callq 0x2040
subq %r15, %r12
cvtsi2sd %r12, %xmm0
divsd 0x462d(%rip), %xmm0     # 0x9010
leaq 0x57a3(%rip), %rdi      # 0xa18d
movl $0x3e8, %esi            # imm = 0x3E8
movb $0x1, %al
callq 0x2100
movl $0x13880, %edi          # imm = 0x13880
callq 0x2200
movq %rax, %r14
movl $0x2710, %ebp           # imm = 0x2710
leaq 0x50f9(%rip), %r15      # 0x9b08
subl $0x1, %ebp
jb 0x4a23
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x5f2d
jmp 0x4a0f
xorl %r13d, %r13d
callq 0x4de4
movq %rax, %r15
cmpq $0x13880, %r13          # imm = 0x13880
je 0x4a7f
leaq (%r14,%r13), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5ddc
testl %eax, %eax
jne 0x4c08
movq (%r12), %rax
testq %rax, %rax
je 0x4a60
addq $0x8, %r13
cmpl $0x5, (%rax)
je 0x4a2e
leaq 0x562f(%rip), %rdi      # 0xa096
leaq 0x4e0c(%rip), %rsi      # 0x987a
leaq 0x565e(%rip), %rcx      # 0xa0d3
movl $0x259, %edx            # imm = 0x259
callq 0x2140
xorl %r13d, %r13d
callq 0x4de4
movq %rax, %r12
cmpq $0x2710, %r13           # imm = 0x2710
je 0x4aa1
movq (%r14,%r13,8), %rdi
callq 0x4e08
incq %r13
jmp 0x4a8a
movq %r14, %rdi
callq 0x2040
subq %r15, %r12
cvtsi2sd %r12, %xmm0
divsd 0x4557(%rip), %xmm0     # 0x9010
leaq 0x5726(%rip), %rdi      # 0xa1e6
movl $0x2710, %ebp           # imm = 0x2710
movl $0x2710, %esi           # imm = 0x2710
movb $0x1, %al
callq 0x2100
movl $0x13880, %edi          # imm = 0x13880
callq 0x2200
movq %rax, %r14
leaq 0x5626(%rip), %r15      # 0xa10b
subl $0x1, %ebp
jb 0x4af9
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x5f2d
jmp 0x4ae5
xorl %r13d, %r13d
callq 0x4de4
movq %rax, %r15
cmpq $0x13880, %r13          # imm = 0x13880
je 0x4b67
leaq (%r14,%r13), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5ddc
testl %eax, %eax
jne 0x4c27
movq (%r12), %rax
testq %rax, %rax
je 0x4be9
cmpl $0x2, (%rax)
jne 0x4be9
addq $0x8, %r13
cmpq $0x1f4, 0x20(%rax)      # imm = 0x1F4
je 0x4b04
leaq 0x560c(%rip), %rdi      # 0xa15b
leaq 0x4d24(%rip), %rsi      # 0x987a
leaq 0x5576(%rip), %rcx      # 0xa0d3
movl $0x267, %edx            # imm = 0x267
callq 0x2140
xorl %r13d, %r13d
callq 0x4de4
movq %rax, %r12
cmpq $0x2710, %r13           # imm = 0x2710
je 0x4b89
movq (%r14,%r13,8), %rdi
callq 0x4e08
incq %r13
jmp 0x4b72
movq %r14, %rdi
callq 0x2040
subq %r15, %r12
cvtsi2sd %r12, %xmm0
divsd 0x446f(%rip), %xmm0     # 0x9010
leaq 0x565e(%rip), %rdi      # 0xa206
movl $0x2710, %esi           # imm = 0x2710
movb $0x1, %al
callq 0x2100
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4d68
leaq 0x554e(%rip), %rdi      # 0xa11f
leaq 0x4ca2(%rip), %rsi      # 0x987a
leaq 0x54f4(%rip), %rcx      # 0xa0d3
movl $0x24a, %edx            # imm = 0x24A
callq 0x2140
leaq 0x552f(%rip), %rdi      # 0xa11f
leaq 0x4c83(%rip), %rsi      # 0x987a
leaq 0x54d5(%rip), %rcx      # 0xa0d3
movl $0x266, %edx            # imm = 0x266
callq 0x2140
leaq 0x55a6(%rip), %rdi      # 0xa1b5
leaq 0x4c64(%rip), %rsi      # 0x987a
leaq 0x54b6(%rip), %rcx      # 0xa0d3
movl $0x258, %edx            # imm = 0x258
callq 0x2140
leaq 0x5587(%rip), %rdi      # 0xa1b5
leaq 0x4c45(%rip), %rsi      # 0x987a
leaq 0x5497(%rip), %rcx      # 0xa0d3
movl $0x265, %edx            # imm = 0x265
callq 0x2140