int expand_curvilinear_grid(int gridID) {
  char units[256];
  int gridIDnew;
  long gridsize, gridsize_new;
  long nx, ny, nxp4, nyp4;
  long i, j;
  double *xvals, *yvals;
  gridsize = gridInqSize(gridID);
  nx = gridInqXsize(gridID);
  ny = gridInqYsize(gridID);
  nxp4 = nx + 4;
  nyp4 = ny + 4;
  gridsize_new = gridsize + 4 * (nx + 2) + 4 * (ny + 2);
  xvals = (double *)Malloc(
      __func__,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c",
      521, (gridsize_new * sizeof(double)));
  yvals = (double *)Malloc(
      __func__,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c",
      522, (gridsize_new * sizeof(double)));
  gridInqXvals(gridID, xvals);
  gridInqYvals(gridID, yvals);
  gridIDnew = gridCreate(10, nxp4 * nyp4);
  gridDefXsize(gridIDnew, nxp4);
  gridDefYsize(gridIDnew, nyp4);
  gridInqXunits(gridID, units);
  gridDefXunits(gridIDnew, units);
  gridInqYunits(gridID, units);
  gridDefYunits(gridIDnew, units);
  for (j = ny - 1; j >= 0; j--)
    for (i = nx - 1; i >= 0; i--)
      xvals[(j + 2) * (nx + 4) + i + 2] = xvals[j * nx + i];
  for (j = ny - 1; j >= 0; j--)
    for (i = nx - 1; i >= 0; i--)
      yvals[(j + 2) * (nx + 4) + i + 2] = yvals[j * nx + i];
  for (j = 2; j < nyp4 - 2; j++) {
    xvals[j * nxp4] =
        intlin(3.0, xvals[j * nxp4 + 3], 0.0, xvals[j * nxp4 + 2], 1.0);
    xvals[j * nxp4 + 1] =
        intlin(2.0, xvals[j * nxp4 + 3], 0.0, xvals[j * nxp4 + 2], 1.0);
    yvals[j * nxp4] =
        intlin(3.0, yvals[j * nxp4 + 3], 0.0, yvals[j * nxp4 + 2], 1.0);
    yvals[j * nxp4 + 1] =
        intlin(2.0, yvals[j * nxp4 + 3], 0.0, yvals[j * nxp4 + 2], 1.0);
    xvals[j * nxp4 + nxp4 - 2] = intlin(2.0, xvals[j * nxp4 + nxp4 - 4], 0.0,
                                        xvals[j * nxp4 + nxp4 - 3], 1.0);
    xvals[j * nxp4 + nxp4 - 1] = intlin(3.0, xvals[j * nxp4 + nxp4 - 4], 0.0,
                                        xvals[j * nxp4 + nxp4 - 3], 1.0);
    yvals[j * nxp4 + nxp4 - 2] = intlin(2.0, yvals[j * nxp4 + nxp4 - 4], 0.0,
                                        yvals[j * nxp4 + nxp4 - 3], 1.0);
    yvals[j * nxp4 + nxp4 - 1] = intlin(3.0, yvals[j * nxp4 + nxp4 - 4], 0.0,
                                        yvals[j * nxp4 + nxp4 - 3], 1.0);
  }
  for (i = 0; i < nxp4; i++) {
    xvals[0 * nxp4 + i] =
        intlin(3.0, xvals[3 * nxp4 + i], 0.0, xvals[2 * nxp4 + i], 1.0);
    xvals[1 * nxp4 + i] =
        intlin(2.0, xvals[3 * nxp4 + i], 0.0, xvals[2 * nxp4 + i], 1.0);
    yvals[0 * nxp4 + i] =
        intlin(3.0, yvals[3 * nxp4 + i], 0.0, yvals[2 * nxp4 + i], 1.0);
    yvals[1 * nxp4 + i] =
        intlin(2.0, yvals[3 * nxp4 + i], 0.0, yvals[2 * nxp4 + i], 1.0);
    xvals[(nyp4 - 2) * nxp4 + i] =
        intlin(2.0, xvals[(nyp4 - 4) * nxp4 + i], 0.0,
               xvals[(nyp4 - 3) * nxp4 + i], 1.0);
    xvals[(nyp4 - 1) * nxp4 + i] =
        intlin(3.0, xvals[(nyp4 - 4) * nxp4 + i], 0.0,
               xvals[(nyp4 - 3) * nxp4 + i], 1.0);
    yvals[(nyp4 - 2) * nxp4 + i] =
        intlin(2.0, yvals[(nyp4 - 4) * nxp4 + i], 0.0,
               yvals[(nyp4 - 3) * nxp4 + i], 1.0);
    yvals[(nyp4 - 1) * nxp4 + i] =
        intlin(3.0, yvals[(nyp4 - 4) * nxp4 + i], 0.0,
               yvals[(nyp4 - 3) * nxp4 + i], 1.0);
  }
  gridDefXvals(gridIDnew, xvals);
  gridDefYvals(gridIDnew, yvals);
  Free(__func__,
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c",
       582, (xvals));
  Free(__func__,
       "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
       "2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c",
       583, (yvals));
  return (gridIDnew);
}


