#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 asin(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.0 / 2.0;
  double val_45 = 1 / (sqrt(2));
  double val_60 = sqrt(3) / 2;
  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("asin(0) = %lf\n", asin(0));
  printf("asin(val_30) = %lf\n", asin(val_30));
  printf("asin(val_45) = %lf\n", asin(val_45));
  printf("asin(val_60) = %lf\n", asin(val_60));
  printf("asin(1) = %lf\n", asin(1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x2,%edi
call   1050 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x3,%edi
call   1050 <sqrt@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x0,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x1e,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e23(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x2d,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0x2e06(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
imul   $0x3c,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2de9(%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    0xde7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xde1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xddc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xdd7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xdd2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xdbf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xdba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xdb5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <asin@plt>
lea    0xda0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x38(%rbp),%edi
call   1040 <asin@plt>
lea    0xd97(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x40(%rbp),%edi
call   1040 <asin@plt>
lea    0xd93(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvttsd2si -0x48(%rbp),%edi
call   1040 <asin@plt>
lea    0xd8f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <asin@plt>
lea    0xd8b(%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    $0x2,%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,0x30(%rsp)
mov    $0x3,%edi
call   1060 <sqrt@plt>
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    0x2e5a(%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    0xe10(%rip),%rdi
xorpd  %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe0b(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe05(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdff(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdf9(%rip),%rdi
movsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xde9(%rip),%rdi
movsd  0xd94(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xde1(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xddb(%rip),%rdi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1050 <asin@plt>
lea    0xdc4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <asin@plt>
lea    0xdbe(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <asin@plt>
lea    0xdbd(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %ebp,%edi
call   1050 <asin@plt>
lea    0xdbc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <asin@plt>
lea    0xdb8(%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"asin(0) = %lf\0A\00"
@.str.10 = [20 x i8] c"asin(val_30) = %lf\0A\00"
@.str.11 = [20 x i8] c"asin(val_45) = %lf\0A\00"
@.str.12 = [20 x i8] c"asin(val_60) = %lf\0A\00"
@.str.13 = [15 x i8] c"asin(1) = %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
store double 5.000000e-01, double* %7
%10 = call i32 @sqrt(i32 2)
%11 = sdiv i32 1, %10
%12 = sitofp i32 %11 to double
store double %12, double* %8
%13 = call i32 @sqrt(i32 3)
%14 = sdiv i32 %13, 2
%15 = sitofp i32 %14 to double
store double %15, double* %9
%16 = load i32, i32* @M_PI
%17 = sdiv i32 %16, 180
%18 = mul nsw i32 0, %17
%19 = sitofp i32 %18 to double
store double %19, double* %2
%20 = load i32, i32* @M_PI
%21 = sdiv i32 %20, 180
%22 = mul nsw i32 30, %21
%23 = sitofp i32 %22 to double
store double %23, double* %3
%24 = load i32, i32* @M_PI
%25 = sdiv i32 %24, 180
%26 = mul nsw i32 45, %25
%27 = sitofp i32 %26 to double
store double %27, double* %4
%28 = load i32, i32* @M_PI
%29 = sdiv i32 %28, 180
%30 = mul nsw i32 60, %29
%31 = sitofp i32 %30 to double
store double %31, double* %5
%32 = load i32, i32* @M_PI
%33 = sdiv i32 %32, 180
%34 = mul nsw i32 90, %33
%35 = sitofp i32 %34 to double
store double %35, double* %6
%36 = load double, double* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %36)
%38 = load double, double* %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %38)
%40 = load double, double* %4
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %40)
%42 = load double, double* %5
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %42)
%44 = load double, double* %6
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%47 = load double, double* %7
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %47)
%49 = load double, double* %8
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %49)
%51 = load double, double* %9
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %51)
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%54 = call double @asin(i32 0)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), double %54)
%56 = load double, double* %7
%57 = fptosi double %56 to i32
%58 = call double @asin(i32 %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %58)
%60 = load double, double* %8
%61 = fptosi double %60 to i32
%62 = call double @asin(i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double %62)
%64 = load double, double* %9
%65 = fptosi double %64 to i32
%66 = call double @asin(i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), double %66)
%68 = call double @asin(i32 1)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), double %68)
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"asin(0) = %lf\0A\00"
@.str.10 = [20 x i8] c"asin(val_30) = %lf\0A\00"
@.str.11 = [20 x i8] c"asin(val_45) = %lf\0A\00"
@.str.12 = [20 x i8] c"asin(val_60) = %lf\0A\00"
@.str.13 = [15 x i8] c"asin(1) = %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @sqrt(i32 2)
%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 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to double
%9 = load i32, i32* @M_PI
%10 = sdiv i32 %9, 180
%11 = mul nsw i32 %10, 30
%12 = sitofp i32 %11 to double
%13 = mul nsw i32 %10, 45
%14 = sitofp i32 %13 to double
%15 = mul nsw i32 %10, 60
%16 = sitofp i32 %15 to double
%17 = mul nsw i32 %10, 90
%18 = sitofp i32 %17 to double
%19 = 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)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %12)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %14)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %16)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %18)
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double 5.000000e-01)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %5)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %8)
%28 = tail call i32 @putchar(i32 10)
%29 = tail call double @asin(i32 0)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), double %29)
%31 = tail call double @asin(i32 0)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), double %31)
%33 = tail call double @asin(i32 %4)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), double %33)
%35 = tail call double @asin(i32 %7)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0), double %35)
%37 = tail call double @asin(i32 1)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), double %37)
ret i32 0
}