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

```asm
<do_csum>:
  endbr64
  test   %esi,%esi
  je     L109
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  push   %rbx
  mov    %rbp,%rbx
  and    $0x1,%ebx
  jne    L179
L192:
  mov    %r12d,%eax
  shr    %eax
  je     L150
  test   $0x2,%bpl
  je     L163
  movzwl 0x0(%rbp),%edx
  sub    $0x1,%eax
  sub    $0x2,%r12d
  add    $0x2,%rbp
  add    %rdx,%rdi
L163:
  shr    %eax
  je     L39
  test   $0x4,%bpl
  jne    L139
L113:
  mov    %eax,%ecx
  shr    %ecx
  shr    $0x4,%eax
  je     L5
  mov    %eax,%eax
  xor    %edx,%edx
  shl    $0x6,%rax
  add    %rbp,%rax
  nopl   0x0(%rax)
L126:
  add    0x0(%rbp),%rdi
  adc    0x8(%rbp),%rdi
  adc    0x10(%rbp),%rdi
  adc    0x18(%rbp),%rdi
  adc    0x20(%rbp),%rdi
  adc    0x28(%rbp),%rdi
  adc    0x30(%rbp),%rdi
  adc    0x38(%rbp),%rdi
  adc    %rdx,%rdi
  add    $0x40,%rbp
  cmp    %rax,%rbp
  jne    L126
L67:
  and    $0x7,%ecx
  je     L22
  mov    %ecx,%ecx
  xor    %edx,%edx
  lea    (%rax,%rcx,8),%rbp
  nopl   (%rax)
L68:
  add    (%rax),%rdi
  adc    %rdx,%rdi
  add    $0x8,%rax
  cmp    %rbp,%rax
  jne    L68
L196:
  mov    %edi,%esi
  xor    %eax,%eax
  shr    $0x20,%rdi
  call   <add32_with_carry@plt>
  movslq %eax,%rdi
  test   $0x4,%r12b
  je     L39
  mov    0x0(%rbp),%eax
  add    $0x4,%rbp
  add    %rax,%rdi
L39:
  test   $0x2,%r12b
  je     L150
  movzwl 0x0(%rbp),%eax
  add    $0x2,%rbp
  add    %rax,%rdi
L150:
  and    $0x1,%r12d
  jne    L2
L52:
  mov    %edi,%esi
  xor    %eax,%eax
  shr    $0x20,%rdi
  call   <add32_with_carry@plt>
  cltq
  test   %rbx,%rbx
  jne    L89
L165:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L2:
  movzbl 0x0(%rbp),%eax
  add    %rax,%rdi
  jmp    L52
  nopl   0x0(%rax)
L139:
  mov    0x0(%rbp),%edx
  sub    $0x1,%eax
  sub    $0x4,%r12d
  add    $0x4,%rbp
  add    %rdx,%rdi
  jmp    L113
  cs nopw 0x0(%rax,%rax,1)
L109:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L89:
  mov    %rax,%rdi
  xor    %eax,%eax
  call   <from32to16@plt>
  movslq %eax,%rdx
  movzbl %dh,%eax
  shl    $0x8,%rdx
  movzwl %dx,%edx
  or     %rdx,%rax
  jmp    L165
  nopl   0x0(%rax)
L179:
  movzbl 0x0(%rbp),%edi
  sub    $0x1,%r12d
  add    $0x1,%rbp
  shl    $0x8,%edi
  movslq %edi,%rdi
  jmp    L192
  nop
L22:
  mov    %rax,%rbp
  jmp    L196
  nopl   0x0(%rax,%rax,1)
L5:
  mov    %rbp,%rax
  jmp    L67
```

assistant: ```c
unsigned do_csum(const unsigned char *buff, unsigned len) {
  unsigned odd, count;
  unsigned long result = 0;
  if (__builtin_expect(!!(len == 0), 0))
    return result;
  odd = 1 & (unsigned long)buff;
  if (__builtin_expect(!!(odd), 0)) {
    result = *buff << 8;
    len--;
    buff++;
  }
  count = len >> 1;
  if (count) {
    if (2 & (unsigned long)buff) {
      result += *(unsigned short *)buff;
      count--;
      len -= 2;
      buff += 2;
    }
    count >>= 1;
    if (count) {
      unsigned long zero;
      unsigned count64;
      if (4 & (unsigned long)buff) {
        result += *(unsigned int *)buff;
        count--;
        len -= 4;
        buff += 4;
      }
      count >>= 1;
      zero = 0;
      count64 = count >> 3;
      while (count64) {
        asm("addq 0*8(%[src]),%[res]\n\t"
            "adcq 1*8(%[src]),%[res]\n\t"
            "adcq 2*8(%[src]),%[res]\n\t"
            "adcq 3*8(%[src]),%[res]\n\t"
            "adcq 4*8(%[src]),%[res]\n\t"
            "adcq 5*8(%[src]),%[res]\n\t"
            "adcq 6*8(%[src]),%[res]\n\t"
            "adcq 7*8(%[src]),%[res]\n\t"
            "adcq %[zero],%[res]"
            : [res] "=r"(result)
            : [src] "r"(buff), [zero] "r"(zero), "[res]"(result));
        buff += 64;
        count64--;
      }
      count %= 8;
      while (count) {
        asm("addq %1,%0\n\t"
            "adcq %2,%0\n"
            : "=r"(result)
            : "m"(*(unsigned long *)buff), "r"(zero), "0"(result));
        --count;
        buff += 8;
      }
      result = add32_with_carry(result >> 32, result & 0xffffffff);
      if (len & 4) {
        result += *(unsigned int *)buff;
        buff += 4;
      }
    }
    if (len & 2) {
      result += *(unsigned short *)buff;
      buff += 2;
    }
  }
  if (len & 1)
    result += *buff;
  result = add32_with_carry(result >> 32, result & 0xffffffff);
  if (__builtin_expect(!!(odd), 0)) {
    result = from32to16(result);
    result = ((result >> 8) & 0xff) | ((result & 0xff) << 8);
  }
  return result;
}
```