// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x80, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x97ab(%rip), %rcx      # 0xde05
movq %rcx, -0x20(%rbp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x5550
movq %rax, -0x8(%rbp)
movl 0xdb3a(%rip), %esi      # 0x121c0
addl $0x1, %esi
movl %esi, 0xdb31(%rip)      # 0x121c0
leaq 0x8a98(%rip), %rdi      # 0xd12e
movb $0x0, %al
callq 0x20f0
leaq 0x9771(%rip), %rdi      # 0xde15
movb $0x0, %al
callq 0x20f0
movq -0x8(%rbp), %rdi
leaq 0x97a3(%rip), %rsi      # 0xde59
movb $0x0, %al
callq 0x7b80
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5880
movq $0x0, -0x30(%rbp)
movq $0x2710, -0x28(%rbp)    # imm = 0x2710
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7370
movq -0x8(%rbp), %rdi
leaq 0x94bf(%rip), %rsi      # 0xdbb5
movb $0x0, %al
callq 0x7b80
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x473b
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x473b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %eax
subl $0x74736166, %eax       # imm = 0x74736166
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x473b
leaq 0x8a56(%rip), %rdi      # 0xd188
movb $0x0, %al
callq 0x20f0
jmp 0x4758
leaq 0x8a5b(%rip), %rdi      # 0xd19d
movb $0x0, %al
callq 0x20f0
movl 0xda6d(%rip), %eax      # 0x121bc
addl $0x1, %eax
movl %eax, 0xda64(%rip)      # 0x121bc
movq -0x10(%rbp), %rdi
callq 0x5880
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x5660
movq -0x38(%rbp), %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x5550
movq %rax, -0x8(%rbp)
movl 0xda28(%rip), %esi      # 0x121c0
addl $0x1, %esi
movl %esi, 0xda1f(%rip)      # 0x121c0
leaq 0x8986(%rip), %rdi      # 0xd12e
movb $0x0, %al
callq 0x20f0
leaq 0x96b0(%rip), %rdi      # 0xde66
movb $0x0, %al
callq 0x20f0
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20d0
movl -0x44(%rbp), %edi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0x20c0
movq %rax, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x2710, -0x28(%rbp)    # imm = 0x2710
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x7370
movq -0x8(%rbp), %rdi
leaq 0x939b(%rip), %rsi      # 0xdbb5
movb $0x0, %al
callq 0x7b80
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x18(%rbp)
jle 0x4865
cmpq $0x0, -0x10(%rbp)
jne 0x4865
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x4865
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
leaq 0x9650(%rip), %rsi      # 0xde9b
callq 0x21a0
cmpl $0x0, %eax
jne 0x4865
leaq 0x892c(%rip), %rdi      # 0xd188
movb $0x0, %al
callq 0x20f0
jmp 0x4882
leaq 0x8931(%rip), %rdi      # 0xd19d
movb $0x0, %al
callq 0x20f0
movl 0xd943(%rip), %eax      # 0x121bc
addl $0x1, %eax
movl %eax, 0xd93a(%rip)      # 0x121bc
movq -0x10(%rbp), %rdi
callq 0x5880
movl 0xd92f(%rip), %esi      # 0x121c0
addl $0x1, %esi
movl %esi, 0xd926(%rip)      # 0x121c0
leaq 0x888d(%rip), %rdi      # 0xd12e
movb $0x0, %al
callq 0x20f0
leaq 0x960d(%rip), %rdi      # 0xdebc
movb $0x0, %al
callq 0x20f0
movq -0x8(%rbp), %rdi
callq 0x6da0
movq -0x8(%rbp), %rdi
leaq 0x928b(%rip), %rsi      # 0xdb55
movb $0x0, %al
callq 0x7b80
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x490e
movq -0x10(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x490e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x95f8(%rip), %rsi      # 0xdeec
callq 0x21a0
cmpl $0x0, %eax
jne 0x490e
leaq 0x8883(%rip), %rdi      # 0xd188
movb $0x0, %al
callq 0x20f0
jmp 0x492b
leaq 0x8888(%rip), %rdi      # 0xd19d
movb $0x0, %al
callq 0x20f0
movl 0xd89a(%rip), %eax      # 0x121bc
addl $0x1, %eax
movl %eax, 0xd891(%rip)      # 0x121bc
movq -0x10(%rbp), %rdi
callq 0x5880
movl 0xd886(%rip), %esi      # 0x121c0
addl $0x1, %esi
movl %esi, 0xd87d(%rip)      # 0x121c0
leaq 0x87e4(%rip), %rdi      # 0xd12e
movb $0x0, %al
callq 0x20f0
leaq 0x9599(%rip), %rdi      # 0xdef1
movb $0x0, %al
callq 0x20f0
movq -0x38(%rbp), %rax
leaq 0x924f(%rip), %rcx      # 0xdbb9
movq %rcx, 0x8(%rax)
leaq 0x9244(%rip), %rcx      # 0xdbb9
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rdi
callq 0x6da0
movq -0x8(%rbp), %rdi
leaq 0x91c8(%rip), %rsi      # 0xdb55
movb $0x0, %al
callq 0x7b80
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x49d1
movq -0x10(%rbp), %rax
cmpl $0x5, (%rax)
jne 0x49d1
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0x9535(%rip), %rsi      # 0xdeec
callq 0x21a0
cmpl $0x0, %eax
jne 0x49d1
leaq 0x87c0(%rip), %rdi      # 0xd188
movb $0x0, %al
callq 0x20f0
jmp 0x49ee
leaq 0x87c5(%rip), %rdi      # 0xd19d
movb $0x0, %al
callq 0x20f0
movl 0xd7d7(%rip), %eax      # 0x121bc
addl $0x1, %eax
movl %eax, 0xd7ce(%rip)      # 0x121bc
movq -0x10(%rbp), %rdi
callq 0x5880
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x5660
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)