int create_xgrid_1dx2d_order1(const int *nlon_in, const int *nlat_in,
                              const int *nlon_out, const int *nlat_out,
                              const double *lon_in, const double *lat_in,
                              const double *lon_out, const double *lat_out,
                              const double *mask_in, int *i_in, int *j_in,
                              int *i_out, int *j_out, double *xgrid_area) {
  int nx1, ny1, nx2, ny2, nx1p, nx2p;
  int i1, j1, i2, j2, nxgrid;
  double ll_lon, ll_lat, ur_lon, ur_lat, x_in[50], y_in[50], x_out[50],
      y_out[50];
  double *area_in, *area_out, min_area;
  double *tmpx, *tmpy;
  nx1 = *nlon_in;
  ny1 = *nlat_in;
  nx2 = *nlon_out;
  ny2 = *nlat_out;
  nxgrid = 0;
  nx1p = nx1 + 1;
  nx2p = nx2 + 1;
  area_in = (double *)malloc(nx1 * ny1 * sizeof(double));
  area_out = (double *)malloc(nx2 * ny2 * sizeof(double));
  tmpx = (double *)malloc((nx1 + 1) * (ny1 + 1) * sizeof(double));
  tmpy = (double *)malloc((nx1 + 1) * (ny1 + 1) * sizeof(double));
  for (j1 = 0; j1 <= ny1; j1++)
    for (i1 = 0; i1 <= nx1; i1++) {
      tmpx[j1 * nx1p + i1] = lon_in[i1];
      tmpy[j1 * nx1p + i1] = lat_in[j1];
    }
  if (nx1 > 1)
    get_grid_area(nlon_in, nlat_in, tmpx, tmpy, area_in);
  else
    get_grid_area_no_adjust(nlon_in, nlat_in, tmpx, tmpy, area_in);
  get_grid_area(nlon_out, nlat_out, lon_out, lat_out, area_out);
  free(tmpx);
  free(tmpy);
  for (j1 = 0; j1 < ny1; j1++)
    for (i1 = 0; i1 < nx1; i1++)
      if (mask_in[j1 * nx1 + i1] > (0.5)) {
        ll_lon = lon_in[i1];
        ll_lat = lat_in[j1];
        ur_lon = lon_in[i1 + 1];
        ur_lat = lat_in[j1 + 1];
        for (j2 = 0; j2 < ny2; j2++)
          for (i2 = 0; i2 < nx2; i2++) {
            int n_in, n_out;
            double Xarea;
            y_in[0] = lat_out[j2 * nx2p + i2];
            y_in[1] = lat_out[j2 * nx2p + i2 + 1];
            y_in[2] = lat_out[(j2 + 1) * nx2p + i2 + 1];
            y_in[3] = lat_out[(j2 + 1) * nx2p + i2];
            if ((y_in[0] <= ll_lat) && (y_in[1] <= ll_lat) &&
                (y_in[2] <= ll_lat) && (y_in[3] <= ll_lat))
              continue;
            if ((y_in[0] >= ur_lat) && (y_in[1] >= ur_lat) &&
                (y_in[2] >= ur_lat) && (y_in[3] >= ur_lat))
              continue;
            x_in[0] = lon_out[j2 * nx2p + i2];
            x_in[1] = lon_out[j2 * nx2p + i2 + 1];
            x_in[2] = lon_out[(j2 + 1) * nx2p + i2 + 1];
            x_in[3] = lon_out[(j2 + 1) * nx2p + i2];
            n_in = fix_lon(x_in, y_in, 4, (ll_lon + ur_lon) / 2);
            if ((n_out = clip(x_in, y_in, n_in, ll_lon, ll_lat, ur_lon, ur_lat,
                              x_out, y_out)) > 0) {
              Xarea = poly_area(x_out, y_out, n_out) * mask_in[j1 * nx1 + i1];
              min_area = (area_in[j1 * nx1 + i1] < area_out[j2 * nx2 + i2]
                              ? area_in[j1 * nx1 + i1]
                              : area_out[j2 * nx2 + i2]);
              if (Xarea / min_area > (1.e-6)) {
                xgrid_area[nxgrid] = Xarea;
                i_in[nxgrid] = i1;
                j_in[nxgrid] = j1;
                i_out[nxgrid] = i2;
                j_out[nxgrid] = j2;
                ++nxgrid;
                if (nxgrid > 1e7)
                  error_handler(
                      "nxgrid is greater than MAXXGRID, increase MAXXGRID");
              }
            }
          }
      }
  free(area_in);
  free(area_out);
  return nxgrid;
}


