// File: /workspace/github_c_makefile_star2_O3/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 0x4df8
movq %rax, %rbx
movl 0xa8ba(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xa8b2(%rip)      # 0xf1d8
leaq 0x57de(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6938(%rip), %rdi      # 0xb273
callq 0x2090
movl $0x1f4, %ebp            # imm = 0x1F4
leaq 0x62d2(%rip), %r14      # 0xac1e
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
decl %ebp
jne 0x494c
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 0x6179(%rip), %r15      # 0xab08
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x655d
movq %rax, (%r14,%rbp,8)
testq %rax, %rax
je 0x4d00
cmpl $0x5, (%rax)
jne 0x4d00
incq %rbp
cmpq $0x3e8, %rbp            # imm = 0x3E8
jne 0x4991
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 0x4fb0
incq %r12
cmpq $0x3e8, %r12            # imm = 0x3E8
jne 0x49de
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 0x55f6(%rip), %xmm0     # 0xa010
leaq 0x66d6(%rip), %rdi      # 0xb0f7
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 0x66b4(%rip), %r15      # 0xb10b
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x655d
movq %rax, (%r14,%rbp,8)
testq %rax, %rax
je 0x4d1f
cmpl $0x2, (%rax)
jne 0x4d1f
cmpq $0x1f4, 0x20(%rax)      # imm = 0x1F4
jne 0x4d7c
incq %rbp
cmpq $0x3e8, %rbp            # imm = 0x3E8
jne 0x4a59
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 0x4fb0
incq %r12
cmpq $0x3e8, %r12            # imm = 0x3E8
jne 0x4ab4
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 0x551d(%rip), %xmm0     # 0xa010
leaq 0x6693(%rip), %rdi      # 0xb18d
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 0x5fe9(%rip), %r15      # 0xab08
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x63f7
decl %ebp
jne 0x4b1f
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 0x61dc
testl %eax, %eax
jne 0x4d9b
movq (%r15), %rax
testq %rax, %rax
je 0x4d3e
cmpl $0x5, (%rax)
jne 0x4d3e
addq $0x8, %rbp
cmpq $0x13880, %rbp          # imm = 0x13880
jne 0x4b48
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 0x4fb0
incq %r12
cmpq $0x2710, %r12           # imm = 0x2710
jne 0x4b9f
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 0x5432(%rip), %xmm0     # 0xa010
leaq 0x6601(%rip), %rdi      # 0xb1e6
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 0x6501(%rip), %r15      # 0xb10b
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x63f7
decl %ebp
jne 0x4c0a
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 0x61dc
testl %eax, %eax
jne 0x4dd9
movq (%r15), %rax
testq %rax, %rax
je 0x4d5d
cmpl $0x2, (%rax)
jne 0x4d5d
cmpq $0x1f4, 0x20(%rax)      # imm = 0x1F4
jne 0x4dba
addq $0x8, %rbp
cmpq $0x13880, %rbp          # imm = 0x13880
jne 0x4c33
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 0x4fb0
incq %r12
cmpq $0x2710, %r12           # imm = 0x2710
jne 0x4c98
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 0x5339(%rip), %xmm0     # 0xa010
leaq 0x6528(%rip), %rdi      # 0xb206
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 0x4f2a
leaq 0x638f(%rip), %rdi      # 0xb096
leaq 0x5b6c(%rip), %rsi      # 0xa87a
leaq 0x63be(%rip), %rcx      # 0xb0d3
movl $0x23f, %edx            # imm = 0x23F
callq 0x2140
leaq 0x63f9(%rip), %rdi      # 0xb11f
leaq 0x5b4d(%rip), %rsi      # 0xa87a
leaq 0x639f(%rip), %rcx      # 0xb0d3
movl $0x24a, %edx            # imm = 0x24A
callq 0x2140
leaq 0x6351(%rip), %rdi      # 0xb096
leaq 0x5b2e(%rip), %rsi      # 0xa87a
leaq 0x6380(%rip), %rcx      # 0xb0d3
movl $0x259, %edx            # imm = 0x259
callq 0x2140
leaq 0x63bb(%rip), %rdi      # 0xb11f
leaq 0x5b0f(%rip), %rsi      # 0xa87a
leaq 0x6361(%rip), %rcx      # 0xb0d3
movl $0x266, %edx            # imm = 0x266
callq 0x2140
leaq 0x63d8(%rip), %rdi      # 0xb15b
leaq 0x5af0(%rip), %rsi      # 0xa87a
leaq 0x6342(%rip), %rcx      # 0xb0d3
movl $0x24b, %edx            # imm = 0x24B
callq 0x2140
leaq 0x6413(%rip), %rdi      # 0xb1b5
leaq 0x5ad1(%rip), %rsi      # 0xa87a
leaq 0x6323(%rip), %rcx      # 0xb0d3
movl $0x258, %edx            # imm = 0x258
callq 0x2140
leaq 0x639a(%rip), %rdi      # 0xb15b
leaq 0x5ab2(%rip), %rsi      # 0xa87a
leaq 0x6304(%rip), %rcx      # 0xb0d3
movl $0x267, %edx            # imm = 0x267
callq 0x2140
leaq 0x63d5(%rip), %rdi      # 0xb1b5
leaq 0x5a93(%rip), %rsi      # 0xa87a
leaq 0x62e5(%rip), %rcx      # 0xb0d3
movl $0x265, %edx            # imm = 0x265
callq 0x2140