#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 M_PI;
double atan(double);
scalar_t__ fabs(double);
scalar_t__ pow(double, double);
double sqrt(scalar_t__);
void tilt_angle_e(double lon_1, double lon_0, double lat_1, double lat_0,
                  double dlon_1, double dlon_0, double dlat_1, double dlat_0,
                  double *tilt, double *dtilt) {
  double g;
  double dgdlat_1, dgdlat_0;
  double dgdlon_1, dgdlon_0;
  double dtiltdlat_1, dtiltdlat_0;
  double dtiltdlon_1, dtiltdlon_0;
  if ((lat_1 == -1000) || (lat_0 == -1000) || (lon_1 == -1000) ||
      (lon_0 == -1000)) {
    *tilt = 0.0;
    *dtilt = 0.0;
  } else {
    g = (double)fabs((lat_1 - lat_0) / (lon_1 - lon_0));
    *tilt = 180.0 / M_PI * atan(g);
    dgdlat_1 = 1.0 / (lon_1 - lon_0);
    dgdlat_0 = -1.0 / (lat_1 - lat_0);
    dgdlon_1 = -1.0 * g / (lon_1 - lon_0);
    dgdlon_0 = g / (lat_1 - lat_0);
    dtiltdlat_1 = (1.0 / (1.0 + g * g)) * dgdlat_1;
    dtiltdlat_0 = (1.0 / (1.0 + g * g)) * dgdlat_0;
    dtiltdlon_1 = (1.0 / (1.0 + g * g)) * dgdlon_1;
    dtiltdlon_0 = (1.0 / (1.0 + g * g)) * dgdlon_0;
    *dtilt =
        180.0 / M_PI *
        sqrt(pow(dtiltdlat_1 * dlat_1, 2.0) + pow(dtiltdlat_0 * dlat_0, 2.0) +
             pow(dtiltdlon_1 * dlon_1, 2.0) + pow(dtiltdlon_0 * dlon_0, 2.0));
    if (lon_1 > lon_0) {
      if (lat_1 < lat_0) {
        *tilt *= -1.0;
      }
    } else {
      if (lat_0 < lat_1) {
        *tilt *= -1.0;
      }
    }
  }
  return;
}


