#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 acos(double);
double cos(double);
double sin(double);
double Angle(double compass1, double clino1, double compass2, double clino2) {
  double c1 = cos(clino1);
  double z1 = sin(clino1);
  double x1 = c1 * cos(compass1);
  double y1 = c1 * sin(compass1);
  double c2 = cos(clino2);
  double z2 = sin(clino2);
  double x2 = c2 * cos(compass2);
  double y2 = c2 * sin(compass2);
  return acos(x1 * x2 + y1 * y2 + z1 * z2) * 180.0 / M_PI;
}


x86 assembly (clang, -O0):
<Angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <acos@plt>
movsd  0xda6(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2d83(%rip),%rax
divsd  (%rax),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Angle>:
sub    $0x38,%rsp
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x30(%rsp)
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x30(%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1030 <acos@plt>
mulsd  0xdee(%rip),%xmm0
mov    0x2dcf(%rip),%rax
divsd  (%rax),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @Angle(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%17 = load double, double* %6
%18 = call double @cos(double %17)
store double %18, double* %9
%19 = load double, double* %6
%20 = call double @sin(double %19)
store double %20, double* %10
%21 = load double, double* %9
%22 = load double, double* %5
%23 = call double @cos(double %22)
%24 = fmul double %21, %23
store double %24, double* %11
%25 = load double, double* %9
%26 = load double, double* %5
%27 = call double @sin(double %26)
%28 = fmul double %25, %27
store double %28, double* %12
%29 = load double, double* %8
%30 = call double @cos(double %29)
store double %30, double* %13
%31 = load double, double* %8
%32 = call double @sin(double %31)
store double %32, double* %14
%33 = load double, double* %13
%34 = load double, double* %7
%35 = call double @cos(double %34)
%36 = fmul double %33, %35
store double %36, double* %15
%37 = load double, double* %13
%38 = load double, double* %7
%39 = call double @sin(double %38)
%40 = fmul double %37, %39
store double %40, double* %16
%41 = load double, double* %11
%42 = load double, double* %15
%43 = load double, double* %12
%44 = load double, double* %16
%45 = fmul double %43, %44
%46 = call double @llvm.fmuladd.f64(double %41, double %42, double %45)
%47 = load double, double* %10
%48 = load double, double* %14
%49 = call double @llvm.fmuladd.f64(double %47, double %48, double %46)
%50 = call double @acos(double %49)
%51 = fmul double %50, 1.800000e+02
%52 = load double, double* @M_PI
%53 = fdiv double %51, %52
ret double %53
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @Angle(double %0, double %1, double %2, double %3) {
%5 = tail call double @cos(double %1)
%6 = tail call double @sin(double %1)
%7 = tail call double @cos(double %0)
%8 = fmul double %5, %7
%9 = tail call double @sin(double %0)
%10 = fmul double %5, %9
%11 = tail call double @cos(double %3)
%12 = tail call double @sin(double %3)
%13 = tail call double @cos(double %2)
%14 = fmul double %11, %13
%15 = tail call double @sin(double %2)
%16 = fmul double %11, %15
%17 = fmul double %10, %16
%18 = tail call double @llvm.fmuladd.f64(double %8, double %14, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %6, double %12, double %18)
%20 = tail call double @acos(double %19)
%21 = fmul double %20, 1.800000e+02
%22 = load double, double* @M_PI
%23 = fdiv double %21, %22
ret double %23
}