user: Converte this assembly snippet into its equivalent C code:

```asm
<adler32>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%r14
  mov    %edx,-0x8(%rsp)
  mov    %edi,%eax
  shr    $0x10,%eax
  mov    %eax,%eax
  mov    %rax,-0x18(%rsp)
  movzwl %di,%r15d
  cmp    $0x1,%edx
  je     L1
  test   %rsi,%rsi
  je     L130
  mov    -0x8(%rsp),%eax
  cmp    $0xf,%eax
  jbe    L40
  lea    0x15b0(%rsi),%rcx
  mov    %rcx,-0x10(%rsp)
  cmp    $0x15af,%eax
  jbe    L107
L70:
  mov    -0x10(%rsp),%rax
  lea    -0x15b0(%rax),%r14
  mov    -0x8(%rsp),%eax
  mov    %eax,-0x4(%rsp)
  sub    $0x15b0,%eax
  mov    %eax,-0x8(%rsp)
L68:
  movzbl (%r14),%r13d
  add    %r15d,%r13d
  movzbl 0x1(%r14),%esi
  add    %r13d,%esi
  movzbl 0x2(%r14),%ecx
  add    %esi,%ecx
  movzbl 0x3(%r14),%edx
  add    %ecx,%edx
  movzbl 0x4(%r14),%eax
  add    %edx,%eax
  movzbl 0x5(%r14),%r12d
  add    %eax,%r12d
  movzbl 0x6(%r14),%ebp
  add    %r12d,%ebp
  movzbl 0x7(%r14),%ebx
  add    %ebp,%ebx
  movzbl 0x8(%r14),%edi
  lea    (%rdi,%rbx,1),%r15d
  movzbl 0x9(%r14),%edi
  mov    %r15d,-0x20(%rsp)
  add    %r15d,%edi
  movzbl 0xa(%r14),%r11d
  mov    %edi,-0x1c(%rsp)
  add    %edi,%r11d
  movzbl 0xb(%r14),%r10d
  add    %r11d,%r10d
  movzbl 0xc(%r14),%r9d
  add    %r10d,%r9d
  movzbl 0xd(%r14),%r8d
  add    %r9d,%r8d
  movzbl 0xe(%r14),%edi
  add    %r8d,%edi
  movzbl 0xf(%r14),%r15d
  add    %edi,%r15d
  mov    %r13d,%r13d
  mov    %esi,%esi
  add    %r13,%rsi
  mov    %ecx,%ecx
  add    %rsi,%rcx
  mov    %edx,%edx
  add    %rcx,%rdx
  mov    %eax,%eax
  add    %rdx,%rax
  mov    %r12d,%r12d
  add    %r12,%rax
  mov    %ebp,%ebp
  add    %rbp,%rax
  mov    %ebx,%ebx
  add    %rbx,%rax
  mov    -0x20(%rsp),%edx
  add    %rdx,%rax
  mov    -0x1c(%rsp),%edx
  add    %rdx,%rax
  mov    %r11d,%r11d
  add    %r11,%rax
  mov    %r10d,%r10d
  add    %r10,%rax
  mov    %r9d,%r9d
  add    %r9,%rax
  mov    %r8d,%r8d
  add    %r8,%rax
  mov    %edi,%edi
  add    %rdi,%rax
  mov    %r15d,%edx
  add    %rdx,%rax
  add    %rax,-0x18(%rsp)
  add    $0x10,%r14
  cmp    -0x10(%rsp),%r14
  jne    L68
  mov    %r15d,%eax
  mov    $0x80078071,%ecx
  imul   %rcx,%rax
  shr    $0x2f,%rax
  imul   $0xfff1,%eax,%eax
  sub    %eax,%r15d
  movabs $0xf00e10d2fc5cd,%rax
  mov    -0x18(%rsp),%rcx
  mul    %rcx
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rax,%rdx
  shr    $0xf,%rdx
  imul   $0xfff1,%rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,-0x18(%rsp)
  addq   $0x15b0,-0x10(%rsp)
  cmpl   $0x15af,-0x8(%rsp)
  ja     L70
  mov    -0x8(%rsp),%eax
  test   %eax,%eax
  jne    L12
L123:
  mov    -0x18(%rsp),%eax
  shl    $0x10,%eax
  or     %r15d,%eax
L103:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L1:
  movzbl (%rsi),%edx
  add    %r15d,%edx
  lea    -0xfff1(%rdx),%eax
  cmp    $0xfff0,%edx
  cmova  %eax,%edx
  mov    %edx,%eax
  add    -0x18(%rsp),%rax
  lea    -0xfff1(%rax),%rcx
  cmp    $0xfff0,%rax
  cmova  %rcx,%rax
  shl    $0x10,%eax
  or     %edx,%eax
  jmp    L103
L40:
  mov    -0x8(%rsp),%ecx
  lea    -0x1(%rcx),%eax
  test   %ecx,%ecx
  je     L128
  mov    %eax,%eax
  lea    0x1(%rsi,%rax,1),%rdx
  mov    -0x18(%rsp),%rax
L33:
  add    $0x1,%r14
  movzbl -0x1(%r14),%ecx
  add    %ecx,%r15d
  mov    %r15d,%ecx
  add    %rcx,%rax
  cmp    %r14,%rdx
  jne    L33
  mov    %rax,-0x18(%rsp)
L128:
  lea    -0xfff1(%r15),%eax
  cmp    $0xfff0,%r15d
  cmova  %eax,%r15d
  movabs $0xf00e10d2fc5cd,%rdx
  mov    -0x18(%rsp),%rax
  mul    %rdx
  mov    -0x18(%rsp),%rcx
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rdx,%rax
  shr    $0xf,%rax
  imul   $0xfff1,%rax,%rax
  mov    %rcx,%rdx
  sub    %rax,%rdx
  mov    %edx,%eax
  shl    $0x10,%eax
  or     %r15d,%eax
  jmp    L103
L12:
  cmp    $0xf,%eax
  jbe    L49
L107:
  mov    -0x8(%rsp),%eax
  sub    $0x10,%eax
  shr    $0x4,%eax
  mov    %eax,-0x4(%rsp)
  add    $0x1,%eax
  mov    %eax,%eax
  shl    $0x4,%rax
  add    %r14,%rax
  mov    %rax,-0x10(%rsp)
L118:
  movzbl (%r14),%r13d
  add    %r15d,%r13d
  movzbl 0x1(%r14),%esi
  add    %r13d,%esi
  movzbl 0x2(%r14),%ecx
  add    %esi,%ecx
  movzbl 0x3(%r14),%edx
  add    %ecx,%edx
  movzbl 0x4(%r14),%eax
  add    %edx,%eax
  movzbl 0x5(%r14),%r12d
  add    %eax,%r12d
  movzbl 0x6(%r14),%ebp
  add    %r12d,%ebp
  movzbl 0x7(%r14),%ebx
  add    %ebp,%ebx
  movzbl 0x8(%r14),%r11d
  add    %ebx,%r11d
  movzbl 0x9(%r14),%r10d
  add    %r11d,%r10d
  movzbl 0xa(%r14),%r9d
  add    %r10d,%r9d
  movzbl 0xb(%r14),%edi
  lea    (%rdi,%r9,1),%r8d
  movzbl 0xc(%r14),%edi
  mov    %r8d,-0x20(%rsp)
  add    %r8d,%edi
  movzbl 0xd(%r14),%r8d
  mov    %edi,-0x1c(%rsp)
  add    %edi,%r8d
  movzbl 0xe(%r14),%edi
  add    %r8d,%edi
  movzbl 0xf(%r14),%r15d
  add    %edi,%r15d
  mov    %r13d,%r13d
  mov    %esi,%esi
  add    %r13,%rsi
  mov    %ecx,%ecx
  add    %rsi,%rcx
  mov    %edx,%edx
  add    %rcx,%rdx
  mov    %eax,%eax
  add    %rdx,%rax
  mov    %r12d,%r12d
  add    %r12,%rax
  mov    %ebp,%ebp
  add    %rbp,%rax
  mov    %ebx,%ebx
  add    %rbx,%rax
  mov    %r11d,%r11d
  add    %r11,%rax
  mov    %r10d,%r10d
  add    %r10,%rax
  mov    %r9d,%r9d
  add    %r9,%rax
  mov    -0x20(%rsp),%edx
  add    %rdx,%rax
  mov    -0x1c(%rsp),%edx
  add    %rdx,%rax
  mov    %r8d,%r8d
  add    %r8,%rax
  mov    %edi,%edi
  add    %rdi,%rax
  mov    %r15d,%edx
  add    %rdx,%rax
  add    %rax,-0x18(%rsp)
  add    $0x10,%r14
  cmp    -0x10(%rsp),%r14
  jne    L118
  mov    -0x4(%rsp),%eax
  shl    $0x4,%eax
  neg    %eax
  mov    -0x8(%rsp),%ecx
  lea    -0x11(%rcx,%rax,1),%eax
  test   $0xf,%cl
  je     L69
L167:
  mov    %eax,%eax
  mov    -0x10(%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rdx
  mov    %rcx,%rax
  mov    -0x18(%rsp),%rcx
L7:
  add    $0x1,%rax
  movzbl -0x1(%rax),%esi
  add    %esi,%r15d
  mov    %r15d,%esi
  add    %rsi,%rcx
  cmp    %rdx,%rax
  jne    L7
  mov    %rcx,-0x18(%rsp)
L69:
  mov    %r15d,%eax
  mov    $0x80078071,%edx
  imul   %rdx,%rax
  shr    $0x2f,%rax
  imul   $0xfff1,%eax,%eax
  sub    %eax,%r15d
  movabs $0xf00e10d2fc5cd,%rdx
  mov    -0x18(%rsp),%rax
  mul    %rdx
  mov    -0x18(%rsp),%rcx
  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    L123
L130:
  mov    $0x1,%eax
  jmp    L103
L49:
  mov    -0x4(%rsp),%eax
  sub    $0x15b1,%eax
  mov    %r14,-0x10(%rsp)
  jmp    L167
```

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