#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 atan(int /*<<< orphan*/);
double cos(double);
int /*<<< orphan*/ exp(double);
double fabs(double);
int /*<<< orphan*/ fatal_error(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ get_nxny_(unsigned char **, unsigned int *, unsigned int *,
                             unsigned int *, int *, int *);
double int4(unsigned char *);
double log(int /*<<< orphan*/);
scalar_t__ malloc(size_t);
double radius_earth(unsigned char **);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tan(int);
double uint4(unsigned char *);
int mercator2ll(unsigned char **sec, double **lat, double **lon) {
  double dx, dy, lat1, lat2, lon1, lon2;
  double *llat, *llon;
  unsigned int i, j;
  double dlon, circum;
  double n, s, e, w, tmp, error;
  unsigned char *gds;
  unsigned int nnx, nny;
  int nres, nscan;
  unsigned int nnpnts;
  get_nxny_(sec, &nnx, &nny, &nnpnts, &nres, &nscan);
  gds = sec[3];
  dy = ((uint4(gds + 68)) * 0.001);
  dx = ((uint4(gds + 64)) * 0.001);
  lat1 = (int4(gds + 38) * 0.000001);
  lat2 = (int4(gds + 51) * 0.000001);
  lon1 = (uint4(gds + 42) * 0.000001);
  lon2 = (uint4(gds + 55) * 0.000001);
  if (lon1 < 0.0 || lon2 < 0.0 || lon1 > 360.0 || lon2 > 360.0)
    fatal_error("BAD grid definition lon", "");
  if (lat1 < -90.0 || lat2 < -90.0 || lat1 > 90.0 || lat2 > 90.0)
    fatal_error("BAD grid definition lat", "");
  if ((uint4(gds + 60) * 0.000001) != 0.0) {
    fprintf(stderr, "cannot handle non-zero mercator orientation angle %f\n",
            (uint4(gds + 60) * 0.000001));
    return 0;
  }
  if (nnx < 1 || nny < 1) {
    fprintf(stderr,
            "Sorry geo/mercator code does not handle variable nx/ny yet\n");
    return 0;
  }
  if ((*lat = (double *)malloc(((size_t)nnpnts) * sizeof(double))) == NULL) {
    fatal_error("mercator2ll memory allocation failed", "");
  }
  if ((*lon = (double *)malloc(((size_t)nnpnts) * sizeof(double))) == NULL) {
    fatal_error("mercator2ll memory allocation failed", "");
  }
  if (((nscan & 64) == 64)) {
    s = lat1;
    n = lat2;
  } else {
    s = lat2;
    n = lat1;
  }
  if (s > n)
    fatal_error("Mercator grid: lat1 and lat2, bad grid definition", "");
  if (((nscan & 16) == 16) && (nny % 2 == 0) && ((nres & 32) == 0)) {
    fatal_error("Mercator grid: grid definition ambiguity, bad grid definition",
                "");
  }
  if (((nscan & 16) == 16) && (nny % 2 == 0)) {
    fatal_error("Mercator: more code needed to decode grid definition", "");
  }
  if (((nscan & 128) == 0)) {
    w = lon1;
    e = lon2;
  } else {
    w = lon2;
    e = lon1;
  }
  if (e <= w)
    e += 360.0;
  llat = *lat;
  llon = *lon;
  dlon = (e - w) / (nnx - 1);
  circum = 2.0 * 3.14159265358979323846 * radius_earth(sec) *
           cos((int4(gds + 47) * 0.000001) * (3.14159265358979323846 / 180.0));
  dx = dx * 360.0 / circum;
  if (dx != 0.0) {
    error = fabs(dx - dlon) / fabs(dx);
    if (error >= 0.001) {
      fprintf(stderr,
              "\n*** Mercator grid error: inconsistent d-longitude, radius and "
              "grid domain\n"
              "*** d-longitude from grid domain %lf (used), d-longitude from "
              "dx %lf (not used)\n",
              dlon, dx);
    }
    dx = dlon;
  }
  s = log(tan((45 + s / 2) * 3.14159265358979323846 / 180));
  n = log(tan((45 + n / 2) * 3.14159265358979323846 / 180));
  dy = (n - s) / (nny - 1);
#pragma omp parallel for private(j, tmp, i)
  for (j = 0; j < nny; j++) {
    tmp = (atan(exp(s + j * dy)) * 180 / 3.14159265358979323846 - 45) * 2;
    for (i = 0; i < nnx; i++) {
      llat[i + j * nnx] = tmp;
    }
  }
  for (j = 0; j < nnx; j++) {
    llon[j] = w + j * dx >= 360.0 ? w + j * dx - 360.0 : w + j * dx;
  }
  for (j = nnx; j < nnpnts; j++) {
    llon[j] = llon[j - nnx];
  }
  return 0;
}


x86 assembly (clang, -O0):
<mercator2ll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xb4(%rbp),%rsi
lea    -0xb8(%rbp),%rdx
lea    -0xc4(%rbp),%rcx
lea    -0xbc(%rbp),%r8
lea    -0xc0(%rbp),%r9
call   1060 <get_nxny_@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x44,%rdi
call   1040 <uint4@plt>
movsd  0xdde(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x40,%rdi
call   1040 <uint4@plt>
movsd  0xdbd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x26,%rdi
call   1030 <int4@plt>
movsd  0xd94(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x33,%rdi
call   1030 <int4@plt>
movsd  0xd73(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x2a,%rdi
call   1040 <uint4@plt>
movsd  0xd52(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x37,%rdi
call   1040 <uint4@plt>
movsd  0xd31(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
ja     1322 <mercator2ll+0x162>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
ja     1322 <mercator2ll+0x162>
movsd  -0x48(%rbp),%xmm0
movsd  0xd0f(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1322 <mercator2ll+0x162>
movsd  -0x50(%rbp),%xmm0
movsd  0xcf8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1335 <mercator2ll+0x175>
lea    0xd47(%rip),%rdi
lea    0xf47(%rip),%rsi
call   1090 <fatal_error@plt>
movsd  0xcdb(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
ja     1389 <mercator2ll+0x1c9>
movsd  0xcc8(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
ja     1389 <mercator2ll+0x1c9>
movsd  -0x38(%rbp),%xmm0
movsd  0xcb8(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1389 <mercator2ll+0x1c9>
movsd  -0x40(%rbp),%xmm0
movsd  0xca1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    139c <mercator2ll+0x1dc>
lea    0xcf8(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1090 <fatal_error@plt>
mov    -0xb0(%rbp),%rdi
add    $0x3c,%rdi
call   1040 <uint4@plt>
movsd  0xc4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13d0 <mercator2ll+0x210>
jp     13d0 <mercator2ll+0x210>
jmp    141b <mercator2ll+0x25b>
mov    0x2c09(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc8(%rbp)
mov    -0xb0(%rbp),%rdi
add    $0x3c,%rdi
call   1040 <uint4@plt>
mov    -0xc8(%rbp),%edi
movsd  0xc03(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xc98(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a37 <mercator2ll+0x877>
cmpl   $0x1,-0xb4(%rbp)
jb     1435 <mercator2ll+0x275>
cmpl   $0x1,-0xb8(%rbp)
jae    1458 <mercator2ll+0x298>
mov    0x2ba4(%rip),%rax
mov    (%rax),%edi
lea    0xc91(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a37 <mercator2ll+0x877>
mov    -0xc4(%rbp),%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   10a0 <malloc@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    148d <mercator2ll+0x2cd>
lea    0xc91(%rip),%rdi
lea    0xdef(%rip),%rsi
call   1090 <fatal_error@plt>
mov    -0xc4(%rbp),%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   10a0 <malloc@plt>
mov    -0x20(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    14c2 <mercator2ll+0x302>
lea    0xc5c(%rip),%rdi
lea    0xdba(%rip),%rsi
call   1090 <fatal_error@plt>
mov    -0xc0(%rbp),%eax
and    $0x40,%eax
cmp    $0x40,%eax
jne    14f0 <mercator2ll+0x330>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    1507 <mercator2ll+0x347>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jbe    152d <mercator2ll+0x36d>
lea    0xc16(%rip),%rdi
lea    0xd4f(%rip),%rsi
call   1090 <fatal_error@plt>
mov    -0xc0(%rbp),%eax
and    $0x10,%eax
cmp    $0x10,%eax
jne    1576 <mercator2ll+0x3b6>
mov    -0xb8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1576 <mercator2ll+0x3b6>
mov    -0xbc(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1576 <mercator2ll+0x3b6>
lea    0xbff(%rip),%rdi
lea    0xd06(%rip),%rsi
call   1090 <fatal_error@plt>
mov    -0xc0(%rbp),%eax
and    $0x10,%eax
cmp    $0x10,%eax
jne    15ad <mercator2ll+0x3ed>
mov    -0xb8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    15ad <mercator2ll+0x3ed>
lea    0xc06(%rip),%rdi
lea    0xccf(%rip),%rsi
call   1090 <fatal_error@plt>
mov    -0xc0(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    15e0 <mercator2ll+0x420>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    15fa <mercator2ll+0x43a>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     162c <mercator2ll+0x46c>
movsd  0x9f4(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x60(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
mov    -0xb4(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <radius_earth@plt>
movaps %xmm0,%xmm1
movsd  0x9af(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0xb0(%rbp),%rdi
add    $0x2f,%rdi
call   1030 <int4@plt>
movsd  0x95b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x977(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   10d0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0x93a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1702 <mercator2ll+0x542>
jp     1702 <mercator2ll+0x542>
jmp    1778 <mercator2ll+0x5b8>
movsd  -0x28(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movaps 0x94d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movaps 0x93d(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0x8c5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     176e <mercator2ll+0x5ae>
mov    0x288c(%rip),%rax
mov    (%rax),%edi
movsd  -0x70(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xa75(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  0x8b0(%rip),%xmm1
movsd  %xmm1,-0xf0(%rbp)
ff
divsd  %xmm1,%xmm0
movsd  0x8a4(%rip),%xmm1
movsd  %xmm1,-0xe8(%rbp)
ff
addsd  %xmm1,%xmm0
movsd  0x898(%rip),%xmm1
movsd  %xmm1,-0xe0(%rbp)
ff
mulsd  %xmm1,%xmm0
movsd  0x88c(%rip),%xmm1
movsd  %xmm1,-0xd8(%rbp)
ff
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10c0 <tan@plt>
mov    %eax,%edi
call   10e0 <log@plt>
movsd  -0xf0(%rbp),%xmm4
ff
movsd  -0xe8(%rbp),%xmm3
ff
movsd  -0xe0(%rbp),%xmm2
ff
movsd  -0xd8(%rbp),%xmm1
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
divsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10c0 <tan@plt>
mov    %eax,%edi
call   10e0 <log@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
mov    -0xb8(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jae    1928 <mercator2ll+0x768>
movsd  -0x88(%rbp),%xmm1
ff
mov    -0x68(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10b0 <exp@plt>
mov    %eax,%edi
call   1080 <atan@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0x79d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0x789(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0x775(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0xb4(%rbp),%eax
jae    1915 <mercator2ll+0x755>
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x58(%rbp),%rax
mov    -0x64(%rbp),%ecx
mov    -0x68(%rbp),%edx
imul   -0xb4(%rbp),%edx
add    %edx,%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    18d6 <mercator2ll+0x716>
jmp    191a <mercator2ll+0x75a>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    1861 <mercator2ll+0x6a1>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0xb4(%rbp),%eax
jae    19ea <mercator2ll+0x82a>
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x68(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x6ad(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     19a3 <mercator2ll+0x7e3>
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x68(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x67e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
jmp    19c8 <mercator2ll+0x808>
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x68(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
mov    -0x60(%rbp),%rax
mov    -0x68(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    192f <mercator2ll+0x76f>
mov    -0xb4(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0xc4(%rbp),%eax
jae    1a30 <mercator2ll+0x870>
mov    -0x60(%rbp),%rax
mov    -0x68(%rbp),%ecx
sub    -0xb4(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x68(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    19f3 <mercator2ll+0x833>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mercator2ll>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0x14(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x54(%rsp),%r8
lea    0x10(%rsp),%r9
call   1060 <get_nxny_@plt>
mov    0x18(%r12),%r13
lea    0x44(%r13),%rdi
call   1040 <uint4@plt>
lea    0x40(%r13),%rdi
call   1040 <uint4@plt>
movsd  %xmm0,0x30(%rsp)
lea    0x26(%r13),%rdi
call   1030 <int4@plt>
mulsd  0xde5(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0x33(%r13),%rdi
call   1030 <int4@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x2a(%r13),%rdi
call   1040 <uint4@plt>
mulsd  0xdbf(%rip),%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0x37(%r13),%rdi
call   1040 <uint4@plt>
mulsd  0xda8(%rip),%xmm0
movsd  0x28(%rsp),%xmm1
ucomisd 0xda2(%rip),%xmm1
movapd %xmm0,0x40(%rsp)
ja     1292 <mercator2ll+0xd2>
xorpd  %xmm1,%xmm1
ucomisd 0x28(%rsp),%xmm1
ja     1292 <mercator2ll+0xd2>
ucomisd %xmm0,%xmm1
ja     1292 <mercator2ll+0xd2>
ucomisd 0xd80(%rip),%xmm0
jbe    12a5 <mercator2ll+0xe5>
lea    0xe47(%rip),%rdi
lea    0x1047(%rip),%rsi
call   1090 <fatal_error@plt>
movsd  0x8(%rsp),%xmm2
mulsd  0xd55(%rip),%xmm2
movsd  0x18(%rsp),%xmm1
ucomisd 0xd57(%rip),%xmm1
movsd  %xmm2,0x8(%rsp)
ja     12e7 <mercator2ll+0x127>
movsd  0xd4f(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     12e7 <mercator2ll+0x127>
ucomisd %xmm2,%xmm0
ja     12e7 <mercator2ll+0x127>
ucomisd 0xd33(%rip),%xmm2
jbe    12fa <mercator2ll+0x13a>
lea    0xe0a(%rip),%rdi
lea    0xff2(%rip),%rsi
call   1090 <fatal_error@plt>
lea    0x3c(%r13),%rbx
mov    %rbx,%rdi
call   1040 <uint4@plt>
mulsd  0xcfa(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    131a <mercator2ll+0x15a>
jnp    1348 <mercator2ll+0x188>
mov    0x2cbf(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1040 <uint4@plt>
mulsd  0xcd5(%rip),%xmm0
lea    0xdd6(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%al
call   1070 <fprintf@plt>
jmp    1bf4 <mercator2ll+0xa34>
cmpl   $0x0,0x14(%rsp)
je     13c1 <mercator2ll+0x201>
cmpl   $0x0,0x4(%rsp)
je     13c1 <mercator2ll+0x201>
mov    0x24(%rsp),%edi
shl    $0x3,%rdi
call   10a0 <malloc@plt>
mov    %rax,(%r15)
test   %rax,%rax
jne    137e <mercator2ll+0x1be>
lea    0xe10(%rip),%rdi
lea    0xf6e(%rip),%rsi
call   1090 <fatal_error@plt>
mov    0x24(%rsp),%edi
shl    $0x3,%rdi
call   10a0 <malloc@plt>
mov    %rax,(%r14)
test   %rax,%rax
jne    13a6 <mercator2ll+0x1e6>
lea    0xde8(%rip),%rdi
lea    0xf46(%rip),%rsi
call   1090 <fatal_error@plt>
mov    0x10(%rsp),%eax
test   $0x40,%al
je     13dd <mercator2ll+0x21d>
movsd  0x8(%rsp),%xmm3
movaps 0x40(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
jmp    13ee <mercator2ll+0x22e>
mov    0x2c18(%rip),%rax
mov    (%rax),%edi
lea    0xd75(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1bf4 <mercator2ll+0xa34>
movsd  0x18(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
movaps 0x40(%rsp),%xmm0
movsd  0x30(%rsp),%xmm2
movsd  %xmm3,0x58(%rsp)
movsd  %xmm1,0x18(%rsp)
ucomisd %xmm3,%xmm1
jbe    1428 <mercator2ll+0x268>
lea    0xd9a(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1090 <fatal_error@plt>
movsd  0x30(%rsp),%xmm2
movaps 0x40(%rsp),%xmm0
mov    0x10(%rsp),%eax
test   $0x10,%al
je     1489 <mercator2ll+0x2c9>
testb  $0x1,0x4(%rsp)
jne    1460 <mercator2ll+0x2a0>
testb  $0x20,0x54(%rsp)
jne    1460 <mercator2ll+0x2a0>
lea    0xd98(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1090 <fatal_error@plt>
movsd  0x30(%rsp),%xmm2
movaps 0x40(%rsp),%xmm0
mov    0x10(%rsp),%eax
test   $0x10,%al
je     1489 <mercator2ll+0x2c9>
testb  $0x1,0x4(%rsp)
jne    1489 <mercator2ll+0x2c9>
lea    0xda9(%rip),%rdi
lea    0xe72(%rip),%rsi
call   1090 <fatal_error@plt>
movsd  0x30(%rsp),%xmm2
movaps 0x40(%rsp),%xmm0
mov    0x10(%rsp),%eax
mulsd  0xb6f(%rip),%xmm2
test   $0x80,%eax
movsd  %xmm2,0x30(%rsp)
je     14ac <mercator2ll+0x2ec>
movsd  0x28(%rsp),%xmm0
movapd %xmm0,0x60(%rsp)
jmp    14bd <mercator2ll+0x2fd>
movaps %xmm0,0x60(%rsp)
movsd  0x28(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
mov    (%r15),%rbp
mov    (%r14),%r14
mov    0x14(%rsp),%ebx
mov    %r12,%rdi
call   1050 <radius_earth@plt>
mulsd  0xb51(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x2f,%r13
mov    %r13,%rdi
call   1030 <int4@plt>
mulsd  0xb17(%rip),%xmm0
mulsd  0xb37(%rip),%xmm0
call   10d0 <cos@plt>
movsd  0xb0a(%rip),%xmm3
mulsd  0x8(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  %xmm3,%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1526 <mercator2ll+0x366>
jnp    159f <mercator2ll+0x3df>
movapd 0x60(%rsp),%xmm4
movapd %xmm4,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm4,%xmm0
movapd 0x40(%rsp),%xmm3
cmpnlesd %xmm3,%xmm0
andpd  %xmm0,%xmm4
andnpd %xmm2,%xmm0
orpd   %xmm4,%xmm0
subsd  %xmm3,%xmm0
add    $0xffffffff,%ebx
xorps  %xmm2,%xmm2
cvtsi2sd %rbx,%xmm2
divsd  %xmm2,%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
andpd  0xafa(%rip),%xmm2
ucomisd 0xa82(%rip),%xmm2
movapd %xmm0,0x30(%rsp)
jb     15a9 <mercator2ll+0x3e9>
mov    0x2a53(%rip),%rax
mov    (%rax),%edi
lea    0xcb6(%rip),%rsi
mov    $0x2,%al
call   1070 <fprintf@plt>
jmp    15a9 <mercator2ll+0x3e9>
movapd %xmm1,%xmm0
movapd %xmm1,0x30(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xa81(%rip),%xmm0
addsd  0xa81(%rip),%xmm0
mulsd  0xa81(%rip),%xmm0
divsd  0xa81(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10c0 <tan@plt>
mov    %eax,%edi
call   10e0 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x58(%rsp),%xmm0
mulsd  0xa45(%rip),%xmm0
addsd  0xa45(%rip),%xmm0
mulsd  0xa45(%rip),%xmm0
divsd  0xa45(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10c0 <tan@plt>
mov    %eax,%edi
call   10e0 <log@plt>
mov    0x4(%rsp),%eax
sub    $0x1,%eax
jae    165d <mercator2ll+0x49d>
mov    0x14(%rsp),%r8d
mov    %r8d,%ecx
test   %r8d,%r8d
movapd 0x40(%rsp),%xmm12
movsd  0x9d1(%rip),%xmm13
movapd 0x30(%rsp),%xmm14
je     1a11 <mercator2ll+0x851>
cmp    $0x1,%r8d
jne    1865 <mercator2ll+0x6a5>
xor    %edx,%edx
jmp    19c3 <mercator2ll+0x803>
movapd %xmm0,%xmm2
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  %xmm0,%xmm2
xor    %r12d,%r12d
movabs $0x7ffffffffffffffc,%r15
ff ff 7f
movsd  %xmm2,0x28(%rsp)
jmp    16a7 <mercator2ll+0x4e7>
nopl   0x0(%rax)
add    $0x1,%r12d
cmp    0x4(%rsp),%r12d
movsd  0x8(%rsp),%xmm1
movsd  0x28(%rsp),%xmm2
jae    1629 <mercator2ll+0x469>
mov    %r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10b0 <exp@plt>
mov    %eax,%edi
call   1080 <atan@plt>
imul   $0xb4,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x96d(%rip),%xmm0
addsd  0x975(%rip),%xmm0
mov    0x14(%rsp),%r8d
test   %r8,%r8
je     1690 <mercator2ll+0x4d0>
addsd  %xmm0,%xmm0
cmp    $0x4,%r8d
jb     1750 <mercator2ll+0x590>
mov    %r8d,%esi
imul   %r12d,%esi
lea    -0x1(%r8),%rax
mov    %eax,%ecx
add    %esi,%ecx
jb     1750 <mercator2ll+0x590>
shr    $0x20,%rax
mov    $0x0,%ecx
jne    1752 <mercator2ll+0x592>
mov    %r8d,%ecx
and    $0xfffffffc,%ecx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rcx),%rdi
mov    %rdi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%eax
and    $0x3,%eax
cmp    $0xc,%rdi
jae    17d5 <mercator2ll+0x615>
xor    %edi,%edi
jmp    1828 <mercator2ll+0x668>
cs nopw 0x0(%rax,%rax,1)
xor    %ecx,%ecx
mov    %rcx,%rax
not    %rax
add    %r8,%rax
mov    %r8,%rdx
and    $0x3,%rdx
je     1783 <mercator2ll+0x5c3>
mov    %r8d,%esi
imul   %r12d,%esi
nopl   0x0(%rax,%rax,1)
lea    (%rsi,%rcx,1),%edi
movsd  %xmm0,0x0(%rbp,%rdi,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rdx
jne    1770 <mercator2ll+0x5b0>
cmp    $0x3,%rax
jb     1690 <mercator2ll+0x4d0>
mov    %r8d,%eax
imul   %r12d,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rcx,1),%rdx
mov    %edx,%esi
movsd  %xmm0,0x0(%rbp,%rsi,8)
lea    0x1(%rdx),%esi
movsd  %xmm0,0x0(%rbp,%rsi,8)
lea    0x2(%rdx),%esi
movsd  %xmm0,0x0(%rbp,%rsi,8)
add    $0x3,%edx
movsd  %xmm0,0x0(%rbp,%rdx,8)
add    $0x4,%rcx
cmp    %rcx,%r8
jne    17a0 <mercator2ll+0x5e0>
jmp    1690 <mercator2ll+0x4d0>
and    %r15,%rdx
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
mov    %esi,%ebx
movupd %xmm1,0x0(%rbp,%rbx,8)
movupd %xmm1,0x10(%rbp,%rbx,8)
lea    0x4(%rsi),%ebx
movupd %xmm1,0x0(%rbp,%rbx,8)
movupd %xmm1,0x10(%rbp,%rbx,8)
lea    0x8(%rsi),%ebx
movupd %xmm1,0x0(%rbp,%rbx,8)
movupd %xmm1,0x10(%rbp,%rbx,8)
lea    0xc(%rsi),%ebx
movupd %xmm1,0x0(%rbp,%rbx,8)
movupd %xmm1,0x10(%rbp,%rbx,8)
add    $0x10,%rdi
add    $0x10,%esi
add    $0xfffffffffffffffc,%rdx
jne    17e0 <mercator2ll+0x620>
test   %rax,%rax
je     1857 <mercator2ll+0x697>
mov    %r8d,%edx
imul   %r12d,%edx
add    %edx,%edi
cs nopw 0x0(%rax,%rax,1)
mov    %edi,%edx
movupd %xmm1,0x0(%rbp,%rdx,8)
movupd %xmm1,0x10(%rbp,%rdx,8)
add    $0x4,%edi
add    $0xffffffffffffffff,%rax
jne    1840 <mercator2ll+0x680>
cmp    %r8,%rcx
je     1690 <mercator2ll+0x4d0>
jmp    1752 <mercator2ll+0x592>
mov    %ecx,%edx
and    $0xfffffffe,%edx
movapd %xmm14,%xmm0
unpcklpd %xmm14,%xmm0
movapd %xmm12,%xmm1
unpcklpd %xmm12,%xmm1
lea    -0x2(%rdx),%rax
mov    %rax,%rbp
shr    %rbp
add    $0x1,%rbp
xorpd  %xmm7,%xmm7
test   %rax,%rax
je     1a76 <mercator2ll+0x8b6>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
movapd 0x7d8(%rip),%xmm2
xor    %esi,%esi
movapd 0x7de(%rip),%xmm4
movapd 0x7e5(%rip),%xmm10
movapd 0x7ec(%rip),%xmm11
movdqa 0x7f3(%rip),%xmm8
movdqa 0x7fa(%rip),%xmm9
cs nopw 0x0(%rax,%rax,1)
movapd %xmm2,%xmm3
unpcklps %xmm7,%xmm3
orpd   %xmm4,%xmm3
subpd  %xmm4,%xmm3
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
movapd %xmm10,%xmm5
cmpnlepd %xmm3,%xmm5
movapd %xmm3,%xmm6
addpd  %xmm11,%xmm6
andpd  %xmm5,%xmm3
andnpd %xmm6,%xmm5
orpd   %xmm3,%xmm5
movupd %xmm5,(%r14,%rsi,8)
movapd %xmm2,%xmm3
paddd  %xmm8,%xmm3
punpckldq %xmm7,%xmm3
por    %xmm4,%xmm3
subpd  %xmm4,%xmm3
mulpd  %xmm0,%xmm3
addpd  %xmm1,%xmm3
movapd %xmm10,%xmm5
cmpnlepd %xmm3,%xmm5
movapd %xmm3,%xmm6
addpd  %xmm11,%xmm6
andpd  %xmm5,%xmm3
andnpd %xmm6,%xmm5
orpd   %xmm3,%xmm5
movupd %xmm5,0x10(%r14,%rsi,8)
add    $0x4,%rsi
paddd  %xmm9,%xmm2
add    $0xfffffffffffffffe,%rdi
jne    18e0 <mercator2ll+0x720>
xorpd  %xmm3,%xmm3
unpcklps %xmm3,%xmm2
orpd   %xmm4,%xmm2
subpd  %xmm4,%xmm2
movapd %xmm2,%xmm7
test   $0x1,%bpl
je     19be <mercator2ll+0x7fe>
mulpd  %xmm0,%xmm7
addpd  %xmm1,%xmm7
movapd 0x705(%rip),%xmm0
cmpnlepd %xmm7,%xmm0
movapd 0x708(%rip),%xmm1
addpd  %xmm7,%xmm1
andpd  %xmm0,%xmm7
andnpd %xmm1,%xmm0
orpd   %xmm7,%xmm0
movupd %xmm0,(%r14,%rsi,8)
cmp    %rcx,%rdx
je     1a11 <mercator2ll+0x851>
movsd  0x69d(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
mov    %edx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mulsd  %xmm14,%xmm1
addsd  %xmm12,%xmm1
movapd %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm13,%xmm3
cmpnlesd %xmm1,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm3
orpd   %xmm1,%xmm3
movlpd %xmm3,(%r14,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    19d0 <mercator2ll+0x810>
mov    0x24(%rsp),%edx
cmp    %edx,%r8d
jae    1bf4 <mercator2ll+0xa34>
mov    %rdx,%r8
sub    %rcx,%r8
mov    %rcx,%r9
cmp    $0x4,%r8
jb     1b4b <mercator2ll+0x98b>
lea    (%r14,%rcx,8),%rax
lea    (%r14,%r8,8),%rsi
cmp    %rsi,%rax
jae    1a4e <mercator2ll+0x88e>
lea    (%r14,%rdx,8),%rax
mov    %rcx,%r9
cmp    %rax,%r14
jb     1b4b <mercator2ll+0x98b>
mov    %r8,%r9
and    $0xfffffffffffffffc,%r9
lea    -0x4(%r9),%rax
mov    %rax,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%ebp
and    $0x3,%ebp
cmp    $0xc,%rax
jae    1a8f <mercator2ll+0x8cf>
xor    %ebx,%ebx
jmp    1b04 <mercator2ll+0x944>
movhpd 0x5e2(%rip),%xmm7
xor    %esi,%esi
test   $0x1,%bpl
jne    198b <mercator2ll+0x7cb>
jmp    19be <mercator2ll+0x7fe>
and    $0xfffffffffffffffc,%rdi
lea    (%r14,%rcx,8),%rsi
add    $0x70,%rsi
xor    %ebx,%ebx
nopl   (%rax)
movups (%r14,%rbx,8),%xmm0
movups 0x10(%r14,%rbx,8),%xmm1
movups %xmm0,-0x70(%rsi,%rbx,8)
movups %xmm1,-0x60(%rsi,%rbx,8)
movups 0x20(%r14,%rbx,8),%xmm0
movups 0x30(%r14,%rbx,8),%xmm1
movups %xmm0,-0x50(%rsi,%rbx,8)
movups %xmm1,-0x40(%rsi,%rbx,8)
movups 0x40(%r14,%rbx,8),%xmm0
movups 0x50(%r14,%rbx,8),%xmm1
movups %xmm0,-0x30(%rsi,%rbx,8)
movups %xmm1,-0x20(%rsi,%rbx,8)
movupd 0x60(%r14,%rbx,8),%xmm0
movupd 0x70(%r14,%rbx,8),%xmm1
movupd %xmm0,-0x10(%rsi,%rbx,8)
movupd %xmm1,(%rsi,%rbx,8)
add    $0x10,%rbx
add    $0xfffffffffffffffc,%rdi
jne    1aa0 <mercator2ll+0x8e0>
test   %rbp,%rbp
je     1b3f <mercator2ll+0x97f>
lea    (%r14,%rbx,8),%rax
add    $0x10,%rax
lea    (%rax,%rcx,8),%rsi
shl    $0x5,%rbp
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movupd -0x10(%rax,%rdi,1),%xmm0
movupd (%rax,%rdi,1),%xmm1
movupd %xmm0,-0x10(%rsi,%rdi,1)
movupd %xmm1,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rbp
jne    1b20 <mercator2ll+0x960>
cmp    %r9,%r8
je     1bf4 <mercator2ll+0xa34>
add    %rcx,%r9
mov    %edx,%edi
sub    %r9d,%edi
mov    %r9,%rsi
not    %rsi
add    %rdx,%rsi
and    $0x3,%rdi
je     1b9b <mercator2ll+0x9db>
lea    (%r14,%r9,8),%rbp
lea    0x0(,%rcx,8),%rbx
neg    %rbx
neg    %rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  0x0(%rbp,%rbx,1),%xmm0
movsd  %xmm0,0x0(%rbp)
add    $0xffffffffffffffff,%rax
add    $0x8,%rbp
cmp    %rax,%rdi
jne    1b80 <mercator2ll+0x9c0>
sub    %rax,%r9
cmp    $0x3,%rsi
jb     1bf4 <mercator2ll+0xa34>
sub    %r9,%rdx
lea    (%r14,%r9,8),%rax
add    $0x18,%rax
shl    $0x3,%rcx
neg    %rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  -0x18(%rax,%rcx,1),%xmm0
movsd  %xmm0,-0x18(%rax)
movsd  -0x10(%rax,%rcx,1),%xmm0
movsd  %xmm0,-0x10(%rax)
movsd  -0x8(%rax,%rcx,1),%xmm0
movsd  %xmm0,-0x8(%rax)
movsd  (%rax,%rcx,1),%xmm0
movsd  %xmm0,(%rax)
add    $0x20,%rax
add    $0xfffffffffffffffc,%rdx
jne    1bc0 <mercator2ll+0xa00>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"BAD grid definition lon\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [24 x i8] c"BAD grid definition lat\00"
@stderr = global i32 0
@.str.3 = [54 x i8] c"cannot handle non-zero mercator orientation angle %f\0A\00"
@.str.4 = [60 x i8] c"Sorry geo/mercator code does not handle variable nx/ny yet\0A\00"
@.str.5 = [37 x i8] c"mercator2ll memory allocation failed\00"
@.str.6 = [50 x i8] c"Mercator grid: lat1 and lat2, bad grid definition\00"
@.str.7 = [62 x i8] c"Mercator grid: grid definition ambiguity, bad grid definition\00"
@.str.8 = [53 x i8] c"Mercator: more code needed to decode grid definition\00"
@.str.9 = [156 x i8] c"\0A*** Mercator grid error: inconsistent d-longitude, radius and grid domain\0A*** d-longitude from grid domain %lf (used), d-longitude from dx %lf (not used)\0A\00"
define i32 @mercator2ll(i8** %0, double** %1, double** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double**
%7 = alloca double**
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca i8*
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
store i8** %0, i8*** %5
store double** %1, double*** %6
store double** %2, double*** %7
%32 = load i8**, i8*** %5
%33 = call i32 @get_nxny_(i8** %32, i32* %27, i32* %28, i32* %31, i32* %29, i32* %30)
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 3
%36 = load i8*, i8** %35
store i8* %36, i8** %26
%37 = load i8*, i8** %26
%38 = getelementptr inbounds i8, i8* %37, i64 68
%39 = call double @uint4(i8* %38)
%40 = fmul double %39, 1.000000e-03
store double %40, double* %9
%41 = load i8*, i8** %26
%42 = getelementptr inbounds i8, i8* %41, i64 64
%43 = call double @uint4(i8* %42)
%44 = fmul double %43, 1.000000e-03
store double %44, double* %8
%45 = load i8*, i8** %26
%46 = getelementptr inbounds i8, i8* %45, i64 38
%47 = call double @int4(i8* %46)
%48 = fmul double %47, 0x3EB0C6F7A0B5ED8D
store double %48, double* %10
%49 = load i8*, i8** %26
%50 = getelementptr inbounds i8, i8* %49, i64 51
%51 = call double @int4(i8* %50)
%52 = fmul double %51, 0x3EB0C6F7A0B5ED8D
store double %52, double* %11
%53 = load i8*, i8** %26
%54 = getelementptr inbounds i8, i8* %53, i64 42
%55 = call double @uint4(i8* %54)
%56 = fmul double %55, 0x3EB0C6F7A0B5ED8D
store double %56, double* %12
%57 = load i8*, i8** %26
%58 = getelementptr inbounds i8, i8* %57, i64 55
%59 = call double @uint4(i8* %58)
%60 = fmul double %59, 0x3EB0C6F7A0B5ED8D
store double %60, double* %13
%61 = load double, double* %12
%62 = fcmp olt double %61, 0.000000e+00
br i1 %62, label %72, label %63
63: ; preds = %3
%64 = load double, double* %13
%65 = fcmp olt double %64, 0.000000e+00
br i1 %65, label %72, label %66
66: ; preds = %63
%67 = load double, double* %12
%68 = fcmp ogt double %67, 3.600000e+02
br i1 %68, label %72, label %69
69: ; preds = %66
%70 = load double, double* %13
%71 = fcmp ogt double %70, 3.600000e+02
br i1 %71, label %72, label %74
72: ; preds = %69, %66, %63, %3
%73 = call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %74
74: ; preds = %72, %69
%75 = load double, double* %10
%76 = fcmp olt double %75, -9.000000e+01
br i1 %76, label %86, label %77
77: ; preds = %74
%78 = load double, double* %11
%79 = fcmp olt double %78, -9.000000e+01
br i1 %79, label %86, label %80
80: ; preds = %77
%81 = load double, double* %10
%82 = fcmp ogt double %81, 9.000000e+01
br i1 %82, label %86, label %83
83: ; preds = %80
%84 = load double, double* %11
%85 = fcmp ogt double %84, 9.000000e+01
br i1 %85, label %86, label %88
86: ; preds = %83, %80, %77, %74
%87 = call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %88
88: ; preds = %86, %83
%89 = load i8*, i8** %26
%90 = getelementptr inbounds i8, i8* %89, i64 60
%91 = call double @uint4(i8* %90)
%92 = fmul double %91, 0x3EB0C6F7A0B5ED8D
%93 = fcmp une double %92, 0.000000e+00
br i1 %93, label %94, label %101
94: ; preds = %88
%95 = load i32, i32* @stderr
%96 = load i8*, i8** %26
%97 = getelementptr inbounds i8, i8* %96, i64 60
%98 = call double @uint4(i8* %97)
%99 = fmul double %98, 0x3EB0C6F7A0B5ED8D
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), double %99)
store i32 0, i32* %4
br label %350
101: ; preds = %88
%102 = load i32, i32* %27
%103 = icmp ult i32 %102, 1
br i1 %103, label %107, label %104
104: ; preds = %101
%105 = load i32, i32* %28
%106 = icmp ult i32 %105, 1
br i1 %106, label %107, label %110
107: ; preds = %104, %101
%108 = load i32, i32* @stderr
%109 = call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %350
110: ; preds = %104
%111 = load i32, i32* %31
%112 = zext i32 %111 to i64
%113 = mul i64 %112, 8
%114 = call i64 @malloc(i64 %113)
%115 = inttoptr i64 %114 to double*
%116 = load double**, double*** %6
store double* %115, double** %116
%117 = icmp eq double* %115, null
br i1 %117, label %118, label %120
118: ; preds = %110
%119 = call i32 @fatal_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %120
120: ; preds = %118, %110
%121 = load i32, i32* %31
%122 = zext i32 %121 to i64
%123 = mul i64 %122, 8
%124 = call i64 @malloc(i64 %123)
%125 = inttoptr i64 %124 to double*
%126 = load double**, double*** %7
store double* %125, double** %126
%127 = icmp eq double* %125, null
br i1 %127, label %128, label %130
128: ; preds = %120
%129 = call i32 @fatal_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %130
130: ; preds = %128, %120
%131 = load i32, i32* %30
%132 = and i32 %131, 64
%133 = icmp eq i32 %132, 64
br i1 %133, label %134, label %137
134: ; preds = %130
%135 = load double, double* %10
store double %135, double* %21
%136 = load double, double* %11
store double %136, double* %20
br label %140
137: ; preds = %130
%138 = load double, double* %11
store double %138, double* %21
%139 = load double, double* %10
store double %139, double* %20
br label %140
140: ; preds = %137, %134
%141 = load double, double* %21
%142 = load double, double* %20
%143 = fcmp ogt double %141, %142
br i1 %143, label %144, label %146
144: ; preds = %140
%145 = call i32 @fatal_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %146
146: ; preds = %144, %140
%147 = load i32, i32* %30
%148 = and i32 %147, 16
%149 = icmp eq i32 %148, 16
br i1 %149, label %150, label %160
150: ; preds = %146
%151 = load i32, i32* %28
%152 = urem i32 %151, 2
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %160
154: ; preds = %150
%155 = load i32, i32* %29
%156 = and i32 %155, 32
%157 = icmp eq i32 %156, 0
br i1 %157, label %158, label %160
158: ; preds = %154
%159 = call i32 @fatal_error(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %160
160: ; preds = %158, %154, %150, %146
%161 = load i32, i32* %30
%162 = and i32 %161, 16
%163 = icmp eq i32 %162, 16
br i1 %163, label %164, label %170
164: ; preds = %160
%165 = load i32, i32* %28
%166 = urem i32 %165, 2
%167 = icmp eq i32 %166, 0
br i1 %167, label %168, label %170
168: ; preds = %164
%169 = call i32 @fatal_error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %170
170: ; preds = %168, %164, %160
%171 = load i32, i32* %30
%172 = and i32 %171, 128
%173 = icmp eq i32 %172, 0
br i1 %173, label %174, label %177
174: ; preds = %170
%175 = load double, double* %12
store double %175, double* %23
%176 = load double, double* %13
store double %176, double* %22
br label %180
177: ; preds = %170
%178 = load double, double* %13
store double %178, double* %23
%179 = load double, double* %12
store double %179, double* %22
br label %180
180: ; preds = %177, %174
%181 = load double, double* %22
%182 = load double, double* %23
%183 = fcmp ole double %181, %182
br i1 %183, label %184, label %187
184: ; preds = %180
%185 = load double, double* %22
%186 = fadd double %185, 3.600000e+02
store double %186, double* %22
br label %187
187: ; preds = %184, %180
%188 = load double**, double*** %6
%189 = load double*, double** %188
store double* %189, double** %14
%190 = load double**, double*** %7
%191 = load double*, double** %190
store double* %191, double** %15
%192 = load double, double* %22
%193 = load double, double* %23
%194 = fsub double %192, %193
%195 = load i32, i32* %27
%196 = sub i32 %195, 1
%197 = uitofp i32 %196 to double
%198 = fdiv double %194, %197
store double %198, double* %18
%199 = load i8**, i8*** %5
%200 = call double @radius_earth(i8** %199)
%201 = fmul double 0x401921FB54442D18, %200
%202 = load i8*, i8** %26
%203 = getelementptr inbounds i8, i8* %202, i64 47
%204 = call double @int4(i8* %203)
%205 = fmul double %204, 0x3EB0C6F7A0B5ED8D
%206 = fmul double %205, 0x3F91DF46A2529D39
%207 = call double @cos(double %206)
%208 = fmul double %201, %207
store double %208, double* %19
%209 = load double, double* %8
%210 = fmul double %209, 3.600000e+02
%211 = load double, double* %19
%212 = fdiv double %210, %211
store double %212, double* %8
%213 = load double, double* %8
%214 = fcmp une double %213, 0.000000e+00
br i1 %214, label %215, label %232
215: ; preds = %187
%216 = load double, double* %8
%217 = load double, double* %18
%218 = fsub double %216, %217
%219 = call double @llvm.fabs.f64(double %218)
%220 = load double, double* %8
%221 = call double @llvm.fabs.f64(double %220)
%222 = fdiv double %219, %221
store double %222, double* %25
%223 = load double, double* %25
%224 = fcmp oge double %223, 1.000000e-03
br i1 %224, label %225, label %230
225: ; preds = %215
%226 = load i32, i32* @stderr
%227 = load double, double* %18
%228 = load double, double* %8
%229 = call i32 (i32, i8*, ...) @fprintf(i32 %226, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.9, i64 0, i64 0), double %227, double %228)
br label %230
230: ; preds = %225, %215
%231 = load double, double* %18
store double %231, double* %8
br label %232
232: ; preds = %230, %187
%233 = load double, double* %21
%234 = fdiv double %233, 2.000000e+00
%235 = fadd double 4.500000e+01, %234
%236 = fmul double %235, 0x400921FB54442D18
%237 = fdiv double %236, 1.800000e+02
%238 = fptosi double %237 to i32
%239 = call i32 @tan(i32 %238)
%240 = call double @log(i32 %239)
store double %240, double* %21
%241 = load double, double* %20
%242 = fdiv double %241, 2.000000e+00
%243 = fadd double 4.500000e+01, %242
%244 = fmul double %243, 0x400921FB54442D18
%245 = fdiv double %244, 1.800000e+02
%246 = fptosi double %245 to i32
%247 = call i32 @tan(i32 %246)
%248 = call double @log(i32 %247)
store double %248, double* %20
%249 = load double, double* %20
%250 = load double, double* %21
%251 = fsub double %249, %250
%252 = load i32, i32* %28
%253 = sub i32 %252, 1
%254 = uitofp i32 %253 to double
%255 = fdiv double %251, %254
store double %255, double* %9
store i32 0, i32* %17
br label %256
256: ; preds = %291, %232
%257 = load i32, i32* %17
%258 = load i32, i32* %28
%259 = icmp ult i32 %257, %258
br i1 %259, label %260, label %294
260: ; preds = %256
%261 = load double, double* %21
%262 = load i32, i32* %17
%263 = uitofp i32 %262 to double
%264 = load double, double* %9
%265 = call double @llvm.fmuladd.f64(double %263, double %264, double %261)
%266 = call i32 @exp(double %265)
%267 = call i32 @atan(i32 %266)
%268 = mul nsw i32 %267, 180
%269 = sitofp i32 %268 to double
%270 = fdiv double %269, 0x400921FB54442D18
%271 = fsub double %270, 4.500000e+01
%272 = fmul double %271, 2.000000e+00
store double %272, double* %24
store i32 0, i32* %16
br label %273
273: ; preds = %287, %260
%274 = load i32, i32* %16
%275 = load i32, i32* %27
%276 = icmp ult i32 %274, %275
br i1 %276, label %277, label %290
277: ; preds = %273
%278 = load double, double* %24
%279 = load double*, double** %14
%280 = load i32, i32* %16
%281 = load i32, i32* %17
%282 = load i32, i32* %27
%283 = mul i32 %281, %282
%284 = add i32 %280, %283
%285 = zext i32 %284 to i64
%286 = getelementptr inbounds double, double* %279, i64 %285
store double %278, double* %286
br label %287
287: ; preds = %277
%288 = load i32, i32* %16
%289 = add i32 %288, 1
store i32 %289, i32* %16
br label %273
290: ; preds = %273
br label %291
291: ; preds = %290
%292 = load i32, i32* %17
%293 = add i32 %292, 1
store i32 %293, i32* %17
br label %256
294: ; preds = %256
store i32 0, i32* %17
br label %295
295: ; preds = %325, %294
%296 = load i32, i32* %17
%297 = load i32, i32* %27
%298 = icmp ult i32 %296, %297
br i1 %298, label %299, label %328
299: ; preds = %295
%300 = load double, double* %23
%301 = load i32, i32* %17
%302 = uitofp i32 %301 to double
%303 = load double, double* %8
%304 = call double @llvm.fmuladd.f64(double %302, double %303, double %300)
%305 = fcmp oge double %304, 3.600000e+02
br i1 %305, label %306, label %313
306: ; preds = %299
%307 = load double, double* %23
%308 = load i32, i32* %17
%309 = uitofp i32 %308 to double
%310 = load double, double* %8
%311 = call double @llvm.fmuladd.f64(double %309, double %310, double %307)
%312 = fsub double %311, 3.600000e+02
br label %319
313: ; preds = %299
%314 = load double, double* %23
%315 = load i32, i32* %17
%316 = uitofp i32 %315 to double
%317 = load double, double* %8
%318 = call double @llvm.fmuladd.f64(double %316, double %317, double %314)
br label %319
319: ; preds = %313, %306
%320 = phi double [ %312, %306 ], [ %318, %313 ]
%321 = load double*, double** %15
%322 = load i32, i32* %17
%323 = zext i32 %322 to i64
%324 = getelementptr inbounds double, double* %321, i64 %323
store double %320, double* %324
br label %325
325: ; preds = %319
%326 = load i32, i32* %17
%327 = add i32 %326, 1
store i32 %327, i32* %17
br label %295
328: ; preds = %295
%329 = load i32, i32* %27
store i32 %329, i32* %17
br label %330
330: ; preds = %346, %328
%331 = load i32, i32* %17
%332 = load i32, i32* %31
%333 = icmp ult i32 %331, %332
br i1 %333, label %334, label %349
334: ; preds = %330
%335 = load double*, double** %15
%336 = load i32, i32* %17
%337 = load i32, i32* %27
%338 = sub i32 %336, %337
%339 = zext i32 %338 to i64
%340 = getelementptr inbounds double, double* %335, i64 %339
%341 = load double, double* %340
%342 = load double*, double** %15
%343 = load i32, i32* %17
%344 = zext i32 %343 to i64
%345 = getelementptr inbounds double, double* %342, i64 %344
store double %341, double* %345
br label %346
346: ; preds = %334
%347 = load i32, i32* %17
%348 = add i32 %347, 1
store i32 %348, i32* %17
br label %330
349: ; preds = %330
store i32 0, i32* %4
br label %350
350: ; preds = %349, %107, %94
%351 = load i32, i32* %4
ret i32 %351
}

LLVM IR (-O2):
@.str = [24 x i8] c"BAD grid definition lon\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [24 x i8] c"BAD grid definition lat\00"
@stderr = global i32 0
@.str.3 = [54 x i8] c"cannot handle non-zero mercator orientation angle %f\0A\00"
@.str.4 = [60 x i8] c"Sorry geo/mercator code does not handle variable nx/ny yet\0A\00"
@.str.5 = [37 x i8] c"mercator2ll memory allocation failed\00"
@.str.6 = [50 x i8] c"Mercator grid: lat1 and lat2, bad grid definition\00"
@.str.7 = [62 x i8] c"Mercator grid: grid definition ambiguity, bad grid definition\00"
@.str.8 = [53 x i8] c"Mercator: more code needed to decode grid definition\00"
@.str.9 = [156 x i8] c"\0A*** Mercator grid error: inconsistent d-longitude, radius and grid domain\0A*** d-longitude from grid domain %lf (used), d-longitude from dx %lf (not used)\0A\00"
define i32 @mercator2ll(i8** %0, double** nocapture %1, double** nocapture %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = bitcast i32* %8 to i8*
%14 = call i32 @get_nxny_(i8** %0, i32* %4, i32* %5, i32* %8, i32* %6, i32* %7)
%15 = getelementptr inbounds i8*, i8** %0, i64 3
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 68
%18 = call double @uint4(i8* %17)
%19 = getelementptr inbounds i8, i8* %16, i64 64
%20 = call double @uint4(i8* %19)
%21 = fmul double %20, 1.000000e-03
%22 = getelementptr inbounds i8, i8* %16, i64 38
%23 = call double @int4(i8* %22)
%24 = fmul double %23, 0x3EB0C6F7A0B5ED8D
%25 = getelementptr inbounds i8, i8* %16, i64 51
%26 = call double @int4(i8* %25)
%27 = fmul double %26, 0x3EB0C6F7A0B5ED8D
%28 = getelementptr inbounds i8, i8* %16, i64 42
%29 = call double @uint4(i8* %28)
%30 = fmul double %29, 0x3EB0C6F7A0B5ED8D
%31 = getelementptr inbounds i8, i8* %16, i64 55
%32 = call double @uint4(i8* %31)
%33 = fmul double %32, 0x3EB0C6F7A0B5ED8D
%34 = fcmp olt double %30, 0.000000e+00
%35 = fcmp olt double %33, 0.000000e+00
%36 = select i1 %34, i1 true, i1 %35
%37 = fcmp ogt double %30, 3.600000e+02
%38 = or i1 %37, %36
%39 = fcmp ogt double %33, 3.600000e+02
%40 = select i1 %38, i1 true, i1 %39
br i1 %40, label %41, label %43
41: ; preds = %3
%42 = call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %3, %41
%44 = fcmp olt double %24, -9.000000e+01
%45 = fcmp olt double %27, -9.000000e+01
%46 = select i1 %44, i1 true, i1 %45
%47 = fcmp ogt double %24, 9.000000e+01
%48 = or i1 %47, %46
%49 = fcmp ogt double %27, 9.000000e+01
%50 = select i1 %48, i1 true, i1 %49
br i1 %50, label %51, label %53
51: ; preds = %43
%52 = call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %53
53: ; preds = %43, %51
%54 = getelementptr inbounds i8, i8* %16, i64 60
%55 = call double @uint4(i8* %54)
%56 = fmul double %55, 0x3EB0C6F7A0B5ED8D
%57 = fcmp une double %56, 0.000000e+00
br i1 %57, label %58, label %63
58: ; preds = %53
%59 = load i32, i32* @stderr
%60 = call double @uint4(i8* %54)
%61 = fmul double %60, 0x3EB0C6F7A0B5ED8D
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.3, i64 0, i64 0), double %61)
br label %537
63: ; preds = %53
%64 = load i32, i32* %4
%65 = icmp eq i32 %64, 0
%66 = load i32, i32* %5
%67 = icmp eq i32 %66, 0
%68 = select i1 %65, i1 true, i1 %67
br i1 %68, label %69, label %72
69: ; preds = %63
%70 = load i32, i32* @stderr
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
br label %537
72: ; preds = %63
%73 = load i32, i32* %8
%74 = zext i32 %73 to i64
%75 = shl nuw nsw i64 %74, 3
%76 = call i64 @malloc(i64 %75)
%77 = inttoptr i64 %76 to double*
store double* %77, double** %1
%78 = icmp eq i64 %76, 0
br i1 %78, label %79, label %81
79: ; preds = %72
%80 = call i32 @fatal_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %81
81: ; preds = %79, %72
%82 = load i32, i32* %8
%83 = zext i32 %82 to i64
%84 = shl nuw nsw i64 %83, 3
%85 = call i64 @malloc(i64 %84)
%86 = inttoptr i64 %85 to double*
store double* %86, double** %2
%87 = icmp eq i64 %85, 0
br i1 %87, label %88, label %90
88: ; preds = %81
%89 = call i32 @fatal_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %90
90: ; preds = %88, %81
%91 = load i32, i32* %7
%92 = and i32 %91, 64
%93 = icmp eq i32 %92, 0
%94 = select i1 %93, double %24, double %27
%95 = select i1 %93, double %27, double %24
%96 = fcmp ogt double %95, %94
br i1 %96, label %97, label %100
97: ; preds = %90
%98 = call i32 @fatal_error(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%99 = load i32, i32* %7
br label %100
100: ; preds = %97, %90
%101 = phi i32 [ %99, %97 ], [ %91, %90 ]
%102 = and i32 %101, 16
%103 = icmp eq i32 %102, 0
br i1 %103, label %125, label %104
104: ; preds = %100
%105 = load i32, i32* %5
%106 = and i32 %105, 1
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %117
108: ; preds = %104
%109 = load i32, i32* %6
%110 = and i32 %109, 32
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %117
112: ; preds = %108
%113 = call i32 @fatal_error(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%114 = load i32, i32* %7
%115 = and i32 %114, 16
%116 = icmp eq i32 %115, 0
br i1 %116, label %125, label %117
117: ; preds = %104, %108, %112
%118 = phi i32 [ %114, %112 ], [ %101, %108 ], [ %101, %104 ]
%119 = load i32, i32* %5
%120 = and i32 %119, 1
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %125
122: ; preds = %117
%123 = call i32 @fatal_error(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%124 = load i32, i32* %7
br label %125
125: ; preds = %100, %122, %117, %112
%126 = phi i32 [ %124, %122 ], [ %118, %117 ], [ %114, %112 ], [ %101, %100 ]
%127 = and i32 %126, 128
%128 = icmp eq i32 %127, 0
%129 = select i1 %128, double %33, double %30
%130 = select i1 %128, double %30, double %33
%131 = fcmp ugt double %129, %130
%132 = fadd double %129, 3.600000e+02
%133 = select i1 %131, double %129, double %132
%134 = load double*, double** %1
%135 = load double*, double** %2
%136 = fsub double %133, %130
%137 = load i32, i32* %4
%138 = add i32 %137, -1
%139 = uitofp i32 %138 to double
%140 = fdiv double %136, %139
%141 = call double @radius_earth(i8** %0)
%142 = fmul double %141, 0x401921FB54442D18
%143 = getelementptr inbounds i8, i8* %16, i64 47
%144 = call double @int4(i8* %143)
%145 = fmul double %144, 0x3EB0C6F7A0B5ED8D
%146 = fmul double %145, 0x3F91DF46A2529D39
%147 = call double @cos(double %146)
%148 = fmul double %142, %147
%149 = fmul double %21, 3.600000e+02
%150 = fdiv double %149, %148
%151 = fcmp une double %150, 0.000000e+00
br i1 %151, label %152, label %160
152: ; preds = %125
%153 = fsub double %150, %140
%154 = fdiv double %153, %150
%155 = call double @llvm.fabs.f64(double %154)
%156 = fcmp ult double %155, 1.000000e-03
br i1 %156, label %160, label %157
157: ; preds = %152
%158 = load i32, i32* @stderr
%159 = call i32 (i32, i8*, ...) @fprintf(i32 %158, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.9, i64 0, i64 0), double %140, double %150)
br label %160
160: ; preds = %152, %157, %125
%161 = phi double [ %150, %125 ], [ %140, %157 ], [ %140, %152 ]
%162 = fmul double %95, 5.000000e-01
%163 = fadd double %162, 4.500000e+01
%164 = fmul double %163, 0x400921FB54442D18
%165 = fdiv double %164, 1.800000e+02
%166 = fptosi double %165 to i32
%167 = call i32 @tan(i32 %166)
%168 = call double @log(i32 %167)
%169 = fmul double %94, 5.000000e-01
%170 = fadd double %169, 4.500000e+01
%171 = fmul double %170, 0x400921FB54442D18
%172 = fdiv double %171, 1.800000e+02
%173 = fptosi double %172 to i32
%174 = call i32 @tan(i32 %173)
%175 = call double @log(i32 %174)
%176 = fsub double %175, %168
%177 = load i32, i32* %5
%178 = add i32 %177, -1
%179 = uitofp i32 %178 to double
%180 = fdiv double %176, %179
%181 = icmp eq i32 %177, 0
br i1 %181, label %182, label %244
182: ; preds = %160
%183 = load i32, i32* %4
br label %184
184: ; preds = %378, %182
%185 = phi i32 [ %183, %182 ], [ %255, %378 ]
%186 = icmp eq i32 %185, 0
br i1 %186, label %382, label %187
187: ; preds = %184
%188 = zext i32 %185 to i64
%189 = icmp eq i32 %185, 1
br i1 %189, label %242, label %190
190: ; preds = %187
%191 = and i64 %188, 4294967294
%192 = insertelement <2 x double> poison, double %161, i64 0
%193 = shufflevector <2 x double> %192, <2 x double> poison, <2 x i32> zeroinitializer
%194 = insertelement <2 x double> poison, double %130, i64 0
%195 = shufflevector <2 x double> %194, <2 x double> poison, <2 x i32> zeroinitializer
%196 = add nsw i64 %191, -2
%197 = lshr exact i64 %196, 1
%198 = add nuw i64 %197, 1
%199 = and i64 %198, 1
%200 = icmp eq i64 %196, 0
br i1 %200, label %229, label %201
201: ; preds = %190
%202 = and i64 %198, -2
br label %203
203: ; preds = %203, %201
%204 = phi i64 [ 0, %201 ], [ %223, %203 ]
%205 = phi <2 x i32> [ <i32 0, i32 1>, %201 ], [ %224, %203 ]
%206 = phi i64 [ 0, %201 ], [ %225, %203 ]
%207 = uitofp <2 x i32> %205 to <2 x double>
%208 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %207, <2 x double> %193, <2 x double> %195)
%209 = fcmp ult <2 x double> %208, <double 3.600000e+02, double 3.600000e+02>
%210 = fadd <2 x double> %208, <double -3.600000e+02, double -3.600000e+02>
%211 = select <2 x i1> %209, <2 x double> %208, <2 x double> %210
%212 = getelementptr inbounds double, double* %135, i64 %204
%213 = bitcast double* %212 to <2 x double>*
store <2 x double> %211, <2 x double>* %213
%214 = or i64 %204, 2
%215 = add <2 x i32> %205, <i32 2, i32 2>
%216 = uitofp <2 x i32> %215 to <2 x double>
%217 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %216, <2 x double> %193, <2 x double> %195)
%218 = fcmp ult <2 x double> %217, <double 3.600000e+02, double 3.600000e+02>
%219 = fadd <2 x double> %217, <double -3.600000e+02, double -3.600000e+02>
%220 = select <2 x i1> %218, <2 x double> %217, <2 x double> %219
%221 = getelementptr inbounds double, double* %135, i64 %214
%222 = bitcast double* %221 to <2 x double>*
store <2 x double> %220, <2 x double>* %222
%223 = add nuw i64 %204, 4
%224 = add <2 x i32> %205, <i32 4, i32 4>
%225 = add nuw i64 %206, 2
%226 = icmp eq i64 %225, %202
br i1 %226, label %227, label %203
227: ; preds = %203
%228 = uitofp <2 x i32> %224 to <2 x double>
br label %229
229: ; preds = %227, %190
%230 = phi i64 [ 0, %190 ], [ %223, %227 ]
%231 = phi <2 x double> [ <double 0.000000e+00, double 1.000000e+00>, %190 ], [ %228, %227 ]
%232 = icmp eq i64 %199, 0
br i1 %232, label %240, label %233
233: ; preds = %229
%234 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %231, <2 x double> %193, <2 x double> %195)
%235 = fcmp ult <2 x double> %234, <double 3.600000e+02, double 3.600000e+02>
%236 = fadd <2 x double> %234, <double -3.600000e+02, double -3.600000e+02>
%237 = select <2 x i1> %235, <2 x double> %234, <2 x double> %236
%238 = getelementptr inbounds double, double* %135, i64 %230
%239 = bitcast double* %238 to <2 x double>*
store <2 x double> %237, <2 x double>* %239
br label %240
240: ; preds = %229, %233
%241 = icmp eq i64 %191, %188
br i1 %241, label %382, label %242
242: ; preds = %187, %240
%243 = phi i64 [ 0, %187 ], [ %191, %240 ]
br label %503
244: ; preds = %160, %378
%245 = phi i32 [ %379, %378 ], [ 0, %160 ]
%246 = uitofp i32 %245 to double
%247 = call double @llvm.fmuladd.f64(double %246, double %180, double %168)
%248 = call i32 @exp(double %247)
%249 = call i32 @atan(i32 %248)
%250 = mul nsw i32 %249, 180
%251 = sitofp i32 %250 to double
%252 = fdiv double %251, 0x400921FB54442D18
%253 = fadd double %252, -4.500000e+01
%254 = fmul double %253, 2.000000e+00
%255 = load i32, i32* %4
%256 = icmp eq i32 %255, 0
br i1 %256, label %378, label %257
257: ; preds = %244
%258 = mul i32 %255, %245
%259 = zext i32 %255 to i64
%260 = icmp ult i32 %255, 4
br i1 %260, label %336, label %261
261: ; preds = %257
%262 = add nsw i64 %259, -1
%263 = trunc i64 %262 to i32
%264 = xor i32 %258, -1
%265 = icmp ult i32 %264, %263
%266 = icmp ugt i64 %262, 4294967295
%267 = or i1 %265, %266
br i1 %267, label %336, label %268
268: ; preds = %261
%269 = and i64 %259, 4294967292
%270 = insertelement <2 x double> poison, double %254, i64 0
%271 = shufflevector <2 x double> %270, <2 x double> poison, <2 x i32> zeroinitializer
%272 = insertelement <2 x double> poison, double %254, i64 0
%273 = shufflevector <2 x double> %272, <2 x double> poison, <2 x i32> zeroinitializer
%274 = add nsw i64 %269, -4
%275 = lshr exact i64 %274, 2
%276 = add nuw nsw i64 %275, 1
%277 = and i64 %276, 3
%278 = icmp ult i64 %274, 12
br i1 %278, label %318, label %279
279: ; preds = %268
%280 = and i64 %276, 9223372036854775804
br label %281
281: ; preds = %281, %279
%282 = phi i64 [ 0, %279 ], [ %315, %281 ]
%283 = phi i64 [ 0, %279 ], [ %316, %281 ]
%284 = trunc i64 %282 to i32
%285 = add i32 %258, %284
%286 = zext i32 %285 to i64
%287 = getelementptr inbounds double, double* %134, i64 %286
%288 = bitcast double* %287 to <2 x double>*
store <2 x double> %271, <2 x double>* %288
%289 = getelementptr inbounds double, double* %287, i64 2
%290 = bitcast double* %289 to <2 x double>*
store <2 x double> %273, <2 x double>* %290
%291 = trunc i64 %282 to i32
%292 = or i32 %291, 4
%293 = add i32 %258, %292
%294 = zext i32 %293 to i64
%295 = getelementptr inbounds double, double* %134, i64 %294
%296 = bitcast double* %295 to <2 x double>*
store <2 x double> %271, <2 x double>* %296
%297 = getelementptr inbounds double, double* %295, i64 2
%298 = bitcast double* %297 to <2 x double>*
store <2 x double> %273, <2 x double>* %298
%299 = trunc i64 %282 to i32
%300 = or i32 %299, 8
%301 = add i32 %258, %300
%302 = zext i32 %301 to i64
%303 = getelementptr inbounds double, double* %134, i64 %302
%304 = bitcast double* %303 to <2 x double>*
store <2 x double> %271, <2 x double>* %304
%305 = getelementptr inbounds double, double* %303, i64 2
%306 = bitcast double* %305 to <2 x double>*
store <2 x double> %273, <2 x double>* %306
%307 = trunc i64 %282 to i32
%308 = or i32 %307, 12
%309 = add i32 %258, %308
%310 = zext i32 %309 to i64
%311 = getelementptr inbounds double, double* %134, i64 %310
%312 = bitcast double* %311 to <2 x double>*
store <2 x double> %271, <2 x double>* %312
%313 = getelementptr inbounds double, double* %311, i64 2
%314 = bitcast double* %313 to <2 x double>*
store <2 x double> %273, <2 x double>* %314
%315 = add nuw i64 %282, 16
%316 = add nuw i64 %283, 4
%317 = icmp eq i64 %316, %280
br i1 %317, label %318, label %281
318: ; preds = %281, %268
%319 = phi i64 [ 0, %268 ], [ %315, %281 ]
%320 = icmp eq i64 %277, 0
br i1 %320, label %334, label %321
321: ; preds = %318, %321
%322 = phi i64 [ %331, %321 ], [ %319, %318 ]
%323 = phi i64 [ %332, %321 ], [ 0, %318 ]
%324 = trunc i64 %322 to i32
%325 = add i32 %258, %324
%326 = zext i32 %325 to i64
%327 = getelementptr inbounds double, double* %134, i64 %326
%328 = bitcast double* %327 to <2 x double>*
store <2 x double> %271, <2 x double>* %328
%329 = getelementptr inbounds double, double* %327, i64 2
%330 = bitcast double* %329 to <2 x double>*
store <2 x double> %273, <2 x double>* %330
%331 = add nuw i64 %322, 4
%332 = add i64 %323, 1
%333 = icmp eq i64 %332, %277
br i1 %333, label %334, label %321
334: ; preds = %321, %318
%335 = icmp eq i64 %269, %259
br i1 %335, label %378, label %336
336: ; preds = %261, %257, %334
%337 = phi i64 [ 0, %261 ], [ 0, %257 ], [ %269, %334 ]
%338 = xor i64 %337, -1
%339 = add nsw i64 %338, %259
%340 = and i64 %259, 3
%341 = icmp eq i64 %340, 0
br i1 %341, label %352, label %342
342: ; preds = %336, %342
%343 = phi i64 [ %349, %342 ], [ %337, %336 ]
%344 = phi i64 [ %350, %342 ], [ 0, %336 ]
%345 = trunc i64 %343 to i32
%346 = add i32 %258, %345
%347 = zext i32 %346 to i64
%348 = getelementptr inbounds double, double* %134, i64 %347
store double %254, double* %348
%349 = add nuw nsw i64 %343, 1
%350 = add i64 %344, 1
%351 = icmp eq i64 %350, %340
br i1 %351, label %352, label %342
352: ; preds = %342, %336
%353 = phi i64 [ %337, %336 ], [ %349, %342 ]
%354 = icmp ult i64 %339, 3
br i1 %354, label %378, label %355
355: ; preds = %352, %355
%356 = phi i64 [ %376, %355 ], [ %353, %352 ]
%357 = trunc i64 %356 to i32
%358 = add i32 %258, %357
%359 = zext i32 %358 to i64
%360 = getelementptr inbounds double, double* %134, i64 %359
store double %254, double* %360
%361 = trunc i64 %356 to i32
%362 = add i32 %361, 1
%363 = add i32 %258, %362
%364 = zext i32 %363 to i64
%365 = getelementptr inbounds double, double* %134, i64 %364
store double %254, double* %365
%366 = trunc i64 %356 to i32
%367 = add i32 %366, 2
%368 = add i32 %258, %367
%369 = zext i32 %368 to i64
%370 = getelementptr inbounds double, double* %134, i64 %369
store double %254, double* %370
%371 = trunc i64 %356 to i32
%372 = add i32 %371, 3
%373 = add i32 %258, %372
%374 = zext i32 %373 to i64
%375 = getelementptr inbounds double, double* %134, i64 %374
store double %254, double* %375
%376 = add nuw nsw i64 %356, 4
%377 = icmp eq i64 %376, %259
br i1 %377, label %378, label %355
378: ; preds = %352, %355, %334, %244
%379 = add nuw i32 %245, 1
%380 = load i32, i32* %5
%381 = icmp ult i32 %379, %380
br i1 %381, label %244, label %184
382: ; preds = %503, %240, %184
%383 = load i32, i32* %8
%384 = icmp ult i32 %185, %383
br i1 %384, label %385, label %537
385: ; preds = %382
%386 = zext i32 %185 to i64
%387 = zext i32 %383 to i64
%388 = sub nsw i64 %387, %386
%389 = icmp ult i64 %388, 4
br i1 %389, label %483, label %390
390: ; preds = %385
%391 = getelementptr double, double* %135, i64 %386
%392 = getelementptr double, double* %135, i64 %387
%393 = sub nsw i64 %387, %386
%394 = getelementptr double, double* %135, i64 %393
%395 = icmp ult double* %391, %394
%396 = icmp ult double* %135, %392
%397 = and i1 %395, %396
br i1 %397, label %483, label %398
398: ; preds = %390
%399 = and i64 %388, -4
%400 = add nsw i64 %399, %386
%401 = add nsw i64 %399, -4
%402 = lshr exact i64 %401, 2
%403 = add nuw nsw i64 %402, 1
%404 = and i64 %403, 3
%405 = icmp ult i64 %401, 12
br i1 %405, label %461, label %406
406: ; preds = %398
%407 = and i64 %403, 9223372036854775804
br label %408
408: ; preds = %408, %406
%409 = phi i64 [ 0, %406 ], [ %458, %408 ]
%410 = phi i64 [ 0, %406 ], [ %459, %408 ]
%411 = add i64 %409, %386
%412 = getelementptr inbounds double, double* %135, i64 %409
%413 = bitcast double* %412 to <2 x double>*
%414 = load <2 x double>, <2 x double>* %413
%415 = getelementptr inbounds double, double* %412, i64 2
%416 = bitcast double* %415 to <2 x double>*
%417 = load <2 x double>, <2 x double>* %416
%418 = getelementptr inbounds double, double* %135, i64 %411
%419 = bitcast double* %418 to <2 x double>*
store <2 x double> %414, <2 x double>* %419
%420 = getelementptr inbounds double, double* %418, i64 2
%421 = bitcast double* %420 to <2 x double>*
store <2 x double> %417, <2 x double>* %421
%422 = or i64 %409, 4
%423 = add i64 %422, %386
%424 = getelementptr inbounds double, double* %135, i64 %422
%425 = bitcast double* %424 to <2 x double>*
%426 = load <2 x double>, <2 x double>* %425
%427 = getelementptr inbounds double, double* %424, i64 2
%428 = bitcast double* %427 to <2 x double>*
%429 = load <2 x double>, <2 x double>* %428
%430 = getelementptr inbounds double, double* %135, i64 %423
%431 = bitcast double* %430 to <2 x double>*
store <2 x double> %426, <2 x double>* %431
%432 = getelementptr inbounds double, double* %430, i64 2
%433 = bitcast double* %432 to <2 x double>*
store <2 x double> %429, <2 x double>* %433
%434 = or i64 %409, 8
%435 = add i64 %434, %386
%436 = getelementptr inbounds double, double* %135, i64 %434
%437 = bitcast double* %436 to <2 x double>*
%438 = load <2 x double>, <2 x double>* %437
%439 = getelementptr inbounds double, double* %436, i64 2
%440 = bitcast double* %439 to <2 x double>*
%441 = load <2 x double>, <2 x double>* %440
%442 = getelementptr inbounds double, double* %135, i64 %435
%443 = bitcast double* %442 to <2 x double>*
store <2 x double> %438, <2 x double>* %443
%444 = getelementptr inbounds double, double* %442, i64 2
%445 = bitcast double* %444 to <2 x double>*
store <2 x double> %441, <2 x double>* %445
%446 = or i64 %409, 12
%447 = add i64 %446, %386
%448 = getelementptr inbounds double, double* %135, i64 %446
%449 = bitcast double* %448 to <2 x double>*
%450 = load <2 x double>, <2 x double>* %449
%451 = getelementptr inbounds double, double* %448, i64 2
%452 = bitcast double* %451 to <2 x double>*
%453 = load <2 x double>, <2 x double>* %452
%454 = getelementptr inbounds double, double* %135, i64 %447
%455 = bitcast double* %454 to <2 x double>*
store <2 x double> %450, <2 x double>* %455
%456 = getelementptr inbounds double, double* %454, i64 2
%457 = bitcast double* %456 to <2 x double>*
store <2 x double> %453, <2 x double>* %457
%458 = add nuw i64 %409, 16
%459 = add nuw i64 %410, 4
%460 = icmp eq i64 %459, %407
br i1 %460, label %461, label %408
461: ; preds = %408, %398
%462 = phi i64 [ 0, %398 ], [ %458, %408 ]
%463 = icmp eq i64 %404, 0
br i1 %463, label %481, label %464
464: ; preds = %461, %464
%465 = phi i64 [ %478, %464 ], [ %462, %461 ]
%466 = phi i64 [ %479, %464 ], [ 0, %461 ]
%467 = add i64 %465, %386
%468 = getelementptr inbounds double, double* %135, i64 %465
%469 = bitcast double* %468 to <2 x double>*
%470 = load <2 x double>, <2 x double>* %469
%471 = getelementptr inbounds double, double* %468, i64 2
%472 = bitcast double* %471 to <2 x double>*
%473 = load <2 x double>, <2 x double>* %472
%474 = getelementptr inbounds double, double* %135, i64 %467
%475 = bitcast double* %474 to <2 x double>*
store <2 x double> %470, <2 x double>* %475
%476 = getelementptr inbounds double, double* %474, i64 2
%477 = bitcast double* %476 to <2 x double>*
store <2 x double> %473, <2 x double>* %477
%478 = add nuw i64 %465, 4
%479 = add i64 %466, 1
%480 = icmp eq i64 %479, %404
br i1 %480, label %481, label %464
481: ; preds = %464, %461
%482 = icmp eq i64 %388, %399
br i1 %482, label %537, label %483
483: ; preds = %390, %385, %481
%484 = phi i64 [ %386, %390 ], [ %386, %385 ], [ %400, %481 ]
%485 = sub nsw i64 %387, %484
%486 = xor i64 %484, -1
%487 = add nsw i64 %486, %387
%488 = and i64 %485, 3
%489 = icmp eq i64 %488, 0
br i1 %489, label %500, label %490
490: ; preds = %483, %490
%491 = phi i64 [ %497, %490 ], [ %484, %483 ]
%492 = phi i64 [ %498, %490 ], [ 0, %483 ]
%493 = sub nuw nsw i64 %491, %386
%494 = getelementptr inbounds double, double* %135, i64 %493
%495 = load double, double* %494
%496 = getelementptr inbounds double, double* %135, i64 %491
store double %495, double* %496
%497 = add nuw nsw i64 %491, 1
%498 = add i64 %492, 1
%499 = icmp eq i64 %498, %488
br i1 %499, label %500, label %490
500: ; preds = %490, %483
%501 = phi i64 [ %484, %483 ], [ %497, %490 ]
%502 = icmp ult i64 %487, 3
br i1 %502, label %537, label %514
503: ; preds = %242, %503
%504 = phi i64 [ %512, %503 ], [ %243, %242 ]
%505 = trunc i64 %504 to i32
%506 = uitofp i32 %505 to double
%507 = call double @llvm.fmuladd.f64(double %506, double %161, double %130)
%508 = fcmp ult double %507, 3.600000e+02
%509 = fadd double %507, -3.600000e+02
%510 = select i1 %508, double %507, double %509
%511 = getelementptr inbounds double, double* %135, i64 %504
store double %510, double* %511
%512 = add nuw nsw i64 %504, 1
%513 = icmp eq i64 %512, %188
br i1 %513, label %382, label %503
514: ; preds = %500, %514
%515 = phi i64 [ %535, %514 ], [ %501, %500 ]
%516 = sub nuw nsw i64 %515, %386
%517 = getelementptr inbounds double, double* %135, i64 %516
%518 = load double, double* %517
%519 = getelementptr inbounds double, double* %135, i64 %515
store double %518, double* %519
%520 = add nuw nsw i64 %515, 1
%521 = sub nuw nsw i64 %520, %386
%522 = getelementptr inbounds double, double* %135, i64 %521
%523 = load double, double* %522
%524 = getelementptr inbounds double, double* %135, i64 %520
store double %523, double* %524
%525 = add nuw nsw i64 %515, 2
%526 = sub nuw nsw i64 %525, %386
%527 = getelementptr inbounds double, double* %135, i64 %526
%528 = load double, double* %527
%529 = getelementptr inbounds double, double* %135, i64 %525
store double %528, double* %529
%530 = add nuw nsw i64 %515, 3
%531 = sub nuw nsw i64 %530, %386
%532 = getelementptr inbounds double, double* %135, i64 %531
%533 = load double, double* %532
%534 = getelementptr inbounds double, double* %135, i64 %530
store double %533, double* %534
%535 = add nuw nsw i64 %515, 4
%536 = icmp eq i64 %535, %387
br i1 %536, label %537, label %514
537: ; preds = %500, %514, %481, %382, %69, %58
ret i32 0
}