#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 cos(double);
double fabs(double);
int pow(double, int);
double sin(double);
double sqrt(double);
double tan(double);
void latlon2localcartesian(double lat, double lon, double lat0, double lon0,
                           double *northern, double *eastern) {
  double e, e2, N, T, C, A, M, M0;
  double phi, lambda, phi0, lambda0, dlambda;
  double k0 = 0.9996;
  double a = 6378137.0;
  double b = 6356752.3142;
  double pi = 3.141592653589793;
  phi = lat * pi / 180.0;
  lambda = lon * pi / 180.0;
  phi0 = lat0 * pi / 180.0;
  lambda0 = lon0 * pi / 180.0;
  e = sqrt(((a * a) - (b * b)) / (a * a));
  e2 = pow(e, 2.0) / (1.0 - pow(e, 2.0));
  N = a / sqrt(1.0 - pow(e, 2.0) * pow(sin(phi), 2.0));
  T = tan(phi);
  C = e2 * pow(cos(phi), 2.0);
  dlambda = lambda - lambda0;
  if (fabs(dlambda) > pi)
    dlambda = (dlambda > 0) ? dlambda - 2 * pi : dlambda + 2 * pi;
  A = dlambda * cos(phi);
  M = a * ((1.0 - pow(e, 2.0) / 4.0 - 3.0 * pow(e, 4.0) / 64.0 -
            5.0 * pow(e, 6.0) / 256.0) *
               phi -
           (3.0 * pow(e, 2.0) / 8.0 + 3.0 * pow(e, 4.0) / 32.0 +
            45.0 * pow(e, 6.0) / 1024.0) *
               sin(2.0 * phi) +
           (15.0 * pow(e, 4.0) / 256.0 + 45.0 * pow(e, 6.0) / 1024.0) *
               sin(4.0 * phi) -
           (35.0 * pow(e, 6.0) / 3072.0) * sin(6.0 * phi));
  M0 = a * ((1.0 - pow(e, 2.0) / 4.0 - 3.0 * pow(e, 4.0) / 64.0 -
             5.0 * pow(e, 6.0) / 256.0) *
                phi0 -
            (3.0 * pow(e, 2.0) / 8.0 + 3.0 * pow(e, 4.0) / 32.0 +
             45.0 * pow(e, 6.0) / 1024.0) *
                sin(2.0 * phi0) +
            (15.0 * pow(e, 4.0) / 256.0 + 45.0 * pow(e, 6.0) / 1024.0) *
                sin(4.0 * phi0) -
            (35.0 * pow(e, 6.0) / 3072.0) * sin(6.0 * phi0));
  *northern = (k0 * (M - M0 +
                     N * tan(phi) *
                         (pow(A, 2) / 2 +
                          (5 - T + 9 * C + 4 * pow(C, 2)) * pow(A, 4) / 24 +
                          (61 - 58 * T + pow(T, 2) + 600 * C - 330 * e2) *
                              pow(A, 6) / 720))) /
              1000;
  *eastern = (k0 * N *
              (A + (1 - T + C) * pow(A, 3) / 6 +
               (5 - 18 * T + pow(T, 2) + 72 * C - 58 * e2) * pow(A, 5) / 120)) /
             1000;
}


