user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ss_connect_to_unix_host_impl>:
  endbr64
  push   %r14
  mov    $0x8,%edx
  mov    %esi,%r14d
  xor    %esi,%esi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  mov    %r13,%rdi
  call   <memset@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cmp    $0x3,%eax
  ja     L131
  mov    D69(%rip),%rbx
  mov    (%rsp),%edi
  mov    %rbp,%rsi
  mov    (%rbx),%eax
  mov    %eax,0x4(%rsp)
  call   <strcpy@plt>
  xor    %eax,%eax
  call   <Sdeactivate_thread@plt>
  mov    D92(%rip),%rax
  mov    (%rbx),%edi
  xor    %edx,%edx
  mov    (%rax),%esi
  call   <socket@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  jne    L124
  mov    D93(%rip),%rbp
  xor    %eax,%eax
  mov    $0xfffffffe,%r12d
  mov    0x0(%rbp),%ebx
  call   <Sactivate_thread@plt>
L35:
  mov    %ebx,0x0(%rbp)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L83
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L124:
  mov    D30(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D60(%rip),%rdx
  mov    %r12d,%edi
  or     (%rdx),%eax
  mov    %eax,%edx
  mov    D36(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D93(%rip),%rbp
  test   %r14d,%r14d
  jne    L18
  jmp    L106
  nop
L11:
  mov    D7(%rip),%rax
  cmp    (%rax),%ebx
  jne    L125
L18:
  mov    $0x8,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <connect@plt>
  mov    0x0(%rbp),%ebx
  cmp    $0xffffffff,%eax
  je     L11
L57:
  xor    %eax,%eax
  call   <Sactivate_thread@plt>
  jmp    L35
  nop
L106:
  mov    %r12d,%edi
  call   <ss_set_fd_non_blocking@plt>
  test   %eax,%eax
  jne    L18
  mov    %r12d,%edi
  mov    0x0(%rbp),%ebx
  mov    $0xfffffffe,%r12d
  call   <close@plt>
  xor    %eax,%eax
  call   <Sactivate_thread@plt>
  jmp    L35
  nopl   0x0(%rax)
L125:
  mov    D8(%rip),%rax
  cmp    (%rax),%ebx
  je     L57
  mov    D24(%rip),%rax
  cmp    (%rax),%ebx
  je     L57
  mov    %r12d,%edi
  mov    $0xfffffffd,%r12d
  call   <close@plt>
  xor    %eax,%eax
  call   <Sactivate_thread@plt>
  jmp    L35
L131:
  mov    D93(%rip),%rbp
  xor    %ebx,%ebx
  mov    $0xffffffff,%r12d
  jmp    L35
L83:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ss_connect_to_unix_host_impl(const char *pathname, int blocking) {
  struct sockaddr_un addr;
  memset(&addr, 0, sizeof(addr));
  if (strlen(pathname) >= sizeof(addr.sun_path)) {
    errno = 0;
    return -1;
  }
  addr.sun_family = AF_UNIX;
  strcpy(addr.sun_path, pathname);
  Sdeactivate_thread();
  int saved_errno = 0;
  int err = 0;
  int sock = socket(AF_UNIX, SOCK_STREAM, 0);
  if (sock == -1) {
    saved_errno = errno;
    err = -2;
  } else {
    fcntl(sock, F_SETFD, fcntl(sock, F_GETFD) | FD_CLOEXEC);
    if (!blocking && !(ss_set_fd_non_blocking(sock))) {
      saved_errno = errno;
      close(sock);
      err = -2;
    }
  }
  if (!err) {
    int res;
    do {
      res = connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_un));
    } while (res == -1 && errno == EINTR);
    saved_errno = errno;
    if (res == -1 && errno != EINPROGRESS && errno != EAGAIN) {
      close(sock);
      err = -3;
    }
  }
  Sactivate_thread();
  errno = saved_errno;
  if (err)
    return err;
  return sock;
}
```