#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 GPS_Math_Rad_To_Deg(double);
double atan(int /*<<< orphan*/);
double pow(double, double);
int /*<<< orphan*/ sinh(double);
void GPS_Math_Miller_EN_To_LatLon(double E, double N, double *phi,
                                  double *lambda, double M0, double E0,
                                  double N0, double a, double b) {
  double a2;
  double b2;
  double R;
  double e;
  double e2;
  double e4;
  double e6;
  double p2;
  double po2;
  double dx;
  double dy;
  dx = E - E0;
  dy = N - N0;
  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;
  e = pow(e2, (double)0.5);
  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;
  *phi = atan(sinh((double)0.8 * dy / R)) / (double)0.8;
  *lambda = M0 + dx / R;
  if (*phi > po2)
    *phi = po2;
  else if (*phi < -po2)
    *phi = -po2;
  if (*lambda > 3.141592653589)
    *lambda -= p2;
  if (*lambda < -3.141592653589)
    *lambda += p2;
  if (*lambda > 3.141592653589)
    *lambda = 3.141592653589;
  else if (*lambda < -3.141592653589)
    *lambda = -3.141592653589;
  *lambda = GPS_Math_Rad_To_Deg(*lambda);
  *phi = GPS_Math_Rad_To_Deg(*phi);
  return;
}


