user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<write_vtkHeader>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L11
  mov    %rdi,%rbx
  mov    %esi,%r12d
  mov    %edx,%ebp
  mov    %rdi,%rcx
  mov    $0x1b,%edx
  mov    $0x1,%esi
  lea    D33(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x3f,%edx
  mov    $0x1,%esi
  lea    D5(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D46(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    %rbx,%rcx
  mov    $0x18,%edx
  mov    $0x1,%esi
  lea    D3(%rip),%rdi
  call   <fwrite@plt>
  add    $0x1,%ebp
  add    $0x1,%r12d
  mov    %ebp,%ecx
  mov    %r12d,%edx
  lea    D26(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %ebp,%edx
  imul   %r12d,%edx
  lea    D14(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbx,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
L24:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L11:
  mov    %rsp,%rbx
  lea    D1(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%rdx
  lea    D63(%rip),%rsi
  mov    $0x59,%edi
  call   <errhandler@plt>
  jmp    L24
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D33
datatype: string
name: unpack_data
arguments: data_label: D5
datatype: string
name: unpack_data
arguments: data_label: D46
datatype: string
name: unpack_data
arguments: data_label: D3
datatype: string
name: unpack_data
arguments: data_label: D26
datatype: string
name: unpack_data
arguments: data_label: D14
datatype: string
name: unpack_data
arguments: data_label: D1
datatype: string
name: unpack_data
arguments: data_label: D63
datatype: string

tool: D33: # vtk DataFile Version 2.0


tool: D5: generated by CFD-lab course output (written by Tobias Neckel) 


tool: D46: ASCII


tool: D3: DATASET STRUCTURED_GRID


tool: D26: DIMENSIONS  %i %i 1 


tool: D14: POINTS %i float


tool: D1: Null pointer in write_vtkHeader

tool: D63: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/grantathon/computational_fluid_dynamics/refs/heads/master/project/ns_sim_serial/visual.c

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