x86 assembly (clang, -O0):
<tilt_angle_e>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe78(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    119d <tilt_angle_e+0x5d>
jp     119d <tilt_angle_e+0x5d>
jmp    11fe <tilt_angle_e+0xbe>
movsd  -0x20(%rbp),%xmm0
movsd  0xe56(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bf <tilt_angle_e+0x7f>
jp     11bf <tilt_angle_e+0x7f>
jmp    11fe <tilt_angle_e+0xbe>
movsd  -0x8(%rbp),%xmm0
movsd  0xe34(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11e1 <tilt_angle_e+0xa1>
jp     11e1 <tilt_angle_e+0xa1>
jmp    11fe <tilt_angle_e+0xbe>
movsd  -0x10(%rbp),%xmm0
movsd  0xe12(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1219 <tilt_angle_e+0xd9>
jp     1219 <tilt_angle_e+0xd9>
mov    -0x48(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    14f7 <tilt_angle_e+0x3b7>
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <fabs@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xdc8(%rip),%xmm0
mov    0x2d99(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xd8a(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  0xd77(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd66(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xd18(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd0c(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xce8(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xcdc(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xcb5(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xca9(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x58(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xc82(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xc76(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xc55(%rip),%xmm0
mov    0x2c26(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xc28(%rip),%xmm1
call   1050 <pow@plt>
mov    %rax,-0xb8(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x40(%rbp),%xmm0
movsd  0xc07(%rip),%xmm1
call   1050 <pow@plt>
mov    %rax,%rcx
mov    -0xb8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xb0(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
mulsd  -0x28(%rbp),%xmm0
movsd  0xbd9(%rip),%xmm1
call   1050 <pow@plt>
mov    %rax,%rcx
mov    -0xb0(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
mulsd  -0x30(%rbp),%xmm0
movsd  0xbab(%rip),%xmm1
call   1050 <pow@plt>
mov    -0xa8(%rbp),%rdi
add    %rax,%rdi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    14c5 <tilt_angle_e+0x385>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14c0 <tilt_angle_e+0x380>
mov    -0x48(%rbp),%rax
movsd  0xb68(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    14f2 <tilt_angle_e+0x3b2>
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14ed <tilt_angle_e+0x3ad>
mov    -0x48(%rbp),%rax
movsd  0xb3b(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    14f2 <tilt_angle_e+0x3b2>
jmp    14f7 <tilt_angle_e+0x3b7>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tilt_angle_e>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
ucomisd 0xea6(%rip),%xmm1
jne    1162 <tilt_angle_e+0x22>
jnp    1353 <tilt_angle_e+0x213>
ucomisd 0xe96(%rip),%xmm0
jne    1172 <tilt_angle_e+0x32>
jnp    1353 <tilt_angle_e+0x213>
ucomisd 0xe86(%rip),%xmm2
jne    1182 <tilt_angle_e+0x42>
jnp    1353 <tilt_angle_e+0x213>
ucomisd 0xe76(%rip),%xmm3
jne    1192 <tilt_angle_e+0x52>
jnp    1353 <tilt_angle_e+0x213>
movapd %xmm2,%xmm8
subsd  %xmm3,%xmm8
movsd  %xmm8,(%rsp)
movapd %xmm0,%xmm9
subsd  %xmm1,%xmm9
movsd  %xmm9,0x30(%rsp)
movsd  %xmm0,0x78(%rsp)
movapd %xmm8,%xmm0
divsd  %xmm9,%xmm0
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x70(%rsp)
movsd  %xmm5,0x68(%rsp)
movsd  %xmm4,0x60(%rsp)
movsd  %xmm7,0x58(%rsp)
movsd  %xmm6,0x50(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movapd %xmm0,0x20(%rsp)
mov    0x2de1(%rip),%rbx
movsd  0xdf9(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
divsd  (%rbx),%xmm1
movsd  %xmm1,0x48(%rsp)
call   1040 <atan@plt>
mulsd  0x48(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0xdd9(%rip),%xmm2
movapd %xmm2,%xmm0
movsd  0x30(%rsp),%xmm3
divsd  %xmm3,%xmm0
movsd  0xdcb(%rip),%xmm1
movsd  (%rsp),%xmm5
divsd  %xmm5,%xmm1
movapd %xmm1,%xmm4
movapd 0xdce(%rip),%xmm1
movapd 0x20(%rsp),%xmm6
xorpd  %xmm6,%xmm1
divsd  %xmm3,%xmm1
movapd %xmm1,%xmm3
movapd %xmm6,%xmm1
divsd  %xmm5,%xmm1
mulsd  %xmm6,%xmm6
addsd  %xmm2,%xmm6
divsd  %xmm6,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm4
movsd  %xmm4,0x20(%rsp)
mulsd  %xmm2,%xmm3
movapd %xmm3,0x30(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
movsd  0x8(%rsp),%xmm1
divsd  (%rbx),%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  0x50(%rsp),%xmm0
movsd  0xd59(%rip),%xmm1
call   1050 <pow@plt>
mov    %rax,%rbx
movsd  0x20(%rsp),%xmm0
mulsd  0x58(%rsp),%xmm0
movsd  0xd3d(%rip),%xmm1
call   1050 <pow@plt>
add    %rax,%rbx
movapd 0x30(%rsp),%xmm0
mulsd  0x60(%rsp),%xmm0
movsd  0xd21(%rip),%xmm1
call   1050 <pow@plt>
add    %rax,%rbx
movsd  (%rsp),%xmm0
mulsd  0x68(%rsp),%xmm0
movsd  0xd06(%rip),%xmm1
call   1050 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1060 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
movsd  0x78(%rsp),%xmm0
ucomisd 0x70(%rsp),%xmm0
jbe    1363 <tilt_angle_e+0x223>
movsd  0x18(%rsp),%xmm0
ucomisd 0x10(%rsp),%xmm0
ja     1371 <tilt_angle_e+0x231>
jmp    1383 <tilt_angle_e+0x243>
movq   $0x0,(%r15)
movq   $0x0,(%r14)
jmp    1383 <tilt_angle_e+0x243>
movsd  0x10(%rsp),%xmm0
ucomisd 0x18(%rsp),%xmm0
jbe    1383 <tilt_angle_e+0x243>
movsd  (%r15),%xmm0
xorpd  0xcb2(%rip),%xmm0
movlpd %xmm0,(%r15)
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @tilt_angle_e(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double* nocapture %8, double* nocapture writeonly %9) {
%11 = fcmp oeq double %2, -1.000000e+03
%12 = fcmp oeq double %3, -1.000000e+03
%13 = or i1 %11, %12
%14 = fcmp oeq double %0, -1.000000e+03
%15 = or i1 %14, %13
%16 = fcmp oeq double %1, -1.000000e+03
%17 = or i1 %16, %15
br i1 %17, label %18, label %19
18: ; preds = %10
store double 0.000000e+00, double* %8
store double 0.000000e+00, double* %9
br label %66
19: ; preds = %10
%20 = fsub double %2, %3
%21 = fsub double %0, %1
%22 = fdiv double %20, %21
%23 = tail call i64 @fabs(double %22)
%24 = sitofp i64 %23 to double
%25 = load double, double* @M_PI
%26 = fdiv double 1.800000e+02, %25
%27 = tail call double @atan(double %24)
%28 = fmul double %26, %27
store double %28, double* %8
%29 = fdiv double 1.000000e+00, %21
%30 = fdiv double -1.000000e+00, %20
%31 = fneg double %24
%32 = fdiv double %31, %21
%33 = fdiv double %24, %20
%34 = tail call double @llvm.fmuladd.f64(double %24, double %24, double 1.000000e+00)
%35 = fdiv double 1.000000e+00, %34
%36 = fmul double %29, %35
%37 = fmul double %30, %35
%38 = fmul double %32, %35
%39 = fmul double %33, %35
%40 = load double, double* @M_PI
%41 = fdiv double 1.800000e+02, %40
%42 = fmul double %36, %6
%43 = tail call i64 @pow(double %42, double 2.000000e+00)
%44 = fmul double %37, %7
%45 = tail call i64 @pow(double %44, double 2.000000e+00)
%46 = add nsw i64 %45, %43
%47 = fmul double %38, %4
%48 = tail call i64 @pow(double %47, double 2.000000e+00)
%49 = add nsw i64 %46, %48
%50 = fmul double %39, %5
%51 = tail call i64 @pow(double %50, double 2.000000e+00)
%52 = add nsw i64 %49, %51
%53 = tail call double @sqrt(i64 %52)
%54 = fmul double %41, %53
store double %54, double* %9
%55 = fcmp ogt double %0, %1
br i1 %55, label %56, label %61
56: ; preds = %19
%57 = fcmp olt double %2, %3
br i1 %57, label %58, label %66
58: ; preds = %56
%59 = load double, double* %8
%60 = fneg double %59
store double %60, double* %8
br label %66
61: ; preds = %19
%62 = fcmp olt double %3, %2
br i1 %62, label %63, label %66
63: ; preds = %61
%64 = load double, double* %8
%65 = fneg double %64
store double %65, double* %8
br label %66
66: ; preds = %58, %56, %63, %61, %18
ret void
}