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

```asm
<do_csum>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r12d
  test   %esi,%esi
  je     L68
  mov    %rdi,%rbx
  mov    $0x0,%edi
  mov    %ebx,%ebp
  and    $0x1,%ebp
  jne    L89
L144:
  mov    %r12d,%edx
  shr    %edx
  je     L109
  test   $0x2,%bl
  je     L1
  movzwl (%rbx),%eax
  add    %rax,%rdi
  sub    $0x1,%edx
  sub    $0x2,%r12d
  add    $0x2,%rbx
L1:
  shr    %edx
  je     L56
  test   $0x4,%bl
  je     L57
  mov    (%rbx),%eax
  add    %rax,%rdi
  sub    $0x1,%edx
  sub    $0x4,%r12d
  add    $0x4,%rbx
L57:
  mov    %edx,%ecx
  shr    %ecx
  shr    $0x4,%edx
  je     L172
  mov    %edx,%edx
  shl    $0x6,%rdx
  add    %rbx,%rdx
  mov    $0x0,%eax
L58:
  add    (%rbx),%rdi
  adc    0x8(%rbx),%rdi
  adc    0x10(%rbx),%rdi
  adc    0x18(%rbx),%rdi
  adc    0x20(%rbx),%rdi
  adc    0x28(%rbx),%rdi
  adc    0x30(%rbx),%rdi
  adc    0x38(%rbx),%rdi
  adc    %rax,%rdi
  add    $0x40,%rbx
  cmp    %rdx,%rbx
  jne    L58
L67:
  and    $0x7,%ecx
  je     L63
  mov    %ecx,%ecx
  lea    (%rdx,%rcx,8),%rbx
  mov    $0x0,%eax
L60:
  add    (%rdx),%rdi
  adc    %rax,%rdi
  add    $0x8,%rdx
  cmp    %rbx,%rdx
  jne    L60
L137:
  mov    %edi,%esi
  shr    $0x20,%rdi
  mov    $0x0,%eax
  call   <add32_with_carry@plt>
  movslq %eax,%rdi
  test   $0x4,%r12b
  je     L56
  mov    (%rbx),%eax
  add    %rax,%rdi
  add    $0x4,%rbx
L56:
  test   $0x2,%r12b
  je     L109
  movzwl (%rbx),%eax
  add    %rax,%rdi
  add    $0x2,%rbx
L109:
  test   $0x1,%r12b
  je     L11
  movzbl (%rbx),%eax
  add    %rax,%rdi
L11:
  mov    %edi,%esi
  shr    $0x20,%rdi
  mov    $0x0,%eax
  call   <add32_with_carry@plt>
  cltq
  test   %ebp,%ebp
  jne    L55
L45:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L89:
  movzbl (%rbx),%edi
  shl    $0x8,%edi
  movslq %edi,%rdi
  sub    $0x1,%r12d
  add    $0x1,%rbx
  jmp    L144
L172:
  mov    %rbx,%rdx
  jmp    L67
L63:
  mov    %rdx,%rbx
  jmp    L137
L55:
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <from32to16@plt>
  movslq %eax,%rdx
  movzbl %dh,%eax
  shl    $0x8,%rdx
  movzwl %dx,%edx
  or     %rdx,%rax
  jmp    L45
L68:
  mov    %esi,%eax
  jmp    L45
```

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;
}
```