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

```asm
<ss_listen_on_ipv6_socket_impl>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %edx,%ebp
  mov    $0xc,%edx
  push   %rbx
  mov    %esi,%ebx
  xor    %esi,%esi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%r13
  mov    %r13,%rdi
  call   <memset@plt>
  mov    D68(%rip),%r14
  mov    (%r14),%edi
  mov    %edi,0x14(%rsp)
  test   %r12,%r12
  je     L75
  lea    0x10(%rsp),%rdx
  mov    %r12,%rsi
  call   <inet_pton@plt>
  cmp    $0x1,%eax
  jne    L102
  mov    (%r14),%edi
L48:
  mov    D6(%rip),%rax
  xor    %edx,%edx
  mov    (%rax),%esi
  call   <socket@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L23
  mov    D25(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D49(%rip),%rdx
  mov    %r12d,%edi
  or     (%rdx),%eax
  mov    %eax,%edx
  mov    D93(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D79(%rip),%rax
  lea    0x8(%rsp),%rcx
  mov    %r12d,%edi
  mov    $0x4,%r8d
  movl   $0x1,0x8(%rsp)
  mov    (%rax),%edx
  mov    D96(%rip),%rax
  mov    (%rax),%esi
  call   <setsockopt@plt>
  movzwl %bx,%edi
  call   <htons@plt>
  mov    $0xc,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  mov    %eax,0xc(%rsp)
  call   <bind@plt>
  cmp    $0xffffffff,%eax
  je     L15
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <listen@plt>
  cmp    $0xffffffff,%eax
  je     L73
L103:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L74
  add    $0x20,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L75:
  mov    D73(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,0x10(%rsp)
  jmp    L48
  nopw   0x0(%rax,%rax,1)
L23:
  mov    $0xfffffffe,%r12d
  jmp    L103
  nopl   0x0(%rax,%rax,1)
L102:
  mov    $0xffffffff,%r12d
  jmp    L103
L15:
  mov    D9(%rip),%rbx
  mov    %r12d,%edi
  mov    $0xfffffffd,%r12d
  mov    (%rbx),%ebp
  call   <close@plt>
  mov    %ebp,(%rbx)
  jmp    L103
L73:
  mov    D9(%rip),%rbx
  mov    %r12d,%edi
  mov    $0xfffffffc,%r12d
  mov    (%rbx),%ebp
  call   <close@plt>
  mov    %ebp,(%rbx)
  jmp    L103
L74:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int ss_listen_on_ipv6_socket_impl(const char *address, unsigned short port, int backlog) {
  struct sockaddr_in6 addr;
  memset(&addr, 0, sizeof(addr));
  addr.sin6_family = AF_INET6;
  if (address) {
    if (!(inet_pton(AF_INET6, address, &(addr.sin6_addr)) == 1))
      return -1;
  } else
    addr.sin6_addr = in6addr_any;
  int sock = socket(AF_INET6, SOCK_STREAM, 0);
  if (sock == -1)
    return -2;
  fcntl(sock, F_SETFD, fcntl(sock, F_GETFD) | FD_CLOEXEC);
  int optval = 1;
  setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval));
  addr.sin6_port = htons(port);
  if ((bind(sock, (struct sockaddr *)&addr, sizeof(addr))) == -1) {
    int saved_errno = errno;
    close(sock);
    errno = saved_errno;
    return -3;
  }
  if ((listen(sock, backlog)) == -1) {
    int saved_errno = errno;
    close(sock);
    errno = saved_errno;
    return -4;
  }
  return sock;
}
```