// File: /workspace/github_c_makefile_star2_O3/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 %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 0x4df8
movq %rax, %rbx
leaq 0x67d5(%rip), %rsi      # 0xae5e
movq %rax, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
movq 0x18(%rax), %rdi
leaq 0x67ae(%rip), %rsi      # 0xae4f
callq 0x22e0
leaq 0xe(%rax), %rdi
leaq 0x30(%rsp), %r12
movq %r12, %rsi
movl $0xa, %edx
callq 0x21e0
movq %rax, %r15
movq (%r12), %rdi
incq %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x21e0
movq %rax, %r12
movq %r14, %rdi
callq 0x4fb0
movl 0xaaf4(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xaaec(%rip)      # 0xf1d8
leaq 0x5a18(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6762(%rip), %rdi      # 0xae63
xorl %eax, %eax
callq 0x2100
leaq 0x6784(%rip), %rsi      # 0xae93
movq %rbx, %rdi
xorl %eax, %eax
callq 0x655d
movq %rax, %r14
cmpl $0x2, %r15d
jg 0x4731
jne 0x4860
testl %r12d, %r12d
jle 0x4860
movq 0x18(%r14), %rdi
leaq 0x6aa7(%rip), %rsi      # 0xb1e3
callq 0x2050
testl %eax, %eax
jne 0x475b
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x61dc
cmpl $-0x1, %eax
je 0x487c
leaq 0x6ae9(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xaa67(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x4fb0
cmpl $0x3, (%rbx)
jne 0x489e
movq %rbx, %rdi
addq $0x4, %rdi
leaq 0x670c(%rip), %rsi      # 0xae98
callq 0x21c0
testl %eax, %eax
jne 0x489e
leaq 0x60(%rsp), %r14
movq %rbx, %rdi
callq 0x5b72
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4df8
movq %rax, %rbx
movl 0xaa08(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xaa00(%rip)      # 0xf1d8
leaq 0x592c(%rip), %rdi      # 0xa10b
xorl %eax, %eax
callq 0x2100
leaq 0x6745(%rip), %rdi      # 0xaf32
xorl %eax, %eax
callq 0x2100
movl $0x3e8, %edx            # imm = 0x3E8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5f7e
testl %eax, %eax
jne 0x48bd
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x61dc
cmpl $-0x1, %eax
jne 0x483a
cmpl $0x1, (%rbx)
jne 0x483a
callq 0x2060
cmpl $0xb, (%rax)
jne 0x483a
leaq 0x6a2c(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x484c
leaq 0x6a0a(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xa988(%rip)            # 0xf1d4
movq %rbx, %rdi
callq 0x5b72
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r14, %r14
je 0x488d
leaq 0x69df(%rip), %rdi      # 0xb24b
callq 0x2090
incl 0xa95d(%rip)            # 0xf1d4
jmp 0x4775
leaq 0x69dc(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x476d
leaq 0x69cb(%rip), %rdi      # 0xb25f
callq 0x2090
jmp 0x4775
leaq 0x6610(%rip), %rdi      # 0xaeb5
leaq 0x5fce(%rip), %rsi      # 0xa87a
leaq 0x6653(%rip), %rcx      # 0xaf06
movl $0x20c, %edx            # imm = 0x20C
callq 0x2140
leaq 0x6694(%rip), %rdi      # 0xaf58
leaq 0x5faf(%rip), %rsi      # 0xa87a
leaq 0x6634(%rip), %rcx      # 0xaf06
movl $0x212, %edx            # imm = 0x212
callq 0x2140