// File: /workspace/github_c_makefile_star2_O2/Genymobile[P]hiredis/test.c
// Function: test_blocking_connection
static void test_blocking_connection(struct config config) {
    redisContext *c;
    redisReply *reply;

    c = connect(config);

    test("Is able to deliver commands: ");
    reply = redisCommand(c,"PING");
    test_cond(reply->type == REDIS_REPLY_STATUS &&
        strcasecmp(reply->str,"pong") == 0)
    freeReplyObject(reply);

    test("Is a able to send commands verbatim: ");
    reply = redisCommand(c,"SET foo bar");
    test_cond (reply->type == REDIS_REPLY_STATUS &&
        strcasecmp(reply->str,"ok") == 0)
    freeReplyObject(reply);

    test("%%s String interpolation works: ");
    reply = redisCommand(c,"SET %s %s","foo","hello world");
    freeReplyObject(reply);
    reply = redisCommand(c,"GET foo");
    test_cond(reply->type == REDIS_REPLY_STRING &&
        strcmp(reply->str,"hello world") == 0);
    freeReplyObject(reply);

    test("%%b String interpolation works: ");
    reply = redisCommand(c,"SET %b %b","foo",(size_t)3,"hello\x00world",(size_t)11);
    freeReplyObject(reply);
    reply = redisCommand(c,"GET foo");
    test_cond(reply->type == REDIS_REPLY_STRING &&
        memcmp(reply->str,"hello\x00world",11) == 0)

    test("Binary reply length is correct: ");
    test_cond(reply->len == 11)
    freeReplyObject(reply);

    test("Can parse nil replies: ");
    reply = redisCommand(c,"GET nokey");
    test_cond(reply->type == REDIS_REPLY_NIL)
    freeReplyObject(reply);

    /* test 7 */
    test("Can parse integer replies: ");
    reply = redisCommand(c,"INCR mycounter");
    test_cond(reply->type == REDIS_REPLY_INTEGER && reply->integer == 1)
    freeReplyObject(reply);

    test("Can parse multi bulk replies: ");
    freeReplyObject(redisCommand(c,"LPUSH mylist foo"));
    freeReplyObject(redisCommand(c,"LPUSH mylist bar"));
    reply = redisCommand(c,"LRANGE mylist 0 -1");
    test_cond(reply->type == REDIS_REPLY_ARRAY &&
              reply->elements == 2 &&
              !memcmp(reply->element[0]->str,"bar",3) &&
              !memcmp(reply->element[1]->str,"foo",3))
    freeReplyObject(reply);

    /* m/e with multi bulk reply *before* other reply.
     * specifically test ordering of reply items to parse. */
    test("Can handle nested multi bulk replies: ");
    freeReplyObject(redisCommand(c,"MULTI"));
    freeReplyObject(redisCommand(c,"LRANGE mylist 0 -1"));
    freeReplyObject(redisCommand(c,"PING"));
    reply = (redisCommand(c,"EXEC"));
    test_cond(reply->type == REDIS_REPLY_ARRAY &&
              reply->elements == 2 &&
              reply->element[0]->type == REDIS_REPLY_ARRAY &&
              reply->element[0]->elements == 2 &&
              !memcmp(reply->element[0]->element[0]->str,"bar",3) &&
              !memcmp(reply->element[0]->element[1]->str,"foo",3) &&
              reply->element[1]->type == REDIS_REPLY_STATUS &&
              strcasecmp(reply->element[1]->str,"pong") == 0);
    freeReplyObject(reply);

    disconnect(c, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movaps 0x60(%rsp), %xmm0
movaps 0x70(%rsp), %xmm1
movaps 0x80(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4c46
movq %rax, %rbx
movl 0xa52a(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa522(%rip)      # 0xe1d8
leaq 0x544e(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5e1f(%rip), %rdi      # 0x9aea
xorl %eax, %eax
callq 0x2100
leaq 0x5e2f(%rip), %rsi      # 0x9b08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x5, (%rax)
jne 0x3d03
movq 0x18(%r14), %rdi
leaq 0x5e17(%rip), %rsi      # 0x9b0d
callq 0x2050
testl %eax, %eax
je 0x4206
leaq 0x6541(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa4bf(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa4b5(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa4ad(%rip)      # 0xe1d8
leaq 0x53d9(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5dd2(%rip), %rdi      # 0x9b12
xorl %eax, %eax
callq 0x2100
leaq 0x53eb(%rip), %rsi      # 0x9139
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x5, (%rax)
jne 0x3d78
movq 0x18(%r14), %rdi
leaq 0x5dcd(%rip), %rsi      # 0x9b38
callq 0x2050
testl %eax, %eax
je 0x4217
leaq 0x64cc(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa44a(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa440(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa438(%rip)      # 0xe1d8
leaq 0x5364(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5d86(%rip), %rdi      # 0x9b3b
xorl %eax, %eax
callq 0x2100
leaq 0x53d1(%rip), %rsi      # 0x9194
leaq 0x5da2(%rip), %rdx      # 0x9b6c
leaq 0x5d8b(%rip), %rcx      # 0x9b5c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x5d7e(%rip), %rsi      # 0x9b68
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x3e14
movq 0x18(%r14), %rdi
leaq 0x5d55(%rip), %rsi      # 0x9b5c
callq 0x21c0
testl %eax, %eax
je 0x4228
leaq 0x6430(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa3ae(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa3a4(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa39c(%rip)      # 0xe1d8
leaq 0x52c8(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5d1f(%rip), %rdi      # 0x9b70
xorl %eax, %eax
callq 0x2100
leaq 0x541d(%rip), %rsi      # 0x927c
leaq 0x5d06(%rip), %rdx      # 0x9b6c
leaq 0x64ef(%rip), %r8       # 0xa35c
pushq $0x3
popq %rcx
pushq $0xb
popq %r9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x5cdb(%rip), %rsi      # 0x9b68
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x3eba
movq 0x18(%r14), %rdi
leaq 0x64b2(%rip), %rsi      # 0xa35c
pushq $0xb
popq %rdx
callq 0x2220
testl %eax, %eax
je 0x4239
leaq 0x638a(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa308(%rip)            # 0xe1d4
movl 0xa306(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa2fe(%rip)      # 0xe1d8
leaq 0x522a(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5ca2(%rip), %rdi      # 0x9b91
xorl %eax, %eax
callq 0x2100
cmpl $0xb, 0x10(%r14)
jne 0x3f0b
leaq 0x635b(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3f1d
leaq 0x6339(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa2b7(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa2ad(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa2a5(%rip)      # 0xe1d8
leaq 0x51d1(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5c6a(%rip), %rdi      # 0x9bb2
xorl %eax, %eax
callq 0x2100
leaq 0x5c74(%rip), %rsi      # 0x9bca
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x4, (%rax)
jne 0x3f76
leaq 0x62f0(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3f88
leaq 0x62ce(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa24c(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa242(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa23a(%rip)      # 0xe1d8
leaq 0x5166(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5c21(%rip), %rdi      # 0x9bd4
xorl %eax, %eax
callq 0x2100
leaq 0x5c2f(%rip), %rsi      # 0x9bf0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x3, (%rax)
jne 0x3fe8
cmpq $0x1, 0x8(%r14)
jne 0x3fe8
leaq 0x627e(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3ffa
leaq 0x625c(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa1da(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa1d0(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa1c8(%rip)      # 0xe1d8
leaq 0x50f4(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5bda(%rip), %rdi      # 0x9bff
xorl %eax, %eax
callq 0x2100
leaq 0x5beb(%rip), %rsi      # 0x9c1e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x5be3(%rip), %rsi      # 0x9c2f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x5bdb(%rip), %rsi      # 0x9c40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x2, (%rax)
jne 0x40bb
cmpq $0x2, 0x20(%r14)
jne 0x40bb
movq 0x28(%r14), %r15
movq (%r15), %rax
movq 0x18(%rax), %rdi
leaq 0x50b1(%rip), %rsi      # 0x9141
pushq $0x3
popq %rdx
callq 0x2220
testl %eax, %eax
jne 0x40bb
movq 0x8(%r15), %rax
movq 0x18(%rax), %rdi
leaq 0x5ac1(%rip), %rsi      # 0x9b6c
pushq $0x3
popq %rdx
callq 0x2220
testl %eax, %eax
je 0x424a
leaq 0x6189(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0xa107(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0xa0fd(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0xa0f5(%rip)      # 0xe1d8
leaq 0x5021(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5b5b(%rip), %rdi      # 0x9c53
xorl %eax, %eax
callq 0x2100
leaq 0x5b74(%rip), %rsi      # 0x9c7a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x5b21(%rip), %rsi      # 0x9c40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x59d0(%rip), %rsi      # 0x9b08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
leaq 0x5b2f(%rip), %rsi      # 0x9c80
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x2, (%rax)
jne 0x41d9
cmpq $0x2, 0x20(%r14)
jne 0x41d9
movq 0x28(%r14), %r15
movq (%r15), %rax
cmpl $0x2, (%rax)
jne 0x41d9
cmpq $0x2, 0x20(%rax)
jne 0x41d9
movq 0x28(%rax), %r12
movq (%r12), %rax
movq 0x18(%rax), %rdi
leaq 0x4fb1(%rip), %rsi      # 0x9141
pushq $0x3
popq %rdx
callq 0x2220
testl %eax, %eax
jne 0x41d9
movq 0x8(%r12), %rax
movq 0x18(%rax), %rdi
leaq 0x59c0(%rip), %rsi      # 0x9b6c
pushq $0x3
popq %rdx
callq 0x2220
testl %eax, %eax
jne 0x41d9
movq 0x8(%r15), %rax
cmpl $0x5, (%rax)
jne 0x41d9
movq 0x18(%rax), %rdi
leaq 0x5941(%rip), %rsi      # 0x9b0d
callq 0x2050
testl %eax, %eax
je 0x425b
leaq 0x606b(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9fe9(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4d68
leaq 0x6052(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3d15
leaq 0x6041(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3d8a
leaq 0x6030(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3e26
leaq 0x601f(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x3ecc
leaq 0x600e(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x40cd
leaq 0x5ffd(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x41eb