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

```asm
<do_checksum>:
  endbr64
  push   %r12
  mov    %rdi,%rax
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  movzbl (%rdi),%ecx
  sar    $0x4,%cl
  cmp    $0x6,%cl
  je     L59
  xor    %r8d,%r8d
  cmp    $0x4,%cl
  jne    L38
  mov    (%rdi),%ebx
  mov    %rdi,%r12
  xor    %edi,%edi
  lea    0x0(,%rbx,4),%edx
L9:
  test   %edx,%edx
  js     L174
  add    $0xffffff80,%esi
  cmp    $0x4,%esi
  ja     1080 <do_checksum.cold>
  lea    D15(%rip),%r8
  movslq (%r8,%rsi,4),%rsi
  add    %r8,%rsi
  notrack jmp *%rsi
  nopl   0x0(%rax,%rax,1)
L189:
  xor    %r8d,%r8d
L38:
  pop    %rbx
  mov    %r8d,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L59:
  mov    0x4(%rdi),%edi
  mov    $0x8,%edx
  cmp    %esi,%edi
  je     L55
L8:
  cmp    $0x85,%edi
  je     L164
  cmp    $0x86,%edi
  jne    L189
  movslq %edx,%r8
  add    %rax,%r8
  mov    (%r8),%edi
  mov    0x4(%r8),%r8d
  lea    0x8(%rdx,%r8,8),%edx
L29:
  cmp    %esi,%edi
  jne    L8
  mov    %rax,%rdi
  xor    %r12d,%r12d
  jmp    L9
  cs nopw 0x0(%rax,%rax,1)
L164:
  movslq %edx,%rdi
  add    $0x4,%edx
  mov    (%rax,%rdi,1),%edi
  jmp    L29
  nopl   0x0(%rax,%rax,1)
  movslq %edx,%rdx
  xor    %r8d,%r8d
  cmp    $0x6,%cl
  jne    L38
L5:
  mov    $0x20,%esi
  lea    (%rax,%rdx,1),%rbx
  call   <in_cksum@plt>
  lea    0x83(%rbp),%edi
  mov    %eax,%r12d
  call   <ntohs@plt>
  movl   $0x0,(%rbx)
  mov    %ebp,%esi
  mov    %rbx,%rdi
  add    %eax,%r12d
  call   <in_cksum@plt>
  mov    $0x1,%r8d
  add    %r12d,%eax
  mov    %eax,%edx
  movzwl %ax,%eax
  sar    $0x10,%edx
  add    %eax,%edx
  mov    %edx,%eax
  sar    $0x10,%eax
  add    %edx,%eax
  not    %eax
  and    $0xffff,%eax
  mov    %eax,(%rbx)
  jmp    L38
  nopw   0x0(%rax,%rax,1)
  movl   $0x0,0x4(%r12)
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <in_cksum@plt>
  mov    $0x1,%r8d
  mov    %eax,%edx
  movzwl %ax,%eax
  sar    $0x10,%edx
  add    %eax,%edx
  mov    %edx,%eax
  sar    $0x10,%eax
  add    %edx,%eax
  not    %eax
  and    $0xffff,%eax
  mov    %eax,0x4(%r12)
  jmp    L38
  nopl   0x0(%rax,%rax,1)
  movslq %edx,%rdx
L160:
  lea    (%rax,%rdx,1),%rbx
  movl   $0x0,(%rbx)
  cmp    $0x6,%cl
  je     L220
  lea    0x8(%r12),%rdi
  mov    $0x8,%esi
  call   <in_cksum@plt>
  mov    %eax,%r12d
L1:
  lea    0x81(%rbp),%edi
  call   <ntohs@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  add    %eax,%r12d
  call   <in_cksum@plt>
  mov    $0x1,%r8d
  add    %r12d,%eax
  mov    %eax,%edx
  movzwl %ax,%eax
  sar    $0x10,%edx
  add    %eax,%edx
  mov    %edx,%eax
  sar    $0x10,%eax
  add    %edx,%eax
  not    %eax
  and    $0xffff,%eax
  mov    %eax,(%rbx)
  jmp    L38
  movslq %edx,%rdx
  lea    (%rax,%rdx,1),%rbx
  movl   $0x0,(%rbx)
  cmp    $0x6,%cl
  je     L125
  lea    0x8(%r12),%rdi
  mov    $0x8,%esi
  call   <in_cksum@plt>
  mov    %eax,%r12d
L128:
  lea    0x80(%rbp),%edi
  call   <ntohs@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  add    %eax,%r12d
  call   <in_cksum@plt>
  mov    $0x1,%r8d
  add    %r12d,%eax
  mov    %eax,%edx
  movzwl %ax,%eax
  sar    $0x10,%edx
  add    %eax,%edx
  mov    %edx,%eax
  sar    $0x10,%eax
  add    %edx,%eax
  not    %eax
  and    $0xffff,%eax
  mov    %eax,(%rbx)
  jmp    L38
  nopl   0x0(%rax,%rax,1)
  movslq %edx,%rdx
L112:
  lea    (%rax,%rdx,1),%rbx
  mov    %ebp,%esi
  movl   $0x0,(%rbx)
  mov    %rbx,%rdi
  call   <in_cksum@plt>
  mov    $0x1,%r8d
  mov    %eax,%edx
  movzwl %ax,%eax
  sar    $0x10,%edx
  add    %eax,%edx
  mov    %edx,%eax
  sar    $0x10,%eax
  add    %edx,%eax
  not    %eax
  and    $0xffff,%eax
  mov    %eax,(%rbx)
  jmp    L38
  nopl   0x0(%rax)
L220:
  mov    $0x20,%esi
  call   <in_cksum@plt>
  mov    %eax,%r12d
  jmp    L1
  movl   $0x0,0x8(%rax)
  lea    0x8(%rax),%rbx
  mov    %rax,%rdi
L125:
  mov    $0x20,%esi
  call   <in_cksum@plt>
  mov    %eax,%r12d
  jmp    L128
  nopw   0x0(%rax,%rax,1)
L55:
  add    $0xffffff80,%edi
  cmp    $0x4,%edi
  ja     L169
  lea    D13(%rip),%rsi
  movslq (%rsi,%rdi,4),%rdx
  add    %rsi,%rdx
  notrack jmp *%rdx
  mov    %rax,%rdi
  mov    $0x8,%edx
  jmp    L5
  mov    %rax,%rdi
  mov    $0x8,%edx
  xor    %r12d,%r12d
  jmp    L160
  mov    $0x8,%edx
  jmp    L112
L174:
  mov    $0xfffffffe,%r8d
  jmp    L38
```

