#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int wind_force;
  printf("Enter wind speed in knots: ");
  scanf("%d", &wind_force);
  printf("Wind speed: %d \n", wind_force);
  printf("Description: ");
  if (wind_force < 0) {
    printf("Negative wind forces not allowed.\n");
  } else if (wind_force < 1) {
    printf("Calm");
  } else if (wind_force <= 3) {
    printf("Light air");
  } else if (wind_force <= 27) {
    printf("Breeze");
  } else if (wind_force <= 47) {
    printf("Gale");
  } else if (wind_force <= 63) {
    printf("Storm");
  } else {
    printf("Hurricane");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1189 <main+0x69>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1241 <main+0x121>
cmpl   $0x1,-0x8(%rbp)
jge    11a6 <main+0x86>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123c <main+0x11c>
cmpl   $0x3,-0x8(%rbp)
jg     11c3 <main+0xa3>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1237 <main+0x117>
cmpl   $0x1b,-0x8(%rbp)
jg     11e0 <main+0xc0>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1232 <main+0x112>
cmpl   $0x2f,-0x8(%rbp)
jg     11fd <main+0xdd>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122d <main+0x10d>
cmpl   $0x3f,-0x8(%rbp)
jg     121a <main+0xfa>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1228 <main+0x108>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122d <main+0x10d>
jmp    1232 <main+0x112>
jmp    1237 <main+0x117>
jmp    123c <main+0x11c>
jmp    1241 <main+0x121>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
js     1188 <main+0x58>
je     1196 <main+0x66>
cmp    $0x3,%eax
ja     119f <main+0x6f>
lea    0xebd(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
jmp    11d7 <main+0xa7>
lea    0xea1(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x1b,%eax
ja     11ad <main+0x7d>
lea    0xea2(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x2f,%eax
ja     11bb <main+0x8b>
lea    0xe9b(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x3f,%eax
ja     11c9 <main+0x99>
lea    0xe92(%rip),%rdi
jmp    11d0 <main+0xa0>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter wind speed in knots: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Wind speed: %d \0A\00"
@.str.3 = [14 x i8] c"Description: \00"
@.str.4 = [35 x i8] c"Negative wind forces not allowed.\0A\00"
@.str.5 = [5 x i8] c"Calm\00"
@.str.6 = [10 x i8] c"Light air\00"
@.str.7 = [7 x i8] c"Breeze\00"
@.str.8 = [5 x i8] c"Gale\00"
@.str.9 = [6 x i8] c"Storm\00"
@.str.10 = [10 x i8] c"Hurricane\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0))
br label %44
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %43
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %42
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 27
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %41
27: ; preds = %22
%28 = load i32, i32* %2
%29 = icmp sle i32 %28, 47
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %40
32: ; preds = %27
%33 = load i32, i32* %2
%34 = icmp sle i32 %33, 63
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %39
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %40
40: ; preds = %39, %30
br label %41
41: ; preds = %40, %25
br label %42
42: ; preds = %41, %20
br label %43
43: ; preds = %42, %15
br label %44
44: ; preds = %43, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter wind speed in knots: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Wind speed: %d \0A\00"
@.str.3 = [14 x i8] c"Description: \00"
@.str.5 = [5 x i8] c"Calm\00"
@.str.6 = [10 x i8] c"Light air\00"
@.str.7 = [7 x i8] c"Breeze\00"
@.str.8 = [5 x i8] c"Gale\00"
@.str.9 = [6 x i8] c"Storm\00"
@.str.10 = [10 x i8] c"Hurricane\00"
@str = [34 x i8] c"Negative wind forces not allowed.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %34
12: ; preds = %0
%13 = icmp eq i32 %8, 0
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %34
16: ; preds = %12
%17 = icmp ult i32 %8, 4
br i1 %17, label %18, label %20
18: ; preds = %16
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %34
20: ; preds = %16
%21 = icmp ult i32 %8, 28
br i1 %21, label %22, label %24
22: ; preds = %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %34
24: ; preds = %20
%25 = icmp ult i32 %8, 48
br i1 %25, label %26, label %28
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %34
28: ; preds = %24
%29 = icmp ult i32 %8, 64
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
br label %34
34: ; preds = %14, %22, %30, %32, %26, %18, %10
ret i32 0
}