#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 M_PI;
double atan(int);
int /*<<< orphan*/ printf(char *, ...);
int sqrt(int);
int main(void) {
  double rad_0;
  double rad_30;
  double rad_45;
  double rad_60;
  double rad_90;
  double val_30 = 1 / sqrt(3);
  double val_45 = 1.0;
  double val_60 = sqrt(3);
  rad_0 = 0 * (M_PI / 180);
  rad_30 = 30 * (M_PI / 180);
  rad_45 = 45 * (M_PI / 180);
  rad_60 = 60 * (M_PI / 180);
  rad_90 = 90 * (M_PI / 180);
  printf("rad_0 = %lf\n", rad_0);
  printf("rad_30 = %lf\n", rad_30);
  printf("rad_45 = %lf\n", rad_45);
  printf("rad_60 = %lf\n", rad_60);
  printf("rad_90 = %lf\n", rad_90);
  printf("\n");
  printf("val_30 = %lf\n", val_30);
  printf("val_45 = %lf\n", val_45);
  printf("val_60 = %lf\n", val_60);
  printf("\n");
  printf("atan(0) = %lf\n", atan(0));
  printf("atan(val_30) = %lf\n", atan(val_30));
  printf("atan(val_45) = %lf\n", atan(val_45));
  printf("atan(val_60) = %lf\n", atan(val_60));
  printf("atan(16331239353195370) = %lf\n", atan(16331239353195370));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x0,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x1e,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e2b(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x2d,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e0e(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x3c,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2df1(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x5a,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xdef(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xde9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xde4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xddf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xdda(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xdc7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xdc2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xdbd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <atan@plt>
lea    0xda8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x38(%rbp),%edi
call   1040 <atan@plt>
lea    0xd9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x40(%rbp),%edi
call   1040 <atan@plt>
lea    0xd9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x48(%rbp),%edi
call   1040 <atan@plt>
lea    0xd97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0xf8639b6a,%edi
call   1040 <atan@plt>
lea    0xd93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    $0x3,%edi
call   1060 <sqrt@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%eax
xor    %ecx,%ecx
cmp    $0x3,%eax
cmovae %ecx,%ebx
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    $0x3,%edi
call   1060 <sqrt@plt>
mov    %eax,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    0x2e61(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shl    $0x5,%eax
sub    %ecx,%eax
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    (%rcx,%rcx,8),%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
imul   $0x3c,%ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
imul   $0x5a,%ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
lea    0xe17(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe12(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe0c(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe06(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe00(%rip),%rdi
movsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdf0(%rip),%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdea(%rip),%rdi
movsd  0xd87(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xde2(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <atan@plt>
lea    0xdcb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <atan@plt>
lea    0xdc5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <atan@plt>
lea    0xdc1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %ebp,%edi
call   1050 <atan@plt>
lea    0xdc0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xf8639b6a,%edi
call   1050 <atan@plt>
lea    0xdbc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
@.str = [13 x i8] c"rad_0 = %lf\0A\00"
@.str.1 = [14 x i8] c"rad_30 = %lf\0A\00"
@.str.2 = [14 x i8] c"rad_45 = %lf\0A\00"
@.str.3 = [14 x i8] c"rad_60 = %lf\0A\00"
@.str.4 = [14 x i8] c"rad_90 = %lf\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [14 x i8] c"val_30 = %lf\0A\00"
@.str.7 = [14 x i8] c"val_45 = %lf\0A\00"
@.str.8 = [14 x i8] c"val_60 = %lf\0A\00"
@.str.9 = [15 x i8] c"atan(0) = %lf\0A\00"
@.str.10 = [20 x i8] c"atan(val_30) = %lf\0A\00"
@.str.11 = [20 x i8] c"atan(val_45) = %lf\0A\00"
@.str.12 = [20 x i8] c"atan(val_60) = %lf\0A\00"
@.str.13 = [31 x i8] c"atan(16331239353195370) = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 @sqrt(i32 3)
%11 = sdiv i32 1, %10
%12 = sitofp i32 %11 to double
store double %12, double* %7
store double 1.000000e+00, double* %8
%13 = call i32 @sqrt(i32 3)
%14 = sitofp i32 %13 to double
store double %14, double* %9
%15 = load i32, i32* @M_PI
%16 = sdiv i32 %15, 180
%17 = mul nsw i32 0, %16
%18 = sitofp i32 %17 to double
store double %18, double* %2
%19 = load i32, i32* @M_PI
%20 = sdiv i32 %19, 180
%21 = mul nsw i32 30, %20
%22 = sitofp i32 %21 to double
store double %22, double* %3
%23 = load i32, i32* @M_PI
%24 = sdiv i32 %23, 180
%25 = mul nsw i32 45, %24
%26 = sitofp i32 %25 to double
store double %26, double* %4
%27 = load i32, i32* @M_PI
%28 = sdiv i32 %27, 180
%29 = mul nsw i32 60, %28
%30 = sitofp i32 %29 to double
store double %30, double* %5
%31 = load i32, i32* @M_PI
%32 = sdiv i32 %31, 180
%33 = mul nsw i32 90, %32
%34 = sitofp i32 %33 to double
store double %34, double* %6
%35 = load double, double* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %35)
%37 = load double, double* %3
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %37)
%39 = load double, double* %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %39)
%41 = load double, double* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %41)
%43 = load double, double* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%46 = load double, double* %7
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %46)
%48 = load double, double* %8
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %48)
%50 = load double, double* %9
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%53 = call double @atan(i32 0)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), double %53)
%55 = load double, double* %7
%56 = fptosi double %55 to i32
%57 = call double @atan(i32 %56)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %57)
%59 = load double, double* %8
%60 = fptosi double %59 to i32
%61 = call double @atan(i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double %61)
%63 = load double, double* %9
%64 = fptosi double %63 to i32
%65 = call double @atan(i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), double %65)
%67 = call double @atan(i32 -127689878)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), double %67)
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [13 x i8] c"rad_0 = %lf\0A\00"
@.str.1 = [14 x i8] c"rad_30 = %lf\0A\00"
@.str.2 = [14 x i8] c"rad_45 = %lf\0A\00"
@.str.3 = [14 x i8] c"rad_60 = %lf\0A\00"
@.str.4 = [14 x i8] c"rad_90 = %lf\0A\00"
@.str.6 = [14 x i8] c"val_30 = %lf\0A\00"
@.str.7 = [14 x i8] c"val_45 = %lf\0A\00"
@.str.8 = [14 x i8] c"val_60 = %lf\0A\00"
@.str.9 = [15 x i8] c"atan(0) = %lf\0A\00"
@.str.10 = [20 x i8] c"atan(val_30) = %lf\0A\00"
@.str.11 = [20 x i8] c"atan(val_45) = %lf\0A\00"
@.str.12 = [20 x i8] c"atan(val_60) = %lf\0A\00"
@.str.13 = [31 x i8] c"atan(16331239353195370) = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @sqrt(i32 3)
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
%5 = sitofp i32 %4 to double
%6 = tail call i32 @sqrt(i32 3)
%7 = sitofp i32 %6 to double
%8 = load i32, i32* @M_PI
%9 = sdiv i32 %8, 180
%10 = mul nsw i32 %9, 30
%11 = sitofp i32 %10 to double
%12 = mul nsw i32 %9, 45
%13 = sitofp i32 %12 to double
%14 = mul nsw i32 %9, 60
%15 = sitofp i32 %14 to double
%16 = mul nsw i32 %9, 90
%17 = sitofp i32 %16 to double
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %11)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %13)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %15)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %17)
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %5)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double 1.000000e+00)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %7)
%27 = tail call i32 @putchar(i32 10)
%28 = tail call double @atan(i32 0)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), double %28)
%30 = tail call double @atan(i32 %4)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %30)
%32 = tail call double @atan(i32 1)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double %32)
%34 = tail call double @atan(i32 %6)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), double %34)
%36 = tail call double @atan(i32 -127689878)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.13, i64 0, i64 0), double %36)
ret i32 0
}