int create_xgrid_2dx1d_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((nx2 + 1) * (ny2 + 1) * sizeof(double));
  tmpy = (double *)malloc((nx2 + 1) * (ny2 + 1) * sizeof(double));
  for (j2 = 0; j2 <= ny2; j2++)
    for (i2 = 0; i2 <= nx2; i2++) {
      tmpx[j2 * nx2p + i2] = lon_out[i2];
      tmpy[j2 * nx2p + i2] = lat_out[j2];
    }
  get_grid_area(nlon_in, nlat_in, lon_in, lat_in, area_in);
  get_grid_area(nlon_out, nlat_out, tmpx, tmpy, area_out);
  free(tmpx);
  free(tmpy);
  for (j2 = 0; j2 < ny2; j2++)
    for (i2 = 0; i2 < nx2; i2++) {
      ll_lon = lon_out[i2];
      ll_lat = lat_out[j2];
      ur_lon = lon_out[i2 + 1];
      ur_lat = lat_out[j2 + 1];
      for (j1 = 0; j1 < ny1; j1++)
        for (i1 = 0; i1 < nx1; i1++)
          if (mask_in[j1 * nx1 + i1] > (0.5)) {
            int n_in, n_out;
            double Xarea;
            y_in[0] = lat_in[j1 * nx1p + i1];
            y_in[1] = lat_in[j1 * nx1p + i1 + 1];
            y_in[2] = lat_in[(j1 + 1) * nx1p + i1 + 1];
            y_in[3] = lat_in[(j1 + 1) * nx1p + i1];
            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_in[j1 * nx1p + i1];
            x_in[1] = lon_in[j1 * nx1p + i1 + 1];
            x_in[2] = lon_in[(j1 + 1) * nx1p + i1 + 1];
            x_in[3] = lon_in[(j1 + 1) * nx1p + i1];
            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_2dx1d_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    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x6e0(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    -0x40(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1080 <malloc@plt>
mov    %rax,-0x6e8(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x40(%rbp),%eax
jg     12fb <create_xgrid_2dx1d_order1+0x18b>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     12e8 <create_xgrid_2dx1d_order1+0x178>
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x6e0(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x6e8(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x48(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1282 <create_xgrid_2dx1d_order1+0x112>
jmp    12ed <create_xgrid_2dx1d_order1+0x17d>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    126f <create_xgrid_2dx1d_order1+0xff>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x6c8(%rbp),%r8
mov    $0x0,%al
call   1090 <get_grid_area@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x6e0(%rbp),%rdx
mov    -0x6e8(%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,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    181f <create_xgrid_2dx1d_order1+0x6af>
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    180c <create_xgrid_2dx1d_order1+0x69c>
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    17f9 <create_xgrid_2dx1d_order1+0x689>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    17e6 <create_xgrid_2dx1d_order1+0x676>
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  0xbef(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17d3 <create_xgrid_2dx1d_order1+0x663>
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x3a0(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x398(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x390(%rbp)
ff
mov    -0x30(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%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     1500 <create_xgrid_2dx1d_order1+0x390>
movsd  -0x398(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1500 <create_xgrid_2dx1d_order1+0x390>
movsd  -0x390(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1500 <create_xgrid_2dx1d_order1+0x390>
movsd  -0x388(%rbp),%xmm1
ff
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1500 <create_xgrid_2dx1d_order1+0x390>
jmp    17d8 <create_xgrid_2dx1d_order1+0x668>
movsd  -0x3a0(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1551 <create_xgrid_2dx1d_order1+0x3e1>
movsd  -0x398(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1551 <create_xgrid_2dx1d_order1+0x3e1>
movsd  -0x390(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1551 <create_xgrid_2dx1d_order1+0x3e1>
movsd  -0x388(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jb     1551 <create_xgrid_2dx1d_order1+0x3e1>
jmp    17d8 <create_xgrid_2dx1d_order1+0x668>
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
imul   -0x44(%rbp),%ecx
add    -0x4c(%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  0xa13(%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    17ce <create_xgrid_2dx1d_order1+0x65e>
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    16f6 <create_xgrid_2dx1d_order1+0x586>
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    1717 <create_xgrid_2dx1d_order1+0x5a7>
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  0x8d1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17c9 <create_xgrid_2dx1d_order1+0x659>
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  0x86c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17c4 <create_xgrid_2dx1d_order1+0x654>
lea    0x863(%rip),%rdi
mov    $0x0,%al
call   1050 <error_handler@plt>
jmp    17c9 <create_xgrid_2dx1d_order1+0x659>
jmp    17ce <create_xgrid_2dx1d_order1+0x65e>
jmp    17d3 <create_xgrid_2dx1d_order1+0x663>
jmp    17d8 <create_xgrid_2dx1d_order1+0x668>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    13e7 <create_xgrid_2dx1d_order1+0x277>
jmp    17eb <create_xgrid_2dx1d_order1+0x67b>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    13d4 <create_xgrid_2dx1d_order1+0x264>
jmp    17fe <create_xgrid_2dx1d_order1+0x68e>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    136f <create_xgrid_2dx1d_order1+0x1ff>
jmp    1811 <create_xgrid_2dx1d_order1+0x6a1>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    135c <create_xgrid_2dx1d_order1+0x1ec>
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_2dx1d_order1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x778,%rsp
mov    %r9,0x50(%rsp)
mov    %r8,0xd0(%rsp)
mov    %rdi,0x10(%rsp)
movslq (%rdi),%rdi
mov    %rsi,0x60(%rsp)
mov    (%rsi),%eax
mov    %rdx,0x68(%rsp)
movslq (%rdx),%rbx
mov    %ebx,%edx
mov    %rdx,0xb8(%rsp)
mov    %rcx,0x78(%rsp)
mov    (%rcx),%r14d
lea    0x1(%rbx),%rbp
mov    %rax,0xd8(%rsp)
mov    %rdi,0xc8(%rsp)
imul   %edi,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %r14d,%eax
mov    %rbx,0xc0(%rsp)
imul   %ebx,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1090 <malloc@plt>
mov    %rax,0x70(%rsp)
lea    0x1(%r14),%ebx
mov    %ebx,%eax
mov    %rbp,0x38(%rsp)
imul   %ebp,%eax
movslq %eax,%rbp
shl    $0x3,%rbp
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %rbp,%rdi
call   1090 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %r14,0xb0(%rsp)
test   %r14d,%r14d
js     1453 <create_xgrid_2dx1d_order1+0x2d3>
mov    0x38(%rsp),%rax
mov    %eax,%r12d
lea    0x0(,%r12,8),%rcx
mov    %rcx,0x90(%rsp)
mov    %ebx,%ecx
mov    %rcx,0x28(%rsp)
mov    %r12d,%ecx
and    $0xfffffffc,%ecx
mov    %rcx,0x88(%rsp)
add    $0xfffffffffffffffc,%rcx
mov    %rcx,0xe0(%rsp)
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %ecx,%r13d
and    $0x3,%r13d
and    $0xfffffffffffffffc,%rcx
mov    %rcx,0x20(%rsp)
mov    0x30(%rsp),%rbx
lea    0x70(%rbx),%r14
shl    $0x3,%rax
mov    %rax,0x98(%rsp)
mov    %rbx,%rdx
add    $0x10,%rdx
mov    %r13,0x80(%rsp)
shl    $0x5,%r13
xor    %r15d,%r15d
mov    0x38(%rsp),%rbp
jmp    1300 <create_xgrid_2dx1d_order1+0x180>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
mov    0x98(%rsp),%rax
add    %rax,%r14
add    %rax,%rdx
add    %rax,%rbx
cmp    0x28(%rsp),%r15
je     1453 <create_xgrid_2dx1d_order1+0x2d3>
cmpl   $0x0,0xb8(%rsp)
js     12e0 <create_xgrid_2dx1d_order1+0x160>
mov    %rdx,0xa0(%rsp)
mov    %ebp,%eax
imul   %r15d,%eax
cltq
mov    0x18(%rsp),%rcx
lea    (%rcx,%rax,8),%rdi
mov    0x7b8(%rsp),%rax
movsd  (%rax,%r15,8),%xmm0
movapd %xmm0,0x40(%rsp)
mov    0x7b0(%rsp),%rsi
mov    0x90(%rsp),%rdx
call   1070 <memcpy@plt>
cmp    $0x4,%ebp
jae    1370 <create_xgrid_2dx1d_order1+0x1f0>
xor    %eax,%eax
mov    0xa0(%rsp),%rdx
movapd 0x40(%rsp),%xmm1
jmp    1440 <create_xgrid_2dx1d_order1+0x2c0>
cs nopw 0x0(%rax,%rax,1)
movapd 0x40(%rsp),%xmm1
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
cmpq   $0xc,0xe0(%rsp)
jae    1395 <create_xgrid_2dx1d_order1+0x215>
xor    %eax,%eax
mov    0xa0(%rsp),%rdx
jmp    13f1 <create_xgrid_2dx1d_order1+0x271>
mov    0x20(%rsp),%rcx
xor    %eax,%eax
mov    0xa0(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd %xmm0,-0x70(%r14,%rax,8)
movupd %xmm0,-0x60(%r14,%rax,8)
movupd %xmm0,-0x50(%r14,%rax,8)
movupd %xmm0,-0x40(%r14,%rax,8)
movupd %xmm0,-0x30(%r14,%rax,8)
movupd %xmm0,-0x20(%r14,%rax,8)
movupd %xmm0,-0x10(%r14,%rax,8)
movupd %xmm0,(%r14,%rax,8)
add    $0x10,%rax
add    $0xfffffffffffffffc,%rcx
jne    13b0 <create_xgrid_2dx1d_order1+0x230>
cmpq   $0x0,0x80(%rsp)
je     1424 <create_xgrid_2dx1d_order1+0x2a4>
lea    (%rdx,%rax,8),%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd %xmm0,-0x10(%rax,%rcx,1)
movupd %xmm0,(%rax,%rcx,1)
add    $0x20,%rcx
cmp    %rcx,%r13
jne    1410 <create_xgrid_2dx1d_order1+0x290>
mov    0x88(%rsp),%rcx
mov    %rcx,%rax
cmp    %r12,%rcx
je     12e0 <create_xgrid_2dx1d_order1+0x160>
nopl   0x0(%rax,%rax,1)
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    1440 <create_xgrid_2dx1d_order1+0x2c0>
jmp    12e0 <create_xgrid_2dx1d_order1+0x160>
movl   $0x0,0xc(%rsp)
mov    0x10(%rsp),%rdi
mov    0x60(%rsp),%rsi
mov    0xd0(%rsp),%rdx
mov    0x50(%rsp),%rcx
mov    0x58(%rsp),%r8
xor    %eax,%eax
call   10a0 <get_grid_area@plt>
mov    0x68(%rsp),%rdi
mov    0x78(%rsp),%rsi
mov    0x18(%rsp),%rbx
mov    %rbx,%rdx
mov    0x30(%rsp),%rbp
mov    %rbp,%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
mov    0xc0(%rsp),%r9
jle    192e <create_xgrid_2dx1d_order1+0x7ae>
mov    %ecx,%edi
lea    0x1(%rcx),%rax
mov    %rax,0x118(%rsp)
mov    0x50(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x110(%rsp)
lea    0x0(,%rcx,8),%rax
mov    %rax,0x108(%rsp)
movsd  0xaf7(%rip),%xmm4
lea    0x5e0(%rsp),%r14
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movl   $0x0,0xc(%rsp)
mov    %rdi,0x20(%rsp)
jmp    154e <create_xgrid_2dx1d_order1+0x3ce>
nopw   0x0(%rax,%rax,1)
mov    0xf8(%rsp),%rsi
mov    %rsi,%rax
mov    %rsi,0x10(%rsp)
cmp    0xb0(%rsp),%rsi
je     192e <create_xgrid_2dx1d_order1+0x7ae>
test   %r9d,%r9d
jle    1920 <create_xgrid_2dx1d_order1+0x7a0>
mov    0x10(%rsp),%rax
lea    0x1(%rax),%rsi
mov    %rsi,0xf8(%rsp)
imul   %r9,%rax
mov    %rax,0x100(%rsp)
xor    %edx,%edx
jmp    158a <create_xgrid_2dx1d_order1+0x40a>
nopl   0x0(%rax,%rax,1)
cmp    0xb8(%rsp),%rdx
je     1530 <create_xgrid_2dx1d_order1+0x3b0>
mov    %rdx,%rsi
add    $0x1,%rdx
cmpl   $0x0,0xd8(%rsp)
jle    1580 <create_xgrid_2dx1d_order1+0x400>
mov    0x7b0(%rsp),%rax
movsd  (%rax,%rsi,8),%xmm0
movsd  0x8(%rax,%rsi,8),%xmm1
mov    0x7b8(%rsp),%r8
mov    0x10(%rsp),%rax
movsd  (%r8,%rax,8),%xmm5
movsd  0x8(%r8,%rax,8),%xmm2
movsd  %xmm0,0x90(%rsp)
movsd  %xmm1,0x88(%rsp)
addsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x80(%rsp)
mov    0x100(%rsp),%rax
add    %rsi,%rax
mov    %rax,0x78(%rsp)
movapd %xmm2,0xe0(%rsp)
unpcklpd %xmm2,%xmm2
movapd %xmm2,0xa0(%rsp)
xor    %ebp,%ebp
mov    %rdx,0x120(%rsp)
mov    %rsi,0x128(%rsp)
movsd  %xmm5,0x40(%rsp)
jmp    165e <create_xgrid_2dx1d_order1+0x4de>
nopl   0x0(%rax,%rax,1)
mov    0x60(%rsp),%rax
mov    %rax,%rbp
mov    0xc8(%rsp),%rcx
mov    0xc0(%rsp),%r9
mov    0x120(%rsp),%rdx
cmp    0xd8(%rsp),%rax
je     1580 <create_xgrid_2dx1d_order1+0x400>
test   %ecx,%ecx
jle    1910 <create_xgrid_2dx1d_order1+0x790>
mov    %rbp,%rax
imul   %rcx,%rax
mov    %rbp,%rcx
mov    0x118(%rsp),%rsi
imul   %rsi,%rcx
lea    0x1(%rbp),%rdx
mov    %rdx,0x60(%rsp)
imul   %rsi,%rdx
mov    0x110(%rsp),%rsi
lea    (%rsi,%rdx,8),%rbx
mov    0xd0(%rsp),%rsi
lea    (%rsi,%rdx,8),%rdx
mov    %rdx,0x98(%rsp)
mov    0x50(%rsp),%rdx
lea    (%rdx,%rcx,8),%rdx
lea    (%rsi,%rcx,8),%rcx
mov    %rcx,0x38(%rsp)
mov    0x7c0(%rsp),%rcx
lea    (%rcx,%rax,8),%r15
mov    %rbp,0x68(%rsp)
imul   0x108(%rsp),%rbp
add    0x58(%rsp),%rbp
mov    %rbp,0x30(%rsp)
xor    %r13d,%r13d
mov    %rbx,0x28(%rsp)
mov    %rdx,0x18(%rsp)
jmp    171d <create_xgrid_2dx1d_order1+0x59d>
movsd  0x90a(%rip),%xmm4
mov    0x20(%rsp),%rdi
movsd  0x40(%rsp),%xmm5
mov    0x28(%rsp),%rbx
mov    0x18(%rsp),%rdx
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
cmp    %r13,%rdi
je     1630 <create_xgrid_2dx1d_order1+0x4b0>
movsd  (%r15,%r13,8),%xmm0
ucomisd %xmm4,%xmm0
jbe    1710 <create_xgrid_2dx1d_order1+0x590>
movupd (%rdx,%r13,8),%xmm0
movapd %xmm0,0x130(%rsp)
movsd  (%rbx,%r13,8),%xmm1
movsd  %xmm1,0x140(%rsp)
movsd  -0x8(%rbx,%r13,8),%xmm2
movsd  %xmm2,0x148(%rsp)
ucomisd %xmm0,%xmm5
jb     1777 <create_xgrid_2dx1d_order1+0x5f7>
movapd %xmm0,%xmm3
unpckhpd %xmm0,%xmm3
ucomisd %xmm3,%xmm5
jb     1777 <create_xgrid_2dx1d_order1+0x5f7>
ucomisd %xmm1,%xmm5
jb     1777 <create_xgrid_2dx1d_order1+0x5f7>
ucomisd %xmm2,%xmm5
jae    1710 <create_xgrid_2dx1d_order1+0x590>
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     1710 <create_xgrid_2dx1d_order1+0x590>
mov    0x38(%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  0x80(%rsp),%xmm0
mov    $0x1,%al
call   1080 <fix_lon@plt>
mov    %r12,%rdi
mov    %r14,%rsi
lea    0x450(%rsp),%rcx
mov    %rbp,%r14
mov    %eax,%edx
movsd  0x90(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
movsd  0x88(%rsp),%xmm2
movapd 0xe0(%rsp),%xmm3
mov    %rbp,%r8
mov    $0x4,%al
call   1040 <clip@plt>
test   %eax,%eax
jle    16ee <create_xgrid_2dx1d_order1+0x56e>
lea    0x450(%rsp),%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <poly_area@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%r15,%r13,8),%xmm0
mov    0x30(%rsp),%rax
movsd  (%rax,%r13,8),%xmm1
mov    0x70(%rsp),%rax
mov    0x78(%rsp),%rcx
minsd  (%rax,%rcx,8),%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
ucomisd 0x774(%rip),%xmm2
jbe    16ee <create_xgrid_2dx1d_order1+0x56e>
movslq 0xc(%rsp),%rax
mov    0x7e8(%rsp),%rcx
movsd  %xmm0,(%rcx,%rax,8)
mov    0x7c8(%rsp),%rcx
mov    %r13d,(%rcx,%rax,4)
mov    0x7d0(%rsp),%rcx
mov    0x68(%rsp),%rdx
mov    %edx,(%rcx,%rax,4)
mov    0x7d8(%rsp),%rcx
mov    0x128(%rsp),%rdx
mov    %edx,(%rcx,%rax,4)
mov    0x7e0(%rsp),%rcx
mov    0x10(%rsp),%rdx
mov    %edx,(%rcx,%rax,4)
lea    0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x989680,%eax
jl     16ee <create_xgrid_2dx1d_order1+0x56e>
lea    0x70c(%rip),%rdi
xor    %eax,%eax
call   1050 <error_handler@plt>
jmp    16ee <create_xgrid_2dx1d_order1+0x56e>
add    $0x1,%rbp
mov    %rbp,%rax
jmp    1650 <create_xgrid_2dx1d_order1+0x4d0>
nopl   0x0(%rax)
mov    0x10(%rsp),%rsi
add    $0x1,%rsi
jmp    1538 <create_xgrid_2dx1d_order1+0x3b8>
mov    0x58(%rsp),%rdi
call   1030 <free@plt>
mov    0x70(%rsp),%rdi
call   1030 <free@plt>
mov    0xc(%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_2dx1d_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* %31
%83 = add nsw i32 %82, 1
%84 = load i32, i32* %32
%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* %31
%92 = add nsw i32 %91, 1
%93 = load i32, i32* %32
%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* %38
br label %100
100: ; preds = %140, %14
%101 = load i32, i32* %38
%102 = load i32, i32* %32
%103 = icmp sle i32 %101, %102
br i1 %103, label %104, label %143
104: ; preds = %100
store i32 0, i32* %37
br label %105
105: ; preds = %136, %104
%106 = load i32, i32* %37
%107 = load i32, i32* %31
%108 = icmp sle i32 %106, %107
br i1 %108, label %109, label %139
109: ; preds = %105
%110 = load double*, double** %21
%111 = load i32, i32* %37
%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* %38
%117 = load i32, i32* %34
%118 = mul nsw i32 %116, %117
%119 = load i32, i32* %37
%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** %22
%124 = load i32, i32* %38
%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* %38
%130 = load i32, i32* %34
%131 = mul nsw i32 %129, %130
%132 = load i32, i32* %37
%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* %37
%138 = add nsw i32 %137, 1
store i32 %138, i32* %37
br label %105
139: ; preds = %105
br label %140
140: ; preds = %139
%141 = load i32, i32* %38
%142 = add nsw i32 %141, 1
store i32 %142, i32* %38
br label %100
143: ; preds = %100
%144 = load i32*, i32** %15
%145 = load i32*, i32** %16
%146 = load double*, double** %19
%147 = load double*, double** %20
%148 = load double*, double** %48
%149 = call i32 (i32*, i32*, double*, double*, double*, ...) bitcast (i32 (...)* @get_grid_area to i32 (i32*, i32*, double*, double*, double*, ...)*)(i32* %144, i32* %145, double* %146, double* %147, double* %148)
%150 = load i32*, i32** %17
%151 = load i32*, i32** %18
%152 = load double*, double** %51
%153 = load double*, double** %52
%154 = load double*, double** %49
%155 = call i32 (i32*, i32*, double*, double*, double*, ...) bitcast (i32 (...)* @get_grid_area to i32 (i32*, i32*, double*, double*, double*, ...)*)(i32* %150, i32* %151, double* %152, double* %153, double* %154)
%156 = load double*, double** %51
%157 = bitcast double* %156 to i8*
%158 = load double*, double** %52
%159 = bitcast double* %158 to i8*
store i32 0, i32* %38
br label %160
160: ; preds = %471, %143
%161 = load i32, i32* %38
%162 = load i32, i32* %32
%163 = icmp slt i32 %161, %162
br i1 %163, label %164, label %474
164: ; preds = %160
store i32 0, i32* %37
br label %165
165: ; preds = %467, %164
%166 = load i32, i32* %37
%167 = load i32, i32* %31
%168 = icmp slt i32 %166, %167
br i1 %168, label %169, label %470
169: ; preds = %165
%170 = load double*, double** %21
%171 = load i32, i32* %37
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %170, i64 %172
%174 = load double, double* %173
store double %174, double* %40
%175 = load double*, double** %22
%176 = load i32, i32* %38
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds double, double* %175, i64 %177
%179 = load double, double* %178
store double %179, double* %41
%180 = load double*, double** %21
%181 = load i32, i32* %37
%182 = add nsw i32 %181, 1
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double, double* %180, i64 %183
%185 = load double, double* %184
store double %185, double* %42
%186 = load double*, double** %22
%187 = load i32, i32* %38
%188 = add nsw i32 %187, 1
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %186, i64 %189
%191 = load double, double* %190
store double %191, double* %43
store i32 0, i32* %36
br label %192
192: ; preds = %463, %169
%193 = load i32, i32* %36
%194 = load i32, i32* %30
%195 = icmp slt i32 %193, %194
br i1 %195, label %196, label %466
196: ; preds = %192
store i32 0, i32* %35
br label %197
197: ; preds = %459, %196
%198 = load i32, i32* %35
%199 = load i32, i32* %29
%200 = icmp slt i32 %198, %199
br i1 %200, label %201, label %462
201: ; preds = %197
%202 = load double*, double** %23
%203 = load i32, i32* %36
%204 = load i32, i32* %29
%205 = mul nsw i32 %203, %204
%206 = load i32, i32* %35
%207 = add nsw i32 %205, %206
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds double, double* %202, i64 %208
%210 = load double, double* %209
%211 = fcmp ogt double %210, 5.000000e-01
br i1 %211, label %212, label %458
212: ; preds = %201
%213 = load double*, double** %20
%214 = load i32, i32* %36
%215 = load i32, i32* %33
%216 = mul nsw i32 %214, %215
%217 = load i32, i32* %35
%218 = add nsw i32 %216, %217
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds double, double* %213, i64 %219
%221 = load double, double* %220
%222 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 0
store double %221, double* %222
%223 = load double*, double** %20
%224 = load i32, i32* %36
%225 = load i32, i32* %33
%226 = mul nsw i32 %224, %225
%227 = load i32, i32* %35
%228 = add nsw i32 %226, %227
%229 = add nsw i32 %228, 1
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds double, double* %223, i64 %230
%232 = load double, double* %231
%233 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 1
store double %232, double* %233
%234 = load double*, double** %20
%235 = load i32, i32* %36
%236 = add nsw i32 %235, 1
%237 = load i32, i32* %33
%238 = mul nsw i32 %236, %237
%239 = load i32, i32* %35
%240 = add nsw i32 %238, %239
%241 = add nsw i32 %240, 1
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %234, i64 %242
%244 = load double, double* %243
%245 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 2
store double %244, double* %245
%246 = load double*, double** %20
%247 = load i32, i32* %36
%248 = add nsw i32 %247, 1
%249 = load i32, i32* %33
%250 = mul nsw i32 %248, %249
%251 = load i32, i32* %35
%252 = add nsw i32 %250, %251
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %246, i64 %253
%255 = load double, double* %254
%256 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 3
store double %255, double* %256
%257 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 0
%258 = load double, double* %257
%259 = load double, double* %41
%260 = fcmp ole double %258, %259
br i1 %260, label %261, label %277
261: ; preds = %212
%262 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 1
%263 = load double, double* %262
%264 = load double, double* %41
%265 = fcmp ole double %263, %264
br i1 %265, label %266, label %277
266: ; preds = %261
%267 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 2
%268 = load double, double* %267
%269 = load double, double* %41
%270 = fcmp ole double %268, %269
br i1 %270, label %271, label %277
271: ; preds = %266
%272 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 3
%273 = load double, double* %272
%274 = load double, double* %41
%275 = fcmp ole double %273, %274
br i1 %275, label %276, label %277
276: ; preds = %271
br label %459
277: ; preds = %271, %266, %261, %212
%278 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 0
%279 = load double, double* %278
%280 = load double, double* %43
%281 = fcmp oge double %279, %280
br i1 %281, label %282, label %298
282: ; preds = %277
%283 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 1
%284 = load double, double* %283
%285 = load double, double* %43
%286 = fcmp oge double %284, %285
br i1 %286, label %287, label %298
287: ; preds = %282
%288 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 2
%289 = load double, double* %288
%290 = load double, double* %43
%291 = fcmp oge double %289, %290
br i1 %291, label %292, label %298
292: ; preds = %287
%293 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 3
%294 = load double, double* %293
%295 = load double, double* %43
%296 = fcmp oge double %294, %295
br i1 %296, label %297, label %298
297: ; preds = %292
br label %459
298: ; preds = %292, %287, %282, %277
%299 = load double*, double** %19
%300 = load i32, i32* %36
%301 = load i32, i32* %33
%302 = mul nsw i32 %300, %301
%303 = load i32, i32* %35
%304 = add nsw i32 %302, %303
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds double, double* %299, i64 %305
%307 = load double, double* %306
%308 = getelementptr inbounds [50 x double], [50 x double]* %44, i64 0, i64 0
store double %307, double* %308
%309 = load double*, double** %19
%310 = load i32, i32* %36
%311 = load i32, i32* %33
%312 = mul nsw i32 %310, %311
%313 = load i32, i32* %35
%314 = add nsw i32 %312, %313
%315 = add nsw i32 %314, 1
%316 = sext i32 %315 to i64
%317 = getelementptr inbounds double, double* %309, i64 %316
%318 = load double, double* %317
%319 = getelementptr inbounds [50 x double], [50 x double]* %44, i64 0, i64 1
store double %318, double* %319
%320 = load double*, double** %19
%321 = load i32, i32* %36
%322 = add nsw i32 %321, 1
%323 = load i32, i32* %33
%324 = mul nsw i32 %322, %323
%325 = load i32, i32* %35
%326 = add nsw i32 %324, %325
%327 = add nsw i32 %326, 1
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds double, double* %320, i64 %328
%330 = load double, double* %329
%331 = getelementptr inbounds [50 x double], [50 x double]* %44, i64 0, i64 2
store double %330, double* %331
%332 = load double*, double** %19
%333 = load i32, i32* %36
%334 = add nsw i32 %333, 1
%335 = load i32, i32* %33
%336 = mul nsw i32 %334, %335
%337 = load i32, i32* %35
%338 = add nsw i32 %336, %337
%339 = sext i32 %338 to i64
%340 = getelementptr inbounds double, double* %332, i64 %339
%341 = load double, double* %340
%342 = getelementptr inbounds [50 x double], [50 x double]* %44, i64 0, i64 3
store double %341, double* %342
%343 = getelementptr inbounds [50 x double], [50 x double]* %44, i64 0, i64 0
%344 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 0
%345 = load double, double* %40
%346 = load double, double* %42
%347 = fadd double %345, %346
%348 = fdiv double %347, 2.000000e+00
%349 = call i32 (double*, double*, i32, double, ...) bitcast (i32 (...)* @fix_lon to i32 (double*, double*, i32, double, ...)*)(double* %343, double* %344, i32 4, double %348)
store i32 %349, i32* %53
%350 = getelementptr inbounds [50 x double], [50 x double]* %44, i64 0, i64 0
%351 = getelementptr inbounds [50 x double], [50 x double]* %45, i64 0, i64 0
%352 = load i32, i32* %53
%353 = load double, double* %40
%354 = load double, double* %41
%355 = load double, double* %42
%356 = load double, double* %43
%357 = getelementptr inbounds [50 x double], [50 x double]* %46, i64 0, i64 0
%358 = getelementptr inbounds [50 x double], [50 x double]* %47, i64 0, i64 0
%359 = 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* %350, double* %351, i32 %352, double %353, double %354, double %355, double %356, double* %357, double* %358)
store i32 %359, i32* %54
%360 = icmp sgt i32 %359, 0
br i1 %360, label %361, label %457
361: ; preds = %298
%362 = getelementptr inbounds [50 x double], [50 x double]* %46, i64 0, i64 0
%363 = getelementptr inbounds [50 x double], [50 x double]* %47, i64 0, i64 0
%364 = load i32, i32* %54
%365 = call i32 (double*, double*, i32, ...) bitcast (i32 (...)* @poly_area to i32 (double*, double*, i32, ...)*)(double* %362, double* %363, i32 %364)
%366 = sitofp i32 %365 to double
%367 = load double*, double** %23
%368 = load i32, i32* %36
%369 = load i32, i32* %29
%370 = mul nsw i32 %368, %369
%371 = load i32, i32* %35
%372 = add nsw i32 %370, %371
%373 = sext i32 %372 to i64
%374 = getelementptr inbounds double, double* %367, i64 %373
%375 = load double, double* %374
%376 = fmul double %366, %375
store double %376, double* %55
%377 = load double*, double** %48
%378 = load i32, i32* %36
%379 = load i32, i32* %29
%380 = mul nsw i32 %378, %379
%381 = load i32, i32* %35
%382 = add nsw i32 %380, %381
%383 = sext i32 %382 to i64
%384 = getelementptr inbounds double, double* %377, i64 %383
%385 = load double, double* %384
%386 = load double*, double** %49
%387 = load i32, i32* %38
%388 = load i32, i32* %31
%389 = mul nsw i32 %387, %388
%390 = load i32, i32* %37
%391 = add nsw i32 %389, %390
%392 = sext i32 %391 to i64
%393 = getelementptr inbounds double, double* %386, i64 %392
%394 = load double, double* %393
%395 = fcmp olt double %385, %394
br i1 %395, label %396, label %406
396: ; preds = %361
%397 = load double*, double** %48
%398 = load i32, i32* %36
%399 = load i32, i32* %29
%400 = mul nsw i32 %398, %399
%401 = load i32, i32* %35
%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
br label %416
406: ; preds = %361
%407 = load double*, double** %49
%408 = load i32, i32* %38
%409 = load i32, i32* %31
%410 = mul nsw i32 %408, %409
%411 = load i32, i32* %37
%412 = add nsw i32 %410, %411
%413 = sext i32 %412 to i64
%414 = getelementptr inbounds double, double* %407, i64 %413
%415 = load double, double* %414
br label %416
416: ; preds = %406, %396
%417 = phi double [ %405, %396 ], [ %415, %406 ]
store double %417, double* %50
%418 = load double, double* %55
%419 = load double, double* %50
%420 = fdiv double %418, %419
%421 = fcmp ogt double %420, 0x3EB0C6F7A0B5ED8D
br i1 %421, label %422, label %456
422: ; preds = %416
%423 = load double, double* %55
%424 = load double*, double** %28
%425 = load i32, i32* %39
%426 = sext i32 %425 to i64
%427 = getelementptr inbounds double, double* %424, i64 %426
store double %423, double* %427
%428 = load i32, i32* %35
%429 = load i32*, i32** %24
%430 = load i32, i32* %39
%431 = sext i32 %430 to i64
%432 = getelementptr inbounds i32, i32* %429, i64 %431
store i32 %428, i32* %432
%433 = load i32, i32* %36
%434 = load i32*, i32** %25
%435 = load i32, i32* %39
%436 = sext i32 %435 to i64
%437 = getelementptr inbounds i32, i32* %434, i64 %436
store i32 %433, i32* %437
%438 = load i32, i32* %37
%439 = load i32*, i32** %26
%440 = load i32, i32* %39
%441 = sext i32 %440 to i64
%442 = getelementptr inbounds i32, i32* %439, i64 %441
store i32 %438, i32* %442
%443 = load i32, i32* %38
%444 = load i32*, i32** %27
%445 = load i32, i32* %39
%446 = sext i32 %445 to i64
%447 = getelementptr inbounds i32, i32* %444, i64 %446
store i32 %443, i32* %447
%448 = load i32, i32* %39
%449 = add nsw i32 %448, 1
store i32 %449, i32* %39
%450 = load i32, i32* %39
%451 = sitofp i32 %450 to double
%452 = fcmp ogt double %451, 1.000000e+07
br i1 %452, label %453, label %455
453: ; preds = %422
%454 = 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 %455
455: ; preds = %453, %422
br label %456
456: ; preds = %455, %416
br label %457
457: ; preds = %456, %298
br label %458
458: ; preds = %457, %201
br label %459
459: ; preds = %458, %297, %276
%460 = load i32, i32* %35
%461 = add nsw i32 %460, 1
store i32 %461, i32* %35
br label %197
462: ; preds = %197
br label %463
463: ; preds = %462
%464 = load i32, i32* %36
%465 = add nsw i32 %464, 1
store i32 %465, i32* %36
br label %192
466: ; preds = %192
br label %467
467: ; preds = %466
%468 = load i32, i32* %37
%469 = add nsw i32 %468, 1
store i32 %469, i32* %37
br label %165
470: ; preds = %165
br label %471
471: ; preds = %470
%472 = load i32, i32* %38
%473 = add nsw i32 %472, 1
store i32 %473, i32* %38
br label %160
474: ; preds = %160
%475 = load double*, double** %48
%476 = bitcast double* %475 to i8*
%477 = load double*, double** %49
%478 = bitcast double* %477 to i8*
%479 = load i32, i32* %39
ret i32 %479
}

LLVM IR (-O2):
@.str = [51 x i8] c"nxgrid is greater than MAXXGRID, increase MAXXGRID\00"
define i32 @create_xgrid_2dx1d_order1(i32* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5, double* nocapture %6, double* nocapture %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* %6 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 %27, 1
%41 = mul nsw i32 %40, %29
%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 %27, 0
br i1 %48, label %136, label %49
49: ; preds = %14
%50 = icmp slt i32 %26, 0
%51 = zext i32 %29 to i64
%52 = shl nuw nsw i64 %51, 3
%53 = sext i32 %29 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 %29, 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 %29, %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* %7, 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 = 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* %4, double* %5, double* %34)
%138 = 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* %45, double* %47, double* %39)
tail call void @free(i8* %44)
tail call void @free(i8* %46)
%139 = icmp sgt i32 %27, 0
br i1 %139, label %140, label %286
140: ; preds = %136
%141 = icmp sgt i32 %26, 0
%142 = icmp sgt i32 %25, 0
%143 = icmp sgt i32 %24, 0
%144 = getelementptr inbounds [50 x double], [50 x double]* %17, i64 0, i64 0
%145 = getelementptr inbounds [50 x double], [50 x double]* %17, i64 0, i64 2
%146 = getelementptr inbounds [50 x double], [50 x double]* %17, i64 0, i64 3
%147 = getelementptr inbounds [50 x double], [50 x double]* %16, i64 0, i64 0
%148 = getelementptr inbounds [50 x double], [50 x double]* %16, i64 0, i64 2
%149 = getelementptr inbounds [50 x double], [50 x double]* %18, i64 0, i64 0
%150 = getelementptr inbounds [50 x double], [50 x double]* %19, i64 0, i64 0
%151 = sext i32 %24 to i64
%152 = sext i32 %28 to i64
%153 = sext i32 %26 to i64
%154 = zext i32 %27 to i64
%155 = zext i32 %26 to i64
%156 = zext i32 %25 to i64
%157 = zext i32 %24 to i64
%158 = bitcast [50 x double]* %17 to <2 x double>*
%159 = bitcast [50 x double]* %16 to <2 x double>*
%160 = bitcast double* %148 to <2 x double>*
br label %161
161: ; preds = %140, %282
%162 = phi i64 [ 0, %140 ], [ %283, %282 ]
%163 = phi i32 [ 0, %140 ], [ %284, %282 ]
br i1 %141, label %166, label %164
164: ; preds = %161
%165 = add nuw nsw i64 %162, 1
br label %282
166: ; preds = %161
%167 = getelementptr inbounds double, double* %7, i64 %162
%168 = add nuw nsw i64 %162, 1
%169 = getelementptr inbounds double, double* %7, i64 %168
%170 = mul nsw i64 %162, %153
%171 = trunc i64 %162 to i32
br label %175
172: ; preds = %278, %175
%173 = phi i32 [ %177, %175 ], [ %280, %278 ]
%174 = icmp eq i64 %181, %155
br i1 %174, label %282, label %175
175: ; preds = %166, %172
%176 = phi i64 [ 0, %166 ], [ %181, %172 ]
%177 = phi i32 [ %163, %166 ], [ %173, %172 ]
%178 = getelementptr inbounds double, double* %6, i64 %176
%179 = load double, double* %178
%180 = load double, double* %167
%181 = add nuw nsw i64 %176, 1
%182 = getelementptr inbounds double, double* %6, i64 %181
%183 = load double, double* %182
%184 = load double, double* %169
br i1 %142, label %185, label %172
185: ; preds = %175
%186 = fadd double %179, %183
%187 = fmul double %186, 5.000000e-01
%188 = add nsw i64 %176, %170
%189 = getelementptr inbounds double, double* %39, i64 %188
%190 = trunc i64 %176 to i32
%191 = insertelement <4 x double> poison, double %184, i64 0
%192 = shufflevector <4 x double> %191, <4 x double> poison, <4 x i32> zeroinitializer
br label %193
193: ; preds = %185, %278
%194 = phi i64 [ 0, %185 ], [ %279, %278 ]
%195 = phi i32 [ %177, %185 ], [ %280, %278 ]
br i1 %143, label %198, label %196
196: ; preds = %193
%197 = add nuw nsw i64 %194, 1
br label %278
198: ; preds = %193
%199 = mul nsw i64 %194, %151
%200 = mul nsw i64 %194, %152
%201 = add nuw nsw i64 %194, 1
%202 = mul nsw i64 %201, %152
%203 = trunc i64 %194 to i32
br label %204
204: ; preds = %198, %274
%205 = phi i64 [ 0, %198 ], [ %276, %274 ]
%206 = phi i32 [ %195, %198 ], [ %275, %274 ]
%207 = add nsw i64 %205, %199
%208 = getelementptr inbounds double, double* %8, i64 %207
%209 = load double, double* %208
%210 = fcmp ogt double %209, 5.000000e-01
br i1 %210, label %211, label %274
211: ; preds = %204
%212 = add nsw i64 %205, %200
%213 = getelementptr inbounds double, double* %5, i64 %212
%214 = bitcast double* %213 to <2 x double>*
%215 = load <2 x double>, <2 x double>* %214
store <2 x double> %215, <2 x double>* %158
%216 = add nsw i64 %205, %202
%217 = add nsw i64 %216, 1
%218 = getelementptr inbounds double, double* %5, i64 %217
%219 = load double, double* %218
store double %219, double* %145
%220 = getelementptr inbounds double, double* %5, i64 %216
%221 = load double, double* %220
store double %221, double* %146
%222 = extractelement <2 x double> %215, i64 0
%223 = fcmp ugt double %222, %180
%224 = extractelement <2 x double> %215, i64 1
%225 = fcmp ugt double %224, %180
%226 = select i1 %223, i1 true, i1 %225
%227 = fcmp ugt double %219, %180
%228 = select i1 %226, i1 true, i1 %227
%229 = fcmp ugt double %221, %180
%230 = select i1 %228, i1 true, i1 %229
br i1 %230, label %231, label %274
231: ; preds = %211
%232 = shufflevector <2 x double> %215, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%233 = insertelement <4 x double> %232, double %219, i64 2
%234 = insertelement <4 x double> %233, double %221, i64 3
%235 = fcmp ult <4 x double> %234, %192
%236 = freeze <4 x i1> %235
%237 = bitcast <4 x i1> %236 to i4
%238 = icmp eq i4 %237, 0
br i1 %238, label %274, label %239
239: ; preds = %231
%240 = getelementptr inbounds double, double* %4, i64 %212
%241 = bitcast double* %240 to <2 x double>*
%242 = load <2 x double>, <2 x double>* %241
store <2 x double> %242, <2 x double>* %159
%243 = getelementptr inbounds double, double* %4, i64 %216
%244 = bitcast double* %243 to <2 x double>*
%245 = load <2 x double>, <2 x double>* %244
%246 = shufflevector <2 x double> %245, <2 x double> poison, <2 x i32> <i32 1, i32 0>
store <2 x double> %246, <2 x double>* %160
%247 = call i32 (double*, double*, i32, double, ...) bitcast (i32 (...)* @fix_lon to i32 (double*, double*, i32, double, ...)*)(double* %147, double* %144, i32 4, double %187)
%248 = 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* %147, double* %144, i32 %247, double %179, double %180, double %183, double %184, double* %149, double* %150)
%249 = icmp sgt i32 %248, 0
br i1 %249, label %250, label %274
250: ; preds = %239
%251 = call i32 (double*, double*, i32, ...) bitcast (i32 (...)* @poly_area to i32 (double*, double*, i32, ...)*)(double* %149, double* %150, i32 %248)
%252 = sitofp i32 %251 to double
%253 = load double, double* %208
%254 = fmul double %253, %252
%255 = getelementptr inbounds double, double* %34, i64 %207
%256 = load double, double* %255
%257 = load double, double* %189
%258 = fcmp olt double %256, %257
%259 = select i1 %258, double %256, double %257
%260 = fdiv double %254, %259
%261 = fcmp ogt double %260, 0x3EB0C6F7A0B5ED8D
br i1 %261, label %262, label %274
262: ; preds = %250
%263 = sext i32 %206 to i64
%264 = getelementptr inbounds double, double* %13, i64 %263
store double %254, double* %264
%265 = getelementptr inbounds i32, i32* %9, i64 %263
%266 = trunc i64 %205 to i32
store i32 %266, i32* %265
%267 = getelementptr inbounds i32, i32* %10, i64 %263
store i32 %203, i32* %267
%268 = getelementptr inbounds i32, i32* %11, i64 %263
store i32 %190, i32* %268
%269 = getelementptr inbounds i32, i32* %12, i64 %263
store i32 %171, i32* %269
%270 = add nsw i32 %206, 1
%271 = icmp sgt i32 %206, 9999999
br i1 %271, label %272, label %274
272: ; preds = %262
%273 = 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 %274
274: ; preds = %211, %231, %250, %272, %262, %239, %204
%275 = phi i32 [ %206, %204 ], [ %206, %211 ], [ %206, %231 ], [ %270, %272 ], [ %270, %262 ], [ %206, %250 ], [ %206, %239 ]
%276 = add nuw nsw i64 %205, 1
%277 = icmp eq i64 %276, %157
br i1 %277, label %278, label %204
278: ; preds = %274, %196
%279 = phi i64 [ %197, %196 ], [ %201, %274 ]
%280 = phi i32 [ %195, %196 ], [ %275, %274 ]
%281 = icmp eq i64 %279, %156
br i1 %281, label %172, label %193
282: ; preds = %172, %164
%283 = phi i64 [ %165, %164 ], [ %168, %172 ]
%284 = phi i32 [ %163, %164 ], [ %173, %172 ]
%285 = icmp eq i64 %283, %154
br i1 %285, label %286, label %161
286: ; preds = %282, %136
%287 = phi i32 [ 0, %136 ], [ %284, %282 ]
ret i32 %287
}