user: Translate the below assembly code into C programming language:

```asm
<AddLZ77Data>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  movq   $0x0,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L90
L36:
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %eax,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x0,-0x30(%rbp)
  jne    L70
  cmpl   $0xff,-0x2c(%rbp)
  setbe  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%esi
  mov    -0x2c(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    0x38(%rbp),%rdi
  mov    0x30(%rbp),%rcx
  mov    0x28(%rbp),%rdx
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <AddHuffmanBits@plt>
  addq   $0x1,-0x20(%rbp)
  jmp    L61
L70:
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <ZopfliGetLengthSymbol@plt>
  mov    %eax,-0x28(%rbp)
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <ZopfliGetDistSymbol@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x2,-0x2c(%rbp)
  jbe    L62
  cmpl   $0x120,-0x2c(%rbp)
  ja     L62
  mov    $0x1,%eax
  jmp    L94
L62:
  mov    $0x0,%eax
L94:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x28(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x28(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%esi
  mov    -0x28(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    0x38(%rbp),%rdi
  mov    0x30(%rbp),%rcx
  mov    0x28(%rbp),%rdx
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <AddHuffmanBits@plt>
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <ZopfliGetLengthExtraBits@plt>
  mov    %eax,%ebx
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <ZopfliGetLengthExtraBitsValue@plt>
  mov    %eax,%edi
  mov    0x38(%rbp),%rcx
  mov    0x30(%rbp),%rdx
  mov    0x28(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  mov    %ebx,%esi
  call   <AddBits@plt>
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%esi
  mov    -0x24(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    0x38(%rbp),%rdi
  mov    0x30(%rbp),%rcx
  mov    0x28(%rbp),%rdx
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <AddHuffmanBits@plt>
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <ZopfliGetDistExtraBits@plt>
  mov    %eax,%ebx
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <ZopfliGetDistExtraBitsValue@plt>
  mov    %eax,%edi
  mov    0x38(%rbp),%rcx
  mov    0x30(%rbp),%rdx
  mov    0x28(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  mov    %ebx,%esi
  call   <AddBits@plt>
  mov    -0x2c(%rbp),%eax
  add    %rax,-0x20(%rbp)
L61:
  addq   $0x1,-0x18(%rbp)
L90:
  mov    -0x18(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jb     L36
  cmpq   $0x0,-0x58(%rbp)
  je     L99
  mov    -0x20(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jne    L89
L99:
  mov    $0x1,%eax
  jmp    L16
L89:
  mov    $0x0,%eax
L16:
  mov    %eax,%edi
  call   <assert@plt>
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void AddLZ77Data(const unsigned short *litlens, const unsigned short *dists, size_t lstart, size_t lend, size_t expected_data_size, const unsigned *ll_symbols, const unsigned *ll_lengths, const unsigned *d_symbols, const unsigned *d_lengths, unsigned char *bp, unsigned char **out, size_t *outsize) {
  size_t testlength = 0;
  size_t i;
  for (i = lstart; i < lend; i++) {
    unsigned dist = dists[i];
    unsigned litlen = litlens[i];
    if (dist == 0) {
      assert(litlen < 256);
      assert(ll_lengths[litlen] > 0);
      AddHuffmanBits(ll_symbols[litlen], ll_lengths[litlen], bp, out, outsize);
      testlength++;
    } else {
      unsigned lls = ZopfliGetLengthSymbol(litlen);
      unsigned ds = ZopfliGetDistSymbol(dist);
      assert(litlen >= 3 && litlen <= 288);
      assert(ll_lengths[lls] > 0);
      assert(d_lengths[ds] > 0);
      AddHuffmanBits(ll_symbols[lls], ll_lengths[lls], bp, out, outsize);
      AddBits(ZopfliGetLengthExtraBitsValue(litlen), ZopfliGetLengthExtraBits(litlen), bp, out, outsize);
      AddHuffmanBits(d_symbols[ds], d_lengths[ds], bp, out, outsize);
      AddBits(ZopfliGetDistExtraBitsValue(dist), ZopfliGetDistExtraBits(dist), bp, out, outsize);
      testlength += litlen;
    }
  }
  assert(expected_data_size == 0 || testlength == expected_data_size);
}
```