#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 *, float *);
int main(void) {
  float knots;
  printf("Enter wind speed (knots): ");
  scanf("%f", &knots);
  if (knots < 1) {
    printf("Beaufort scale: Calm\n");
  } else if (knots <= 3) {
    printf("Beaufort scale: Light Air\n");
  } else if (knots <= 27) {
    printf("Beaufort scale: Breeze\n");
  } else if (knots <= 47) {
    printf("Beaufort scale: Gale\n");
  } else if (knots <= 63) {
    printf("Beaufort scale: Storm\n");
  } else {
    printf("Beaufort scale: Hurricane\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xead(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    116e <main+0x4e>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xfa>
movss  0xe8e(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1191 <main+0x71>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1215 <main+0xf5>
movss  0xe6f(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11b4 <main+0x94>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0xf0>
movss  0xe50(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11d7 <main+0xb7>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
movss  0xe31(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     11fa <main+0xda>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1206 <main+0xe6>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xeb>
jmp    1210 <main+0xf0>
jmp    1215 <main+0xf5>
jmp    121a <main+0xfa>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  0xea4(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    116a <main+0x3a>
lea    0xf40(%rip),%rdi
jmp    11c9 <main+0x99>
movss  0xe92(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11b0 <main+0x80>
movss  0xe89(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11b9 <main+0x89>
movss  0xe80(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    11c2 <main+0x92>
movss  0xe77(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xe8f(%rip),%rax
lea    0xea2(%rip),%rdi
cmovb  %rax,%rdi
jmp    11c9 <main+0x99>
lea    0xed7(%rip),%rdi
jmp    11c9 <main+0x99>
lea    0xeb7(%rip),%rdi
jmp    11c9 <main+0x99>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter wind speed (knots): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [22 x i8] c"Beaufort scale: Calm\0A\00"
@.str.3 = [27 x i8] c"Beaufort scale: Light Air\0A\00"
@.str.4 = [24 x i8] c"Beaufort scale: Breeze\0A\00"
@.str.5 = [22 x i8] c"Beaufort scale: Gale\0A\00"
@.str.6 = [23 x i8] c"Beaufort scale: Storm\0A\00"
@.str.7 = [27 x i8] c"Beaufort scale: Hurricane\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 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), float* %2)
%5 = load float, float* %2
%6 = fcmp olt float %5, 1.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %35
9: ; preds = %0
%10 = load float, float* %2
%11 = fcmp ole float %10, 3.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
br label %34
14: ; preds = %9
%15 = load float, float* %2
%16 = fcmp ole float %15, 2.700000e+01
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %33
19: ; preds = %14
%20 = load float, float* %2
%21 = fcmp ole float %20, 4.700000e+01
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %32
24: ; preds = %19
%25 = load float, float* %2
%26 = fcmp ole float %25, 6.300000e+01
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %31
29: ; preds = %24
%30 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %31
31: ; preds = %29, %27
br label %32
32: ; preds = %31, %22
br label %33
33: ; preds = %32, %17
br label %34
34: ; preds = %33, %12
br label %35
35: ; preds = %34, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter wind speed (knots): \00"
@.str.1 = [3 x i8] c"%f\00"
@str = [26 x i8] c"Beaufort scale: Hurricane\00"
@str.8 = [22 x i8] c"Beaufort scale: Storm\00"
@str.9 = [21 x i8] c"Beaufort scale: Gale\00"
@str.10 = [23 x i8] c"Beaufort scale: Breeze\00"
@str.11 = [26 x i8] c"Beaufort scale: Light Air\00"
@str.12 = [21 x i8] c"Beaufort scale: Calm\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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), float* %1)
%5 = load float, float* %1
%6 = fcmp olt float %5, 1.000000e+00
br i1 %6, label %16, label %7
7: ; preds = %0
%8 = fcmp ugt float %5, 3.000000e+00
br i1 %8, label %9, label %16
9: ; preds = %7
%10 = fcmp ugt float %5, 2.700000e+01
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = fcmp ugt float %5, 4.700000e+01
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = fcmp ugt float %5, 6.300000e+01
%15 = select i1 %14, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0)
br label %16
16: ; preds = %13, %11, %9, %7, %0
%17 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.12, i64 0, i64 0), %0 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.11, i64 0, i64 0), %7 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0), %9 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0), %11 ], [ %15, %13 ]
%18 = call i32 @puts(i8* dereferenceable(1) %17)
ret i32 0
}