#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 GPS_Math_Deg_To_Rad(double);
double cos(double);
double fabs(double);
double pow(double, double);
double sin(double);
void GPS_Math_EckertVI_LatLon_To_EN(double phi, double lambda, double *E,
                                    double *N, double M0, double E0, double N0,
                                    double a, double b) {
  double a2;
  double b2;
  double e2;
  double e4;
  double e6;
  double Ra;
  double Rsq;
  double IRa;
  double po2;
  double p2;
  double phis;
  double theta;
  double dtheta;
  double dlam;
  double tol;
  lambda = GPS_Math_Deg_To_Rad(lambda);
  phi = GPS_Math_Deg_To_Rad(phi);
  M0 = GPS_Math_Deg_To_Rad(M0);
  p2 = (double)3.141592653589 * (double)2.;
  po2 = (double)3.141592653589 / (double)2.;
  if (M0 > 3.141592653589)
    M0 -= p2;
  a2 = a * a;
  b2 = b * b;
  e2 = (a2 - b2) / a2;
  e4 = e2 * e2;
  e6 = e2 * e4;
  Ra = a * ((double)1. - e2 / (double)6. - (double)17. * e4 / (double)360. -
            (double)67. * e6 / (double)3024.);
  Rsq = Ra / pow((double)2. + 3.141592653589, (double).5);
  IRa = (double)1. / Rsq;
  phis = sin(phi);
  theta = phi;
  dtheta = (double)1.;
  tol = (double)4.85e-10;
  dlam = lambda - M0;
  if (dlam > 3.141592653589)
    dlam -= p2;
  if (dlam < -3.141592653589)
    dlam += p2;
  while (fabs(dtheta) > tol) {
    dtheta = -(theta + sin(theta) - ((double)1. + po2) * phis) /
             ((double)1. + cos(theta));
    theta += dtheta;
  }
  *E = Rsq * dlam * ((double)1. + cos(theta)) + E0;
  *N = (double)2. * Rsq * theta + N0;
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_EckertVI_LatLon_To_EN>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
movsd  %xmm5,-0x40(%rbp)
movsd  %xmm6,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xe65(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xe4d(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xe30(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f0 <GPS_Math_EckertVI_LatLon_To_EN+0xb0>
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xe06(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xdc2(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xde6(%rip),%xmm2
mulsd  -0x68(%rbp),%xmm2
movsd  0xdd1(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  0xdb9(%rip),%xmm2
mulsd  -0x70(%rbp),%xmm2
movsd  0xda4(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xd6e(%rip),%xmm0
movsd  0xd6e(%rip),%xmm1
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xd3d(%rip),%xmm0
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xd09(%rip),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xcf1(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xcaf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1377 <GPS_Math_EckertVI_LatLon_To_EN+0x237>
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xce1(%rip),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    13a5 <GPS_Math_EckertVI_LatLon_To_EN+0x265>
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    13aa <GPS_Math_EckertVI_LatLon_To_EN+0x26a>
movsd  -0xb0(%rbp),%xmm0
ff
movaps 0xcb7(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    1497 <GPS_Math_EckertVI_LatLon_To_EN+0x357>
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  -0xd8(%rbp),%xmm1
ff
addsd  %xmm0,%xmm1
movsd  0xc24(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  0xbb6(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    13aa <GPS_Math_EckertVI_LatLon_To_EN+0x26a>
movsd  -0x80(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
movsd  0xb54(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xb7b(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_EckertVI_LatLon_To_EN>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movsd  %xmm6,0x20(%rsp)
movsd  %xmm5,0x38(%rsp)
movsd  %xmm4,0x60(%rsp)
movsd  %xmm3,0x58(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movaps %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  0xe71(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  %xmm1,%xmm1
movsd  %xmm1,0x50(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movapd 0x40(%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
movapd %xmm1,0x40(%rsp)
mulsd  0xe0a(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
nopl   0x0(%rax)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
xorpd  0xe3b(%rip),%xmm1
movapd %xmm1,0x20(%rsp)
call   1050 <cos@plt>
addsd  0xdd0(%rip),%xmm0
movapd 0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
andpd  0xe18(%rip),%xmm1
ucomisd 0xdb0(%rip),%xmm1
ja     1210 <GPS_Math_EckertVI_LatLon_To_EN+0xe0>
movsd  0xd86(%rip),%xmm0
movsd  0x8(%rsp),%xmm5
movapd %xmm5,%xmm1
divsd  0xd9c(%rip),%xmm1
movapd 0x40(%rsp),%xmm2
addsd  %xmm2,%xmm0
movsd  0x50(%rsp),%xmm4
mulsd  %xmm4,%xmm5
mulsd  0xd88(%rip),%xmm4
movsd  0xd68(%rip),%xmm3
addsd  %xmm3,%xmm1
divsd  0xd7c(%rip),%xmm4
addsd  %xmm1,%xmm4
mulsd  0xd78(%rip),%xmm5
divsd  0xd78(%rip),%xmm5
addsd  %xmm4,%xmm5
mulsd  0x38(%rsp),%xmm5
divsd  0xd6e(%rip),%xmm5
movsd  %xmm5,0x8(%rsp)
movsd  0xd18(%rip),%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movsd  0xd4f(%rip),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
cmpltsd 0xd46(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm2,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
addsd  0xcd6(%rip),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
mulsd  (%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @GPS_Math_EckertVI_LatLon_To_EN(double %0, double %1, double* %2, double* %3, double %4, double %5, double %6, double %7, double %8) {
%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
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
store double %0, double* %10
store double %1, double* %11
store double* %2, double** %12
store double* %3, double** %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
%34 = load double, double* %11
%35 = call double @GPS_Math_Deg_To_Rad(double %34)
store double %35, double* %11
%36 = load double, double* %10
%37 = call double @GPS_Math_Deg_To_Rad(double %36)
store double %37, double* %10
%38 = load double, double* %14
%39 = call double @GPS_Math_Deg_To_Rad(double %38)
store double %39, double* %14
store double 0x401921FB5444261E, double* %28
store double 0x3FF921FB5444261E, double* %27
%40 = load double, double* %14
%41 = fcmp ogt double %40, 0x400921FB5444261E
br i1 %41, label %42, label %46
42: ; preds = %9
%43 = load double, double* %28
%44 = load double, double* %14
%45 = fsub double %44, %43
store double %45, double* %14
br label %46
46: ; preds = %42, %9
%47 = load double, double* %17
%48 = load double, double* %17
%49 = fmul double %47, %48
store double %49, double* %19
%50 = load double, double* %18
%51 = load double, double* %18
%52 = fmul double %50, %51
store double %52, double* %20
%53 = load double, double* %19
%54 = load double, double* %20
%55 = fsub double %53, %54
%56 = load double, double* %19
%57 = fdiv double %55, %56
store double %57, double* %21
%58 = load double, double* %21
%59 = load double, double* %21
%60 = fmul double %58, %59
store double %60, double* %22
%61 = load double, double* %21
%62 = load double, double* %22
%63 = fmul double %61, %62
store double %63, double* %23
%64 = load double, double* %17
%65 = load double, double* %21
%66 = fdiv double %65, 6.000000e+00
%67 = fsub double 1.000000e+00, %66
%68 = load double, double* %22
%69 = fmul double 1.700000e+01, %68
%70 = fdiv double %69, 3.600000e+02
%71 = fsub double %67, %70
%72 = load double, double* %23
%73 = fmul double 6.700000e+01, %72
%74 = fdiv double %73, 3.024000e+03
%75 = fsub double %71, %74
%76 = fmul double %64, %75
store double %76, double* %24
%77 = load double, double* %24
%78 = call double @pow(double 0x401490FDAA22130F, double 5.000000e-01)
%79 = fdiv double %77, %78
store double %79, double* %25
%80 = load double, double* %25
%81 = fdiv double 1.000000e+00, %80
store double %81, double* %26
%82 = load double, double* %10
%83 = call double @sin(double %82)
store double %83, double* %29
%84 = load double, double* %10
store double %84, double* %30
store double 1.000000e+00, double* %31
store double 4.850000e-10, double* %33
%85 = load double, double* %11
%86 = load double, double* %14
%87 = fsub double %85, %86
store double %87, double* %32
%88 = load double, double* %32
%89 = fcmp ogt double %88, 0x400921FB5444261E
br i1 %89, label %90, label %94
90: ; preds = %46
%91 = load double, double* %28
%92 = load double, double* %32
%93 = fsub double %92, %91
store double %93, double* %32
br label %94
94: ; preds = %90, %46
%95 = load double, double* %32
%96 = fcmp olt double %95, 0xC00921FB5444261E
br i1 %96, label %97, label %101
97: ; preds = %94
%98 = load double, double* %28
%99 = load double, double* %32
%100 = fadd double %99, %98
store double %100, double* %32
br label %101
101: ; preds = %97, %94
br label %102
102: ; preds = %107, %101
%103 = load double, double* %31
%104 = call double @llvm.fabs.f64(double %103)
%105 = load double, double* %33
%106 = fcmp ogt double %104, %105
br i1 %106, label %107, label %125
107: ; preds = %102
%108 = load double, double* %30
%109 = load double, double* %30
%110 = call double @sin(double %109)
%111 = fadd double %108, %110
%112 = load double, double* %27
%113 = fadd double 1.000000e+00, %112
%114 = load double, double* %29
%115 = fneg double %113
%116 = call double @llvm.fmuladd.f64(double %115, double %114, double %111)
%117 = fneg double %116
%118 = load double, double* %30
%119 = call double @cos(double %118)
%120 = fadd double 1.000000e+00, %119
%121 = fdiv double %117, %120
store double %121, double* %31
%122 = load double, double* %31
%123 = load double, double* %30
%124 = fadd double %123, %122
store double %124, double* %30
br label %102
125: ; preds = %102
%126 = load double, double* %25
%127 = load double, double* %32
%128 = fmul double %126, %127
%129 = load double, double* %30
%130 = call double @cos(double %129)
%131 = fadd double 1.000000e+00, %130
%132 = load double, double* %15
%133 = call double @llvm.fmuladd.f64(double %128, double %131, double %132)
%134 = load double*, double** %12
store double %133, double* %134
%135 = load double, double* %25
%136 = fmul double 2.000000e+00, %135
%137 = load double, double* %30
%138 = load double, double* %16
%139 = call double @llvm.fmuladd.f64(double %136, double %137, double %138)
%140 = load double*, double** %13
store double %139, double* %140
ret void
}

LLVM IR (-O2):
define void @GPS_Math_EckertVI_LatLon_To_EN(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double %4, double %5, double %6, double %7, double %8) {
%10 = tail call double @GPS_Math_Deg_To_Rad(double %1)
%11 = tail call double @GPS_Math_Deg_To_Rad(double %0)
%12 = tail call double @GPS_Math_Deg_To_Rad(double %4)
%13 = fcmp ogt double %12, 0x400921FB5444261E
%14 = fadd double %12, 0xC01921FB5444261E
%15 = select i1 %13, double %14, double %12
%16 = fmul double %7, %7
%17 = fmul double %8, %8
%18 = fsub double %16, %17
%19 = fdiv double %18, %16
%20 = fmul double %19, %19
%21 = tail call double @sin(double %11)
%22 = fsub double %10, %15
br label %23
23: ; preds = %9, %23
%24 = phi double [ %11, %9 ], [ %32, %23 ]
%25 = tail call double @sin(double %24)
%26 = fadd double %24, %25
%27 = tail call double @llvm.fmuladd.f64(double %21, double 0xC00490FDAA22130F, double %26)
%28 = fneg double %27
%29 = tail call double @cos(double %24)
%30 = fadd double %29, 1.000000e+00
%31 = fdiv double %28, %30
%32 = fadd double %24, %31
%33 = tail call double @llvm.fabs.f64(double %31)
%34 = fcmp ogt double %33, 4.850000e-10
br i1 %34, label %23, label %35
35: ; preds = %23
%36 = fadd double %22, 0xC01921FB5444261E
%37 = fdiv double %19, 6.000000e+00
%38 = fsub double 1.000000e+00, %37
%39 = fmul double %20, 1.700000e+01
%40 = fdiv double %39, 3.600000e+02
%41 = fsub double %38, %40
%42 = fmul double %19, %20
%43 = fmul double %42, 6.700000e+01
%44 = fdiv double %43, 3.024000e+03
%45 = fsub double %41, %44
%46 = fmul double %45, %7
%47 = fdiv double %46, 0x400223DB3FA33D41
%48 = fcmp ogt double %22, 0x400921FB5444261E
%49 = select i1 %48, double %36, double %22
%50 = fcmp olt double %49, 0xC00921FB5444261E
%51 = fadd double %49, 0x401921FB5444261E
%52 = select i1 %50, double %51, double %49
%53 = fmul double %47, %52
%54 = tail call double @cos(double %32)
%55 = fadd double %54, 1.000000e+00
%56 = tail call double @llvm.fmuladd.f64(double %53, double %55, double %5)
store double %56, double* %2
%57 = fmul double %47, 2.000000e+00
%58 = tail call double @llvm.fmuladd.f64(double %57, double %32, double %6)
store double %58, double* %3
ret void
}