user: Converte this assembly snippet into its equivalent C code:

```asm
<write_vtkHeader>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    %edx,-0x70(%rbp)
  mov    %ecx,-0x74(%rbp)
  movsd  %xmm0,-0x80(%rbp)
  movsd  %xmm1,-0x88(%rbp)
  movsd  %xmm2,-0x90(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x68(%rbp)
  jne    L29
  lea    -0x60(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdx
  lea    D8(%rip),%rax
  mov    %rax,%rsi
  mov    $0x79,%edi
  call   <errhandler@plt>
  jmp    L20
L29:
  mov    -0x68(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x1b,%edx
  mov    $0x1,%esi
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x24,%edx
  mov    $0x1,%esi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x18,%edx
  mov    $0x1,%esi
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x74(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x70(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x6c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    %esi,%r8d
  lea    D36(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x6c(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x70(%rbp),%eax
  add    $0x1,%eax
  imul   %edx,%eax
  mov    -0x74(%rbp),%edx
  add    $0x1,%edx
  imul   %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D62(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
L20:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D7
data_type: string
name: retrieve_data
arguments: data_label: D8
data_type: string
name: retrieve_data
arguments: data_label: D46
data_type: string
name: retrieve_data
arguments: data_label: D35
data_type: string
name: retrieve_data
arguments: data_label: D21
data_type: string
name: retrieve_data
arguments: data_label: D79
data_type: string
name: retrieve_data
arguments: data_label: D36
data_type: string
name: retrieve_data
arguments: data_label: D62
data_type: string

tool: D7: Null pointer in write_vtkHeader

tool: D8: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProjectPresentation/visual.c

tool: D46: # vtk DataFile Version 2.0


tool: D35: generated by CFD-lab course output 


tool: D21: ASCII


tool: D79: DATASET STRUCTURED_GRID


tool: D36: DIMENSIONS  %i %i %i 


tool: D62: POINTS %i float


assistant: ```c
void write_vtkHeader(FILE *fp, int imax, int jmax, int kmax, double dx, double dy, double dz) {
  if (fp == NULL) {
    char szBuff[80];
    sprintf(szBuff, "Null pointer in write_vtkHeader");
    errhandler(121, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/EvaBr/CFD-Lab/refs/heads/master/Backup/FinalProjectPresentation/visual.c", szBuff);
    return;
  }
  fprintf(fp, "# vtk DataFile Version 2.0\n");
  fprintf(fp, "generated by CFD-lab course output \n");
  fprintf(fp, "ASCII\n");
  fprintf(fp, "\n");
  fprintf(fp, "DATASET STRUCTURED_GRID\n");
  fprintf(fp, "DIMENSIONS  %i %i %i \n", imax + 1, jmax + 1, kmax + 1);
  fprintf(fp, "POINTS %i float\n", (imax + 1) * (jmax + 1) * (kmax + 1));
  fprintf(fp, "\n");
}
```