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

```asm
<in_chksum_udp6>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movw   $0x0,-0xe(%rbp)
  mov    -0x18(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xa,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xc,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0xe,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x12,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x14,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x16,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1a,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1c,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x1e,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x20,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  add    $0x22,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  subl   $0x8,-0x24(%rbp)
  addq   $0x8,-0x20(%rbp)
  jmp    L60
L21:
  mov    -0x20(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0xa,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0xe,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x12,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x14,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x16,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x18,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x1a,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x1c,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x1e,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  addq   $0x20,-0x20(%rbp)
  subl   $0x20,-0x24(%rbp)
L60:
  cmpl   $0x1f,-0x24(%rbp)
  jg     L21
  jmp    L27
L22:
  mov    -0x20(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x6,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  addq   $0x8,-0x20(%rbp)
  subl   $0x8,-0x24(%rbp)
L27:
  cmpl   $0x7,-0x24(%rbp)
  jg     L22
  jmp    L37
L59:
  mov    -0x20(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movzwl (%rax),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
  subl   $0x2,-0x24(%rbp)
L37:
  cmpl   $0x1,-0x24(%rbp)
  jg     L59
  cmpl   $0x1,-0x24(%rbp)
  jne    L54
  lea    -0xe(%rbp),%rax
  mov    -0x20(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movzwl -0xe(%rbp),%eax
  movzwl %ax,%eax
  add    %eax,-0xc(%rbp)
L54:
  mov    -0xc(%rbp),%eax
  shr    $0x10,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  movzwl %ax,%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  shr    $0x10,%eax
  add    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  not    %eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

assistant: ```c
unsigned short in_chksum_udp6(unsigned short *h, unsigned short *d, int dlen) {
  unsigned int cksum;
  unsigned short answer = 0;
  cksum = h[0];
  cksum += h[1];
  cksum += h[2];
  cksum += h[3];
  cksum += h[4];
  cksum += h[5];
  cksum += h[6];
  cksum += h[7];
  cksum += h[8];
  cksum += h[9];
  cksum += h[10];
  cksum += h[11];
  cksum += h[12];
  cksum += h[13];
  cksum += h[14];
  cksum += h[15];
  cksum += h[16];
  cksum += h[17];
  cksum += d[0];
  cksum += d[1];
  cksum += d[2];
  cksum += d[3];
  dlen -= 8;
  d += 4;
  while (dlen >= 32) {
    cksum += d[0];
    cksum += d[1];
    cksum += d[2];
    cksum += d[3];
    cksum += d[4];
    cksum += d[5];
    cksum += d[6];
    cksum += d[7];
    cksum += d[8];
    cksum += d[9];
    cksum += d[10];
    cksum += d[11];
    cksum += d[12];
    cksum += d[13];
    cksum += d[14];
    cksum += d[15];
    d += 16;
    dlen -= 32;
  }
  while (dlen >= 8) {
    cksum += d[0];
    cksum += d[1];
    cksum += d[2];
    cksum += d[3];
    d += 4;
    dlen -= 8;
  }
  while (dlen > 1) {
    cksum += *d++;
    dlen -= 2;
  }
  if (dlen == 1) {
    *(unsigned char *)(&answer) = (*(unsigned char *)d);
    cksum += answer;
  }
  cksum = (cksum >> 16) + (cksum & 0x0000ffff);
  cksum += (cksum >> 16);
  return (unsigned short)(~cksum);
}
```