#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 EXIT_SUCCESS;
int acos(double);
int asin(double);
int atan(double);
double cos(double);
int /*<<< orphan*/ printf(char *, double);
double sin(double);
double tan(double);
int main(int argc, char *argv[]) {
  double param = 0.5;
  printf("atan (param) * 180 / PI"
         " is: %f\n",
         atan(param) * 180 / 3.14159265);
  printf("acos (param) * 180 / PI"
         " is: %f\n",
         acos(param) * 180 / 3.14159265);
  printf("asin (param) * 180 / PI"
         " is: %f\n",
         asin(param) * 180 / 3.14159265);
  double degree = 45.0;
  printf("cos (degree / 180 * PI)"
         " is: %f\n",
         cos(degree / 180 * 3.14159265));
  printf("sin (degree / 180 * PI)"
         " is: %f\n",
         sin(degree / 180 * 3.14159265));
  printf("tan (degree / 180 * PI)"
         " is: %f\n",
         tan(degree / 180 * 3.14159265));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <atan@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe51(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1040 <acos@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe25(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
call   1070 <asin@plt>
imul   $0xb4,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xdf9(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe4e(%rip),%rdi
call   1030 <printf@plt>
movsd  0xdf1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xdd7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdc3(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1090 <cos@plt>
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xda9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd95(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <sin@plt>
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  0xd7b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd67(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1080 <tan@plt>
lea    0xe17(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d2b(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xeb7(%rip),%xmm0
call   1050 <atan@plt>
imul   $0xb4,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xea5(%rip),%xmm0
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe89(%rip),%xmm0
call   1040 <acos@plt>
imul   $0xb4,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe77(%rip),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe5b(%rip),%xmm0
call   1060 <asin@plt>
imul   $0xb4,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe49(%rip),%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
movsd  0xe36(%rip),%xmm0
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
movsd  0xe2a(%rip),%xmm0
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
movsd  0xe1e(%rip),%xmm0
call   1030 <printf@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"atan (param) * 180 / PI is: %f\0A\00"
@.str.1 = [32 x i8] c"acos (param) * 180 / PI is: %f\0A\00"
@.str.2 = [32 x i8] c"asin (param) * 180 / PI is: %f\0A\00"
@.str.3 = [32 x i8] c"cos (degree / 180 * PI) is: %f\0A\00"
@.str.4 = [32 x i8] c"sin (degree / 180 * PI) is: %f\0A\00"
@.str.5 = [32 x i8] c"tan (degree / 180 * PI) is: %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 5.000000e-01, double* %6
%8 = load double, double* %6
%9 = call i32 @atan(double %8)
%10 = mul nsw i32 %9, 180
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 0x400921FB53C8D4F1
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %12)
%14 = load double, double* %6
%15 = call i32 @acos(double %14)
%16 = mul nsw i32 %15, 180
%17 = sitofp i32 %16 to double
%18 = fdiv double %17, 0x400921FB53C8D4F1
%19 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = load double, double* %6
%21 = call i32 @asin(double %20)
%22 = mul nsw i32 %21, 180
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 0x400921FB53C8D4F1
%25 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %24)
store double 4.500000e+01, double* %7
%26 = load double, double* %7
%27 = fdiv double %26, 1.800000e+02
%28 = fmul double %27, 0x400921FB53C8D4F1
%29 = call double @cos(double %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), double %29)
%31 = load double, double* %7
%32 = fdiv double %31, 1.800000e+02
%33 = fmul double %32, 0x400921FB53C8D4F1
%34 = call double @sin(double %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), double %34)
%36 = load double, double* %7
%37 = fdiv double %36, 1.800000e+02
%38 = fmul double %37, 0x400921FB53C8D4F1
%39 = call double @tan(double %38)
%40 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double %39)
%41 = load i32, i32* @EXIT_SUCCESS
ret i32 %41
}

LLVM IR (-O2):
@.str = [32 x i8] c"atan (param) * 180 / PI is: %f\0A\00"
@.str.1 = [32 x i8] c"acos (param) * 180 / PI is: %f\0A\00"
@.str.2 = [32 x i8] c"asin (param) * 180 / PI is: %f\0A\00"
@.str.3 = [32 x i8] c"cos (degree / 180 * PI) is: %f\0A\00"
@.str.4 = [32 x i8] c"sin (degree / 180 * PI) is: %f\0A\00"
@.str.5 = [32 x i8] c"tan (degree / 180 * PI) is: %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @atan(double 5.000000e-01)
%4 = mul nsw i32 %3, 180
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 0x400921FB53C8D4F1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %6)
%8 = tail call i32 @acos(double 5.000000e-01)
%9 = mul nsw i32 %8, 180
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 0x400921FB53C8D4F1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = tail call i32 @asin(double 5.000000e-01)
%14 = mul nsw i32 %13, 180
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, 0x400921FB53C8D4F1
%17 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), double 0x3FE6A09E66D67383)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), double 0x3FE6A09E66280416)
%20 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double 0x3FEFFFFFFF094FB1)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}