// File: /workspace/github_c_makefile_star2_O1/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 0x4e8a
movq %rax, %rbx
movl 0xb3dd(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb3d5(%rip)      # 0xf1d8
leaq 0x630a(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6cdb(%rip), %rdi      # 0xaaf3
xorl %eax, %eax
callq 0x2100
leaq 0x6ceb(%rip), %rsi      # 0xab11
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x5, (%rax)
jne 0x3e50
movq 0x18(%r14), %rdi
leaq 0x6cd3(%rip), %rsi      # 0xab16
callq 0x2050
testl %eax, %eax
je 0x4362
leaq 0x73fd(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb372(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xb368(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb360(%rip)      # 0xf1d8
leaq 0x6295(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6c8e(%rip), %rdi      # 0xab1b
xorl %eax, %eax
callq 0x2100
leaq 0x62a7(%rip), %rsi      # 0xa142
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x5, (%rax)
jne 0x3ec5
movq 0x18(%r14), %rdi
leaq 0x6c89(%rip), %rsi      # 0xab41
callq 0x2050
testl %eax, %eax
je 0x4373
leaq 0x7388(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb2fd(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xb2f3(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb2eb(%rip)      # 0xf1d8
leaq 0x6220(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6c42(%rip), %rdi      # 0xab44
xorl %eax, %eax
callq 0x2100
leaq 0x628d(%rip), %rsi      # 0xa19d
leaq 0x6c5e(%rip), %rdx      # 0xab75
leaq 0x6c47(%rip), %rcx      # 0xab65
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x6c3a(%rip), %rsi      # 0xab71
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x3f61
movq 0x18(%r14), %rdi
leaq 0x6c11(%rip), %rsi      # 0xab65
callq 0x21c0
testl %eax, %eax
je 0x4384
leaq 0x72ec(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb261(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xb257(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb24f(%rip)      # 0xf1d8
leaq 0x6184(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6bdb(%rip), %rdi      # 0xab79
xorl %eax, %eax
callq 0x2100
leaq 0x62d9(%rip), %rsi      # 0xa285
leaq 0x6bc2(%rip), %rdx      # 0xab75
leaq 0x73b2(%rip), %r8       # 0xb36c
movl $0x3, %ecx
movl $0xb, %r9d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x6b93(%rip), %rsi      # 0xab71
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x1, (%rax)
jne 0x4018
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 0x4395
leaq 0x7235(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb1aa(%rip)            # 0xf1d4
movl 0xb1a8(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb1a0(%rip)      # 0xf1d8
leaq 0x60d5(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6b4d(%rip), %rdi      # 0xab9a
xorl %eax, %eax
callq 0x2100
cmpl $0xb, 0x10(%r14)
jne 0x4069
leaq 0x7206(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x407b
leaq 0x71e4(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb159(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xb14f(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb147(%rip)      # 0xf1d8
leaq 0x607c(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6b15(%rip), %rdi      # 0xabbb
xorl %eax, %eax
callq 0x2100
leaq 0x6b1f(%rip), %rsi      # 0xabd3
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x4, (%rax)
jne 0x40d4
leaq 0x719b(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x40e6
leaq 0x7179(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb0ee(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xb0e4(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb0dc(%rip)      # 0xf1d8
leaq 0x6011(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6acc(%rip), %rdi      # 0xabdd
xorl %eax, %eax
callq 0x2100
leaq 0x6ada(%rip), %rsi      # 0xabf9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x3, (%rax)
jne 0x4146
cmpq $0x1, 0x8(%r14)
jne 0x4146
leaq 0x7129(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x4158
leaq 0x7107(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xb07c(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xb072(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xb06a(%rip)      # 0xf1d8
leaq 0x5f9f(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6a85(%rip), %rdi      # 0xac08
xorl %eax, %eax
callq 0x2100
leaq 0x6a96(%rip), %rsi      # 0xac27
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x6a8e(%rip), %rsi      # 0xac38
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x6a86(%rip), %rsi      # 0xac49
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x2, (%rax)
jne 0x421d
cmpq $0x2, 0x20(%r14)
jne 0x421d
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 0x421d
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 0x43a6
leaq 0x7030(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xafa5(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movl 0xaf9b(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xaf93(%rip)      # 0xf1d8
leaq 0x5ec8(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x6a02(%rip), %rdi      # 0xac5c
xorl %eax, %eax
callq 0x2100
leaq 0x6a1b(%rip), %rsi      # 0xac83
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x69c8(%rip), %rsi      # 0xac49
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x6877(%rip), %rsi      # 0xab11
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %rdi
callq 0x5040
leaq 0x69d6(%rip), %rsi      # 0xac89
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x2, (%rax)
jne 0x4339
cmpq $0x2, 0x20(%r14)
jne 0x4339
movq 0x28(%r14), %rax
movq (%rax), %rcx
cmpl $0x2, (%rcx)
jne 0x4339
cmpq $0x2, 0x20(%rcx)
jne 0x4339
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 0x4339
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 0x4339
movq 0x8(%rax), %rax
cmpl $0x5, (%rax)
jne 0x4339
movq 0x18(%rax), %rdi
leaq 0x67e6(%rip), %rsi      # 0xab16
callq 0x2050
testl %eax, %eax
je 0x43b7
leaq 0x6f14(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xae89(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r14
jmp 0x4fbc
leaq 0x6eff(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x3e62
leaq 0x6eee(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x3ed7
leaq 0x6edd(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x3f73
leaq 0x6ecc(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x402a
leaq 0x6ebb(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x422f
leaq 0x6eaa(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x434b