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

```asm
<read_tga_header>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%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)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    $0x12,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <read_bytes@plt>
  movzbl -0x14(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x13(%rbp),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  movzbl -0x12(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x11(%rbp),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L20
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L20
  mov    $0x1,%eax
  jmp    L16
L20:
  mov    $0x0,%eax
L16:
  mov    %eax,%edi
  call   <assert@plt>
  movzbl -0x10(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x30(%rbp)
  cmpl   $0x8,-0x30(%rbp)
  je     L98
  cmpl   $0x18,-0x30(%rbp)
  je     L98
  cmpl   $0x20,-0x30(%rbp)
  jne    L73
L98:
  mov    $0x1,%eax
  jmp    L67
L73:
  mov    $0x0,%eax
L67:
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x30(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  mov    %edx,(%rax)
  movzbl -0x20(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movzbl -0x1e(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x2,-0x28(%rbp)
  je     L34
  cmpl   $0x3,-0x28(%rbp)
  je     L34
  cmpl   $0xa,-0x28(%rbp)
  je     L34
  cmpl   $0xb,-0x28(%rbp)
  jne    L64
L34:
  mov    $0x1,%eax
  jmp    L104
L64:
  mov    $0x0,%eax
L104:
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0xa,-0x28(%rbp)
  je     L116
  cmpl   $0xb,-0x28(%rbp)
  jne    L131
L116:
  mov    $0x1,%edx
  jmp    L132
L131:
  mov    $0x0,%edx
L132:
  mov    -0x58(%rbp),%rax
  mov    %edx,(%rax)
  movzbl -0xf(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  and    $0x10,%eax
  mov    %eax,%edx
  mov    -0x60(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x24(%rbp),%eax
  and    $0x20,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L43
  call   <__stack_chk_fail@plt>
L43:
  leave
  ret
```

assistant: ```c
void read_tga_header(FILE *file, int *width, int *height, int *channels, int *is_rle, int *flip_h, int *flip_v) {
  unsigned char header[18];
  int depth, idlength, imgtype, imgdesc;
  read_bytes(file, header, 18);
  *width = header[12] | (header[13] << 8);
  *height = header[14] | (header[15] << 8);
  assert(*width > 0 && *height > 0);
  depth = header[16];
  assert(depth == 8 || depth == 24 || depth == 32);
  *channels = depth / 8;
  idlength = header[0];
  assert(idlength == 0);
  ((void)(idlength));
  imgtype = header[2];
  assert(imgtype == 2 || imgtype == 3 || imgtype == 10 || imgtype == 11);
  *is_rle = imgtype == 10 || imgtype == 11;
  imgdesc = header[17];
  *flip_h = imgdesc & 0x10;
  *flip_v = imgdesc & 0x20;
}
```