assistant: ```c
int do_checksum(char *buf, int protocol, int len) {
  struct ip *iph_p = NULL;
  struct ip6_hdr *ip6h_p = NULL;
  int ip_hl;
  int sum = 0;
  int ip_version = buf[0] >> 4;
  if (ip_version == 6) {
    int next_header;
    ip6h_p = (struct ip6_hdr *)buf;
    next_header = ip6h_p->ip6_ctlun.ip6_un1.ip6_un1_nxt;
    ip_hl = sizeof(struct ip6_hdr);
    while (next_header != protocol) {
      switch (next_header) {
      case IPPROTO_FRAGMENT:
        next_header = ((struct ip6_frag *)(buf + ip_hl))->ip6f_nxt;
        ip_hl += sizeof(struct ip6_frag);
        break;
      case IPPROTO_DSTOPTS:
        next_header = ((struct ip6_dest *)(buf + ip_hl))->ip6d_nxt;
        ip_hl += (((struct ip6_dest *)(buf + ip_hl))->ip6d_len * 8) + 8;
        break;
      default:
        return 0;
      }
    }
  } else if (ip_version == 4) {
    iph_p = (struct ip *)buf;
    ip_hl = iph_p->ip_hl << 2;
  } else {
    return (0);
  }
  if (ip_hl < 0)
    return -2;
  switch (protocol) {
  case IPPROTO_UDP: {
    struct udphdr *udph_p = (struct udphdr *)(buf + ip_hl);
    udph_p->uh_sum = 0;
    if (ip_version == 6) {
      sum = in_cksum((unsigned short *)&ip6h_p->ip6_src, 32);
    } else {
      sum = in_cksum((void *)&iph_p->ip_src, 8);
    }
    sum += ntohs(IPPROTO_UDP + len);
    sum += in_cksum((unsigned short *)udph_p, len);
    udph_p->uh_sum = (sum = (sum >> 16) + (sum & 0xffff), (~(sum + (sum >> 16)) & 0xffff));
    break;
  }
  case IPPROTO_TCP: {
    struct tcphdr *tcph_p = (struct tcphdr *)(buf + ip_hl);
    tcph_p->th_sum = 0;
    if (ip_version == 6) {
      sum = in_cksum((unsigned short *)&ip6h_p->ip6_src, 32);
    } else {
      sum = in_cksum((void *)&iph_p->ip_src, 8);
    }
    sum += ntohs(IPPROTO_TCP + len);
    sum += in_cksum((unsigned short *)tcph_p, len);
    tcph_p->th_sum = (sum = (sum >> 16) + (sum & 0xffff), (~(sum + (sum >> 16)) & 0xffff));
    break;
  }
  case IPPROTO_ICMP: {
    struct icmp *icmph_p = (struct icmp *)(buf + ip_hl);
    icmph_p->icmp_cksum = 0;
    sum = in_cksum((unsigned short *)icmph_p, len);
    icmph_p->icmp_cksum = (sum = (sum >> 16) + (sum & 0xffff), (~(sum + (sum >> 16)) & 0xffff));
    break;
  }
  case IPPROTO_ICMPV6: {
    struct icmp6_hdr *icmp6h_p = (struct icmp6_hdr *)(buf + ip_hl);
    if (ip_version == 6) {
      sum = in_cksum((unsigned short *)&ip6h_p->ip6_src, 32);
    } else {
      return 0;
    }
    sum += ntohs(IPPROTO_ICMPV6 + len);
    icmp6h_p->icmp6_cksum = 0;
    sum += in_cksum((unsigned short *)icmp6h_p, len);
    icmp6h_p->icmp6_cksum = (sum = (sum >> 16) + (sum & 0xffff), (~(sum + (sum >> 16)) & 0xffff));
    break;
  }
  case IPPROTO_IP: {
    iph_p->ip_sum = 0;
    sum = in_cksum((unsigned short *)iph_p, len);
    iph_p->ip_sum = (sum = (sum >> 16) + (sum & 0xffff), (~(sum + (sum >> 16)) & 0xffff));
    break;
  }
  default: {
    return (-1);
  }
  }
  return (1);
}
```