user: Please show me the C implementation that matches the assembly code listed below:

```asm
<adler32>:
  endbr64
  push   %r15
  mov    %edi,%eax
  mov    %rsi,%rcx
  push   %r14
  shr    $0x10,%eax
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rax,-0x18(%rsp)
  movzwl %di,%eax
  mov    %edx,-0x8(%rsp)
  mov    %eax,%edi
  cmp    $0x1,%edx
  je     L67
  test   %rsi,%rsi
  je     L400
  cmp    $0xf,%edx
  jbe    L43
  lea    0x15b0(%rsi),%rsi
  mov    %rsi,-0x10(%rsp)
  cmp    $0x15af,%edx
  jbe    L46
L16:
  mov    -0x10(%rsp),%rax
  mov    %edi,%r14d
  lea    -0x15b0(%rax),%r15
  mov    -0x8(%rsp),%eax
  mov    %eax,-0x4(%rsp)
  sub    $0x15b0,%eax
  mov    %eax,-0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L262:
  movzbl (%r15),%r13d
  movzbl 0x1(%r15),%esi
  add    $0x10,%r15
  movzbl -0xe(%r15),%ecx
  movzbl -0xd(%r15),%edx
  add    %r14d,%r13d
  movzbl -0xc(%r15),%eax
  movzbl -0xb(%r15),%r12d
  add    %r13d,%esi
  movzbl -0xa(%r15),%ebp
  movzbl -0x9(%r15),%ebx
  add    %esi,%ecx
  add    %r13,%rsi
  movzbl -0x8(%r15),%edi
  movzbl -0x6(%r15),%r11d
  add    %ecx,%edx
  add    %rsi,%rcx
  movzbl -0x5(%r15),%r10d
  movzbl -0x4(%r15),%r9d
  add    %edx,%eax
  add    %rcx,%rdx
  movzbl -0x3(%r15),%r8d
  add    %eax,%r12d
  add    %rdx,%rax
  add    %r12d,%ebp
  add    %r12,%rax
  add    %ebp,%ebx
  add    %rbp,%rax
  lea    (%rdi,%rbx,1),%r14d
  movzbl -0x7(%r15),%edi
  add    %rbx,%rax
  mov    %r14d,-0x20(%rsp)
  mov    -0x20(%rsp),%edx
  add    %r14d,%edi
  movzbl -0x1(%r15),%r14d
  mov    %edi,-0x1c(%rsp)
  add    %rdx,%rax
  mov    -0x1c(%rsp),%edx
  add    %edi,%r11d
  add    %r11d,%r10d
  movzbl -0x2(%r15),%edi
  add    %rdx,%rax
  add    %r10d,%r9d
  add    %r11,%rax
  add    %r9d,%r8d
  add    %r10,%rax
  add    %r8d,%edi
  add    %r9,%rax
  add    %edi,%r14d
  add    %r8,%rax
  mov    %r14d,%edx
  add    %rdi,%rax
  add    %rdx,%rax
  add    %rax,-0x18(%rsp)
  mov    -0x10(%rsp),%rax
  mov    %rax,%rcx
  cmp    %rax,%r15
  jne    L262
  mov    $0x80078071,%eax
  mov    -0x18(%rsp),%rsi
  imul   %rax,%rdx
  shr    $0x2f,%rdx
  imul   $0xfff1,%edx,%eax
  sub    %eax,%r14d
  movabs $0xf00e10d2fc5cd,%rax
  mul    %rsi
  mov    %rsi,%rax
  mov    %r14d,%edi
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  shr    $0xf,%rdx
  imul   $0xfff1,%rdx,%rax
  sub    %rax,%rsi
  lea    0x15b0(%r15),%rax
  cmpl   $0x15af,-0x8(%rsp)
  mov    %rsi,-0x18(%rsp)
  mov    %rax,-0x10(%rsp)
  ja     L16
  mov    -0x8(%rsp),%eax
  test   %eax,%eax
  jne    L40
L191:
  mov    -0x18(%rsp),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  shl    $0x10,%eax
  pop    %r13
  pop    %r14
  or     %edi,%eax
  pop    %r15
  ret
L43:
  test   %edx,%edx
  je     L276
  movzbl (%rsi),%eax
  add    %edi,%eax
  add    %rax,-0x18(%rsp)
  mov    -0x18(%rsp),%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  cmp    $0x1,%edx
  je     L276
  movzbl 0x1(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x2,%edx
  je     L276
  movzbl 0x2(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x3,%edx
  je     L276
  movzbl 0x3(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x4,%edx
  je     L276
  movzbl 0x4(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x5,%edx
  je     L276
  movzbl 0x5(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x6,%edx
  je     L276
  movzbl 0x6(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x7,%edx
  je     L276
  movzbl 0x7(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x8,%edx
  je     L276
  movzbl 0x8(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0x9,%edx
  je     L276
  movzbl 0x9(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0xa,%edx
  je     L276
  movzbl 0xa(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0xb,%edx
  je     L276
  movzbl 0xb(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0xc,%edx
  je     L276
  movzbl 0xc(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0xd,%edx
  je     L276
  movzbl 0xd(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %rax,%rsi
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
  cmp    $0xe,%edx
  je     L276
  movzbl 0xe(%rcx),%eax
  add    %esi,%eax
  add    %rax,%rbx
  mov    %eax,%edi
  mov    %rbx,-0x18(%rsp)
L276:
  cmp    $0xfff0,%edi
  lea    -0xfff1(%rdi),%eax
  mov    -0x18(%rsp),%rcx
  movabs $0xf00e10d2fc5cd,%rdx
  cmovbe %edi,%eax
  mov    %eax,%esi
  mov    -0x18(%rsp),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  mul    %rdx
  mov    %rcx,%rax
  pop    %r13
  pop    %r14
  pop    %r15
  sub    %rdx,%rax
  shr    %rax
  add    %rdx,%rax
  mov    %rcx,%rdx
  shr    $0xf,%rax
  imul   $0xfff1,%rax,%rax
  sub    %rax,%rdx
  mov    %edx,%eax
  shl    $0x10,%eax
  or     %esi,%eax
  ret
L67:
  movzbl (%rsi),%edx
  add    %eax,%edx
  cmp    $0xfff0,%edx
  lea    -0xfff1(%rdx),%eax
  cmova  %eax,%edx
  mov    %edx,%eax
  add    -0x18(%rsp),%rax
  pop    %rbx
  cmp    $0xfff0,%rax
  lea    -0xfff1(%rax),%rcx
  pop    %rbp
  pop    %r12
  cmova  %rcx,%rax
  pop    %r13
  pop    %r14
  pop    %r15
  shl    $0x10,%eax
  or     %edx,%eax
  ret
L40:
  cmp    $0xf,%eax
  jbe    L382
L46:
  mov    -0x8(%rsp),%eax
  mov    %edi,%r15d
  sub    $0x10,%eax
  shr    $0x4,%eax
  mov    %eax,-0x4(%rsp)
  add    $0x1,%eax
  shl    $0x4,%rax
  add    %rcx,%rax
  mov    %rax,-0x10(%rsp)
L122:
  movzbl (%rcx),%r14d
  movzbl 0x1(%rcx),%edi
  add    $0x10,%rcx
  movzbl -0xe(%rcx),%esi
  movzbl -0xd(%rcx),%edx
  add    %r15d,%r14d
  movzbl -0xc(%rcx),%eax
  movzbl -0xb(%rcx),%r13d
  add    %r14d,%edi
  movzbl -0xa(%rcx),%r12d
  movzbl -0x9(%rcx),%ebp
  add    %edi,%esi
  add    %r14,%rdi
  movzbl -0x8(%rcx),%ebx
  movzbl -0x7(%rcx),%r11d
  add    %esi,%edx
  add    %rdi,%rsi
  movzbl -0x6(%rcx),%r8d
  movzbl -0x4(%rcx),%r10d
  add    %edx,%eax
  add    %rsi,%rdx
  movzbl -0x1(%rcx),%r15d
  add    %eax,%r13d
  add    %rdx,%rax
  add    %r13d,%r12d
  add    %r13,%rax
  add    %r12d,%ebp
  add    %r12,%rax
  add    %ebp,%ebx
  add    %rbp,%rax
  add    %ebx,%r11d
  add    %rbx,%rax
  lea    (%r8,%r11,1),%r9d
  movzbl -0x5(%rcx),%r8d
  add    %r11,%rax
  mov    %r9d,-0x20(%rsp)
  mov    -0x20(%rsp),%edx
  add    %r9d,%r8d
  movzbl -0x3(%rcx),%r9d
  mov    %r8d,-0x1c(%rsp)
  add    %rdx,%rax
  mov    -0x1c(%rsp),%edx
  add    %r8d,%r10d
  movzbl -0x2(%rcx),%r8d
  add    %r10d,%r9d
  add    %rdx,%rax
  add    %r9d,%r8d
  add    %r10,%rax
  add    %r8d,%r15d
  add    %r9,%rax
  add    %r8,%rax
  mov    %r15d,%edx
  add    %rdx,%rax
  add    %rax,-0x18(%rsp)
  cmp    -0x10(%rsp),%rcx
  jne    L122
  mov    -0x4(%rsp),%eax
  mov    -0x8(%rsp),%ecx
  mov    %r15d,%edi
  shl    $0x4,%eax
  neg    %eax
  lea    -0x11(%rcx,%rax,1),%eax
  and    $0xf,%ecx
  je     L309
L170:
  mov    -0x10(%rsp),%rbx
  movzbl (%rbx),%edx
  add    %edi,%edx
  add    %rdx,-0x18(%rsp)
  mov    -0x18(%rsp),%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  test   %eax,%eax
  je     L309
  movzbl 0x1(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x1,%eax
  je     L309
  movzbl 0x2(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x2,%eax
  je     L309
  movzbl 0x3(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x3,%eax
  je     L309
  movzbl 0x4(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x4,%eax
  je     L309
  movzbl 0x5(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x5,%eax
  je     L309
  movzbl 0x6(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x6,%eax
  je     L309
  movzbl 0x7(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x7,%eax
  je     L309
  movzbl 0x8(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x8,%eax
  je     L309
  movzbl 0x9(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0x9,%eax
  je     L309
  movzbl 0xa(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0xa,%eax
  je     L309
  movzbl 0xb(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0xb,%eax
  je     L309
  movzbl 0xc(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %rdx,%rcx
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0xc,%eax
  je     L309
  movzbl 0xd(%rbx),%edx
  add    %ecx,%edx
  add    %rdx,%rsi
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
  cmp    $0xd,%eax
  je     L309
  movzbl 0xe(%rbx),%eax
  add    %eax,%edx
  add    %rdx,%rsi
  mov    %edx,%edi
  mov    %rsi,-0x18(%rsp)
L309:
  mov    $0x80078071,%eax
  mov    %edi,%ecx
  imul   %rdx,%rax
  movabs $0xf00e10d2fc5cd,%rdx
  shr    $0x2f,%rax
  imul   $0xfff1,%eax,%eax
  sub    %eax,%ecx
  mov    -0x18(%rsp),%rax
  mov    %ecx,%edi
  mov    -0x18(%rsp),%rcx
  mul    %rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rdx,%rax
  shr    $0xf,%rax
  imul   $0xfff1,%rax,%rax
  sub    %rax,%rcx
  mov    %rcx,-0x18(%rsp)
  jmp    L191
L400:
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L382:
  mov    -0x4(%rsp),%eax
  mov    %r15,-0x10(%rsp)
  sub    $0x15b1,%eax
  jmp    L170
```

