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

```asm
<midi_note_off>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    -0x2c(%rbp),%eax
  sar    $0x1c,%eax
  and    $0x7f,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x2c(%rbp),%eax
  sar    $0x15,%eax
  and    $0x7f,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  sar    $0xe,%eax
  and    $0x7f,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x2c(%rbp),%eax
  sar    $0x7,%eax
  and    $0x7f,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x2c(%rbp),%eax
  and    $0x7f,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jle    L12
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    -0x14(%rbp),%edx
  sub    $0xffffff80,%edx
  mov    %edx,(%rax)
L12:
  cmpl   $0x0,-0x10(%rbp)
  jle    L17
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    -0x10(%rbp),%edx
  sub    $0xffffff80,%edx
  mov    %edx,(%rax)
L17:
  cmpl   $0x0,-0xc(%rbp)
  jle    L35
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    -0xc(%rbp),%edx
  sub    $0xffffff80,%edx
  mov    %edx,(%rax)
L35:
  cmpl   $0x0,-0x8(%rbp)
  jle    L13
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  mov    -0x8(%rbp),%edx
  sub    $0xffffff80,%edx
  mov    %edx,(%rax)
L13:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  lea    (%rsi,%rax,1),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  add    %rsi,%rax
  movl   $0x80,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  lea    (%rsi,%rax,1),%rdx
  mov    -0x24(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rsi
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x40(%rbp),%rdx
  mov    %ecx,(%rdx)
  cltq
  shl    $0x2,%rax
  lea    (%rsi,%rax,1),%rdx
  mov    -0x28(%rbp),%eax
  mov    %eax,(%rdx)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void midi_note_off(uint8_t curValue0, uint8_t curValue1, uint32_t timediff, uint8_t **buf, int *curBufferPosition) {
  uint32_t timediff4 = (timediff >> 28) & 0x7F;
  uint32_t timediff3 = (timediff >> 21) & 0x7F;
  uint32_t timediff2 = (timediff >> 14) & 0x7F;
  uint32_t timediff1 = (timediff >> 7) & 0x7F;
  uint32_t timediff0 = (timediff >> 0) & 0x7F;
  if (timediff4 > 0)
    (*buf)[(*curBufferPosition)++] = 128 + timediff4;
  if (timediff3 > 0)
    (*buf)[(*curBufferPosition)++] = 128 + timediff3;
  if (timediff2 > 0)
    (*buf)[(*curBufferPosition)++] = 128 + timediff2;
  if (timediff1 > 0)
    (*buf)[(*curBufferPosition)++] = 128 + timediff1;
  (*buf)[(*curBufferPosition)++] = timediff0;
  (*buf)[(*curBufferPosition)++] = 128;
  (*buf)[(*curBufferPosition)++] = curValue0;
  (*buf)[(*curBufferPosition)++] = curValue1;
}
```