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,%r10d
  cmp    $0x1,%edx
  je     L48
  test   %rsi,%rsi
  je     L140
  mov    -0x8(%rsp),%eax
  cmp    $0xf,%eax
  jbe    L39
  lea    0x15b0(%rsi),%rsi
  mov    %rsi,-0x10(%rsp)
  cmp    $0x15af,%eax
  jbe    L65
L19:
  mov    -0x10(%rsp),%rax
  mov    %r10d,%r14d
  lea    -0x15b0(%rax),%r15
  mov    -0x8(%rsp),%eax
  mov    %eax,-0x4(%rsp)
  sub    $0x15b0,%eax
  mov    %eax,-0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L15:
  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    L15
  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,%r10d
  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     L19
  mov    -0x8(%rsp),%eax
  test   %eax,%eax
  jne    L27
L98:
  mov    -0x18(%rsp),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  shl    $0x10,%eax
  pop    %r13
  pop    %r14
  or     %r10d,%eax
  pop    %r15
  ret
L39:
  mov    -0x8(%rsp),%eax
  test   %eax,%eax
  je     L52
  mov    %eax,%edx
  mov    %r10d,%eax
  add    %rsi,%rdx
  mov    -0x18(%rsp),%rsi
L55:
  movzbl (%rcx),%edi
  add    $0x1,%rcx
  add    %eax,%edi
  mov    %rdi,%rax
  add    %rdi,%rsi
  cmp    %rdx,%rcx
  jne    L55
  mov    %rsi,-0x18(%rsp)
  mov    %edi,%r10d
L52:
  cmp    $0xfff0,%r10d
  lea    -0xfff1(%r10),%eax
  mov    -0x18(%rsp),%rcx
  movabs $0xf00e10d2fc5cd,%rdx
  cmovbe %r10d,%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
L48:
  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
L27:
  cmp    $0xf,%eax
  jbe    L116
L65:
  mov    -0x8(%rsp),%eax
  mov    %r10d,%r15d
  sub    $0x10,%eax
  shr    $0x4,%eax
  mov    %eax,-0x4(%rsp)
  add    $0x1,%eax
  shl    $0x4,%rax
  add    %rcx,%rax
  mov    %rax,-0x10(%rsp)
L147:
  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    L147
  mov    -0x4(%rsp),%eax
  mov    -0x8(%rsp),%ecx
  mov    %r15d,%r10d
  shl    $0x4,%eax
  neg    %eax
  lea    -0x11(%rcx,%rax,1),%eax
  and    $0xf,%ecx
  je     L89
L149:
  mov    -0x10(%rsp),%rbx
  mov    -0x18(%rsp),%rdi
  mov    %r10d,%esi
  lea    0x1(%rbx,%rax,1),%rcx
  mov    %rbx,%rax
L83:
  movzbl (%rax),%edx
  add    $0x1,%rax
  add    %esi,%edx
  mov    %rdx,%rsi
  add    %rdx,%rdi
  cmp    %rcx,%rax
  jne    L83
  mov    %rdi,-0x18(%rsp)
  mov    %edx,%r10d
L89:
  mov    $0x80078071,%eax
  mov    %r10d,%ecx
  imul   %rdx,%rax
  movabs $0xf00e10d2fc5cd,%rdx
  shr    $0x2f,%rax
  imul   $0xfff1,%eax,%eax
  sub    %eax,%ecx
  mov    -0x18(%rsp),%rax
  mov    %ecx,%r10d
  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    L98
L140:
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L116:
  mov    -0x4(%rsp),%eax
  mov    %r15,-0x10(%rsp)
  sub    $0x15b1,%eax
  jmp    L149
```

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 == (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);
}
```