user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  lea    -0x3c000(%rsp),%r11
L70:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L70
  sub    $0x48,%rsp
  mov    %edi,-0x3c044(%rbp)
  mov    %rsi,-0x3c050(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x1b9,-0x3c018(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x3c008(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x3c000(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x3bff8(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x3bff0(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x3bfe8(%rbp)
  cmpl   $0x2,-0x3c044(%rbp)
  jg     L135
  mov    -0x3c050(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D138(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L164
L135:
  mov    -0x3c050(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x3c014(%rbp)
  mov    -0x3c050(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x3c010(%rbp)
  cmpl   $0x0,-0x3c014(%rbp)
  js     L171
  cmpl   $0x0,-0x3c010(%rbp)
  jns    L142
L171:
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L164
L142:
  cmpl   $0x14,-0x3c014(%rbp)
  jg     L263
  cmpl   $0x14,-0x3c010(%rbp)
  jle    L126
L263:
  mov    $0x14,%esi
  lea    D117(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L126:
  mov    -0x3c010(%rbp),%edx
  mov    -0x3c014(%rbp),%eax
  mov    %edx,%r8d
  mov    %eax,%ecx
  mov    $0x15,%edx
  mov    $0x15,%esi
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D189(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xa8,%edi
  call   <malloc@plt>
  mov    %rax,-0x3bfe0(%rbp)
  mov    -0x3c018(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x3bfd8(%rbp)
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x3c040(%rbp)
  jmp    L173
L283:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x3c040(%rbp),%xmm1
  movsd  D147(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x3c040(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x3bfe0(%rbp),%rax
  add    %rdx,%rax
  movsd  D87(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x3c040(%rbp)
L173:
  cmpl   $0x14,-0x3c040(%rbp)
  jle    L283
  movl   $0x0,-0x3c03c(%rbp)
  jmp    L248
L12:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x3c03c(%rbp),%xmm1
  movsd  D175(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D87(%rip),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x3c03c(%rbp),%eax
  cltq
  movsd  %xmm0,-0x3bfb0(%rbp,%rax,8)
  addl   $0x1,-0x3c03c(%rbp)
L248:
  cmpl   $0x64,-0x3c03c(%rbp)
  jle    L12
  movl   $0x0,-0x3c038(%rbp)
  jmp    L151
L8:
  movl   $0x0,-0x3c034(%rbp)
  jmp    L83
L168:
  mov    -0x3c034(%rbp),%edx
  mov    -0x3c038(%rbp),%eax
  mov    $0x15,%ecx
  mov    $0x15,%esi
  mov    %eax,%edi
  call   <index_2D_to_1D@plt>
  mov    %eax,-0x3c00c(%rbp)
  mov    -0x3c034(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x3bfe0(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x3c038(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x3bfe0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x3c00c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x3bfd8(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <xyn@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  addl   $0x1,-0x3c034(%rbp)
L83:
  cmpl   $0x14,-0x3c034(%rbp)
  jle    L168
  addl   $0x1,-0x3c038(%rbp)
L151:
  cmpl   $0x14,-0x3c038(%rbp)
  jle    L8
  movl   $0x0,-0x3c030(%rbp)
  jmp    L244
L127:
  movl   $0x0,-0x3c02c(%rbp)
  jmp    L119
L239:
  mov    -0x3c02c(%rbp),%edx
  mov    -0x3c030(%rbp),%eax
  mov    $0x65,%ecx
  mov    $0x65,%esi
  mov    %eax,%edi
  call   <index_2D_to_1D@plt>
  mov    %eax,-0x3c00c(%rbp)
  mov    -0x3c02c(%rbp),%eax
  cltq
  movsd  -0x3bfb0(%rbp,%rax,8),%xmm0
  mov    -0x3c030(%rbp),%eax
  cltq
  mov    -0x3bfb0(%rbp,%rax,8),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <xyn@plt>
  movq   %xmm0,%rax
  mov    -0x3c00c(%rbp),%edx
  movslq %edx,%rdx
  mov    %rax,-0x3bc80(%rbp,%rdx,8)
  addl   $0x1,-0x3c02c(%rbp)
L119:
  cmpl   $0x64,-0x3c02c(%rbp)
  jle    L239
  addl   $0x1,-0x3c030(%rbp)
L244:
  cmpl   $0x64,-0x3c030(%rbp)
  jle    L127
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x3c028(%rbp)
  jmp    L32
L113:
  movl   $0x0,-0x3c024(%rbp)
  jmp    L274
L225:
  mov    -0x3c024(%rbp),%edx
  mov    -0x3c028(%rbp),%eax
  mov    $0x65,%ecx
  mov    $0x65,%esi
  mov    %eax,%edi
  call   <index_2D_to_1D@plt>
  mov    %eax,-0x3c00c(%rbp)
  mov    -0x3c024(%rbp),%eax
  cltq
  movsd  -0x3bfb0(%rbp,%rax,8),%xmm0
  mov    -0x3c028(%rbp),%eax
  cltq
  mov    -0x3bfb0(%rbp,%rax,8),%rax
  mov    -0x3bfe0(%rbp),%rcx
  mov    -0x3bfe0(%rbp),%rdx
  mov    -0x3c010(%rbp),%esi
  mov    -0x3c014(%rbp),%edi
  sub    $0x8,%rsp
  push   -0x3bfd8(%rbp)
  mov    $0x15,%r9d
  mov    %rcx,%r8
  mov    $0x15,%ecx
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <lagrange_interp_2Dfo@plt>
  add    $0x10,%rsp
  movq   %xmm0,%rax
  mov    -0x3c00c(%rbp),%edx
  movslq %edx,%rdx
  mov    %rax,-0x13ee0(%rbp,%rdx,8)
  mov    -0x3c024(%rbp),%eax
  cltq
  movsd  -0x3bfb0(%rbp,%rax,8),%xmm0
  mov    -0x3c028(%rbp),%eax
  cltq
  mov    -0x3bfb0(%rbp,%rax,8),%rax
  mov    -0x3bfd8(%rbp),%rcx
  mov    -0x3bfe0(%rbp),%rdx
  mov    -0x3bfe0(%rbp),%rdi
  mov    %rcx,%r8
  mov    $0x15,%ecx
  mov    $0x15,%esi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <lagrange_interp_2D@plt>
  movq   %xmm0,%rax
  mov    -0x3c00c(%rbp),%edx
  movslq %edx,%rdx
  mov    %rax,-0x27db0(%rbp,%rdx,8)
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x13ee0(%rbp,%rax,8),%xmm0
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x3bc80(%rbp,%rax,8),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x3bfc0(%rbp)
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x27db0(%rbp,%rax,8),%xmm0
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x3bc80(%rbp,%rax,8),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x3bfb8(%rbp)
  movsd  -0x3bfc0(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0x3c008(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x3c008(%rbp)
  movsd  -0x3bfb8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0x3c000(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x3c000(%rbp)
  movsd  -0x3bff8(%rbp),%xmm1
  movsd  D87(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x3bff8(%rbp)
  movsd  -0x3bfe8(%rbp),%xmm0
  mov    -0x3bfc0(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmax@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x3bfe8(%rbp)
  movsd  -0x3bff0(%rbp),%xmm0
  mov    -0x3bfb8(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <fmax@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x3bff0(%rbp)
  addl   $0x1,-0x3c024(%rbp)
L274:
  cmpl   $0x64,-0x3c024(%rbp)
  jle    L225
  addl   $0x1,-0x3c028(%rbp)
L32:
  cmpl   $0x64,-0x3c028(%rbp)
  jle    L113
  movsd  -0x3c008(%rbp),%xmm0
  divsd  -0x3bff8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x3c008(%rbp)
  movsd  -0x3c000(%rbp),%xmm0
  divsd  -0x3bff8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x3c000(%rbp)
  movsd  -0x3c008(%rbp),%xmm2
  movsd  -0x3bfe8(%rbp),%xmm1
  movsd  -0x3c000(%rbp),%xmm0
  mov    -0x3bff0(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D84(%rip),%rax
  mov    %rax,%rdi
  mov    $0x4,%eax
  call   <printf@plt>
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D10(%rip),%rax
  mov    %rax,%rsi
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x3bfd0(%rbp)
  lea    D10(%rip),%rax
  mov    %rax,%rsi
  lea    D167(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x3bfc8(%rbp)
  mov    -0x3bfd0(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x3bfc8(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x3bfd0(%rbp),%rax
  mov    $0x65,%edx
  lea    D98(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x3bfc8(%rbp),%rax
  mov    $0x65,%edx
  lea    D98(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0x3c020(%rbp)
  jmp    L209
L102:
  movl   $0x0,-0x3c01c(%rbp)
  jmp    L5
L80:
  mov    -0x3c01c(%rbp),%edx
  mov    -0x3c020(%rbp),%eax
  mov    $0x65,%ecx
  mov    $0x65,%esi
  mov    %eax,%edi
  call   <index_2D_to_1D@plt>
  mov    %eax,-0x3c00c(%rbp)
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x13ee0(%rbp,%rax,8),%xmm2
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x3bc80(%rbp,%rax,8),%xmm1
  mov    -0x3c01c(%rbp),%eax
  cltq
  movsd  -0x3bfb0(%rbp,%rax,8),%xmm0
  mov    -0x3c020(%rbp),%eax
  cltq
  mov    -0x3bfb0(%rbp,%rax,8),%rsi
  mov    -0x3c01c(%rbp),%ecx
  mov    -0x3c020(%rbp),%edx
  mov    -0x3bfc8(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rsi,%xmm0
  lea    D32(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x4,%eax
  call   <fprintf@plt>
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x27db0(%rbp,%rax,8),%xmm2
  mov    -0x3c00c(%rbp),%eax
  cltq
  movsd  -0x3bc80(%rbp,%rax,8),%xmm1
  mov    -0x3c01c(%rbp),%eax
  cltq
  movsd  -0x3bfb0(%rbp,%rax,8),%xmm0
  mov    -0x3c020(%rbp),%eax
  cltq
  mov    -0x3bfb0(%rbp,%rax,8),%rsi
  mov    -0x3c01c(%rbp),%ecx
  mov    -0x3c020(%rbp),%edx
  mov    -0x3bfd0(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rsi,%xmm0
  lea    D32(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x4,%eax
  call   <fprintf@plt>
  addl   $0x1,-0x3c01c(%rbp)
L5:
  cmpl   $0x64,-0x3c01c(%rbp)
  jle    L80
  addl   $0x1,-0x3c020(%rbp)
L209:
  cmpl   $0x64,-0x3c020(%rbp)
  jle    L102
  mov    -0x3bfc8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x3bfd0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x3bfe0(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x3bfd8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L164:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L275
  call   <__stack_chk_fail@plt>
L275:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D138
data_type: string
name: read_data
arguments: tag: D12
data_type: string
name: read_data
arguments: tag: D117
data_type: string
name: read_data
arguments: tag: D119
data_type: string
name: read_data
arguments: tag: D189
data_type: string
name: read_data
arguments: tag: D49
data_type: string
name: read_data
arguments: tag: D147
data_type: byte[8]
name: read_data
arguments: tag: D87
data_type: f64
name: read_data
arguments: tag: D175
data_type: byte[8]
name: read_data
arguments: tag: D66
data_type: string
name: read_data
arguments: tag: D84
data_type: string
name: read_data
arguments: tag: D29
data_type: string
name: read_data
arguments: tag: D10
data_type: string
name: read_data
arguments: tag: D136
data_type: string
name: read_data
arguments: tag: D167
data_type: string
name: read_data
arguments: tag: D18
data_type: string
name: read_data
arguments: tag: D98
data_type: string
name: read_data
arguments: tag: D32
data_type: string

tool: D138: usage %s order_x order_y


tool: D12: Interpolation order must be at least 0

tool: D117: Interpolation order can be no greater than %d


tool: D119: We compare to the analytic function
x^4 - y^4 + 0.5*(x*y)**4
on the domain [-1,1]x[-1,1].
For FULL Lagrange polynomials of order:
	%d in x
	%d in y
and FIXED ORDER Lagrange polynomials of order:
	%d in x
	%d in y


tool: D189: Preparing grids.

tool: D49: Writing to grids.

tool: {"D147": [0x9a,0x99,0x99,0x99,0x99,0x99,0xb9,0x3f]}

tool: D87: 1

tool: {"D175": [0x7b,0x14,0xae,0x47,0xe1,0x7a,0x94,0x3f]}

tool: D66: Interpolating.

tool: D84: 	Max error = %lf
	L2 error = %lf
	Max error fixed order %lf
	L2 error fixed order %lf


tool: D29: Creating output files.

tool: D10: w

tool: D136: test_full.out

tool: D167: test_fo.out

tool: D18: #i	j	x	y	z	z_interp


tool: D98: #NX = NY = %d


tool: D32: %d	%d	%lf	%lf	%lf	%lf


assistant: ```c
int main(int argc, char *argv[]) {
  int iflat;
  int nz_coarse = 21 * 21;
  double *x_coarse;
  double *z_coarse;
  double x_fine[101];
  double z_fine[101 * 101];
  double z_interp_full[101 * 101];
  double z_interp_fo[101 * 101];
  double error_fo, error_full;
  double l2_error_fo = 0.;
  double l2_error_full = 0.;
  double l2_error_denom = 0.;
  double max_error_full = 0.;
  double max_error_fo = 0.;
  if (argc < 3) {
    printf("usage %s order_x order_y\n", argv[0]);
    return 1;
  }
  int order_x = atoi(argv[1]);
  int order_y = atoi(argv[2]);
  if (order_x < 0 || order_y < 0) {
    printf("Interpolation order must be at least 0\n");
    return 1;
  }
  if (order_x >= 21 || order_y >= 21) {
    printf("Interpolation order can be no greater than %d\n", 21 - 1);
  }
  printf("We compare to the analytic function\n"
         "x^4 - y^4 + 0.5*(x*y)**4\n"
         "on the domain [-1,1]x[-1,1].\n"
         "For FULL Lagrange polynomials of order:\n"
         "\t%d in x\n\t%d in y\n"
         "and FIXED ORDER Lagrange polynomials of order:\n"
         "\t%d in x\n\t%d in y\n",
         21, 21, order_x, order_y);
  printf("Preparing grids.\n");
  x_coarse = (double *)malloc(sizeof(double) * 21);
  z_coarse = (double *)malloc(sizeof(double) * nz_coarse);
  printf("Writing to grids.\n");
  for (int i = 0; i < 21; i++) {
    x_coarse[i] = -1.0 + (1.0 - -1.0) / (21 - 1) * i;
  }
  for (int i = 0; i < 101; i++) {
    x_fine[i] = -1.0 + (1.0 - -1.0) / (101 - 1) * i;
  }
  for (int i = 0; i < 21; i++) {
    for (int j = 0; j < 21; j++) {
      iflat = index_2D_to_1D(i, 21, j, 21);
      z_coarse[iflat] = xyn(x_coarse[i], x_coarse[j]);
    }
  }
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) {
      iflat = index_2D_to_1D(i, 101, j, 101);
      z_fine[iflat] = xyn(x_fine[i], x_fine[j]);
    }
  }
  printf("Interpolating.\n");
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) {
      iflat = index_2D_to_1D(i, 101, j, 101);
      z_interp_fo[iflat] = lagrange_interp_2Dfo(x_fine[i], x_fine[j], order_x, order_y, x_coarse, 21, x_coarse, 21, z_coarse);
      z_interp_full[iflat] = lagrange_interp_2D(x_fine[i], x_fine[j], x_coarse, 21, x_coarse, 21, z_coarse);
      error_fo = z_interp_fo[iflat] - z_fine[iflat];
      error_full = z_interp_full[iflat] - z_fine[iflat];
      l2_error_fo += error_fo * error_fo;
      l2_error_full += error_full * error_full;
      l2_error_denom += 1. * 1.;
      max_error_fo = fmax(error_fo, max_error_fo);
      max_error_full = fmax(error_full, max_error_full);
    }
  }
  l2_error_fo = sqrt(l2_error_fo / l2_error_denom);
  l2_error_full = sqrt(l2_error_full / l2_error_denom);
  printf("\tMax error = %lf\n\tL2 error = %lf\n"
         "\tMax error fixed order %lf\n"
         "\tL2 error fixed order %lf\n",
         max_error_full, l2_error_full, max_error_fo, l2_error_fo);
  printf("Creating output files.\n");
  FILE *fp_full;
  FILE *fp_fo;
  fp_full = fopen("test_full.out", "w");
  fp_fo = fopen("test_fo.out", "w");
  fprintf(fp_full, "#i\tj\tx\ty\tz\tz_interp\n");
  fprintf(fp_fo, "#i\tj\tx\ty\tz\tz_interp\n");
  fprintf(fp_full, "#NX = NY = %d\n", 101);
  fprintf(fp_fo, "#NX = NY = %d\n", 101);
  for (int i = 0; i < 101; i++) {
    for (int j = 0; j < 101; j++) {
      iflat = index_2D_to_1D(i, 101, j, 101);
      fprintf(fp_fo, "%d\t%d\t%lf\t%lf\t%lf\t%lf\n", i, j, x_fine[i], x_fine[j], z_fine[iflat], z_interp_fo[iflat]);
      fprintf(fp_full, "%d\t%d\t%lf\t%lf\t%lf\t%lf\n", i, j, x_fine[i], x_fine[j], z_fine[iflat], z_interp_full[iflat]);
    }
  }
  fclose(fp_fo);
  fclose(fp_full);
  free(x_coarse);
  free(z_coarse);
  return 0;
}
```