x86 assembly (clang, -O0):
<GPS_Math_Miller_EN_To_LatLon>:
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
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1040 <GPS_Math_Deg_To_Rad@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
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,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  0xe02(%rip),%xmm1
call   1070 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  0xdde(%rip),%xmm1
divsd  %xmm1,%xmm2
movsd  0xdca(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  0xdb6(%rip),%xmm2
mulsd  -0x78(%rbp),%xmm2
movsd  0xda1(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  0xd89(%rip),%xmm2
mulsd  -0x80(%rbp),%xmm2
movsd  0xd74(%rip),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xd4e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12d2 <GPS_Math_Miller_EN_To_LatLon+0x182>
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xd76(%rip),%xmm0
mulsd  -0xa0(%rbp),%xmm0
ff
divsd  -0x60(%rbp),%xmm0
call   1030 <sinh@plt>
mov    %eax,%edi
call   1050 <atan@plt>
movsd  0xd55(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm1
ff
divsd  -0x60(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd -0x90(%rbp),%xmm0
ff
jbe    1350 <GPS_Math_Miller_EN_To_LatLon+0x200>
movsd  -0x90(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13ad <GPS_Math_Miller_EN_To_LatLon+0x25d>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    13a8 <GPS_Math_Miller_EN_To_LatLon+0x258>
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13ad <GPS_Math_Miller_EN_To_LatLon+0x25d>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc43(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13df <GPS_Math_Miller_EN_To_LatLon+0x28f>
movsd  -0x88(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xc6d(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1409 <GPS_Math_Miller_EN_To_LatLon+0x2b9>
movsd  -0x88(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xbe7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1438 <GPS_Math_Miller_EN_To_LatLon+0x2e8>
mov    -0x20(%rbp),%rax
movsd  0xbd1(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1463 <GPS_Math_Miller_EN_To_LatLon+0x313>
mov    -0x20(%rbp),%rax
movsd  0xc14(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    145e <GPS_Math_Miller_EN_To_LatLon+0x30e>
mov    -0x20(%rbp),%rax
movsd  0xbfe(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1463 <GPS_Math_Miller_EN_To_LatLon+0x313>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <GPS_Math_Rad_To_Deg@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <GPS_Math_Rad_To_Deg@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPS_Math_Miller_EN_To_LatLon>:
push   %r14
push   %rbx
sub    $0x68,%rsp
movsd  %xmm6,0x8(%rsp)
movsd  %xmm5,0x10(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
subsd  %xmm3,%xmm0
movapd %xmm0,0x50(%rsp)
subsd  %xmm4,%xmm1
movsd  %xmm1,0x38(%rsp)
movaps %xmm2,%xmm0
call   1040 <GPS_Math_Deg_To_Rad@plt>
movaps %xmm0,0x40(%rsp)
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm0,0x28(%rsp)
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x30(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xe2c(%rip),%xmm1
call   1070 <pow@plt>
movsd  0x28(%rsp),%xmm0
divsd  0xe21(%rip),%xmm0
addsd  0xe21(%rip),%xmm0
movapd %xmm0,%xmm1
movsd  0x30(%rsp),%xmm0
mulsd  0xe17(%rip),%xmm0
divsd  0xe17(%rip),%xmm0
addsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xe09(%rip),%xmm0
divsd  0xe09(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
movapd %xmm0,%xmm3
movsd  %xmm0,0x8(%rsp)
movsd  0xdf5(%rip),%xmm0
movapd 0x40(%rsp),%xmm2
addsd  %xmm2,%xmm0
movsd  0xdeb(%rip),%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
mulsd  0xdce(%rip),%xmm0
divsd  %xmm3,%xmm0
call   1030 <sinh@plt>
mov    %eax,%edi
call   1050 <atan@plt>
movapd 0x50(%rsp),%xmm2
divsd  0xdb0(%rip),%xmm0
movsd  %xmm0,(%rbx)
divsd  0x8(%rsp),%xmm2
addsd  0x10(%rsp),%xmm2
movsd  %xmm2,(%r14)
movsd  (%rbx),%xmm1
movsd  0xd97(%rip),%xmm0
ucomisd %xmm0,%xmm1
ja     12cd <GPS_Math_Miller_EN_To_LatLon+0x17d>
movsd  0xd91(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    12d6 <GPS_Math_Miller_EN_To_LatLon+0x186>
movsd  %xmm0,(%rbx)
movsd  (%r14),%xmm2
movsd  0xd62(%rip),%xmm3
ucomisd %xmm3,%xmm2
movsd  0xd4e(%rip),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm3,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movsd  0xd55(%rip),%xmm2
movapd %xmm1,%xmm0
cmpltsd 0xd50(%rip),%xmm0
addsd  %xmm1,%xmm2
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
ja     1340 <GPS_Math_Miller_EN_To_LatLon+0x1f0>
movsd  0xd36(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1340 <GPS_Math_Miller_EN_To_LatLon+0x1f0>
ucomisd %xmm3,%xmm0
jbe    134b <GPS_Math_Miller_EN_To_LatLon+0x1fb>
jmp    1359 <GPS_Math_Miller_EN_To_LatLon+0x209>
movsd  %xmm0,(%r14)
ucomisd %xmm3,%xmm0
ja     1359 <GPS_Math_Miller_EN_To_LatLon+0x209>
movsd  0xd15(%rip),%xmm3
ucomisd %xmm0,%xmm3
jbe    1362 <GPS_Math_Miller_EN_To_LatLon+0x212>
movsd  %xmm3,(%r14)
movapd %xmm3,%xmm0
call   1060 <GPS_Math_Rad_To_Deg@plt>
movsd  %xmm0,(%r14)
movsd  (%rbx),%xmm0
call   1060 <GPS_Math_Rad_To_Deg@plt>
movsd  %xmm0,(%rbx)
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @GPS_Math_Miller_EN_To_LatLon(double %0, double %1, double* nocapture %2, double* nocapture %3, double %4, double %5, double %6, double %7, double %8) {
%10 = fsub double %0, %5
%11 = fsub double %1, %6
%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 = tail call double @pow(double %16, double 5.000000e-01)
%20 = fdiv double %16, 6.000000e+00
%21 = fsub double 1.000000e+00, %20
%22 = fmul double %17, 1.700000e+01
%23 = fdiv double %22, 3.600000e+02
%24 = fsub double %21, %23
%25 = fmul double %18, 6.700000e+01
%26 = fdiv double %25, 3.024000e+03
%27 = fsub double %24, %26
%28 = fmul double %27, %7
%29 = fcmp ogt double %12, 0x400921FB5444261E
%30 = fadd double %12, 0xC01921FB5444261E
%31 = select i1 %29, double %30, double %12
%32 = fmul double %11, 8.000000e-01
%33 = fdiv double %32, %28
%34 = tail call i32 @sinh(double %33)
%35 = tail call double @atan(i32 %34)
%36 = fdiv double %35, 8.000000e-01
store double %36, double* %2
%37 = fdiv double %10, %28
%38 = fadd double %37, %31
store double %38, double* %3
%39 = load double, double* %2
%40 = fcmp ogt double %39, 0x3FF921FB5444261E
br i1 %40, label %43, label %41
41: ; preds = %9
%42 = fcmp olt double %39, 0xBFF921FB5444261E
br i1 %42, label %43, label %46
43: ; preds = %41, %9
%44 = phi double [ 0x3FF921FB5444261E, %9 ], [ 0xBFF921FB5444261E, %41 ]
store double %44, double* %2
%45 = load double, double* %3
br label %46
46: ; preds = %43, %41
%47 = phi double [ %45, %43 ], [ %38, %41 ]
%48 = fcmp ogt double %47, 0x400921FB5444261E
%49 = fadd double %47, 0xC01921FB5444261E
%50 = select i1 %48, double %49, double %47
%51 = fcmp olt double %50, 0xC00921FB5444261E
%52 = fadd double %50, 0x401921FB5444261E
%53 = select i1 %51, double %52, double %50
%54 = or i1 %48, %51
br i1 %54, label %55, label %56
55: ; preds = %46
store double %53, double* %3
br label %56
56: ; preds = %46, %55
%57 = fcmp ogt double %53, 0x400921FB5444261E
br i1 %57, label %60, label %58
58: ; preds = %56
%59 = fcmp olt double %53, 0xC00921FB5444261E
br i1 %59, label %60, label %62
60: ; preds = %58, %56
%61 = phi double [ 0x400921FB5444261E, %56 ], [ 0xC00921FB5444261E, %58 ]
store double %61, double* %3
br label %62
62: ; preds = %60, %58
%63 = phi double [ %53, %58 ], [ %61, %60 ]
%64 = tail call double @GPS_Math_Rad_To_Deg(double %63)
store double %64, double* %3
%65 = load double, double* %2
%66 = tail call double @GPS_Math_Rad_To_Deg(double %65)
store double %66, double* %2
ret void
}