#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 log(double);
double sin(double);
void GPS_Math_Miller_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 R;
  double e2;
  double e4;
  double e6;
  double p2;
  double po2;
  double phis;
  double dlam;
  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;
  R = a * ((double)1.0 - e2 / (double)6.0 - (double)17.0 * e4 / (double)360.0 -
           (double)67.0 * e6 / (double)3024.0);
  if (M0 > 3.141592653589)
    M0 -= p2;
  phis = sin((double)0.8 * phi);
  dlam = lambda - M0;
  if (dlam > 3.141592653589)
    dlam -= p2;
  if (dlam < -3.141592653589)
    dlam += p2;
  *E = R * dlam + E0;
  *N =
      (R / (double)1.6) * log(((double)1.0 + phis) / ((double)1.0 - phis)) + N0;
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_Miller_LatLon_To_EN>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%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  0xea5(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x80(%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,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  0xe1e(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xe0a(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xdf6(%rip),%xmm2
mulsd  -0x70(%rbp),%xmm2
movsd  0xde1(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  0xdc9(%rip),%xmm2
mulsd  -0x78(%rbp),%xmm2
movsd  0xdb4(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xd8e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    128f <GPS_Math_Miller_LatLon_To_EN+0x15f>
movsd  -0x80(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdb1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xd35(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12ee <GPS_Math_Miller_LatLon_To_EN+0x1be>
movsd  -0x80(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xd5a(%rip),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    1319 <GPS_Math_Miller_LatLon_To_EN+0x1e9>
movsd  -0x80(%rbp),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x60(%rbp),%xmm0
movsd  0xd10(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xccc(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  0xcbc(%rip),%xmm1
subsd  -0x90(%rbp),%xmm1
ff
divsd  %xmm1,%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm2
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_Miller_LatLon_To_EN>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movsd  %xmm6,0x8(%rsp)
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x50(%rsp)
movsd  %xmm3,0x48(%rsp)
movsd  %xmm2,0x38(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x20(%rsp)
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x20(%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x38(%rsp),%xmm0
call   1030 <GPS_Math_Deg_To_Rad@plt>
movsd  0x10(%rsp),%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm3
movapd %xmm1,%xmm2
subsd  %xmm3,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm1,%xmm3
divsd  0xe3d(%rip),%xmm2
addsd  0xe3d(%rip),%xmm2
mulsd  0xe3d(%rip),%xmm1
divsd  0xe3d(%rip),%xmm1
mulsd  0xe3d(%rip),%xmm3
divsd  0xe3d(%rip),%xmm3
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm3
movsd  %xmm3,0x8(%rsp)
movsd  0xe2b(%rip),%xmm2
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe23(%rip),%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
movsd  0x40(%rsp),%xmm0
mulsd  0xe06(%rip),%xmm0
call   1040 <sin@plt>
movapd 0x20(%rsp),%xmm1
subsd  0x10(%rsp),%xmm1
movsd  0xddd(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xdd9(%rip),%xmm3
cmpltsd %xmm1,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm3
orpd   %xmm2,%xmm3
movsd  0xdd0(%rip),%xmm1
movapd %xmm3,%xmm2
cmpltsd 0xdcb(%rip),%xmm2
addsd  %xmm3,%xmm1
andpd  %xmm2,%xmm1
andnpd %xmm3,%xmm2
orpd   %xmm1,%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm2
addsd  0x48(%rsp),%xmm2
divsd  0xdab(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,(%rbx)
movapd %xmm0,%xmm1
movsd  0xd45(%rip),%xmm2
addsd  %xmm2,%xmm1
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
call   1050 <log@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_Miller_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
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
%29 = load double, double* %10
%30 = call double @GPS_Math_Deg_To_Rad(double %29)
store double %30, double* %10
%31 = load double, double* %11
%32 = call double @GPS_Math_Deg_To_Rad(double %31)
store double %32, double* %11
%33 = load double, double* %14
%34 = call double @GPS_Math_Deg_To_Rad(double %33)
store double %34, double* %14
store double 0x3FF921FB5444261E, double* %26
store double 0x401921FB5444261E, double* %25
%35 = load double, double* %17
%36 = load double, double* %17
%37 = fmul double %35, %36
store double %37, double* %19
%38 = load double, double* %18
%39 = load double, double* %18
%40 = fmul double %38, %39
store double %40, double* %20
%41 = load double, double* %19
%42 = load double, double* %20
%43 = fsub double %41, %42
%44 = load double, double* %19
%45 = fdiv double %43, %44
store double %45, double* %22
%46 = load double, double* %22
%47 = load double, double* %22
%48 = fmul double %46, %47
store double %48, double* %23
%49 = load double, double* %23
%50 = load double, double* %22
%51 = fmul double %49, %50
store double %51, double* %24
%52 = load double, double* %17
%53 = load double, double* %22
%54 = fdiv double %53, 6.000000e+00
%55 = fsub double 1.000000e+00, %54
%56 = load double, double* %23
%57 = fmul double 1.700000e+01, %56
%58 = fdiv double %57, 3.600000e+02
%59 = fsub double %55, %58
%60 = load double, double* %24
%61 = fmul double 6.700000e+01, %60
%62 = fdiv double %61, 3.024000e+03
%63 = fsub double %59, %62
%64 = fmul double %52, %63
store double %64, double* %21
%65 = load double, double* %14
%66 = fcmp ogt double %65, 0x400921FB5444261E
br i1 %66, label %67, label %71
67: ; preds = %9
%68 = load double, double* %25
%69 = load double, double* %14
%70 = fsub double %69, %68
store double %70, double* %14
br label %71
71: ; preds = %67, %9
%72 = load double, double* %10
%73 = fmul double 8.000000e-01, %72
%74 = call double @sin(double %73)
store double %74, double* %27
%75 = load double, double* %11
%76 = load double, double* %14
%77 = fsub double %75, %76
store double %77, double* %28
%78 = load double, double* %28
%79 = fcmp ogt double %78, 0x400921FB5444261E
br i1 %79, label %80, label %84
80: ; preds = %71
%81 = load double, double* %25
%82 = load double, double* %28
%83 = fsub double %82, %81
store double %83, double* %28
br label %84
84: ; preds = %80, %71
%85 = load double, double* %28
%86 = fcmp olt double %85, 0xC00921FB5444261E
br i1 %86, label %87, label %91
87: ; preds = %84
%88 = load double, double* %25
%89 = load double, double* %28
%90 = fadd double %89, %88
store double %90, double* %28
br label %91
91: ; preds = %87, %84
%92 = load double, double* %21
%93 = load double, double* %28
%94 = load double, double* %15
%95 = call double @llvm.fmuladd.f64(double %92, double %93, double %94)
%96 = load double*, double** %12
store double %95, double* %96
%97 = load double, double* %21
%98 = fdiv double %97, 1.600000e+00
%99 = load double, double* %27
%100 = fadd double 1.000000e+00, %99
%101 = load double, double* %27
%102 = fsub double 1.000000e+00, %101
%103 = fdiv double %100, %102
%104 = call double @log(double %103)
%105 = load double, double* %16
%106 = call double @llvm.fmuladd.f64(double %98, double %104, double %105)
%107 = load double*, double** %13
store double %106, double* %107
ret void
}

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