// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x38, %rsp
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4df8
movq %rax, %rbx
movl 0xb454(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb44c(%rip)      # 0xf1d8
leaq 0x6378(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6d49(%rip), %rdi      # 0xaaea
xorl %eax, %eax
callq 0x2100
leaq 0x6d59(%rip), %rsi      # 0xab08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x5, (%rax)
jne 0x3dd9
movq 0x18(%r14), %rdi
leaq 0x6d41(%rip), %rsi      # 0xab0d
callq 0x2050
testl %eax, %eax
je 0x42eb
leaq 0x746b(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb3e9(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb3df(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb3d7(%rip)      # 0xf1d8
leaq 0x6303(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6cfc(%rip), %rdi      # 0xab12
xorl %eax, %eax
callq 0x2100
leaq 0x6315(%rip), %rsi      # 0xa139
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x5, (%rax)
jne 0x3e4e
movq 0x18(%r14), %rdi
leaq 0x6cf7(%rip), %rsi      # 0xab38
callq 0x2050
testl %eax, %eax
je 0x42fc
leaq 0x73f6(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb374(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb36a(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb362(%rip)      # 0xf1d8
leaq 0x628e(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6cb0(%rip), %rdi      # 0xab3b
xorl %eax, %eax
callq 0x2100
leaq 0x62fb(%rip), %rsi      # 0xa194
leaq 0x6ccc(%rip), %rdx      # 0xab6c
leaq 0x6cb5(%rip), %rcx      # 0xab5c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x6ca8(%rip), %rsi      # 0xab68
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x3eea
movq 0x18(%r14), %rdi
leaq 0x6c7f(%rip), %rsi      # 0xab5c
callq 0x21c0
testl %eax, %eax
je 0x430d
leaq 0x735a(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb2d8(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb2ce(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb2c6(%rip)      # 0xf1d8
leaq 0x61f2(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6c49(%rip), %rdi      # 0xab70
xorl %eax, %eax
callq 0x2100
leaq 0x6347(%rip), %rsi      # 0xa27c
leaq 0x6c30(%rip), %rdx      # 0xab6c
leaq 0x7419(%rip), %r8       # 0xb35c
movl $0x3, %ecx
movl $0xb, %r9d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x6c01(%rip), %rsi      # 0xab68
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x3fa1
movq 0x18(%r14), %rax
movabsq $0x6f77006f6c6c6568, %rcx # imm = 0x6F77006F6C6C6568
xorq (%rax), %rcx
movabsq $0x646c726f77006f6c, %rdx # imm = 0x646C726F77006F6C
xorq 0x3(%rax), %rdx
orq %rcx, %rdx
je 0x431e
leaq 0x72a3(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb221(%rip)            # 0xf1d4
movl 0xb21f(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb217(%rip)      # 0xf1d8
leaq 0x6143(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6bbb(%rip), %rdi      # 0xab91
xorl %eax, %eax
callq 0x2100
cmpl $0xb, 0x10(%r14)
jne 0x3ff2
leaq 0x7274(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x4004
leaq 0x7252(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb1d0(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb1c6(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb1be(%rip)      # 0xf1d8
leaq 0x60ea(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6b83(%rip), %rdi      # 0xabb2
xorl %eax, %eax
callq 0x2100
leaq 0x6b8d(%rip), %rsi      # 0xabca
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x4, (%rax)
jne 0x405d
leaq 0x7209(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x406f
leaq 0x71e7(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb165(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb15b(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb153(%rip)      # 0xf1d8
leaq 0x607f(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6b3a(%rip), %rdi      # 0xabd4
xorl %eax, %eax
callq 0x2100
leaq 0x6b48(%rip), %rsi      # 0xabf0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x3, (%rax)
jne 0x40cf
cmpq $0x1, 0x8(%r14)
jne 0x40cf
leaq 0x7197(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x40e1
leaq 0x7175(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb0f3(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb0e9(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb0e1(%rip)      # 0xf1d8
leaq 0x600d(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6af3(%rip), %rdi      # 0xabff
xorl %eax, %eax
callq 0x2100
leaq 0x6b04(%rip), %rsi      # 0xac1e
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x6afc(%rip), %rsi      # 0xac2f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x6af4(%rip), %rsi      # 0xac40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x2, (%rax)
jne 0x41a6
cmpq $0x2, 0x20(%r14)
jne 0x41a6
movq 0x28(%r14), %rax
movq (%rax), %rcx
movq 0x18(%rcx), %rcx
movzwl (%rcx), %edx
xorl $0x6162, %edx           # imm = 0x6162
movzbl 0x2(%rcx), %ecx
xorl $0x72, %ecx
orw %dx, %cx
jne 0x41a6
movq 0x8(%rax), %rax
movq 0x18(%rax), %rax
movzwl (%rax), %ecx
xorl $0x6f66, %ecx           # imm = 0x6F66
movzbl 0x2(%rax), %eax
xorl $0x6f, %eax
orw %cx, %ax
je 0x432f
leaq 0x709e(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xb01c(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movl 0xb012(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb00a(%rip)      # 0xf1d8
leaq 0x5f36(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6a70(%rip), %rdi      # 0xac53
xorl %eax, %eax
callq 0x2100
leaq 0x6a89(%rip), %rsi      # 0xac7a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x6a36(%rip), %rsi      # 0xac40
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x68e5(%rip), %rsi      # 0xab08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %rdi
callq 0x4fb0
leaq 0x6a44(%rip), %rsi      # 0xac80
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x2, (%rax)
jne 0x42c2
cmpq $0x2, 0x20(%r14)
jne 0x42c2
movq 0x28(%r14), %rax
movq (%rax), %rcx
cmpl $0x2, (%rcx)
jne 0x42c2
cmpq $0x2, 0x20(%rcx)
jne 0x42c2
movq 0x28(%rcx), %rcx
movq (%rcx), %rdx
movq 0x18(%rdx), %rdx
movzwl (%rdx), %esi
xorl $0x6162, %esi           # imm = 0x6162
movzbl 0x2(%rdx), %edx
xorl $0x72, %edx
orw %si, %dx
jne 0x42c2
movq 0x8(%rcx), %rcx
movq 0x18(%rcx), %rcx
movzwl (%rcx), %edx
xorl $0x6f66, %edx           # imm = 0x6F66
movzbl 0x2(%rcx), %ecx
xorl $0x6f, %ecx
orw %dx, %cx
jne 0x42c2
movq 0x8(%rax), %rax
cmpl $0x5, (%rax)
jne 0x42c2
movq 0x18(%rax), %rdi
leaq 0x6854(%rip), %rsi      # 0xab0d
callq 0x2050
testl %eax, %eax
je 0x4340
leaq 0x6f82(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xaf00(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r14
jmp 0x4f2a
leaq 0x6f6d(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x3deb
leaq 0x6f5c(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x3e60
leaq 0x6f4b(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x3efc
leaq 0x6f3a(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x3fb3
leaq 0x6f29(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x41b8
leaq 0x6f18(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x42d4