#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 atan(float);
double cos(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
double sin(float);
double tan(float);
int main(void) {
  float input1, input2, input3;
  printf("Enter 3 numbers between 0 and 9.999: ");
  scanf("%f%f%f", &input1, &input2, &input3);
  printf("\nNumber      sin      cos      tan      atan\n"
         "-------------------------------------------\n");
  printf("%.5f %8.3f %8.3f %8.3f %8.3f\n", input1, sin(input1), cos(input1),
         tan(input1), atan(input1));
  printf("%.5f %8.3f %8.3f %8.3f %8.3f\n", input2, sin(input2), cos(input2),
         tan(input2), atan(input2));
  printf("%.5f %8.3f %8.3f %8.3f %8.3f\n", input3, sin(input3), cos(input3),
         tan(input3), atan(input3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1070 <scanf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x70(%rbp)
movss  -0x8(%rbp),%xmm0
call   1080 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
movss  -0x8(%rbp),%xmm0
call   1060 <tan@plt>
movsd  %xmm0,-0x60(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <atan@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x58(%rbp),%xmm0
lea    0xe81(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movss  -0xc(%rbp),%xmm0
call   1080 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
movss  -0xc(%rbp),%xmm0
call   1060 <tan@plt>
movsd  %xmm0,-0x40(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <atan@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x38(%rbp),%xmm0
lea    0xe17(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movss  -0x10(%rbp),%xmm0
call   1080 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movss  -0x10(%rbp),%xmm0
call   1060 <tan@plt>
movsd  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
call   1050 <atan@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x18(%rbp),%xmm0
lea    0xdad(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1080 <scanf@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movss  0xc(%rsp),%xmm0
call   1090 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movss  0xc(%rsp),%xmm0
call   1070 <tan@plt>
movsd  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1060 <atan@plt>
movaps %xmm0,%xmm4
lea    0xe31(%rip),%rbx
mov    %rbx,%rdi
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
mov    $0x5,%al
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movss  0x8(%rsp),%xmm0
call   1090 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movss  0x8(%rsp),%xmm0
call   1070 <tan@plt>
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
call   1060 <atan@plt>
movaps %xmm0,%xmm4
mov    %rbx,%rdi
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
mov    $0x5,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
call   1050 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movss  0x4(%rsp),%xmm0
call   1090 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movss  0x4(%rsp),%xmm0
call   1070 <tan@plt>
movsd  %xmm0,0x10(%rsp)
movss  0x4(%rsp),%xmm0
call   1060 <atan@plt>
movaps %xmm0,%xmm4
mov    %rbx,%rdi
movsd  0x28(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
mov    $0x5,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter 3 numbers between 0 and 9.999: \00"
@.str.1 = [7 x i8] c"%f%f%f\00"
@.str.2 = [90 x i8] c"\0ANumber sin cos tan atan\0A-------------------------------------------\0A\00"
@.str.3 = [30 x i8] c"%.5f %8.3f %8.3f %8.3f %8.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.2, i64 0, i64 0))
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = load float, float* %2
%11 = call double @sin(float %10)
%12 = load float, float* %2
%13 = call double @cos(float %12)
%14 = load float, float* %2
%15 = call double @tan(float %14)
%16 = load float, float* %2
%17 = call double @atan(float %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %9, double %11, double %13, double %15, double %17)
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = load float, float* %3
%22 = call double @sin(float %21)
%23 = load float, float* %3
%24 = call double @cos(float %23)
%25 = load float, float* %3
%26 = call double @tan(float %25)
%27 = load float, float* %3
%28 = call double @atan(float %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %20, double %22, double %24, double %26, double %28)
%30 = load float, float* %4
%31 = fpext float %30 to double
%32 = load float, float* %4
%33 = call double @sin(float %32)
%34 = load float, float* %4
%35 = call double @cos(float %34)
%36 = load float, float* %4
%37 = call double @tan(float %36)
%38 = load float, float* %4
%39 = call double @atan(float %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %31, double %33, double %35, double %37, double %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter 3 numbers between 0 and 9.999: \00"
@.str.1 = [7 x i8] c"%f%f%f\00"
@.str.3 = [30 x i8] c"%.5f %8.3f %8.3f %8.3f %8.3f\0A\00"
@str = [89 x i8] c"\0ANumber sin cos tan atan\0A-------------------------------------------\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str, i64 0, i64 0))
%10 = load float, float* %1
%11 = fpext float %10 to double
%12 = call double @sin(float %10)
%13 = load float, float* %1
%14 = call double @cos(float %13)
%15 = load float, float* %1
%16 = call double @tan(float %15)
%17 = load float, float* %1
%18 = call double @atan(float %17)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %11, double %12, double %14, double %16, double %18)
%20 = load float, float* %2
%21 = fpext float %20 to double
%22 = call double @sin(float %20)
%23 = load float, float* %2
%24 = call double @cos(float %23)
%25 = load float, float* %2
%26 = call double @tan(float %25)
%27 = load float, float* %2
%28 = call double @atan(float %27)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %21, double %22, double %24, double %26, double %28)
%30 = load float, float* %3
%31 = fpext float %30 to double
%32 = call double @sin(float %30)
%33 = load float, float* %3
%34 = call double @cos(float %33)
%35 = load float, float* %3
%36 = call double @tan(float %35)
%37 = load float, float* %3
%38 = call double @atan(float %37)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), double %31, double %32, double %34, double %36, double %38)
ret i32 0
}