user: 请从给定的汇编指令推导出C源代码:

```asm
<write_AVS_header>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movss  %xmm0,-0x30(%rbp)
  movss  %xmm1,-0x34(%rbp)
  movss  %xmm2,-0x38(%rbp)
  movss  %xmm3,-0x3c(%rbp)
  movss  %xmm4,-0x40(%rbp)
  movss  %xmm5,-0x44(%rbp)
  mov    %edx,%eax
  mov    %al,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movw   $0xc0c,-0xa(%rbp)
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,-0x20(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L48
  mov    $0x0,%eax
  jmp    L28
L48:
  movss  -0x44(%rbp),%xmm4
  movss  -0x40(%rbp),%xmm3
  movss  -0x3c(%rbp),%xmm2
  movss  -0x38(%rbp),%xmm1
  movss  -0x34(%rbp),%xmm0
  mov    -0x30(%rbp),%eax
  movaps %xmm4,%xmm5
  movaps %xmm3,%xmm4
  movaps %xmm2,%xmm3
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  lea    D168(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movss  -0x30(%rbp),%xmm0
  addss  -0x3c(%rbp),%xmm0
  movss  D155(%rip),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movss  -0x34(%rbp),%xmm0
  addss  -0x40(%rbp),%xmm0
  movss  D155(%rip),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x38(%rbp),%xmm0
  addss  -0x44(%rbp),%xmm0
  movss  D155(%rip),%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x14(%rbp)
  movss  -0x3c(%rbp),%xmm0
  subss  -0x30(%rbp),%xmm0
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x25,%edx
  mov    $0x1,%esi
  lea    D179(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <ctime@plt>
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  lea    D124(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  pxor   %xmm2,%xmm2
  cvtss2sd -0x10(%rbp),%xmm2
  pxor   %xmm1,%xmm1
  cvtss2sd -0x14(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd -0x18(%rbp),%xmm0
  pxor   %xmm6,%xmm6
  cvtss2sd -0x1c(%rbp),%xmm6
  movq   %xmm6,%rcx
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rcx,%xmm0
  lea    D148(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x4,%eax
  call   <fprintf@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x34,%edx
  mov    $0x1,%esi
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  lea    D86(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  lea    D3(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  lea    D57(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x3b,%edx
  mov    $0x1,%esi
  lea    D126(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x36,%edx
  mov    $0x1,%esi
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmpb   $0x66,-0x48(%rbp)
  jne    L22
  lea    D115(%rip),%rax
  jmp    L43
L22:
  lea    D125(%rip),%rax
L43:
  mov    -0x28(%rbp),%rcx
  mov    %rax,%rdx
  lea    D12(%rip),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  pxor   %xmm1,%xmm1
  cvtss2sd -0x38(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd -0x34(%rbp),%xmm0
  pxor   %xmm7,%xmm7
  cvtss2sd -0x30(%rbp),%xmm7
  movq   %xmm7,%rdx
  mov    -0x28(%rbp),%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  lea    D20(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <fprintf@plt>
  pxor   %xmm1,%xmm1
  cvtss2sd -0x44(%rbp),%xmm1
  pxor   %xmm0,%xmm0
  cvtss2sd -0x40(%rbp),%xmm0
  pxor   %xmm5,%xmm5
  cvtss2sd -0x3c(%rbp),%xmm5
  movq   %xmm5,%rdx
  mov    -0x28(%rbp),%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  lea    D67(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <fprintf@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x3e,%edx
  mov    $0x1,%esi
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x28(%rbp),%rdx
  lea    -0xa(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    $0x1,%eax
L28:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D168
type_guessed: string
name: unpack_data
arguments: data_label: D155
type_guessed: f32
name: unpack_data
arguments: data_label: D179
type_guessed: string
name: unpack_data
arguments: data_label: D124
type_guessed: string
name: unpack_data
arguments: data_label: D148
type_guessed: string
name: unpack_data
arguments: data_label: D98
type_guessed: string
name: unpack_data
arguments: data_label: D86
type_guessed: string
name: unpack_data
arguments: data_label: D3
type_guessed: string
name: unpack_data
arguments: data_label: D57
type_guessed: string
name: unpack_data
arguments: data_label: D126
type_guessed: string
name: unpack_data
arguments: data_label: D45
type_guessed: string
name: unpack_data
arguments: data_label: D115
type_guessed: string
name: unpack_data
arguments: data_label: D125
type_guessed: string
name: unpack_data
arguments: data_label: D12
type_guessed: string
name: unpack_data
arguments: data_label: D20
type_guessed: string
name: unpack_data
arguments: data_label: D67
type_guessed: string
name: unpack_data
arguments: data_label: D53
type_guessed: string

tool: D168: writing an AVS header, min (%f, %f, %f): max (%f, %f, %f)


tool: D155: 2

tool: D179: # AVS field file -- generated by GEM


tool: D124: # creation date: %s

tool: D148: # Scalar field for cubic lattice: ON_GEOM_CENT resolved to (%f %f %f) %i %f 


tool: D98: ndim=3         # number of dimensions in the field 


tool: D86: dim1=%i # dimension of axis 1


tool: D3: dim2=%i # dimension of axis 2


tool: D57: dim3=%i # dimension of axis 3


tool: D126: nspace=3       # number of physical coordinates per point 


tool: D45: veclen=1       # number of data components per point 


tool: D115: float

tool: D125: double

tool: D12: data=%s    # data type (byte, integer, float, double) 


tool: D20: min_ext=%f %f %f


tool: D67: max_ext=%f %f %f


tool: D53: field=uniform  # field type (uniform, rectilinear, irregular)


assistant: ```c
int write_AVS_header(FILE *fp, int dim, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax, char gridtype) {
  const char FORM_FEEDS[2] = {12, 12};
  float center_x, center_y, center_z, spacing;
  time_t tclock = time(0);
  if (fp == NULL)
    return 0;
  printf("writing an AVS header, min (%f, %f, %f): max (%f, %f, %f)\n", xmin, ymin, zmin, xmax, ymax, zmax);
  center_x = (xmin + xmax) / 2.;
  center_y = (ymin + ymax) / 2.;
  center_z = (zmin + zmax) / 2.;
  spacing = (xmax - xmin) / (float)(dim - 1);
  fprintf(fp, "# AVS field file -- generated by GEM\n");
  fprintf(fp, "# creation date: %s", ctime(&tclock));
  fprintf(fp, "# Scalar field for cubic lattice: ON_GEOM_CENT resolved to (%f %f %f) %i %f \n", center_x, center_y, center_z, dim, spacing);
  fprintf(fp, "ndim=3         # number of dimensions in the field \n");
  fprintf(fp, "dim1=%i # dimension of axis 1\n", dim);
  fprintf(fp, "dim2=%i # dimension of axis 2\n", dim);
  fprintf(fp, "dim3=%i # dimension of axis 3\n", dim);
  fprintf(fp, "nspace=3       # number of physical coordinates per point \n");
  fprintf(fp, "veclen=1       # number of data components per point \n");
  fprintf(fp, "data=%s    # data type (byte, integer, float, double) \n", ((gridtype == 'f') ? "float" : "double"));
  fprintf(fp, "min_ext=%f %f %f\n", xmin, ymin, zmin);
  fprintf(fp, "max_ext=%f %f %f\n", xmax, ymax, zmax);
  fprintf(fp, "field=uniform  # field type (uniform, rectilinear, irregular)\n");
  fwrite(FORM_FEEDS, sizeof(char), 2, fp);
  return 1;
}
```