user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ipc_write_fixed_size>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r12
  push   %rbx
  sub    $0xb0,%rsp
  mov    %edi,-0xa4(%rbp)
  mov    %rsi,-0xb0(%rbp)
  mov    %edx,-0xa8(%rbp)
  mov    %ecx,-0xb4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  mov    $0x4,%edi
  call   <CMSG_SPACE@plt>
  mov    %eax,%ebx
  movslq %ebx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x90(%rbp)
  movslq %ebx,%rax
  mov    %rax,-0xd0(%rbp)
  movq   $0x0,-0xc8(%rbp)
  movslq %ebx,%rax
  mov    %rax,%r14
  mov    $0x0,%r15d
  movslq %ebx,%rax
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L12:
  cmp    %rdx,%rsp
  je     L72
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L12
L72:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L44
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L44:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x80(%rbp)
  mov    -0xb0(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x70(%rbp)
  mov    $0x4,%edi
  call   <CMSG_LEN@plt>
  mov    -0x80(%rbp),%rdx
  mov    %eax,0x8(%rdx)
  mov    D56(%rip),%rax
  mov    (%rax),%edx
  mov    -0x80(%rbp),%rax
  mov    %edx,0x4(%rax)
  mov    D12(%rip),%rax
  mov    (%rax),%edx
  mov    -0x80(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <CMSG_DATA@plt>
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  mov    -0xb4(%rbp),%edx
  mov    %edx,(%rax)
  lea    -0x60(%rbp),%rax
  mov    $0x38,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x38(%rbp)
  lea    -0x70(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  movl   $0x1,-0x60(%rbp)
  movq   $0x0,-0x48(%rbp)
  cmpl   $0x0,-0xb4(%rbp)
  js     L28
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    %ebx,-0x50(%rbp)
  jmp    L23
L28:
  movq   $0x0,-0x58(%rbp)
  movl   $0x0,-0x50(%rbp)
L23:
  mov    D44(%rip),%rax
  mov    (%rax),%edx
  lea    -0x60(%rbp),%rcx
  mov    -0xa4(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <sendmsg@plt>
  mov    %eax,-0x94(%rbp)
  mov    -0x94(%rbp),%eax
  cmp    -0xa8(%rbp),%eax
  je     L42
  mov    D33(%rip),%rax
  mov    (%rax),%edx
  mov    D4(%rip),%rax
  mov    %edx,(%rax)
  mov    D4(%rip),%rax
  mov    (%rax),%eax
  neg    %eax
  jmp    L16
L42:
  mov    -0x94(%rbp),%eax
L16:
  mov    %r12,%rsp
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
ssize_t ipc_write_fixed_size(int fd, void *buf, ssize_t remain, int ram_fd) {
  struct iovec iov;
  char cmsgbuf[CMSG_SPACE(sizeof(int))];
  struct cmsghdr *cmsg = (struct cmsghdr *)cmsgbuf;
  ssize_t total;
  int *p;
  iov.iov_base = buf;
  iov.iov_len = remain;
  cmsg->cmsg_len = CMSG_LEN(sizeof(int));
  cmsg->cmsg_level = SOL_SOCKET;
  cmsg->cmsg_type = SCM_RIGHTS;
  p = (int *)CMSG_DATA(cmsg);
  *p = ram_fd;
  struct msghdr msg;
  memset(&msg, 0, sizeof(msg));
  msg.msg_name = NULL;
  msg.msg_namelen = 0;
  msg.msg_iov = &iov;
  msg.msg_iovlen = 1;
  msg.msg_flags = 0;
  if (ram_fd >= 0) {
    msg.msg_control = cmsgbuf;
    msg.msg_controllen = sizeof(cmsgbuf);
  } else {
    msg.msg_control = NULL;
    msg.msg_controllen = 0;
  }
  if ((total = sendmsg(fd, &msg, MSG_NOSIGNAL)) != remain) {
    errno = EFAULT;
    return -errno;
  }
  return total;
}
```