#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_Mollweide_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 p2;
  double po2;
  double Ra;
  double sRa2;
  double sRa8;
  double ps;
  double dlam;
  double theta;
  double thetap;
  double d;
  double tol;
  phi = GPS_Math_Deg_To_Rad(phi);
  lambda = GPS_Math_Deg_To_Rad(lambda);
  M0 = GPS_Math_Deg_To_Rad(M0);
  po2 = (double)3.141592653589 / (double)2.0;
  p2 = (double)3.141592653589 * (double)2.0;
  a2 = a * a;
  b2 = b * b;
  e2 = (a2 - b2) / a2;
  e4 = e2 * e2;
  e6 = e4 * e2;
  Ra = a * ((double)1.0 - e2 / (double)6.0 - (double)17.0 * e4 / (double)360.0 -
            (double)67.0 * e6 / (double)3024.0);
  sRa2 = pow((double)2., (double).5) * Ra;
  sRa8 = pow((double)8., (double).5) * Ra;
  if (M0 > 3.141592653589)
    M0 -= p2;
  ps = sin(phi) * (double)3.141592653589;
  d = (double)0.1745329;
  tol = (double)4.85e-10;
  thetap = phi;
  dlam = lambda - M0;
  if (dlam > 3.141592653589)
    dlam -= p2;
  if (dlam < -3.141592653589)
    dlam += p2;
  while (fabs(d) > tol) {
    d = -(thetap + sin(thetap) - ps) / ((double)1. + cos(thetap));
    thetap += d;
  }
  theta = thetap / (double)2.;
  *E = (sRa8 / (double)3.141592653589) * dlam * cos(theta) + E0;
  *N = sRa2 * sin(theta) + N0;
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_Mollweide_LatLon_To_EN>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%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  -0x8(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe98(%rip),%xmm0
movsd  %xmm0,-0x78(%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  -0x68(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xe29(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xe15(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xe01(%rip),%xmm2
mulsd  -0x68(%rbp),%xmm2
movsd  0xdec(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  0xdd4(%rip),%xmm2
mulsd  -0x70(%rbp),%xmm2
movsd  0xdbf(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xd9b(%rip),%xmm0
movsd  0xd8b(%rip),%xmm1
call   1060 <pow@plt>
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xd66(%rip),%xmm0
movsd  0xd66(%rip),%xmm1
call   1060 <pow@plt>
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  0xd34(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12e9 <GPS_Math_Mollweide_LatLon_To_EN+0x1a9>
movsd  -0x78(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  0xd05(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xd59(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xd41(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  0xcaa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1379 <GPS_Math_Mollweide_LatLon_To_EN+0x239>
movsd  -0x78(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xcef(%rip),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    13a4 <GPS_Math_Mollweide_LatLon_To_EN+0x264>
movsd  -0x78(%rbp),%xmm0
addsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    13a9 <GPS_Math_Mollweide_LatLon_To_EN+0x269>
movsd  -0xc0(%rbp),%xmm0
ff
movaps 0xcc8(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xc8(%rbp),%xmm0
ff
jbe    146a <GPS_Math_Mollweide_LatLon_To_EN+0x32a>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  0xc03(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    13a9 <GPS_Math_Mollweide_LatLon_To_EN+0x269>
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xb9e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xb6a(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xe8(%rbp),%xmm0
ff
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xe0(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_Mollweide_LatLon_To_EN>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movsd  %xmm6,0x10(%rsp)
movsd  %xmm5,0x28(%rsp)
movsd  %xmm4,0x50(%rsp)
movsd  %xmm3,0x48(%rsp)
movsd  %xmm2,0x20(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movaps %xmm0,0x30(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movsd  0x10(%rsp),%xmm3
mulsd  %xmm3,%xmm3
movapd %xmm1,%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
mulsd  %xmm2,%xmm2
movsd  %xmm2,0x40(%rsp)
movsd  0xe42(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe3e(%rip),%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0xe15(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd 0x30(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm1
subsd  0x20(%rsp),%xmm1
xorpd  0xe3b(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
call   1050 <cos@plt>
addsd  0xdc8(%rip),%xmm0
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
andpd  0xe18(%rip),%xmm1
ucomisd 0xda8(%rip),%xmm1
ja     1210 <GPS_Math_Mollweide_LatLon_To_EN+0xe0>
movsd  0xd86(%rip),%xmm0
movsd  0x8(%rsp),%xmm4
movapd %xmm4,%xmm1
divsd  0xd94(%rip),%xmm1
addsd  0xd7c(%rip),%xmm1
movapd 0x30(%rsp),%xmm2
addsd  %xmm2,%xmm0
movsd  0x40(%rsp),%xmm3
mulsd  %xmm3,%xmm4
mulsd  0xd78(%rip),%xmm3
divsd  0xd78(%rip),%xmm3
mulsd  0xd78(%rip),%xmm4
addsd  %xmm1,%xmm3
divsd  0xd74(%rip),%xmm4
addsd  %xmm3,%xmm4
mulsd  0x28(%rsp),%xmm4
movsd  0xd2a(%rip),%xmm3
movapd %xmm3,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movsd  0xd4d(%rip),%xmm0
movapd %xmm1,%xmm2
cmpltsd 0xd48(%rip),%xmm2
addsd  %xmm1,%xmm0
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movsd  0xd38(%rip),%xmm1
mulsd  %xmm4,%xmm1
mulsd  0xd34(%rip),%xmm4
movsd  %xmm4,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xd29(%rip),%xmm0
movsd  %xmm0,(%rsp)
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x48(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

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

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