// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movaps 0x80(%rsp), %xmm0
movaps 0x90(%rsp), %xmm1
movaps 0xa0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4e8a
movq %rax, %rbx
movl 0xa828(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xa820(%rip)      # 0xf1d8
leaq 0x5755(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x68af(%rip), %rdi      # 0xb27c
callq 0x2090
movl $0x1f4, %ebp            # imm = 0x1F4
leaq 0x6249(%rip), %r14      # 0xac27
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
decl %ebp
jne 0x49de
movl $0x1f40, %edi           # imm = 0x1F40
callq 0x2200
movq %rax, %r14
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %r12
movq 0x8(%r15), %r13
leaq 0x60f0(%rip), %r15      # 0xab11
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x66dc
movq %rax, (%r14,%rbp,8)
testq %rax, %rax
je 0x4d92
cmpl $0x5, (%rax)
jne 0x4d92
incq %rbp
cmpq $0x3e8, %rbp            # imm = 0x3E8
jne 0x4a23
movq %r12, 0x30(%rsp)
xorl %r12d, %r12d
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %rbp
movq 0x8(%r15), %r15
movq (%r14,%r12,8), %rdi
callq 0x5040
incq %r12
cmpq $0x3e8, %r12            # imm = 0x3E8
jne 0x4a70
movq %r14, %rdi
callq 0x2040
subq 0x30(%rsp), %rbp
imulq $0xf4240, %rbp, %rax    # imm = 0xF4240
subq %r13, %r15
addq %rax, %r15
cvtsi2sd %r15, %xmm0
divsd 0x5564(%rip), %xmm0     # 0xa010
leaq 0x664d(%rip), %rdi      # 0xb100
movl $0x3e8, %esi            # imm = 0x3E8
movb $0x1, %al
callq 0x2100
movl $0x1f40, %edi           # imm = 0x1F40
callq 0x2200
movq %rax, %r14
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %r13
movq 0x8(%r15), %r12
leaq 0x662b(%rip), %r15      # 0xb114
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x66dc
movq %rax, (%r14,%rbp,8)
testq %rax, %rax
je 0x4db1
cmpl $0x2, (%rax)
jne 0x4db1
cmpq $0x1f4, 0x20(%rax)      # imm = 0x1F4
jne 0x4e0e
incq %rbp
cmpq $0x3e8, %rbp            # imm = 0x3E8
jne 0x4aeb
movq %r12, 0x30(%rsp)
xorl %r12d, %r12d
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %rbp
movq 0x8(%r15), %r15
movq (%r14,%r12,8), %rdi
callq 0x5040
incq %r12
cmpq $0x3e8, %r12            # imm = 0x3E8
jne 0x4b46
movq %r14, %rdi
callq 0x2040
subq %r13, %rbp
imulq $0xf4240, %rbp, %rax    # imm = 0xF4240
subq 0x30(%rsp), %r15
addq %rax, %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
divsd 0x548b(%rip), %xmm0     # 0xa010
leaq 0x660a(%rip), %rdi      # 0xb196
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 0x5f60(%rip), %r15      # 0xab11
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x657a
decl %ebp
jne 0x4bb1
xorl %ebp, %ebp
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %r13
movq 0x8(%r15), %r12
leaq (%r14,%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6364
testl %eax, %eax
jne 0x4e2d
movq (%r15), %rax
testq %rax, %rax
je 0x4dd0
cmpl $0x5, (%rax)
jne 0x4dd0
addq $0x8, %rbp
cmpq $0x13880, %rbp          # imm = 0x13880
jne 0x4bda
movq %r12, 0x30(%rsp)
xorl %r12d, %r12d
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %rbp
movq 0x8(%r15), %r15
movq (%r14,%r12,8), %rdi
callq 0x5040
incq %r12
cmpq $0x2710, %r12           # imm = 0x2710
jne 0x4c31
movq %r14, %rdi
callq 0x2040
subq %r13, %rbp
imulq $0xf4240, %rbp, %rax    # imm = 0xF4240
subq 0x30(%rsp), %r15
addq %rax, %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
divsd 0x53a0(%rip), %xmm0     # 0xa010
leaq 0x6578(%rip), %rdi      # 0xb1ef
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 0x6478(%rip), %r15      # 0xb114
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x657a
decl %ebp
jne 0x4c9c
xorl %ebp, %ebp
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %r13
movq 0x8(%r15), %r12
leaq (%r14,%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6364
testl %eax, %eax
jne 0x4e6b
movq (%r15), %rax
testq %rax, %rax
je 0x4def
cmpl $0x2, (%rax)
jne 0x4def
cmpq $0x1f4, 0x20(%rax)      # imm = 0x1F4
jne 0x4e4c
addq $0x8, %rbp
cmpq $0x13880, %rbp          # imm = 0x13880
jne 0x4cc5
movq %r12, 0x30(%rsp)
xorl %r12d, %r12d
leaq 0x38(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x2130
movq (%r15), %rbp
movq 0x8(%r15), %r15
movq (%r14,%r12,8), %rdi
callq 0x5040
incq %r12
cmpq $0x2710, %r12           # imm = 0x2710
jne 0x4d2a
movq %r14, %rdi
callq 0x2040
subq %r13, %rbp
imulq $0xf4240, %rbp, %rax    # imm = 0xF4240
subq 0x30(%rsp), %r15
addq %rax, %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15, %xmm0
divsd 0x52a7(%rip), %xmm0     # 0xa010
leaq 0x649f(%rip), %rdi      # 0xb20f
movl $0x2710, %esi           # imm = 0x2710
movb $0x1, %al
callq 0x2100
movq %rbx, %rdi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4fbc
leaq 0x6306(%rip), %rdi      # 0xb09f
leaq 0x5ae3(%rip), %rsi      # 0xa883
leaq 0x6335(%rip), %rcx      # 0xb0dc
movl $0x23f, %edx            # imm = 0x23F
callq 0x2140
leaq 0x6370(%rip), %rdi      # 0xb128
leaq 0x5ac4(%rip), %rsi      # 0xa883
leaq 0x6316(%rip), %rcx      # 0xb0dc
movl $0x24a, %edx            # imm = 0x24A
callq 0x2140
leaq 0x62c8(%rip), %rdi      # 0xb09f
leaq 0x5aa5(%rip), %rsi      # 0xa883
leaq 0x62f7(%rip), %rcx      # 0xb0dc
movl $0x259, %edx            # imm = 0x259
callq 0x2140
leaq 0x6332(%rip), %rdi      # 0xb128
leaq 0x5a86(%rip), %rsi      # 0xa883
leaq 0x62d8(%rip), %rcx      # 0xb0dc
movl $0x266, %edx            # imm = 0x266
callq 0x2140
leaq 0x634f(%rip), %rdi      # 0xb164
leaq 0x5a67(%rip), %rsi      # 0xa883
leaq 0x62b9(%rip), %rcx      # 0xb0dc
movl $0x24b, %edx            # imm = 0x24B
callq 0x2140
leaq 0x638a(%rip), %rdi      # 0xb1be
leaq 0x5a48(%rip), %rsi      # 0xa883
leaq 0x629a(%rip), %rcx      # 0xb0dc
movl $0x258, %edx            # imm = 0x258
callq 0x2140
leaq 0x6311(%rip), %rdi      # 0xb164
leaq 0x5a29(%rip), %rsi      # 0xa883
leaq 0x627b(%rip), %rcx      # 0xb0dc
movl $0x267, %edx            # imm = 0x267
callq 0x2140
leaq 0x634c(%rip), %rdi      # 0xb1be
leaq 0x5a0a(%rip), %rsi      # 0xa883
leaq 0x625c(%rip), %rcx      # 0xb0dc
movl $0x265, %edx            # imm = 0x265
callq 0x2140