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

```asm
<zlib_inflate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x70,%rsp
  mov    %rdi,-0x2068(%rbp)
  mov    %rsi,-0x2070(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D17(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x2020(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x2028(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x2030(%rbp)
  movq   $0x0,-0x2050(%rbp)
  mov    D17(%rip),%rax
  mov    (%rax),%rax
  mov    %rax,-0x2048(%rbp)
  lea    -0x2050(%rbp),%rax
  mov    %rax,%rdi
  call   <inflateInit@plt>
  mov    %eax,-0x2058(%rbp)
  mov    D87(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2058(%rbp)
  je     L160
  mov    -0x2058(%rbp),%eax
  jmp    L74
L160:
  mov    -0x2068(%rbp),%rdx
  lea    -0x2010(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1000,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %rax,-0x2050(%rbp)
  mov    -0x2068(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L14
  lea    -0x2050(%rbp),%rax
  mov    %rax,%rdi
  call   <inflateEnd@plt>
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  jmp    L74
L14:
  mov    -0x2050(%rbp),%rax
  test   %rax,%rax
  je     L63
  lea    -0x2010(%rbp),%rax
  mov    %rax,-0x2048(%rbp)
L27:
  movl   $0x1000,-0x2040(%rbp)
  lea    -0x1010(%rbp),%rax
  mov    %rax,-0x2038(%rbp)
  mov    D75(%rip),%rax
  mov    (%rax),%edx
  lea    -0x2050(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <inflate@plt>
  mov    %eax,-0x2058(%rbp)
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2058(%rbp)
  jne    L116
  mov    -0x2058(%rbp),%eax
  jmp    L74
L116:
  cmpl   $0x80,-0x2058(%rbp)
  je     L98
  cmpl   $0x80,-0x2058(%rbp)
  jl     L49
  mov    -0x2058(%rbp),%eax
  sub    $0x81,%eax
  cmp    $0x1,%eax
  ja     L49
  jmp    L2
L98:
  movl   $0x82,-0x2058(%rbp)
L2:
  lea    -0x2050(%rbp),%rax
  mov    %rax,%rdi
  call   <inflateEnd@plt>
  mov    -0x2058(%rbp),%eax
  jmp    L74
L49:
  mov    -0x2040(%rbp),%edx
  mov    $0x1000,%eax
  sub    %edx,%eax
  mov    %eax,-0x2054(%rbp)
  mov    -0x2070(%rbp),%rcx
  mov    -0x2054(%rbp),%edx
  lea    -0x1010(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    %eax,-0x2054(%rbp)
  jne    L51
  mov    -0x2070(%rbp),%rax
  mov    %rax,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  je     L164
L51:
  lea    -0x2050(%rbp),%rax
  mov    %rax,%rdi
  call   <inflateEnd@plt>
  mov    D7(%rip),%rax
  mov    (%rax),%eax
  jmp    L74
L164:
  mov    -0x2040(%rbp),%eax
  test   %eax,%eax
  je     L27
  mov    D40(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2058(%rbp)
  jne    L160
  jmp    L104
L63:
  nop
L104:
  lea    -0x2050(%rbp),%rax
  mov    %rax,%rdi
  call   <inflateEnd@plt>
  mov    D40(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x2058(%rbp)
  je     L143
  mov    $0x82,%eax
  jmp    L74
L143:
  mov    D87(%rip),%rax
  mov    (%rax),%eax
L74:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L70
  call   <__stack_chk_fail@plt>
L70:
  leave
  ret
```

assistant: ```c
int zlib_inflate(FILE *fin, FILE *fout) {
  z_stream strm;
  unsigned char bin[0x1000];
  unsigned char bout[0x1000];
  int nleft, result;
  strm.zalloc = Z_NULL;
  strm.zfree = Z_NULL;
  strm.opaque = Z_NULL;
  strm.avail_in = 0;
  strm.next_in = Z_NULL;
  result = inflateInit(&strm);
  if (result != Z_OK)
    return result;
  do {
    strm.avail_in = fread(bin, 1, 0x1000, fin);
    if (ferror(fin)) {
      inflateEnd(&strm);
      return Z_ERRNO;
    }
    if (strm.avail_in == 0)
      break;
    strm.next_in = bin;
    do {
      strm.avail_out = 0x1000;
      strm.next_out = bout;
      result = inflate(&strm, Z_NO_FLUSH);
      if (result == Z_STREAM_ERROR)
        return result;
      switch (result) {
      case Z_NEED_DICT:
        result = Z_DATA_ERROR;
      case Z_DATA_ERROR:
      case Z_MEM_ERROR:
        inflateEnd(&strm);
        return result;
        break;
      }
      nleft = 0x1000 - strm.avail_out;
      if ((fwrite(bout, 1, nleft, fout) != nleft) || ferror(fout)) {
        inflateEnd(&strm);
        return Z_ERRNO;
      }
    } while (strm.avail_out == 0);
  } while (result != Z_STREAM_END);
  inflateEnd(&strm);
  if (result != Z_STREAM_END)
    return Z_DATA_ERROR;
  return Z_OK;
}
```