#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 */
float cos(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
float sin(float);
int main(void) {
  float launchHeight;
  int launchAngle;
  float launchVelocity;
  float vertLaunchVelocity;
  float horizLaunchVelocity;
  float launchAngleRad;
  float timeToImpact;
  float distanceTraveled;
  float returnToLaunchHeight;
  float fromLaunchHeightToGround;
  printf(
      "Ballistic Calculator\t Copyright (C) 2017 Bryson O'Neill\n This program "
      "comes with ABSOLUTELY NO WARRANTY\n This is free software, and you are "
      "welcome to redistribute it\n under certain conditions.\n");
  printf("\nChangelog 0.02 -> 0.03\n");
  printf("Spelling fixes\nSyntax corrections\nFormatting\n\n");
  do {
    printf("Please enter a height above the ground in meters.\n");
    scanf("%f", &launchHeight);
    printf("\n You entered: %f meters\n", launchHeight);
    if (launchHeight < 0) {
      printf("Input Error: Expected a positive number\n");
    }
  } while (launchHeight < 0);
  do {
    printf("Please enter a launch angle in degrees \n");
    scanf("%d", &launchAngle);
    printf("\n You entered: %d degrees\n", launchAngle);
    if (launchAngle > 90 || launchAngle < -90) {
      printf("Input Error: Expected an angle between 90 and -90 degrees\n");
    }
  } while (launchAngle > 90 || launchAngle < -90);
  do {
    printf("Please enter an initial launch velocity in m/s\n");
    scanf("%f", &launchVelocity);
    printf("\n You entered: %f m/s\n", launchVelocity);
    if (launchVelocity < 0) {
      printf("Input Error: Expected a positive number\n");
    }
  } while (launchVelocity < 0);
  launchAngleRad = launchAngle * 0.0174532925;
  horizLaunchVelocity = launchVelocity * cos(launchAngleRad);
  vertLaunchVelocity = launchVelocity * sin(launchAngleRad);
  if (launchAngle >= 0) {
    returnToLaunchHeight = 2 * vertLaunchVelocity / 9.81;
    fromLaunchHeightToGround = (launchHeight * 16) / (vertLaunchVelocity * 15);
  }
  timeToImpact = returnToLaunchHeight + fromLaunchHeightToGround;
  distanceTraveled = timeToImpact * horizLaunchVelocity;
  printf("launch height: %fm \n", launchHeight);
  printf("launch angle: %d degrees\n", launchAngle);
  printf("launch velocity: %fm/s \n", launchVelocity);
  printf("time to impact: %fs \n", timeToImpact);
  printf("distance travelled: %fm \n", distanceTraveled);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfcc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xfb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11cb <main+0x8b>
lea    0xfb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d0 <main+0x90>
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
ja     1179 <main+0x39>
jmp    11e2 <main+0xa2>
lea    0xfb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfd2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xfc0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x5a,-0xc(%rbp)
jg     1227 <main+0xe7>
cmpl   $0xffffffa6,-0xc(%rbp)
jge    1235 <main+0xf5>
lea    0xfb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0xfa>
mov    $0x1,%al
cmpl   $0x5a,-0xc(%rbp)
mov    %al,-0x2d(%rbp)
jg     1253 <main+0x113>
cmpl   $0xffffffa6,-0xc(%rbp)
setl   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
test   $0x1,%al
jne    11e2 <main+0xa2>
jmp    1263 <main+0x123>
lea    0xfb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xfbf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    12b5 <main+0x175>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ba <main+0x17a>
xorps  %xmm0,%xmm0
ucomiss -0x10(%rbp),%xmm0
ja     1263 <main+0x123>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xd2c(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x38(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     137e <main+0x23e>
movss  0xcdb(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcba(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xcb1(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xca0(%rip),%xmm1
mulss  -0x14(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
addss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xf7e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1034(%rip),%rdi
call   1030 <puts@plt>
lea    0x1040(%rip),%rdi
call   1030 <puts@plt>
lea    0x1062(%rip),%r14
lea    0xe89(%rip),%r15
lea    0xc(%rsp),%r12
lea    0xe80(%rip),%rbx
lea    0x110b(%rip),%r13
jmp    11b5 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
ucomiss %xmm0,%xmm1
jbe    11ff <main+0xaf>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm1,%xmm1
movss  0xc(%rsp),%xmm0
ucomiss %xmm0,%xmm1
jbe    11b0 <main+0x60>
mov    %r13,%rdi
call   1030 <puts@plt>
xorps  %xmm1,%xmm1
movss  0xc(%rsp),%xmm0
jmp    11b0 <main+0x60>
lea    0x1016(%rip),%r14
lea    0xe28(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe1f(%rip),%rbx
lea    0x1053(%rip),%r13
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffa5,%eax
cmp    $0xffffff4a,%eax
ja     1267 <main+0x117>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
add    $0xffffffa5,%eax
cmp    $0xffffff4b,%eax
jb     1220 <main+0xd0>
lea    0xfd6(%rip),%r14
lea    0xda3(%rip),%r15
lea    0x8(%rsp),%r12
lea    0xdd2(%rip),%rbx
lea    0x1025(%rip),%r13
jmp    1295 <main+0x145>
nopw   0x0(%rax,%rax,1)
ucomiss %xmm0,%xmm1
jbe    12df <main+0x18f>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm1,%xmm1
movss  0x8(%rsp),%xmm0
ucomiss %xmm0,%xmm1
jbe    1290 <main+0x140>
mov    %r13,%rdi
call   1030 <puts@plt>
xorps  %xmm1,%xmm1
movss  0x8(%rsp),%xmm0
jmp    1290 <main+0x140>
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x4(%rsp),%xmm0
mulsd  0xd0a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
call   1070 <cos@plt>
movss  %xmm0,0x1c(%rsp)
movss  0x8(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x10(%rsp),%xmm0
call   1050 <sin@plt>
cmpl   $0x0,0x4(%rsp)
js     1371 <main+0x221>
movss  0x18(%rsp),%xmm3
mulss  %xmm0,%xmm3
movaps %xmm3,%xmm0
addss  %xmm3,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xcc2(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
movss  0xcb5(%rip),%xmm2
mulss  %xmm0,%xmm2
mulss  0xcad(%rip),%xmm3
divss  %xmm3,%xmm2
addss  %xmm1,%xmm2
jmp    1377 <main+0x227>
movss  0xc(%rsp),%xmm0
movss  %xmm2,0x10(%rsp)
movss  0x14(%rsp),%xmm1
mulss  0x1c(%rsp),%xmm1
mulss  %xmm2,%xmm1
movss  %xmm1,0x14(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xccc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xccf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcd1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcd2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcd0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [195 x i8] c"Ballistic Calculator\09 Copyright (C) 2017 Bryson O'Neill\0A This program comes with ABSOLUTELY NO WARRANTY\0A This is free software, and you are welcome to redistribute it\0A under certain conditions.\0A\00"
@.str.1 = [25 x i8] c"\0AChangelog 0.02 -> 0.03\0A\00"
@.str.2 = [47 x i8] c"Spelling fixes\0ASyntax corrections\0AFormatting\0A\0A\00"
@.str.3 = [51 x i8] c"Please enter a height above the ground in meters.\0A\00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [26 x i8] c"\0A You entered: %f meters\0A\00"
@.str.6 = [41 x i8] c"Input Error: Expected a positive number\0A\00"
@.str.7 = [41 x i8] c"Please enter a launch angle in degrees \0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [27 x i8] c"\0A You entered: %d degrees\0A\00"
@.str.10 = [59 x i8] c"Input Error: Expected an angle between 90 and -90 degrees\0A\00"
@.str.11 = [48 x i8] c"Please enter an initial launch velocity in m/s\0A\00"
@.str.12 = [23 x i8] c"\0A You entered: %f m/s\0A\00"
@.str.13 = [21 x i8] c"launch height: %fm \0A\00"
@.str.14 = [26 x i8] c"launch angle: %d degrees\0A\00"
@.str.15 = [25 x i8] c"launch velocity: %fm/s \0A\00"
@.str.16 = [22 x i8] c"time to impact: %fs \0A\00"
@.str.17 = [26 x i8] c"distance travelled: %fm \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %26, %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%18 = load float, float* %2
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), double %19)
%21 = load float, float* %2
%22 = fcmp olt float %21, 0.000000e+00
br i1 %22, label %23, label %25
23: ; preds = %15
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %23, %15
br label %26
26: ; preds = %25
%27 = load float, float* %2
%28 = fcmp olt float %27, 0.000000e+00
br i1 %28, label %15, label %29
29: ; preds = %26
br label %30
30: ; preds = %49, %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%33 = load i32, i32* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %3
%36 = icmp sgt i32 %35, 90
br i1 %36, label %40, label %37
37: ; preds = %30
%38 = load i32, i32* %3
%39 = icmp slt i32 %38, -90
br i1 %39, label %40, label %42
40: ; preds = %37, %30
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.10, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
br label %43
43: ; preds = %42
%44 = load i32, i32* %3
%45 = icmp sgt i32 %44, 90
br i1 %45, label %49, label %46
46: ; preds = %43
%47 = load i32, i32* %3
%48 = icmp slt i32 %47, -90
br label %49
49: ; preds = %46, %43
%50 = phi i1 [ true, %43 ], [ %48, %46 ]
br i1 %50, label %30, label %51
51: ; preds = %49
br label %52
52: ; preds = %63, %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%54 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%55 = load float, float* %4
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), double %56)
%58 = load float, float* %4
%59 = fcmp olt float %58, 0.000000e+00
br i1 %59, label %60, label %62
60: ; preds = %52
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.6, i64 0, i64 0))
br label %62
62: ; preds = %60, %52
br label %63
63: ; preds = %62
%64 = load float, float* %4
%65 = fcmp olt float %64, 0.000000e+00
br i1 %65, label %52, label %66
66: ; preds = %63
%67 = load i32, i32* %3
%68 = sitofp i32 %67 to double
%69 = fmul double %68, 0x3F91DF46A1FAE711
%70 = fptrunc double %69 to float
store float %70, float* %7
%71 = load float, float* %4
%72 = load float, float* %7
%73 = call float @cos(float %72)
%74 = fmul float %71, %73
store float %74, float* %6
%75 = load float, float* %4
%76 = load float, float* %7
%77 = call float @sin(float %76)
%78 = fmul float %75, %77
store float %78, float* %5
%79 = load i32, i32* %3
%80 = icmp sge i32 %79, 0
br i1 %80, label %81, label %92
81: ; preds = %66
%82 = load float, float* %5
%83 = fmul float 2.000000e+00, %82
%84 = fpext float %83 to double
%85 = fdiv double %84, 9.810000e+00
%86 = fptrunc double %85 to float
store float %86, float* %10
%87 = load float, float* %2
%88 = fmul float %87, 1.600000e+01
%89 = load float, float* %5
%90 = fmul float %89, 1.500000e+01
%91 = fdiv float %88, %90
store float %91, float* %11
br label %92
92: ; preds = %81, %66
%93 = load float, float* %10
%94 = load float, float* %11
%95 = fadd float %93, %94
store float %95, float* %8
%96 = load float, float* %8
%97 = load float, float* %6
%98 = fmul float %96, %97
store float %98, float* %9
%99 = load float, float* %2
%100 = fpext float %99 to double
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), double %100)
%102 = load i32, i32* %3
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %102)
%104 = load float, float* %4
%105 = fpext float %104 to double
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), double %105)
%107 = load float, float* %8
%108 = fpext float %107 to double
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), double %108)
%110 = load float, float* %9
%111 = fpext float %110 to double
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0), double %111)
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [26 x i8] c"\0A You entered: %f meters\0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [27 x i8] c"\0A You entered: %d degrees\0A\00"
@.str.12 = [23 x i8] c"\0A You entered: %f m/s\0A\00"
@.str.13 = [21 x i8] c"launch height: %fm \0A\00"
@.str.14 = [26 x i8] c"launch angle: %d degrees\0A\00"
@.str.15 = [25 x i8] c"launch velocity: %fm/s \0A\00"
@.str.16 = [22 x i8] c"time to impact: %fs \0A\00"
@.str.17 = [26 x i8] c"distance travelled: %fm \0A\00"
@str = [194 x i8] c"Ballistic Calculator\09 Copyright (C) 2017 Bryson O'Neill\0A This program comes with ABSOLUTELY NO WARRANTY\0A This is free software, and you are welcome to redistribute it\0A under certain conditions.\00"
@str.18 = [24 x i8] c"\0AChangelog 0.02 -> 0.03\00"
@str.19 = [46 x i8] c"Spelling fixes\0ASyntax corrections\0AFormatting\0A\00"
@str.20 = [50 x i8] c"Please enter a height above the ground in meters.\00"
@str.21 = [40 x i8] c"Please enter a launch angle in degrees \00"
@str.22 = [47 x i8] c"Please enter an initial launch velocity in m/s\00"
@str.24 = [58 x i8] c"Input Error: Expected an angle between 90 and -90 degrees\00"
@str.25 = [40 x i8] c"Input Error: Expected a positive number\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([194 x i8], [194 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.18, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.19, i64 0, i64 0))
br label %10
10: ; preds = %21, %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.20, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %1)
%13 = load float, float* %1
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), double %14)
%16 = load float, float* %1
%17 = fcmp olt float %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %10
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.25, i64 0, i64 0))
%20 = load float, float* %1
br label %21
21: ; preds = %10, %18
%22 = phi float [ %16, %10 ], [ %20, %18 ]
%23 = fcmp olt float %22, 0.000000e+00
br i1 %23, label %10, label %24
24: ; preds = %21, %32
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.21, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %2
%30 = add i32 %29, -91
%31 = icmp ult i32 %30, -181
br i1 %31, label %32, label %37
32: ; preds = %24
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.24, i64 0, i64 0))
%34 = load i32, i32* %2
%35 = add i32 %34, -91
%36 = icmp ult i32 %35, -181
br i1 %36, label %24, label %37
37: ; preds = %24, %32
br label %38
38: ; preds = %37, %49
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.22, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%41 = load float, float* %3
%42 = fpext float %41 to double
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), double %42)
%44 = load float, float* %3
%45 = fcmp olt float %44, 0.000000e+00
br i1 %45, label %46, label %49
46: ; preds = %38
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.25, i64 0, i64 0))
%48 = load float, float* %3
br label %49
49: ; preds = %38, %46
%50 = phi float [ %44, %38 ], [ %48, %46 ]
%51 = fcmp olt float %50, 0.000000e+00
br i1 %51, label %38, label %52
52: ; preds = %49
%53 = load i32, i32* %2
%54 = sitofp i32 %53 to double
%55 = fmul double %54, 0x3F91DF46A1FAE711
%56 = fptrunc double %55 to float
%57 = call float @cos(float %56)
%58 = load float, float* %3
%59 = call float @sin(float %56)
%60 = fmul float %58, %59
%61 = load i32, i32* %2
%62 = icmp sgt i32 %61, -1
br i1 %62, label %65, label %63
63: ; preds = %52
%64 = load float, float* %1
br label %75
65: ; preds = %52
%66 = fmul float %60, 2.000000e+00
%67 = fpext float %66 to double
%68 = fdiv double %67, 9.810000e+00
%69 = fptrunc double %68 to float
%70 = load float, float* %1
%71 = fmul float %70, 1.600000e+01
%72 = fmul float %60, 1.500000e+01
%73 = fdiv float %71, %72
%74 = fadd float %73, %69
br label %75
75: ; preds = %63, %65
%76 = phi float [ %70, %65 ], [ %64, %63 ]
%77 = phi float [ %74, %65 ], [ undef, %63 ]
%78 = fmul float %50, %57
%79 = fmul float %78, %77
%80 = fpext float %76 to double
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), double %80)
%82 = load i32, i32* %2
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %82)
%84 = load float, float* %3
%85 = fpext float %84 to double
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), double %85)
%87 = fpext float %77 to double
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i64 0, i64 0), double %87)
%89 = fpext float %79 to double
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.17, i64 0, i64 0), double %89)
ret i32 0
}