user: 下面的汇编指令对应的C源代码是什么:

```asm
<write_fifo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    -0x34(%rbp),%eax
  not    %eax
  shr    $0x1f,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%eax
  not    %eax
  shr    $0x1f,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x28(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x40(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x20(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L50
L10:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <nsleep@plt>
  mov    -0x10(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
L50:
  mov    -0x1c(%rbp),%eax
  xor    $0x80000000,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  cmp    %eax,%edx
  je     L10
  mov    -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%eax
  xor    %edx,%eax
  test   %eax,%eax
  js     L66
  mov    $0x7fffffff,%eax
  sub    -0x14(%rbp),%eax
  jmp    L54
L66:
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  and    $0x7fffffff,%eax
  cmp    %eax,%edx
  jle    L24
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  jmp    L54
L24:
  mov    -0x18(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,%edx
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
L54:
  cmp    -0x34(%rbp),%eax
  jb     L10
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L87
L76:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  lea    0x2(%rdx),%ecx
  mov    -0x20(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x20(%rbp)
L87:
  mov    -0x20(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  ja     L76
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  cmp    %eax,-0x38(%rbp)
  je     L73
  mov    -0x1c(%rbp),%eax
  and    $0x7fffffff,%eax
  cmp    %eax,-0x14(%rbp)
  jle    L16
L73:
  andl   $0x80000000,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  xor    $0x80000000,%eax
  mov    %eax,-0x1c(%rbp)
L16:
  mov    -0x10(%rbp),%rax
  mov    -0x1c(%rbp),%edx
  mov    %edx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void write_fifo(void *fifo, void *value, unsigned int len, unsigned int fifo_size, unsigned long period) {
  assert(len <= 0x7FFFFFFF);
  assert(fifo_size <= 0x7FFFFFFF);
  assert(fifo != NULL);
  assert(period != 0);
  int i = 0;
  volatile int *wfifo = (int *)fifo;
  int w_cnt = wfifo[0];
  int r_cnt = wfifo[1];
  int wc = 0;
  volatile int *v = NULL;
  while (r_cnt == (w_cnt ^ 0x80000000) || ((w_cnt & 0x80000000) == (r_cnt & 0x80000000) ? (unsigned int)(0x7FFFFFFF - wc) : ((w_cnt & 0x7FFFFFFF) > (r_cnt & 0x7FFFFFFF) ? (unsigned int)((w_cnt & 0x7FFFFFFF) - (r_cnt & 0x7FFFFFFF)) : (unsigned int)((r_cnt & 0x7FFFFFFF) - (w_cnt & 0x7FFFFFFF)))) < len) {
    nsleep(0, period);
    r_cnt = wfifo[1];
  }
  wc = (w_cnt & 0x7FFFFFFF);
  v = (volatile int *)value;
  for (i = 0; i < len; i++) {
    wfifo[wc + 2 + i] = v[i];
  }
  wc = (w_cnt & 0x7FFFFFFF);
  w_cnt += len;
  if ((w_cnt & 0x7FFFFFFF) == fifo_size || wc > (w_cnt & 0x7FFFFFFF)) {
    w_cnt &= 0x80000000;
    w_cnt ^= 0x80000000;
  }
  wfifo[0] = w_cnt;
}
```