// File: /workspace/github_c_makefile_star2_O2/Genymobile[P]hiredis/test.c
// Function: test_blocking_connection_timeouts
static void test_blocking_connection_timeouts(struct config config) {
    redisContext *c;
    redisReply *reply;
    ssize_t s;
    const char *cmd = "DEBUG SLEEP 3\r\n";
    struct timeval tv;

    c = connect(config);
    test("Successfully completes a command when the timeout is not exceeded: ");
    reply = redisCommand(c,"SET foo fast");
    freeReplyObject(reply);
    tv.tv_sec = 0;
    tv.tv_usec = 10000;
    redisSetTimeout(c, tv);
    reply = redisCommand(c, "GET foo");
    test_cond(reply != NULL && reply->type == REDIS_REPLY_STRING && memcmp(reply->str, "fast", 4) == 0);
    freeReplyObject(reply);
    disconnect(c, 0);

    c = connect(config);
    test("Does not return a reply when the command times out: ");
    s = write(c->fd, cmd, strlen(cmd));
    tv.tv_sec = 0;
    tv.tv_usec = 10000;
    redisSetTimeout(c, tv);
    reply = redisCommand(c, "GET foo");
    test_cond(s > 0 && reply == NULL && c->err == REDIS_ERR_IO && strcmp(c->errstr, "Resource temporarily unavailable") == 0);
    freeReplyObject(reply);

    test("Reconnect properly reconnects after a timeout: ");
    redisReconnect(c);
    reply = redisCommand(c, "PING");
    test_cond(reply != NULL && reply->type == REDIS_REPLY_STATUS && strcmp(reply->str, "PONG") == 0);
    freeReplyObject(reply);

    test("Reconnect properly uses owned parameters: ");
    config.tcp.host = "foo";
    config.unix.path = "foo";
    redisReconnect(c);
    reply = redisCommand(c, "PING");
    test_cond(reply != NULL && reply->type == REDIS_REPLY_STATUS && strcmp(reply->str, "PONG") == 0);
    freeReplyObject(reply);

    disconnect(c, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
leaq 0x50(%rsp), %r15
movaps (%r15), %xmm0
movaps 0x10(%r15), %xmm1
movaps 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4c46
movq %rax, %rbx
movl 0x9f37(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x9f2f(%rip)      # 0xe1d8
leaq 0x4e5b(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5a8a(%rip), %rdi      # 0x9d48
xorl %eax, %eax
callq 0x2100
leaq 0x5ac0(%rip), %rsi      # 0x9d8c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %rdi
callq 0x4e08
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5c3a
leaq 0x5874(%rip), %rsi      # 0x9b68
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
testq %rax, %rax
je 0x431c
cmpl $0x1, (%r14)
jne 0x431c
movq 0x18(%r14), %rax
cmpl $0x74736166, (%rax)     # imm = 0x74736166
je 0x4527
leaq 0x5f28(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9ea6(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movq %rbx, %rdi
callq 0x4d68
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x4c46
movq %rax, %rbx
movl 0x9e70(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x9e68(%rip)      # 0xe1d8
leaq 0x4d94(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x5a14(%rip), %rdi      # 0x9d99
xorl %eax, %eax
callq 0x2100
movl 0x84(%rbx), %edi
leaq 0x599f(%rip), %rsi      # 0x9d38
pushq $0xf
popq %rdx
callq 0x20d0
movq %rax, %r15
movl $0x2710, %edx           # imm = 0x2710
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5c3a
leaq 0x57ae(%rip), %rsi      # 0x9b68
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
testq %r15, %r15
setg %al
testq %r14, %r14
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x43fa
cmpl $0x1, (%rbx)
jne 0x43fa
movq %rbx, %rdi
addq $0x4, %rdi
leaq 0x59e1(%rip), %rsi      # 0x9dce
callq 0x21c0
testl %eax, %eax
je 0x4557
leaq 0x5e4a(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9dc8(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0x9dbe(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x9db6(%rip)      # 0xe1d8
leaq 0x4ce2(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x59b8(%rip), %rdi      # 0x9def
xorl %eax, %eax
callq 0x2100
movq %rbx, %rdi
callq 0x5918
leaq 0x56bb(%rip), %rsi      # 0x9b08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
testq %rax, %rax
je 0x447d
cmpl $0x5, (%r14)
jne 0x447d
movq 0x18(%r14), %rdi
leaq 0x59af(%rip), %rsi      # 0x9e1f
callq 0x21c0
testl %eax, %eax
je 0x4538
leaq 0x5dc7(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9d45(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movl 0x9d3b(%rip), %esi      # 0xe1d8
incl %esi
movl %esi, 0x9d33(%rip)      # 0xe1d8
leaq 0x4c5f(%rip), %rdi      # 0x910b
xorl %eax, %eax
callq 0x2100
leaq 0x596a(%rip), %rdi      # 0x9e24
xorl %eax, %eax
callq 0x2100
movq %rbx, %rdi
callq 0x5918
leaq 0x5638(%rip), %rsi      # 0x9b08
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6044
movq %rax, %r14
testq %rax, %rax
je 0x44fc
cmpl $0x5, (%r14)
jne 0x44fc
movq 0x18(%r14), %rdi
leaq 0x592c(%rip), %rsi      # 0x9e1f
callq 0x21c0
testl %eax, %eax
je 0x4549
leaq 0x5d48(%rip), %rdi      # 0xa24b
callq 0x2090
incl 0x9cc6(%rip)            # 0xe1d4
movq %r14, %rdi
callq 0x4e08
movq %rbx, %rdi
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4d68
leaq 0x5d31(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x432e
leaq 0x5d20(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x448f
leaq 0x5d0f(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x450e
leaq 0x5d01(%rip), %rdi      # 0xa25f
callq 0x2090
jmp 0x440c