assistant: ```c
unsigned int adler32(adler, buf, len)
unsigned int adler;
const unsigned char *buf;
unsigned int len;
{
  unsigned long sum2;
  unsigned n;
  sum2 = (adler >> 16) & 0xffff;
  adler &= 0xffff;
  if (len == 1) {
    adler += buf[0];
    if (adler >= 65521UL)
      adler -= 65521UL;
    sum2 += adler;
    if (sum2 >= 65521UL)
      sum2 -= 65521UL;
    return adler | (sum2 << 16);
  }
  if (buf == (void *)(unsigned char)0)
    return 1L;
  if (len < 16) {
    while (len--) {
      adler += *buf++;
      sum2 += adler;
    }
    if (adler >= 65521UL)
      adler -= 65521UL;
    sum2 %= 65521UL;
    return adler | (sum2 << 16);
  }
  while (len >= 5552) {
    len -= 5552;
    n = 5552 / 16;
    do {
      {
        adler += (buf)[0];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[0 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      {
        adler += (buf)[0 + 4];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 4 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[0 + 4 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 4 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      ;
      {
        adler += (buf)[8];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[8 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      {
        adler += (buf)[8 + 4];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 4 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[8 + 4 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 4 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      ;
      ;
      buf += 16;
    } while (--n);
    adler %= 65521UL;
    sum2 %= 65521UL;
  }
  if (len) {
    while (len >= 16) {
      len -= 16;
      {
        adler += (buf)[0];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[0 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      {
        adler += (buf)[0 + 4];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 4 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[0 + 4 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[0 + 4 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      ;
      {
        adler += (buf)[8];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[8 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      {
        adler += (buf)[8 + 4];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 4 + 1];
        sum2 += adler;
      };
      ;
      {
        adler += (buf)[8 + 4 + 2];
        sum2 += adler;
      };
      {
        adler += (buf)[8 + 4 + 2 + 1];
        sum2 += adler;
      };
      ;
      ;
      ;
      ;
      buf += 16;
    }
    while (len--) {
      adler += *buf++;
      sum2 += adler;
    }
    adler %= 65521UL;
    sum2 %= 65521UL;
  }
  return adler | (sum2 << 16);
}
```