user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ss_listen_on_ipv4_socket_impl>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,%eax
  mov    %edx,-0x40(%rbp)
  mov    %ax,-0x3c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x14(%rbp),%rax
  mov    $0xc,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    D87(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L46
  mov    D87(%rip),%rax
  mov    (%rax),%eax
  lea    -0x14(%rbp),%rdx
  add    $0x4,%rdx
  mov    -0x38(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <inet_pton@plt>
  cmp    $0x1,%eax
  je     L58
  mov    $0xffffffff,%eax
  jmp    L25
L46:
  mov    D88(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <htonl@plt>
  mov    %eax,-0x10(%rbp)
L58:
  mov    D63(%rip),%rax
  mov    (%rax),%ecx
  mov    D87(%rip),%rax
  mov    (%rax),%eax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <socket@plt>
  mov    %eax,-0x20(%rbp)
  cmpl   $0xffffffff,-0x20(%rbp)
  jne    L18
  mov    $0xfffffffe,%eax
  jmp    L25
L18:
  mov    D30(%rip),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fcntl@plt>
  mov    %eax,%edx
  mov    D125(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D15(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fcntl@plt>
  movl   $0x1,-0x24(%rbp)
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  mov    D119(%rip),%rax
  mov    (%rax),%esi
  lea    -0x24(%rbp),%rcx
  mov    -0x20(%rbp),%eax
  mov    $0x4,%r8d
  mov    %eax,%edi
  call   <setsockopt@plt>
  movzwl -0x3c(%rbp),%eax
  mov    %eax,%edi
  call   <htons@plt>
  mov    %eax,-0x14(%rbp)
  lea    -0x14(%rbp),%rcx
  mov    -0x20(%rbp),%eax
  mov    $0xc,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <bind@plt>
  cmp    $0xffffffff,%eax
  jne    L69
  mov    D92(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    D92(%rip),%rax
  mov    -0x18(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0xfffffffd,%eax
  jmp    L25
L69:
  mov    -0x40(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <listen@plt>
  cmp    $0xffffffff,%eax
  jne    L89
  mov    D92(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    D92(%rip),%rax
  mov    -0x1c(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0xfffffffc,%eax
  jmp    L25
L89:
  mov    -0x20(%rbp),%eax
L25:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L52
  call   <__stack_chk_fail@plt>
L52:
  leave
  ret
```

assistant: ```c
int ss_listen_on_ipv4_socket_impl(const char *address, unsigned short port, int backlog) {
  struct sockaddr_in addr;
  memset(&addr, 0, sizeof(addr));
  addr.sin_family = AF_INET;
  if (address) {
    if (!(inet_pton(AF_INET, address, &(addr.sin_addr)) == 1))
      return -1;
  } else
    addr.sin_addr.s_addr = htonl(INADDR_ANY);
  int sock = socket(AF_INET, 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.sin_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;
}
```