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

```asm
<AddLZ77Data>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    0xb0(%rsp),%rax
  mov    %rdi,0x8(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    0xc8(%rsp),%r13
  mov    %rax,0x28(%rsp)
  mov    0xb8(%rsp),%rax
  mov    %rcx,0x18(%rsp)
  mov    0xd0(%rsp),%r14
  mov    %rax,0x58(%rsp)
  mov    0xc0(%rsp),%rax
  mov    %r8,0x68(%rsp)
  mov    0xd8(%rsp),%r15
  mov    %r9,0x20(%rsp)
  mov    %rax,0x60(%rsp)
  cmp    %rcx,%rdx
  jae    L20
  movq   $0x0,(%rsp)
  mov    %rdx,%r10
  jmp    L5
L19:
  xor    %edi,%edi
  cmp    $0xff,%ebp
  mov    %r10,0x30(%rsp)
  setbe  %dil
  call   <assert@plt>
  mov    0x28(%rsp),%rax
  xor    %edi,%edi
  lea    (%rax,%rbp,4),%rbp
  mov    0x0(%rbp),%ecx
  test   %ecx,%ecx
  setne  %dil
  call   <assert@plt>
  mov    0x20(%rsp),%rax
  mov    0x0(%rbp),%esi
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    (%rax,%rbx,4),%edi
  call   <AddHuffmanBits@plt>
  mov    0x30(%rsp),%r10
  addq   $0x1,(%rsp)
  add    $0x1,%r10
  cmp    %r10,0x18(%rsp)
  je     L4
L5:
  mov    0x10(%rsp),%rax
  movzwl (%rax,%r10,2),%r12d
  mov    0x8(%rsp),%rax
  movzwl (%rax,%r10,2),%ebp
  mov    %rbp,%rbx
  test   %r12d,%r12d
  je     L19
  mov    %ebp,%edi
  mov    %r10,0x50(%rsp)
  call   <GetLengthSymbol@plt>
  mov    %r12d,%edi
  mov    %eax,0x30(%rsp)
  call   <GetDistSymbol@plt>
  xor    %edi,%edi
  mov    %eax,0x38(%rsp)
  lea    -0x3(%rbp),%eax
  cmp    $0x11d,%eax
  setbe  %dil
  call   <assert@plt>
  mov    0x30(%rsp),%edx
  mov    0x28(%rsp),%rcx
  lea    (%rcx,%rdx,4),%rsi
  mov    %rdx,0x48(%rsp)
  mov    (%rsi),%eax
  mov    %rsi,0x30(%rsp)
  test   %eax,%eax
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0x38(%rsp),%r11d
  mov    0x60(%rsp),%rax
  lea    (%rax,%r11,4),%r9
  mov    %r11,0x40(%rsp)
  mov    (%r9),%edx
  mov    %r9,0x38(%rsp)
  test   %edx,%edx
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    0x48(%rsp),%rdx
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    0x20(%rsp),%rax
  mov    0x30(%rsp),%rsi
  mov    (%rax,%rdx,4),%edi
  mov    (%rsi),%esi
  mov    %r13,%rdx
  call   <AddHuffmanBits@plt>
  mov    %ebp,%edi
  call   <GetLengthExtraBits@plt>
  mov    %ebp,%edi
  mov    %eax,0x30(%rsp)
  call   <GetLengthExtraBitsValue@plt>
  mov    0x30(%rsp),%esi
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    %eax,%edi
  mov    %r13,%rdx
  call   <AddBits@plt>
  mov    0x40(%rsp),%r11
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    0x38(%rsp),%r9
  mov    0x58(%rsp),%rax
  mov    %r13,%rdx
  mov    (%rax,%r11,4),%edi
  mov    (%r9),%esi
  call   <AddHuffmanBits@plt>
  mov    %r12d,%edi
  call   <GetDistExtraBits@plt>
  mov    %r12d,%edi
  mov    %eax,%ebp
  call   <GetDistExtraBitsValue@plt>
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %eax,%edi
  mov    %ebp,%esi
  call   <AddBits@plt>
  mov    0x50(%rsp),%r10
  add    %rbx,(%rsp)
  add    $0x1,%r10
  cmp    %r10,0x18(%rsp)
  jne    L5
L4:
  mov    0x68(%rsp),%rax
  test   %rax,%rax
  sete   %dil
  cmp    (%rsp),%rax
  sete   %al
  add    $0x78,%rsp
  or     %eax,%edi
  pop    %rbx
  pop    %rbp
  movzbl %dil,%edi
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10e0 <assert@plt>
  nopw   0x0(%rax,%rax,1)
L20:
  movq   $0x0,(%rsp)
  jmp    L4
```

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 = GetLengthSymbol(litlen);
      unsigned ds = GetDistSymbol(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(GetLengthExtraBitsValue(litlen), GetLengthExtraBits(litlen), bp, out, outsize);
      AddHuffmanBits(d_symbols[ds], d_lengths[ds], bp, out, outsize);
      AddBits(GetDistExtraBitsValue(dist), GetDistExtraBits(dist), bp, out, outsize);
      testlength += litlen;
    }
  }
  assert(expected_data_size == 0 || testlength == expected_data_size);
}
```