#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 */
double asin(double);
double atan2(double, double);
double cos(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 *);
scalar_t__ malloc(size_t);
double radius_earth(unsigned char **);
double sin(double);
int /*<<< orphan*/ stderr;
double uint4(unsigned char *);
int polar2ll(unsigned char **sec, double **llat, double **llon) {
  double *lat, *lon;
  unsigned char *gds;
  double dx, dy, orient, de, de2, dr, tmp, xp, yp, h, lat1, lon1, dr2;
  double di, dj, LatD;
  unsigned int ix, iy;
  unsigned int nnx, nny;
  int nres, nscan;
  unsigned int nnpnts;
  size_t nx;
  get_nxny_(sec, &nnx, &nny, &nnpnts, &nres, &nscan);
  gds = sec[3];
  if (nnx < 1 || nny < 1) {
    fprintf(stderr, "Sorry code does not handle variable nx/ny yet\n");
    return 0;
  }
  nx = nnx;
  if ((*llat = (double *)malloc(((size_t)nnpnts) * sizeof(double))) == NULL) {
    fatal_error("polar2ll memory allocation failed", "");
  }
  if ((*llon = (double *)malloc(((size_t)nnpnts) * sizeof(double))) == NULL) {
    fatal_error("polar2ll memory allocation failed", "");
  }
  lat = *llat;
  lon = *llon;
  lat1 = (int4(gds + 38) * 0.000001) * (3.14159265358979323846 / 180);
  lon1 = (uint4(gds + 42) * 0.000001);
  orient = (uint4(gds + 51) * 0.000001);
  LatD = (int4(gds + 47) * 0.000001);
  lon1 *= (3.14159265358979323846 / 180.0);
  orient *= (3.14159265358979323846 / 180.0);
  dy = (uint4(gds + 59) * 0.001);
  dx = (uint4(gds + 55) * 0.001);
  h = 1.0;
  if (((gds[63] & 128) == 128)) {
    h = -1.0;
    orient -= 3.14159265358979323846;
  }
  de = (1.0 + sin(fabs(LatD) * (3.14159265358979323846 / 180.0))) *
       radius_earth(sec);
  dr = de * cos(lat1) / (1 + h * sin(lat1));
  xp = -h * sin(lon1 - orient) * dr / dx;
  yp = cos(lon1 - orient) * dr / dy;
  if (!(((nscan & 64) == 64))) {
    yp = yp - nny + 1;
  }
  if (!(((nscan & 128) == 0))) {
    xp = xp - nnx + 1;
  }
  de2 = de * de;
#pragma omp parallel for private(iy, ix, di, dj, dr2, tmp)
  for (iy = 0; iy < nny; iy++) {
    for (ix = 0; ix < nnx; ix++) {
      di = (ix - xp) * dx;
      dj = (iy - yp) * dy;
      dr2 = di * di + dj * dj;
      if (dr2 < de2 * 1e-6) {
        lon[ix + iy * nx] = 0.0;
        lat[ix + iy * nx] = h * 90.0;
      } else {
        tmp = (orient + h * atan2(di, -dj)) * (180.0 / 3.14159265358979323846);
        if (tmp < 0.0)
          tmp += 360.0;
        if (tmp > 360.0)
          tmp -= 360.0;
        lon[ix + iy * nx] = tmp;
        lat[ix + iy * nx] = h * asin((de2 - dr2) / (de2 + dr2)) *
                            (180.0 / 3.14159265358979323846);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<polar2ll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xc4(%rbp),%rsi
lea    -0xc8(%rbp),%rdx
lea    -0xd4(%rbp),%rcx
lea    -0xcc(%rbp),%r8
lea    -0xd0(%rbp),%r9
call   1070 <get_nxny_@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x1,-0xc4(%rbp)
jb     1219 <polar2ll+0x69>
cmpl   $0x1,-0xc8(%rbp)
jae    123a <polar2ll+0x8a>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1880 <polar2ll+0x6d0>
mov    -0xc4(%rbp),%eax
mov    %rax,-0xe0(%rbp)
mov    -0xd4(%rbp),%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   10c0 <malloc@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    127c <polar2ll+0xcc>
lea    0xe1f(%rip),%rdi
lea    0xe17(%rip),%rsi
call   10a0 <fatal_error@plt>
mov    -0xd4(%rbp),%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   10c0 <malloc@plt>
mov    -0x20(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    12b1 <polar2ll+0x101>
lea    0xdea(%rip),%rdi
lea    0xde2(%rip),%rsi
call   10a0 <fatal_error@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x26,%rdi
call   1030 <int4@plt>
movsd  0xd3c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd28(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x38(%rbp),%rdi
add    $0x2a,%rdi
call   1040 <uint4@plt>
movsd  0xd0f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x38(%rbp),%rdi
add    $0x33,%rdi
call   1040 <uint4@plt>
movsd  0xcee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x2f,%rdi
call   1030 <int4@plt>
movsd  0xcd0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xcb4(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xc9c(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x3b,%rdi
call   1040 <uint4@plt>
movsd  0xc75(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
add    $0x37,%rdi
call   1040 <uint4@plt>
movsd  0xc57(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xc3e(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%rax
movzbl 0x3f(%rax),%eax
and    $0x80,%eax
cmp    $0x80,%eax
jne    1408 <polar2ll+0x258>
movsd  0xc3e(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0xc21(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0xb8(%rbp),%xmm0
ff
movaps 0xc39(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xbed(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1090 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xbc9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x10(%rbp),%rdi
call   1050 <radius_earth@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   10d0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
call   1090 <sin@plt>
movsd  -0xf8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
movsd  0xb33(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xe8(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x50(%rbp),%xmm0
call   1090 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0x50(%rbp),%xmm0
call   10d0 <cos@plt>
mulsd  -0x68(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0xd0(%rbp),%eax
and    $0x40,%eax
cmp    $0x40,%eax
je     1589 <polar2ll+0x3d9>
movsd  -0x80(%rbp),%xmm0
mov    -0xc8(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xa80(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0xd0(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     15c2 <polar2ll+0x412>
movsd  -0x78(%rbp),%xmm0
mov    -0xc4(%rbp),%eax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xa47(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0xc0(%rbp)
mov    -0xc0(%rbp),%eax
cmp    -0xc8(%rbp),%eax
jae    1879 <polar2ll+0x6c9>
movl   $0x0,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0xc4(%rbp),%eax
jae    1860 <polar2ll+0x6b0>
mov    -0xbc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x78(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0xc0(%rbp),%eax
cvtsi2sd %rax,%xmm0
subsd  -0x80(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  -0xb0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0x98d(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    16f2 <polar2ll+0x542>
mov    -0x30(%rbp),%rax
mov    -0xbc(%rbp),%ecx
mov    -0xc0(%rbp),%edx
imul   -0xe0(%rbp),%rdx
ff
add    %rdx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0x97b(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0xbc(%rbp),%ecx
mov    -0xc0(%rbp),%edx
imul   -0xe0(%rbp),%rdx
ff
add    %rdx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1847 <polar2ll+0x697>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
call   1060 <atan2@plt>
movsd  -0x118(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x110(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x8d2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    1787 <polar2ll+0x5d7>
movsd  0x8bb(%rip),%xmm0
addsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0x8a4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    17b4 <polar2ll+0x604>
movsd  -0x70(%rbp),%xmm0
movsd  0x88d(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0xbc(%rbp),%ecx
mov    -0xc0(%rbp),%edx
imul   -0xe0(%rbp),%rdx
ff
add    %rdx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm1
addsd  -0xa0(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   10b0 <asin@plt>
movaps %xmm0,%xmm1
movsd  -0x120(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  0x80d(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0xbc(%rbp),%ecx
mov    -0xc0(%rbp),%edx
imul   -0xe0(%rbp),%rdx
ff
add    %rdx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    184c <polar2ll+0x69c>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    15f7 <polar2ll+0x447>
jmp    1865 <polar2ll+0x6b5>
mov    -0xc0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc0(%rbp)
jmp    15db <polar2ll+0x42b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polar2ll>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%rbp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x3c(%rsp),%rcx
lea    0xa4(%rsp),%r8
lea    0x5c(%rsp),%r9
call   1070 <get_nxny_@plt>
mov    0x14(%rsp),%r13d
test   %r13,%r13
je     145f <polar2ll+0x2af>
cmpl   $0x0,0x10(%rsp)
je     145f <polar2ll+0x2af>
mov    0x18(%rbp),%r14
mov    0x3c(%rsp),%edi
shl    $0x3,%rdi
call   10c0 <malloc@plt>
mov    %rax,(%r15)
test   %rax,%rax
jne    1230 <polar2ll+0x80>
lea    0xe8b(%rip),%rdi
lea    0xe83(%rip),%rsi
call   10a0 <fatal_error@plt>
mov    0x3c(%rsp),%edi
shl    $0x3,%rdi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    %rax,(%rbx)
test   %rax,%rax
jne    125e <polar2ll+0xae>
lea    0xe60(%rip),%rdi
lea    0xe58(%rip),%rsi
call   10a0 <fatal_error@plt>
mov    (%rbx),%r12
mov    (%r15),%rbx
lea    0x26(%r14),%rdi
call   1030 <int4@plt>
mulsd  0xd8e(%rip),%xmm0
mulsd  0xd8e(%rip),%xmm0
movsd  %xmm0,0x60(%rsp)
lea    0x2a(%r14),%rdi
call   1040 <uint4@plt>
mulsd  0xd6f(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x33(%r14),%rdi
call   1040 <uint4@plt>
mulsd  0xd58(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
lea    0x2f(%r14),%rdi
call   1030 <int4@plt>
mulsd  0xd41(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0xd3b(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
lea    0x3b(%r14),%rdi
call   1040 <uint4@plt>
mulsd  0xd12(%rip),%xmm0
movsd  %xmm0,0x78(%rsp)
lea    0x37(%r14),%rdi
call   1040 <uint4@plt>
mov    0x3f(%r14),%al
mov    %eax,%ecx
shr    $0x7,%cl
movzbl %cl,%ecx
lea    0xd30(%rip),%rdx
movsd  (%rdx,%rcx,8),%xmm1
movapd %xmm1,0x80(%rsp)
test   %al,%al
jns    1346 <polar2ll+0x196>
movsd  0x18(%rsp),%xmm1
addsd  0xcd8(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xcba(%rip),%xmm1
movapd 0x20(%rsp),%xmm2
movsd  0xcb4(%rip),%xmm3
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x50(%rsp)
andpd  0xcf2(%rip),%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1090 <sin@plt>
addsd  0xc9d(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %rbp,%rdi
call   1050 <radius_earth@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  0x60(%rsp),%xmm0
call   10d0 <cos@plt>
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x60(%rsp),%xmm0
call   1090 <sin@plt>
movapd 0x80(%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xc4c(%rip),%xmm0
movsd  0x20(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x20(%rsp)
movapd 0xc84(%rip),%xmm0
xorpd  %xmm1,%xmm0
movapd %xmm0,0x60(%rsp)
movsd  0x8(%rsp),%xmm0
subsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1090 <sin@plt>
mulsd  0x60(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
call   10d0 <cos@plt>
mulsd  0x20(%rsp),%xmm0
divsd  0x78(%rsp),%xmm0
mov    0x5c(%rsp),%edx
mov    0x10(%rsp),%ecx
test   $0x40,%dl
je     1479 <polar2ll+0x2c9>
movsd  %xmm0,0x70(%rsp)
movsd  0x50(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
movsd  0xbc3(%rip),%xmm3
jmp    14a3 <polar2ll+0x2f3>
mov    0x2b7a(%rip),%rax
mov    (%rax),%edi
lea    0xc11(%rip),%rsi
call   1080 <fprintf@plt>
jmp    16a7 <polar2ll+0x4f7>
xorps  %xmm1,%xmm1
cvtsi2sd %rcx,%xmm1
subsd  %xmm1,%xmm0
movsd  0xb93(%rip),%xmm3
addsd  %xmm3,%xmm0
movsd  %xmm0,0x70(%rsp)
movsd  0x50(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
divsd  %xmm1,%xmm2
mov    0x14(%rsp),%eax
test   $0x80,%edx
je     14c3 <polar2ll+0x313>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
subsd  %xmm0,%xmm2
addsd  %xmm3,%xmm2
test   %ecx,%ecx
je     16a7 <polar2ll+0x4f7>
movsd  0x48(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xb23(%rip),%xmm3
movsd  %xmm0,0x48(%rsp)
mulsd  %xmm0,%xmm3
movsd  0xb39(%rip),%xmm0
mulsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x90(%rsp)
shl    $0x3,%r13
xor    %r14d,%r14d
mov    %eax,%edx
movsd  %xmm2,0x40(%rsp)
movsd  %xmm3,0x98(%rsp)
jmp    153b <polar2ll+0x38b>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%ecx
mov    %eax,%edx
add    $0x1,%r14
mov    %ecx,%esi
add    %r13,%rbx
add    %r13,%r12
cmp    %rsi,%r14
jae    16a7 <polar2ll+0x4f7>
test   %edx,%edx
je     16a0 <polar2ll+0x4f0>
mov    %r14d,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
subsd  0x70(%rsp),%xmm0
mulsd  0x78(%rsp),%xmm0
movapd %xmm0,%xmm4
mulsd  %xmm0,%xmm4
xorpd  0xb06(%rip),%xmm0
movapd %xmm0,0x20(%rsp)
xor    %ebp,%ebp
movapd %xmm4,0x60(%rsp)
jmp    1660 <polar2ll+0x4b0>
nopl   (%rax)
movaps 0x20(%rsp),%xmm1
movsd  %xmm5,0x8(%rsp)
call   1060 <atan2@plt>
mulsd  0x80(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  0xa89(%rip),%xmm1
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movsd  0xa81(%rip),%xmm3
addsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
cmpltsd 0xa80(%rip),%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
addsd  0xa60(%rip),%xmm0
movapd %xmm3,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movlpd %xmm1,(%r12,%rbp,8)
movsd  0x48(%rsp),%xmm1
movapd %xmm1,%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
call   10b0 <asin@plt>
movapd 0x60(%rsp),%xmm4
movsd  0x98(%rsp),%xmm3
movsd  0x40(%rsp),%xmm2
movsd  0x50(%rsp),%xmm1
mulsd  0x80(%rsp),%xmm0
mulsd  0x9e8(%rip),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
mov    0x14(%rsp),%eax
add    $0x1,%rbp
mov    %eax,%ecx
cmp    %rcx,%rbp
jae    1520 <polar2ll+0x370>
mov    %ebp,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm4,%xmm5
ucomisd %xmm5,%xmm3
jbe    1580 <polar2ll+0x3d0>
movq   $0x0,(%r12,%rbp,8)
movsd  0x90(%rsp),%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
jmp    1651 <polar2ll+0x4a1>
xor    %edx,%edx
jmp    1526 <polar2ll+0x376>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Sorry code does not handle variable nx/ny yet\0A\00"
@.str.1 = [34 x i8] c"polar2ll memory allocation failed\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @polar2ll(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 i8*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%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 double
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i64
store i8** %0, i8*** %5
store double** %1, double*** %6
store double** %2, double*** %7
%35 = load i8**, i8*** %5
%36 = call i32 @get_nxny_(i8** %35, i32* %29, i32* %30, i32* %33, i32* %31, i32* %32)
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 3
%39 = load i8*, i8** %38
store i8* %39, i8** %10
%40 = load i32, i32* %29
%41 = icmp ult i32 %40, 1
br i1 %41, label %45, label %42
42: ; preds = %3
%43 = load i32, i32* %30
%44 = icmp ult i32 %43, 1
br i1 %44, label %45, label %48
45: ; preds = %42, %3
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %286
48: ; preds = %42
%49 = load i32, i32* %29
%50 = zext i32 %49 to i64
store i64 %50, i64* %34
%51 = load i32, i32* %33
%52 = zext i32 %51 to i64
%53 = mul i64 %52, 8
%54 = call i64 @malloc(i64 %53)
%55 = inttoptr i64 %54 to double*
%56 = load double**, double*** %6
store double* %55, double** %56
%57 = icmp eq double* %55, null
br i1 %57, label %58, label %60
58: ; preds = %48
%59 = call i32 @fatal_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %60
60: ; preds = %58, %48
%61 = load i32, i32* %33
%62 = zext i32 %61 to i64
%63 = mul i64 %62, 8
%64 = call i64 @malloc(i64 %63)
%65 = inttoptr i64 %64 to double*
%66 = load double**, double*** %7
store double* %65, double** %66
%67 = icmp eq double* %65, null
br i1 %67, label %68, label %70
68: ; preds = %60
%69 = call i32 @fatal_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %70
70: ; preds = %68, %60
%71 = load double**, double*** %6
%72 = load double*, double** %71
store double* %72, double** %8
%73 = load double**, double*** %7
%74 = load double*, double** %73
store double* %74, double** %9
%75 = load i8*, i8** %10
%76 = getelementptr inbounds i8, i8* %75, i64 38
%77 = call double @int4(i8* %76)
%78 = fmul double %77, 0x3EB0C6F7A0B5ED8D
%79 = fmul double %78, 0x3F91DF46A2529D39
store double %79, double* %21
%80 = load i8*, i8** %10
%81 = getelementptr inbounds i8, i8* %80, i64 42
%82 = call double @uint4(i8* %81)
%83 = fmul double %82, 0x3EB0C6F7A0B5ED8D
store double %83, double* %22
%84 = load i8*, i8** %10
%85 = getelementptr inbounds i8, i8* %84, i64 51
%86 = call double @uint4(i8* %85)
%87 = fmul double %86, 0x3EB0C6F7A0B5ED8D
store double %87, double* %13
%88 = load i8*, i8** %10
%89 = getelementptr inbounds i8, i8* %88, i64 47
%90 = call double @int4(i8* %89)
%91 = fmul double %90, 0x3EB0C6F7A0B5ED8D
store double %91, double* %26
%92 = load double, double* %22
%93 = fmul double %92, 0x3F91DF46A2529D39
store double %93, double* %22
%94 = load double, double* %13
%95 = fmul double %94, 0x3F91DF46A2529D39
store double %95, double* %13
%96 = load i8*, i8** %10
%97 = getelementptr inbounds i8, i8* %96, i64 59
%98 = call double @uint4(i8* %97)
%99 = fmul double %98, 1.000000e-03
store double %99, double* %12
%100 = load i8*, i8** %10
%101 = getelementptr inbounds i8, i8* %100, i64 55
%102 = call double @uint4(i8* %101)
%103 = fmul double %102, 1.000000e-03
store double %103, double* %11
store double 1.000000e+00, double* %20
%104 = load i8*, i8** %10
%105 = getelementptr inbounds i8, i8* %104, i64 63
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = and i32 %107, 128
%109 = icmp eq i32 %108, 128
br i1 %109, label %110, label %113
110: ; preds = %70
store double -1.000000e+00, double* %20
%111 = load double, double* %13
%112 = fsub double %111, 0x400921FB54442D18
store double %112, double* %13
br label %113
113: ; preds = %110, %70
%114 = load double, double* %26
%115 = call double @llvm.fabs.f64(double %114)
%116 = fmul double %115, 0x3F91DF46A2529D39
%117 = call double @sin(double %116)
%118 = fadd double 1.000000e+00, %117
%119 = load i8**, i8*** %5
%120 = call double @radius_earth(i8** %119)
%121 = fmul double %118, %120
store double %121, double* %14
%122 = load double, double* %14
%123 = load double, double* %21
%124 = call double @cos(double %123)
%125 = fmul double %122, %124
%126 = load double, double* %20
%127 = load double, double* %21
%128 = call double @sin(double %127)
%129 = call double @llvm.fmuladd.f64(double %126, double %128, double 1.000000e+00)
%130 = fdiv double %125, %129
store double %130, double* %16
%131 = load double, double* %20
%132 = fneg double %131
%133 = load double, double* %22
%134 = load double, double* %13
%135 = fsub double %133, %134
%136 = call double @sin(double %135)
%137 = fmul double %132, %136
%138 = load double, double* %16
%139 = fmul double %137, %138
%140 = load double, double* %11
%141 = fdiv double %139, %140
store double %141, double* %18
%142 = load double, double* %22
%143 = load double, double* %13
%144 = fsub double %142, %143
%145 = call double @cos(double %144)
%146 = load double, double* %16
%147 = fmul double %145, %146
%148 = load double, double* %12
%149 = fdiv double %147, %148
store double %149, double* %19
%150 = load i32, i32* %32
%151 = and i32 %150, 64
%152 = icmp eq i32 %151, 64
br i1 %152, label %159, label %153
153: ; preds = %113
%154 = load double, double* %19
%155 = load i32, i32* %30
%156 = uitofp i32 %155 to double
%157 = fsub double %154, %156
%158 = fadd double %157, 1.000000e+00
store double %158, double* %19
br label %159
159: ; preds = %153, %113
%160 = load i32, i32* %32
%161 = and i32 %160, 128
%162 = icmp eq i32 %161, 0
br i1 %162, label %169, label %163
163: ; preds = %159
%164 = load double, double* %18
%165 = load i32, i32* %29
%166 = uitofp i32 %165 to double
%167 = fsub double %164, %166
%168 = fadd double %167, 1.000000e+00
store double %168, double* %18
br label %169
169: ; preds = %163, %159
%170 = load double, double* %14
%171 = load double, double* %14
%172 = fmul double %170, %171
store double %172, double* %15
store i32 0, i32* %28
br label %173
173: ; preds = %282, %169
%174 = load i32, i32* %28
%175 = load i32, i32* %30
%176 = icmp ult i32 %174, %175
br i1 %176, label %177, label %285
177: ; preds = %173
store i32 0, i32* %27
br label %178
178: ; preds = %278, %177
%179 = load i32, i32* %27
%180 = load i32, i32* %29
%181 = icmp ult i32 %179, %180
br i1 %181, label %182, label %281
182: ; preds = %178
%183 = load i32, i32* %27
%184 = uitofp i32 %183 to double
%185 = load double, double* %18
%186 = fsub double %184, %185
%187 = load double, double* %11
%188 = fmul double %186, %187
store double %188, double* %24
%189 = load i32, i32* %28
%190 = uitofp i32 %189 to double
%191 = load double, double* %19
%192 = fsub double %190, %191
%193 = load double, double* %12
%194 = fmul double %192, %193
store double %194, double* %25
%195 = load double, double* %24
%196 = load double, double* %24
%197 = load double, double* %25
%198 = load double, double* %25
%199 = fmul double %197, %198
%200 = call double @llvm.fmuladd.f64(double %195, double %196, double %199)
store double %200, double* %23
%201 = load double, double* %23
%202 = load double, double* %15
%203 = fmul double %202, 0x3EB0C6F7A0B5ED8D
%204 = fcmp olt double %201, %203
br i1 %204, label %205, label %226
205: ; preds = %182
%206 = load double*, double** %9
%207 = load i32, i32* %27
%208 = zext i32 %207 to i64
%209 = load i32, i32* %28
%210 = zext i32 %209 to i64
%211 = load i64, i64* %34
%212 = mul i64 %210, %211
%213 = add i64 %208, %212
%214 = getelementptr inbounds double, double* %206, i64 %213
store double 0.000000e+00, double* %214
%215 = load double, double* %20
%216 = fmul double %215, 9.000000e+01
%217 = load double*, double** %8
%218 = load i32, i32* %27
%219 = zext i32 %218 to i64
%220 = load i32, i32* %28
%221 = zext i32 %220 to i64
%222 = load i64, i64* %34
%223 = mul i64 %221, %222
%224 = add i64 %219, %223
%225 = getelementptr inbounds double, double* %217, i64 %224
store double %216, double* %225
br label %277
226: ; preds = %182
%227 = load double, double* %13
%228 = load double, double* %20
%229 = load double, double* %24
%230 = load double, double* %25
%231 = fneg double %230
%232 = call double @atan2(double %229, double %231)
%233 = call double @llvm.fmuladd.f64(double %228, double %232, double %227)
%234 = fmul double %233, 0x404CA5DC1A63C1F8
store double %234, double* %17
%235 = load double, double* %17
%236 = fcmp olt double %235, 0.000000e+00
br i1 %236, label %237, label %240
237: ; preds = %226
%238 = load double, double* %17
%239 = fadd double %238, 3.600000e+02
store double %239, double* %17
br label %240
240: ; preds = %237, %226
%241 = load double, double* %17
%242 = fcmp ogt double %241, 3.600000e+02
br i1 %242, label %243, label %246
243: ; preds = %240
%244 = load double, double* %17
%245 = fsub double %244, 3.600000e+02
store double %245, double* %17
br label %246
246: ; preds = %243, %240
%247 = load double, double* %17
%248 = load double*, double** %9
%249 = load i32, i32* %27
%250 = zext i32 %249 to i64
%251 = load i32, i32* %28
%252 = zext i32 %251 to i64
%253 = load i64, i64* %34
%254 = mul i64 %252, %253
%255 = add i64 %250, %254
%256 = getelementptr inbounds double, double* %248, i64 %255
store double %247, double* %256
%257 = load double, double* %20
%258 = load double, double* %15
%259 = load double, double* %23
%260 = fsub double %258, %259
%261 = load double, double* %15
%262 = load double, double* %23
%263 = fadd double %261, %262
%264 = fdiv double %260, %263
%265 = call double @asin(double %264)
%266 = fmul double %257, %265
%267 = fmul double %266, 0x404CA5DC1A63C1F8
%268 = load double*, double** %8
%269 = load i32, i32* %27
%270 = zext i32 %269 to i64
%271 = load i32, i32* %28
%272 = zext i32 %271 to i64
%273 = load i64, i64* %34
%274 = mul i64 %272, %273
%275 = add i64 %270, %274
%276 = getelementptr inbounds double, double* %268, i64 %275
store double %267, double* %276
br label %277
277: ; preds = %246, %205
br label %278
278: ; preds = %277
%279 = load i32, i32* %27
%280 = add i32 %279, 1
store i32 %280, i32* %27
br label %178
281: ; preds = %178
br label %282
282: ; preds = %281
%283 = load i32, i32* %28
%284 = add i32 %283, 1
store i32 %284, i32* %28
br label %173
285: ; preds = %173
store i32 0, i32* %4
br label %286
286: ; preds = %285, %45
%287 = load i32, i32* %4
ret i32 %287
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Sorry code does not handle variable nx/ny yet\0A\00"
@.str.1 = [34 x i8] c"polar2ll memory allocation failed\00"
@.str.2 = [1 x i8] zeroinitializer
define i32 @polar2ll(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 = load i32, i32* %4
%18 = icmp eq i32 %17, 0
%19 = load i32, i32* %5
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 true, i1 %20
br i1 %21, label %22, label %25
22: ; preds = %3
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %176
25: ; preds = %3
%26 = zext i32 %17 to i64
%27 = load i32, i32* %8
%28 = zext i32 %27 to i64
%29 = shl nuw nsw i64 %28, 3
%30 = call i64 @malloc(i64 %29)
%31 = inttoptr i64 %30 to double*
store double* %31, double** %1
%32 = icmp eq i64 %30, 0
br i1 %32, label %33, label %35
33: ; preds = %25
%34 = call i32 @fatal_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %33, %25
%36 = load i32, i32* %8
%37 = zext i32 %36 to i64
%38 = shl nuw nsw i64 %37, 3
%39 = call i64 @malloc(i64 %38)
%40 = inttoptr i64 %39 to double*
store double* %40, double** %2
%41 = icmp eq i64 %39, 0
br i1 %41, label %42, label %45
42: ; preds = %35
%43 = call i32 @fatal_error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%44 = load double*, double** %2
br label %45
45: ; preds = %42, %35
%46 = phi double* [ %44, %42 ], [ %40, %35 ]
%47 = load double*, double** %1
%48 = getelementptr inbounds i8, i8* %16, i64 38
%49 = call double @int4(i8* %48)
%50 = fmul double %49, 0x3EB0C6F7A0B5ED8D
%51 = fmul double %50, 0x3F91DF46A2529D39
%52 = getelementptr inbounds i8, i8* %16, i64 42
%53 = call double @uint4(i8* %52)
%54 = fmul double %53, 0x3EB0C6F7A0B5ED8D
%55 = getelementptr inbounds i8, i8* %16, i64 51
%56 = call double @uint4(i8* %55)
%57 = fmul double %56, 0x3EB0C6F7A0B5ED8D
%58 = getelementptr inbounds i8, i8* %16, i64 47
%59 = call double @int4(i8* %58)
%60 = fmul double %59, 0x3EB0C6F7A0B5ED8D
%61 = fmul double %54, 0x3F91DF46A2529D39
%62 = fmul double %57, 0x3F91DF46A2529D39
%63 = getelementptr inbounds i8, i8* %16, i64 59
%64 = call double @uint4(i8* %63)
%65 = fmul double %64, 1.000000e-03
%66 = getelementptr inbounds i8, i8* %16, i64 55
%67 = call double @uint4(i8* %66)
%68 = fmul double %67, 1.000000e-03
%69 = getelementptr inbounds i8, i8* %16, i64 63
%70 = load i8, i8* %69
%71 = icmp slt i8 %70, 0
%72 = fadd double %62, 0xC00921FB54442D18
%73 = select i1 %71, double -1.000000e+00, double 1.000000e+00
%74 = select i1 %71, double %72, double %62
%75 = call double @llvm.fabs.f64(double %60)
%76 = fmul double %75, 0x3F91DF46A2529D39
%77 = call double @sin(double %76)
%78 = fadd double %77, 1.000000e+00
%79 = call double @radius_earth(i8** %0)
%80 = fmul double %78, %79
%81 = call double @cos(double %51)
%82 = fmul double %80, %81
%83 = call double @sin(double %51)
%84 = call double @llvm.fmuladd.f64(double %73, double %83, double 1.000000e+00)
%85 = fdiv double %82, %84
%86 = fneg double %73
%87 = fsub double %61, %74
%88 = call double @sin(double %87)
%89 = fmul double %88, %86
%90 = fmul double %89, %85
%91 = fdiv double %90, %68
%92 = call double @cos(double %87)
%93 = fmul double %92, %85
%94 = fdiv double %93, %65
%95 = load i32, i32* %7
%96 = and i32 %95, 64
%97 = icmp eq i32 %96, 0
%98 = load i32, i32* %5
%99 = uitofp i32 %98 to double
%100 = fsub double %94, %99
%101 = fadd double %100, 1.000000e+00
%102 = select i1 %97, double %101, double %94
%103 = and i32 %95, 128
%104 = icmp eq i32 %103, 0
%105 = load i32, i32* %4
%106 = uitofp i32 %105 to double
%107 = fsub double %91, %106
%108 = fadd double %107, 1.000000e+00
%109 = select i1 %104, double %91, double %108
%110 = fmul double %80, %80
%111 = icmp eq i32 %98, 0
br i1 %111, label %176, label %112
112: ; preds = %45
%113 = fmul double %110, 0x3EB0C6F7A0B5ED8D
%114 = fmul double %73, 9.000000e+01
br label %115
115: ; preds = %112, %169
%116 = phi i32 [ %98, %112 ], [ %170, %169 ]
%117 = phi i32 [ %105, %112 ], [ %171, %169 ]
%118 = phi i32 [ %105, %112 ], [ %172, %169 ]
%119 = phi i64 [ 0, %112 ], [ %173, %169 ]
%120 = icmp eq i32 %118, 0
br i1 %120, label %169, label %121
121: ; preds = %115
%122 = trunc i64 %119 to i32
%123 = uitofp i32 %122 to double
%124 = fsub double %123, %102
%125 = fmul double %65, %124
%126 = fmul double %125, %125
%127 = fneg double %125
%128 = mul nuw i64 %119, %26
br label %129
129: ; preds = %121, %162
%130 = phi i32 [ %117, %121 ], [ %163, %162 ]
%131 = phi i64 [ 0, %121 ], [ %164, %162 ]
%132 = trunc i64 %131 to i32
%133 = uitofp i32 %132 to double
%134 = fsub double %133, %109
%135 = fmul double %68, %134
%136 = call double @llvm.fmuladd.f64(double %135, double %135, double %126)
%137 = fcmp olt double %136, %113
br i1 %137, label %138, label %142
138: ; preds = %129
%139 = add nuw i64 %128, %131
%140 = getelementptr inbounds double, double* %46, i64 %139
store double 0.000000e+00, double* %140
%141 = getelementptr inbounds double, double* %47, i64 %139
store double %114, double* %141
br label %162
142: ; preds = %129
%143 = call double @atan2(double %135, double %127)
%144 = call double @llvm.fmuladd.f64(double %73, double %143, double %74)
%145 = fmul double %144, 0x404CA5DC1A63C1F8
%146 = fcmp olt double %145, 0.000000e+00
%147 = fadd double %145, 3.600000e+02
%148 = select i1 %146, double %147, double %145
%149 = fcmp ogt double %148, 3.600000e+02
%150 = fadd double %148, -3.600000e+02
%151 = select i1 %149, double %150, double %148
%152 = add nuw i64 %128, %131
%153 = getelementptr inbounds double, double* %46, i64 %152
store double %151, double* %153
%154 = fsub double %110, %136
%155 = fadd double %110, %136
%156 = fdiv double %154, %155
%157 = call double @asin(double %156)
%158 = fmul double %73, %157
%159 = fmul double %158, 0x404CA5DC1A63C1F8
%160 = getelementptr inbounds double, double* %47, i64 %152
store double %159, double* %160
%161 = load i32, i32* %4
br label %162
162: ; preds = %138, %142
%163 = phi i32 [ %130, %138 ], [ %161, %142 ]
%164 = add nuw nsw i64 %131, 1
%165 = zext i32 %163 to i64
%166 = icmp ult i64 %164, %165
br i1 %166, label %129, label %167
167: ; preds = %162
%168 = load i32, i32* %5
br label %169
169: ; preds = %167, %115
%170 = phi i32 [ %168, %167 ], [ %116, %115 ]
%171 = phi i32 [ %163, %167 ], [ %117, %115 ]
%172 = phi i32 [ %163, %167 ], [ 0, %115 ]
%173 = add nuw nsw i64 %119, 1
%174 = zext i32 %170 to i64
%175 = icmp ult i64 %173, %174
br i1 %175, label %115, label %176
176: ; preds = %169, %45, %22
ret i32 0
}