#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 /*<<< orphan*/ assert(int);
double f_ana(double, double, int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
double get_dx_from_bounds(double, double, int);
int index_2D_to_1D(int, int, int, int);
double infinity_norm(double *, int);
double l2_norm(double *, double, double, int);
double lagrange_interp_2Dfo(double, double, int, int, double *, int, double *,
                            int, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
void test_convergence_2d(int nx[4], int ny[4], int order[3], int kx, int ky) {
  double norm = 2;
  FILE *fp;
  int i, j, k, o, i1d;
  double dx, dy;
  double *x[4];
  double *y[4];
  double *f[4];
  double *f_interp[3];
  double *f_error[3];
  double norm_error[3][3];
  printf("Testing 2D convergence\n");
  printf("Using frequencies:\n\tkx = %d\n\tky = %d\n", kx, ky);
  printf("Using %d resolutions:\n", 3);
  printf("\tnx = [ ");
  for (i = 0; i < 3; i++) {
    printf("%d ", nx[i]);
  }
  printf("]\n");
  printf("\tny = [ ");
  for (i = 0; i < 3; i++) {
    printf("%d ", ny[i]);
  }
  printf("]\n");
  printf("Using %d orders\n", 3);
  printf("\tO = [ ");
  for (i = 0; i < 3; ++i) {
    printf("%d ", order[i]);
  }
  printf("]\n");
  printf("Generating grids");
  for (i = 0; i < 4; ++i) {
    x[i] = (double *)malloc(sizeof(double) * nx[i]);
    y[i] = (double *)malloc(sizeof(double) * ny[i]);
    f[i] = (double *)malloc(sizeof(double) * nx[i] * ny[i]);
    dx = get_dx_from_bounds(-1.0 * 3.14159265358979323846,
                            3.14159265358979323846, nx[i]);
    dy = get_dx_from_bounds(-1.0 * 3.14159265358979323846,
                            3.14159265358979323846, ny[i]);
    for (int j = 0; j < nx[i]; ++j) {
      x[i][j] = -1.0 * 3.14159265358979323846 + j * dx;
      for (int k = 0; k < ny[i]; ++k) {
        y[i][k] = -1.0 * 3.14159265358979323846 + k * dy;
        i1d = index_2D_to_1D(j, nx[i], k, ny[i]);
        f[i][i1d] = f_ana(x[i][j], y[i][k], kx, ky);
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    f_interp[i] = (double *)malloc(sizeof(double) * nx[4 - 1] * ny[4 - 1]);
    f_error[i] = (double *)malloc(sizeof(double) * nx[4 - 1] * ny[4 - 1]);
  }
  printf("Interpolating and calculating error\n");
  for (o = 0; o < 3; ++o) {
    printf("\tCalculating for order %d\n", order[o]);
    for (i = 0; i < 3; ++i) {
      printf("\t\tfor resolution [nx,ny] = [%d,%d]\n", nx[i], ny[i]);
      for (j = 0; j < nx[4 - 1]; ++j) {
        for (k = 0; k < ny[4 - 1]; ++k) {
          i1d = index_2D_to_1D(j, nx[4 - 1], k, ny[4 - 1]);
          f_interp[i][i1d] =
              lagrange_interp_2Dfo(x[4 - 1][j], y[4 - 1][k], order[o], order[o],
                                   x[i], nx[i], y[i], ny[i], f[i]);
          f_error[i][i1d] = f_interp[i][i1d] - f[4 - 1][i1d];
        }
      }
      if (norm == 2) {
        dx = x[i][1] - x[i][0];
        dy = y[i][1] - y[i][0];
        norm_error[o][i] = l2_norm(f_error[i], dx, dy, nx[4 - 1] * ny[4 - 1]);
      } else if (norm == 1) {
        norm_error[o][i] = infinity_norm(f_error[i], nx[4 - 1] * ny[4 - 1]);
      } else {
        printf("ERROR norm not supported.\n");
        assert(norm == 2 || norm == 1);
      }
    }
  }
  printf("Saving to file.\n");
  fp = fopen("convergence_norm.out", "w");
  fprintf(fp, "#nx ny error,order =");
  for (o = 0; o < 3; ++o) {
    fprintf(fp, " %d", order[o]);
  }
  fprintf(fp, "\n");
  for (i = 0; i < 3; ++i) {
    fprintf(fp, "%d %d", nx[i], ny[i]);
    for (o = 0; o < 3; ++o) {
      fprintf(fp, " %lf", norm_error[o][i]);
    }
    fprintf(fp, "\n");
  }
  fclose(fp);
  printf("Cleaning up.\n");
  for (i = 0; i < 4; ++i) {
    free(x[i]);
    free(y[i]);
    free(f[i]);
  }
  for (i = 0; i < 3; ++i) {
    free(f_interp[i]);
    free(f_error[i]);
  }
}


x86 assembly (clang, -O0):
<test_convergence_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movsd  0xe0a(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe3a(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1276 <test_convergence_2d+0xa6>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1245 <test_convergence_2d+0x75>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    12ca <test_convergence_2d+0xfa>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1299 <test_convergence_2d+0xc9>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdac(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1331 <test_convergence_2d+0x161>
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1300 <test_convergence_2d+0x130>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd5e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1587 <test_convergence_2d+0x3b7>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
mov    %rcx,-0x80(%rbp,%rax,8)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
mov    %rcx,-0xa0(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movslq (%rax,%rcx,4),%rax
shl    $0x3,%rax
mov    -0x10(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,%rcx
movslq -0x34(%rbp),%rax
mov    %rcx,-0xc0(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
movsd  0xc20(%rip),%xmm0
movsd  0xc20(%rip),%xmm1
call   1030 <get_dx_from_bounds@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
movsd  0xbfb(%rip),%xmm0
movsd  0xbfb(%rip),%xmm1
call   1030 <get_dx_from_bounds@plt>
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x154(%rbp)
mov    -0x154(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x34(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1574 <test_convergence_2d+0x3a4>
cvtsi2sdl -0x154(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbaf(%rip),%xmm1
addsd  %xmm1,%xmm0
movslq -0x34(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rax
movslq -0x154(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x158(%rbp)
mov    -0x158(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x34(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    155b <test_convergence_2d+0x38b>
cvtsi2sdl -0x158(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb5c(%rip),%xmm1
addsd  %xmm1,%xmm0
movslq -0x34(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
movslq -0x158(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x154(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x158(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
call   10e0 <index_2D_to_1D@plt>
mov    %eax,-0x44(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rax
movslq -0x154(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x34(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
movslq -0x158(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   10f0 <f_ana@plt>
movslq -0x34(%rbp),%rax
mov    -0xc0(%rbp,%rax,8),%rax
ff
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x158(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x158(%rbp)
jmp    1484 <test_convergence_2d+0x2b4>
jmp    1560 <test_convergence_2d+0x390>
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    1431 <test_convergence_2d+0x261>
jmp    1579 <test_convergence_2d+0x3a9>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1354 <test_convergence_2d+0x184>
movl   $0x0,-0x15c(%rbp)
cmpl   $0x3,-0x15c(%rbp)
jge    1614 <test_convergence_2d+0x444>
mov    -0x8(%rbp),%rax
movslq 0xc(%rax),%rax
shl    $0x3,%rax
mov    -0x10(%rbp),%rcx
movslq 0xc(%rcx),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,%rcx
movslq -0x15c(%rbp),%rax
mov    %rcx,-0xe0(%rbp,%rax,8)
ff
mov    -0x8(%rbp),%rax
movslq 0xc(%rax),%rax
shl    $0x3,%rax
mov    -0x10(%rbp),%rcx
movslq 0xc(%rcx),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,%rcx
movslq -0x15c(%rbp),%rax
mov    %rcx,-0x100(%rbp,%rax,8)
ff
mov    -0x15c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x15c(%rbp)
jmp    1591 <test_convergence_2d+0x3c1>
lea    0xa9a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x40(%rbp)
jge    194b <test_convergence_2d+0x77b>
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xa95(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1938 <test_convergence_2d+0x768>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xa7b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jge    17af <test_convergence_2d+0x5df>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    0xc(%rcx),%eax
jge    179c <test_convergence_2d+0x5cc>
mov    -0x38(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x3c(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
call   10e0 <index_2D_to_1D@plt>
mov    %eax,-0x44(%rbp)
mov    -0x68(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x88(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
movslq -0x34(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x34(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%r8
ff
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%r9
mov    (%rax,%r9,4),%r9d
movslq -0x34(%rbp),%rax
mov    -0xc0(%rbp,%rax,8),%rax
ff
mov    %rax,(%rsp)
call   1080 <lagrange_interp_2Dfo@plt>
movslq -0x34(%rbp),%rax
mov    -0xe0(%rbp,%rax,8),%rax
ff
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movslq -0x34(%rbp),%rax
mov    -0xe0(%rbp,%rax,8),%rax
ff
movslq -0x44(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xa8(%rbp),%rax
movslq -0x44(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movslq -0x34(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%rax
ff
movslq -0x44(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    169f <test_convergence_2d+0x4cf>
jmp    17a1 <test_convergence_2d+0x5d1>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1688 <test_convergence_2d+0x4b8>
movsd  -0x28(%rbp),%xmm0
movsd  0x844(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    185c <test_convergence_2d+0x68c>
jp     185c <test_convergence_2d+0x68c>
movslq -0x34(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rax
movsd  0x8(%rax),%xmm0
movslq -0x34(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movslq -0x34(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
movsd  0x8(%rax),%xmm0
movslq -0x34(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rax
ff
subsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%rdi
ff
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x10(%rbp),%rax
imul   0xc(%rax),%esi
call   1050 <l2_norm@plt>
movslq -0x40(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1925 <test_convergence_2d+0x755>
movsd  -0x28(%rbp),%xmm0
movsd  0x79f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    18b9 <test_convergence_2d+0x6e9>
jp     18b9 <test_convergence_2d+0x6e9>
movslq -0x34(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%rdi
ff
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x10(%rbp),%rax
imul   0xc(%rax),%esi
call   1090 <infinity_norm@plt>
movslq -0x40(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1920 <test_convergence_2d+0x750>
lea    0x859(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%al
movsd  0x72a(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x15d(%rbp)
jne    18f1 <test_convergence_2d+0x721>
jp     18f1 <test_convergence_2d+0x721>
jmp    1910 <test_convergence_2d+0x740>
movsd  -0x28(%rbp),%xmm0
movsd  0x70a(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x15d(%rbp)
mov    -0x15d(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
jmp    1925 <test_convergence_2d+0x755>
jmp    192a <test_convergence_2d+0x75a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1653 <test_convergence_2d+0x483>
jmp    193d <test_convergence_2d+0x76d>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1629 <test_convergence_2d+0x459>
lea    0x7e2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0x7e5(%rip),%rdi
lea    0x7f3(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0x7e1(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x40(%rbp)
jge    19be <test_convergence_2d+0x7ee>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0x7ca(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1989 <test_convergence_2d+0x7b9>
mov    -0x30(%rbp),%rdi
lea    0x769(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1a75 <test_convergence_2d+0x8a5>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0x76f(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0x3,-0x40(%rbp)
jge    1a55 <test_convergence_2d+0x885>
mov    -0x30(%rbp),%rdi
movslq -0x40(%rbp),%rcx
lea    -0x150(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0x737(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1a10 <test_convergence_2d+0x840>
mov    -0x30(%rbp),%rdi
lea    0x6d2(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    19d7 <test_convergence_2d+0x807>
mov    -0x30(%rbp),%rdi
call   1060 <fclose@plt>
lea    0x6f7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
jge    1adb <test_convergence_2d+0x90b>
movslq -0x34(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rdi
call   1040 <free@plt>
movslq -0x34(%rbp),%rax
mov    -0xa0(%rbp,%rax,8),%rdi
ff
call   1040 <free@plt>
movslq -0x34(%rbp),%rax
mov    -0xc0(%rbp,%rax,8),%rdi
ff
call   1040 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1a93 <test_convergence_2d+0x8c3>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1b1c <test_convergence_2d+0x94c>
movslq -0x34(%rbp),%rax
mov    -0xe0(%rbp,%rax,8),%rdi
ff
call   1040 <free@plt>
movslq -0x34(%rbp),%rax
mov    -0x100(%rbp,%rax,8),%rdi
ff
call   1040 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1ae2 <test_convergence_2d+0x912>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_convergence_2d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x158,%rsp
mov    %r8d,%r13d
mov    %ecx,%ebp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
lea    0xefd(%rip),%rdi
call   1060 <puts@plt>
lea    0xdfe(%rip),%rdi
mov    %ebp,0x38(%rsp)
mov    %ebp,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe0d(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r12),%esi
lea    0xe08(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x4(%r12),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x8(%r12),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xe9d(%rip),%r15
mov    %r15,%rdi
call   1060 <puts@plt>
lea    0xdce(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x4(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,0x10(%rsp)
mov    0x8(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
call   1060 <puts@plt>
lea    0xd96(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd94(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r14),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x4(%r14),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,0x48(%rsp)
mov    0x8(%r14),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r12,%r14
call   1060 <puts@plt>
lea    0xd55(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %edx,%edx
mov    %r12,0x18(%rsp)
jmp    134e <test_convergence_2d+0x16e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdx
cmp    $0x4,%rdx
je     150c <test_convergence_2d+0x32c>
mov    %rdx,0x8(%rsp)
mov    (%r14,%rdx,4),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%rax
mov    %rbx,0x90(%rsp,%rax,8)
mov    0x10(%rsp),%rbp
mov    0x8(%rsp),%rax
mov    0x0(%rbp,%rax,4),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    0x8(%rsp),%rax
mov    %r12,0x70(%rsp,%rax,8)
mov    0x8(%rsp),%rax
mov    (%r14,%rax,4),%edi
mov    0x8(%rsp),%rax
imul   0x0(%rbp,%rax,4),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,%r15
mov    0x8(%rsp),%rax
mov    %r15,0xd0(%rsp,%rax,8)
mov    0x8(%rsp),%rax
mov    (%r14,%rax,4),%edi
movsd  0xc32(%rip),%xmm0
movsd  0xc32(%rip),%xmm1
call   1030 <get_dx_from_bounds@plt>
movsd  %xmm0,0x40(%rsp)
mov    0x8(%rsp),%rax
mov    0x0(%rbp,%rax,4),%edi
movsd  0xc0e(%rip),%xmm0
movsd  0xc0e(%rip),%xmm1
call   1030 <get_dx_from_bounds@plt>
movsd  0xbf9(%rip),%xmm1
mov    0x8(%rsp),%rdx
mov    (%r14,%rdx,4),%esi
test   %esi,%esi
jle    1340 <test_convergence_2d+0x160>
movapd %xmm0,%xmm2
mov    0x0(%rbp,%rdx,4),%ecx
xor    %ebp,%ebp
movsd  %xmm0,0x30(%rsp)
mov    %r15,0x20(%rsp)
mov    %rbx,0x28(%rsp)
jmp    1460 <test_convergence_2d+0x280>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13d,%ebx
add    $0x1,%rbp
movslq %esi,%rax
cmp    %rax,%rbp
mov    0x18(%rsp),%r14
mov    %ebx,%r13d
mov    0x28(%rsp),%rbx
jge    1340 <test_convergence_2d+0x160>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0x40(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
test   %ecx,%ecx
jle    1440 <test_convergence_2d+0x260>
xor    %r15d,%r15d
mov    %r13d,%ebx
mov    0x38(%rsp),%r14d
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r12,%r15,8)
mov    %ebp,%edi
mov    %r15d,%edx
call   10f0 <index_2D_to_1D@plt>
mov    %eax,%r13d
mov    0x28(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
movsd  (%r12,%r15,8),%xmm1
mov    %r14d,%edi
mov    %ebx,%esi
call   1100 <f_ana@plt>
movsd  0x30(%rsp),%xmm2
movsd  0xb25(%rip),%xmm1
mov    0x8(%rsp),%rdx
movslq %r13d,%rax
mov    0x20(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
add    $0x1,%r15
mov    0x10(%rsp),%rax
movslq (%rax,%rdx,4),%rcx
mov    0x18(%rsp),%rax
mov    (%rax,%rdx,4),%esi
cmp    %rcx,%r15
jl     1490 <test_convergence_2d+0x2b0>
jmp    1443 <test_convergence_2d+0x263>
mov    0xc(%r14),%edi
mov    0x10(%rsp),%rbp
imul   0xc(%rbp),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %rax,0xf0(%rsp)
mov    0xc(%r14),%edi
imul   0xc(%rbp),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    %rax,0xb0(%rsp)
mov    0xc(%r14),%edi
imul   0xc(%rbp),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,0x68(%rsp)
mov    %rax,0xf8(%rsp)
mov    0xc(%r14),%edi
imul   0xc(%rbp),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,0x60(%rsp)
mov    %rax,0xb8(%rsp)
mov    0xc(%r14),%edi
imul   0xc(%rbp),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %rax,0x100(%rsp)
mov    0xc(%r14),%edi
imul   0xc(%rbp),%edi
shl    $0x3,%edi
call   10c0 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    %rax,0xc0(%rsp)
lea    0xb56(%rip),%rdi
call   1060 <puts@plt>
mov    0xa8(%rsp),%rbp
mov    0x88(%rsp),%r12
mov    0xe8(%rsp),%r13
xor    %eax,%eax
mov    0x48(%rsp),%rbx
mov    %rbp,0x8(%rsp)
mov    %r12,0x30(%rsp)
jmp    1618 <test_convergence_2d+0x438>
cs nopw 0x0(%rax,%rax,1)
mov    0x20(%rsp),%rax
add    $0x1,%rax
cmp    $0x3,%rax
mov    0x48(%rsp),%rbx
je     17b4 <test_convergence_2d+0x5d4>
mov    %rax,0x20(%rsp)
mov    (%rbx,%rax,4),%esi
lea    0xa66(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xor    %r14d,%r14d
jmp    169c <test_convergence_2d+0x4bc>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%r15),%ecx
imul   %esi,%ecx
mov    0x90(%rsp,%r14,8),%rax
movsd  0x8(%rax),%xmm0
subsd  (%rax),%xmm0
mov    0x70(%rsp,%r14,8),%rax
movsd  0x8(%rax),%xmm1
subsd  (%rax),%xmm1
mov    0xb0(%rsp,%r14,8),%rdi
mov    %ecx,%esi
call   1050 <l2_norm@plt>
mov    0x20(%rsp),%rax
lea    (%rax,%rax,2),%rax
lea    (%rsp,%rax,8),%rax
add    $0x110,%rax
movsd  %xmm0,(%rax,%r14,8)
add    $0x1,%r14
cmp    $0x3,%r14
je     1600 <test_convergence_2d+0x420>
mov    0x18(%rsp),%rbx
mov    (%rbx,%r14,4),%esi
mov    0x10(%rsp),%r15
mov    (%r15,%r14,4),%edx
lea    0x9f3(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0xc(%rbx),%esi
test   %esi,%esi
jle    1640 <test_convergence_2d+0x460>
mov    0xc(%r15),%ecx
xor    %eax,%eax
jmp    16f2 <test_convergence_2d+0x512>
nop
mov    0x28(%rsp),%rdx
add    $0x1,%rdx
movslq %esi,%rax
cmp    %rax,%rdx
mov    0x30(%rsp),%r12
mov    0x8(%rsp),%rbp
mov    %rdx,%rax
jge    1644 <test_convergence_2d+0x464>
test   %ecx,%ecx
mov    %rax,0x28(%rsp)
jle    16d0 <test_convergence_2d+0x4f0>
xor    %r12d,%r12d
mov    0x18(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x28(%rsp),%rbx
mov    %ebx,%edi
mov    %r12d,%edx
call   10f0 <index_2D_to_1D@plt>
mov    %r13,%r15
mov    %eax,%r13d
mov    0x8(%rsp),%rax
movsd  (%rax,%rbx,8),%xmm0
mov    0x30(%rsp),%rax
movsd  (%rax,%r12,8),%xmm1
mov    0x48(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x90(%rsp,%r14,8),%rdx
mov    0x0(%rbp,%r14,4),%ecx
mov    0x70(%rsp,%r14,8),%r8
mov    0x10(%rsp),%rbx
mov    (%rbx,%r14,4),%r9d
mov    0xd0(%rsp,%r14,8),%rax
mov    %rax,(%rsp)
mov    %edi,%esi
call   1090 <lagrange_interp_2Dfo@plt>
mov    0xf0(%rsp,%r14,8),%rax
movslq %r13d,%rcx
mov    %r15,%r13
movsd  %xmm0,(%rax,%rcx,8)
subsd  (%r15,%rcx,8),%xmm0
mov    0xb0(%rsp,%r14,8),%rax
movsd  %xmm0,(%rax,%rcx,8)
add    $0x1,%r12
movslq 0xc(%rbx),%rcx
mov    0xc(%rbp),%esi
cmp    %rcx,%r12
jl     1710 <test_convergence_2d+0x530>
jmp    16d0 <test_convergence_2d+0x4f0>
lea    0x985(%rip),%rdi
call   1060 <puts@plt>
lea    0x905(%rip),%rdi
lea    0x913(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r14
lea    0x906(%rip),%rdi
mov    $0x14,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10e0 <fwrite@plt>
mov    (%rbx),%edx
lea    0x902(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    0x4(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    0x8(%rbx),%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    $0xa,%edi
mov    %r14,%rsi
mov    %r14,%rbx
call   10a0 <fputc@plt>
mov    0x18(%rsp),%r14
mov    (%r14),%edx
mov    0x10(%rsp),%rax
mov    (%rax),%ecx
lea    0x8ad(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <fprintf@plt>
movsd  0x110(%rsp),%xmm0
lea    0x899(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
movsd  0x128(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
movsd  0x140(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   10a0 <fputc@plt>
mov    0x4(%r14),%edx
mov    0x10(%rsp),%r15
mov    0x4(%r15),%ecx
mov    %rbx,%rdi
lea    0x836(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
movsd  0x118(%rsp),%xmm0
mov    %rbx,%rdi
lea    0x822(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
movsd  0x130(%rsp),%xmm0
mov    %rbx,%rdi
lea    0x808(%rip),%rsi
mov    %rsi,%r14
mov    $0x1,%al
call   10b0 <fprintf@plt>
movsd  0x148(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   10a0 <fputc@plt>
mov    0x18(%rsp),%rax
mov    0x8(%rax),%edx
mov    0x8(%r15),%ecx
mov    %rbx,%rdi
lea    0x7bf(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
movsd  0x120(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
movsd  0x138(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
movsd  0x150(%rsp),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   10a0 <fputc@plt>
mov    %rbx,%rdi
call   1070 <fclose@plt>
lea    0x7b2(%rip),%rdi
call   1060 <puts@plt>
mov    0x90(%rsp),%rdi
call   1040 <free@plt>
mov    0x70(%rsp),%rdi
call   1040 <free@plt>
mov    0xd0(%rsp),%rdi
call   1040 <free@plt>
mov    0x98(%rsp),%rdi
call   1040 <free@plt>
mov    0x78(%rsp),%rdi
call   1040 <free@plt>
mov    0xd8(%rsp),%rdi
call   1040 <free@plt>
mov    0xa0(%rsp),%rdi
call   1040 <free@plt>
mov    0x80(%rsp),%rdi
call   1040 <free@plt>
mov    0xe0(%rsp),%rdi
call   1040 <free@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
mov    %r12,%rdi
call   1040 <free@plt>
mov    %r13,%rdi
call   1040 <free@plt>
mov    0x40(%rsp),%rdi
call   1040 <free@plt>
mov    0x38(%rsp),%rdi
call   1040 <free@plt>
mov    0x68(%rsp),%rdi
call   1040 <free@plt>
mov    0x60(%rsp),%rdi
call   1040 <free@plt>
mov    0x58(%rsp),%rdi
call   1040 <free@plt>
mov    0x50(%rsp),%rdi
add    $0x158,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Testing 2D convergence\0A\00"
@.str.1 = [38 x i8] c"Using frequencies:\0A\09kx = %d\0A\09ky = %d\0A\00"
@.str.2 = [23 x i8] c"Using %d resolutions:\0A\00"
@.str.3 = [9 x i8] c"\09nx = [ \00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [3 x i8] c"]\0A\00"
@.str.6 = [9 x i8] c"\09ny = [ \00"
@.str.7 = [17 x i8] c"Using %d orders\0A\00"
@.str.8 = [8 x i8] c"\09O = [ \00"
@.str.9 = [17 x i8] c"Generating grids\00"
@.str.10 = [37 x i8] c"Interpolating and calculating error\0A\00"
@.str.11 = [27 x i8] c"\09Calculating for order %d\0A\00"
@.str.12 = [36 x i8] c"\09\09for resolution [nx,ny] = [%d,%d]\0A\00"
@.str.13 = [27 x i8] c"ERROR norm not supported.\0A\00"
@.str.14 = [17 x i8] c"Saving to file.\0A\00"
@.str.15 = [21 x i8] c"convergence_norm.out\00"
@.str.16 = [2 x i8] c"w\00"
@.str.17 = [21 x i8] c"#nx ny error,order =\00"
@.str.18 = [4 x i8] c" %d\00"
@.str.19 = [2 x i8] c"\0A\00"
@.str.20 = [6 x i8] c"%d %d\00"
@.str.21 = [5 x i8] c" %lf\00"
@.str.22 = [14 x i8] c"Cleaning up.\0A\00"
define void @test_convergence_2d(i32* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca [4 x double*]
%21 = alloca [4 x double*]
%22 = alloca [4 x double*]
%23 = alloca [3 x double*]
%24 = alloca [3 x double*]
%25 = alloca [3 x [3 x double]]
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store double 2.000000e+00, double* %11
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 3)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %13
br label %35
35: ; preds = %45, %5
%36 = load i32, i32* %13
%37 = icmp slt i32 %36, 3
br i1 %37, label %38, label %48
38: ; preds = %35
%39 = load i32*, i32** %6
%40 = load i32, i32* %13
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %38
%46 = load i32, i32* %13
%47 = add nsw i32 %46, 1
store i32 %47, i32* %13
br label %35
48: ; preds = %35
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %13
br label %51
51: ; preds = %61, %48
%52 = load i32, i32* %13
%53 = icmp slt i32 %52, 3
br i1 %53, label %54, label %64
54: ; preds = %51
%55 = load i32*, i32** %7
%56 = load i32, i32* %13
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %55, i64 %57
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %54
%62 = load i32, i32* %13
%63 = add nsw i32 %62, 1
store i32 %63, i32* %13
br label %51
64: ; preds = %51
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 3)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %13
br label %68
68: ; preds = %78, %64
%69 = load i32, i32* %13
%70 = icmp slt i32 %69, 3
br i1 %70, label %71, label %81
71: ; preds = %68
%72 = load i32*, i32** %8
%73 = load i32, i32* %13
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i32, i32* %72, i64 %74
%76 = load i32, i32* %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %71
%79 = load i32, i32* %13
%80 = add nsw i32 %79, 1
store i32 %80, i32* %13
br label %68
81: ; preds = %68
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %13
br label %84
84: ; preds = %233, %81
%85 = load i32, i32* %13
%86 = icmp slt i32 %85, 4
br i1 %86, label %87, label %236
87: ; preds = %84
%88 = load i32*, i32** %6
%89 = load i32, i32* %13
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i32, i32* %88, i64 %90
%92 = load i32, i32* %91
%93 = sext i32 %92 to i64
%94 = mul i64 8, %93
%95 = trunc i64 %94 to i32
%96 = call i64 @malloc(i32 %95)
%97 = inttoptr i64 %96 to double*
%98 = load i32, i32* %13
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %99
store double* %97, double** %100
%101 = load i32*, i32** %7
%102 = load i32, i32* %13
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %101, i64 %103
%105 = load i32, i32* %104
%106 = sext i32 %105 to i64
%107 = mul i64 8, %106
%108 = trunc i64 %107 to i32
%109 = call i64 @malloc(i32 %108)
%110 = inttoptr i64 %109 to double*
%111 = load i32, i32* %13
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %112
store double* %110, double** %113
%114 = load i32*, i32** %6
%115 = load i32, i32* %13
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i32, i32* %114, i64 %116
%118 = load i32, i32* %117
%119 = sext i32 %118 to i64
%120 = mul i64 8, %119
%121 = load i32*, i32** %7
%122 = load i32, i32* %13
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i32, i32* %121, i64 %123
%125 = load i32, i32* %124
%126 = sext i32 %125 to i64
%127 = mul i64 %120, %126
%128 = trunc i64 %127 to i32
%129 = call i64 @malloc(i32 %128)
%130 = inttoptr i64 %129 to double*
%131 = load i32, i32* %13
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [4 x double*], [4 x double*]* %22, i64 0, i64 %132
store double* %130, double** %133
%134 = load i32*, i32** %6
%135 = load i32, i32* %13
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i32, i32* %134, i64 %136
%138 = load i32, i32* %137
%139 = call double @get_dx_from_bounds(double 0xC00921FB54442D18, double 0x400921FB54442D18, i32 %138)
store double %139, double* %18
%140 = load i32*, i32** %7
%141 = load i32, i32* %13
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i32, i32* %140, i64 %142
%144 = load i32, i32* %143
%145 = call double @get_dx_from_bounds(double 0xC00921FB54442D18, double 0x400921FB54442D18, i32 %144)
store double %145, double* %19
store i32 0, i32* %26
br label %146
146: ; preds = %229, %87
%147 = load i32, i32* %26
%148 = load i32*, i32** %6
%149 = load i32, i32* %13
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32, i32* %148, i64 %150
%152 = load i32, i32* %151
%153 = icmp slt i32 %147, %152
br i1 %153, label %154, label %232
154: ; preds = %146
%155 = load i32, i32* %26
%156 = sitofp i32 %155 to double
%157 = load double, double* %18
%158 = call double @llvm.fmuladd.f64(double %156, double %157, double 0xC00921FB54442D18)
%159 = load i32, i32* %13
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %160
%162 = load double*, double** %161
%163 = load i32, i32* %26
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
store double %158, double* %165
store i32 0, i32* %27
br label %166
166: ; preds = %225, %154
%167 = load i32, i32* %27
%168 = load i32*, i32** %7
%169 = load i32, i32* %13
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i32, i32* %168, i64 %170
%172 = load i32, i32* %171
%173 = icmp slt i32 %167, %172
br i1 %173, label %174, label %228
174: ; preds = %166
%175 = load i32, i32* %27
%176 = sitofp i32 %175 to double
%177 = load double, double* %19
%178 = call double @llvm.fmuladd.f64(double %176, double %177, double 0xC00921FB54442D18)
%179 = load i32, i32* %13
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %180
%182 = load double*, double** %181
%183 = load i32, i32* %27
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
store double %178, double* %185
%186 = load i32, i32* %26
%187 = load i32*, i32** %6
%188 = load i32, i32* %13
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32, i32* %187, i64 %189
%191 = load i32, i32* %190
%192 = load i32, i32* %27
%193 = load i32*, i32** %7
%194 = load i32, i32* %13
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds i32, i32* %193, i64 %195
%197 = load i32, i32* %196
%198 = call i32 @index_2D_to_1D(i32 %186, i32 %191, i32 %192, i32 %197)
store i32 %198, i32* %17
%199 = load i32, i32* %13
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %200
%202 = load double*, double** %201
%203 = load i32, i32* %26
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %202, i64 %204
%206 = load double, double* %205
%207 = load i32, i32* %13
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %208
%210 = load double*, double** %209
%211 = load i32, i32* %27
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %210, i64 %212
%214 = load double, double* %213
%215 = load i32, i32* %9
%216 = load i32, i32* %10
%217 = call double @f_ana(double %206, double %214, i32 %215, i32 %216)
%218 = load i32, i32* %13
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds [4 x double*], [4 x double*]* %22, i64 0, i64 %219
%221 = load double*, double** %220
%222 = load i32, i32* %17
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds double, double* %221, i64 %223
store double %217, double* %224
br label %225
225: ; preds = %174
%226 = load i32, i32* %27
%227 = add nsw i32 %226, 1
store i32 %227, i32* %27
br label %166
228: ; preds = %166
br label %229
229: ; preds = %228
%230 = load i32, i32* %26
%231 = add nsw i32 %230, 1
store i32 %231, i32* %26
br label %146
232: ; preds = %146
br label %233
233: ; preds = %232
%234 = load i32, i32* %13
%235 = add nsw i32 %234, 1
store i32 %235, i32* %13
br label %84
236: ; preds = %84
store i32 0, i32* %28
br label %237
237: ; preds = %273, %236
%238 = load i32, i32* %28
%239 = icmp slt i32 %238, 3
br i1 %239, label %240, label %276
240: ; preds = %237
%241 = load i32*, i32** %6
%242 = getelementptr inbounds i32, i32* %241, i64 3
%243 = load i32, i32* %242
%244 = sext i32 %243 to i64
%245 = mul i64 8, %244
%246 = load i32*, i32** %7
%247 = getelementptr inbounds i32, i32* %246, i64 3
%248 = load i32, i32* %247
%249 = sext i32 %248 to i64
%250 = mul i64 %245, %249
%251 = trunc i64 %250 to i32
%252 = call i64 @malloc(i32 %251)
%253 = inttoptr i64 %252 to double*
%254 = load i32, i32* %28
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds [3 x double*], [3 x double*]* %23, i64 0, i64 %255
store double* %253, double** %256
%257 = load i32*, i32** %6
%258 = getelementptr inbounds i32, i32* %257, i64 3
%259 = load i32, i32* %258
%260 = sext i32 %259 to i64
%261 = mul i64 8, %260
%262 = load i32*, i32** %7
%263 = getelementptr inbounds i32, i32* %262, i64 3
%264 = load i32, i32* %263
%265 = sext i32 %264 to i64
%266 = mul i64 %261, %265
%267 = trunc i64 %266 to i32
%268 = call i64 @malloc(i32 %267)
%269 = inttoptr i64 %268 to double*
%270 = load i32, i32* %28
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [3 x double*], [3 x double*]* %24, i64 0, i64 %271
store double* %269, double** %272
br label %273
273: ; preds = %240
%274 = load i32, i32* %28
%275 = add nsw i32 %274, 1
store i32 %275, i32* %28
br label %237
276: ; preds = %237
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %16
br label %278
278: ; preds = %496, %276
%279 = load i32, i32* %16
%280 = icmp slt i32 %279, 3
br i1 %280, label %281, label %499
281: ; preds = %278
%282 = load i32*, i32** %8
%283 = load i32, i32* %16
%284 = sext i32 %283 to i64
%285 = getelementptr inbounds i32, i32* %282, i64 %284
%286 = load i32, i32* %285
%287 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %286)
store i32 0, i32* %13
br label %288
288: ; preds = %492, %281
%289 = load i32, i32* %13
%290 = icmp slt i32 %289, 3
br i1 %290, label %291, label %495
291: ; preds = %288
%292 = load i32*, i32** %6
%293 = load i32, i32* %13
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds i32, i32* %292, i64 %294
%296 = load i32, i32* %295
%297 = load i32*, i32** %7
%298 = load i32, i32* %13
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds i32, i32* %297, i64 %299
%301 = load i32, i32* %300
%302 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %296, i32 %301)
store i32 0, i32* %14
br label %303
303: ; preds = %404, %291
%304 = load i32, i32* %14
%305 = load i32*, i32** %6
%306 = getelementptr inbounds i32, i32* %305, i64 3
%307 = load i32, i32* %306
%308 = icmp slt i32 %304, %307
br i1 %308, label %309, label %407
309: ; preds = %303
store i32 0, i32* %15
br label %310
310: ; preds = %400, %309
%311 = load i32, i32* %15
%312 = load i32*, i32** %7
%313 = getelementptr inbounds i32, i32* %312, i64 3
%314 = load i32, i32* %313
%315 = icmp slt i32 %311, %314
br i1 %315, label %316, label %403
316: ; preds = %310
%317 = load i32, i32* %14
%318 = load i32*, i32** %6
%319 = getelementptr inbounds i32, i32* %318, i64 3
%320 = load i32, i32* %319
%321 = load i32, i32* %15
%322 = load i32*, i32** %7
%323 = getelementptr inbounds i32, i32* %322, i64 3
%324 = load i32, i32* %323
%325 = call i32 @index_2D_to_1D(i32 %317, i32 %320, i32 %321, i32 %324)
store i32 %325, i32* %17
%326 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 3
%327 = load double*, double** %326
%328 = load i32, i32* %14
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds double, double* %327, i64 %329
%331 = load double, double* %330
%332 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 3
%333 = load double*, double** %332
%334 = load i32, i32* %15
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds double, double* %333, i64 %335
%337 = load double, double* %336
%338 = load i32*, i32** %8
%339 = load i32, i32* %16
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds i32, i32* %338, i64 %340
%342 = load i32, i32* %341
%343 = load i32*, i32** %8
%344 = load i32, i32* %16
%345 = sext i32 %344 to i64
%346 = getelementptr inbounds i32, i32* %343, i64 %345
%347 = load i32, i32* %346
%348 = load i32, i32* %13
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %349
%351 = load double*, double** %350
%352 = load i32*, i32** %6
%353 = load i32, i32* %13
%354 = sext i32 %353 to i64
%355 = getelementptr inbounds i32, i32* %352, i64 %354
%356 = load i32, i32* %355
%357 = load i32, i32* %13
%358 = sext i32 %357 to i64
%359 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %358
%360 = load double*, double** %359
%361 = load i32*, i32** %7
%362 = load i32, i32* %13
%363 = sext i32 %362 to i64
%364 = getelementptr inbounds i32, i32* %361, i64 %363
%365 = load i32, i32* %364
%366 = load i32, i32* %13
%367 = sext i32 %366 to i64
%368 = getelementptr inbounds [4 x double*], [4 x double*]* %22, i64 0, i64 %367
%369 = load double*, double** %368
%370 = call double @lagrange_interp_2Dfo(double %331, double %337, i32 %342, i32 %347, double* %351, i32 %356, double* %360, i32 %365, double* %369)
%371 = load i32, i32* %13
%372 = sext i32 %371 to i64
%373 = getelementptr inbounds [3 x double*], [3 x double*]* %23, i64 0, i64 %372
%374 = load double*, double** %373
%375 = load i32, i32* %17
%376 = sext i32 %375 to i64
%377 = getelementptr inbounds double, double* %374, i64 %376
store double %370, double* %377
%378 = load i32, i32* %13
%379 = sext i32 %378 to i64
%380 = getelementptr inbounds [3 x double*], [3 x double*]* %23, i64 0, i64 %379
%381 = load double*, double** %380
%382 = load i32, i32* %17
%383 = sext i32 %382 to i64
%384 = getelementptr inbounds double, double* %381, i64 %383
%385 = load double, double* %384
%386 = getelementptr inbounds [4 x double*], [4 x double*]* %22, i64 0, i64 3
%387 = load double*, double** %386
%388 = load i32, i32* %17
%389 = sext i32 %388 to i64
%390 = getelementptr inbounds double, double* %387, i64 %389
%391 = load double, double* %390
%392 = fsub double %385, %391
%393 = load i32, i32* %13
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds [3 x double*], [3 x double*]* %24, i64 0, i64 %394
%396 = load double*, double** %395
%397 = load i32, i32* %17
%398 = sext i32 %397 to i64
%399 = getelementptr inbounds double, double* %396, i64 %398
store double %392, double* %399
br label %400
400: ; preds = %316
%401 = load i32, i32* %15
%402 = add nsw i32 %401, 1
store i32 %402, i32* %15
br label %310
403: ; preds = %310
br label %404
404: ; preds = %403
%405 = load i32, i32* %14
%406 = add nsw i32 %405, 1
store i32 %406, i32* %14
br label %303
407: ; preds = %303
%408 = load double, double* %11
%409 = fcmp oeq double %408, 2.000000e+00
br i1 %409, label %410, label %457
410: ; preds = %407
%411 = load i32, i32* %13
%412 = sext i32 %411 to i64
%413 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %412
%414 = load double*, double** %413
%415 = getelementptr inbounds double, double* %414, i64 1
%416 = load double, double* %415
%417 = load i32, i32* %13
%418 = sext i32 %417 to i64
%419 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %418
%420 = load double*, double** %419
%421 = getelementptr inbounds double, double* %420, i64 0
%422 = load double, double* %421
%423 = fsub double %416, %422
store double %423, double* %18
%424 = load i32, i32* %13
%425 = sext i32 %424 to i64
%426 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %425
%427 = load double*, double** %426
%428 = getelementptr inbounds double, double* %427, i64 1
%429 = load double, double* %428
%430 = load i32, i32* %13
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %431
%433 = load double*, double** %432
%434 = getelementptr inbounds double, double* %433, i64 0
%435 = load double, double* %434
%436 = fsub double %429, %435
store double %436, double* %19
%437 = load i32, i32* %13
%438 = sext i32 %437 to i64
%439 = getelementptr inbounds [3 x double*], [3 x double*]* %24, i64 0, i64 %438
%440 = load double*, double** %439
%441 = load double, double* %18
%442 = load double, double* %19
%443 = load i32*, i32** %6
%444 = getelementptr inbounds i32, i32* %443, i64 3
%445 = load i32, i32* %444
%446 = load i32*, i32** %7
%447 = getelementptr inbounds i32, i32* %446, i64 3
%448 = load i32, i32* %447
%449 = mul nsw i32 %445, %448
%450 = call double @l2_norm(double* %440, double %441, double %442, i32 %449)
%451 = load i32, i32* %16
%452 = sext i32 %451 to i64
%453 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %25, i64 0, i64 %452
%454 = load i32, i32* %13
%455 = sext i32 %454 to i64
%456 = getelementptr inbounds [3 x double], [3 x double]* %453, i64 0, i64 %455
store double %450, double* %456
br label %491
457: ; preds = %407
%458 = load double, double* %11
%459 = fcmp oeq double %458, 1.000000e+00
br i1 %459, label %460, label %479
460: ; preds = %457
%461 = load i32, i32* %13
%462 = sext i32 %461 to i64
%463 = getelementptr inbounds [3 x double*], [3 x double*]* %24, i64 0, i64 %462
%464 = load double*, double** %463
%465 = load i32*, i32** %6
%466 = getelementptr inbounds i32, i32* %465, i64 3
%467 = load i32, i32* %466
%468 = load i32*, i32** %7
%469 = getelementptr inbounds i32, i32* %468, i64 3
%470 = load i32, i32* %469
%471 = mul nsw i32 %467, %470
%472 = call double @infinity_norm(double* %464, i32 %471)
%473 = load i32, i32* %16
%474 = sext i32 %473 to i64
%475 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %25, i64 0, i64 %474
%476 = load i32, i32* %13
%477 = sext i32 %476 to i64
%478 = getelementptr inbounds [3 x double], [3 x double]* %475, i64 0, i64 %477
store double %472, double* %478
br label %490
479: ; preds = %457
%480 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%481 = load double, double* %11
%482 = fcmp oeq double %481, 2.000000e+00
br i1 %482, label %486, label %483
483: ; preds = %479
%484 = load double, double* %11
%485 = fcmp oeq double %484, 1.000000e+00
br label %486
486: ; preds = %483, %479
%487 = phi i1 [ true, %479 ], [ %485, %483 ]
%488 = zext i1 %487 to i32
%489 = call i32 @assert(i32 %488)
br label %490
490: ; preds = %486, %460
br label %491
491: ; preds = %490, %410
br label %492
492: ; preds = %491
%493 = load i32, i32* %13
%494 = add nsw i32 %493, 1
store i32 %494, i32* %13
br label %288
495: ; preds = %288
br label %496
496: ; preds = %495
%497 = load i32, i32* %16
%498 = add nsw i32 %497, 1
store i32 %498, i32* %16
br label %278
499: ; preds = %278
%500 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i64 0, i64 0))
%501 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
store i32* %501, i32** %12
%502 = load i32*, i32** %12
%503 = call i32 (i32*, i8*, ...) @fprintf(i32* %502, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
store i32 0, i32* %16
br label %504
504: ; preds = %515, %499
%505 = load i32, i32* %16
%506 = icmp slt i32 %505, 3
br i1 %506, label %507, label %518
507: ; preds = %504
%508 = load i32*, i32** %12
%509 = load i32*, i32** %8
%510 = load i32, i32* %16
%511 = sext i32 %510 to i64
%512 = getelementptr inbounds i32, i32* %509, i64 %511
%513 = load i32, i32* %512
%514 = call i32 (i32*, i8*, ...) @fprintf(i32* %508, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i32 %513)
br label %515
515: ; preds = %507
%516 = load i32, i32* %16
%517 = add nsw i32 %516, 1
store i32 %517, i32* %16
br label %504
518: ; preds = %504
%519 = load i32*, i32** %12
%520 = call i32 (i32*, i8*, ...) @fprintf(i32* %519, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
store i32 0, i32* %13
br label %521
521: ; preds = %556, %518
%522 = load i32, i32* %13
%523 = icmp slt i32 %522, 3
br i1 %523, label %524, label %559
524: ; preds = %521
%525 = load i32*, i32** %12
%526 = load i32*, i32** %6
%527 = load i32, i32* %13
%528 = sext i32 %527 to i64
%529 = getelementptr inbounds i32, i32* %526, i64 %528
%530 = load i32, i32* %529
%531 = load i32*, i32** %7
%532 = load i32, i32* %13
%533 = sext i32 %532 to i64
%534 = getelementptr inbounds i32, i32* %531, i64 %533
%535 = load i32, i32* %534
%536 = call i32 (i32*, i8*, ...) @fprintf(i32* %525, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %530, i32 %535)
store i32 0, i32* %16
br label %537
537: ; preds = %550, %524
%538 = load i32, i32* %16
%539 = icmp slt i32 %538, 3
br i1 %539, label %540, label %553
540: ; preds = %537
%541 = load i32*, i32** %12
%542 = load i32, i32* %16
%543 = sext i32 %542 to i64
%544 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %25, i64 0, i64 %543
%545 = load i32, i32* %13
%546 = sext i32 %545 to i64
%547 = getelementptr inbounds [3 x double], [3 x double]* %544, i64 0, i64 %546
%548 = load double, double* %547
%549 = call i32 (i32*, i8*, ...) @fprintf(i32* %541, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %548)
br label %550
550: ; preds = %540
%551 = load i32, i32* %16
%552 = add nsw i32 %551, 1
store i32 %552, i32* %16
br label %537
553: ; preds = %537
%554 = load i32*, i32** %12
%555 = call i32 (i32*, i8*, ...) @fprintf(i32* %554, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
br label %556
556: ; preds = %553
%557 = load i32, i32* %13
%558 = add nsw i32 %557, 1
store i32 %558, i32* %13
br label %521
559: ; preds = %521
%560 = load i32*, i32** %12
%561 = call i32 @fclose(i32* %560)
%562 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.22, i64 0, i64 0))
store i32 0, i32* %13
br label %563
563: ; preds = %582, %559
%564 = load i32, i32* %13
%565 = icmp slt i32 %564, 4
br i1 %565, label %566, label %585
566: ; preds = %563
%567 = load i32, i32* %13
%568 = sext i32 %567 to i64
%569 = getelementptr inbounds [4 x double*], [4 x double*]* %20, i64 0, i64 %568
%570 = load double*, double** %569
%571 = call i32 @free(double* %570)
%572 = load i32, i32* %13
%573 = sext i32 %572 to i64
%574 = getelementptr inbounds [4 x double*], [4 x double*]* %21, i64 0, i64 %573
%575 = load double*, double** %574
%576 = call i32 @free(double* %575)
%577 = load i32, i32* %13
%578 = sext i32 %577 to i64
%579 = getelementptr inbounds [4 x double*], [4 x double*]* %22, i64 0, i64 %578
%580 = load double*, double** %579
%581 = call i32 @free(double* %580)
br label %582
582: ; preds = %566
%583 = load i32, i32* %13
%584 = add nsw i32 %583, 1
store i32 %584, i32* %13
br label %563
585: ; preds = %563
store i32 0, i32* %13
br label %586
586: ; preds = %600, %585
%587 = load i32, i32* %13
%588 = icmp slt i32 %587, 3
br i1 %588, label %589, label %603
589: ; preds = %586
%590 = load i32, i32* %13
%591 = sext i32 %590 to i64
%592 = getelementptr inbounds [3 x double*], [3 x double*]* %23, i64 0, i64 %591
%593 = load double*, double** %592
%594 = call i32 @free(double* %593)
%595 = load i32, i32* %13
%596 = sext i32 %595 to i64
%597 = getelementptr inbounds [3 x double*], [3 x double*]* %24, i64 0, i64 %596
%598 = load double*, double** %597
%599 = call i32 @free(double* %598)
br label %600
600: ; preds = %589
%601 = load i32, i32* %13
%602 = add nsw i32 %601, 1
store i32 %602, i32* %13
br label %586
603: ; preds = %586
ret void
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"Using frequencies:\0A\09kx = %d\0A\09ky = %d\0A\00"
@.str.2 = [23 x i8] c"Using %d resolutions:\0A\00"
@.str.3 = [9 x i8] c"\09nx = [ \00"
@.str.4 = [4 x i8] c"%d \00"
@.str.6 = [9 x i8] c"\09ny = [ \00"
@.str.7 = [17 x i8] c"Using %d orders\0A\00"
@.str.8 = [8 x i8] c"\09O = [ \00"
@.str.9 = [17 x i8] c"Generating grids\00"
@.str.11 = [27 x i8] c"\09Calculating for order %d\0A\00"
@.str.12 = [36 x i8] c"\09\09for resolution [nx,ny] = [%d,%d]\0A\00"
@.str.15 = [21 x i8] c"convergence_norm.out\00"
@.str.16 = [2 x i8] c"w\00"
@.str.17 = [21 x i8] c"#nx ny error,order =\00"
@.str.18 = [4 x i8] c" %d\00"
@.str.20 = [6 x i8] c"%d %d\00"
@.str.21 = [5 x i8] c" %lf\00"
@str = [23 x i8] c"Testing 2D convergence\00"
@str.25 = [2 x i8] c"]\00"
@str.26 = [36 x i8] c"Interpolating and calculating error\00"
@str.27 = [16 x i8] c"Saving to file.\00"
@str.28 = [13 x i8] c"Cleaning up.\00"
define void @test_convergence_2d(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32 %3, i32 %4) {
%6 = alloca [4 x double*]
%7 = alloca [4 x double*]
%8 = alloca [4 x double*]
%9 = alloca [3 x double*]
%10 = alloca [3 x double*]
%11 = alloca [3 x [3 x double]]
%12 = bitcast [4 x double*]* %6 to i8*
%13 = bitcast [4 x double*]* %7 to i8*
%14 = bitcast [4 x double*]* %8 to i8*
%15 = bitcast [3 x double*]* %9 to i8*
%16 = bitcast [3 x double*]* %10 to i8*
%17 = bitcast [3 x [3 x double]]* %11 to i8*
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 3)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* %0
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds i32, i32* %0, i64 1
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds i32, i32* %0, i64 2
%28 = load i32, i32* %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %28)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.25, i64 0, i64 0))
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
%32 = load i32, i32* %1
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds i32, i32* %1, i64 1
%35 = load i32, i32* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds i32, i32* %1, i64 2
%38 = load i32, i32* %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %38)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.25, i64 0, i64 0))
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 3)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%43 = load i32, i32* %2
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = getelementptr inbounds i32, i32* %2, i64 1
%46 = load i32, i32* %45
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = getelementptr inbounds i32, i32* %2, i64 2
%49 = load i32, i32* %48
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %49)
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.25, i64 0, i64 0))
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
br label %105
53: ; preds = %134
%54 = getelementptr inbounds i32, i32* %0, i64 3
%55 = getelementptr inbounds i32, i32* %1, i64 3
%56 = load i32, i32* %54
%57 = shl i32 %56, 3
%58 = load i32, i32* %55
%59 = mul i32 %57, %58
%60 = tail call i64 @malloc(i32 %59)
%61 = inttoptr i64 %60 to double*
%62 = getelementptr inbounds [3 x double*], [3 x double*]* %9, i64 0, i64 0
store double* %61, double** %62
%63 = load i32, i32* %54
%64 = shl i32 %63, 3
%65 = load i32, i32* %55
%66 = mul i32 %64, %65
%67 = tail call i64 @malloc(i32 %66)
%68 = inttoptr i64 %67 to double*
%69 = getelementptr inbounds [3 x double*], [3 x double*]* %10, i64 0, i64 0
store double* %68, double** %69
%70 = load i32, i32* %54
%71 = shl i32 %70, 3
%72 = load i32, i32* %55
%73 = mul i32 %71, %72
%74 = tail call i64 @malloc(i32 %73)
%75 = inttoptr i64 %74 to double*
%76 = getelementptr inbounds [3 x double*], [3 x double*]* %9, i64 0, i64 1
store double* %75, double** %76
%77 = load i32, i32* %54
%78 = shl i32 %77, 3
%79 = load i32, i32* %55
%80 = mul i32 %78, %79
%81 = tail call i64 @malloc(i32 %80)
%82 = inttoptr i64 %81 to double*
%83 = getelementptr inbounds [3 x double*], [3 x double*]* %10, i64 0, i64 1
store double* %82, double** %83
%84 = load i32, i32* %54
%85 = shl i32 %84, 3
%86 = load i32, i32* %55
%87 = mul i32 %85, %86
%88 = tail call i64 @malloc(i32 %87)
%89 = inttoptr i64 %88 to double*
%90 = getelementptr inbounds [3 x double*], [3 x double*]* %9, i64 0, i64 2
store double* %89, double** %90
%91 = load i32, i32* %54
%92 = shl i32 %91, 3
%93 = load i32, i32* %55
%94 = mul i32 %92, %93
%95 = tail call i64 @malloc(i32 %94)
%96 = inttoptr i64 %95 to double*
%97 = getelementptr inbounds [3 x double*], [3 x double*]* %10, i64 0, i64 2
store double* %96, double** %97
%98 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.26, i64 0, i64 0))
%99 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 3
%100 = load double*, double** %99
%101 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 3
%102 = load double*, double** %101
%103 = getelementptr inbounds [4 x double*], [4 x double*]* %8, i64 0, i64 3
%104 = load double*, double** %103
br label %171
105: ; preds = %5, %134
%106 = phi i64 [ 0, %5 ], [ %135, %134 ]
%107 = getelementptr inbounds i32, i32* %0, i64 %106
%108 = load i32, i32* %107
%109 = shl i32 %108, 3
%110 = tail call i64 @malloc(i32 %109)
%111 = inttoptr i64 %110 to double*
%112 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 %106
store double* %111, double** %112
%113 = getelementptr inbounds i32, i32* %1, i64 %106
%114 = load i32, i32* %113
%115 = shl i32 %114, 3
%116 = tail call i64 @malloc(i32 %115)
%117 = inttoptr i64 %116 to double*
%118 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 %106
store double* %117, double** %118
%119 = load i32, i32* %107
%120 = shl i32 %119, 3
%121 = load i32, i32* %113
%122 = mul i32 %120, %121
%123 = tail call i64 @malloc(i32 %122)
%124 = inttoptr i64 %123 to double*
%125 = getelementptr inbounds [4 x double*], [4 x double*]* %8, i64 0, i64 %106
store double* %124, double** %125
%126 = load i32, i32* %107
%127 = tail call double @get_dx_from_bounds(double 0xC00921FB54442D18, double 0x400921FB54442D18, i32 %126)
%128 = load i32, i32* %113
%129 = tail call double @get_dx_from_bounds(double 0xC00921FB54442D18, double 0x400921FB54442D18, i32 %128)
%130 = load i32, i32* %107
%131 = icmp sgt i32 %130, 0
br i1 %131, label %132, label %134
132: ; preds = %105
%133 = load i32, i32* %113
br label %137
134: ; preds = %146, %105
%135 = add nuw nsw i64 %106, 1
%136 = icmp eq i64 %135, 4
br i1 %136, label %53, label %105
137: ; preds = %132, %146
%138 = phi i32 [ %130, %132 ], [ %147, %146 ]
%139 = phi i32 [ %133, %132 ], [ %148, %146 ]
%140 = phi i64 [ 0, %132 ], [ %149, %146 ]
%141 = trunc i64 %140 to i32
%142 = sitofp i32 %141 to double
%143 = tail call double @llvm.fmuladd.f64(double %142, double %127, double 0xC00921FB54442D18)
%144 = getelementptr inbounds double, double* %111, i64 %140
store double %143, double* %144
%145 = icmp sgt i32 %139, 0
br i1 %145, label %152, label %146
146: ; preds = %152, %137
%147 = phi i32 [ %138, %137 ], [ %170, %152 ]
%148 = phi i32 [ %139, %137 ], [ %167, %152 ]
%149 = add nuw nsw i64 %140, 1
%150 = sext i32 %147 to i64
%151 = icmp slt i64 %149, %150
br i1 %151, label %137, label %134
152: ; preds = %137, %152
%153 = phi i32 [ %170, %152 ], [ %138, %137 ]
%154 = phi i64 [ %166, %152 ], [ 0, %137 ]
%155 = phi i32 [ %167, %152 ], [ %139, %137 ]
%156 = trunc i64 %154 to i32
%157 = sitofp i32 %156 to double
%158 = tail call double @llvm.fmuladd.f64(double %157, double %129, double 0xC00921FB54442D18)
%159 = getelementptr inbounds double, double* %117, i64 %154
store double %158, double* %159
%160 = tail call i32 @index_2D_to_1D(i32 %141, i32 %153, i32 %156, i32 %155)
%161 = load double, double* %144
%162 = load double, double* %159
%163 = tail call double @f_ana(double %161, double %162, i32 %3, i32 %4)
%164 = sext i32 %160 to i64
%165 = getelementptr inbounds double, double* %124, i64 %164
store double %163, double* %165
%166 = add nuw nsw i64 %154, 1
%167 = load i32, i32* %113
%168 = sext i32 %167 to i64
%169 = icmp slt i64 %166, %168
%170 = load i32, i32* %107
br i1 %169, label %152, label %146
171: ; preds = %53, %259
%172 = phi i64 [ 0, %53 ], [ %260, %259 ]
%173 = getelementptr inbounds i32, i32* %2, i64 %172
%174 = load i32, i32* %173
%175 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), i32 %174)
br label %176
176: ; preds = %171, %237
%177 = phi i64 [ 0, %171 ], [ %257, %237 ]
%178 = getelementptr inbounds i32, i32* %0, i64 %177
%179 = load i32, i32* %178
%180 = getelementptr inbounds i32, i32* %1, i64 %177
%181 = load i32, i32* %180
%182 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %179, i32 %181)
%183 = load i32, i32* %54
%184 = icmp sgt i32 %183, 0
br i1 %184, label %187, label %185
185: ; preds = %176
%186 = load i32, i32* %55
br label %237
187: ; preds = %176
%188 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 %177
%189 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 %177
%190 = getelementptr inbounds [4 x double*], [4 x double*]* %8, i64 0, i64 %177
%191 = getelementptr inbounds [3 x double*], [3 x double*]* %9, i64 0, i64 %177
%192 = getelementptr inbounds [3 x double*], [3 x double*]* %10, i64 0, i64 %177
%193 = load i32, i32* %55
br label %194
194: ; preds = %187, %231
%195 = phi i32 [ %183, %187 ], [ %232, %231 ]
%196 = phi i32 [ %193, %187 ], [ %233, %231 ]
%197 = phi i64 [ 0, %187 ], [ %234, %231 ]
%198 = icmp sgt i32 %196, 0
br i1 %198, label %199, label %231
199: ; preds = %194
%200 = getelementptr inbounds double, double* %100, i64 %197
%201 = trunc i64 %197 to i32
br label %202
202: ; preds = %202, %199
%203 = phi i32 [ %195, %199 ], [ %230, %202 ]
%204 = phi i64 [ 0, %199 ], [ %226, %202 ]
%205 = phi i32 [ %196, %199 ], [ %227, %202 ]
%206 = trunc i64 %204 to i32
%207 = tail call i32 @index_2D_to_1D(i32 %201, i32 %203, i32 %206, i32 %205)
%208 = load double, double* %200
%209 = getelementptr inbounds double, double* %102, i64 %204
%210 = load double, double* %209
%211 = load i32, i32* %173
%212 = load double*, double** %188
%213 = load i32, i32* %178
%214 = load double*, double** %189
%215 = load i32, i32* %180
%216 = load double*, double** %190
%217 = tail call double @lagrange_interp_2Dfo(double %208, double %210, i32 %211, i32 %211, double* %212, i32 %213, double* %214, i32 %215, double* %216)
%218 = load double*, double** %191
%219 = sext i32 %207 to i64
%220 = getelementptr inbounds double, double* %218, i64 %219
store double %217, double* %220
%221 = getelementptr inbounds double, double* %104, i64 %219
%222 = load double, double* %221
%223 = fsub double %217, %222
%224 = load double*, double** %192
%225 = getelementptr inbounds double, double* %224, i64 %219
store double %223, double* %225
%226 = add nuw nsw i64 %204, 1
%227 = load i32, i32* %55
%228 = sext i32 %227 to i64
%229 = icmp slt i64 %226, %228
%230 = load i32, i32* %54
br i1 %229, label %202, label %231
231: ; preds = %202, %194
%232 = phi i32 [ %195, %194 ], [ %230, %202 ]
%233 = phi i32 [ %196, %194 ], [ %227, %202 ]
%234 = add nuw nsw i64 %197, 1
%235 = sext i32 %232 to i64
%236 = icmp slt i64 %234, %235
br i1 %236, label %194, label %237
237: ; preds = %231, %185
%238 = phi i32 [ %186, %185 ], [ %233, %231 ]
%239 = phi i32 [ %183, %185 ], [ %232, %231 ]
%240 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 %177
%241 = load double*, double** %240
%242 = getelementptr inbounds double, double* %241, i64 1
%243 = load double, double* %242
%244 = load double, double* %241
%245 = fsub double %243, %244
%246 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 %177
%247 = load double*, double** %246
%248 = getelementptr inbounds double, double* %247, i64 1
%249 = load double, double* %248
%250 = load double, double* %247
%251 = fsub double %249, %250
%252 = getelementptr inbounds [3 x double*], [3 x double*]* %10, i64 0, i64 %177
%253 = load double*, double** %252
%254 = mul nsw i32 %238, %239
%255 = tail call double @l2_norm(double* %253, double %245, double %251, i32 %254)
%256 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 %172, i64 %177
store double %255, double* %256
%257 = add nuw nsw i64 %177, 1
%258 = icmp eq i64 %257, 3
br i1 %258, label %259, label %176
259: ; preds = %237
%260 = add nuw nsw i64 %172, 1
%261 = icmp eq i64 %260, 3
br i1 %261, label %262, label %171
262: ; preds = %259
%263 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.27, i64 0, i64 0))
%264 = tail call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%265 = tail call i64 @fwrite(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i64 20, i64 1, i32* %264)
%266 = load i32, i32* %2
%267 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i32 %266)
%268 = load i32, i32* %45
%269 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i32 %268)
%270 = load i32, i32* %48
%271 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i32 %270)
%272 = tail call i32 @fputc(i32 10, i32* %264)
%273 = load i32, i32* %0
%274 = load i32, i32* %1
%275 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %273, i32 %274)
%276 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 0, i64 0
%277 = load double, double* %276
%278 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %277)
%279 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 1, i64 0
%280 = load double, double* %279
%281 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %280)
%282 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 2, i64 0
%283 = load double, double* %282
%284 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %283)
%285 = tail call i32 @fputc(i32 10, i32* %264)
%286 = load i32, i32* %24
%287 = load i32, i32* %34
%288 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %286, i32 %287)
%289 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 0, i64 1
%290 = load double, double* %289
%291 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %290)
%292 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 1, i64 1
%293 = load double, double* %292
%294 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %293)
%295 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 2, i64 1
%296 = load double, double* %295
%297 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %296)
%298 = tail call i32 @fputc(i32 10, i32* %264)
%299 = load i32, i32* %27
%300 = load i32, i32* %37
%301 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i32 %299, i32 %300)
%302 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 0, i64 2
%303 = load double, double* %302
%304 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %303)
%305 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 1, i64 2
%306 = load double, double* %305
%307 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %306)
%308 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %11, i64 0, i64 2, i64 2
%309 = load double, double* %308
%310 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0), double %309)
%311 = tail call i32 @fputc(i32 10, i32* %264)
%312 = tail call i32 @fclose(i32* %264)
%313 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.28, i64 0, i64 0))
%314 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 0
%315 = load double*, double** %314
%316 = tail call i32 @free(double* %315)
%317 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 0
%318 = load double*, double** %317
%319 = tail call i32 @free(double* %318)
%320 = getelementptr inbounds [4 x double*], [4 x double*]* %8, i64 0, i64 0
%321 = load double*, double** %320
%322 = tail call i32 @free(double* %321)
%323 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 1
%324 = load double*, double** %323
%325 = tail call i32 @free(double* %324)
%326 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 1
%327 = load double*, double** %326
%328 = tail call i32 @free(double* %327)
%329 = getelementptr inbounds [4 x double*], [4 x double*]* %8, i64 0, i64 1
%330 = load double*, double** %329
%331 = tail call i32 @free(double* %330)
%332 = getelementptr inbounds [4 x double*], [4 x double*]* %6, i64 0, i64 2
%333 = load double*, double** %332
%334 = tail call i32 @free(double* %333)
%335 = getelementptr inbounds [4 x double*], [4 x double*]* %7, i64 0, i64 2
%336 = load double*, double** %335
%337 = tail call i32 @free(double* %336)
%338 = getelementptr inbounds [4 x double*], [4 x double*]* %8, i64 0, i64 2
%339 = load double*, double** %338
%340 = tail call i32 @free(double* %339)
%341 = tail call i32 @free(double* %100)
%342 = tail call i32 @free(double* %102)
%343 = tail call i32 @free(double* %104)
%344 = tail call i32 @free(double* %61)
%345 = tail call i32 @free(double* %68)
%346 = tail call i32 @free(double* %75)
%347 = tail call i32 @free(double* %82)
%348 = tail call i32 @free(double* %89)
%349 = tail call i32 @free(double* %96)
ret void
}