#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
double fmax(double, double);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
int index_2D_to_1D(int, int, int, int);
double lagrange_interp_2D(double, double, double *, int, double *, int,
                          double *);
double lagrange_interp_2Dfo(double, double, int, int, double *, int, double *,
                            int, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
double sqrt(double);
double xyn(double, double);
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;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3c040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1b9,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3bfd8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3bfe0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3bfe8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3bff0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x3bff8(%rbp)
ff
cmpl   $0x3,-0x8(%rbp)
jge    1242 <main+0x82>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    19cb <main+0x80b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x3bffc(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x3c000(%rbp)
cmpl   $0x0,-0x3bffc(%rbp)
jl     1282 <main+0xc2>
cmpl   $0x0,-0x3c000(%rbp)
jge    129c <main+0xdc>
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    19cb <main+0x80b>
cmpl   $0x15,-0x3bffc(%rbp)
jge    12b6 <main+0xf6>
cmpl   $0x15,-0x3c000(%rbp)
jl     12c9 <main+0x109>
lea    0xda5(%rip),%rdi
mov    $0x14,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x3bffc(%rbp),%ecx
mov    -0x3c000(%rbp),%r8d
lea    0xdb4(%rip),%rdi
mov    $0x15,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xa8,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x3c004(%rbp)
cmpl   $0x15,-0x3c004(%rbp)
jge    1383 <main+0x1c3>
cvtsi2sdl -0x3c004(%rbp),%xmm0
ff
movsd  0xcc9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcb5(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c004(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c004(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c004(%rbp)
jmp    1332 <main+0x172>
movl   $0x0,-0x3c008(%rbp)
cmpl   $0x65,-0x3c008(%rbp)
jge    13de <main+0x21e>
cvtsi2sdl -0x3c008(%rbp),%xmm0
ff
movsd  0xc5e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc5a(%rip),%xmm1
addsd  %xmm1,%xmm0
movslq -0x3c008(%rbp),%rax
movsd  %xmm0,-0x350(%rbp,%rax,8)
ff ff
mov    -0x3c008(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c008(%rbp)
jmp    138d <main+0x1cd>
movl   $0x0,-0x3c00c(%rbp)
cmpl   $0x15,-0x3c00c(%rbp)
jge    1486 <main+0x2c6>
movl   $0x0,-0x3c010(%rbp)
cmpl   $0x15,-0x3c010(%rbp)
jge    146d <main+0x2ad>
mov    -0x3c00c(%rbp),%edi
mov    -0x3c010(%rbp),%edx
mov    $0x15,%ecx
mov    %ecx,%esi
call   10e0 <index_2D_to_1D@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x3c00c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c010(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   10d0 <xyn@plt>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c010(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c010(%rbp)
jmp    13ff <main+0x23f>
jmp    1472 <main+0x2b2>
mov    -0x3c00c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c00c(%rbp)
jmp    13e8 <main+0x228>
movl   $0x0,-0x3c014(%rbp)
cmpl   $0x65,-0x3c014(%rbp)
jge    152e <main+0x36e>
movl   $0x0,-0x3c018(%rbp)
cmpl   $0x65,-0x3c018(%rbp)
jge    1515 <main+0x355>
mov    -0x3c014(%rbp),%edi
mov    -0x3c018(%rbp),%edx
mov    $0x65,%ecx
mov    %ecx,%esi
call   10e0 <index_2D_to_1D@plt>
mov    %eax,-0x14(%rbp)
movslq -0x3c014(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm0
ff ff
movslq -0x3c018(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm1
ff ff
call   10d0 <xyn@plt>
movslq -0x14(%rbp),%rax
movsd  %xmm0,-0x14220(%rbp,%rax,8)
fe ff
mov    -0x3c018(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c018(%rbp)
jmp    14a7 <main+0x2e7>
jmp    151a <main+0x35a>
mov    -0x3c014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c014(%rbp)
jmp    1490 <main+0x2d0>
lea    0xc57(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x3c01c(%rbp)
cmpl   $0x65,-0x3c01c(%rbp)
jge    1766 <main+0x5a6>
movl   $0x0,-0x3c020(%rbp)
cmpl   $0x65,-0x3c020(%rbp)
jge    174d <main+0x58d>
mov    -0x3c01c(%rbp),%edi
mov    -0x3c020(%rbp),%edx
mov    $0x65,%ecx
mov    %ecx,%esi
call   10e0 <index_2D_to_1D@plt>
mov    %eax,-0x14(%rbp)
movslq -0x3c01c(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm0
ff ff
movslq -0x3c020(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm1
ff ff
mov    -0x3bffc(%rbp),%edi
mov    -0x3c000(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%rax
mov    $0x15,%r9d
mov    %r9d,%ecx
mov    %rax,(%rsp)
call   1070 <lagrange_interp_2Dfo@plt>
movslq -0x14(%rbp),%rax
movsd  %xmm0,-0x3bfc0(%rbp,%rax,8)
fc ff
movslq -0x3c01c(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm0
ff ff
movslq -0x3c020(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm1
ff ff
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%r8
mov    $0x15,%ecx
mov    %ecx,%esi
call   1030 <lagrange_interp_2D@plt>
movslq -0x14(%rbp),%rax
movsd  %xmm0,-0x280f0(%rbp,%rax,8)
fd ff
movslq -0x14(%rbp),%rax
movsd  -0x3bfc0(%rbp,%rax,8),%xmm0
fc ff
movslq -0x14(%rbp),%rax
subsd  -0x14220(%rbp,%rax,8),%xmm0
fe ff
movsd  %xmm0,-0x3bfc8(%rbp)
ff
movslq -0x14(%rbp),%rax
movsd  -0x280f0(%rbp,%rax,8),%xmm0
fd ff
movslq -0x14(%rbp),%rax
subsd  -0x14220(%rbp,%rax,8),%xmm0
fe ff
movsd  %xmm0,-0x3bfd0(%rbp)
ff
movsd  -0x3bfc8(%rbp),%xmm0
ff
movsd  -0x3bfc8(%rbp),%xmm2
ff
movsd  -0x3bfd8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3bfd8(%rbp)
ff
movsd  -0x3bfd0(%rbp),%xmm0
ff
movsd  -0x3bfd0(%rbp),%xmm2
ff
movsd  -0x3bfe0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x3bfe0(%rbp)
ff
movsd  0x943(%rip),%xmm0
addsd  -0x3bfe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x3bfe8(%rbp)
ff
movsd  -0x3bfc8(%rbp),%xmm3
ff
movsd  -0x3bff8(%rbp),%xmm2
ff
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x3bff8(%rbp)
ff
movsd  -0x3bfd0(%rbp),%xmm3
ff
movsd  -0x3bff0(%rbp),%xmm2
ff
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movsd  %xmm0,-0x3bff0(%rbp)
ff
mov    -0x3c020(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c020(%rbp)
jmp    155d <main+0x39d>
jmp    1752 <main+0x592>
mov    -0x3c01c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c01c(%rbp)
jmp    1546 <main+0x386>
movsd  -0x3bfd8(%rbp),%xmm0
ff
divsd  -0x3bfe8(%rbp),%xmm0
ff
call   10c0 <sqrt@plt>
movsd  %xmm0,-0x3bfd8(%rbp)
ff
movsd  -0x3bfe0(%rbp),%xmm0
ff
divsd  -0x3bfe8(%rbp),%xmm0
ff
call   10c0 <sqrt@plt>
movsd  %xmm0,-0x3bfe0(%rbp)
ff
movsd  -0x3bff0(%rbp),%xmm0
ff
movsd  -0x3bfe0(%rbp),%xmm1
ff
movsd  -0x3bff8(%rbp),%xmm2
ff
movsd  -0x3bfd8(%rbp),%xmm3
ff
lea    0x9d5(%rip),%rdi
mov    $0x4,%al
call   1060 <printf@plt>
lea    0xa1e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xa28(%rip),%rdi
lea    0xa2f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x3c028(%rbp)
lea    0xa1e(%rip),%rdi
lea    0xa15(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x3c030(%rbp)
mov    -0x3c028(%rbp),%rdi
lea    0xa09(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x3c030(%rbp),%rdi
lea    0x9f4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x3c028(%rbp),%rdi
lea    0x9f4(%rip),%rsi
mov    $0x65,%edx
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x3c030(%rbp),%rdi
lea    0x9da(%rip),%rsi
mov    $0x65,%edx
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x3c034(%rbp)
cmpl   $0x65,-0x3c034(%rbp)
jge    199a <main+0x7da>
movl   $0x0,-0x3c038(%rbp)
cmpl   $0x65,-0x3c038(%rbp)
jge    1981 <main+0x7c1>
mov    -0x3c034(%rbp),%edi
mov    -0x3c038(%rbp),%edx
mov    $0x65,%ecx
mov    %ecx,%esi
call   10e0 <index_2D_to_1D@plt>
mov    %eax,-0x14(%rbp)
mov    -0x3c030(%rbp),%rdi
mov    -0x3c034(%rbp),%edx
mov    -0x3c038(%rbp),%ecx
movslq -0x3c034(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm0
ff ff
movslq -0x3c038(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm1
ff ff
movslq -0x14(%rbp),%rax
movsd  -0x14220(%rbp,%rax,8),%xmm2
fe ff
movslq -0x14(%rbp),%rax
movsd  -0x3bfc0(%rbp,%rax,8),%xmm3
fc ff
lea    0x940(%rip),%rsi
mov    $0x4,%al
call   1080 <fprintf@plt>
mov    -0x3c028(%rbp),%rdi
mov    -0x3c034(%rbp),%edx
mov    -0x3c038(%rbp),%ecx
movslq -0x3c034(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm0
ff ff
movslq -0x3c038(%rbp),%rax
movsd  -0x350(%rbp,%rax,8),%xmm1
ff ff
movslq -0x14(%rbp),%rax
movsd  -0x14220(%rbp,%rax,8),%xmm2
fe ff
movslq -0x14(%rbp),%rax
movsd  -0x280f0(%rbp,%rax,8),%xmm3
fd ff
lea    0x8e5(%rip),%rsi
mov    $0x4,%al
call   1080 <fprintf@plt>
mov    -0x3c038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c038(%rbp)
jmp    188f <main+0x6cf>
jmp    1986 <main+0x7c6>
mov    -0x3c034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c034(%rbp)
jmp    1878 <main+0x6b8>
mov    -0x3c030(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x3c028(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3c040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3c018,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1214 <main+0x34>
mov    (%rbx),%rsi
lea    0xef5(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%eax
jmp    1888 <main+0x6a8>
mov    0x8(%rbx),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   10c0 <atoi@plt>
test   %ebp,%ebp
js     1657 <main+0x477>
mov    %eax,%ebx
test   %eax,%eax
js     1657 <main+0x477>
cmp    $0x14,%ebp
ja     1244 <main+0x64>
cmp    $0x15,%ebx
jb     1257 <main+0x77>
lea    0xec7(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x15,%esi
mov    $0x15,%edx
mov    %ebp,0x4c(%rsp)
mov    %ebp,%ecx
mov    %ebx,0x48(%rsp)
mov    %ebx,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x1042(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa8,%edi
call   10a0 <malloc@plt>
mov    %rax,%r13
mov    $0xdc8,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
lea    0x102d(%rip),%rdi
call   1050 <puts@plt>
movaps 0xd4b(%rip),%xmm0
movups %xmm0,0x0(%r13)
movaps 0xd4f(%rip),%xmm0
movups %xmm0,0x10(%r13)
movaps 0xd53(%rip),%xmm0
movups %xmm0,0x20(%r13)
movaps 0xd57(%rip),%xmm0
movups %xmm0,0x30(%r13)
movaps 0xd5b(%rip),%xmm0
movups %xmm0,0x40(%r13)
movaps 0xd5f(%rip),%xmm0
movups %xmm0,0x50(%r13)
movaps 0xd63(%rip),%xmm0
movups %xmm0,0x60(%r13)
movaps 0xd67(%rip),%xmm0
movups %xmm0,0x70(%r13)
movaps 0xd6b(%rip),%xmm0
movups %xmm0,0x80(%r13)
movaps 0xd6c(%rip),%xmm0
movups %xmm0,0x90(%r13)
movabs $0x3ff0000000000000,%rax
mov    %rax,0xa0(%r13)
movdqa 0xd5b(%rip),%xmm0
mov    $0x2,%ecx
movapd 0xd5e(%rip),%xmm1
movapd 0xd66(%rip),%xmm2
movdqa 0xd6e(%rip),%xmm3
movdqa 0xd76(%rip),%xmm4
nopw   0x0(%rax,%rax,1)
cvtdq2pd %xmm0,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movapd %xmm5,0x70(%rsp,%rcx,8)
movdqa %xmm0,%xmm5
paddd  %xmm3,%xmm5
cvtdq2pd %xmm5,%xmm5
mulpd  %xmm1,%xmm5
addpd  %xmm2,%xmm5
movapd %xmm5,0x80(%rsp,%rcx,8)
paddd  %xmm4,%xmm0
add    $0x4,%rcx
cmp    $0x66,%rcx
jne    1370 <main+0x190>
mov    %rax,0x3a0(%rsp)
xor    %r14d,%r14d
mov    %rbx,0x40(%rsp)
nopl   (%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
mov    $0x15,%esi
mov    %ebp,%edx
mov    $0x15,%ecx
call   1100 <index_2D_to_1D@plt>
mov    %eax,%ebx
movq   0x0(%r13,%r14,8),%xmm0
movsd  0x0(%r13,%rbp,8),%xmm1
call   10e0 <xyn@plt>
movslq %ebx,%rax
mov    0x40(%rsp),%rbx
movq   %xmm0,(%rbx,%rax,8)
add    $0x1,%rbp
cmp    $0x15,%rbp
jne    13d0 <main+0x1f0>
add    $0x1,%r14
cmp    $0x15,%r14
jne    13c0 <main+0x1e0>
xor    %r14d,%r14d
nopl   (%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
mov    $0x65,%esi
mov    %ebp,%edx
mov    $0x65,%ecx
call   1100 <index_2D_to_1D@plt>
mov    %eax,%ebx
movq   0x80(%rsp,%r14,8),%xmm0
movsd  0x80(%rsp,%rbp,8),%xmm1
call   10e0 <xyn@plt>
movslq %ebx,%rax
movq   %xmm0,0x3b0(%rsp,%rax,8)
add    $0x1,%rbp
cmp    $0x65,%rbp
jne    1430 <main+0x250>
add    $0x1,%r14
cmp    $0x65,%r14
jne    1420 <main+0x240>
lea    0xe63(%rip),%rdi
call   1050 <puts@plt>
xorpd  %xmm5,%xmm5
xor    %r14d,%r14d
xorpd  %xmm8,%xmm8
pxor   %xmm0,%xmm0
movdqa %xmm0,0x20(%rsp)
pxor   %xmm0,%xmm0
pxor   %xmm4,%xmm4
mov    0x40(%rsp),%r12
mov    0x48(%rsp),%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebx,%ebx
movaps 0x20(%rsp),%xmm6
nopw   0x0(%rax,%rax,1)
movaps %xmm6,0x20(%rsp)
movdqa %xmm0,0x30(%rsp)
movsd  %xmm5,0x68(%rsp)
movq   %xmm4,0x18(%rsp)
movsd  %xmm8,0x10(%rsp)
mov    %r14d,%edi
mov    $0x65,%esi
mov    %ebx,%edx
mov    $0x65,%ecx
call   1100 <index_2D_to_1D@plt>
mov    %eax,%ebp
movsd  0x80(%rsp,%r14,8),%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  0x80(%rsp,%rbx,8),%xmm1
movsd  %xmm1,0x58(%rsp)
mov    %r12,(%rsp)
mov    0x4c(%rsp),%edi
mov    %r15d,%esi
mov    %r13,%rdx
mov    $0x15,%ecx
mov    %r13,%r8
mov    $0x15,%r9d
call   1080 <lagrange_interp_2Dfo@plt>
movaps %xmm0,0x70(%rsp)
movslq %ebp,%rbp
movsd  %xmm0,0x14280(%rsp,%rbp,8)
movsd  0x60(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
mov    %r13,%rdi
mov    $0x15,%esi
mov    %r13,%rdx
mov    $0x15,%ecx
mov    %r12,%r8
call   1030 <lagrange_interp_2D@plt>
movsd  0xb6f(%rip),%xmm2
movsd  0x68(%rsp),%xmm5
movsd  0x18(%rsp),%xmm4
movsd  0x10(%rsp),%xmm8
movsd  %xmm0,0x28150(%rsp,%rbp,8)
movsd  0x3b0(%rsp,%rbp,8),%xmm1
movapd 0x70(%rsp),%xmm7
subsd  %xmm1,%xmm7
subsd  %xmm1,%xmm0
movapd %xmm7,%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm1,%xmm5
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm8
addsd  %xmm2,%xmm4
movapd 0x20(%rsp),%xmm6
movapd %xmm6,%xmm1
maxsd  %xmm7,%xmm1
cmpunordsd %xmm7,%xmm7
movapd %xmm7,%xmm2
andnpd %xmm1,%xmm2
andpd  %xmm6,%xmm7
orpd   %xmm2,%xmm7
movapd %xmm7,%xmm6
movapd 0x30(%rsp),%xmm7
movapd %xmm7,%xmm1
maxsd  %xmm0,%xmm1
cmpunordsd %xmm0,%xmm0
movapd %xmm0,%xmm2
andnpd %xmm1,%xmm2
andpd  %xmm7,%xmm0
orpd   %xmm2,%xmm0
add    $0x1,%rbx
cmp    $0x65,%rbx
jne    14d0 <main+0x2f0>
movapd %xmm6,0x20(%rsp)
add    $0x1,%r14
cmp    $0x65,%r14
jne    14c0 <main+0x2e0>
divsd  %xmm4,%xmm5
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm5
jb     166d <main+0x48d>
movdqa %xmm0,0x30(%rsp)
sqrtsd %xmm5,%xmm3
jmp    169e <main+0x4be>
lea    0xcb0(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%eax
jmp    1888 <main+0x6a8>
movdqa %xmm0,0x30(%rsp)
movapd %xmm5,%xmm0
movsd  %xmm8,0x10(%rsp)
movsd  %xmm4,0x18(%rsp)
call   10d0 <sqrt@plt>
xorpd  %xmm1,%xmm1
movsd  0x18(%rsp),%xmm4
movsd  0x10(%rsp),%xmm8
movapd %xmm0,%xmm3
divsd  %xmm4,%xmm8
ucomisd %xmm1,%xmm8
mov    %r13,0x50(%rsp)
jb     16b9 <main+0x4d9>
xorps  %xmm1,%xmm1
sqrtsd %xmm8,%xmm1
jmp    16d3 <main+0x4f3>
movapd %xmm8,%xmm0
movsd  %xmm3,0x10(%rsp)
call   10d0 <sqrt@plt>
movsd  0x10(%rsp),%xmm3
movapd %xmm0,%xmm1
movaps 0x20(%rsp),%xmm2
movaps 0x30(%rsp),%xmm0
lea    0xb33(%rip),%rdi
mov    $0x4,%al
call   1070 <printf@plt>
lea    0xc05(%rip),%rdi
call   1050 <puts@plt>
lea    0xb70(%rip),%rdi
lea    0xb77(%rip),%rbx
mov    %rbx,%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbp
lea    0xb67(%rip),%rdi
mov    %rbx,%rsi
call   10b0 <fopen@plt>
mov    %rax,%r15
lea    0xb61(%rip),%rbx
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %rbp,%rcx
call   10f0 <fwrite@plt>
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r15,%rcx
call   10f0 <fwrite@plt>
lea    0xb45(%rip),%r14
xor    %r13d,%r13d
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x65,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,0x18(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x65,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xb21(%rip),%rbx
mov    0x18(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13d,%edi
mov    $0x65,%esi
mov    %r14d,%edx
mov    $0x65,%ecx
call   1100 <index_2D_to_1D@plt>
movsd  0x80(%rsp,%r13,8),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x80(%rsp,%r14,8),%xmm1
movsd  %xmm1,0x30(%rsp)
movslq %eax,%r15
movsd  0x3b0(%rsp,%r15,8),%xmm2
movsd  %xmm2,0x10(%rsp)
movsd  0x14280(%rsp,%r15,8),%xmm3
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    $0x4,%al
call   1090 <fprintf@plt>
movsd  0x28150(%rsp,%r15,8),%xmm3
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x20(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    $0x4,%al
call   1090 <fprintf@plt>
add    $0x1,%r14
cmp    $0x65,%r14
jne    17b0 <main+0x5d0>
add    $0x1,%r13
cmp    $0x65,%r13
jne    17a0 <main+0x5c0>
mov    0x18(%rsp),%rdi
call   1060 <fclose@plt>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    0x50(%rsp),%rdi
call   1040 <free@plt>
mov    0x40(%rsp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x3c018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"usage %s order_x order_y\0A\00"
@.str.1 = [40 x i8] c"Interpolation order must be at least 0\0A\00"
@.str.2 = [47 x i8] c"Interpolation order can be no greater than %d\0A\00"
@.str.3 = [214 x i8] c"We compare to the analytic function\0Ax^4 - y^4 + 0.5*(x*y)**4\0Aon the domain [-1,1]x[-1,1].\0AFor FULL Lagrange polynomials of order:\0A\09%d in x\0A\09%d in y\0Aand FIXED ORDER Lagrange polynomials of order:\0A\09%d in x\0A\09%d in y\0A\00"
@.str.4 = [18 x i8] c"Preparing grids.\0A\00"
@.str.5 = [19 x i8] c"Writing to grids.\0A\00"
@.str.6 = [16 x i8] c"Interpolating.\0A\00"
@.str.7 = [87 x i8] c"\09Max error = %lf\0A\09L2 error = %lf\0A\09Max error fixed order %lf\0A\09L2 error fixed order %lf\0A\00"
@.str.8 = [24 x i8] c"Creating output files.\0A\00"
@.str.9 = [14 x i8] c"test_full.out\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [12 x i8] c"test_fo.out\00"
@.str.12 = [21 x i8] c"#i\09j\09x\09y\09z\09z_interp\0A\00"
@.str.13 = [15 x i8] c"#NX = NY = %d\0A\00"
@.str.14 = [23 x i8] c"%d\09%d\09%lf\09%lf\09%lf\09%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca [101 x double]
%11 = alloca [10201 x double]
%12 = alloca [10201 x double]
%13 = alloca [10201 x double]
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32*
%32 = alloca i32*
%33 = alloca i32
%34 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 441, i32* %7
store double 0.000000e+00, double* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
store double 0.000000e+00, double* %20
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 3
br i1 %36, label %37, label %42
37: ; preds = %2
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 0
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %40)
store i32 1, i32* %3
br label %351
42: ; preds = %2
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i32 @atoi(i8* %45)
store i32 %46, i32* %21
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 2
%49 = load i8*, i8** %48
%50 = call i32 @atoi(i8* %49)
store i32 %50, i32* %22
%51 = load i32, i32* %21
%52 = icmp slt i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %42
%54 = load i32, i32* %22
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53, %42
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %351
58: ; preds = %53
%59 = load i32, i32* %21
%60 = icmp sge i32 %59, 21
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* %22
%63 = icmp sge i32 %62, 21
br i1 %63, label %64, label %66
64: ; preds = %61, %58
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 20)
br label %66
66: ; preds = %64, %61
%67 = load i32, i32* %21
%68 = load i32, i32* %22
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str.3, i64 0, i64 0), i32 21, i32 21, i32 %67, i32 %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%71 = call i64 @malloc(i32 168)
%72 = inttoptr i64 %71 to double*
store double* %72, double** %8
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = mul i64 8, %74
%76 = trunc i64 %75 to i32
%77 = call i64 @malloc(i32 %76)
%78 = inttoptr i64 %77 to double*
store double* %78, double** %9
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %23
br label %80
80: ; preds = %91, %66
%81 = load i32, i32* %23
%82 = icmp slt i32 %81, 21
br i1 %82, label %83, label %94
83: ; preds = %80
%84 = load i32, i32* %23
%85 = sitofp i32 %84 to double
%86 = call double @llvm.fmuladd.f64(double 1.000000e-01, double %85, double -1.000000e+00)
%87 = load double*, double** %8
%88 = load i32, i32* %23
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
store double %86, double* %90
br label %91
91: ; preds = %83
%92 = load i32, i32* %23
%93 = add nsw i32 %92, 1
store i32 %93, i32* %23
br label %80
94: ; preds = %80
store i32 0, i32* %24
br label %95
95: ; preds = %105, %94
%96 = load i32, i32* %24
%97 = icmp slt i32 %96, 101
br i1 %97, label %98, label %108
98: ; preds = %95
%99 = load i32, i32* %24
%100 = sitofp i32 %99 to double
%101 = call double @llvm.fmuladd.f64(double 2.000000e-02, double %100, double -1.000000e+00)
%102 = load i32, i32* %24
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %103
store double %101, double* %104
br label %105
105: ; preds = %98
%106 = load i32, i32* %24
%107 = add nsw i32 %106, 1
store i32 %107, i32* %24
br label %95
108: ; preds = %95
store i32 0, i32* %25
br label %109
109: ; preds = %139, %108
%110 = load i32, i32* %25
%111 = icmp slt i32 %110, 21
br i1 %111, label %112, label %142
112: ; preds = %109
store i32 0, i32* %26
br label %113
113: ; preds = %135, %112
%114 = load i32, i32* %26
%115 = icmp slt i32 %114, 21
br i1 %115, label %116, label %138
116: ; preds = %113
%117 = load i32, i32* %25
%118 = load i32, i32* %26
%119 = call i32 @index_2D_to_1D(i32 %117, i32 21, i32 %118, i32 21)
store i32 %119, i32* %6
%120 = load double*, double** %8
%121 = load i32, i32* %25
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %120, i64 %122
%124 = load double, double* %123
%125 = load double*, double** %8
%126 = load i32, i32* %26
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds double, double* %125, i64 %127
%129 = load double, double* %128
%130 = call double @xyn(double %124, double %129)
%131 = load double*, double** %9
%132 = load i32, i32* %6
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
store double %130, double* %134
br label %135
135: ; preds = %116
%136 = load i32, i32* %26
%137 = add nsw i32 %136, 1
store i32 %137, i32* %26
br label %113
138: ; preds = %113
br label %139
139: ; preds = %138
%140 = load i32, i32* %25
%141 = add nsw i32 %140, 1
store i32 %141, i32* %25
br label %109
142: ; preds = %109
store i32 0, i32* %27
br label %143
143: ; preds = %170, %142
%144 = load i32, i32* %27
%145 = icmp slt i32 %144, 101
br i1 %145, label %146, label %173
146: ; preds = %143
store i32 0, i32* %28
br label %147
147: ; preds = %166, %146
%148 = load i32, i32* %28
%149 = icmp slt i32 %148, 101
br i1 %149, label %150, label %169
150: ; preds = %147
%151 = load i32, i32* %27
%152 = load i32, i32* %28
%153 = call i32 @index_2D_to_1D(i32 %151, i32 101, i32 %152, i32 101)
store i32 %153, i32* %6
%154 = load i32, i32* %27
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %155
%157 = load double, double* %156
%158 = load i32, i32* %28
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %159
%161 = load double, double* %160
%162 = call double @xyn(double %157, double %161)
%163 = load i32, i32* %6
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [10201 x double], [10201 x double]* %11, i64 0, i64 %164
store double %162, double* %165
br label %166
166: ; preds = %150
%167 = load i32, i32* %28
%168 = add nsw i32 %167, 1
store i32 %168, i32* %28
br label %147
169: ; preds = %147
br label %170
170: ; preds = %169
%171 = load i32, i32* %27
%172 = add nsw i32 %171, 1
store i32 %172, i32* %27
br label %143
173: ; preds = %143
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %29
br label %175
175: ; preds = %256, %173
%176 = load i32, i32* %29
%177 = icmp slt i32 %176, 101
br i1 %177, label %178, label %259
178: ; preds = %175
store i32 0, i32* %30
br label %179
179: ; preds = %252, %178
%180 = load i32, i32* %30
%181 = icmp slt i32 %180, 101
br i1 %181, label %182, label %255
182: ; preds = %179
%183 = load i32, i32* %29
%184 = load i32, i32* %30
%185 = call i32 @index_2D_to_1D(i32 %183, i32 101, i32 %184, i32 101)
store i32 %185, i32* %6
%186 = load i32, i32* %29
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %187
%189 = load double, double* %188
%190 = load i32, i32* %30
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %191
%193 = load double, double* %192
%194 = load i32, i32* %21
%195 = load i32, i32* %22
%196 = load double*, double** %8
%197 = load double*, double** %8
%198 = load double*, double** %9
%199 = call double @lagrange_interp_2Dfo(double %189, double %193, i32 %194, i32 %195, double* %196, i32 21, double* %197, i32 21, double* %198)
%200 = load i32, i32* %6
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [10201 x double], [10201 x double]* %13, i64 0, i64 %201
store double %199, double* %202
%203 = load i32, i32* %29
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %204
%206 = load double, double* %205
%207 = load i32, i32* %30
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %208
%210 = load double, double* %209
%211 = load double*, double** %8
%212 = load double*, double** %8
%213 = load double*, double** %9
%214 = call double @lagrange_interp_2D(double %206, double %210, double* %211, i32 21, double* %212, i32 21, double* %213)
%215 = load i32, i32* %6
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [10201 x double], [10201 x double]* %12, i64 0, i64 %216
store double %214, double* %217
%218 = load i32, i32* %6
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds [10201 x double], [10201 x double]* %13, i64 0, i64 %219
%221 = load double, double* %220
%222 = load i32, i32* %6
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds [10201 x double], [10201 x double]* %11, i64 0, i64 %223
%225 = load double, double* %224
%226 = fsub double %221, %225
store double %226, double* %14
%227 = load i32, i32* %6
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds [10201 x double], [10201 x double]* %12, i64 0, i64 %228
%230 = load double, double* %229
%231 = load i32, i32* %6
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds [10201 x double], [10201 x double]* %11, i64 0, i64 %232
%234 = load double, double* %233
%235 = fsub double %230, %234
store double %235, double* %15
%236 = load double, double* %14
%237 = load double, double* %14
%238 = load double, double* %16
%239 = call double @llvm.fmuladd.f64(double %236, double %237, double %238)
store double %239, double* %16
%240 = load double, double* %15
%241 = load double, double* %15
%242 = load double, double* %17
%243 = call double @llvm.fmuladd.f64(double %240, double %241, double %242)
store double %243, double* %17
%244 = load double, double* %18
%245 = fadd double %244, 1.000000e+00
store double %245, double* %18
%246 = load double, double* %14
%247 = load double, double* %20
%248 = call double @llvm.maxnum.f64(double %246, double %247)
store double %248, double* %20
%249 = load double, double* %15
%250 = load double, double* %19
%251 = call double @llvm.maxnum.f64(double %249, double %250)
store double %251, double* %19
br label %252
252: ; preds = %182
%253 = load i32, i32* %30
%254 = add nsw i32 %253, 1
store i32 %254, i32* %30
br label %179
255: ; preds = %179
br label %256
256: ; preds = %255
%257 = load i32, i32* %29
%258 = add nsw i32 %257, 1
store i32 %258, i32* %29
br label %175
259: ; preds = %175
%260 = load double, double* %16
%261 = load double, double* %18
%262 = fdiv double %260, %261
%263 = call double @sqrt(double %262)
store double %263, double* %16
%264 = load double, double* %17
%265 = load double, double* %18
%266 = fdiv double %264, %265
%267 = call double @sqrt(double %266)
store double %267, double* %17
%268 = load double, double* %19
%269 = load double, double* %17
%270 = load double, double* %20
%271 = load double, double* %16
%272 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.7, i64 0, i64 0), double %268, double %269, double %270, double %271)
%273 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%274 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %274, i32** %31
%275 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %275, i32** %32
%276 = load i32*, i32** %31
%277 = call i32 (i32*, i8*, ...) @fprintf(i32* %276, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
%278 = load i32*, i32** %32
%279 = call i32 (i32*, i8*, ...) @fprintf(i32* %278, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
%280 = load i32*, i32** %31
%281 = call i32 (i32*, i8*, ...) @fprintf(i32* %280, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 101)
%282 = load i32*, i32** %32
%283 = call i32 (i32*, i8*, ...) @fprintf(i32* %282, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 101)
store i32 0, i32* %33
br label %284
284: ; preds = %339, %259
%285 = load i32, i32* %33
%286 = icmp slt i32 %285, 101
br i1 %286, label %287, label %342
287: ; preds = %284
store i32 0, i32* %34
br label %288
288: ; preds = %335, %287
%289 = load i32, i32* %34
%290 = icmp slt i32 %289, 101
br i1 %290, label %291, label %338
291: ; preds = %288
%292 = load i32, i32* %33
%293 = load i32, i32* %34
%294 = call i32 @index_2D_to_1D(i32 %292, i32 101, i32 %293, i32 101)
store i32 %294, i32* %6
%295 = load i32*, i32** %32
%296 = load i32, i32* %33
%297 = load i32, i32* %34
%298 = load i32, i32* %33
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %299
%301 = load double, double* %300
%302 = load i32, i32* %34
%303 = sext i32 %302 to i64
%304 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %303
%305 = load double, double* %304
%306 = load i32, i32* %6
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds [10201 x double], [10201 x double]* %11, i64 0, i64 %307
%309 = load double, double* %308
%310 = load i32, i32* %6
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds [10201 x double], [10201 x double]* %13, i64 0, i64 %311
%313 = load double, double* %312
%314 = call i32 (i32*, i8*, ...) @fprintf(i32* %295, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 %296, i32 %297, double %301, double %305, double %309, double %313)
%315 = load i32*, i32** %31
%316 = load i32, i32* %33
%317 = load i32, i32* %34
%318 = load i32, i32* %33
%319 = sext i32 %318 to i64
%320 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %319
%321 = load double, double* %320
%322 = load i32, i32* %34
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds [101 x double], [101 x double]* %10, i64 0, i64 %323
%325 = load double, double* %324
%326 = load i32, i32* %6
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds [10201 x double], [10201 x double]* %11, i64 0, i64 %327
%329 = load double, double* %328
%330 = load i32, i32* %6
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds [10201 x double], [10201 x double]* %12, i64 0, i64 %331
%333 = load double, double* %332
%334 = call i32 (i32*, i8*, ...) @fprintf(i32* %315, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 %316, i32 %317, double %321, double %325, double %329, double %333)
br label %335
335: ; preds = %291
%336 = load i32, i32* %34
%337 = add nsw i32 %336, 1
store i32 %337, i32* %34
br label %288
338: ; preds = %288
br label %339
339: ; preds = %338
%340 = load i32, i32* %33
%341 = add nsw i32 %340, 1
store i32 %341, i32* %33
br label %284
342: ; preds = %284
%343 = load i32*, i32** %32
%344 = call i32 @fclose(i32* %343)
%345 = load i32*, i32** %31
%346 = call i32 @fclose(i32* %345)
%347 = load double*, double** %8
%348 = call i32 @free(double* %347)
%349 = load double*, double** %9
%350 = call i32 @free(double* %349)
store i32 0, i32* %3
br label %351
351: ; preds = %342, %56, %37
%352 = load i32, i32* %3
ret i32 %352
}

LLVM IR (-O2):
@.str = [26 x i8] c"usage %s order_x order_y\0A\00"
@.str.2 = [47 x i8] c"Interpolation order can be no greater than %d\0A\00"
@.str.3 = [214 x i8] c"We compare to the analytic function\0Ax^4 - y^4 + 0.5*(x*y)**4\0Aon the domain [-1,1]x[-1,1].\0AFor FULL Lagrange polynomials of order:\0A\09%d in x\0A\09%d in y\0Aand FIXED ORDER Lagrange polynomials of order:\0A\09%d in x\0A\09%d in y\0A\00"
@.str.7 = [87 x i8] c"\09Max error = %lf\0A\09L2 error = %lf\0A\09Max error fixed order %lf\0A\09L2 error fixed order %lf\0A\00"
@.str.9 = [14 x i8] c"test_full.out\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [12 x i8] c"test_fo.out\00"
@.str.12 = [21 x i8] c"#i\09j\09x\09y\09z\09z_interp\0A\00"
@.str.13 = [15 x i8] c"#NX = NY = %d\0A\00"
@.str.14 = [23 x i8] c"%d\09%d\09%lf\09%lf\09%lf\09%lf\0A\00"
@str = [17 x i8] c"Preparing grids.\00"
@str.15 = [18 x i8] c"Writing to grids.\00"
@str.16 = [15 x i8] c"Interpolating.\00"
@str.17 = [23 x i8] c"Creating output files.\00"
@str.18 = [39 x i8] c"Interpolation order must be at least 0\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [101 x double]
%4 = alloca [10201 x double]
%5 = alloca [10201 x double]
%6 = alloca [10201 x double]
%7 = bitcast [101 x double]* %3 to i8*
%8 = bitcast [10201 x double]* %4 to i8*
%9 = bitcast [10201 x double]* %5 to i8*
%10 = bitcast [10201 x double]* %6 to i8*
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %202
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @atoi(i8* %17)
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = tail call i32 @atoi(i8* %20)
%22 = icmp slt i32 %18, 0
%23 = icmp slt i32 %21, 0
%24 = select i1 %22, i1 true, i1 %23
br i1 %24, label %25, label %27
25: ; preds = %15
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.18, i64 0, i64 0))
br label %202
27: ; preds = %15
%28 = icmp ugt i32 %18, 20
%29 = icmp ugt i32 %21, 20
%30 = select i1 %28, i1 true, i1 %29
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 20)
br label %33
33: ; preds = %27, %31
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([214 x i8], [214 x i8]* @.str.3, i64 0, i64 0), i32 21, i32 21, i32 %18, i32 %21)
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%36 = tail call i64 @malloc(i32 168)
%37 = inttoptr i64 %36 to double*
%38 = tail call i64 @malloc(i32 3528)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.15, i64 0, i64 0))
%40 = inttoptr i64 %36 to <2 x double>*
store <2 x double> <double -1.000000e+00, double -9.000000e-01>, <2 x double>* %40
%41 = getelementptr inbounds double, double* %37, i64 2
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> <double -8.000000e-01, double 0xBFE6666666666666>, <2 x double>* %42
%43 = getelementptr inbounds double, double* %37, i64 4
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> <double -6.000000e-01, double -5.000000e-01>, <2 x double>* %44
%45 = getelementptr inbounds double, double* %37, i64 6
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> <double 0xBFD9999999999999, double 0xBFD3333333333332>, <2 x double>* %46
%47 = getelementptr inbounds double, double* %37, i64 8
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> <double 0xBFC9999999999998, double 0xBFB9999999999996>, <2 x double>* %48
%49 = getelementptr inbounds double, double* %37, i64 10
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> <double 0x3C90000000000000, double 0x3FB999999999999E>, <2 x double>* %50
%51 = getelementptr inbounds double, double* %37, i64 12
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> <double 0x3FC999999999999C, double 0x3FD3333333333334>, <2 x double>* %52
%53 = getelementptr inbounds double, double* %37, i64 14
%54 = bitcast double* %53 to <2 x double>*
store <2 x double> <double 0x3FD999999999999B, double 0x3FE0000000000001>, <2 x double>* %54
%55 = getelementptr inbounds double, double* %37, i64 16
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> <double 0x3FE3333333333334, double 0x3FE6666666666667>, <2 x double>* %56
%57 = getelementptr inbounds double, double* %37, i64 18
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> <double 8.000000e-01, double 0x3FECCCCCCCCCCCCE>, <2 x double>* %58
%59 = getelementptr inbounds double, double* %37, i64 20
store double 1.000000e+00, double* %59
br label %60
60: ; preds = %60, %33
%61 = phi i64 [ 0, %33 ], [ %73, %60 ]
%62 = phi <2 x i32> [ <i32 0, i32 1>, %33 ], [ %74, %60 ]
%63 = sitofp <2 x i32> %62 to <2 x double>
%64 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %63, <2 x double> <double 2.000000e-02, double 2.000000e-02>, <2 x double> <double -1.000000e+00, double -1.000000e+00>)
%65 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %61
%66 = bitcast double* %65 to <2 x double>*
store <2 x double> %64, <2 x double>* %66
%67 = or i64 %61, 2
%68 = add <2 x i32> %62, <i32 2, i32 2>
%69 = sitofp <2 x i32> %68 to <2 x double>
%70 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %69, <2 x double> <double 2.000000e-02, double 2.000000e-02>, <2 x double> <double -1.000000e+00, double -1.000000e+00>)
%71 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %67
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %70, <2 x double>* %72
%73 = add nuw nsw i64 %61, 4
%74 = add <2 x i32> %62, <i32 4, i32 4>
%75 = icmp eq i64 %73, 100
br i1 %75, label %76, label %60
76: ; preds = %60
%77 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 100
store double 1.000000e+00, double* %77
%78 = inttoptr i64 %38 to double*
br label %79
79: ; preds = %76, %83
%80 = phi i64 [ 0, %76 ], [ %84, %83 ]
%81 = getelementptr inbounds double, double* %37, i64 %80
%82 = trunc i64 %80 to i32
br label %86
83: ; preds = %86
%84 = add nuw nsw i64 %80, 1
%85 = icmp eq i64 %84, 21
br i1 %85, label %98, label %79
86: ; preds = %79, %86
%87 = phi i64 [ 0, %79 ], [ %96, %86 ]
%88 = trunc i64 %87 to i32
%89 = tail call i32 @index_2D_to_1D(i32 %82, i32 21, i32 %88, i32 21)
%90 = load double, double* %81
%91 = getelementptr inbounds double, double* %37, i64 %87
%92 = load double, double* %91
%93 = tail call double @xyn(double %90, double %92)
%94 = sext i32 %89 to i64
%95 = getelementptr inbounds double, double* %78, i64 %94
store double %93, double* %95
%96 = add nuw nsw i64 %87, 1
%97 = icmp eq i64 %96, 21
br i1 %97, label %83, label %86
98: ; preds = %83, %104
%99 = phi i64 [ %105, %104 ], [ 0, %83 ]
%100 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %99
%101 = trunc i64 %99 to i32
br label %107
102: ; preds = %104
%103 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
br label %119
104: ; preds = %107
%105 = add nuw nsw i64 %99, 1
%106 = icmp eq i64 %105, 101
br i1 %106, label %102, label %98
107: ; preds = %98, %107
%108 = phi i64 [ 0, %98 ], [ %117, %107 ]
%109 = trunc i64 %108 to i32
%110 = tail call i32 @index_2D_to_1D(i32 %101, i32 101, i32 %109, i32 101)
%111 = load double, double* %100
%112 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %108
%113 = load double, double* %112
%114 = tail call double @xyn(double %111, double %113)
%115 = sext i32 %110 to i64
%116 = getelementptr inbounds [10201 x double], [10201 x double]* %4, i64 0, i64 %115
store double %114, double* %116
%117 = add nuw nsw i64 %108, 1
%118 = icmp eq i64 %117, 101
br i1 %118, label %104, label %107
119: ; preds = %102, %141
%120 = phi i64 [ 0, %102 ], [ %142, %141 ]
%121 = phi double [ 0.000000e+00, %102 ], [ %165, %141 ]
%122 = phi double [ 0.000000e+00, %102 ], [ %166, %141 ]
%123 = phi double [ 0.000000e+00, %102 ], [ %168, %141 ]
%124 = phi double [ 0.000000e+00, %102 ], [ %169, %141 ]
%125 = phi double [ 0.000000e+00, %102 ], [ %167, %141 ]
%126 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %120
%127 = trunc i64 %120 to i32
br label %144
128: ; preds = %141
%129 = fdiv double %165, %167
%130 = tail call double @sqrt(double %129)
%131 = fdiv double %166, %167
%132 = tail call double @sqrt(double %131)
%133 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @.str.7, i64 0, i64 0), double %169, double %132, double %168, double %130)
%134 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.17, i64 0, i64 0))
%135 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%136 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%137 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i64 20, i64 1, i32* %135)
%138 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i64 20, i64 1, i32* %136)
%139 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 101)
%140 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 101)
br label %172
141: ; preds = %144
%142 = add nuw nsw i64 %120, 1
%143 = icmp eq i64 %142, 101
br i1 %143, label %128, label %119
144: ; preds = %119, %144
%145 = phi i64 [ 0, %119 ], [ %170, %144 ]
%146 = phi double [ %121, %119 ], [ %165, %144 ]
%147 = phi double [ %122, %119 ], [ %166, %144 ]
%148 = phi double [ %123, %119 ], [ %168, %144 ]
%149 = phi double [ %124, %119 ], [ %169, %144 ]
%150 = phi double [ %125, %119 ], [ %167, %144 ]
%151 = trunc i64 %145 to i32
%152 = tail call i32 @index_2D_to_1D(i32 %127, i32 101, i32 %151, i32 101)
%153 = load double, double* %126
%154 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %145
%155 = load double, double* %154
%156 = tail call double @lagrange_interp_2Dfo(double %153, double %155, i32 %18, i32 %21, double* %37, i32 21, double* %37, i32 21, double* %78)
%157 = sext i32 %152 to i64
%158 = getelementptr inbounds [10201 x double], [10201 x double]* %6, i64 0, i64 %157
store double %156, double* %158
%159 = tail call double @lagrange_interp_2D(double %153, double %155, double* %37, i32 21, double* %37, i32 21, double* %78)
%160 = getelementptr inbounds [10201 x double], [10201 x double]* %5, i64 0, i64 %157
store double %159, double* %160
%161 = getelementptr inbounds [10201 x double], [10201 x double]* %4, i64 0, i64 %157
%162 = load double, double* %161
%163 = fsub double %156, %162
%164 = fsub double %159, %162
%165 = tail call double @llvm.fmuladd.f64(double %163, double %163, double %146)
%166 = tail call double @llvm.fmuladd.f64(double %164, double %164, double %147)
%167 = fadd double %150, 1.000000e+00
%168 = tail call double @llvm.maxnum.f64(double %163, double %148)
%169 = tail call double @llvm.maxnum.f64(double %164, double %149)
%170 = add nuw nsw i64 %145, 1
%171 = icmp eq i64 %170, 101
br i1 %171, label %141, label %144
172: ; preds = %128, %181
%173 = phi i64 [ 0, %128 ], [ %182, %181 ]
%174 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %173
%175 = trunc i64 %173 to i32
br label %184
176: ; preds = %181
%177 = tail call i32 @fclose(i32* %136)
%178 = tail call i32 @fclose(i32* %135)
%179 = tail call i32 @free(double* %37)
%180 = tail call i32 @free(double* %78)
br label %202
181: ; preds = %184
%182 = add nuw nsw i64 %173, 1
%183 = icmp eq i64 %182, 101
br i1 %183, label %176, label %172
184: ; preds = %172, %184
%185 = phi i64 [ 0, %172 ], [ %200, %184 ]
%186 = trunc i64 %185 to i32
%187 = tail call i32 @index_2D_to_1D(i32 %175, i32 101, i32 %186, i32 101)
%188 = load double, double* %174
%189 = getelementptr inbounds [101 x double], [101 x double]* %3, i64 0, i64 %185
%190 = load double, double* %189
%191 = sext i32 %187 to i64
%192 = getelementptr inbounds [10201 x double], [10201 x double]* %4, i64 0, i64 %191
%193 = load double, double* %192
%194 = getelementptr inbounds [10201 x double], [10201 x double]* %6, i64 0, i64 %191
%195 = load double, double* %194
%196 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 %175, i32 %186, double %188, double %190, double %193, double %195)
%197 = getelementptr inbounds [10201 x double], [10201 x double]* %5, i64 0, i64 %191
%198 = load double, double* %197
%199 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %135, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i32 %175, i32 %186, double %188, double %190, double %193, double %198)
%200 = add nuw nsw i64 %185, 1
%201 = icmp eq i64 %200, 101
br i1 %201, label %181, label %184
202: ; preds = %25, %176, %12
%203 = phi i32 [ 1, %12 ], [ 1, %25 ], [ 0, %176 ]
ret i32 %203
}