x86 assembly (clang, -O0):
<create_xgrid_1dx2d_order1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x700,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x6c8(%rbp)
mov    -0x3c(%rbp),%eax
imul   -0x40(%rbp),%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x6d0(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x6e0(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    -0x38(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x6e8(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     130b <create_xgrid_1dx2d_order1+0x18b>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     12f8 <create_xgrid_1dx2d_order1+0x178>
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x6e0(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x6e8(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1292 <create_xgrid_1dx2d_order1+0x112>
jmp    12fd <create_xgrid_1dx2d_order1+0x17d>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    127f <create_xgrid_1dx2d_order1+0xff>
cmpl   $0x1,-0x34(%rbp)
jle    133e <create_xgrid_1dx2d_order1+0x1be>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x6e0(%rbp),%rdx
mov    -0x6e8(%rbp),%rcx
mov    -0x6c8(%rbp),%r8
mov    $0x0,%al
call   1090 <get_grid_area@plt>
jmp    1362 <create_xgrid_1dx2d_order1+0x1e2>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x6e0(%rbp),%rdx
mov    -0x6e8(%rbp),%rcx
mov    -0x6c8(%rbp),%r8
mov    $0x0,%al
call   10a0 <get_grid_area_no_adjust@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x10(%rbp),%rdx
mov    0x18(%rbp),%rcx
mov    -0x6d0(%rbp),%r8
mov    $0x0,%al
call   1090 <get_grid_area@plt>
mov    -0x6e0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x6e8(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1862 <create_xgrid_1dx2d_order1+0x6e2>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    184f <create_xgrid_1dx2d_order1+0x6cf>
mov    0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc24(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    183c <create_xgrid_1dx2d_order1+0x6bc>
mov    -0x28(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1837 <create_xgrid_1dx2d_order1+0x6b7>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1824 <create_xgrid_1dx2d_order1+0x6a4>
mov    0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x3a0(%rbp)
ff
mov    0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x398(%rbp)
ff
mov    0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x390(%rbp)
ff
mov    0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x388(%rbp)
ff
movsd  -0x3a0(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1543 <create_xgrid_1dx2d_order1+0x3c3>
movsd  -0x398(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1543 <create_xgrid_1dx2d_order1+0x3c3>
movsd  -0x390(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1543 <create_xgrid_1dx2d_order1+0x3c3>
movsd  -0x388(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1543 <create_xgrid_1dx2d_order1+0x3c3>
jmp    1816 <create_xgrid_1dx2d_order1+0x696>
movsd  -0x3a0(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1594 <create_xgrid_1dx2d_order1+0x414>
movsd  -0x398(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1594 <create_xgrid_1dx2d_order1+0x414>
movsd  -0x390(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1594 <create_xgrid_1dx2d_order1+0x414>
movsd  -0x388(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1594 <create_xgrid_1dx2d_order1+0x414>
jmp    1816 <create_xgrid_1dx2d_order1+0x696>
mov    0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
mov    0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
mov    0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
mov    0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
lea    -0x210(%rbp),%rdi
lea    -0x3a0(%rbp),%rsi
movsd  -0x68(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  0x9d0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x4,%edx
mov    $0x1,%al
call   1070 <fix_lon@plt>
mov    %eax,-0x6ec(%rbp)
lea    -0x210(%rbp),%rdi
lea    -0x3a0(%rbp),%rsi
mov    -0x6ec(%rbp),%edx
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm3
lea    -0x530(%rbp),%rcx
lea    -0x6c0(%rbp),%r8
mov    $0x4,%al
call   1040 <clip@plt>
mov    %eax,-0x6f0(%rbp)
cmp    $0x0,%eax
jle    1811 <create_xgrid_1dx2d_order1+0x691>
lea    -0x530(%rbp),%rdi
lea    -0x6c0(%rbp),%rsi
mov    -0x6f0(%rbp),%edx
mov    $0x0,%al
call   1060 <poly_area@plt>
cvtsi2sd %eax,%xmm0
mov    0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x6f8(%rbp)
ff
mov    -0x6c8(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x6d0(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jbe    1739 <create_xgrid_1dx2d_order1+0x5b9>
mov    -0x6c8(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x34(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x700(%rbp)
ff
jmp    175a <create_xgrid_1dx2d_order1+0x5da>
mov    -0x6d0(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x700(%rbp)
ff
movsd  -0x700(%rbp),%xmm0
ff
movsd  %xmm0,-0x6d8(%rbp)
ff
movsd  -0x6f8(%rbp),%xmm0
ff
divsd  -0x6d8(%rbp),%xmm0
ff
movsd  0x88e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    180c <create_xgrid_1dx2d_order1+0x68c>
movsd  -0x6f8(%rbp),%xmm0
ff
mov    0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%edx
mov    0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x50(%rbp),%edx
mov    0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x54(%rbp),%edx
mov    0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x58(%rbp),%edx
mov    0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
cvtsi2sdl -0x5c(%rbp),%xmm0
movsd  0x829(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1807 <create_xgrid_1dx2d_order1+0x687>
lea    0x820(%rip),%rdi
mov    $0x0,%al
call   1050 <error_handler@plt>
jmp    180c <create_xgrid_1dx2d_order1+0x68c>
jmp    1811 <create_xgrid_1dx2d_order1+0x691>
jmp    1816 <create_xgrid_1dx2d_order1+0x696>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1452 <create_xgrid_1dx2d_order1+0x2d2>
jmp    1829 <create_xgrid_1dx2d_order1+0x6a9>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    143f <create_xgrid_1dx2d_order1+0x2bf>
jmp    183c <create_xgrid_1dx2d_order1+0x6bc>
jmp    1841 <create_xgrid_1dx2d_order1+0x6c1>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13b2 <create_xgrid_1dx2d_order1+0x232>
jmp    1854 <create_xgrid_1dx2d_order1+0x6d4>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    139f <create_xgrid_1dx2d_order1+0x21f>
mov    -0x6c8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x6d0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x5c(%rbp),%eax
add    $0x700,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_xgrid_1dx2d_order1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x778,%rsp
mov    %r9,0xc0(%rsp)
mov    %r8,0xb8(%rsp)
mov    %rdi,0x38(%rsp)
movslq (%rdi),%rdi
mov    %edi,%eax
mov    %rax,0x68(%rsp)
mov    %rsi,0x18(%rsp)
mov    (%rsi),%r15d
mov    %rdx,0x10(%rsp)
movslq (%rdx),%rbp
mov    %rcx,0x78(%rsp)
mov    (%rcx),%ebx
lea    0x1(%rdi),%r12
mov    %r15d,%eax
mov    %rdi,0xc8(%rsp)
imul   %edi,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,0x40(%rsp)
mov    %rbx,0xd8(%rsp)
mov    %ebx,%eax
mov    %rbp,0xd0(%rsp)
imul   %ebp,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,0x70(%rsp)
lea    0x1(%r15),%r14d
mov    %r14d,%eax
mov    %r12,0x48(%rsp)
imul   %r12d,%eax
movslq %eax,%rbp
shl    $0x3,%rbp
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r15,0xb0(%rsp)
test   %r15d,%r15d
js     1453 <create_xgrid_1dx2d_order1+0x2c3>
mov    0x48(%rsp),%rax
mov    %eax,%ebp
lea    0x0(,%rbp,8),%rcx
mov    %rcx,0x90(%rsp)
mov    %r14d,%ecx
mov    %rcx,0x98(%rsp)
mov    %ebp,%ecx
and    $0xfffffffc,%ecx
mov    %rcx,0xe0(%rsp)
add    $0xfffffffffffffffc,%rcx
mov    %rcx,0x88(%rsp)
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %ecx,%r14d
and    $0x3,%r14d
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x80(%rsp)
mov    0x8(%rsp),%rbx
lea    0x70(%rbx),%r13
shl    $0x3,%rax
mov    %rax,0x28(%rsp)
mov    %rbx,%rdx
add    $0x10,%rdx
mov    %r14,0x20(%rsp)
shl    $0x5,%r14
xor    %r12d,%r12d
mov    0x48(%rsp),%r15
jmp    1310 <create_xgrid_1dx2d_order1+0x180>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r12
mov    0x28(%rsp),%rax
add    %rax,%r13
add    %rax,%rdx
add    %rax,%rbx
cmp    0x98(%rsp),%r12
je     1453 <create_xgrid_1dx2d_order1+0x2c3>
cmpl   $0x0,0x68(%rsp)
js     12f0 <create_xgrid_1dx2d_order1+0x160>
mov    %rdx,0xa0(%rsp)
mov    %r15d,%eax
imul   %r12d,%eax
cltq
mov    0x30(%rsp),%rcx
lea    (%rcx,%rax,8),%rdi
mov    0xc0(%rsp),%rax
movsd  (%rax,%r12,8),%xmm0
movapd %xmm0,0x50(%rsp)
mov    0xb8(%rsp),%rsi
mov    0x90(%rsp),%rdx
call   1070 <memcpy@plt>
cmp    $0x4,%r15d
jae    1380 <create_xgrid_1dx2d_order1+0x1f0>
xor    %eax,%eax
mov    0xa0(%rsp),%rdx
movapd 0x50(%rsp),%xmm1
jmp    1440 <create_xgrid_1dx2d_order1+0x2b0>
cs nopw 0x0(%rax,%rax,1)
nop
movapd 0x50(%rsp),%xmm1
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
cmpq   $0xc,0x88(%rsp)
jae    13a5 <create_xgrid_1dx2d_order1+0x215>
xor    %eax,%eax
mov    0xa0(%rsp),%rdx
jmp    1402 <create_xgrid_1dx2d_order1+0x272>
mov    0x80(%rsp),%rcx
xor    %eax,%eax
mov    0xa0(%rsp),%rdx
nopw   0x0(%rax,%rax,1)
movupd %xmm0,-0x70(%r13,%rax,8)
movupd %xmm0,-0x60(%r13,%rax,8)
movupd %xmm0,-0x50(%r13,%rax,8)
movupd %xmm0,-0x40(%r13,%rax,8)
movupd %xmm0,-0x30(%r13,%rax,8)
movupd %xmm0,-0x20(%r13,%rax,8)
movupd %xmm0,-0x10(%r13,%rax,8)
movupd %xmm0,0x0(%r13,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rcx
jne    13c0 <create_xgrid_1dx2d_order1+0x230>
cmpq   $0x0,0x20(%rsp)
je     1424 <create_xgrid_1dx2d_order1+0x294>
lea    (%rdx,%rax,8),%rax
xor    %ecx,%ecx
movupd %xmm0,-0x10(%rax,%rcx,1)
movupd %xmm0,(%rax,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r14
jne    1410 <create_xgrid_1dx2d_order1+0x280>
mov    0xe0(%rsp),%rcx
mov    %rcx,%rax
cmp    %rbp,%rcx
je     12f0 <create_xgrid_1dx2d_order1+0x160>
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%rbp
jne    1440 <create_xgrid_1dx2d_order1+0x2b0>
jmp    12f0 <create_xgrid_1dx2d_order1+0x160>
cmpl   $0x2,0x68(%rsp)
jl     1482 <create_xgrid_1dx2d_order1+0x2f2>
mov    0x38(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x30(%rsp),%rbx
mov    %rbx,%rdx
mov    0x8(%rsp),%rbp
mov    %rbp,%rcx
mov    0x40(%rsp),%r8
xor    %eax,%eax
call   10a0 <get_grid_area@plt>
jmp    14a8 <create_xgrid_1dx2d_order1+0x318>
mov    0x38(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x30(%rsp),%rbx
mov    %rbx,%rdx
mov    0x8(%rsp),%rbp
mov    %rbp,%rcx
mov    0x40(%rsp),%r8
xor    %eax,%eax
call   10b0 <get_grid_area_no_adjust@plt>
movl   $0x0,0x18(%rsp)
mov    0x10(%rsp),%rdi
mov    0x78(%rsp),%rsi
mov    0x7b0(%rsp),%rdx
mov    0x7b8(%rsp),%rcx
mov    0x70(%rsp),%r8
xor    %eax,%eax
call   10a0 <get_grid_area@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
cmpl   $0x0,0xb0(%rsp)
mov    0xc8(%rsp),%rcx
jle    1992 <create_xgrid_1dx2d_order1+0x802>
mov    0xd0(%rsp),%rax
mov    %eax,%esi
lea    0x1(%rax),%rdx
mov    %rdx,0x118(%rsp)
lea    0x0(,%rax,8),%rax
mov    %rax,0x110(%rsp)
mov    0x7b8(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x108(%rsp)
lea    0x5e0(%rsp),%rbx
lea    0x450(%rsp),%r14
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %rsi,0x20(%rsp)
jmp    1576 <create_xgrid_1dx2d_order1+0x3e6>
nopl   0x0(%rax)
mov    %rdi,%rax
mov    %rdi,0x10(%rsp)
cmp    0xb0(%rsp),%rdi
je     1992 <create_xgrid_1dx2d_order1+0x802>
test   %ecx,%ecx
jle    1970 <create_xgrid_1dx2d_order1+0x7e0>
mov    0x10(%rsp),%rax
mov    %rax,%r8
imul   %rcx,%r8
lea    0x1(%rax),%rdi
xor    %ebp,%ebp
mov    %rdi,0x120(%rsp)
mov    %r8,0xf8(%rsp)
jmp    15c1 <create_xgrid_1dx2d_order1+0x431>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbp
mov    %rbp,%rax
mov    %rax,%rbp
cmp    0x68(%rsp),%rax
je     1560 <create_xgrid_1dx2d_order1+0x3d0>
lea    (%r8,%rbp,1),%rdx
mov    0x7c0(%rsp),%rax
movsd  (%rax,%rdx,8),%xmm0
ucomisd 0xa26(%rip),%xmm0
jbe    15b0 <create_xgrid_1dx2d_order1+0x420>
mov    %rdx,0x78(%rsp)
lea    0x1(%rbp),%rax
cmpl   $0x0,0xd8(%rsp)
jle    15b7 <create_xgrid_1dx2d_order1+0x427>
mov    %rax,0x100(%rsp)
mov    0xb8(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
mov    %rbp,0x38(%rsp)
movsd  0x8(%rax,%rbp,8),%xmm1
mov    0xc0(%rsp),%rax
mov    0x10(%rsp),%rdx
movsd  (%rax,%rdx,8),%xmm4
movsd  0x8(%rax,%rdx,8),%xmm2
movsd  %xmm0,0x48(%rsp)
movsd  %xmm1,0x90(%rsp)
addsd  %xmm1,%xmm0
mulsd  0x9be(%rip),%xmm0
movsd  %xmm0,0x88(%rsp)
movapd %xmm2,0xe0(%rsp)
unpcklpd %xmm2,%xmm2
movapd %xmm2,0xa0(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
movsd  %xmm4,0x50(%rsp)
jmp    169e <create_xgrid_1dx2d_order1+0x50e>
mov    0x128(%rsp),%rdx
mov    %rdx,%rax
mov    %rdx,0x8(%rsp)
mov    0xc8(%rsp),%rcx
mov    0x120(%rsp),%rdi
cmp    0xd8(%rsp),%rdx
je     194f <create_xgrid_1dx2d_order1+0x7bf>
cmpl   $0x0,0xd0(%rsp)
jle    1930 <create_xgrid_1dx2d_order1+0x7a0>
mov    0x8(%rsp),%rdi
mov    %rdi,%rax
mov    0x118(%rsp),%rdx
imul   %rdx,%rax
lea    0x1(%rdi),%rcx
mov    %rcx,0x128(%rsp)
imul   %rdx,%rcx
imul   0x110(%rsp),%rdi
add    0x70(%rsp),%rdi
mov    %rdi,0x80(%rsp)
mov    0x108(%rsp),%rdx
lea    (%rdx,%rcx,8),%r15
mov    0x7b0(%rsp),%rdx
lea    (%rdx,%rcx,8),%rcx
mov    %rcx,0x98(%rsp)
mov    0x7b8(%rsp),%rcx
lea    (%rcx,%rax,8),%rcx
lea    (%rdx,%rax,8),%rax
mov    %rax,0x30(%rsp)
xor    %r13d,%r13d
mov    %rcx,0x28(%rsp)
jmp    174d <create_xgrid_1dx2d_order1+0x5bd>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rsi
movsd  0x50(%rsp),%xmm4
mov    0x28(%rsp),%rcx
add    $0x1,%r13
cmp    %r13,%rsi
je     1670 <create_xgrid_1dx2d_order1+0x4e0>
movupd (%rcx,%r13,8),%xmm0
movapd %xmm0,0x130(%rsp)
movsd  (%r15,%r13,8),%xmm1
movsd  %xmm1,0x140(%rsp)
movsd  -0x8(%r15,%r13,8),%xmm2
movsd  %xmm2,0x148(%rsp)
ucomisd %xmm0,%xmm4
jb     179b <create_xgrid_1dx2d_order1+0x60b>
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
ucomisd %xmm3,%xmm4
jb     179b <create_xgrid_1dx2d_order1+0x60b>
ucomisd %xmm1,%xmm4
jb     179b <create_xgrid_1dx2d_order1+0x60b>
ucomisd %xmm2,%xmm4
jae    1740 <create_xgrid_1dx2d_order1+0x5b0>
unpcklpd %xmm2,%xmm1
movapd 0xa0(%rsp),%xmm3
movapd %xmm3,%xmm2
cmpnlepd %xmm0,%xmm2
movapd %xmm3,%xmm0
cmpnlepd %xmm1,%xmm0
shufps $0x88,%xmm0,%xmm2
pslld  $0x1f,%xmm2
movmskps %xmm2,%eax
test   %eax,%eax
je     1740 <create_xgrid_1dx2d_order1+0x5b0>
mov    0x30(%rsp),%rax
movups (%rax,%r13,8),%xmm0
movaps %xmm0,0x2c0(%rsp)
mov    0x98(%rsp),%rax
movups (%rax,%r13,8),%xmm0
shufps $0x4e,%xmm0,%xmm0
movaps %xmm0,0x2d0(%rsp)
lea    0x2c0(%rsp),%r12
mov    %r12,%rdi
mov    %r14,%rbp
lea    0x130(%rsp),%r14
mov    %r14,%rsi
mov    $0x4,%edx
movsd  0x88(%rsp),%xmm0
mov    $0x1,%al
call   1080 <fix_lon@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbp,%r14
mov    %eax,%edx
movsd  0x48(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
movsd  0x90(%rsp),%xmm2
movapd 0xe0(%rsp),%xmm3
mov    %rbx,%rcx
mov    %rbp,%r8
mov    $0x4,%al
call   1040 <clip@plt>
test   %eax,%eax
jle    1730 <create_xgrid_1dx2d_order1+0x5a0>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <poly_area@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x7c0(%rsp),%rax
mov    0x78(%rsp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    0x40(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm1
mov    0x80(%rsp),%rax
minsd  (%rax,%r13,8),%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
ucomisd 0x753(%rip),%xmm2
jbe    1730 <create_xgrid_1dx2d_order1+0x5a0>
movslq 0x18(%rsp),%rax
mov    0x7e8(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
mov    0x7c8(%rsp),%rcx
mov    0x38(%rsp),%rdx
mov    %edx,(%rcx,%rax,4)
mov    0x7d0(%rsp),%rcx
mov    0x10(%rsp),%rdx
mov    %edx,(%rcx,%rax,4)
mov    0x7d8(%rsp),%rcx
mov    %r13d,(%rcx,%rax,4)
mov    0x7e0(%rsp),%rcx
mov    0x8(%rsp),%rdx
mov    %edx,(%rcx,%rax,4)
lea    0x1(%rax),%ecx
mov    %ecx,0x18(%rsp)
cmp    $0x989680,%eax
jl     1730 <create_xgrid_1dx2d_order1+0x5a0>
lea    0x6ee(%rip),%rdi
xor    %eax,%eax
call   1050 <error_handler@plt>
jmp    1730 <create_xgrid_1dx2d_order1+0x5a0>
xchg   %ax,%ax
mov    0x8(%rsp),%rdx
add    $0x1,%rdx
mov    %rdx,%rax
mov    %rdx,0x8(%rsp)
cmp    0xd8(%rsp),%rdx
jne    169e <create_xgrid_1dx2d_order1+0x50e>
mov    0xf8(%rsp),%r8
mov    0x100(%rsp),%rax
jmp    15b7 <create_xgrid_1dx2d_order1+0x427>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x10(%rsp),%rdx
add    $0x1,%rdx
mov    %rdx,%rax
mov    %rdx,0x10(%rsp)
mov    %rdx,%rdi
cmp    0xb0(%rsp),%rdi
jne    1576 <create_xgrid_1dx2d_order1+0x3e6>
mov    0x40(%rsp),%rdi
call   1030 <free@plt>
mov    0x70(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%eax
add    $0x778,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [51 x i8] c"nxgrid is greater than MAXXGRID, increase MAXXGRID\00"
define i32 @create_xgrid_1dx2d_order1(i32* %0, i32* %1, i32* %2, i32* %3, double* nocapture %4, double* nocapture %5, double* %6, double* %7, double* nocapture %8, i32* nocapture writeonly %9, i32* nocapture writeonly %10, i32* nocapture writeonly %11, i32* nocapture writeonly %12, double* nocapture writeonly %13) {
%15 = bitcast double* %4 to i8*
%16 = alloca [50 x double]
%17 = alloca [50 x double]
%18 = alloca [50 x double]
%19 = alloca [50 x double]
%20 = bitcast [50 x double]* %16 to i8*
%21 = bitcast [50 x double]* %17 to i8*
%22 = bitcast [50 x double]* %18 to i8*
%23 = bitcast [50 x double]* %19 to i8*
%24 = load i32, i32* %0
%25 = load i32, i32* %1
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = add nsw i32 %24, 1
%29 = add nsw i32 %26, 1
%30 = mul nsw i32 %25, %24
%31 = sext i32 %30 to i64
%32 = shl nsw i64 %31, 3
%33 = tail call i8* @malloc(i64 %32)
%34 = bitcast i8* %33 to double*
%35 = mul nsw i32 %27, %26
%36 = sext i32 %35 to i64
%37 = shl nsw i64 %36, 3
%38 = tail call i8* @malloc(i64 %37)
%39 = bitcast i8* %38 to double*
%40 = add i32 %25, 1
%41 = mul nsw i32 %40, %28
%42 = sext i32 %41 to i64
%43 = shl nsw i64 %42, 3
%44 = tail call i8* @malloc(i64 %43)
%45 = bitcast i8* %44 to double*
%46 = tail call i8* @malloc(i64 %43)
%47 = bitcast i8* %46 to double*
%48 = icmp slt i32 %25, 0
br i1 %48, label %136, label %49
49: ; preds = %14
%50 = icmp slt i32 %24, 0
%51 = zext i32 %28 to i64
%52 = shl nuw nsw i64 %51, 3
%53 = sext i32 %28 to i64
%54 = zext i32 %40 to i64
%55 = and i64 %51, 4294967292
%56 = add nsw i64 %55, -4
%57 = lshr exact i64 %56, 2
%58 = add nuw nsw i64 %57, 1
%59 = icmp ult i32 %28, 4
%60 = and i64 %51, 4294967292
%61 = and i64 %58, 3
%62 = icmp ult i64 %56, 12
%63 = and i64 %58, 9223372036854775804
%64 = icmp eq i64 %61, 0
%65 = icmp eq i64 %60, %51
br label %66
66: ; preds = %49, %133
%67 = phi i64 [ 0, %49 ], [ %134, %133 ]
br i1 %50, label %133, label %68
68: ; preds = %66
%69 = trunc i64 %67 to i32
%70 = mul i32 %28, %69
%71 = sext i32 %70 to i64
%72 = shl nsw i64 %71, 3
%73 = getelementptr i8, i8* %44, i64 %72
%74 = mul nsw i64 %67, %53
%75 = getelementptr inbounds double, double* %5, i64 %67
%76 = load double, double* %75
br i1 %59, label %125, label %77
77: ; preds = %68
%78 = insertelement <2 x double> poison, double %76, i64 0
%79 = shufflevector <2 x double> %78, <2 x double> poison, <2 x i32> zeroinitializer
%80 = insertelement <2 x double> poison, double %76, i64 0
%81 = shufflevector <2 x double> %80, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %62, label %111, label %82
82: ; preds = %77, %82
%83 = phi i64 [ %108, %82 ], [ 0, %77 ]
%84 = phi i64 [ %109, %82 ], [ 0, %77 ]
%85 = add nsw i64 %83, %74
%86 = getelementptr inbounds double, double* %47, i64 %85
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %79, <2 x double>* %87
%88 = getelementptr inbounds double, double* %86, i64 2
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> %81, <2 x double>* %89
%90 = or i64 %83, 4
%91 = add nsw i64 %90, %74
%92 = getelementptr inbounds double, double* %47, i64 %91
%93 = bitcast double* %92 to <2 x double>*
store <2 x double> %79, <2 x double>* %93
%94 = getelementptr inbounds double, double* %92, i64 2
%95 = bitcast double* %94 to <2 x double>*
store <2 x double> %81, <2 x double>* %95
%96 = or i64 %83, 8
%97 = add nsw i64 %96, %74
%98 = getelementptr inbounds double, double* %47, i64 %97
%99 = bitcast double* %98 to <2 x double>*
store <2 x double> %79, <2 x double>* %99
%100 = getelementptr inbounds double, double* %98, i64 2
%101 = bitcast double* %100 to <2 x double>*
store <2 x double> %81, <2 x double>* %101
%102 = or i64 %83, 12
%103 = add nsw i64 %102, %74
%104 = getelementptr inbounds double, double* %47, i64 %103
%105 = bitcast double* %104 to <2 x double>*
store <2 x double> %79, <2 x double>* %105
%106 = getelementptr inbounds double, double* %104, i64 2
%107 = bitcast double* %106 to <2 x double>*
store <2 x double> %81, <2 x double>* %107
%108 = add nuw i64 %83, 16
%109 = add nuw i64 %84, 4
%110 = icmp eq i64 %109, %63
br i1 %110, label %111, label %82
111: ; preds = %82, %77
%112 = phi i64 [ 0, %77 ], [ %108, %82 ]
br i1 %64, label %124, label %113
113: ; preds = %111, %113
%114 = phi i64 [ %121, %113 ], [ %112, %111 ]
%115 = phi i64 [ %122, %113 ], [ 0, %111 ]
%116 = add nsw i64 %114, %74
%117 = getelementptr inbounds double, double* %47, i64 %116
%118 = bitcast double* %117 to <2 x double>*
store <2 x double> %79, <2 x double>* %118
%119 = getelementptr inbounds double, double* %117, i64 2
%120 = bitcast double* %119 to <2 x double>*
store <2 x double> %81, <2 x double>* %120
%121 = add nuw i64 %114, 4
%122 = add i64 %115, 1
%123 = icmp eq i64 %122, %61
br i1 %123, label %124, label %113
124: ; preds = %113, %111
br i1 %65, label %133, label %125
125: ; preds = %68, %124
%126 = phi i64 [ 0, %68 ], [ %60, %124 ]
br label %127
127: ; preds = %125, %127
%128 = phi i64 [ %131, %127 ], [ %126, %125 ]
%129 = add nsw i64 %128, %74
%130 = getelementptr inbounds double, double* %47, i64 %129
store double %76, double* %130
%131 = add nuw nsw i64 %128, 1
%132 = icmp eq i64 %131, %51
br i1 %132, label %133, label %127
133: ; preds = %127, %124, %66
%134 = add nuw nsw i64 %67, 1
%135 = icmp eq i64 %134, %54
br i1 %135, label %136, label %66
136: ; preds = %133, %14
%137 = icmp sgt i32 %24, 1
br i1 %137, label %138, label %140
138: ; preds = %136
%139 = tail call i32 (i32*, i32*, double*, double*, double*, ...) bitcast (i32 (...)* @get_grid_area to i32 (i32*, i32*, double*, double*, double*, ...)*)(i32* %0, i32* %1, double* %45, double* %47, double* %34)
br label %142
140: ; preds = %136
%141 = tail call i32 (i32*, i32*, double*, double*, double*, ...) bitcast (i32 (...)* @get_grid_area_no_adjust to i32 (i32*, i32*, double*, double*, double*, ...)*)(i32* %0, i32* %1, double* %45, double* %47, double* %34)
br label %142
142: ; preds = %140, %138
%143 = tail call i32 (i32*, i32*, double*, double*, double*, ...) bitcast (i32 (...)* @get_grid_area to i32 (i32*, i32*, double*, double*, double*, ...)*)(i32* %2, i32* %3, double* %6, double* %7, double* %39)
tail call void @free(i8* %44)
tail call void @free(i8* %46)
%144 = icmp sgt i32 %25, 0
br i1 %144, label %145, label %294
145: ; preds = %142
%146 = icmp sgt i32 %24, 0
%147 = icmp sgt i32 %27, 0
%148 = icmp sgt i32 %26, 0
%149 = getelementptr inbounds [50 x double], [50 x double]* %17, i64 0, i64 0
%150 = getelementptr inbounds [50 x double], [50 x double]* %17, i64 0, i64 2
%151 = getelementptr inbounds [50 x double], [50 x double]* %17, i64 0, i64 3
%152 = getelementptr inbounds [50 x double], [50 x double]* %16, i64 0, i64 0
%153 = getelementptr inbounds [50 x double], [50 x double]* %16, i64 0, i64 2
%154 = getelementptr inbounds [50 x double], [50 x double]* %18, i64 0, i64 0
%155 = getelementptr inbounds [50 x double], [50 x double]* %19, i64 0, i64 0
%156 = sext i32 %29 to i64
%157 = sext i32 %26 to i64
%158 = sext i32 %24 to i64
%159 = zext i32 %25 to i64
%160 = zext i32 %24 to i64
%161 = zext i32 %27 to i64
%162 = zext i32 %26 to i64
%163 = bitcast [50 x double]* %17 to <2 x double>*
%164 = bitcast [50 x double]* %16 to <2 x double>*
%165 = bitcast double* %153 to <2 x double>*
br label %166
166: ; preds = %145, %290
%167 = phi i64 [ 0, %145 ], [ %291, %290 ]
%168 = phi i32 [ 0, %145 ], [ %292, %290 ]
br i1 %146, label %171, label %169
169: ; preds = %166
%170 = add nuw nsw i64 %167, 1
br label %290
171: ; preds = %166
%172 = mul nsw i64 %167, %158
%173 = getelementptr inbounds double, double* %5, i64 %167
%174 = add nuw nsw i64 %167, 1
%175 = getelementptr inbounds double, double* %5, i64 %174
%176 = trunc i64 %167 to i32
br label %177
177: ; preds = %171, %286
%178 = phi i64 [ 0, %171 ], [ %287, %286 ]
%179 = phi i32 [ %168, %171 ], [ %288, %286 ]
%180 = add nsw i64 %178, %172
%181 = getelementptr inbounds double, double* %8, i64 %180
%182 = load double, double* %181
%183 = fcmp ogt double %182, 5.000000e-01
br i1 %183, label %186, label %184
184: ; preds = %177
%185 = add nuw nsw i64 %178, 1
br label %286
186: ; preds = %177
%187 = getelementptr inbounds double, double* %4, i64 %178
%188 = load double, double* %187
%189 = load double, double* %173
%190 = add nuw nsw i64 %178, 1
%191 = getelementptr inbounds double, double* %4, i64 %190
%192 = load double, double* %191
%193 = load double, double* %175
br i1 %147, label %194, label %286
194: ; preds = %186
%195 = fadd double %188, %192
%196 = fmul double %195, 5.000000e-01
%197 = getelementptr inbounds double, double* %34, i64 %180
%198 = trunc i64 %178 to i32
%199 = insertelement <4 x double> poison, double %193, i64 0
%200 = shufflevector <4 x double> %199, <4 x double> poison, <4 x i32> zeroinitializer
br label %201
201: ; preds = %194, %282
%202 = phi i64 [ 0, %194 ], [ %283, %282 ]
%203 = phi i32 [ %179, %194 ], [ %284, %282 ]
br i1 %148, label %206, label %204
204: ; preds = %201
%205 = add nuw nsw i64 %202, 1
br label %282
206: ; preds = %201
%207 = mul nsw i64 %202, %156
%208 = add nuw nsw i64 %202, 1
%209 = mul nsw i64 %208, %156
%210 = mul nsw i64 %202, %157
%211 = trunc i64 %202 to i32
br label %212
212: ; preds = %206, %278
%213 = phi i64 [ 0, %206 ], [ %280, %278 ]
%214 = phi i32 [ %203, %206 ], [ %279, %278 ]
%215 = add nsw i64 %213, %207
%216 = getelementptr inbounds double, double* %7, i64 %215
%217 = bitcast double* %216 to <2 x double>*
%218 = load <2 x double>, <2 x double>* %217
store <2 x double> %218, <2 x double>* %163
%219 = add nsw i64 %213, %209
%220 = add nsw i64 %219, 1
%221 = getelementptr inbounds double, double* %7, i64 %220
%222 = load double, double* %221
store double %222, double* %150
%223 = getelementptr inbounds double, double* %7, i64 %219
%224 = load double, double* %223
store double %224, double* %151
%225 = extractelement <2 x double> %218, i64 0
%226 = fcmp ugt double %225, %189
%227 = extractelement <2 x double> %218, i64 1
%228 = fcmp ugt double %227, %189
%229 = select i1 %226, i1 true, i1 %228
%230 = fcmp ugt double %222, %189
%231 = select i1 %229, i1 true, i1 %230
%232 = fcmp ugt double %224, %189
%233 = select i1 %231, i1 true, i1 %232
br i1 %233, label %234, label %278
234: ; preds = %212
%235 = shufflevector <2 x double> %218, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%236 = insertelement <4 x double> %235, double %222, i64 2
%237 = insertelement <4 x double> %236, double %224, i64 3
%238 = fcmp ult <4 x double> %237, %200
%239 = freeze <4 x i1> %238
%240 = bitcast <4 x i1> %239 to i4
%241 = icmp eq i4 %240, 0
br i1 %241, label %278, label %242
242: ; preds = %234
%243 = getelementptr inbounds double, double* %6, i64 %215
%244 = bitcast double* %243 to <2 x double>*
%245 = load <2 x double>, <2 x double>* %244
store <2 x double> %245, <2 x double>* %164
%246 = getelementptr inbounds double, double* %6, i64 %219
%247 = bitcast double* %246 to <2 x double>*
%248 = load <2 x double>, <2 x double>* %247
%249 = shufflevector <2 x double> %248, <2 x double> poison, <2 x i32> <i32 1, i32 0>
store <2 x double> %249, <2 x double>* %165
%250 = call i32 (double*, double*, i32, double, ...) bitcast (i32 (...)* @fix_lon to i32 (double*, double*, i32, double, ...)*)(double* %152, double* %149, i32 4, double %196)
%251 = call i32 (double*, double*, i32, double, double, double, double, double*, double*, ...) bitcast (i32 (...)* @clip to i32 (double*, double*, i32, double, double, double, double, double*, double*, ...)*)(double* %152, double* %149, i32 %250, double %188, double %189, double %192, double %193, double* %154, double* %155)
%252 = icmp sgt i32 %251, 0
br i1 %252, label %253, label %278
253: ; preds = %242
%254 = call i32 (double*, double*, i32, ...) bitcast (i32 (...)* @poly_area to i32 (double*, double*, i32, ...)*)(double* %154, double* %155, i32 %251)
%255 = sitofp i32 %254 to double
%256 = load double, double* %181
%257 = fmul double %256, %255
%258 = load double, double* %197
%259 = add nsw i64 %213, %210
%260 = getelementptr inbounds double, double* %39, i64 %259
%261 = load double, double* %260
%262 = fcmp olt double %258, %261
%263 = select i1 %262, double %258, double %261
%264 = fdiv double %257, %263
%265 = fcmp ogt double %264, 0x3EB0C6F7A0B5ED8D
br i1 %265, label %266, label %278
266: ; preds = %253
%267 = sext i32 %214 to i64
%268 = getelementptr inbounds double, double* %13, i64 %267
store double %257, double* %268
%269 = getelementptr inbounds i32, i32* %9, i64 %267
store i32 %198, i32* %269
%270 = getelementptr inbounds i32, i32* %10, i64 %267
store i32 %176, i32* %270
%271 = getelementptr inbounds i32, i32* %11, i64 %267
%272 = trunc i64 %213 to i32
store i32 %272, i32* %271
%273 = getelementptr inbounds i32, i32* %12, i64 %267
store i32 %211, i32* %273
%274 = add nsw i32 %214, 1
%275 = icmp sgt i32 %214, 9999999
br i1 %275, label %276, label %278
276: ; preds = %266
%277 = call i32 (i8*, ...) bitcast (i32 (...)* @error_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %278
278: ; preds = %242, %266, %276, %253, %234, %212
%279 = phi i32 [ %214, %212 ], [ %214, %234 ], [ %274, %276 ], [ %274, %266 ], [ %214, %253 ], [ %214, %242 ]
%280 = add nuw nsw i64 %213, 1
%281 = icmp eq i64 %280, %162
br i1 %281, label %282, label %212
282: ; preds = %278, %204
%283 = phi i64 [ %205, %204 ], [ %208, %278 ]
%284 = phi i32 [ %203, %204 ], [ %279, %278 ]
%285 = icmp eq i64 %283, %161
br i1 %285, label %286, label %201
286: ; preds = %282, %184, %186
%287 = phi i64 [ %185, %184 ], [ %190, %186 ], [ %190, %282 ]
%288 = phi i32 [ %179, %184 ], [ %179, %186 ], [ %284, %282 ]
%289 = icmp eq i64 %287, %160
br i1 %289, label %290, label %177
290: ; preds = %286, %169
%291 = phi i64 [ %170, %169 ], [ %174, %286 ]
%292 = phi i32 [ %168, %169 ], [ %288, %286 ]
%293 = icmp eq i64 %291, %159
br i1 %293, label %294, label %166
294: ; preds = %290, %142
%295 = phi i32 [ 0, %142 ], [ %292, %290 ]
ret i32 %295
}