#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 _floatSin(float);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, float *);
int main() {
  float x;
  int test;
  printf("\n");
  printf("--------------------------------------------------------\n");
  printf("Enter the float-value you wish to calculate the sine of:\n");
  printf("--------------------------------------------------------\n");
  test = scanf("%f", &x);
  if (test != 1) {
    printf("You can only enter a number!");
  } else {
    printf("\nsin(%f) = ", x);
    printf("%f\n", _floatSin(x));
  }
  printf("\n-------------------------DONE------------------------\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     11a7 <main+0x77>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xa6>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <_floatSin@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf03(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe77(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    11cb <main+0x7b>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe77(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0xc(%rsp),%xmm0
call   1060 <_floatSin@plt>
lea    0xe6a(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    11d9 <main+0x89>
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [58 x i8] c"--------------------------------------------------------\0A\00"
@.str.2 = [58 x i8] c"Enter the float-value you wish to calculate the sine of:\0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [29 x i8] c"You can only enter a number!\00"
@.str.5 = [12 x i8] c"\0Asin(%f) = \00"
@.str.6 = [4 x i8] c"%f\0A\00"
@.str.7 = [56 x i8] c"\0A-------------------------DONE------------------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %20
13: ; preds = %0
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double %15)
%17 = load float, float* %2
%18 = call double @_floatSin(float %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %18)
br label %20
20: ; preds = %13, %11
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.7, i64 0, i64 0))
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [29 x i8] c"You can only enter a number!\00"
@.str.5 = [12 x i8] c"\0Asin(%f) = \00"
@.str.6 = [4 x i8] c"%f\0A\00"
@str.8 = [57 x i8] c"Enter the float-value you wish to calculate the sine of:\00"
@str.9 = [57 x i8] c"--------------------------------------------------------\00"
@str.10 = [55 x i8] c"\0A-------------------------DONE------------------------\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.9, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.9, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %1)
%8 = icmp eq i32 %7, 1
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %18
11: ; preds = %0
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double %13)
%15 = load float, float* %1
%16 = call double @_floatSin(float %15)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %16)
br label %18
18: ; preds = %11, %9
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.10, i64 0, i64 0))
ret i32 0
}