#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 sin(double);
void GPS_Math_Orthog_LatLon_To_EN(double phi, double lambda, double *E,
                                  double *N, double phi0, double lambda0,
                                  double E0, double N0, double a, double b) {
  double p2;
  double po2;
  double a2;
  double b2;
  double e2;
  double e4;
  double e6;
  double Ra;
  double phi0s;
  double phi0c;
  double phis;
  double phic;
  double dlam;
  double clc;
  double cc;
  lambda = GPS_Math_Deg_To_Rad(lambda);
  phi = GPS_Math_Deg_To_Rad(phi);
  phi0 = GPS_Math_Deg_To_Rad(phi0);
  lambda0 = GPS_Math_Deg_To_Rad(lambda0);
  p2 = (double)3.141592653589 * (double)2.0;
  po2 = (double)3.141592653589 / (double)2.0;
  if (lambda0 > 3.141592653589)
    lambda0 -= 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.);
  phi0s = sin(phi0);
  phi0c = cos(phi0);
  dlam = lambda - lambda0;
  if (dlam > 3.141592653589)
    dlam -= p2;
  if (dlam < -3.141592653589)
    dlam += p2;
  phis = sin(phi);
  phic = cos(phi);
  clc = phic * cos(dlam);
  cc = phi0s * phis + phi0c * clc;
  *E = Ra * phic * sin(dlam) + E0;
  *N = Ra * (phi0c * phis - phi0s * clc) + N0;
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_Orthog_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  %xmm7,-0x50(%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  -0x30(%rbp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe61(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11eb <GPS_Math_Orthog_LatLon_To_EN+0xbb>
movsd  -0x58(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
movsd  0xdf0(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xddc(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xdc8(%rip),%xmm2
mulsd  -0x80(%rbp),%xmm2
movsd  0xdb3(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  0xd9b(%rip),%xmm2
mulsd  -0x88(%rbp),%xmm2
ff
movsd  0xd83(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  0xd11(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1312 <GPS_Math_Orthog_LatLon_To_EN+0x1e2>
movsd  -0x58(%rbp),%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xd2e(%rip),%xmm0
ucomisd -0xb8(%rbp),%xmm0
ff
jbe    133d <GPS_Math_Orthog_LatLon_To_EN+0x20d>
movsd  -0x58(%rbp),%xmm0
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0xa8(%rbp),%xmm3
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0xc0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%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_Orthog_LatLon_To_EN>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movsd  %xmm7,0x8(%rsp)
movsd  %xmm6,0x28(%rsp)
movsd  %xmm5,0x60(%rsp)
movsd  %xmm4,0x58(%rsp)
movsd  %xmm3,0x20(%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  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  0xe5a(%rip),%xmm2
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe52(%rip),%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
movapd %xmm2,%xmm5
movsd  0x28(%rsp),%xmm4
movapd %xmm4,%xmm0
mulsd  %xmm4,%xmm0
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm3
movapd %xmm0,%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm2,%xmm3
mulsd  %xmm0,%xmm3
divsd  0xe0d(%rip),%xmm2
addsd  0xe0d(%rip),%xmm2
mulsd  0xe0d(%rip),%xmm0
divsd  0xe0d(%rip),%xmm0
orpd   %xmm1,%xmm5
movapd %xmm5,0x30(%rsp)
addsd  %xmm2,%xmm0
mulsd  0xdff(%rip),%xmm3
divsd  0xdff(%rip),%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm4,%xmm3
movsd  %xmm3,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0x40(%rsp),%xmm0
subsd  0x30(%rsp),%xmm0
movsd  0xd83(%rip),%xmm2
addsd  %xmm0,%xmm2
movsd  0xd7f(%rip),%xmm1
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movsd  0xd9e(%rip),%xmm0
movapd %xmm1,%xmm2
cmpltsd 0xd99(%rip),%xmm2
addsd  %xmm1,%xmm0
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1050 <cos@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x30(%rsp)
mulsd  0x8(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  (%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x30(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
movsd  0x40(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
subsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

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