x86 assembly (clang, -O0):
<expand_curvilinear_grid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1120 <gridInqSize@plt>
cltq
mov    %rax,-0x120(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   10a0 <gridInqXsize@plt>
cltq
mov    %rax,-0x130(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1080 <gridInqYsize@plt>
cltq
mov    %rax,-0x138(%rbp)
mov    -0x130(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x140(%rbp)
mov    -0x138(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x148(%rbp)
mov    -0x120(%rbp),%rax
mov    -0x130(%rbp),%rcx
add    $0x2,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x138(%rbp),%rcx
add    $0x2,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rcx
shl    $0x3,%rcx
lea    0xd59(%rip),%rdi
lea    0xd6a(%rip),%rsi
mov    $0x209,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x160(%rbp)
mov    -0x128(%rbp),%rcx
shl    $0x3,%rcx
lea    0xd2b(%rip),%rdi
lea    0xd3c(%rip),%rsi
mov    $0x20a,%edx
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x168(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x160(%rbp),%rsi
mov    $0x0,%al
call   10c0 <gridInqXvals@plt>
mov    -0x4(%rbp),%edi
mov    -0x168(%rbp),%rsi
mov    $0x0,%al
call   1090 <gridInqYvals@plt>
mov    -0x140(%rbp),%rsi
imul   -0x148(%rbp),%rsi
ff
mov    $0xa,%edi
mov    $0x0,%al
call   1050 <gridCreate@plt>
mov    %eax,-0x114(%rbp)
mov    -0x114(%rbp),%edi
mov    -0x140(%rbp),%rsi
mov    $0x0,%al
call   10b0 <gridDefXsize@plt>
mov    -0x114(%rbp),%edi
mov    -0x148(%rbp),%rsi
mov    $0x0,%al
call   10e0 <gridDefYsize@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1110 <gridInqXunits@plt>
mov    -0x114(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   10f0 <gridDefXunits@plt>
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1100 <gridInqYunits@plt>
mov    -0x114(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x0,%al
call   1060 <gridDefYunits@plt>
mov    -0x138(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x158(%rbp)
cmpq   $0x0,-0x158(%rbp)
jl     1481 <expand_curvilinear_grid+0x271>
mov    -0x130(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x150(%rbp)
cmpq   $0x0,-0x150(%rbp)
jl     1465 <expand_curvilinear_grid+0x255>
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x130(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
add    $0x2,%rcx
mov    -0x130(%rbp),%rdx
add    $0x4,%rdx
imul   %rdx,%rcx
add    -0x150(%rbp),%rcx
movsd  %xmm0,0x10(%rax,%rcx,8)
mov    -0x150(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x150(%rbp)
jmp    13f0 <expand_curvilinear_grid+0x1e0>
jmp    146a <expand_curvilinear_grid+0x25a>
mov    -0x158(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x158(%rbp)
jmp    13d0 <expand_curvilinear_grid+0x1c0>
mov    -0x138(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x158(%rbp)
cmpq   $0x0,-0x158(%rbp)
jl     1544 <expand_curvilinear_grid+0x334>
mov    -0x130(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x150(%rbp)
cmpq   $0x0,-0x150(%rbp)
jl     1528 <expand_curvilinear_grid+0x318>
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x130(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
add    $0x2,%rcx
mov    -0x130(%rbp),%rdx
add    $0x4,%rdx
imul   %rdx,%rcx
add    -0x150(%rbp),%rcx
movsd  %xmm0,0x10(%rax,%rcx,8)
mov    -0x150(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x150(%rbp)
jmp    14b3 <expand_curvilinear_grid+0x2a3>
jmp    152d <expand_curvilinear_grid+0x31d>
mov    -0x158(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x158(%rbp)
jmp    1493 <expand_curvilinear_grid+0x283>
movq   $0x2,-0x158(%rbp)
mov    -0x158(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x2,%rcx
cmp    %rcx,%rax
jge    1987 <expand_curvilinear_grid+0x777>
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x18(%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x10(%rax,%rcx,8),%xmm3
movsd  0xa56(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xa53(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x18(%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x10(%rax,%rcx,8),%xmm3
movsd  0x9f5(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x9e2(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  %xmm0,0x8(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x18(%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x10(%rax,%rcx,8),%xmm3
movsd  0x973(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x970(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x18(%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  0x10(%rax,%rcx,8),%xmm3
movsd  0x912(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x8ff(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
movsd  %xmm0,0x8(%rax,%rcx,8)
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x4,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x3,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x88c(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x879(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x2,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x4,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x3,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x7ec(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x7e9(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x1,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x4,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x3,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x76c(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x759(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x2,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x4,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x3,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x6cc(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x6c9(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x158(%rbp),%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x140(%rbp),%rcx
sub    $0x1,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x158(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x158(%rbp)
jmp    154f <expand_curvilinear_grid+0x33f>
movq   $0x0,-0x150(%rbp)
mov    -0x150(%rbp),%rax
cmp    -0x140(%rbp),%rax
jge    1dcb <expand_curvilinear_grid+0xbbb>
mov    -0x160(%rbp),%rax
imul   $0x3,-0x140(%rbp),%rcx
03
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x140(%rbp),%rcx
shl    $0x1,%rcx
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x619(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x616(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
imul   $0x0,-0x140(%rbp),%rcx
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x160(%rbp),%rax
imul   $0x3,-0x140(%rbp),%rcx
03
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x140(%rbp),%rcx
shl    $0x1,%rcx
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x5b7(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x5a4(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x140(%rbp),%rcx
shl    $0x0,%rcx
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
imul   $0x3,-0x140(%rbp),%rcx
03
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x140(%rbp),%rcx
shl    $0x1,%rcx
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x532(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x52f(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
imul   $0x0,-0x140(%rbp),%rcx
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
imul   $0x3,-0x140(%rbp),%rcx
03
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x140(%rbp),%rcx
shl    $0x1,%rcx
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x4d0(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x4bd(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x140(%rbp),%rcx
shl    $0x0,%rcx
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x160(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x4,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x3,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x448(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x435(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x2,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x160(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x4,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x160(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x3,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x3a8(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x3a5(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x160(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x1,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x4,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x3,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x328(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x315(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x2,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x168(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x4,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x168(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x3,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  0x288(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0x285(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
cvtsi2sd %eax,%xmm0
mov    -0x168(%rbp),%rax
mov    -0x148(%rbp),%rcx
sub    $0x1,%rcx
imul   -0x140(%rbp),%rcx
ff
add    -0x150(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x150(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x150(%rbp)
jmp    1992 <expand_curvilinear_grid+0x782>
mov    -0x114(%rbp),%edi
mov    -0x160(%rbp),%rsi
mov    $0x0,%al
call   1130 <gridDefXvals@plt>
mov    -0x114(%rbp),%edi
mov    -0x168(%rbp),%rsi
mov    $0x0,%al
call   1070 <gridDefYvals@plt>
mov    -0x160(%rbp),%rcx
lea    0x217(%rip),%rdi
lea    0x228(%rip),%rsi
mov    $0x246,%edx
mov    $0x0,%al
call   10d0 <Free@plt>
mov    -0x168(%rbp),%rcx
lea    0x1f6(%rip),%rdi
lea    0x207(%rip),%rsi
mov    $0x247,%edx
mov    $0x0,%al
call   10d0 <Free@plt>
mov    -0x114(%rbp),%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_curvilinear_grid>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8,%rsp
mov    %edi,%r13d
xor    %eax,%eax
call   1120 <gridInqSize@plt>
movslq %eax,%rbx
mov    %r13d,%edi
xor    %eax,%eax
call   10a0 <gridInqXsize@plt>
mov    %eax,0x28(%rsp)
movslq %eax,%rbp
mov    %r13d,%edi
xor    %eax,%eax
call   1080 <gridInqYsize@plt>
mov    %eax,0x64(%rsp)
movslq %eax,%r12
lea    0x4(%rbp),%r14
lea    0x4(%r12),%r15
mov    %rbp,(%rsp)
lea    (%r12,%rbp,1),%rax
lea    (%rbx,%rax,4),%rax
lea    0x80(,%rax,8),%rbx
lea    0xda4(%rip),%rdi
lea    0xdb5(%rip),%rsi
mov    $0x209,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rbp
lea    0xd84(%rip),%rdi
lea    0xd95(%rip),%rsi
mov    $0x20a,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rbx
mov    %r13d,%edi
mov    %rbp,0x20(%rsp)
mov    %rbp,%rsi
xor    %eax,%eax
call   10c0 <gridInqXvals@plt>
mov    %r13d,%edi
mov    %rbx,0x18(%rsp)
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <gridInqYvals@plt>
mov    %r15,%rsi
imul   %r14,%rsi
mov    $0xa,%edi
xor    %eax,%eax
call   1050 <gridCreate@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <gridDefXsize@plt>
mov    %ebp,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   10e0 <gridDefYsize@plt>
lea    0xe0(%rsp),%rbx
mov    %r13d,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1110 <gridInqXunits@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   10f0 <gridDefXunits@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1100 <gridInqYunits@plt>
mov    %ebp,0x94(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <gridDefYunits@plt>
test   %r12d,%r12d
mov    %r14,0x38(%rsp)
jle    1936 <expand_curvilinear_grid+0x726>
lea    -0x1(%r12),%r8
mov    (%rsp),%rsi
lea    -0x1(%rsi),%rax
lea    0x1(%r12),%rcx
imul   %r14,%rcx
lea    0x0(,%rsi,8),%rdx
mov    $0xffffffffffffffe0,%r11
mov    %rdx,0xb0(%rsp)
sub    %rdx,%r11
mov    %rsi,%rbp
imul   %r12,%rbp
mov    %r12,0x88(%rsp)
lea    -0x8(,%r12,8),%rdx
ff
imul   %rsi,%rdx
mov    %rdx,0x78(%rsp)
lea    -0x4(%rsi),%rdx
mov    %rdx,0x70(%rsp)
mov    %rdx,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    $0x8,%edx
mov    %rax,0xb8(%rsp)
mul    %rdx
mov    %rax,%rdx
seto   0x8(%rsp)
mov    %rsi,%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,0x68(%rsp)
mov    0x28(%rsp),%eax
and    $0x3,%eax
mov    %rax,0x98(%rsp)
mov    %rdi,%rax
mov    %rdi,0x40(%rsp)
and    $0xfffffffffffffffe,%rdi
mov    %rdi,0xd0(%rsp)
mov    $0xfffffffffffffff8,%rbx
sub    %rdx,%rbx
neg    %rdx
mov    %rdx,0x58(%rsp)
mov    %r8,%rdx
imul   %rsi,%rdx
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
mov    %rax,0x80(%rsp)
lea    (%rcx,%rsi,1),%rax
mov    0x20(%rsp),%rdi
lea    0x8(%rdi,%rax,8),%rsi
mov    %rsi,0x50(%rsp)
lea    0x10(%rdi,%rcx,8),%rsi
mov    %rsi,0x48(%rsp)
lea    0x10(%rdi,%rax,8),%rsi
mov    %rsi,0xd8(%rsp)
mov    %rax,0xa0(%rsp)
lea    (%rdi,%rax,8),%r10
mov    %rbx,%rax
mov    %rbp,0x10(%rsp)
lea    -0x10(%rdi,%rbp,8),%r13
mov    %rcx,0xc0(%rsp)
lea    (%rdi,%rcx,8),%r9
mov    %rdx,0xa8(%rsp)
lea    (%rdi,%rdx,8),%rbp
add    $0xfffffffffffffff8,%rbp
xor    %edx,%edx
mov    %r8,0xc8(%rsp)
mov    %r8,%r12
mov    %rbx,0x30(%rsp)
jmp    14c1 <expand_curvilinear_grid+0x2b1>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%r12),%rcx
add    $0x1,%rdx
add    %r11,%r10
add    %rax,%r13
add    %r11,%r9
add    %rax,%rbp
test   %r12,%r12
mov    %rcx,%r12
jle    168b <expand_curvilinear_grid+0x47b>
cmpl   $0x0,0x28(%rsp)
jle    14a0 <expand_curvilinear_grid+0x290>
mov    (%rsp),%rcx
mov    %rcx,%rbx
cmp    $0x4,%ecx
jb     1660 <expand_curvilinear_grid+0x450>
mov    %r11,%r8
imul   %rdx,%r8
mov    %rdx,%r15
mov    (%rsp),%rax
imul   %rax,%r15
mov    0x50(%rsp),%rcx
lea    (%rcx,%r8,1),%rbx
mov    %r15,%rcx
not    %rcx
add    0x10(%rsp),%rcx
lea    (%rdi,%rcx,8),%r14
mov    0x58(%rsp),%rsi
lea    (%rbx,%rsi,1),%rdi
cmp    %rbx,%rdi
seta   %cl
or     0x8(%rsp),%cl
lea    (%r14,%rsi,1),%rdi
cmp    %r14,%rdi
mov    0x20(%rsp),%rdi
seta   %r14b
mov    %rax,%rbx
mov    0x30(%rsp),%rax
test   %cl,%cl
jne    1660 <expand_curvilinear_grid+0x450>
or     0x8(%rsp),%r14b
mov    (%rsp),%rbx
jne    1660 <expand_curvilinear_grid+0x450>
mov    0x48(%rsp),%rcx
add    %r8,%rcx
mov    0x10(%rsp),%rsi
sub    %r15,%rsi
lea    (%rdi,%rsi,8),%rsi
cmp    %rsi,%rcx
jae    1581 <expand_curvilinear_grid+0x371>
add    0xd8(%rsp),%r8
shl    $0x3,%r15
mov    %rdi,%rcx
sub    %r15,%rcx
add    0x78(%rsp),%rcx
mov    (%rsp),%rbx
cmp    %r8,%rcx
jb     1660 <expand_curvilinear_grid+0x450>
cmpq   $0x4,0x70(%rsp)
jae    1597 <expand_curvilinear_grid+0x387>
xor    %edi,%edi
testb  $0x1,0x40(%rsp)
jne    15f5 <expand_curvilinear_grid+0x3e5>
jmp    1636 <expand_curvilinear_grid+0x426>
mov    0xd0(%rsp),%rcx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups -0x10(%r13,%rdi,8),%xmm0
movups 0x0(%r13,%rdi,8),%xmm1
movups %xmm1,(%r10,%rdi,8)
movups %xmm0,-0x10(%r10,%rdi,8)
movupd -0x30(%r13,%rdi,8),%xmm0
movups -0x20(%r13,%rdi,8),%xmm1
movups %xmm1,-0x20(%r10,%rdi,8)
movupd %xmm0,-0x30(%r10,%rdi,8)
add    $0xfffffffffffffff8,%rdi
add    $0xfffffffffffffffe,%rcx
jne    15b0 <expand_curvilinear_grid+0x3a0>
neg    %rdi
testb  $0x1,0x40(%rsp)
je     1636 <expand_curvilinear_grid+0x426>
lea    0x2(%r12),%rcx
imul   0x38(%rsp),%rcx
mov    %r12,%rsi
mov    (%rsp),%rax
imul   %rax,%rsi
add    $0x2,%rcx
not    %rdi
add    %rax,%rdi
add    %rdi,%rsi
mov    0x20(%rsp),%rbx
movupd -0x18(%rbx,%rsi,8),%xmm0
movups -0x8(%rbx,%rsi,8),%xmm1
add    %rcx,%rdi
movups %xmm1,-0x8(%rbx,%rdi,8)
movupd %xmm0,-0x18(%rbx,%rdi,8)
mov    0x98(%rsp),%rbx
mov    0x68(%rsp),%rax
cmp    (%rsp),%rax
mov    0x20(%rsp),%rdi
mov    0x30(%rsp),%rax
je     14a0 <expand_curvilinear_grid+0x290>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%rbp,%rbx,8),%xmm0
movsd  %xmm0,(%r9,%rbx,8)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
jg     1670 <expand_curvilinear_grid+0x460>
jmp    14a0 <expand_curvilinear_grid+0x290>
cmpl   $0x0,0x64(%rsp)
mov    0x88(%rsp),%r12
jle    1936 <expand_curvilinear_grid+0x726>
mov    0x18(%rsp),%r8
mov    0xa0(%rsp),%rdi
lea    (%r8,%rdi,8),%rax
add    $0x8,%rax
mov    %rax,0x30(%rsp)
mov    $0xffffffffffffffe0,%r13
sub    0xb0(%rsp),%r13
mov    0xc0(%rsp),%rsi
lea    (%r8,%rsi,8),%rax
add    $0x10,%rax
mov    %rax,0x50(%rsp)
lea    0x10(%r8,%rdi,8),%rax
mov    %rax,0x48(%rsp)
mov    $0x8,%ecx
mov    0xb8(%rsp),%rax
mul    %rcx
mov    %rax,%rcx
seto   0x8(%rsp)
mov    0x80(%rsp),%rax
and    0x40(%rsp),%rax
mov    %rax,0x80(%rsp)
lea    (%r8,%rdi,8),%rbx
mov    0x10(%rsp),%rax
lea    (%r8,%rax,8),%rdx
add    $0xfffffffffffffff0,%rdx
mov    $0xfffffffffffffff8,%rax
sub    %rcx,%rax
neg    %rcx
mov    %rcx,0x58(%rsp)
lea    (%r8,%rsi,8),%rbp
mov    0xa8(%rsp),%rcx
lea    (%r8,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
xor    %r12d,%r12d
mov    0xc8(%rsp),%r9
mov    (%rsp),%r10
jmp    1780 <expand_curvilinear_grid+0x570>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r9),%rcx
add    $0x1,%r12
add    %r13,%rbx
add    %rax,%rdx
add    %r13,%rbp
add    %rax,%rdi
test   %r9,%r9
mov    %rcx,%r9
jle    1940 <expand_curvilinear_grid+0x730>
cmpl   $0x0,0x28(%rsp)
jle    1760 <expand_curvilinear_grid+0x550>
mov    (%rsp),%rsi
cmpl   $0x4,0x28(%rsp)
jae    17c0 <expand_curvilinear_grid+0x5b0>
add    $0x1,%rsi
cs nopw 0x0(%rax,%rax,1)
movsd  -0x8(%rdi,%rsi,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rsi,8)
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
jg     17a0 <expand_curvilinear_grid+0x590>
jmp    1760 <expand_curvilinear_grid+0x550>
nopl   0x0(%rax,%rax,1)
mov    %r13,%r14
imul   %r12,%r14
mov    %r12,%r15
imul   %r10,%r15
mov    0x30(%rsp),%rcx
lea    (%rcx,%r14,1),%r11
mov    %r15,%rsi
not    %rsi
add    0x10(%rsp),%rsi
mov    0x18(%rsp),%rcx
lea    (%rcx,%rsi,8),%r8
mov    0x58(%rsp),%rsi
lea    (%r11,%rsi,1),%rcx
cmp    %r11,%rcx
seta   %cl
or     0x8(%rsp),%cl
add    %r8,%rsi
cmp    %r8,%rsi
mov    0x18(%rsp),%r8
seta   %r11b
mov    %r10,%rsi
test   %cl,%cl
jne    1792 <expand_curvilinear_grid+0x582>
or     0x8(%rsp),%r11b
mov    (%rsp),%rsi
jne    1792 <expand_curvilinear_grid+0x582>
mov    0x50(%rsp),%rcx
add    %r14,%rcx
mov    0x10(%rsp),%rsi
sub    %r15,%rsi
lea    (%r8,%rsi,8),%rsi
cmp    %rsi,%rcx
jae    1861 <expand_curvilinear_grid+0x651>
add    0x48(%rsp),%r14
shl    $0x3,%r15
mov    %r8,%rcx
sub    %r15,%rcx
add    0x78(%rsp),%rcx
mov    (%rsp),%rsi
cmp    %r14,%rcx
jb     1792 <expand_curvilinear_grid+0x582>
cmpq   $0x4,0x70(%rsp)
jae    1877 <expand_curvilinear_grid+0x667>
xor    %esi,%esi
testb  $0x1,0x40(%rsp)
jne    18cc <expand_curvilinear_grid+0x6bc>
jmp    191a <expand_curvilinear_grid+0x70a>
mov    0x80(%rsp),%rcx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movups -0x10(%rdx,%rsi,8),%xmm0
movups (%rdx,%rsi,8),%xmm1
movups %xmm1,(%rbx,%rsi,8)
movups %xmm0,-0x10(%rbx,%rsi,8)
movupd -0x30(%rdx,%rsi,8),%xmm0
movups -0x20(%rdx,%rsi,8),%xmm1
movups %xmm1,-0x20(%rbx,%rsi,8)
movupd %xmm0,-0x30(%rbx,%rsi,8)
add    $0xfffffffffffffff8,%rsi
add    $0xfffffffffffffffe,%rcx
jne    1890 <expand_curvilinear_grid+0x680>
neg    %rsi
testb  $0x1,0x40(%rsp)
je     191a <expand_curvilinear_grid+0x70a>
lea    0x2(%r9),%r8
imul   0x38(%rsp),%r8
mov    %r9,%r11
mov    (%rsp),%rcx
imul   %rcx,%r11
add    $0x2,%r8
not    %rsi
add    %rcx,%rsi
add    %rsi,%r11
mov    0x18(%rsp),%rcx
movupd -0x18(%rcx,%r11,8),%xmm0
mov    0x18(%rsp),%rcx
movups -0x8(%rcx,%r11,8),%xmm1
add    %r8,%rsi
mov    0x18(%rsp),%r8
movups %xmm1,-0x8(%r8,%rsi,8)
movupd %xmm0,-0x18(%r8,%rsi,8)
mov    0x98(%rsp),%rsi
mov    0x68(%rsp),%rcx
cmp    (%rsp),%rcx
je     1760 <expand_curvilinear_grid+0x550>
jmp    1792 <expand_curvilinear_grid+0x582>
lea    0x2(%r12),%rdi
jmp    1b72 <expand_curvilinear_grid+0x962>
mov    0x88(%rsp),%r12
lea    0x2(%r12),%rdi
cmpl   $0x0,0x64(%rsp)
jle    1b72 <expand_curvilinear_grid+0x962>
cmp    $0x4,%rdi
mov    $0x3,%r15d
mov    %rdi,0x8(%rsp)
cmovge %rdi,%r15
add    $0xfffffffffffffffe,%r15
mov    (%rsp),%rdx
lea    (%rdx,%rdx,2),%rax
mov    0x20(%rsp),%rcx
lea    (%rcx,%rax,8),%r14
add    $0x40,%r14
lea    0x20(,%rdx,8),%rsi
mov    %rsi,0x10(%rsp)
lea    (%r8,%rax,8),%r12
add    $0x40,%r12
shl    $0x4,%rdx
lea    (%r8,%rdx,1),%r13
add    $0x58,%r13
lea    (%rcx,%rdx,1),%rbp
add    $0x58,%rbp
xor    %ebx,%ebx
nop
movsd  -0x8(%rbp,%rbx,1),%xmm3
movsd  0x0(%rbp,%rbx,1),%xmm1
xorps  %xmm2,%xmm2
movsd  0x639(%rip),%xmm0
movsd  0x639(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp,%rbx,1)
movsd  -0x8(%rbp,%rbx,1),%xmm3
movsd  0x0(%rbp,%rbx,1),%xmm1
xorps  %xmm2,%xmm2
movsd  0x616(%rip),%xmm0
movsd  0x606(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp,%rbx,1)
movsd  -0x8(%r13,%rbx,1),%xmm3
movsd  0x0(%r13,%rbx,1),%xmm1
xorps  %xmm2,%xmm2
movsd  0x5d1(%rip),%xmm0
movsd  0x5d1(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%r13,%rbx,1)
movsd  -0x8(%r13,%rbx,1),%xmm3
movsd  0x0(%r13,%rbx,1),%xmm1
xorps  %xmm2,%xmm2
movsd  0x5ab(%rip),%xmm0
movsd  0x59b(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%r13,%rbx,1)
movsd  (%r14,%rbx,1),%xmm1
movsd  0x8(%r14,%rbx,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x576(%rip),%xmm0
movsd  0x566(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%r14,%rbx,1)
movsd  (%r14,%rbx,1),%xmm1
movsd  0x8(%r14,%rbx,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x531(%rip),%xmm0
movsd  0x531(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%r14,%rbx,1)
movsd  (%r12,%rbx,1),%xmm1
movsd  0x8(%r12,%rbx,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x50c(%rip),%xmm0
movsd  0x4fc(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%r12,%rbx,1)
movsd  (%r12,%rbx,1),%xmm1
movsd  0x8(%r12,%rbx,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x4c7(%rip),%xmm0
movsd  0x4c7(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%r12,%rbx,1)
add    0x10(%rsp),%rbx
add    $0xffffffffffffffff,%r15
jne    19b0 <expand_curvilinear_grid+0x7a0>
mov    0x88(%rsp),%r12
mov    0x8(%rsp),%rdi
cmpl   $0xfffffffd,0x28(%rsp)
mov    0x38(%rsp),%r15
jl     1e3d <expand_curvilinear_grid+0xc2d>
mov    %r15,%rax
imul   %r12,%rax
lea    0x1(%r12),%rcx
imul   %r15,%rcx
imul   %r15,%rdi
add    $0x3,%r12
imul   %r15,%r12
cmp    $0x2,%r15
mov    $0x1,%edx
cmovge %r15,%rdx
shl    $0x3,%rdx
mov    %rdx,(%rsp)
mov    0x18(%rsp),%rdx
lea    (%rdx,%r12,8),%rsi
mov    %rsi,0x28(%rsp)
mov    0x20(%rsp),%rsi
lea    (%rsi,%r12,8),%rbp
mov    %rbp,0x10(%rsp)
lea    (%rdx,%rdi,8),%rbp
mov    %rbp,0x8(%rsp)
lea    (%rsi,%rdi,8),%rdi
mov    %rdi,0x30(%rsp)
lea    (%rdx,%rcx,8),%rdi
mov    %rdi,0x58(%rsp)
lea    (%rsi,%rcx,8),%rcx
mov    %rcx,0x50(%rsp)
lea    (%rdx,%rax,8),%rcx
mov    %rcx,0x78(%rsp)
lea    (%rsi,%rax,8),%rax
mov    %rax,0x48(%rsp)
lea    (%rdx,%r15,8),%rax
mov    %rax,0x40(%rsp)
lea    0x0(,%r15,8),%rax
lea    (%rsi,%r15,8),%rcx
mov    %rcx,0x70(%rsp)
shl    $0x4,%r15
lea    (%rdx,%r15,1),%rcx
mov    %rcx,0x38(%rsp)
add    %rsi,%r15
lea    (%rax,%rax,2),%r12
lea    (%rdx,%r12,1),%rax
mov    %rax,0x68(%rsp)
add    %rsi,%r12
xor    %r14d,%r14d
mov    0x58(%rsp),%r13
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%r14,1),%xmm1
movsd  (%r15,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x399(%rip),%xmm0
movsd  0x399(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x20(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
movsd  (%r12,%r14,1),%xmm1
movsd  (%r15,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x371(%rip),%xmm0
movsd  0x361(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x70(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
mov    0x68(%rsp),%rbp
movsd  0x0(%rbp,%r14,1),%xmm1
mov    0x38(%rsp),%rbx
movsd  (%rbx,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x31e(%rip),%xmm0
movsd  0x31e(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x18(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
movsd  0x0(%rbp,%r14,1),%xmm1
movsd  (%rbx,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x2f5(%rip),%xmm0
movsd  0x2e5(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x40(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
mov    0x48(%rsp),%rbp
movsd  0x0(%rbp,%r14,1),%xmm1
mov    0x50(%rsp),%rbx
movsd  (%rbx,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x2b2(%rip),%xmm0
movsd  0x2a2(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x30(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
movsd  0x0(%rbp,%r14,1),%xmm1
movsd  (%rbx,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x269(%rip),%xmm0
movsd  0x269(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x10(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
mov    0x78(%rsp),%rbx
movsd  (%rbx,%r14,1),%xmm1
movsd  0x0(%r13,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x23b(%rip),%xmm0
movsd  0x22b(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x8(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
movsd  (%rbx,%r14,1),%xmm1
movsd  0x0(%r13,%r14,1),%xmm3
xorps  %xmm2,%xmm2
movsd  0x1f2(%rip),%xmm0
movsd  0x1f2(%rip),%xmm4
mov    $0x5,%al
call   1040 <intlin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x28(%rsp),%rax
movsd  %xmm0,(%rax,%r14,1)
add    $0x8,%r14
cmp    %r14,(%rsp)
jne    1c50 <expand_curvilinear_grid+0xa40>
mov    0x94(%rsp),%ebx
mov    %ebx,%edi
mov    0x20(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1130 <gridDefXvals@plt>
mov    %ebx,%edi
mov    0x18(%rsp),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <gridDefYvals@plt>
lea    0x1ab(%rip),%r14
lea    0x1bc(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x246,%edx
mov    %rbp,%rcx
xor    %eax,%eax
call   10d0 <Free@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x247,%edx
mov    %r12,%rcx
xor    %eax,%eax
call   10d0 <Free@plt>
mov    %ebx,%eax
add    $0x1e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@__func__.expand_curvilinear_grid = [24 x i8] c"expand_curvilinear_grid\00"
@.str = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AZed/cdo/refs/heads/master/src/remaplib.c\00"
define i32 @expand_curvilinear_grid(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqSize to i32 (i32, ...)*)(i32 %0)
%5 = sext i32 %4 to i64
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqXsize to i32 (i32, ...)*)(i32 %0)
%7 = sext i32 %6 to i64
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @gridInqYsize to i32 (i32, ...)*)(i32 %0)
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, 4
%11 = add nsw i64 %9, 4
%12 = add nsw i64 %9, %7
%13 = shl nsw i64 %12, 2
%14 = add nsw i64 %5, 16
%15 = add nsw i64 %14, %13
%16 = shl nsw i64 %15, 3
%17 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.expand_curvilinear_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 521, i64 %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to double*
%20 = tail call i32 (i8*, i8*, i32, i64, ...) bitcast (i32 (...)* @Malloc to i32 (i8*, i8*, i32, i64, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.expand_curvilinear_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 522, i64 %16)
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to double*
%23 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqXvals to i32 (i32, double*, ...)*)(i32 %0, double* %19)
%24 = tail call i32 (i32, double*, ...) bitcast (i32 (...)* @gridInqYvals to i32 (i32, double*, ...)*)(i32 %0, double* %22)
%25 = mul nsw i64 %11, %10
%26 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @gridCreate to i32 (i32, i64, ...)*)(i32 10, i64 %25)
%27 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @gridDefXsize to i32 (i32, i64, ...)*)(i32 %26, i64 %10)
%28 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @gridDefYsize to i32 (i32, i64, ...)*)(i32 %26, i64 %11)
%29 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridInqXunits to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
%30 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridDefXunits to i32 (i32, i8*, ...)*)(i32 %26, i8* %3)
%31 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridInqYunits to i32 (i32, i8*, ...)*)(i32 %0, i8* %3)
%32 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @gridDefYunits to i32 (i32, i8*, ...)*)(i32 %26, i8* %3)
%33 = add nsw i64 %9, -1
%34 = icmp sgt i32 %8, 0
br i1 %34, label %35, label %348
35: ; preds = %1
%36 = icmp sgt i32 %6, 0
%37 = add nsw i64 %7, -1
%38 = add nsw i64 %9, 1
%39 = mul i64 %10, %38
%40 = add i64 %39, %7
%41 = add i64 %40, 1
%42 = getelementptr double, double* %19, i64 %41
%43 = bitcast double* %42 to i8*
%44 = mul nsw i64 %7, -8
%45 = add nsw i64 %44, -32
%46 = mul nsw i64 %7, %9
%47 = add nsw i64 %9, 1
%48 = mul i64 %10, %47
%49 = add nsw i64 %48, 2
%50 = getelementptr double, double* %19, i64 %49
%51 = bitcast double* %50 to i8*
%52 = mul nsw i64 %7, -8
%53 = add nsw i64 %52, -32
%54 = add i64 %48, %7
%55 = add i64 %54, 2
%56 = getelementptr double, double* %19, i64 %55
%57 = bitcast double* %56 to i8*
%58 = shl nsw i64 %9, 3
%59 = add nsw i64 %58, -8
%60 = mul i64 %59, %7
%61 = mul nsw i64 %7, %9
%62 = add nsw i64 %7, -4
%63 = lshr i64 %62, 2
%64 = add nuw nsw i64 %63, 1
%65 = icmp ult i32 %6, 4
%66 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %37, i64 8)
%67 = extractvalue { i64, i1 } %66, 0
%68 = extractvalue { i64, i1 } %66, 1
%69 = sub i64 0, %67
%70 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %37, i64 8)
%71 = extractvalue { i64, i1 } %70, 0
%72 = extractvalue { i64, i1 } %70, 1
%73 = sub i64 0, %71
%74 = and i64 %7, -4
%75 = and i64 %7, 3
%76 = and i64 %64, 1
%77 = icmp ult i64 %62, 4
%78 = and i64 %64, 9223372036854775806
%79 = icmp eq i64 %76, 0
%80 = icmp eq i64 %74, %7
br label %81
81: ; preds = %35, %239
%82 = phi i64 [ 0, %35 ], [ %242, %239 ]
%83 = phi i64 [ %33, %35 ], [ %240, %239 ]
%84 = mul i64 %53, %82
%85 = getelementptr i8, i8* %51, i64 %84
%86 = getelementptr i8, i8* %57, i64 %84
%87 = mul i64 %82, %7
%88 = sub i64 0, %87
%89 = getelementptr double, double* %19, i64 %88
%90 = bitcast double* %89 to i8*
%91 = getelementptr i8, i8* %90, i64 %60
%92 = sub i64 %61, %87
%93 = getelementptr double, double* %19, i64 %92
%94 = bitcast double* %93 to i8*
%95 = mul i64 %45, %82
%96 = getelementptr i8, i8* %43, i64 %95
%97 = mul i64 %82, %7
%98 = xor i64 %97, -1
%99 = add i64 %46, %98
%100 = getelementptr double, double* %19, i64 %99
%101 = bitcast double* %100 to i8*
br i1 %36, label %102, label %239
102: ; preds = %81
%103 = mul nsw i64 %83, %7
%104 = add nsw i64 %83, 2
%105 = mul nsw i64 %104, %10
%106 = add i64 %105, 2
br i1 %65, label %184, label %107
107: ; preds = %102
%108 = getelementptr i8, i8* %96, i64 %69
%109 = icmp ugt i8* %108, %96
%110 = or i1 %109, %68
%111 = getelementptr i8, i8* %101, i64 %73
%112 = icmp ugt i8* %111, %101
%113 = or i1 %112, %72
%114 = or i1 %110, %113
br i1 %114, label %184, label %115
115: ; preds = %107
%116 = icmp ult i8* %85, %94
%117 = icmp ult i8* %91, %86
%118 = and i1 %116, %117
br i1 %118, label %184, label %119
119: ; preds = %115
br i1 %77, label %162, label %120
120: ; preds = %119, %120
%121 = phi i64 [ %159, %120 ], [ 0, %119 ]
%122 = phi i64 [ %160, %120 ], [ 0, %119 ]
%123 = xor i64 %121, -1
%124 = add i64 %123, %7
%125 = add nsw i64 %124, %103
%126 = getelementptr inbounds double, double* %19, i64 %125
%127 = getelementptr inbounds double, double* %126, i64 -1
%128 = bitcast double* %127 to <2 x double>*
%129 = load <2 x double>, <2 x double>* %128
%130 = getelementptr inbounds double, double* %126, i64 -2
%131 = getelementptr inbounds double, double* %130, i64 -1
%132 = bitcast double* %131 to <2 x double>*
%133 = load <2 x double>, <2 x double>* %132
%134 = add i64 %106, %124
%135 = getelementptr inbounds double, double* %19, i64 %134
%136 = getelementptr inbounds double, double* %135, i64 -1
%137 = bitcast double* %136 to <2 x double>*
store <2 x double> %129, <2 x double>* %137
%138 = getelementptr inbounds double, double* %135, i64 -2
%139 = getelementptr inbounds double, double* %138, i64 -1
%140 = bitcast double* %139 to <2 x double>*
store <2 x double> %133, <2 x double>* %140
%141 = sub nuw nsw i64 -5, %121
%142 = add i64 %141, %7
%143 = add nsw i64 %142, %103
%144 = getelementptr inbounds double, double* %19, i64 %143
%145 = getelementptr inbounds double, double* %144, i64 -1
%146 = bitcast double* %145 to <2 x double>*
%147 = load <2 x double>, <2 x double>* %146
%148 = getelementptr inbounds double, double* %144, i64 -2
%149 = getelementptr inbounds double, double* %148, i64 -1
%150 = bitcast double* %149 to <2 x double>*
%151 = load <2 x double>, <2 x double>* %150
%152 = add i64 %106, %142
%153 = getelementptr inbounds double, double* %19, i64 %152
%154 = getelementptr inbounds double, double* %153, i64 -1
%155 = bitcast double* %154 to <2 x double>*
store <2 x double> %147, <2 x double>* %155
%156 = getelementptr inbounds double, double* %153, i64 -2
%157 = getelementptr inbounds double, double* %156, i64 -1
%158 = bitcast double* %157 to <2 x double>*
store <2 x double> %151, <2 x double>* %158
%159 = add nuw i64 %121, 8
%160 = add i64 %122, 2
%161 = icmp eq i64 %160, %78
br i1 %161, label %162, label %120
162: ; preds = %120, %119
%163 = phi i64 [ 0, %119 ], [ %159, %120 ]
br i1 %79, label %183, label %164
164: ; preds = %162
%165 = xor i64 %163, -1
%166 = add i64 %165, %7
%167 = add nsw i64 %166, %103
%168 = getelementptr inbounds double, double* %19, i64 %167
%169 = getelementptr inbounds double, double* %168, i64 -1
%170 = bitcast double* %169 to <2 x double>*
%171 = load <2 x double>, <2 x double>* %170
%172 = getelementptr inbounds double, double* %168, i64 -2
%173 = getelementptr inbounds double, double* %172, i64 -1
%174 = bitcast double* %173 to <2 x double>*
%175 = load <2 x double>, <2 x double>* %174
%176 = add i64 %106, %166
%177 = getelementptr inbounds double, double* %19, i64 %176
%178 = getelementptr inbounds double, double* %177, i64 -1
%179 = bitcast double* %178 to <2 x double>*
store <2 x double> %171, <2 x double>* %179
%180 = getelementptr inbounds double, double* %177, i64 -2
%181 = getelementptr inbounds double, double* %180, i64 -1
%182 = bitcast double* %181 to <2 x double>*
store <2 x double> %175, <2 x double>* %182
br label %183
183: ; preds = %162, %164
br i1 %80, label %239, label %184
184: ; preds = %115, %107, %102, %183
%185 = phi i64 [ %7, %115 ], [ %7, %107 ], [ %7, %102 ], [ %75, %183 ]
br label %230
186: ; preds = %239
br i1 %34, label %187, label %348
187: ; preds = %186
%188 = icmp sgt i32 %6, 0
%189 = add nsw i64 %7, -1
%190 = add nsw i64 %9, 1
%191 = mul i64 %10, %190
%192 = add i64 %191, %7
%193 = add i64 %192, 1
%194 = getelementptr double, double* %22, i64 %193
%195 = bitcast double* %194 to i8*
%196 = mul nsw i64 %7, -8
%197 = add nsw i64 %196, -32
%198 = mul nsw i64 %7, %9
%199 = add nsw i64 %9, 1
%200 = mul i64 %10, %199
%201 = add nsw i64 %200, 2
%202 = getelementptr double, double* %22, i64 %201
%203 = bitcast double* %202 to i8*
%204 = mul nsw i64 %7, -8
%205 = add nsw i64 %204, -32
%206 = add i64 %200, %7
%207 = add i64 %206, 2
%208 = getelementptr double, double* %22, i64 %207
%209 = bitcast double* %208 to i8*
%210 = shl nsw i64 %9, 3
%211 = add nsw i64 %210, -8
%212 = mul i64 %211, %7
%213 = mul nsw i64 %7, %9
%214 = icmp ult i32 %6, 4
%215 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %189, i64 8)
%216 = extractvalue { i64, i1 } %215, 0
%217 = extractvalue { i64, i1 } %215, 1
%218 = sub i64 0, %216
%219 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %189, i64 8)
%220 = extractvalue { i64, i1 } %219, 0
%221 = extractvalue { i64, i1 } %219, 1
%222 = sub i64 0, %220
%223 = and i64 %7, -4
%224 = and i64 %7, 3
%225 = and i64 %64, 1
%226 = icmp ult i64 %62, 4
%227 = and i64 %64, 9223372036854775806
%228 = icmp eq i64 %225, 0
%229 = icmp eq i64 %223, %7
br label %243
230: ; preds = %184, %230
%231 = phi i64 [ %232, %230 ], [ %185, %184 ]
%232 = add nsw i64 %231, -1
%233 = add nsw i64 %232, %103
%234 = getelementptr inbounds double, double* %19, i64 %233
%235 = load double, double* %234
%236 = add i64 %106, %232
%237 = getelementptr inbounds double, double* %19, i64 %236
store double %235, double* %237
%238 = icmp sgt i64 %231, 1
br i1 %238, label %230, label %239
239: ; preds = %230, %183, %81
%240 = add nsw i64 %83, -1
%241 = icmp sgt i64 %83, 0
%242 = add i64 %82, 1
br i1 %241, label %81, label %186
243: ; preds = %187, %363
%244 = phi i64 [ 0, %187 ], [ %366, %363 ]
%245 = phi i64 [ %33, %187 ], [ %364, %363 ]
%246 = mul i64 %205, %244
%247 = getelementptr i8, i8* %203, i64 %246
%248 = getelementptr i8, i8* %209, i64 %246
%249 = mul i64 %244, %7
%250 = sub i64 0, %249
%251 = getelementptr double, double* %22, i64 %250
%252 = bitcast double* %251 to i8*
%253 = getelementptr i8, i8* %252, i64 %212
%254 = sub i64 %213, %249
%255 = getelementptr double, double* %22, i64 %254
%256 = bitcast double* %255 to i8*
%257 = mul i64 %197, %244
%258 = getelementptr i8, i8* %195, i64 %257
%259 = mul i64 %244, %7
%260 = xor i64 %259, -1
%261 = add i64 %198, %260
%262 = getelementptr double, double* %22, i64 %261
%263 = bitcast double* %262 to i8*
br i1 %188, label %264, label %363
264: ; preds = %243
%265 = mul nsw i64 %245, %7
%266 = add nsw i64 %245, 2
%267 = mul nsw i64 %266, %10
%268 = add i64 %267, 2
br i1 %214, label %346, label %269
269: ; preds = %264
%270 = getelementptr i8, i8* %258, i64 %218
%271 = icmp ugt i8* %270, %258
%272 = or i1 %271, %217
%273 = getelementptr i8, i8* %263, i64 %222
%274 = icmp ugt i8* %273, %263
%275 = or i1 %274, %221
%276 = or i1 %272, %275
br i1 %276, label %346, label %277
277: ; preds = %269
%278 = icmp ult i8* %247, %256
%279 = icmp ult i8* %253, %248
%280 = and i1 %278, %279
br i1 %280, label %346, label %281
281: ; preds = %277
br i1 %226, label %324, label %282
282: ; preds = %281, %282
%283 = phi i64 [ %321, %282 ], [ 0, %281 ]
%284 = phi i64 [ %322, %282 ], [ 0, %281 ]
%285 = xor i64 %283, -1
%286 = add i64 %285, %7
%287 = add nsw i64 %286, %265
%288 = getelementptr inbounds double, double* %22, i64 %287
%289 = getelementptr inbounds double, double* %288, i64 -1
%290 = bitcast double* %289 to <2 x double>*
%291 = load <2 x double>, <2 x double>* %290
%292 = getelementptr inbounds double, double* %288, i64 -2
%293 = getelementptr inbounds double, double* %292, i64 -1
%294 = bitcast double* %293 to <2 x double>*
%295 = load <2 x double>, <2 x double>* %294
%296 = add i64 %268, %286
%297 = getelementptr inbounds double, double* %22, i64 %296
%298 = getelementptr inbounds double, double* %297, i64 -1
%299 = bitcast double* %298 to <2 x double>*
store <2 x double> %291, <2 x double>* %299
%300 = getelementptr inbounds double, double* %297, i64 -2
%301 = getelementptr inbounds double, double* %300, i64 -1
%302 = bitcast double* %301 to <2 x double>*
store <2 x double> %295, <2 x double>* %302
%303 = sub nuw nsw i64 -5, %283
%304 = add i64 %303, %7
%305 = add nsw i64 %304, %265
%306 = getelementptr inbounds double, double* %22, i64 %305
%307 = getelementptr inbounds double, double* %306, i64 -1
%308 = bitcast double* %307 to <2 x double>*
%309 = load <2 x double>, <2 x double>* %308
%310 = getelementptr inbounds double, double* %306, i64 -2
%311 = getelementptr inbounds double, double* %310, i64 -1
%312 = bitcast double* %311 to <2 x double>*
%313 = load <2 x double>, <2 x double>* %312
%314 = add i64 %268, %304
%315 = getelementptr inbounds double, double* %22, i64 %314
%316 = getelementptr inbounds double, double* %315, i64 -1
%317 = bitcast double* %316 to <2 x double>*
store <2 x double> %309, <2 x double>* %317
%318 = getelementptr inbounds double, double* %315, i64 -2
%319 = getelementptr inbounds double, double* %318, i64 -1
%320 = bitcast double* %319 to <2 x double>*
store <2 x double> %313, <2 x double>* %320
%321 = add nuw i64 %283, 8
%322 = add i64 %284, 2
%323 = icmp eq i64 %322, %227
br i1 %323, label %324, label %282
324: ; preds = %282, %281
%325 = phi i64 [ 0, %281 ], [ %321, %282 ]
br i1 %228, label %345, label %326
326: ; preds = %324
%327 = xor i64 %325, -1
%328 = add i64 %327, %7
%329 = add nsw i64 %328, %265
%330 = getelementptr inbounds double, double* %22, i64 %329
%331 = getelementptr inbounds double, double* %330, i64 -1
%332 = bitcast double* %331 to <2 x double>*
%333 = load <2 x double>, <2 x double>* %332
%334 = getelementptr inbounds double, double* %330, i64 -2
%335 = getelementptr inbounds double, double* %334, i64 -1
%336 = bitcast double* %335 to <2 x double>*
%337 = load <2 x double>, <2 x double>* %336
%338 = add i64 %268, %328
%339 = getelementptr inbounds double, double* %22, i64 %338
%340 = getelementptr inbounds double, double* %339, i64 -1
%341 = bitcast double* %340 to <2 x double>*
store <2 x double> %333, <2 x double>* %341
%342 = getelementptr inbounds double, double* %339, i64 -2
%343 = getelementptr inbounds double, double* %342, i64 -1
%344 = bitcast double* %343 to <2 x double>*
store <2 x double> %337, <2 x double>* %344
br label %345
345: ; preds = %324, %326
br i1 %229, label %363, label %346
346: ; preds = %277, %269, %264, %345
%347 = phi i64 [ %7, %277 ], [ %7, %269 ], [ %7, %264 ], [ %224, %345 ]
br label %354
348: ; preds = %186, %1
%349 = add nsw i64 %9, 2
br label %367
350: ; preds = %363
%351 = add nsw i64 %9, 2
br i1 %34, label %352, label %367
352: ; preds = %350
%353 = call i64 @llvm.smax.i64(i64 %351, i64 3)
br label %380
354: ; preds = %346, %354
%355 = phi i64 [ %356, %354 ], [ %347, %346 ]
%356 = add nsw i64 %355, -1
%357 = add nsw i64 %356, %265
%358 = getelementptr inbounds double, double* %22, i64 %357
%359 = load double, double* %358
%360 = add i64 %268, %356
%361 = getelementptr inbounds double, double* %22, i64 %360
store double %359, double* %361
%362 = icmp sgt i64 %355, 1
br i1 %362, label %354, label %363
363: ; preds = %354, %345, %243
%364 = add nsw i64 %245, -1
%365 = icmp sgt i64 %245, 0
%366 = add i64 %244, 1
br i1 %365, label %243, label %350
367: ; preds = %380, %348, %350
%368 = phi i64 [ %349, %348 ], [ %351, %350 ], [ %351, %380 ]
%369 = icmp sgt i32 %6, -4
br i1 %369, label %370, label %500
370: ; preds = %367
%371 = mul nsw i64 %10, 3
%372 = shl nsw i64 %10, 1
%373 = mul nsw i64 %10, %9
%374 = add nsw i64 %9, 1
%375 = mul nsw i64 %374, %10
%376 = mul nsw i64 %368, %10
%377 = add nsw i64 %9, 3
%378 = mul nsw i64 %377, %10
%379 = call i64 @llvm.smax.i64(i64 %10, i64 1)
br label %441
380: ; preds = %352, %380
%381 = phi i64 [ %439, %380 ], [ 2, %352 ]
%382 = mul nsw i64 %381, %10
%383 = add nsw i64 %382, 3
%384 = getelementptr inbounds double, double* %19, i64 %383
%385 = load double, double* %384
%386 = add nsw i64 %382, 2
%387 = getelementptr inbounds double, double* %19, i64 %386
%388 = load double, double* %387
%389 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %385, double 0.000000e+00, double %388, double 1.000000e+00)
%390 = sitofp i32 %389 to double
%391 = getelementptr inbounds double, double* %19, i64 %382
store double %390, double* %391
%392 = load double, double* %384
%393 = load double, double* %387
%394 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %392, double 0.000000e+00, double %393, double 1.000000e+00)
%395 = sitofp i32 %394 to double
%396 = add nsw i64 %382, 1
%397 = getelementptr inbounds double, double* %19, i64 %396
store double %395, double* %397
%398 = getelementptr inbounds double, double* %22, i64 %383
%399 = load double, double* %398
%400 = getelementptr inbounds double, double* %22, i64 %386
%401 = load double, double* %400
%402 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %399, double 0.000000e+00, double %401, double 1.000000e+00)
%403 = sitofp i32 %402 to double
%404 = getelementptr inbounds double, double* %22, i64 %382
store double %403, double* %404
%405 = load double, double* %398
%406 = load double, double* %400
%407 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %405, double 0.000000e+00, double %406, double 1.000000e+00)
%408 = sitofp i32 %407 to double
%409 = getelementptr inbounds double, double* %22, i64 %396
store double %408, double* %409
%410 = add nsw i64 %382, %10
%411 = add i64 %382, %7
%412 = getelementptr inbounds double, double* %19, i64 %411
%413 = load double, double* %412
%414 = add nsw i64 %410, -3
%415 = getelementptr inbounds double, double* %19, i64 %414
%416 = load double, double* %415
%417 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %413, double 0.000000e+00, double %416, double 1.000000e+00)
%418 = sitofp i32 %417 to double
%419 = add nsw i64 %410, -2
%420 = getelementptr inbounds double, double* %19, i64 %419
store double %418, double* %420
%421 = load double, double* %412
%422 = load double, double* %415
%423 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %421, double 0.000000e+00, double %422, double 1.000000e+00)
%424 = sitofp i32 %423 to double
%425 = add nsw i64 %410, -1
%426 = getelementptr inbounds double, double* %19, i64 %425
store double %424, double* %426
%427 = getelementptr inbounds double, double* %22, i64 %411
%428 = load double, double* %427
%429 = getelementptr inbounds double, double* %22, i64 %414
%430 = load double, double* %429
%431 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %428, double 0.000000e+00, double %430, double 1.000000e+00)
%432 = sitofp i32 %431 to double
%433 = getelementptr inbounds double, double* %22, i64 %419
store double %432, double* %433
%434 = load double, double* %427
%435 = load double, double* %429
%436 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %434, double 0.000000e+00, double %435, double 1.000000e+00)
%437 = sitofp i32 %436 to double
%438 = getelementptr inbounds double, double* %22, i64 %425
store double %437, double* %438
%439 = add nuw nsw i64 %381, 1
%440 = icmp eq i64 %439, %353
br i1 %440, label %367, label %380
441: ; preds = %370, %441
%442 = phi i64 [ 0, %370 ], [ %498, %441 ]
%443 = add nsw i64 %442, %371
%444 = getelementptr inbounds double, double* %19, i64 %443
%445 = load double, double* %444
%446 = add nsw i64 %442, %372
%447 = getelementptr inbounds double, double* %19, i64 %446
%448 = load double, double* %447
%449 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %445, double 0.000000e+00, double %448, double 1.000000e+00)
%450 = sitofp i32 %449 to double
%451 = getelementptr inbounds double, double* %19, i64 %442
store double %450, double* %451
%452 = load double, double* %444
%453 = load double, double* %447
%454 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %452, double 0.000000e+00, double %453, double 1.000000e+00)
%455 = sitofp i32 %454 to double
%456 = add nsw i64 %442, %10
%457 = getelementptr inbounds double, double* %19, i64 %456
store double %455, double* %457
%458 = getelementptr inbounds double, double* %22, i64 %443
%459 = load double, double* %458
%460 = getelementptr inbounds double, double* %22, i64 %446
%461 = load double, double* %460
%462 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %459, double 0.000000e+00, double %461, double 1.000000e+00)
%463 = sitofp i32 %462 to double
%464 = getelementptr inbounds double, double* %22, i64 %442
store double %463, double* %464
%465 = load double, double* %458
%466 = load double, double* %460
%467 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %465, double 0.000000e+00, double %466, double 1.000000e+00)
%468 = sitofp i32 %467 to double
%469 = getelementptr inbounds double, double* %22, i64 %456
store double %468, double* %469
%470 = add nsw i64 %442, %373
%471 = getelementptr inbounds double, double* %19, i64 %470
%472 = load double, double* %471
%473 = add nsw i64 %442, %375
%474 = getelementptr inbounds double, double* %19, i64 %473
%475 = load double, double* %474
%476 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %472, double 0.000000e+00, double %475, double 1.000000e+00)
%477 = sitofp i32 %476 to double
%478 = add nsw i64 %442, %376
%479 = getelementptr inbounds double, double* %19, i64 %478
store double %477, double* %479
%480 = load double, double* %471
%481 = load double, double* %474
%482 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %480, double 0.000000e+00, double %481, double 1.000000e+00)
%483 = sitofp i32 %482 to double
%484 = add nsw i64 %442, %378
%485 = getelementptr inbounds double, double* %19, i64 %484
store double %483, double* %485
%486 = getelementptr inbounds double, double* %22, i64 %470
%487 = load double, double* %486
%488 = getelementptr inbounds double, double* %22, i64 %473
%489 = load double, double* %488
%490 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 2.000000e+00, double %487, double 0.000000e+00, double %489, double 1.000000e+00)
%491 = sitofp i32 %490 to double
%492 = getelementptr inbounds double, double* %22, i64 %478
store double %491, double* %492
%493 = load double, double* %486
%494 = load double, double* %488
%495 = call i32 (double, double, double, double, double, ...) bitcast (i32 (...)* @intlin to i32 (double, double, double, double, double, ...)*)(double 3.000000e+00, double %493, double 0.000000e+00, double %494, double 1.000000e+00)
%496 = sitofp i32 %495 to double
%497 = getelementptr inbounds double, double* %22, i64 %484
store double %496, double* %497
%498 = add nuw nsw i64 %442, 1
%499 = icmp eq i64 %498, %379
br i1 %499, label %500, label %441
500: ; preds = %441, %367
%501 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefXvals to i32 (i32, double*, ...)*)(i32 %26, double* %19)
%502 = call i32 (i32, double*, ...) bitcast (i32 (...)* @gridDefYvals to i32 (i32, double*, ...)*)(i32 %26, double* %22)
%503 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.expand_curvilinear_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 582, double* %19)
%504 = call i32 (i8*, i8*, i32, double*, ...) bitcast (i32 (...)* @Free to i32 (i8*, i8*, i32, double*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.expand_curvilinear_grid, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 583, double* %22)
ret i32 %26
}