user: What is the c source code of the assembly code below:

```asm
<ss_connect_to_ipv6_host_impl>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  xor    %esi,%esi
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %dx,(%rsp)
  lea    0x20(%rsp),%r15
  mov    $0x18,%edx
  mov    %ecx,0x4(%rsp)
  mov    %r15,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  mov    D1(%rip),%rax
  mov    %r13,%rdi
  mov    (%rax),%eax
  mov    %eax,0x34(%rsp)
  mov    D47(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x30(%rsp)
  call   <Slock_object@plt>
  test   %r12,%r12
  je     L198
  mov    %r12,%rdi
  call   <Slock_object@plt>
  xor    %eax,%eax
  call   <Sdeactivate_thread@plt>
  lea    0x18(%rsp),%rcx
  mov    %r15,%rdx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L93
  mov    0x18(%rsp),%r15
  test   %r15,%r15
  je     L93
L214:
  movzwl (%rsp),%eax
  mov    D118(%rip),%rbp
  mov    %eax,0x8(%rsp)
L32:
  mov    D47(%rip),%rax
  xor    %edx,%edx
  mov    (%rax),%esi
  mov    D1(%rip),%rax
  mov    (%rax),%edi
  call   <socket@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L239
  mov    D90(%rip),%rax
  mov    %r14d,%edi
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D28(%rip),%rdx
  mov    %r14d,%edi
  or     (%rdx),%eax
  mov    %eax,%edx
  mov    D13(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L208
L66:
  cmpw   $0x0,(%rsp)
  mov    (%r15),%rbx
  je     L36
  jmp    L137
  nopl   0x0(%rax,%rax,1)
L148:
  mov    D110(%rip),%rax
  mov    0x0(%rbp),%edx
  cmp    (%rax),%edx
  jne    L244
L36:
  mov    $0x4,%edx
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <connect@plt>
  cmp    $0xffffffff,%eax
  je     L148
  mov    0x0(%rbp),%ebx
  jmp    L135
  nopl   0x0(%rax,%rax,1)
L244:
  mov    D73(%rip),%rax
  mov    (%rax),%ebx
  cmp    %ebx,%edx
  jne    L80
L135:
  xor    %eax,%eax
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  je     L115
L215:
  mov    %r12,%rdi
  call   <Sunlock_object@plt>
L115:
  mov    0x18(%rsp),%rdi
  call   <freeaddrinfo@plt>
L178:
  mov    %ebx,0x0(%rbp)
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L256
  add    $0x48,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L198:
  xor    %eax,%eax
  call   <Sdeactivate_thread@plt>
  xor    %esi,%esi
  lea    0x18(%rsp),%rcx
  mov    %r15,%rdx
  mov    %r13,%rdi
  call   <getaddrinfo@plt>
  test   %rax,%rax
  jne    L188
  mov    0x18(%rsp),%r15
  test   %r15,%r15
  jne    L214
L188:
  mov    D118(%rip),%rbp
  xor    %eax,%eax
  mov    0x0(%rbp),%ebx
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
L60:
  mov    $0xffffffff,%r14d
  jmp    L178
  nopl   (%rax)
L208:
  mov    %r14d,%edi
  call   <ss_set_fd_non_blocking@plt>
  test   %eax,%eax
  jne    L66
  mov    %r14d,%edi
  mov    0x0(%rbp),%ebx
  call   <close@plt>
L155:
  xor    %eax,%eax
  mov    $0xfffffffe,%r14d
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  jne    L215
  jmp    L115
  xchg   %ax,%ax
L137:
  mov    0x8(%rsp),%edi
  call   <htons@plt>
  mov    %eax,(%rbx)
  jmp    L36
L80:
  mov    %r14d,%edi
  mov    %edx,0xc(%rsp)
  call   <close@plt>
  mov    0x8(%r15),%r15
  mov    0xc(%rsp),%edx
  test   %r15,%r15
  jne    L32
  xor    %eax,%eax
  mov    %edx,(%rsp)
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  mov    (%rsp),%edx
  je     L73
  mov    %edx,%ebx
  mov    $0xfffffffd,%r14d
  jmp    L215
L239:
  mov    0x0(%rbp),%ebx
  jmp    L155
L73:
  mov    0x18(%rsp),%rdi
  mov    $0xfffffffd,%r14d
  call   <freeaddrinfo@plt>
  mov    (%rsp),%ebx
  jmp    L178
L93:
  mov    D118(%rip),%rbp
  xor    %eax,%eax
  mov    0x0(%rbp),%ebx
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  mov    %r12,%rdi
  call   <Sunlock_object@plt>
  jmp    L60
L256:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ss_connect_to_ipv6_host_impl(const char *address, const char *service, unsigned short port, int blocking) {
  struct addrinfo hints;
  memset(&hints, 0, sizeof(hints));
  hints.ai_family = AF_INET6;
  hints.ai_socktype = SOCK_STREAM;
  Slock_object((void *)address);
  if (service)
    Slock_object((void *)service);
  Sdeactivate_thread();
  struct addrinfo *info;
  int saved_errno = 0;
  if (getaddrinfo(address, service, &hints, &info) || info == NULL) {
    saved_errno = errno;
    Sactivate_thread();
    Sunlock_object((void *)address);
    if (service)
      Sunlock_object((void *)service);
    errno = saved_errno;
    return -1;
  }
  int sock;
  struct addrinfo *tmp;
  int err = 0;
  for (tmp = info; tmp != NULL; tmp = tmp->ai_next) {
    err = 0;
    sock = socket(AF_INET6, SOCK_STREAM, 0);
    if (sock == -1) {
      saved_errno = errno;
      err = -2;
      break;
    }
    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;
      break;
    }
    struct sockaddr *in = tmp->ai_addr;
    if (port > 0)
      ((struct sockaddr_in6 *)in)->sin6_port = htons(port);
    int res;
    do {
      res = connect(sock, in, sizeof(struct sockaddr_in6));
    } while (res == -1 && errno == EINTR);
    saved_errno = errno;
    if (res == -1 && errno != EINPROGRESS) {
      close(sock);
      err = -3;
      continue;
    } else
      break;
  }
  Sactivate_thread();
  Sunlock_object((void *)address);
  if (service)
    Sunlock_object((void *)service);
  freeaddrinfo(info);
  errno = saved_errno;
  if (err)
    return err;
  return sock;
}
```