user: 请从给定的汇编指令推导出C源代码:

```asm
<ss_accept_ipv4_connection_impl>:
  endbr64
  push   %r15
  mov    $0x4,%edx
  mov    %rsi,%r15
  xor    %esi,%esi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r13
  mov    %r13,%rdi
  call   <memset@plt>
  movl   $0x4,0x14(%rsp)
  test   %r15,%r15
  je     L47
  mov    %r15,%rdi
  call   <Slock_object@plt>
L47:
  xor    %eax,%eax
  lea    0x14(%rsp),%r14
  call   <Sdeactivate_thread@plt>
  mov    D18(%rip),%rbx
  nopl   0x0(%rax,%rax,1)
L119:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <accept@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L95
  mov    D66(%rip),%rax
  mov    %r12d,%edi
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    D45(%rip),%rdx
  mov    %r12d,%edi
  or     (%rdx),%eax
  mov    %eax,%edx
  mov    D42(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <fcntl@plt>
  mov    (%rbx),%edx
L128:
  xor    %eax,%eax
  mov    %edx,0xc(%rsp)
  call   <Sactivate_thread@plt>
  test   %r15,%r15
  mov    0xc(%rsp),%edx
  je     L72
  mov    %r15,%rdi
  call   <Sunlock_object@plt>
  mov    0xc(%rsp),%edx
L72:
  cmpl   $0x4,0x14(%rsp)
  ja     L56
  cmp    $0xffffffff,%r12d
  je     L14
  test   %r15,%r15
  je     L58
  mov    $0x4,%edx
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <memcpy@plt>
L58:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L95:
  mov    D30(%rip),%rax
  mov    (%rbx),%edx
  cmp    (%rax),%edx
  je     L119
  jmp    L128
  nopl   0x0(%rax,%rax,1)
L14:
  mov    D10(%rip),%rax
  mov    %edx,(%rbx)
  cmp    %edx,(%rax)
  je     L102
  mov    D52(%rip),%rax
  cmp    %edx,(%rax)
  mov    $0xfffffffe,%eax
  cmove  %eax,%r12d
  jmp    L58
L56:
  mov    %r12d,%edi
  mov    %edx,0xc(%rsp)
  mov    $0xffffffff,%r12d
  call   <close@plt>
  mov    0xc(%rsp),%edx
  mov    %edx,(%rbx)
  jmp    L58
L102:
  mov    $0xfffffffe,%r12d
  jmp    L58
L9:
  call   <__stack_chk_fail@plt>
```

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;
}
```