// File: /workspace/github_c_makefile_star2_O0/andyfighting[P]hiredis_timer_cmpt/net.c
// Function: redisContextConnectUnix
int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) {
    int blocking = (c->flags & REDIS_BLOCK);
    struct sockaddr_un sa;

    if (redisCreateSocket(c,AF_LOCAL) < 0)
        return REDIS_ERR;
    if (redisSetBlocking(c,0) != REDIS_OK)
        return REDIS_ERR;

    c->connection_type = REDIS_CONN_UNIX;
    if (c->unix_sock.path != path)
        c->unix_sock.path = strdup(path);

    if (timeout) {
        if (c->timeout != timeout) {
            if (c->timeout == NULL)
                c->timeout = malloc(sizeof(struct timeval));

            memcpy(c->timeout, timeout, sizeof(struct timeval));
        }
    } else {
        if (c->timeout)
            free(c->timeout);
        c->timeout = NULL;
    }

    sa.sun_family = AF_LOCAL;
    strncpy(sa.sun_path,path,sizeof(sa.sun_path)-1);
    if (connect(c->fd, (struct sockaddr*)&sa, sizeof(sa)) == -1) {
        if (errno == EINPROGRESS && !blocking) {
            /* This is ok. */
        } else {
            if (redisContextWaitReady(c,c->timeout) != REDIS_OK)
                return REDIS_ERR;
        }
    }

    /* Reset socket to be blocking after connect(2). */
    if (blocking && redisSetBlocking(c,1) != REDIS_OK)
        return REDIS_ERR;

    c->flags |= REDIS_CONNECTED;
    return REDIS_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4270
cmpl $0x0, %eax
jge 0x40c6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4258
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x42f0
cmpl $0x0, %eax
je 0x40e2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4258
movq -0x10(%rbp), %rax
movl $0x1, 0xa0(%rax)
movq -0x10(%rbp), %rax
movq 0xc8(%rax), %rax
cmpq -0x18(%rbp), %rax
je 0x4118
movq -0x18(%rbp), %rdi
callq 0x34d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xc8(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x4175
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
cmpq -0x20(%rbp), %rax
je 0x4173
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
jne 0x4156
movl $0x10, %edi
callq 0x3350
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xa8(%rax)
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x41a2
movq -0x10(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
je 0x4193
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rdi
callq 0x3040
movq -0x10(%rbp), %rax
movq $0x0, 0xa8(%rax)
movw $0x1, -0x92(%rbp)
leaq -0x92(%rbp), %rdi
addq $0x2, %rdi
movq -0x18(%rbp), %rsi
movl $0x6b, %edx
callq 0x3080
movq -0x10(%rbp), %rax
movl 0x84(%rax), %edi
leaq -0x92(%rbp), %rsi
movl $0x6e, %edx
callq 0x3480
cmpl $-0x1, %eax
jne 0x421c
callq 0x3070
cmpl $0x73, (%rax)
jne 0x41f6
cmpl $0x0, -0x24(%rbp)
jne 0x41f6
jmp 0x421a
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0xa8(%rax), %rsi
callq 0x43c0
cmpl $0x0, %eax
je 0x4218
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4258
jmp 0x421a
jmp 0x421c
cmpl $0x0, -0x24(%rbp)
je 0x423e
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x42f0
cmpl $0x0, %eax
je 0x423e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4258
movq -0x10(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x88(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)