// File: /workspace/github_c_makefile_star2_O1/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 0x4e8a
movq %rax, %rbx
leaq 0x674c(%rip), %rsi      # 0xae67
movq %rax, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
movq 0x18(%rax), %rdi
leaq 0x6725(%rip), %rsi      # 0xae58
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 0x5040
movl 0xaa62(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xaa5a(%rip)      # 0xf1d8
leaq 0x598f(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x66d9(%rip), %rdi      # 0xae6c
xorl %eax, %eax
callq 0x2100
leaq 0x66fb(%rip), %rsi      # 0xae9c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66dc
movq %rax, %r14
cmpl $0x2, %r15d
jg 0x47c3
jne 0x48f2
testl %r12d, %r12d
jle 0x48f2
movq 0x18(%r14), %rdi
leaq 0x6a1e(%rip), %rsi      # 0xb1ec
callq 0x2050
testl %eax, %eax
jne 0x47ed
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6364
cmpl $-0x1, %eax
je 0x490e
leaq 0x6a60(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xa9d5(%rip)            # 0xf1d4
movq %r14, %rdi
callq 0x5040
cmpl $0x3, (%rbx)
jne 0x4930
movq %rbx, %rdi
addq $0x4, %rdi
leaq 0x6683(%rip), %rsi      # 0xaea1
callq 0x21c0
testl %eax, %eax
jne 0x4930
leaq 0x60(%rsp), %r14
movq %rbx, %rdi
callq 0x5cab
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4e8a
movq %rax, %rbx
movl 0xa976(%rip), %esi      # 0xf1d8
incl %esi
movl %esi, 0xa96e(%rip)      # 0xf1d8
leaq 0x58a3(%rip), %rdi      # 0xa114
xorl %eax, %eax
callq 0x2100
leaq 0x66bc(%rip), %rdi      # 0xaf3b
xorl %eax, %eax
callq 0x2100
movl $0x3e8, %edx            # imm = 0x3E8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x60eb
testl %eax, %eax
jne 0x494f
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x6364
cmpl $-0x1, %eax
jne 0x48cc
cmpl $0x1, (%rbx)
jne 0x48cc
callq 0x2060
cmpl $0xb, (%rax)
jne 0x48cc
leaq 0x69a3(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x48de
leaq 0x6981(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xa8f6(%rip)            # 0xf1d4
movq %rbx, %rdi
callq 0x5cab
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r14, %r14
je 0x491f
leaq 0x6956(%rip), %rdi      # 0xb254
callq 0x2090
incl 0xa8cb(%rip)            # 0xf1d4
jmp 0x4807
leaq 0x6953(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x47ff
leaq 0x6942(%rip), %rdi      # 0xb268
callq 0x2090
jmp 0x4807
leaq 0x6587(%rip), %rdi      # 0xaebe
leaq 0x5f45(%rip), %rsi      # 0xa883
leaq 0x65ca(%rip), %rcx      # 0xaf0f
movl $0x20c, %edx            # imm = 0x20C
callq 0x2140
leaq 0x660b(%rip), %rdi      # 0xaf61
leaq 0x5f26(%rip), %rsi      # 0xa883
leaq 0x65ab(%rip), %rcx      # 0xaf0f
movl $0x212, %edx            # imm = 0x212
callq 0x2140