#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 cos(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double x, ret, val;
  x = 60.0;
  val = 180.0 / 3.14159265;
  ret = cos(x * val);
  printf("The cosine of %lf is %lf degrees\n", x, ret);
  x = 90.0;
  val = 180.0 / 3.14159265;
  ret = cos(x * val);
  printf("The cosine of %lf is %lf degrees\n", x, ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe8d(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe78(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf08(%rip),%rbx
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"The cosine of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 6.000000e+01, double* %2
store double 0x404CA5DC1AF05A77, double* %4
%5 = load double, double* %2
%6 = load double, double* %4
%7 = fmul double %5, %6
%8 = call double @cos(double %7)
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %9, double %10)
store double 9.000000e+01, double* %2
store double 0x404CA5DC1AF05A77, double* %4
%12 = load double, double* %2
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = call double @cos(double %14)
store double %15, double* %3
%16 = load double, double* %2
%17 = load double, double* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double %16, double %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"The cosine of %lf is %lf degrees\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double 6.000000e+01, double 0x3FE540E3FAFE62DC)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), double 9.000000e+01, double 0xBFD32B2B09EC4E91)
ret i32 0
}