x86 assembly (clang, -O0):
<latlon2localcartesian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  0xe4c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  0xe2e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  0xe10(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm1
ff
mulsd  -0xb0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0xa8(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0xd8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xd40(%rip),%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %eax,-0xcc(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1030 <sin@plt>
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %eax,%ecx
mov    -0xcc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xce3(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1050 <cos@plt>
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0xc0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x80(%rbp),%xmm0
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movaps 0xc4d(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    142f <latlon2localcartesian+0x2df>
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13ff <latlon2localcartesian+0x2af>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    141f <latlon2localcartesian+0x2cf>
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x238(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x238(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x1d0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xc30(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xb7c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x230(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x230(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xc2d(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xc31(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x228(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x228(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xb66(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xbc2(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x208(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xbaa(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xba6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x220(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x220(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xb6f(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xb5b(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x218(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x218(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xb08(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xaf4(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
movsd  0xafc(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x210(%rbp),%xmm1
ff
movsd  -0x208(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x200(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xa89(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xa75(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x1f8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0xa3e(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xa2a(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1e8(%rbp)
ff
movsd  0xa0a(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x1f0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x1e8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1d8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0x9ba(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x9a6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1e0(%rbp)
ff
movsd  0x95a(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x1e0(%rbp),%xmm1
ff
movsd  -0x1d8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x1d0(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x168(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0x92a(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0x876(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1c8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x1c8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0x927(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0x92b(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x1c0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x1c0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0x860(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0x8bc(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x1a0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0x8a1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x89d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x1b8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0x866(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0x852(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1b0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x1b0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0x7ff(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0x7eb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  0x7f3(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
call   1030 <sin@plt>
movsd  -0x1a8(%rbp),%xmm1
ff
movsd  -0x1a0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x198(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0x77d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x769(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x190(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x190(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
movsd  0x732(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0x71e(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x180(%rbp)
ff
movsd  0x6fe(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
call   1030 <sin@plt>
movsd  -0x188(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x180(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x170(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0x6ab(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x697(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x178(%rbp)
ff
movsd  0x64b(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
call   1030 <sin@plt>
movsd  -0x178(%rbp),%xmm1
ff
movsd  -0x170(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x168(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x160(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x160(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x148(%rbp)
ff
movsd  0x578(%rip),%xmm1
subsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  0x59e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x158(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0x158(%rbp),%xmm0
ff
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x150(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x150(%rbp),%xmm1
ff
movsd  -0x148(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x52d(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0x4c8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x4fc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0x140(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0x4bc(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0x49f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
movsd  -0x138(%rbp),%xmm4
ff
movsd  -0x130(%rbp),%xmm3
ff
movsd  -0x128(%rbp),%xmm1
ff
movsd  -0x120(%rbp),%xmm2
ff
movsd  -0x118(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm5
mulsd  %xmm5,%xmm4
movsd  0x440(%rip),%xmm5
divsd  %xmm5,%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x3ec(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  0x386(%rip),%xmm0
subsd  -0x50(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
movsd  -0x110(%rbp),%xmm1
ff
movsd  -0x108(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
movsd  0x3a5(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  0x378(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x374(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0x100(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0x32c(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0x30f(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mov    $0x5,%edi
call   1060 <pow@plt>
movsd  -0xf8(%rbp),%xmm2
ff
movsd  -0xf0(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm2
movsd  0x2c0(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0x2a4(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<latlon2localcartesian>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  0xe9a(%rip),%xmm4
mulsd  %xmm4,%xmm0
movsd  0xe96(%rip),%xmm5
divsd  %xmm5,%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm4,%xmm2
divsd  %xmm5,%xmm2
movsd  %xmm2,0x28(%rsp)
unpcklpd %xmm3,%xmm1
mulpd  0xf7a(%rip),%xmm1
divpd  0xf82(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0xe64(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xe45(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe34(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0x38(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xe10(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mov    $0x2,%edi
call   1060 <pow@plt>
imul   %ebp,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xde5(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1247 <latlon2localcartesian+0xf7>
sqrtsd %xmm0,%xmm0
jmp    124c <latlon2localcartesian+0xfc>
call   1070 <sqrt@plt>
movsd  0xdcc(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x58(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movapd 0x10(%rsp),%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
subsd  %xmm0,%xmm3
xor    %eax,%eax
ucomisd 0xe4d(%rip),%xmm3
seta   %al
movapd 0xe72(%rip),%xmm0
andpd  %xmm3,%xmm0
lea    0xe77(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm1
movsd  0xd2a(%rip),%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm1
movsd  0xd41(%rip),%xmm0
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xcf8(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xcff(%rip),%xmm0
movsd  0xcdf(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xcc5(%rip),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xcd4(%rip),%xmm0
mulsd  0xcd4(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xc8c(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xcab(%rip),%xmm0
mulsd  0xcab(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xc53(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc62(%rip),%xmm0
mulsd  0xc7a(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xc25(%rip),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc34(%rip),%xmm0
mulsd  0xc54(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xbf2(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xc31(%rip),%xmm0
mulsd  0xc31(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xb95(%rip),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xbe4(%rip),%xmm0
mulsd  0xbb4(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xb67(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xba6(%rip),%xmm0
mulsd  0xba6(%rip),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xb9e(%rip),%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xb10(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xb6f(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xb64(%rip),%xmm0
call   1030 <sin@plt>
movsd  (%rsp),%xmm1
divsd  0xb5a(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
mulsd  0xad0(%rip),%xmm1
movsd  %xmm1,(%rsp)
movsd  0xab3(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xaba(%rip),%xmm0
movsd  0xa9a(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xa80(%rip),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xa8f(%rip),%xmm0
mulsd  0xa8f(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xa47(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xa66(%rip),%xmm0
mulsd  0xa66(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xa0e(%rip),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xa1d(%rip),%xmm0
mulsd  0xa35(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x9df(%rip),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x9ee(%rip),%xmm0
mulsd  0xa0e(%rip),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x9aa(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x9e9(%rip),%xmm0
mulsd  0x9e9(%rip),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
addsd  %xmm0,%xmm0
call   1030 <sin@plt>
mulsd  0x30(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x94a(%rip),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x999(%rip),%xmm0
mulsd  0x969(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x91b(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x95a(%rip),%xmm0
mulsd  0x95a(%rip),%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x956(%rip),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x30(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8c1(%rip),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x920(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0x914(%rip),%xmm0
call   1030 <sin@plt>
movsd  0x30(%rsp),%xmm1
divsd  0x909(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
mulsd  0x87f(%rip),%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <tan@plt>
mulsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x40(%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x854(%rip),%xmm1
subsd  0x50(%rsp),%xmm1
movsd  0x89e(%rip),%xmm2
movsd  0x48(%rsp),%xmm0
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x28(%rsp)
mov    $0x2,%edi
call   1060 <pow@plt>
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x40(%rsp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x28(%rsp),%xmm0
divsd  0x84d(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x50(%rsp),%xmm0
movapd %xmm0,%xmm1
mulsd  0x837(%rip),%xmm1
addsd  0x837(%rip),%xmm1
movsd  %xmm1,0x28(%rsp)
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x28(%rsp),%xmm0
movsd  0x81a(%rip),%xmm1
mulsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  0x810(%rip),%xmm0
mulsd  0x38(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x40(%rsp),%xmm0
mov    $0x6,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x28(%rsp),%xmm0
divsd  0x7e3(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  0x7d2(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  0x7ce(%rip),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x58(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x58(%rsp)
movsd  0x6ea(%rip),%xmm0
subsd  0x50(%rsp),%xmm0
addsd  0x48(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x40(%rsp),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
divsd  0x72b(%rip),%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x76f(%rip),%xmm1
movsd  0x50(%rsp),%xmm0
mulsd  %xmm0,%xmm1
addsd  0x6bd(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x48(%rsp),%xmm1
mulsd  0x740(%rip),%xmm1
addsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm1
movsd  0x38(%rsp),%xmm0
mulsd  0x6e8(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0x40(%rsp),%xmm0
mov    $0x5,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x38(%rsp),%xmm0
divsd  0x701(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x58(%rsp),%xmm0
divsd  0x6d5(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @latlon2localcartesian(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fmul double %0, 0x400921FB54442D18
%8 = fdiv double %7, 1.800000e+02
%9 = fmul double %2, 0x400921FB54442D18
%10 = fdiv double %9, 1.800000e+02
%11 = insertelement <2 x double> poison, double %1, i64 0
%12 = insertelement <2 x double> %11, double %3, i64 1
%13 = fmul <2 x double> %12, <double 0x400921FB54442D18, double 0x400921FB54442D18>
%14 = fdiv <2 x double> %13, <double 1.800000e+02, double 1.800000e+02>
%15 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%16 = sitofp i32 %15 to double
%17 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%18 = sitofp i32 %17 to double
%19 = fsub double 1.000000e+00, %18
%20 = fdiv double %16, %19
%21 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%22 = tail call double @sin(double %8)
%23 = tail call i32 @pow(double %22, i32 2)
%24 = mul nsw i32 %23, %21
%25 = sitofp i32 %24 to double
%26 = fsub double 1.000000e+00, %25
%27 = tail call double @sqrt(double %26)
%28 = fdiv double 0x415854A640000000, %27
%29 = tail call double @tan(double %8)
%30 = tail call double @cos(double %8)
%31 = tail call i32 @pow(double %30, i32 2)
%32 = sitofp i32 %31 to double
%33 = fmul double %20, %32
%34 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%35 = fsub <2 x double> %14, %34
%36 = extractelement <2 x double> %35, i64 0
%37 = tail call double @llvm.fabs.f64(double %36)
%38 = fcmp ogt double %37, 0x400921FB54442D18
%39 = fcmp ogt double %36, 0.000000e+00
%40 = select i1 %39, double 0xC01921FB54442D18, double 0x401921FB54442D18
%41 = select i1 %38, double %40, double -0.000000e+00
%42 = fadd double %36, %41
%43 = tail call double @cos(double %8)
%44 = fmul double %42, %43
%45 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%46 = sitofp i32 %45 to double
%47 = fmul double %46, 2.500000e-01
%48 = fsub double 1.000000e+00, %47
%49 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 4)
%50 = sitofp i32 %49 to double
%51 = fmul double %50, 3.000000e+00
%52 = fmul double %51, 1.562500e-02
%53 = fsub double %48, %52
%54 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%55 = sitofp i32 %54 to double
%56 = fmul double %55, 5.000000e+00
%57 = fmul double %56, 3.906250e-03
%58 = fsub double %53, %57
%59 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%60 = sitofp i32 %59 to double
%61 = fmul double %60, 3.000000e+00
%62 = fmul double %61, 1.250000e-01
%63 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 4)
%64 = sitofp i32 %63 to double
%65 = fmul double %64, 3.000000e+00
%66 = fmul double %65, 3.125000e-02
%67 = fadd double %62, %66
%68 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%69 = sitofp i32 %68 to double
%70 = fmul double %69, 4.500000e+01
%71 = fmul double %70, 0x3F50000000000000
%72 = fadd double %67, %71
%73 = fmul double %8, 2.000000e+00
%74 = tail call double @sin(double %73)
%75 = fneg double %72
%76 = fmul double %74, %75
%77 = tail call double @llvm.fmuladd.f64(double %58, double %8, double %76)
%78 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 4)
%79 = sitofp i32 %78 to double
%80 = fmul double %79, 1.500000e+01
%81 = fmul double %80, 3.906250e-03
%82 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%83 = sitofp i32 %82 to double
%84 = fmul double %83, 4.500000e+01
%85 = fmul double %84, 0x3F50000000000000
%86 = fadd double %81, %85
%87 = fmul double %8, 4.000000e+00
%88 = tail call double @sin(double %87)
%89 = tail call double @llvm.fmuladd.f64(double %86, double %88, double %77)
%90 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%91 = sitofp i32 %90 to double
%92 = fmul double %91, 3.500000e+01
%93 = fmul double %8, 6.000000e+00
%94 = tail call double @sin(double %93)
%95 = fdiv double %92, -3.072000e+03
%96 = tail call double @llvm.fmuladd.f64(double %95, double %94, double %89)
%97 = fmul double %96, 0x415854A640000000
%98 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%99 = sitofp i32 %98 to double
%100 = fmul double %99, 2.500000e-01
%101 = fsub double 1.000000e+00, %100
%102 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 4)
%103 = sitofp i32 %102 to double
%104 = fmul double %103, 3.000000e+00
%105 = fmul double %104, 1.562500e-02
%106 = fsub double %101, %105
%107 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%108 = sitofp i32 %107 to double
%109 = fmul double %108, 5.000000e+00
%110 = fmul double %109, 3.906250e-03
%111 = fsub double %106, %110
%112 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 2)
%113 = sitofp i32 %112 to double
%114 = fmul double %113, 3.000000e+00
%115 = fmul double %114, 1.250000e-01
%116 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 4)
%117 = sitofp i32 %116 to double
%118 = fmul double %117, 3.000000e+00
%119 = fmul double %118, 3.125000e-02
%120 = fadd double %115, %119
%121 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%122 = sitofp i32 %121 to double
%123 = fmul double %122, 4.500000e+01
%124 = fmul double %123, 0x3F50000000000000
%125 = fadd double %120, %124
%126 = fmul double %10, 2.000000e+00
%127 = tail call double @sin(double %126)
%128 = fneg double %125
%129 = fmul double %127, %128
%130 = tail call double @llvm.fmuladd.f64(double %111, double %10, double %129)
%131 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 4)
%132 = sitofp i32 %131 to double
%133 = fmul double %132, 1.500000e+01
%134 = fmul double %133, 3.906250e-03
%135 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%136 = sitofp i32 %135 to double
%137 = fmul double %136, 4.500000e+01
%138 = fmul double %137, 0x3F50000000000000
%139 = fadd double %134, %138
%140 = fmul double %10, 4.000000e+00
%141 = tail call double @sin(double %140)
%142 = tail call double @llvm.fmuladd.f64(double %139, double %141, double %130)
%143 = tail call i32 @pow(double 0x3FB4F21A3D398EA0, i32 6)
%144 = sitofp i32 %143 to double
%145 = fmul double %144, 3.500000e+01
%146 = fmul double %10, 6.000000e+00
%147 = tail call double @sin(double %146)
%148 = fdiv double %145, -3.072000e+03
%149 = tail call double @llvm.fmuladd.f64(double %148, double %147, double %142)
%150 = fmul double %149, 0x415854A640000000
%151 = fsub double %97, %150
%152 = tail call double @tan(double %8)
%153 = fmul double %28, %152
%154 = tail call i32 @pow(double %44, i32 2)
%155 = sdiv i32 %154, 2
%156 = sitofp i32 %155 to double
%157 = fsub double 5.000000e+00, %29
%158 = tail call double @llvm.fmuladd.f64(double %33, double 9.000000e+00, double %157)
%159 = tail call i32 @pow(double %33, i32 2)
%160 = shl nsw i32 %159, 2
%161 = sitofp i32 %160 to double
%162 = fadd double %158, %161
%163 = tail call i32 @pow(double %44, i32 4)
%164 = sitofp i32 %163 to double
%165 = fmul double %162, %164
%166 = fdiv double %165, 2.400000e+01
%167 = fadd double %166, %156
%168 = tail call double @llvm.fmuladd.f64(double %29, double -5.800000e+01, double 6.100000e+01)
%169 = tail call i32 @pow(double %29, i32 2)
%170 = sitofp i32 %169 to double
%171 = fadd double %168, %170
%172 = tail call double @llvm.fmuladd.f64(double %33, double 6.000000e+02, double %171)
%173 = tail call double @llvm.fmuladd.f64(double %20, double -3.300000e+02, double %172)
%174 = tail call i32 @pow(double %44, i32 6)
%175 = sitofp i32 %174 to double
%176 = fmul double %173, %175
%177 = fdiv double %176, 7.200000e+02
%178 = fadd double %167, %177
%179 = tail call double @llvm.fmuladd.f64(double %153, double %178, double %151)
%180 = fmul double %179, 9.996000e-01
%181 = fdiv double %180, 1.000000e+03
store double %181, double* %4
%182 = fmul double %28, 9.996000e-01
%183 = fsub double 1.000000e+00, %29
%184 = fadd double %183, %33
%185 = tail call i32 @pow(double %44, i32 3)
%186 = sitofp i32 %185 to double
%187 = fmul double %184, %186
%188 = fdiv double %187, 6.000000e+00
%189 = fadd double %44, %188
%190 = tail call double @llvm.fmuladd.f64(double %29, double -1.800000e+01, double 5.000000e+00)
%191 = tail call i32 @pow(double %29, i32 2)
%192 = sitofp i32 %191 to double
%193 = fadd double %190, %192
%194 = tail call double @llvm.fmuladd.f64(double %33, double 7.200000e+01, double %193)
%195 = tail call double @llvm.fmuladd.f64(double %20, double -5.800000e+01, double %194)
%196 = tail call i32 @pow(double %44, i32 5)
%197 = sitofp i32 %196 to double
%198 = fmul double %195, %197
%199 = fdiv double %198, 1.200000e+02
%200 = fadd double %189, %199
%201 = fmul double %182, %200
%202 = fdiv double %201, 1.000000e+03
store double %202, double* %5
ret void
}