#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 asin(double);
double cos(double);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
double sin(double);
int /*<<< orphan*/ stdin;
main() {
  double velocity, x_vel, y_vel, theta, time, pi, height;
  char buffer[133];
  printf("Target distance is %.1f feet away\n", 30.0);
  printf("Target is %.2f feet tall\n\n", 5.75);
  printf("Enter angle of elavation in degrees: ");
  scanf("%1f", &theta);
  printf("Enter initial velocity in feet per second: ");
  fgets(buffer, 133, stdin);
  scanf("%1f", &velocity);
  printf("Enter initial height in feet: ");
  fgets(buffer, 133, stdin);
  scanf("%1f", &height);
  pi = 2.0 * asin(1.0);
  x_vel = velocity * cos(theta * pi / 180);
  y_vel = velocity * sin(theta * pi / 180);
  fgets(buffer, 133, stdin);
  printf("Target distance ====> %.1f\n", 30.0);
  time = 30.0 / x_vel;
  printf("Time ====> %.1f\n", time);
  height = height + y_vel * time - 16.0 * time * time;
  if ((height > 0.0) && (height < 5.75)) {
    printf("You hit the professor with the rubber band!!!\n");
    printf("GOOD!");
  } else
    printf("You missed!\n");
  printf("Height of the rubber band at target was %.2f feet.\n", height);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
movsd  0xe87(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
movsd  0xe91(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2e10(%rip),%rax
mov    (%rax),%edx
mov    $0x85,%esi
call   1040 <fgets@plt>
lea    0xea9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    0x2dd8(%rip),%rax
mov    (%rax),%edx
mov    $0x85,%esi
call   1040 <fgets@plt>
lea    0xe71(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   1070 <scanf@plt>
movsd  0xdec(%rip),%xmm0
call   1060 <asin@plt>
movaps %xmm0,%xmm1
movsd  0xdd4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xda4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1080 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xd68(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0xd0(%rbp),%rdi
mov    0x2d15(%rip),%rax
mov    (%rax),%edx
mov    $0x85,%esi
call   1040 <fgets@plt>
lea    0xdfd(%rip),%rdi
movsd  0xd1a(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd0b(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xdec(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcc7(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13ad <main+0x24d>
movsd  0xca7(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    13ad <main+0x24d>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13bb <main+0x25b>
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xd8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
lea    0xeb5(%rip),%rdi
movsd  0xe85(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
movsd  0xe77(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e19(%rip),%r15
mov    (%r15),%edx
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    $0x85,%esi
call   1050 <fgets@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%edx
mov    %r14,%rdi
mov    $0x85,%esi
call   1050 <fgets@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0xdda(%rip),%xmm0
divsd  0xdda(%rip),%xmm0
call   1080 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xdad(%rip),%xmm0
mulsd  0x20(%rsp),%xmm0
divsd  0xda7(%rip),%xmm0
call   1060 <sin@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    (%r15),%edx
mov    %r14,%rdi
mov    $0x85,%esi
call   1050 <fgets@plt>
lea    0xe42(%rip),%rdi
movsd  0xd5f(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xd50(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe34(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
addsd  0x18(%rsp),%xmm0
movapd %xmm0,%xmm1
movsd  0xd34(%rip),%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1332 <main+0x1d2>
movsd  0xcf8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1332 <main+0x1d2>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
lea    0xddf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    133e <main+0x1de>
lea    0xe09(%rip),%rdi
call   1030 <puts@plt>
movsd  0x18(%rsp),%xmm0
lea    0xdc3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Target distance is %.1f feet away\0A\00"
@.str.1 = [27 x i8] c"Target is %.2f feet tall\0A\0A\00"
@.str.2 = [38 x i8] c"Enter angle of elavation in degrees: \00"
@.str.3 = [4 x i8] c"%1f\00"
@.str.4 = [44 x i8] c"Enter initial velocity in feet per second: \00"
@stdin = global i32 0
@.str.5 = [31 x i8] c"Enter initial height in feet: \00"
@.str.6 = [28 x i8] c"Target distance ====> %.1f\0A\00"
@.str.7 = [17 x i8] c"Time ====> %.1f\0A\00"
@.str.8 = [47 x i8] c"You hit the professor with the rubber band!!!\0A\00"
@.str.9 = [6 x i8] c"GOOD!\00"
@.str.10 = [13 x i8] c"You missed!\0A\00"
@.str.11 = [52 x i8] c"Height of the rubber band at target was %.2f feet.\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 [133 x i8]
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 3.000000e+01)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double 5.750000e+00)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %5)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%15 = getelementptr inbounds [133 x i8], [133 x i8]* %9, i64 0, i64 0
%16 = load i32, i32* @stdin
%17 = call i32 @fgets(i8* %15, i32 133, i32 %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %2)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%20 = getelementptr inbounds [133 x i8], [133 x i8]* %9, i64 0, i64 0
%21 = load i32, i32* @stdin
%22 = call i32 @fgets(i8* %20, i32 133, i32 %21)
%23 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %8)
%24 = call double @asin(double 1.000000e+00)
%25 = fmul double 2.000000e+00, %24
store double %25, double* %7
%26 = load double, double* %2
%27 = load double, double* %5
%28 = load double, double* %7
%29 = fmul double %27, %28
%30 = fdiv double %29, 1.800000e+02
%31 = call double @cos(double %30)
%32 = fmul double %26, %31
store double %32, double* %3
%33 = load double, double* %2
%34 = load double, double* %5
%35 = load double, double* %7
%36 = fmul double %34, %35
%37 = fdiv double %36, 1.800000e+02
%38 = call double @sin(double %37)
%39 = fmul double %33, %38
store double %39, double* %4
%40 = getelementptr inbounds [133 x i8], [133 x i8]* %9, i64 0, i64 0
%41 = load i32, i32* @stdin
%42 = call i32 @fgets(i8* %40, i32 133, i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), double 3.000000e+01)
%44 = load double, double* %3
%45 = fdiv double 3.000000e+01, %44
store double %45, double* %6
%46 = load double, double* %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %46)
%48 = load double, double* %8
%49 = load double, double* %4
%50 = load double, double* %6
%51 = call double @llvm.fmuladd.f64(double %49, double %50, double %48)
%52 = load double, double* %6
%53 = fmul double 1.600000e+01, %52
%54 = load double, double* %6
%55 = fneg double %53
%56 = call double @llvm.fmuladd.f64(double %55, double %54, double %51)
store double %56, double* %8
%57 = load double, double* %8
%58 = fcmp ogt double %57, 0.000000e+00
br i1 %58, label %59, label %65
59: ; preds = %0
%60 = load double, double* %8
%61 = fcmp olt double %60, 5.750000e+00
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %67
65: ; preds = %59, %0
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
br label %67
67: ; preds = %65, %62
%68 = load double, double* %8
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0), double %68)
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
@.str = [35 x i8] c"Target distance is %.1f feet away\0A\00"
@.str.1 = [27 x i8] c"Target is %.2f feet tall\0A\0A\00"
@.str.2 = [38 x i8] c"Enter angle of elavation in degrees: \00"
@.str.3 = [4 x i8] c"%1f\00"
@.str.4 = [44 x i8] c"Enter initial velocity in feet per second: \00"
@stdin = global i32 0
@.str.5 = [31 x i8] c"Enter initial height in feet: \00"
@.str.6 = [28 x i8] c"Target distance ====> %.1f\0A\00"
@.str.7 = [17 x i8] c"Time ====> %.1f\0A\00"
@.str.9 = [6 x i8] c"GOOD!\00"
@.str.11 = [52 x i8] c"Height of the rubber band at target was %.2f feet.\0A\00"
@str = [12 x i8] c"You missed!\00"
@str.12 = [46 x i8] c"You hit the professor with the rubber band!!!\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca [133 x i8]
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = getelementptr inbounds [133 x i8], [133 x i8]* %4, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double 3.000000e+01)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double 5.750000e+00)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32, i32* @stdin
%15 = call i32 @fgets(i8* %8, i32 133, i32 %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %1)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %8, i32 133, i32 %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %3)
%21 = load double, double* %1
%22 = load double, double* %2
%23 = fmul double %22, 0x400921FB54442D18
%24 = fdiv double %23, 1.800000e+02
%25 = call double @cos(double %24)
%26 = fmul double %21, %25
%27 = load double, double* %1
%28 = load double, double* %2
%29 = fmul double %28, 0x400921FB54442D18
%30 = fdiv double %29, 1.800000e+02
%31 = call double @sin(double %30)
%32 = fmul double %27, %31
%33 = load i32, i32* @stdin
%34 = call i32 @fgets(i8* %8, i32 133, i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), double 3.000000e+01)
%36 = fdiv double 3.000000e+01, %26
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %36)
%38 = load double, double* %3
%39 = call double @llvm.fmuladd.f64(double %32, double %36, double %38)
%40 = fmul double %36, -1.600000e+01
%41 = call double @llvm.fmuladd.f64(double %40, double %36, double %39)
store double %41, double* %3
%42 = fcmp ogt double %41, 0.000000e+00
%43 = fcmp olt double %41, 5.750000e+00
%44 = and i1 %42, %43
br i1 %44, label %45, label %48
45: ; preds = %0
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %50
48: ; preds = %0
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
%51 = load double, double* %3
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.11, i64 0, i64 0), double %51)
ret i32 0
}