// File: /workspace/github_c_makefile_star2_O2/Genymobile[P]hiredis/test.c
// Function: test_blocking_io_errors
static void test_blocking_io_errors(struct config config) {
    redisContext *c;
    redisReply *reply;
    void *_reply;
    int major, minor;

    /* Connect to target given by config. */
    c = connect(config);
    {
        /* Find out Redis version to determine the path for the next test */
        const char *field = "redis_version:";
        char *p, *eptr;

        reply = redisCommand(c,"INFO");
        p = strstr(reply->str,field);
        major = strtol(p+strlen(field),&eptr,10);
        p = eptr+1; /* char next to the first "." */
        minor = strtol(p,&eptr,10);
        freeReplyObject(reply);
    }

    test("Returns I/O error when the connection is lost: ");
    reply = redisCommand(c,"QUIT");
    if (major > 2 || (major == 2 && minor > 0)) {
        /* > 2.0 returns OK on QUIT and read() should be issued once more
         * to know the descriptor is at EOF. */
        test_cond(strcasecmp(reply->str,"OK") == 0 &&
            redisGetReply(c,&_reply) == REDIS_ERR);
        freeReplyObject(reply);
    } else {
        test_cond(reply == NULL);
    }

    /* On 2.0, QUIT will cause the connection to be closed immediately and
     * the read(2) for the reply on QUIT will set the error to EOF.
     * On >2.0, QUIT will return with OK and another read(2) needed to be
     * issued to find out the socket was closed by the server. In both
     * conditions, the error will be set to EOF. */
    assert(c->err == REDIS_ERR_EOF &&
        strcmp(c->errstr,"Server closed the connection") == 0);
    redisFree(c);

    c = connect(config);
    test("Returns I/O error on socket timeout: ");
    struct timeval tv = { 0, 1000 };
    assert(redisSetTimeout(c,tv) == REDIS_OK);
    test_cond(redisGetReply(c,&_reply) == REDIS_ERR &&
        c->err == REDIS_ERR_IO && errno == EAGAIN);
    redisFree(c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movaps 0x70(%rsp), %xmm0
movaps 0x80(%rsp), %xmm1
movaps 0x90(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4c46
movq %rax, %rbx
leaq 0x58b8(%rip), %rsi      # 0x9e5e
movq %rax, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
movq 0x18(%rax), %rdi
leaq 0x5891(%rip), %rsi      # 0x9e4f
callq 0x22e0
leaq 0xe(%rax), %rdi
leaq 0x38(%rsp), %r12
pushq $0xa
popq %rbp
movq %r12, %rsi
movl %ebp, %edx
callq 0x21e0
movq %rax, %r15
movq (%r12), %rdi
incq %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x21e0
movq %rax, %r12
movq %r14, %rdi
callq 0x4e08
movl 0x9bda(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x9bd2(%rip)      # 0xe1d8
leaq 0x4afe(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5848(%rip), %rdi      # 0x9e63
xorl %eax, %eax
callq 0x2100
leaq 0x586a(%rip), %rsi      # 0x9e93
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
cmpl $0x2, %r15d
jg 0x464b
jne 0x477b
testl %r12d, %r12d
jle 0x477b
movq 0x18(%r14), %rdi
leaq 0x5b8d(%rip), %rsi      # 0xa1e3
callq 0x2050
testl %eax, %eax
jne 0x4675
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x5ddc
cmpl $-0x1, %eax
je 0x4797
leaq 0x5bcf(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9b4d(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
cmpl $0x3, (%rbx)
jne 0x47b9
movq %rbx, %rdi
addq $0x4, %rdi
leaq 0x57f2(%rip), %rsi      # 0x9e98
callq 0x21c0
testl %eax, %eax
jne 0x47b9
leaq 0x70(%rsp), %r14
movq %rbx, %rdi
callq 0x588d
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4c46
movq %rax, %rbx
movl 0x9aee(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x9ae6(%rip)      # 0xe1d8
leaq 0x4a12(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x582b(%rip), %rdi      # 0x9f32
xorl %eax, %eax
callq 0x2100
movl $0x3e8, %edx            # imm = 0x3E8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5c3a
testl %eax, %eax
jne 0x47d8
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x5ddc
cmpl $-0x1, %eax
jne 0x4754
cmpl $0x1, (%rbx)
jne 0x4754
callq 0x2060
cmpl $0xb, (%rax)
jne 0x4754
leaq 0x5b12(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x4766
leaq 0x5af0(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9a6e(%rip)            # 0xe1d4
movq %rbx, %rdi
callq 0x588d
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r14, %r14
je 0x47a8
leaq 0x5ac4(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9a42(%rip)            # 0xe1d4
jmp 0x468f
leaq 0x5ac1(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x4687
leaq 0x5ab0(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x468f
leaq 0x56f5(%rip), %rdi      # 0x9eb5
leaq 0x50b3(%rip), %rsi      # 0x987a
leaq 0x5738(%rip), %rcx      # 0x9f06
movl $0x20c, %edx            # imm = 0x20C
callq 0x2140
leaq 0x5779(%rip), %rdi      # 0x9f58
leaq 0x5094(%rip), %rsi      # 0x987a
leaq 0x5719(%rip), %rcx      # 0x9f06
movl $0x212, %edx            # imm = 0x212
callq 0x2140