user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_doc_normal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  movl   $0x0,-0x3c(%rbp)
  mov    D7(%rip),%rax
  mov    (%rax),%ebx
  movslq %ebx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  movslq %ebx,%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  movslq %ebx,%rax
  mov    %rax,%r8
  mov    $0x0,%r9d
  movslq %ebx,%rax
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L38:
  cmp    %rdx,%rsp
  je     L10
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L38
L10:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L89
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L89:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x28(%rbp)
  movq   $0x0,-0x38(%rbp)
  jmp    L58
L92:
  mov    -0x48(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    %rax,-0x20(%rbp)
  je     L143
  mov    -0x50(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <_tar_error@plt>
  mov    %eax,-0x3c(%rbp)
  jmp    L63
L143:
  mov    -0x20(%rbp),%rax
  add    %rax,-0x38(%rbp)
L58:
  mov    -0x58(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rcx
  mov    %ebx,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L92
L63:
  cmpl   $0x0,-0x3c(%rbp)
  jne    L127
  cmpq   $0x0,-0x20(%rbp)
  jne    L127
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %eax,%eax
  jne    L127
  mov    -0x60(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <_tar_error@plt>
  jmp    L108
L127:
  mov    -0x38(%rbp),%rax
  and    $0x1ff,%eax
  mov    %rax,%rdx
  mov    $0x200,%eax
  sub    %rdx,%rax
  mov    %rax,-0x38(%rbp)
  jmp    L130
L94:
  subq   $0x1,-0x38(%rbp)
L130:
  cmpq   $0x0,-0x38(%rbp)
  je     L68
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <fputc@plt>
  test   %al,%al
  je     L94
L68:
  cmpq   $0x0,-0x38(%rbp)
  je     L22
  mov    -0x50(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <_tar_error@plt>
  jmp    L108
L22:
  mov    $0x0,%eax
L108:
  mov    %r12,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L138
  call   <__stack_chk_fail@plt>
L138:
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
int _doc_normal(FILE *fp, char const *archive, FILE *fp2, char const *filename) {
  int ret = 0;
  size_t read;
  size_t cnt;
  char buf[BUFSIZ];
  for (cnt = 0; (read = fread(buf, sizeof(*buf), sizeof(buf), fp2)) != 0; cnt += read)
    if (fwrite(buf, sizeof(*buf), read, fp) != read) {
      ret = _tar_error(archive, 1);
      break;
    }
  if (ret == 0 && read == 0 && !feof(fp2))
    return _tar_error(filename, 1);
  for (cnt = 512 - (cnt % 512); cnt > 0 && fputc('\0', fp) == '\0'; cnt--)
    ;
  return (cnt == 0) ? 0 : _tar_error(archive, 1);
}
```