#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 cos(int);
double pow(int, double);
int sin(int);
double sqrt(int);
double tan(double);
void latLongToOsGrid(double *x, double *y) {
  double lat = *x * .0174532925199432958;
  double lon = *y * .0174532925199432958;
  double a = 6377563.396, b = 6356256.909;
  double F0 = 0.9996012717;
  double lat0 = 49 * .0174532925199432958, lon0 = -2 * .0174532925199432958;
  int N0 = -100000, E0 = 400000;
  double e2 = 1 - (b * b) / (a * a);
  double n = (a - b) / (a + b), n2 = n * n, n3 = n * n * n;
  double cosLat = cos(lat), sinLat = sin(lat);
  double nu = a * F0 / sqrt(1 - e2 * sinLat * sinLat);
  double rho = a * F0 * (1 - e2) / pow(1 - e2 * sinLat * sinLat, 1.5);
  double eta2 = nu / rho - 1;
  double Ma = (1 + n + (5 / 4) * n2 + (5 / 4) * n3) * (lat - lat0);
  double Mb =
      (3 * n + 3 * n * n + (21 / 8) * n3) * sin(lat - lat0) * cos(lat + lat0);
  double Mc = ((15 / 8) * n2 + (15 / 8) * n3) * sin(2 * (lat - lat0)) *
              cos(2 * (lat + lat0));
  double Md = (35 / 24) * n3 * sin(3 * (lat - lat0)) * cos(3 * (lat + lat0));
  double M = b * F0 * (Ma - Mb + Mc - Md);
  double cos3lat = cosLat * cosLat * cosLat;
  double cos5lat = cos3lat * cosLat * cosLat;
  double tan2lat = tan(lat) * tan(lat);
  double tan4lat = tan2lat * tan2lat;
  double I = M + N0;
  double II = (nu / 2) * sinLat * cosLat;
  double III = (nu / 24) * sinLat * cos3lat * (5 - tan2lat + 9 * eta2);
  double IIIA = (nu / 720) * sinLat * cos5lat * (61 - 58 * tan2lat + tan4lat);
  double IV = nu * cosLat;
  double V = (nu / 6) * cos3lat * (nu / rho - tan2lat);
  double VI = (nu / 120) * cos5lat *
              (5 - 18 * tan2lat + tan4lat + 14 * eta2 - 58 * tan2lat * eta2);
  double dLon = lon - lon0;
  double dLon2 = dLon * dLon, dLon3 = dLon2 * dLon, dLon4 = dLon3 * dLon,
         dLon5 = dLon4 * dLon, dLon6 = dLon5 * dLon;
  double N = I + II * dLon2 + III * dLon4 + IIIA * dLon6;
  double E = E0 + IV * dLon + V * dLon3 + VI * dLon5;
  *x = E;
  *y = N;
}


