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

```asm
<ss_accept_ipv4_connection_impl>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x18(%rbp),%rax
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x4,-0x14(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L68
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <Slock_object@plt>
L68:
  mov    $0x0,%eax
  call   <Sdeactivate_thread@plt>
L60:
  lea    -0x14(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  mov    -0x24(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0x10(%rbp)
  cmpl   $0xffffffff,-0x10(%rbp)
  je     L130
  mov    D84(%rip),%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fcntl@plt>
  mov    %eax,%edx
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    D48(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x10(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <fcntl@plt>
L130:
  cmpl   $0xffffffff,-0x10(%rbp)
  jne    L33
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  je     L60
L33:
  mov    D5(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    $0x0,%eax
  call   <Sactivate_thread@plt>
  cmpq   $0x0,-0x30(%rbp)
  je     L14
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <Sunlock_object@plt>
L14:
  mov    -0x14(%rbp),%eax
  cmp    $0x4,%eax
  jbe    L2
  mov    -0x10(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    D5(%rip),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L51
L2:
  cmpl   $0xffffffff,-0x10(%rbp)
  jne    L113
  mov    D5(%rip),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    D52(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  je     L44
  mov    D98(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jne    L133
L44:
  mov    $0xfffffffe,%eax
  jmp    L51
L133:
  mov    $0xffffffff,%eax
  jmp    L51
L113:
  cmpq   $0x0,-0x30(%rbp)
  je     L93
  lea    -0x18(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L93:
  mov    -0x10(%rbp),%eax
L51:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

assistant: ```c
int ss_accept_ipv4_connection_impl(int sock, uint32_t *connection) {
  struct sockaddr_in addr;
  memset(&addr, 0, sizeof(addr));
  socklen_t addr_len = sizeof(addr);
  if (connection)
    Slock_object((void *)connection);
  Sdeactivate_thread();
  int connect_sock;
  do {
    connect_sock = accept(sock, (struct sockaddr *)&addr, &addr_len);
    if (connect_sock != -1) {
      fcntl(connect_sock, F_SETFD, fcntl(connect_sock, F_GETFD) | FD_CLOEXEC);
    }
  } while (connect_sock == -1 && errno == EINTR);
  int saved_errno = errno;
  Sactivate_thread();
  if (connection)
    Sunlock_object((void *)connection);
  if (addr_len > sizeof(addr)) {
    close(connect_sock);
    errno = saved_errno;
    return -1;
  }
  if (connect_sock == -1) {
    errno = saved_errno;
    if (saved_errno == EAGAIN || saved_errno == EWOULDBLOCK)
      return -2;
    return -1;
  }
  if (connection)
    memcpy(connection, &addr.sin_addr.s_addr, sizeof(uint32_t));
  return connect_sock;
}
```