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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rsi,%r12
  cmp    $0x2,%edi
  je     L103
  cmp    $0xa,%edi
  je     L0
L19:
  lea    D262(%rip),%rdi
  call   <printf@plt>
  lea    D109(%rip),%rdi
  call   <printf@plt>
  lea    D45(%rip),%rdi
  call   <errorHandler@plt>
L165:
  lea    D210(%rip),%rsi
  lea    D125(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L119
L102:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x10(%rsp)
  cmp    $0x1,%r14d
  je     L164
  movq   %rbp,%xmm1
  subsd  0x18(%rsp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %r14d,%xmm0
  subsd  D203(%rip),%xmm0
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
L164:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x28(%rsp)
  mov    0x24(%rsp),%eax
  cmp    $0x1,%eax
  je     L121
  movq   %rbx,%xmm1
  subsd  0x30(%rsp),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  D203(%rip),%xmm0
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x28(%rsp)
L121:
  mov    0x44(%rsp),%ebx
  cmp    $0x1,%ebx
  je     L14
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movq   %r13,%xmm2
  subsd  0x48(%rsp),%xmm2
  movapd %xmm1,%xmm0
  subsd  D203(%rip),%xmm0
  divsd  %xmm0,%xmm2
  movsd  %xmm2,0x38(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x24(%rsp),%xmm0
  mov    %r14d,%edx
  lea    D144(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x2,%eax
  call   <fprintf@plt>
  cvttsd2si 0x10(%rsp),%edx
  movsd  0x38(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm0
  lea    D5(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x2,%eax
  call   <fprintf@plt>
  test   %ebx,%ebx
  jle    L41
L53:
  mov    $0x1,%ebp
  movl   $0x0,0x40(%rsp)
  lea    D141(%rip),%r15
  mov    %r12,%r13
L83:
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x40(%rsp),%xmm0
  mulsd  0x38(%rsp),%xmm0
  addsd  0x48(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  cmpl   $0x0,0x24(%rsp)
  jle    L64
  mov    $0x0,%r12d
L80:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  0x28(%rsp),%xmm0
  addsd  0x30(%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  test   %r14d,%r14d
  jle    L5
  mov    $0x0,%ebx
L34:
  mov    %ebp,0x20(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  0x10(%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  lea    (%rbx,%rbp,1),%edx
  movsd  0x8(%rsp),%xmm2
  movsd  (%rsp),%xmm1
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    $0x3,%eax
  call   <fprintf@plt>
  add    $0x1,%ebx
  cmp    %ebx,%r14d
  jne    L34
  mov    0x20(%rsp),%ebp
  add    %ebx,%ebp
L5:
  add    $0x1,%r12d
  cmp    %r12d,0x24(%rsp)
  jne    L80
L64:
  addl   $0x1,0x40(%rsp)
  mov    0x40(%rsp),%eax
  cmp    %eax,0x44(%rsp)
  jg     L83
  mov    %r13,%r12
L41:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  mov    0x8(%rsi),%rdi
  lea    D252(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L19
  lea    D160(%rip),%rdi
  call   <printf@plt>
  lea    D23(%rip),%rdi
  call   <printf@plt>
  lea    D24(%rip),%rdi
  call   <printf@plt>
  lea    D281(%rip),%rdi
  call   <printf@plt>
  lea    D218(%rip),%rdi
  call   <printf@plt>
  lea    D94(%rip),%rdi
  call   <printf@plt>
  lea    D276(%rip),%rdi
  call   <printf@plt>
  lea    D192(%rip),%rdi
  call   <printf@plt>
  lea    D164(%rip),%rdi
  call   <printf@plt>
  lea    D139(%rip),%rdi
  call   <printf@plt>
  lea    D286(%rip),%rdi
  call   <printf@plt>
  lea    D70(%rip),%rdi
  call   <printf@plt>
  lea    D154(%rip),%rdi
  call   <printf@plt>
  lea    D219(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L165
L0:
  mov    0x8(%rsi),%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  mov    0x10(%r12),%rdi
  call   <atoi@plt>
  mov    %eax,0x24(%rsp)
  mov    0x18(%r12),%rdi
  call   <atoi@plt>
  mov    %eax,0x44(%rsp)
  mov    0x20(%r12),%rdi
  call   <atof@plt>
  movsd  %xmm0,0x18(%rsp)
  mov    0x28(%r12),%rdi
  call   <atof@plt>
  movq   %xmm0,%rbp
  mov    0x30(%r12),%rdi
  call   <atof@plt>
  movsd  %xmm0,0x30(%rsp)
  mov    0x38(%r12),%rdi
  call   <atof@plt>
  movq   %xmm0,%rbx
  mov    0x40(%r12),%rdi
  call   <atof@plt>
  movsd  %xmm0,0x48(%rsp)
  mov    0x48(%r12),%rdi
  call   <atof@plt>
  movq   %xmm0,%r13
  jmp    L165
L119:
  lea    D168(%rip),%rdi
  call   <errorHandler@plt>
  jmp    L102
L14:
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x24(%rsp),%xmm0
  movsd  D203(%rip),%xmm1
  mov    %r14d,%edx
  lea    D144(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x2,%eax
  call   <fprintf@plt>
  cvttsd2si 0x10(%rsp),%edx
  pxor   %xmm1,%xmm1
  movsd  0x28(%rsp),%xmm0
  lea    D5(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x2,%eax
  call   <fprintf@plt>
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x38(%rsp)
  jmp    L53
```

tool_calls: name: parse_data
arguments: data_label: D262
type: string
name: parse_data
arguments: data_label: D109
type: string
name: parse_data
arguments: data_label: D45
type: string
name: parse_data
arguments: data_label: D210
type: string
name: parse_data
arguments: data_label: D125
type: string
name: parse_data
arguments: data_label: D203
type: f64
name: parse_data
arguments: data_label: D144
type: string
name: parse_data
arguments: data_label: D5
type: string
name: parse_data
arguments: data_label: D141
type: string
name: parse_data
arguments: data_label: D252
type: string
name: parse_data
arguments: data_label: D160
type: string
name: parse_data
arguments: data_label: D23
type: string
name: parse_data
arguments: data_label: D24
type: string
name: parse_data
arguments: data_label: D281
type: string
name: parse_data
arguments: data_label: D218
type: string
name: parse_data
arguments: data_label: D94
type: string
name: parse_data
arguments: data_label: D276
type: string
name: parse_data
arguments: data_label: D192
type: string
name: parse_data
arguments: data_label: D164
type: string
name: parse_data
arguments: data_label: D139
type: string
name: parse_data
arguments: data_label: D286
type: string
name: parse_data
arguments: data_label: D70
type: string
name: parse_data
arguments: data_label: D154
type: string
name: parse_data
arguments: data_label: D219
type: string
name: parse_data
arguments: data_label: D168
type: string

tool: D262: 

Error: Incorrect syntax.



tool: D109: Try: meshgen-vtk nx ny nz xmin xmax ymin ymax zmin zmax


tool: D45: or type 'meshgen-vtk -h' for help.


tool: D210: w

tool: D125: mesh.bem

tool: D203: 1

tool: D144: %d	%d	%d


tool: D5: %le	%le	%le


tool: D141: %d	%le	%le	%le


tool: D252: -h

tool: D160: 

SYNTAX:
meshgen-vtk nx ny nz xmin xmax ymin ymax 

tool: D23: zmin zmax



tool: D24: DESCRIPTION


tool: D281: Generates a regular 3d cartesian grid with limits 

tool: D218: [(xmin,xmax),(ymin,ymax),
(zmin,zmax)] and saves the 

tool: D94: coordinates to the file 'mesh.dat'. The first
two lines 

tool: D276: of the file contain the total number of points and the 

tool: D192: interval
between two consecutive points for each of the 

tool: D164: three spatial directions.
Line numbers are always saved 

tool: D139: to the output file.



tool: D286: EXAMPLE


tool: D70: meshgen-vtk 10 10 20 -50 50 -10 10 -5 5



tool: D154: Produces a mesh in the volume [(-50,50):(-10,10):(-5,5)] 

tool: D219: with a total
of 2000 points (10x10x20).



tool: D168: Error: Can't create output file mesh.dat

assistant: ```c
int main(int argc, char *argv[]) {
  FILE *fout;
  int i, j, k, nx, ny, nz, count;
  double dx, dy, dz, r, x, xmin, xmax, y, ymin, ymax, z, zmin, zmax;
  if (argc == 2 && strcmp(argv[1], "-h") == 0) {
    printf("\n\nSYNTAX:\nmeshgen-vtk nx ny nz xmin xmax ymin ymax ");
    printf("zmin zmax\n\n");
    printf("DESCRIPTION\n");
    printf("Generates a regular 3d cartesian grid with limits ");
    printf("[(xmin,xmax),(ymin,ymax),\n(zmin,zmax)] and saves the ");
    printf("coordinates to the file 'mesh.dat'. The first\ntwo lines ");
    printf("of the file contain the total number of points and the ");
    printf("interval\nbetween two consecutive points for each of the ");
    printf("three spatial directions.\nLine numbers are always saved ");
    printf("to the output file.\n\n");
    printf("EXAMPLE\n");
    printf("meshgen-vtk 10 10 20 -50 50 -10 10 -5 5\n\n");
    printf("Produces a mesh in the volume [(-50,50):(-10,10):(-5,5)] ");
    printf("with a total\nof 2000 points (10x10x20).\n\n");
    exit(0);
  } else if (argc != 10) {
    printf("\n\nError: Incorrect syntax.\n\n");
    printf("Try: meshgen-vtk nx ny nz xmin xmax ymin ymax zmin zmax\n");
    errorHandler("or type 'meshgen-vtk -h' for help.\n");
  } else {
    nx = atoi(argv[1]);
    ny = atoi(argv[2]);
    nz = atoi(argv[3]);
    xmin = atof(argv[4]);
    xmax = atof(argv[5]);
    ymin = atof(argv[6]);
    ymax = atof(argv[7]);
    zmin = atof(argv[8]);
    zmax = atof(argv[9]);
  }
  if ((fout = fopen("mesh.bem", "w")) == NULL)
    errorHandler("Error: Can't create output file mesh.dat");
  if (nx == 1)
    dx = 0.0;
  else
    dx = (xmax - xmin) / ((double)nx - 1.0);
  if (ny == 1)
    dy = 0.0;
  else
    dy = (ymax - ymin) / ((double)ny - 1.0);
  if (nz == 1)
    dz = 0.0;
  else
    dz = (zmax - zmin) / ((double)nz - 1.0);
  fprintf(fout, "%d\t%d\t%d\n", nx, ny, nz);
  fprintf(fout, "%le\t%le\t%le\n", dx, dy, dz);
  count = 1;
  for (k = 0; k < nz; k++) {
    z = zmin + k * dz;
    for (j = 0; j < ny; j++) {
      y = ymin + j * dy;
      for (i = 0; i < nx; i++) {
        x = xmin + i * dx;
        fprintf(fout, "%d\t%le\t%le\t%le\n", count, x, y, z);
        count++;
      }
    }
  }
  fclose(fout);
  return 0;
}
```