#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 */
int asin(double);
double log(int);
double sin(double);
double eqvlat(double lat1, double lat2) {
  double slat1, slat2, al1, al2;
  slat1 = sin((3.14159265358979323846 / 180.) * lat1);
  slat2 = sin((3.14159265358979323846 / 180.) * lat2);
  if (slat1 < slat2) {
    double temp = slat1;
    slat1 = slat2;
    slat2 = temp;
  }
  if (slat1 == slat2)
    return asin(slat1) * (180. / 3.14159265358979323846);
  if (slat1 == -slat2)
    return 0.;
  if (slat1 >= 1.)
    return 90.;
  if (slat2 <= -1.)
    return -90.;
  {
    double tau = (slat1 - slat2) / (2. - slat1 - slat2);
    if (tau > 1.e-3) {
      al1 = log((1. - slat1) / (1. - slat2)) / (slat1 - slat2);
    } else {
      tau *= tau;
      al1 = -2. / (2. - slat1 - slat2) *
            (1. + tau * (1. / 3. + tau * (1. / 5. + tau * (1. / 7. + tau))));
    }
  }
  {
    double tau = (slat1 - slat2) / (2. + slat1 + slat2);
    if (tau > 1.e-3) {
      al2 = log((1. + slat1) / (1. + slat2)) / (slat1 - slat2);
    } else {
      tau *= tau;
      al2 = 2. / (2. + slat1 + slat2) *
            (1. + tau * (1. / 3. + tau * (1. / 5. + tau * (1. / 7. + tau))));
    }
  }
  return asin((al1 + al2) / (al1 - al2)) * (180. / 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<eqvlat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeb6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9f(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11a2 <eqvlat+0x72>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    11dc <eqvlat+0xac>
jp     11dc <eqvlat+0xac>
movsd  -0x20(%rbp),%xmm0
call   1040 <asin@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe7a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1494 <eqvlat+0x364>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
jne    121a <eqvlat+0xea>
jp     121a <eqvlat+0xea>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1494 <eqvlat+0x364>
movsd  -0x20(%rbp),%xmm0
movsd  0xde1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1243 <eqvlat+0x113>
movsd  0xe1f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1494 <eqvlat+0x364>
movsd  0xdc5(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1268 <eqvlat+0x138>
movsd  0xdf2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1494 <eqvlat+0x364>
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
subsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xd7e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12e3 <eqvlat+0x1b3>
movsd  0xd5c(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xd4f(%rip),%xmm1
subsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <log@plt>
movsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1365 <eqvlat+0x235>
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd26(%rip),%xmm1
subsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xd34(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
movsd  0xd11(%rip),%xmm4
addsd  -0x48(%rbp),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xcf8(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xce0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xcb0(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xca9(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  0xc81(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13e0 <eqvlat+0x2b0>
movsd  0xc5f(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xc52(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <log@plt>
movsd  -0x20(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1462 <eqvlat+0x332>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xc29(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  0xc17(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
movsd  0xc14(%rip),%xmm4
addsd  -0x50(%rbp),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xbfb(%rip),%xmm4
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movsd  0xbe3(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xbb3(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <asin@plt>
cvtsi2sd %eax,%xmm0
movsd  0xbbd(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqvlat>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
mulsd  0xebe(%rip),%xmm0
call   1030 <sin@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xea5(%rip),%xmm0
call   1030 <sin@plt>
movapd 0x10(%rsp),%xmm4
movapd %xmm0,%xmm3
maxsd  %xmm4,%xmm3
minsd  %xmm0,%xmm4
ucomisd %xmm4,%xmm3
jne    1194 <eqvlat+0x64>
jp     1194 <eqvlat+0x64>
movapd %xmm3,%xmm0
call   1040 <asin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xec6(%rip),%xmm0
jmp    11ac <eqvlat+0x7c>
movapd 0xec4(%rip),%xmm1
xorpd  %xmm4,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm3
jne    11b1 <eqvlat+0x81>
jp     11b1 <eqvlat+0x81>
add    $0x28,%rsp
ret
ucomisd 0xe57(%rip),%xmm3
jae    1256 <eqvlat+0x126>
movsd  0xe59(%rip),%xmm0
ucomisd %xmm4,%xmm0
jae    1263 <eqvlat+0x133>
movapd %xmm3,%xmm7
subsd  %xmm4,%xmm7
movsd  0xe47(%rip),%xmm5
movapd %xmm5,%xmm1
subsd  %xmm3,%xmm1
subsd  %xmm4,%xmm1
movapd %xmm7,%xmm0
divsd  %xmm1,%xmm0
ucomisd 0xe33(%rip),%xmm0
movsd  %xmm7,0x8(%rsp)
jbe    1270 <eqvlat+0x140>
movsd  0xe03(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm3,%xmm1
subsd  %xmm4,%xmm0
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
movsd  %xmm3,0x20(%rsp)
movapd %xmm4,0x10(%rsp)
call   1050 <log@plt>
movsd  0x8(%rsp),%xmm7
movsd  0xde8(%rip),%xmm5
movapd 0x10(%rsp),%xmm4
movsd  0x20(%rsp),%xmm3
movapd %xmm0,%xmm6
divsd  %xmm7,%xmm6
jmp    12b4 <eqvlat+0x184>
movsd  0xdaa(%rip),%xmm0
add    $0x28,%rsp
ret
movsd  0xdad(%rip),%xmm0
add    $0x28,%rsp
ret
mulsd  %xmm0,%xmm0
movsd  0xdbc(%rip),%xmm2
movsd  0xdbc(%rip),%xmm6
addsd  %xmm0,%xmm6
mulsd  %xmm0,%xmm6
addsd  0xdb4(%rip),%xmm6
divsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm6
addsd  0xdac(%rip),%xmm6
mulsd  %xmm0,%xmm6
addsd  0xd60(%rip),%xmm6
mulsd  %xmm2,%xmm6
movsd  0xd6c(%rip),%xmm2
addsd  %xmm3,%xmm2
addsd  %xmm4,%xmm2
movapd %xmm7,%xmm1
divsd  %xmm2,%xmm1
ucomisd 0xd5c(%rip),%xmm1
jbe    1307 <eqvlat+0x1d7>
movsd  0xd32(%rip),%xmm0
addsd  %xmm0,%xmm3
addsd  %xmm0,%xmm4
divsd  %xmm4,%xmm3
cvttsd2si %xmm3,%edi
movsd  %xmm6,0x10(%rsp)
call   1050 <log@plt>
movsd  0x10(%rsp),%xmm6
divsd  0x8(%rsp),%xmm0
jmp    1343 <eqvlat+0x213>
mulsd  %xmm1,%xmm1
movsd  0xd2d(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  0xd25(%rip),%xmm0
divsd  %xmm2,%xmm5
mulsd  %xmm1,%xmm0
addsd  0xd1d(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xcd1(%rip),%xmm0
mulsd  %xmm5,%xmm0
movapd %xmm6,%xmm3
addsd  %xmm0,%xmm3
subsd  %xmm0,%xmm6
divsd  %xmm6,%xmm3
jmp    117a <eqvlat+0x4a>

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

LLVM IR (-O2):
define double @eqvlat(double %0, double %1) {
%3 = fmul double %0, 0x3F91DF46A2529D39
%4 = tail call double @sin(double %3)
%5 = fmul double %1, 0x3F91DF46A2529D39
%6 = tail call double @sin(double %5)
%7 = fcmp olt double %4, %6
%8 = select i1 %7, double %6, double %4
%9 = select i1 %7, double %4, double %6
%10 = fcmp oeq double %8, %9
br i1 %10, label %65, label %11
11: ; preds = %2
%12 = fneg double %9
%13 = fcmp oeq double %8, %12
br i1 %13, label %70, label %14
14: ; preds = %11
%15 = fcmp ult double %8, 1.000000e+00
br i1 %15, label %16, label %70
16: ; preds = %14
%17 = fcmp ugt double %9, -1.000000e+00
br i1 %17, label %18, label %70
18: ; preds = %16
%19 = fsub double %8, %9
%20 = fsub double 2.000000e+00, %8
%21 = fsub double %20, %9
%22 = fdiv double %19, %21
%23 = fcmp ogt double %22, 1.000000e-03
br i1 %23, label %24, label %31
24: ; preds = %18
%25 = fsub double 1.000000e+00, %8
%26 = fsub double 1.000000e+00, %9
%27 = fdiv double %25, %26
%28 = fptosi double %27 to i32
%29 = tail call double @log(i32 %28)
%30 = fdiv double %29, %19
br label %39
31: ; preds = %18
%32 = fmul double %22, %22
%33 = fdiv double -2.000000e+00, %21
%34 = fadd double %32, 0x3FC2492492492492
%35 = tail call double @llvm.fmuladd.f64(double %32, double %34, double 2.000000e-01)
%36 = tail call double @llvm.fmuladd.f64(double %32, double %35, double 0x3FD5555555555555)
%37 = tail call double @llvm.fmuladd.f64(double %32, double %36, double 1.000000e+00)
%38 = fmul double %33, %37
br label %39
39: ; preds = %31, %24
%40 = phi double [ %30, %24 ], [ %38, %31 ]
%41 = fadd double %8, 2.000000e+00
%42 = fadd double %9, %41
%43 = fdiv double %19, %42
%44 = fcmp ogt double %43, 1.000000e-03
br i1 %44, label %45, label %52
45: ; preds = %39
%46 = fadd double %8, 1.000000e+00
%47 = fadd double %9, 1.000000e+00
%48 = fdiv double %46, %47
%49 = fptosi double %48 to i32
%50 = tail call double @log(i32 %49)
%51 = fdiv double %50, %19
br label %60
52: ; preds = %39
%53 = fmul double %43, %43
%54 = fdiv double 2.000000e+00, %42
%55 = fadd double %53, 0x3FC2492492492492
%56 = tail call double @llvm.fmuladd.f64(double %53, double %55, double 2.000000e-01)
%57 = tail call double @llvm.fmuladd.f64(double %53, double %56, double 0x3FD5555555555555)
%58 = tail call double @llvm.fmuladd.f64(double %53, double %57, double 1.000000e+00)
%59 = fmul double %54, %58
br label %60
60: ; preds = %52, %45
%61 = phi double [ %51, %45 ], [ %59, %52 ]
%62 = fadd double %40, %61
%63 = fsub double %40, %61
%64 = fdiv double %62, %63
br label %65
65: ; preds = %2, %60
%66 = phi double [ %64, %60 ], [ %8, %2 ]
%67 = tail call i32 @asin(double %66)
%68 = sitofp i32 %67 to double
%69 = fmul double %68, 0x404CA5DC1A63C1F8
br label %70
70: ; preds = %65, %16, %14, %11
%71 = phi double [ 0.000000e+00, %11 ], [ 9.000000e+01, %14 ], [ -9.000000e+01, %16 ], [ %69, %65 ]
ret double %71
}