user: 请将以下的汇编代码转换成C语言代码:

```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    D104(%rip),%rax
  mov    %r13,%rdi
  mov    (%rax),%eax
  mov    %eax,0x8(%rsp)
  mov    D112(%rip),%rax
  movd   0x8(%rsp),%xmm1
  movd   (%rax),%xmm0
  punpckldq %xmm1,%xmm0
  movq   %xmm0,0x30(%rsp)
  call   <Slock_object@plt>
  test   %r12,%r12
  je     L14
  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    L220
  mov    0x18(%rsp),%r15
  test   %r15,%r15
  je     L220
L235:
  movzwl (%rsp),%eax
  mov    D18(%rip),%rbp
  mov    %eax,0x8(%rsp)
L62:
  mov    D112(%rip),%rax
  xor    %edx,%edx
  mov    (%rax),%esi
  mov    D104(%rip),%rax
  mov    (%rax),%edi
  call   <socket@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L161
  mov    D61(%rip),%rax
  mov    %r14d,%edi
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D83(%rip),%rdx
  mov    %r14d,%edi
  or     (%rdx),%eax
  mov    %eax,%edx
  mov    D15(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  je     L212
L111:
  cmpw   $0x0,(%rsp)
  mov    (%r15),%rbx
  je     L217
  jmp    L115
  cs nopw 0x0(%rax,%rax,1)
L231:
  mov    D89(%rip),%rax
  mov    0x0(%rbp),%edx
  cmp    (%rax),%edx
  jne    L186
L217:
  mov    $0x4,%edx
  mov    %rbx,%rsi
  mov    %r14d,%edi
  call   <connect@plt>
  cmp    $0xffffffff,%eax
  je     L231
  mov    0x0(%rbp),%ebx
  jmp    L17
  nopl   0x0(%rax,%rax,1)
L186:
  mov    D71(%rip),%rax
  mov    (%rax),%ebx
  cmp    %ebx,%edx
  jne    L201
L17:
  xor    %eax,%eax
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  je     L196
L133:
  mov    %r12,%rdi
  call   <Sunlock_object@plt>
L196:
  mov    0x18(%rsp),%rdi
  call   <freeaddrinfo@plt>
L204:
  mov    %ebx,0x0(%rbp)
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L106
  add    $0x48,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  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    L120
  mov    0x18(%rsp),%r15
  test   %r15,%r15
  jne    L235
L120:
  mov    D18(%rip),%rbp
  xor    %eax,%eax
  mov    0x0(%rbp),%ebx
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
L28:
  mov    $0xffffffff,%r14d
  jmp    L204
  nopl   (%rax)
L212:
  mov    %r14d,%edi
  call   <ss_set_fd_non_blocking@plt>
  test   %eax,%eax
  jne    L111
  mov    %r14d,%edi
  mov    0x0(%rbp),%ebx
  call   <close@plt>
L45:
  xor    %eax,%eax
  mov    $0xfffffffe,%r14d
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  jne    L133
  jmp    L196
  xchg   %ax,%ax
L115:
  mov    0x8(%rsp),%edi
  call   <htons@plt>
  mov    %eax,(%rbx)
  jmp    L217
L201:
  mov    %r14d,%edi
  mov    %edx,0xc(%rsp)
  call   <close@plt>
  mov    0x8(%r15),%r15
  mov    0xc(%rsp),%edx
  test   %r15,%r15
  jne    L62
  xor    %eax,%eax
  mov    %edx,(%rsp)
  call   <Sactivate_thread@plt>
  mov    %r13,%rdi
  call   <Sunlock_object@plt>
  test   %r12,%r12
  mov    (%rsp),%edx
  je     L55
  mov    %edx,%ebx
  mov    $0xfffffffd,%r14d
  jmp    L133
L161:
  mov    0x0(%rbp),%ebx
  jmp    L45
L55:
  mov    0x18(%rsp),%rdi
  mov    $0xfffffffd,%r14d
  call   <freeaddrinfo@plt>
  mov    (%rsp),%ebx
  jmp    L204
L220:
  mov    D18(%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    L28
L106:
  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;
}
```