x86 assembly (clang, -O0):
<latLongToOsGrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xf31(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xf1c(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xf03(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeee(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0xfffe7960,-0x4c(%rbp)
movl   $0x61a80,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe6c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
addsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
cvttsd2si -0x18(%rbp),%edi
call   1050 <cos@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x78(%rbp)
cvttsd2si -0x18(%rbp),%edi
call   1030 <sin@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdb9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x1a0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xd83(%rip),%xmm1
subsd  -0x58(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd40(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xd38(%rip),%xmm0
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x198(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
divsd  -0x90(%rbp),%xmm0
ff
movsd  0xcfc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xce8(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x60(%rbp),%xmm1
movsd  0xca6(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0xc94(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x190(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0x188(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  0xc1c(%rip),%xmm1
mulsd  -0x70(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0xbe9(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x180(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
movsd  0xbb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0x178(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xb95(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0xb6e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  -0x170(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
movsd  0xb37(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  -0x168(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
subsd  -0xa8(%rbp),%xmm1
ff
addsd  -0xb0(%rbp),%xmm1
ff
subsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x160(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  -0xd8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
cvtsi2sdl -0x4c(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xa2f(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0xa01(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
mulsd  -0xc8(%rbp),%xmm0
ff
movsd  0x9b0(%rip),%xmm2
subsd  -0xd8(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
movsd  0x9c8(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0x99c(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x80(%rbp),%xmm0
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xd8(%rbp),%xmm1
ff
movsd  0x96b(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x967(%rip),%xmm2
addsd  %xmm2,%xmm1
addsd  -0xe0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0x91a(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm1
ff
divsd  -0x90(%rbp),%xmm1
ff
subsd  -0xd8(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  0x8d2(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  -0xd8(%rbp),%xmm1
ff
movsd  0x8a6(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x8a2(%rip),%xmm2
addsd  %xmm2,%xmm1
addsd  -0xe0(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm2
ff
movsd  0x876(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  0x85e(%rip),%xmm1
mulsd  -0xd8(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm3
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x128(%rbp),%xmm0
ff
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x130(%rbp),%xmm0
ff
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x138(%rbp),%xmm0
ff
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x140(%rbp),%xmm0
ff
mulsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x148(%rbp)
ff
movsd  -0xe8(%rbp),%xmm1
ff
movsd  -0xf0(%rbp),%xmm0
ff
movsd  -0x128(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xf8(%rbp),%xmm1
ff
movsd  -0x138(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
movsd  -0x148(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
cvtsi2sdl -0x50(%rbp),%xmm1
movsd  -0x108(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x110(%rbp),%xmm1
ff
movsd  -0x130(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x118(%rbp),%xmm0
ff
movsd  -0x140(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x158(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x150(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<latLongToOsGrid>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  0xe9a(%rip),%xmm0
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
mulsd  (%rsi),%xmm0
movsd  %xmm0,0x58(%rsp)
cvttsd2si %xmm1,%ebp
mov    %ebp,%edi
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    %ebp,%edi
call   1030 <sin@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x48(%rsp)
movsd  0xe56(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe4e(%rip),%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
call   1070 <sqrt@plt>
movsd  0xe43(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rsp)
movsd  0xe39(%rip),%xmm0
mov    %ebp,%edi
call   1060 <pow@plt>
movsd  0xe32(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0x38(%rsp),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x50(%rsp)
movsd  0xe1e(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xe14(%rip),%xmm0
addsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe08(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xdee(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xde8(%rip),%xmm0
addsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xda0(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
addsd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x18(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xd68(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd58(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xd3c(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0xd28(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <tan@plt>
mulsd  0x18(%rsp),%xmm0
movapd %xmm0,%xmm13
mulsd  %xmm0,%xmm13
movsd  0x8(%rsp),%xmm11
addsd  0xcc8(%rip),%xmm11
movsd  0xcc8(%rip),%xmm1
movsd  0x38(%rsp),%xmm5
mulsd  %xmm5,%xmm1
movsd  0x48(%rsp),%xmm2
mulsd  %xmm2,%xmm1
movapd %xmm5,%xmm4
divsd  0xcb0(%rip),%xmm4
movsd  0x30(%rsp),%xmm12
mulsd  %xmm12,%xmm1
mulsd  %xmm2,%xmm4
movapd %xmm2,%xmm9
movsd  0x20(%rsp),%xmm14
mulsd  %xmm14,%xmm4
movsd  0xc8e(%rip),%xmm8
movapd %xmm8,%xmm6
subsd  %xmm0,%xmm6
movsd  0xc85(%rip),%xmm2
movsd  0x40(%rsp),%xmm10
mulsd  %xmm10,%xmm2
addsd  %xmm6,%xmm2
mulsd  %xmm4,%xmm2
movapd %xmm5,%xmm7
divsd  0xc6d(%rip),%xmm7
mulsd  %xmm9,%xmm7
movsd  0x10(%rsp),%xmm3
mulsd  %xmm3,%xmm7
movsd  0xc5e(%rip),%xmm6
mulsd  %xmm0,%xmm6
movsd  0xc5a(%rip),%xmm4
addsd  %xmm6,%xmm4
addsd  %xmm13,%xmm4
mulsd  %xmm7,%xmm4
mulsd  %xmm5,%xmm12
movapd %xmm5,%xmm7
divsd  0xc44(%rip),%xmm7
mulsd  %xmm14,%xmm7
movsd  0x50(%rsp),%xmm9
subsd  %xmm0,%xmm9
mulsd  %xmm7,%xmm9
movapd %xmm5,%xmm7
divsd  0xc2a(%rip),%xmm7
mulsd  %xmm3,%xmm7
mulsd  0xc26(%rip),%xmm0
addsd  %xmm8,%xmm0
addsd  %xmm13,%xmm0
movapd %xmm10,%xmm8
mulsd  %xmm10,%xmm6
mulsd  0xc11(%rip),%xmm8
addsd  %xmm0,%xmm8
addsd  %xmm6,%xmm8
mulsd  %xmm7,%xmm8
movsd  0x58(%rsp),%xmm7
addsd  0xbfc(%rip),%xmm7
movapd %xmm7,%xmm0
mulsd  %xmm7,%xmm0
movapd %xmm7,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm7,%xmm5
mulsd  %xmm3,%xmm5
movapd %xmm7,%xmm6
mulsd  %xmm5,%xmm6
mulsd  %xmm7,%xmm12
mulsd  %xmm6,%xmm7
mulsd  %xmm4,%xmm7
mulsd  %xmm1,%xmm0
addsd  %xmm11,%xmm0
mulsd  %xmm2,%xmm5
addsd  %xmm0,%xmm5
addsd  %xmm7,%xmm5
movapd %xmm12,%xmm0
addsd  0xbb5(%rip),%xmm0
mulsd  %xmm9,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm8,%xmm6
addsd  %xmm3,%xmm6
movsd  %xmm6,(%rbx)
movsd  %xmm5,(%r14)
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @latLongToOsGrid(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca i32
%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 double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
%45 = alloca double
%46 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%47 = load double*, double** %3
%48 = load double, double* %47
%49 = fmul double %48, 0x3F91DF46A2529D39
store double %49, double* %5
%50 = load double*, double** %4
%51 = load double, double* %50
%52 = fmul double %51, 0x3F91DF46A2529D39
store double %52, double* %6
store double 0x41585416D9581062, double* %7
store double 0x41583F483A2D0E56, double* %8
store double 0x3FEFFCBBCE5FBA74, double* %9
store double 0x3FEB5DE4288E80BF, double* %10
store double 0xBFA1DF46A2529D39, double* %11
store i32 -100000, i32* %12
store i32 400000, i32* %13
%53 = load double, double* %8
%54 = load double, double* %8
%55 = fmul double %53, %54
%56 = load double, double* %7
%57 = load double, double* %7
%58 = fmul double %56, %57
%59 = fdiv double %55, %58
%60 = fsub double 1.000000e+00, %59
store double %60, double* %14
%61 = load double, double* %7
%62 = load double, double* %8
%63 = fsub double %61, %62
%64 = load double, double* %7
%65 = load double, double* %8
%66 = fadd double %64, %65
%67 = fdiv double %63, %66
store double %67, double* %15
%68 = load double, double* %15
%69 = load double, double* %15
%70 = fmul double %68, %69
store double %70, double* %16
%71 = load double, double* %15
%72 = load double, double* %15
%73 = fmul double %71, %72
%74 = load double, double* %15
%75 = fmul double %73, %74
store double %75, double* %17
%76 = load double, double* %5
%77 = fptosi double %76 to i32
%78 = call i32 @cos(i32 %77)
%79 = sitofp i32 %78 to double
store double %79, double* %18
%80 = load double, double* %5
%81 = fptosi double %80 to i32
%82 = call i32 @sin(i32 %81)
%83 = sitofp i32 %82 to double
store double %83, double* %19
%84 = load double, double* %7
%85 = load double, double* %9
%86 = fmul double %84, %85
%87 = load double, double* %14
%88 = load double, double* %19
%89 = fmul double %87, %88
%90 = load double, double* %19
%91 = fneg double %89
%92 = call double @llvm.fmuladd.f64(double %91, double %90, double 1.000000e+00)
%93 = fptosi double %92 to i32
%94 = call double @sqrt(i32 %93)
%95 = fdiv double %86, %94
store double %95, double* %20
%96 = load double, double* %7
%97 = load double, double* %9
%98 = fmul double %96, %97
%99 = load double, double* %14
%100 = fsub double 1.000000e+00, %99
%101 = fmul double %98, %100
%102 = load double, double* %14
%103 = load double, double* %19
%104 = fmul double %102, %103
%105 = load double, double* %19
%106 = fneg double %104
%107 = call double @llvm.fmuladd.f64(double %106, double %105, double 1.000000e+00)
%108 = fptosi double %107 to i32
%109 = call double @pow(i32 %108, double 1.500000e+00)
%110 = fdiv double %101, %109
store double %110, double* %21
%111 = load double, double* %20
%112 = load double, double* %21
%113 = fdiv double %111, %112
%114 = fsub double %113, 1.000000e+00
store double %114, double* %22
%115 = load double, double* %15
%116 = fadd double 1.000000e+00, %115
%117 = load double, double* %16
%118 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %117, double %116)
%119 = load double, double* %17
%120 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %119, double %118)
%121 = load double, double* %5
%122 = load double, double* %10
%123 = fsub double %121, %122
%124 = fmul double %120, %123
store double %124, double* %23
%125 = load double, double* %15
%126 = load double, double* %15
%127 = fmul double 3.000000e+00, %126
%128 = load double, double* %15
%129 = fmul double %127, %128
%130 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %125, double %129)
%131 = load double, double* %17
%132 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %131, double %130)
%133 = load double, double* %5
%134 = load double, double* %10
%135 = fsub double %133, %134
%136 = fptosi double %135 to i32
%137 = call i32 @sin(i32 %136)
%138 = sitofp i32 %137 to double
%139 = fmul double %132, %138
%140 = load double, double* %5
%141 = load double, double* %10
%142 = fadd double %140, %141
%143 = fptosi double %142 to i32
%144 = call i32 @cos(i32 %143)
%145 = sitofp i32 %144 to double
%146 = fmul double %139, %145
store double %146, double* %24
%147 = load double, double* %16
%148 = load double, double* %17
%149 = fmul double 1.000000e+00, %148
%150 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %147, double %149)
%151 = load double, double* %5
%152 = load double, double* %10
%153 = fsub double %151, %152
%154 = fmul double 2.000000e+00, %153
%155 = fptosi double %154 to i32
%156 = call i32 @sin(i32 %155)
%157 = sitofp i32 %156 to double
%158 = fmul double %150, %157
%159 = load double, double* %5
%160 = load double, double* %10
%161 = fadd double %159, %160
%162 = fmul double 2.000000e+00, %161
%163 = fptosi double %162 to i32
%164 = call i32 @cos(i32 %163)
%165 = sitofp i32 %164 to double
%166 = fmul double %158, %165
store double %166, double* %25
%167 = load double, double* %17
%168 = fmul double 1.000000e+00, %167
%169 = load double, double* %5
%170 = load double, double* %10
%171 = fsub double %169, %170
%172 = fmul double 3.000000e+00, %171
%173 = fptosi double %172 to i32
%174 = call i32 @sin(i32 %173)
%175 = sitofp i32 %174 to double
%176 = fmul double %168, %175
%177 = load double, double* %5
%178 = load double, double* %10
%179 = fadd double %177, %178
%180 = fmul double 3.000000e+00, %179
%181 = fptosi double %180 to i32
%182 = call i32 @cos(i32 %181)
%183 = sitofp i32 %182 to double
%184 = fmul double %176, %183
store double %184, double* %26
%185 = load double, double* %8
%186 = load double, double* %9
%187 = fmul double %185, %186
%188 = load double, double* %23
%189 = load double, double* %24
%190 = fsub double %188, %189
%191 = load double, double* %25
%192 = fadd double %190, %191
%193 = load double, double* %26
%194 = fsub double %192, %193
%195 = fmul double %187, %194
store double %195, double* %27
%196 = load double, double* %18
%197 = load double, double* %18
%198 = fmul double %196, %197
%199 = load double, double* %18
%200 = fmul double %198, %199
store double %200, double* %28
%201 = load double, double* %28
%202 = load double, double* %18
%203 = fmul double %201, %202
%204 = load double, double* %18
%205 = fmul double %203, %204
store double %205, double* %29
%206 = load double, double* %5
%207 = call double @tan(double %206)
%208 = load double, double* %5
%209 = call double @tan(double %208)
%210 = fmul double %207, %209
store double %210, double* %30
%211 = load double, double* %30
%212 = load double, double* %30
%213 = fmul double %211, %212
store double %213, double* %31
%214 = load double, double* %27
%215 = load i32, i32* %12
%216 = sitofp i32 %215 to double
%217 = fadd double %214, %216
store double %217, double* %32
%218 = load double, double* %20
%219 = fdiv double %218, 2.000000e+00
%220 = load double, double* %19
%221 = fmul double %219, %220
%222 = load double, double* %18
%223 = fmul double %221, %222
store double %223, double* %33
%224 = load double, double* %20
%225 = fdiv double %224, 2.400000e+01
%226 = load double, double* %19
%227 = fmul double %225, %226
%228 = load double, double* %28
%229 = fmul double %227, %228
%230 = load double, double* %30
%231 = fsub double 5.000000e+00, %230
%232 = load double, double* %22
%233 = call double @llvm.fmuladd.f64(double 9.000000e+00, double %232, double %231)
%234 = fmul double %229, %233
store double %234, double* %34
%235 = load double, double* %20
%236 = fdiv double %235, 7.200000e+02
%237 = load double, double* %19
%238 = fmul double %236, %237
%239 = load double, double* %29
%240 = fmul double %238, %239
%241 = load double, double* %30
%242 = call double @llvm.fmuladd.f64(double -5.800000e+01, double %241, double 6.100000e+01)
%243 = load double, double* %31
%244 = fadd double %242, %243
%245 = fmul double %240, %244
store double %245, double* %35
%246 = load double, double* %20
%247 = load double, double* %18
%248 = fmul double %246, %247
store double %248, double* %36
%249 = load double, double* %20
%250 = fdiv double %249, 6.000000e+00
%251 = load double, double* %28
%252 = fmul double %250, %251
%253 = load double, double* %20
%254 = load double, double* %21
%255 = fdiv double %253, %254
%256 = load double, double* %30
%257 = fsub double %255, %256
%258 = fmul double %252, %257
store double %258, double* %37
%259 = load double, double* %20
%260 = fdiv double %259, 1.200000e+02
%261 = load double, double* %29
%262 = fmul double %260, %261
%263 = load double, double* %30
%264 = call double @llvm.fmuladd.f64(double -1.800000e+01, double %263, double 5.000000e+00)
%265 = load double, double* %31
%266 = fadd double %264, %265
%267 = load double, double* %22
%268 = call double @llvm.fmuladd.f64(double 1.400000e+01, double %267, double %266)
%269 = load double, double* %30
%270 = fmul double 5.800000e+01, %269
%271 = load double, double* %22
%272 = fneg double %270
%273 = call double @llvm.fmuladd.f64(double %272, double %271, double %268)
%274 = fmul double %262, %273
store double %274, double* %38
%275 = load double, double* %6
%276 = load double, double* %11
%277 = fsub double %275, %276
store double %277, double* %39
%278 = load double, double* %39
%279 = load double, double* %39
%280 = fmul double %278, %279
store double %280, double* %40
%281 = load double, double* %40
%282 = load double, double* %39
%283 = fmul double %281, %282
store double %283, double* %41
%284 = load double, double* %41
%285 = load double, double* %39
%286 = fmul double %284, %285
store double %286, double* %42
%287 = load double, double* %42
%288 = load double, double* %39
%289 = fmul double %287, %288
store double %289, double* %43
%290 = load double, double* %43
%291 = load double, double* %39
%292 = fmul double %290, %291
store double %292, double* %44
%293 = load double, double* %32
%294 = load double, double* %33
%295 = load double, double* %40
%296 = call double @llvm.fmuladd.f64(double %294, double %295, double %293)
%297 = load double, double* %34
%298 = load double, double* %42
%299 = call double @llvm.fmuladd.f64(double %297, double %298, double %296)
%300 = load double, double* %35
%301 = load double, double* %44
%302 = call double @llvm.fmuladd.f64(double %300, double %301, double %299)
store double %302, double* %45
%303 = load i32, i32* %13
%304 = sitofp i32 %303 to double
%305 = load double, double* %36
%306 = load double, double* %39
%307 = call double @llvm.fmuladd.f64(double %305, double %306, double %304)
%308 = load double, double* %37
%309 = load double, double* %41
%310 = call double @llvm.fmuladd.f64(double %308, double %309, double %307)
%311 = load double, double* %38
%312 = load double, double* %43
%313 = call double @llvm.fmuladd.f64(double %311, double %312, double %310)
store double %313, double* %46
%314 = load double, double* %46
%315 = load double*, double** %3
store double %314, double* %315
%316 = load double, double* %45
%317 = load double*, double** %4
store double %316, double* %317
ret void
}

LLVM IR (-O2):
define void @latLongToOsGrid(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = fmul double %3, 0x3F91DF46A2529D39
%5 = load double, double* %1
%6 = fmul double %5, 0x3F91DF46A2529D39
%7 = fptosi double %4 to i32
%8 = tail call i32 @cos(i32 %7)
%9 = sitofp i32 %8 to double
%10 = tail call i32 @sin(i32 %7)
%11 = sitofp i32 %10 to double
%12 = fmul double %11, 0xBF7B529177712A00
%13 = tail call double @llvm.fmuladd.f64(double %12, double %11, double 1.000000e+00)
%14 = fptosi double %13 to i32
%15 = tail call double @sqrt(i32 %14)
%16 = fdiv double 0x4158519B1EC885F7, %15
%17 = tail call double @pow(i32 %14, double 1.500000e+00)
%18 = fdiv double 0x41582813E9B07D18, %17
%19 = fdiv double %16, %18
%20 = fadd double %19, -1.000000e+00
%21 = fadd double %4, 0xBFEB5DE4288E80BF
%22 = fmul double %21, 0x3FF006DD7072FC96
%23 = fptosi double %21 to i32
%24 = tail call i32 @sin(i32 %23)
%25 = sitofp i32 %24 to double
%26 = fmul double %25, 0x3F749850170BE3C1
%27 = fadd double %4, 0x3FEB5DE4288E80BF
%28 = fptosi double %27 to i32
%29 = tail call i32 @cos(i32 %28)
%30 = sitofp i32 %29 to double
%31 = fmul double %26, %30
%32 = fmul double %21, 2.000000e+00
%33 = fptosi double %32 to i32
%34 = tail call i32 @sin(i32 %33)
%35 = sitofp i32 %34 to double
%36 = fmul double %35, 0x3EC7864C1DE7CF09
%37 = fmul double %27, 2.000000e+00
%38 = fptosi double %37 to i32
%39 = tail call i32 @cos(i32 %38)
%40 = sitofp i32 %39 to double
%41 = fmul double %36, %40
%42 = fmul double %21, 3.000000e+00
%43 = fptosi double %42 to i32
%44 = tail call i32 @sin(i32 %43)
%45 = sitofp i32 %44 to double
%46 = fmul double %45, 0x3E341E9DDA0CE6BD
%47 = fmul double %27, 3.000000e+00
%48 = fptosi double %47 to i32
%49 = tail call i32 @cos(i32 %48)
%50 = sitofp i32 %49 to double
%51 = fmul double %46, %50
%52 = fsub double %22, %31
%53 = fadd double %52, %41
%54 = fsub double %53, %51
%55 = fmul double %54, 0x41583CCE9F53C6C8
%56 = fmul double %9, %9
%57 = fmul double %56, %9
%58 = fmul double %57, %9
%59 = fmul double %58, %9
%60 = tail call double @tan(double %4)
%61 = tail call double @tan(double %4)
%62 = fmul double %60, %61
%63 = fmul double %62, %62
%64 = fadd double %55, -1.000000e+05
%65 = fmul double %16, 5.000000e-01
%66 = fmul double %65, %11
%67 = fmul double %66, %9
%68 = fdiv double %16, 2.400000e+01
%69 = fmul double %68, %11
%70 = fmul double %57, %69
%71 = fsub double 5.000000e+00, %62
%72 = tail call double @llvm.fmuladd.f64(double %20, double 9.000000e+00, double %71)
%73 = fmul double %70, %72
%74 = fdiv double %16, 7.200000e+02
%75 = fmul double %74, %11
%76 = fmul double %75, %59
%77 = tail call double @llvm.fmuladd.f64(double %62, double -5.800000e+01, double 6.100000e+01)
%78 = fadd double %77, %63
%79 = fmul double %76, %78
%80 = fmul double %16, %9
%81 = fdiv double %16, 6.000000e+00
%82 = fmul double %57, %81
%83 = fsub double %19, %62
%84 = fmul double %82, %83
%85 = fdiv double %16, 1.200000e+02
%86 = fmul double %85, %59
%87 = tail call double @llvm.fmuladd.f64(double %62, double -1.800000e+01, double 5.000000e+00)
%88 = fadd double %87, %63
%89 = tail call double @llvm.fmuladd.f64(double %20, double 1.400000e+01, double %88)
%90 = fmul double %62, -5.800000e+01
%91 = tail call double @llvm.fmuladd.f64(double %90, double %20, double %89)
%92 = fmul double %86, %91
%93 = fadd double %6, 0x3FA1DF46A2529D39
%94 = fmul double %93, %93
%95 = fmul double %93, %94
%96 = fmul double %93, %95
%97 = fmul double %93, %96
%98 = fmul double %93, %97
%99 = tail call double @llvm.fmuladd.f64(double %67, double %94, double %64)
%100 = tail call double @llvm.fmuladd.f64(double %73, double %96, double %99)
%101 = tail call double @llvm.fmuladd.f64(double %79, double %98, double %100)
%102 = tail call double @llvm.fmuladd.f64(double %80, double %93, double 4.000000e+05)
%103 = tail call double @llvm.fmuladd.f64(double %84, double %95, double %102)
%104 = tail call double @llvm.fmuladd.f64(double %92, double %97, double %103)
store double %104, double* %0
store double %101, double* %1
ret void
}