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

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    -0x24(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L9
L4:
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %ecx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0xa,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0xa,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0xa,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0xe,%rax
  movzwl (%rax),%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  add    $0xe,%rax
  movzwl (%rax),%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x18(%rbp),%rax
  add    $0xe,%rax
  mov    %dx,(%rax)
  mov    -0x28(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,-0x20(%rbp)
  cmpl   $0x20,-0x2c(%rbp)
  jne    L7
  mov    $0x0,%eax
  call   <abort@plt>
L7:
  addl   $0x1,-0x4(%rbp)
L9:
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L4
  nop
  nop
  leave
  ret
```

assistant: ```c
void foo(short *__restrict__ dst, short *__restrict__ src, int h, int stride, int dummy) {
  int i;
  h /= 8;
  for (i = 0; i < h; i++) {
    dst[0] += 3 * src[0];
    dst[1] += 3 * src[1];
    dst[2] += 3 * src[2];
    dst[3] += 3 * src[3];
    dst[4] += 3 * src[4];
    dst[5] += 3 * src[5];
    dst[6] += 3 * src[6];
    dst[7] += 3 * src[7];
    dst += stride;
    src += stride;
    if (dummy == 32)
      abort();
  }
}
```