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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ get_edge(int, int, double const *, double const *,
                            double const *, double const *, double *, double *,
                            double *, double *, int, int, int, int);
double great_circle_distance(double *, double *);
int /*<<< orphan*/ latlon2xyz(int, double const *, double const *, double *,
                              double *, double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ normalize_vect(double *);
double spherical_excess_area(double *, double *, double *, double *, int);
int /*<<< orphan*/ unit_vect_latlon(int, double *, double *, double *,
                                    double *);
int /*<<< orphan*/ vect_cross(double *, double *, double *);
void calc_c2l_grid_info(int *nx_pt, int *ny_pt, const double *xt,
                        const double *yt, const double *xc, const double *yc,
                        double *dx, double *dy, double *area, double *edge_w,
                        double *edge_e, double *edge_s, double *edge_n,
                        double *en_n, double *en_e, double *vlon, double *vlat,
                        int *on_west_edge, int *on_east_edge,
                        int *on_south_edge, int *on_north_edge) {
  double *x, *y, *z, *xt_tmp, *yt_tmp;
  int nx, ny, nxp, nyp, i, j;
  double p1[3], p2[3], p3[3], p4[3];
  nx = *nx_pt;
  ny = *ny_pt;
  nxp = nx + 1;
  nyp = ny + 1;
  for (j = 0; j < nyp; j++)
    for (i = 0; i < nx; i++) {
      p1[0] = xc[j * nxp + i];
      p1[1] = yc[j * nxp + i];
      p2[0] = xc[j * nxp + i + 1];
      p2[1] = yc[j * nxp + i + 1];
      dx[j * nx + i] = great_circle_distance(p1, p2);
    }
  for (j = 0; j < ny; j++)
    for (i = 0; i < nxp; i++) {
      p1[0] = xc[j * nxp + i];
      p1[1] = yc[j * nxp + i];
      p2[0] = xc[(j + 1) * nxp + i];
      p2[1] = yc[(j + 1) * nxp + i];
      dy[j * nxp + i] = great_circle_distance(p1, p2);
    }
  for (j = 0; j < ny; j++)
    for (i = 0; i < nx; i++) {
      p1[0] = xc[j * nxp + i];
      p1[1] = yc[j * nxp + i];
      p2[0] = xc[(j + 1) * nxp + i];
      p2[1] = yc[(j + 1) * nxp + i];
      p3[0] = xc[j * nxp + i + 1];
      p3[1] = yc[j * nxp + i + 1];
      p4[0] = xc[(j + 1) * nxp + i + 1];
      p4[1] = yc[(j + 1) * nxp + i + 1];
      area[j * nx + i] = spherical_excess_area(p1, p2, p3, p4, (6371000.));
    }
  x = (double *)malloc(nxp * nyp * sizeof(double));
  y = (double *)malloc(nxp * nyp * sizeof(double));
  z = (double *)malloc(nxp * nyp * sizeof(double));
  latlon2xyz(nxp * nyp, xc, yc, x, y, z);
  for (j = 0; j < nyp; j++)
    for (i = 0; i < nx; i++) {
      p1[0] = x[j * nxp + i];
      p1[1] = y[j * nxp + i];
      p1[2] = z[j * nxp + i];
      p2[0] = x[j * nxp + i + 1];
      p2[1] = y[j * nxp + i + 1];
      p2[2] = z[j * nxp + i + 1];
      vect_cross(p1, p2, en_n + 3 * (j * nx + i));
      normalize_vect(en_n + 3 * (j * nx + i));
    }
  for (j = 0; j < ny; j++)
    for (i = 0; i < nxp; i++) {
      p2[0] = x[j * nxp + i];
      p2[1] = y[j * nxp + i];
      p2[2] = z[j * nxp + i];
      p1[0] = x[(j + 1) * nxp + i];
      p1[1] = y[(j + 1) * nxp + i];
      p1[2] = z[(j + 1) * nxp + i];
      vect_cross(p1, p2, en_e + 3 * (j * nxp + i));
      normalize_vect(en_e + 3 * (j * nxp + i));
    }
  xt_tmp = (double *)malloc(nx * ny * sizeof(double));
  yt_tmp = (double *)malloc(nx * ny * sizeof(double));
  for (j = 0; j < ny; j++)
    for (i = 0; i < nx; i++) {
      xt_tmp[j * nx + i] = xt[(j + 1) * (nx + 2) + i + 1];
      yt_tmp[j * nx + i] = yt[(j + 1) * (nx + 2) + i + 1];
    }
  unit_vect_latlon(nx * ny, xt_tmp, yt_tmp, vlon, vlat);
  get_edge(nx, ny, xt, yt, xc, yc, edge_w, edge_e, edge_s, edge_n,
           *on_west_edge, *on_east_edge, *on_south_edge, *on_north_edge);
  free(x);
  free(y);
  free(z);
  free(xt_tmp);
  free(yt_tmp);
}


x86 assembly (clang, -O0):
<calc_c2l_grid_info>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    0x80(%rbp),%rax
mov    0x78(%rbp),%rax
mov    0x70(%rbp),%rax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
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,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x84(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x88(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x90(%rbp),%eax
jge    136a <calc_c2l_grid_info+0x1da>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    1351 <calc_c2l_grid_info+0x1c1>
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1050 <great_circle_distance@plt>
mov    0x10(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x84(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1257 <calc_c2l_grid_info+0xc7>
jmp    1356 <calc_c2l_grid_info+0x1c6>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    123b <calc_c2l_grid_info+0xab>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    14a3 <calc_c2l_grid_info+0x313>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jge    148a <calc_c2l_grid_info+0x2fa>
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
call   1050 <great_circle_distance@plt>
mov    0x18(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1390 <calc_c2l_grid_info+0x200>
jmp    148f <calc_c2l_grid_info+0x2ff>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1374 <calc_c2l_grid_info+0x1e4>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    169e <calc_c2l_grid_info+0x50e>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    1685 <calc_c2l_grid_info+0x4f5>
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x50(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
mov    -0x58(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
lea    -0x110(%rbp),%rcx
mov    $0x6136b8,%r8d
call   10b0 <spherical_excess_area@plt>
mov    0x20(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x84(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    14c9 <calc_c2l_grid_info+0x339>
jmp    168a <calc_c2l_grid_info+0x4fa>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    14ad <calc_c2l_grid_info+0x31d>
mov    -0x8c(%rbp),%eax
imul   -0x90(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x8c(%rbp),%eax
imul   -0x90(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x8c(%rbp),%eax
imul   -0x90(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x8c(%rbp),%edi
imul   -0x90(%rbp),%edi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    -0x70(%rbp),%r9
call   10a0 <latlon2xyz@plt>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x90(%rbp),%eax
jge    18d4 <calc_c2l_grid_info+0x744>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    18bb <calc_c2l_grid_info+0x72b>
mov    -0x60(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x68(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x70(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x60(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x68(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x70(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    0x48(%rbp),%rdx
mov    -0x98(%rbp),%eax
imul   -0x84(%rbp),%eax
add    -0x94(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1090 <vect_cross@plt>
mov    0x48(%rbp),%rdi
mov    -0x98(%rbp),%eax
imul   -0x84(%rbp),%eax
add    -0x94(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <normalize_vect@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1744 <calc_c2l_grid_info+0x5b4>
jmp    18c0 <calc_c2l_grid_info+0x730>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1728 <calc_c2l_grid_info+0x598>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    1a8a <calc_c2l_grid_info+0x8fa>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jge    1a71 <calc_c2l_grid_info+0x8e1>
mov    -0x60(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0x68(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x70(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x60(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x68(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x70(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8c(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
lea    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
mov    0x50(%rbp),%rdx
mov    -0x98(%rbp),%eax
imul   -0x8c(%rbp),%eax
add    -0x94(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1090 <vect_cross@plt>
mov    0x50(%rbp),%rdi
mov    -0x98(%rbp),%eax
imul   -0x8c(%rbp),%eax
add    -0x94(%rbp),%eax
imul   $0x3,%eax,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
call   1040 <normalize_vect@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    18fa <calc_c2l_grid_info+0x76a>
jmp    1a76 <calc_c2l_grid_info+0x8e6>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    18de <calc_c2l_grid_info+0x74e>
mov    -0x84(%rbp),%eax
imul   -0x88(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x84(%rbp),%eax
imul   -0x88(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x88(%rbp),%eax
jge    1bbd <calc_c2l_grid_info+0xa2d>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    -0x84(%rbp),%eax
jge    1ba4 <calc_c2l_grid_info+0xa14>
mov    -0x40(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
mov    -0x84(%rbp),%edx
add    $0x2,%edx
imul   %edx,%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x78(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x84(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
mov    -0x98(%rbp),%ecx
add    $0x1,%ecx
mov    -0x84(%rbp),%edx
add    $0x2,%edx
imul   %edx,%ecx
add    -0x94(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x80(%rbp),%rax
mov    -0x98(%rbp),%ecx
imul   -0x84(%rbp),%ecx
add    -0x94(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1aec <calc_c2l_grid_info+0x95c>
jmp    1ba9 <calc_c2l_grid_info+0xa19>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1ad0 <calc_c2l_grid_info+0x940>
mov    -0x84(%rbp),%edi
imul   -0x88(%rbp),%edi
mov    -0x78(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    0x58(%rbp),%rcx
mov    0x60(%rbp),%r8
call   1060 <unit_vect_latlon@plt>
mov    -0x84(%rbp),%edi
mov    -0x88(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x50(%rbp),%r8
mov    -0x58(%rbp),%r9
mov    0x28(%rbp),%r13
mov    0x30(%rbp),%r12
mov    0x38(%rbp),%r15
mov    0x40(%rbp),%r14
mov    0x68(%rbp),%rax
mov    (%rax),%ebx
mov    0x70(%rbp),%rax
mov    (%rax),%r11d
mov    0x78(%rbp),%rax
mov    (%rax),%r10d
mov    0x80(%rbp),%rax
mov    (%rax),%eax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11d,0x28(%rsp)
mov    %r10d,0x30(%rsp)
mov    %eax,0x38(%rsp)
call   1080 <get_edge@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_c2l_grid_info>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %r9,%r15
mov    %r8,%r14
mov    %rcx,0x58(%rsp)
mov    %rdx,0xc8(%rsp)
movslq (%rdi),%rdx
mov    %edx,%eax
mov    (%rsi),%ecx
lea    0x1(%rdx),%esi
lea    0x1(%rcx),%edi
mov    %esi,0x50(%rsp)
movslq %esi,%rsi
mov    %rdi,0xd0(%rsp)
mov    %edi,%edi
mov    %rdi,0x60(%rsp)
mov    %rcx,0x40(%rsp)
test   %ecx,%ecx
mov    %r9,0x88(%rsp)
mov    %r8,0x80(%rsp)
mov    %rax,0x20(%rsp)
mov    %rdx,0x48(%rsp)
mov    %rsi,0x38(%rsp)
js     15de <calc_c2l_grid_info+0x44e>
mov    0x180(%rsp),%rbx
lea    0x0(,%rdx,8),%rcx
mov    %rcx,0x18(%rsp)
lea    0x8(%r14),%rbp
lea    0x0(,%rsi,8),%rcx
mov    %rcx,(%rsp)
lea    0x8(%r15),%r12
xor    %esi,%esi
lea    0xb0(%rsp),%r15
lea    0x90(%rsp),%r13
mov    %rdx,%rcx
jmp    1274 <calc_c2l_grid_info+0xe4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x30(%rsp),%rsi
add    $0x1,%rsi
add    0x18(%rsp),%rbx
mov    (%rsp),%rcx
add    %rcx,%rbp
add    %rcx,%r12
cmp    0x60(%rsp),%rsi
mov    0x48(%rsp),%rcx
je     12e3 <calc_c2l_grid_info+0x153>
mov    %rsi,0x30(%rsp)
test   %ecx,%ecx
jle    1250 <calc_c2l_grid_info+0xc0>
xor    %r14d,%r14d
movsd  -0x8(%rbp,%r14,8),%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  -0x8(%r12,%r14,8),%xmm0
movsd  %xmm0,0xb8(%rsp)
movsd  0x0(%rbp,%r14,8),%xmm0
movsd  %xmm0,0x90(%rsp)
movsd  (%r12,%r14,8),%xmm0
movsd  %xmm0,0x98(%rsp)
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <great_circle_distance@plt>
mov    0x20(%rsp),%rax
movsd  %xmm0,(%rbx,%r14,8)
add    $0x1,%r14
cmp    %r14,%rax
jne    1280 <calc_c2l_grid_info+0xf0>
jmp    1250 <calc_c2l_grid_info+0xc0>
cmpl   $0x0,0x40(%rsp)
jle    15e8 <calc_c2l_grid_info+0x458>
mov    0x50(%rsp),%ebp
xor    %ebx,%ebx
lea    0xb0(%rsp),%rdi
lea    0x90(%rsp),%rsi
mov    0x88(%rsp),%r15
mov    0x80(%rsp),%r14
jmp    132f <calc_c2l_grid_info+0x19f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    0x40(%rsp),%rbx
je     1414 <calc_c2l_grid_info+0x284>
test   %eax,%eax
js     1320 <calc_c2l_grid_info+0x190>
mov    %rbx,%rax
mov    0x38(%rsp),%rdx
imul   %rdx,%rax
add    $0x1,%rbx
mov    %rbx,0x10(%rsp)
mov    %rbx,%rcx
imul   %rdx,%rcx
lea    (%r14,%rcx,8),%rdx
mov    %rdx,0x30(%rsp)
lea    (%r15,%rcx,8),%rcx
mov    %rcx,0x18(%rsp)
lea    (%r14,%rax,8),%rcx
mov    %rcx,(%rsp)
lea    (%r15,%rax,8),%r15
mov    0x188(%rsp),%rcx
lea    (%rcx,%rax,8),%r12
xor    %r13d,%r13d
nopl   0x0(%rax)
mov    (%rsp),%rax
movsd  (%rax,%r13,8),%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  (%r15,%r13,8),%xmm0
movsd  %xmm0,0xb8(%rsp)
mov    0x30(%rsp),%rax
movsd  (%rax,%r13,8),%xmm0
movsd  %xmm0,0x90(%rsp)
mov    0x18(%rsp),%rax
movsd  (%rax,%r13,8),%xmm0
movsd  %xmm0,0x98(%rsp)
mov    %rdi,%rbx
mov    %rsi,%r14
call   1050 <great_circle_distance@plt>
mov    %r14,%rsi
mov    %rbx,%rdi
movsd  %xmm0,(%r12,%r13,8)
add    $0x1,%r13
cmp    %r13,%rbp
jne    1380 <calc_c2l_grid_info+0x1f0>
mov    0x88(%rsp),%r15
mov    0x80(%rsp),%r14
mov    0x20(%rsp),%rax
mov    0x48(%rsp),%rcx
mov    0x10(%rsp),%rbx
cmp    0x40(%rsp),%rbx
jne    132f <calc_c2l_grid_info+0x19f>
cmpl   $0x0,0x40(%rsp)
jle    15de <calc_c2l_grid_info+0x44e>
lea    0x8(%r14),%rdx
mov    %rdx,0x70(%rsp)
lea    0x8(%r15),%rdx
mov    %rdx,0x68(%rsp)
lea    0x0(,%rax,8),%r13
xor    %r9d,%r9d
lea    0xb0(%rsp),%rdi
lea    0x90(%rsp),%r10
lea    0x130(%rsp),%rbx
lea    0x110(%rsp),%rax
jmp    1472 <calc_c2l_grid_info+0x2e2>
xchg   %ax,%ax
add    $0x1,%r9
mov    %r9,%rdx
cmp    0x40(%rsp),%rdx
je     15d6 <calc_c2l_grid_info+0x446>
test   %ecx,%ecx
jle    1460 <calc_c2l_grid_info+0x2d0>
mov    %rcx,%r8
mov    %r9,%rcx
mov    0x38(%rsp),%rsi
imul   %rsi,%rcx
lea    0x1(%r9),%rdx
mov    %rdx,0x78(%rsp)
imul   %rsi,%rdx
imul   %r8,%r9
mov    0x190(%rsp),%rsi
lea    (%rsi,%r9,8),%rsi
mov    %rsi,0x30(%rsp)
mov    0x70(%rsp),%r8
lea    (%r8,%rdx,8),%rsi
mov    %rsi,0x18(%rsp)
mov    0x68(%rsp),%rsi
lea    (%rsi,%rdx,8),%rdx
mov    %rdx,(%rsp)
lea    (%r8,%rcx,8),%rdx
mov    %rdx,0x10(%rsp)
lea    (%rsi,%rcx,8),%rcx
mov    %rcx,0x28(%rsp)
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rsi
movsd  -0x8(%rsi,%r12,1),%xmm0
movsd  %xmm0,0xb0(%rsp)
mov    0x28(%rsp),%rbp
movsd  -0x8(%rbp,%r12,1),%xmm0
movsd  %xmm0,0xb8(%rsp)
mov    0x18(%rsp),%rcx
movsd  -0x8(%rcx,%r12,1),%xmm0
movsd  %xmm0,0x90(%rsp)
mov    (%rsp),%rdx
movsd  -0x8(%rdx,%r12,1),%xmm0
movsd  %xmm0,0x98(%rsp)
movsd  (%rsi,%r12,1),%xmm0
movsd  %xmm0,0x130(%rsp)
movsd  0x0(%rbp,%r12,1),%xmm0
movsd  %xmm0,0x138(%rsp)
movsd  (%rcx,%r12,1),%xmm0
movsd  %xmm0,0x110(%rsp)
movsd  (%rdx,%r12,1),%xmm0
movsd  %xmm0,0x118(%rsp)
mov    %r10,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %rdi,%r14
mov    %r10,%rbp
mov    $0x6136b8,%r8d
mov    %rax,%r15
call   10b0 <spherical_excess_area@plt>
mov    %r15,%rax
mov    %rbp,%r10
mov    %r14,%rdi
mov    0x30(%rsp),%rcx
movsd  %xmm0,(%rcx,%r12,1)
add    $0x8,%r12
cmp    %r12,%r13
jne    14e0 <calc_c2l_grid_info+0x350>
mov    0x78(%rsp),%rdx
mov    %rdx,%r9
mov    0x88(%rsp),%r15
mov    0x80(%rsp),%r14
mov    0x48(%rsp),%rcx
cmp    0x40(%rsp),%rdx
jne    1472 <calc_c2l_grid_info+0x2e2>
mov    $0x1,%al
mov    %eax,0x8(%rsp)
jmp    1600 <calc_c2l_grid_info+0x470>
movl   $0x0,0x8(%rsp)
jmp    1600 <calc_c2l_grid_info+0x470>
movl   $0x0,0x8(%rsp)
mov    0x88(%rsp),%r15
mov    0x80(%rsp),%r14
mov    0xd0(%rsp),%rbp
imul   0x50(%rsp),%ebp
lea    0x0(,%rbp,8),%ebx
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %rax,%r13
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,0x78(%rsp)
mov    %r12,%rcx
mov    %r13,0x70(%rsp)
mov    %r13,%r8
mov    %rax,0x68(%rsp)
mov    %rax,%r9
call   10a0 <latlon2xyz@plt>
cmpl   $0x0,0x40(%rsp)
mov    0x20(%rsp),%rbp
js     17ba <calc_c2l_grid_info+0x62a>
mov    0x1b8(%rsp),%rax
mov    %rax,(%rsp)
mov    0x48(%rsp),%rax
lea    0x0(,%rax,8),%rax
lea    (%rax,%rax,2),%rax
mov    %rax,0x10(%rsp)
mov    0x78(%rsp),%rax
lea    0x8(%rax),%rsi
mov    0x38(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x28(%rsp)
mov    0x70(%rsp),%rax
lea    0x8(%rax),%rdi
mov    0x68(%rsp),%rax
lea    0x8(%rax),%r13
xor    %edx,%edx
lea    0xb0(%rsp),%r14
lea    0x90(%rsp),%r12
jmp    16fb <calc_c2l_grid_info+0x56b>
nopw   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rdx
add    $0x1,%rdx
mov    0x10(%rsp),%rax
add    %rax,(%rsp)
mov    0x28(%rsp),%rax
add    %rax,%rsi
add    %rax,%rdi
add    %rax,%r13
cmp    0x60(%rsp),%rdx
je     17ba <calc_c2l_grid_info+0x62a>
mov    %rdx,0x18(%rsp)
cmpl   $0x0,0x48(%rsp)
jle    16d0 <calc_c2l_grid_info+0x540>
mov    (%rsp),%rbx
xor    %r15d,%r15d
mov    %rdi,0x30(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  -0x8(%rsi,%r15,8),%xmm0
movsd  %xmm0,0xb0(%rsp)
movsd  -0x8(%rdi,%r15,8),%xmm0
movsd  %xmm0,0xb8(%rsp)
movsd  -0x8(%r13,%r15,8),%xmm0
movsd  %xmm0,0xc0(%rsp)
movsd  (%rsi,%r15,8),%xmm0
movsd  %xmm0,0x90(%rsp)
movsd  (%rdi,%r15,8),%xmm0
movsd  %xmm0,0x98(%rsp)
movsd  0x0(%r13,%r15,8),%xmm0
movsd  %xmm0,0xa0(%rsp)
mov    %r14,%rdi
mov    %rsi,%rbp
mov    %r12,%rsi
mov    %rbx,%rdx
call   1090 <vect_cross@plt>
mov    %rbx,%rdi
call   1040 <normalize_vect@plt>
mov    0x30(%rsp),%rdi
mov    %rbp,%rsi
mov    0x20(%rsp),%rbp
add    $0x1,%r15
add    $0x18,%rbx
cmp    %r15,%rbp
jne    1720 <calc_c2l_grid_info+0x590>
jmp    16d0 <calc_c2l_grid_info+0x540>
cmpb   $0x0,0x8(%rsp)
mov    0x38(%rsp),%r8
je     1929 <calc_c2l_grid_info+0x799>
mov    0x50(%rsp),%r14d
lea    (%r8,%r8,2),%rdx
mov    %rdx,0x50(%rsp)
shl    $0x3,%r14
xor    %ebx,%ebx
lea    0xb0(%rsp),%r12
lea    0x90(%rsp),%rsi
jmp    1802 <calc_c2l_grid_info+0x672>
add    $0x1,%rbx
mov    %rbx,%rcx
cmp    0x40(%rsp),%rcx
je     1929 <calc_c2l_grid_info+0x799>
test   %ebp,%ebp
js     17f0 <calc_c2l_grid_info+0x660>
mov    %rbx,%rcx
imul   %r8,%rcx
lea    0x1(%rbx),%rdx
mov    %rdx,0x60(%rsp)
imul   %r8,%rdx
mov    0x78(%rsp),%r10
lea    (%r10,%rdx,8),%rbp
mov    %rbp,0x30(%rsp)
mov    0x70(%rsp),%r9
lea    (%r9,%rdx,8),%rbp
mov    %rbp,0x18(%rsp)
mov    0x68(%rsp),%r8
lea    (%r8,%rdx,8),%rdx
mov    %rdx,(%rsp)
imul   0x50(%rsp),%rbx
mov    0x1c0(%rsp),%rdx
lea    (%rdx,%rbx,8),%rbp
lea    (%r10,%rcx,8),%rdx
mov    %rdx,0x10(%rsp)
lea    (%r9,%rcx,8),%rdx
mov    %rdx,0x28(%rsp)
lea    (%r8,%rcx,8),%r15
xor    %r13d,%r13d
xchg   %ax,%ax
mov    0x10(%rsp),%rcx
movsd  (%rcx,%r13,1),%xmm0
movsd  %xmm0,0x90(%rsp)
mov    0x28(%rsp),%rcx
movsd  (%rcx,%r13,1),%xmm0
movsd  %xmm0,0x98(%rsp)
movsd  (%r15,%r13,1),%xmm0
movsd  %xmm0,0xa0(%rsp)
mov    0x30(%rsp),%rcx
movsd  (%rcx,%r13,1),%xmm0
movsd  %xmm0,0xb0(%rsp)
mov    0x18(%rsp),%rcx
movsd  (%rcx,%r13,1),%xmm0
movsd  %xmm0,0xb8(%rsp)
mov    (%rsp),%rcx
movsd  (%rcx,%r13,1),%xmm0
movsd  %xmm0,0xc0(%rsp)
mov    %r12,%rdi
mov    %rbp,%rdx
mov    %rsi,%rbx
call   1090 <vect_cross@plt>
mov    %rbp,%rdi
call   1040 <normalize_vect@plt>
mov    %rbx,%rsi
add    $0x8,%r13
add    $0x18,%rbp
cmp    %r13,%r14
jne    1870 <calc_c2l_grid_info+0x6e0>
mov    0x60(%rsp),%rcx
mov    %rcx,%rbx
mov    0x20(%rsp),%rbp
mov    0x38(%rsp),%r8
cmp    0x40(%rsp),%rcx
jne    1802 <calc_c2l_grid_info+0x672>
mov    0x48(%rsp),%rax
imul   0x40(%rsp),%eax
mov    %rax,0xf8(%rsp)
lea    0x0(,%rax,8),%ebx
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    0x20(%rsp),%rdx
mov    %rax,0x28(%rsp)
cmpb   $0x0,0x8(%rsp)
mov    0x58(%rsp),%rcx
mov    0xc8(%rsp),%rsi
je     1d82 <calc_c2l_grid_info+0xbf2>
lea    0x2(%rdx),%r10d
lea    -0x1(%rdx),%rax
mov    %rax,0x50(%rsp)
lea    0x3(%rdx),%eax
mov    %eax,0x8(%rsp)
lea    (%rsi,%rdx,8),%rax
mov    %rax,0x108(%rsp)
lea    (%rcx,%rdx,8),%rax
mov    %rax,0x100(%rsp)
mov    %edx,%eax
and    $0xfffffffc,%eax
mov    %rax,0xf0(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0xe8(%rsp)
mov    %rax,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %rdi,%rax
mov    %rdi,0xe0(%rsp)
and    $0xfffffffffffffffe,%rdi
mov    %rdi,0xd8(%rsp)
mov    %rdx,%rax
neg    %rax
mov    %rax,0x60(%rsp)
mov    0x28(%rsp),%rbp
lea    0x30(%rbp),%rdi
mov    0x48(%rsp),%rax
lea    0x0(,%rax,8),%rax
mov    %rax,0x30(%rsp)
mov    0x10(%rsp),%rax
lea    0x30(%rax),%r15
lea    0x8(%rax),%r8
lea    0x8(%rbp),%r9
xor    %r14d,%r14d
mov    %rdx,%r12
mov    %r10,0x38(%rsp)
jmp    1a4f <calc_c2l_grid_info+0x8bf>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %r10,%r12
mov    0x30(%rsp),%rax
add    %rax,%rdi
add    %rax,%r15
add    %rax,%r8
add    %rax,%r9
cmp    0x40(%rsp),%r14
je     1d82 <calc_c2l_grid_info+0xbf2>
mov    %r14,%rbx
add    $0x1,%r14
cmpl   $0x0,0x48(%rsp)
jle    1a30 <calc_c2l_grid_info+0x8a0>
mov    %rbx,%r11
imul   0x48(%rsp),%r11
mov    %r14d,%ebp
mov    %r10,%rax
imul   %eax,%ebp
mov    %ebp,0x18(%rsp)
cmp    $0x4,%edx
jae    1a80 <calc_c2l_grid_info+0x8f0>
xor    %r13d,%r13d
jmp    1c90 <calc_c2l_grid_info+0xb00>
mov    %r14,(%rsp)
imul   %eax,%ebx
add    0x8(%rsp),%ebx
mov    0x50(%rsp),%rbp
lea    (%rbx,%rbp,1),%eax
cmp    %ebx,%eax
jl     1c89 <calc_c2l_grid_info+0xaf9>
mov    %rbp,%rax
shr    $0x20,%rax
mov    $0x0,%r13d
mov    (%rsp),%r14
jne    1c90 <calc_c2l_grid_info+0xb00>
lea    (%r11,%rdx,1),%rax
mov    0x10(%rsp),%rdx
lea    (%rdx,%r11,8),%rcx
lea    (%rdx,%rax,8),%rdx
mov    %rsi,%r10
mov    0x28(%rsp),%rbp
lea    0x0(%rbp,%r11,8),%rsi
lea    0x0(%rbp,%rax,8),%r13
movslq %ebx,%rax
lea    (%r10,%rax,8),%r14
mov    0x108(%rsp),%rbx
lea    (%rbx,%rax,8),%rbx
mov    0x100(%rsp),%rbp
lea    0x0(%rbp,%rax,8),%rbp
cmp    %r13,%rcx
setb   0xf(%rsp)
cmp    %rdx,%rsi
setb   0xd0(%rsp)
cmp    %rbx,%rcx
setb   %r10b
cmp    %rdx,%r14
setb   0xe(%rsp)
cmp    %rbp,%rcx
mov    0x58(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
setb   %cl
cmp    %rdx,%rax
setb   0xd(%rsp)
cmp    %rbx,%rsi
setb   %bl
cmp    %r13,%r14
setb   %dl
cmp    %rbp,%rsi
setb   %bpl
cmp    %r13,%rax
setb   %r13b
mov    0xf(%rsp),%al
test   %al,0xd0(%rsp)
jne    1d63 <calc_c2l_grid_info+0xbd3>
and    0xe(%rsp),%r10b
mov    0xc8(%rsp),%rsi
mov    0x38(%rsp),%r10
mov    (%rsp),%r14
jne    1d51 <calc_c2l_grid_info+0xbc1>
and    0xd(%rsp),%cl
jne    1d51 <calc_c2l_grid_info+0xbc1>
mov    %edx,%eax
and    %dl,%bl
mov    0x58(%rsp),%rcx
jne    1d44 <calc_c2l_grid_info+0xbb4>
mov    %r13d,%eax
mov    $0x0,%r13d
and    %al,%bpl
mov    0x20(%rsp),%rdx
jne    1c90 <calc_c2l_grid_info+0xb00>
cmpq   $0x0,0xe8(%rsp)
je     1d2f <calc_c2l_grid_info+0xb9f>
mov    0xd8(%rsp),%rdx
xor    %ebx,%ebx
xchg   %ax,%ax
lea    (%r12,%rbx,1),%eax
add    $0x3,%eax
cltq
movups (%rsi,%rax,8),%xmm0
movups 0x10(%rsi,%rax,8),%xmm1
movups %xmm0,-0x30(%r15,%rbx,8)
movups %xmm1,-0x20(%r15,%rbx,8)
movups (%rcx,%rax,8),%xmm0
movups 0x10(%rcx,%rax,8),%xmm1
movups %xmm0,-0x30(%rdi,%rbx,8)
movups %xmm1,-0x20(%rdi,%rbx,8)
lea    0x7(%r12,%rbx,1),%eax
cltq
movups (%rsi,%rax,8),%xmm0
movups 0x10(%rsi,%rax,8),%xmm1
movups %xmm0,-0x10(%r15,%rbx,8)
movups %xmm1,(%r15,%rbx,8)
movups (%rcx,%rax,8),%xmm0
movups 0x10(%rcx,%rax,8),%xmm1
movups %xmm0,-0x10(%rdi,%rbx,8)
movups %xmm1,(%rdi,%rbx,8)
add    $0x8,%rbx
add    $0xfffffffffffffffe,%rdx
jne    1bc0 <calc_c2l_grid_info+0xa30>
testb  $0x1,0xe0(%rsp)
01
je     1c6e <calc_c2l_grid_info+0xade>
mov    %ebx,%eax
or     $0x1,%eax
add    0x18(%rsp),%eax
cltq
movups (%rsi,%rax,8),%xmm0
movups 0x10(%rsi,%rax,8),%xmm1
add    %r11,%rbx
mov    0x10(%rsp),%rdx
movups %xmm0,(%rdx,%rbx,8)
movups %xmm1,0x10(%rdx,%rbx,8)
movups (%rcx,%rax,8),%xmm0
movups 0x10(%rcx,%rax,8),%xmm1
mov    0x28(%rsp),%rax
movups %xmm0,(%rax,%rbx,8)
movups %xmm1,0x10(%rax,%rbx,8)
mov    0xf0(%rsp),%rax
mov    %rax,%r13
mov    0x20(%rsp),%rdx
cmp    %rdx,%rax
je     1a30 <calc_c2l_grid_info+0x8a0>
jmp    1c90 <calc_c2l_grid_info+0xb00>
xor    %r13d,%r13d
mov    (%rsp),%r14
mov    %r13,%rbx
test   $0x1,%dl
je     1cd0 <calc_c2l_grid_info+0xb40>
mov    %r13,%rbx
or     $0x1,%rbx
mov    0x18(%rsp),%eax
add    %ebx,%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
add    %r13,%r11
mov    0x10(%rsp),%rbp
movsd  %xmm0,0x0(%rbp,%r11,8)
mov    0x38(%rsp),%r10
movsd  (%rcx,%rax,8),%xmm0
mov    0x28(%rsp),%rax
movsd  %xmm0,(%rax,%r11,8)
not    %r13
cmp    0x60(%rsp),%r13
je     1a30 <calc_c2l_grid_info+0x8a0>
xchg   %ax,%ax
lea    (%r12,%rbx,1),%eax
add    $0x3,%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,-0x8(%r8,%rbx,8)
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,-0x8(%r9,%rbx,8)
lea    0x4(%r12,%rbx,1),%eax
cltq
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%r8,%rbx,8)
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%r9,%rbx,8)
lea    0x2(%rbx),%rax
mov    %rax,%rbx
cmp    %rax,%rdx
jne    1ce0 <calc_c2l_grid_info+0xb50>
jmp    1a30 <calc_c2l_grid_info+0x8a0>
xor    %ebx,%ebx
testb  $0x1,0xe0(%rsp)
01
jne    1c32 <calc_c2l_grid_info+0xaa2>
jmp    1c6e <calc_c2l_grid_info+0xade>
xor    %r13d,%r13d
mov    0x20(%rsp),%rdx
jmp    1c90 <calc_c2l_grid_info+0xb00>
xor    %r13d,%r13d
mov    0x58(%rsp),%rcx
mov    0x20(%rsp),%rdx
jmp    1c90 <calc_c2l_grid_info+0xb00>
xor    %r13d,%r13d
mov    0x58(%rsp),%rcx
mov    0xc8(%rsp),%rsi
mov    0x20(%rsp),%rdx
mov    0x38(%rsp),%r10
jmp    1c8c <calc_c2l_grid_info+0xafc>
mov    0xf8(%rsp),%rdi
mov    %rsi,%r14
mov    0x10(%rsp),%r12
mov    %r12,%rsi
mov    %rdx,%rbx
mov    0x28(%rsp),%r13
mov    %r13,%rdx
mov    %rcx,%rbp
mov    0x1c8(%rsp),%rcx
mov    0x1d0(%rsp),%r8
call   1060 <unit_vect_latlon@plt>
mov    0x1d8(%rsp),%rax
mov    (%rax),%r10d
mov    0x1e0(%rsp),%rax
mov    (%rax),%r11d
mov    0x1e8(%rsp),%rax
mov    (%rax),%r15d
mov    0x1f0(%rsp),%rax
mov    (%rax),%eax
mov    %ebx,%edi
mov    0x40(%rsp),%rsi
mov    %r14,%rdx
mov    %rbp,%rcx
mov    0x80(%rsp),%r8
mov    0x88(%rsp),%r9
push   %rax
push   %r15
push   %r11
push   %r10
push   0x1d0(%rsp)
push   0x1d0(%rsp)
push   0x1d0(%rsp)
push   0x1d0(%rsp)
call   1080 <get_edge@plt>
add    $0x40,%rsp
mov    0x78(%rsp),%rdi
call   1030 <free@plt>
mov    0x70(%rsp),%rdi
call   1030 <free@plt>
mov    0x68(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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