#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(void) {
  int wind_speed = 0;
  printf("enter the wind speed:\n");
  scanf("%d", &wind_speed);
  int flag = 0;
  if (wind_speed < 1) {
    flag = 0;
  } else if (wind_speed < 4) {
    flag = 1;
  } else if (wind_speed < 28) {
    flag = 2;
  } else if (wind_speed < 48) {
    flag = 3;
  } else if (wind_speed < 64) {
    flag = 4;
  } else {
    flag = 5;
  }
  switch (flag) {
  case 0:
    printf("Calm\n");
    break;
  case 1:
    printf("Light air\n");
    break;
  case 2:
    printf("Breeze\n");
    break;
  case 3:
    printf("Gale\n");
    break;
  case 4:
    printf("Storm\n");
    break;
  case 5:
    printf("Hurricane\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    116f <main+0x4f>
movl   $0x0,-0xc(%rbp)
jmp    11e2 <main+0xc2>
cmpl   $0x4,-0x8(%rbp)
jge    1185 <main+0x65>
movl   $0x1,-0xc(%rbp)
jmp    11dd <main+0xbd>
cmpl   $0x1c,-0x8(%rbp)
jge    119b <main+0x7b>
movl   $0x2,-0xc(%rbp)
jmp    11d8 <main+0xb8>
cmpl   $0x30,-0x8(%rbp)
jge    11b1 <main+0x91>
movl   $0x3,-0xc(%rbp)
jmp    11d3 <main+0xb3>
cmpl   $0x40,-0x8(%rbp)
jge    11c7 <main+0xa7>
movl   $0x4,-0xc(%rbp)
jmp    11ce <main+0xae>
movl   $0x5,-0xc(%rbp)
jmp    11d3 <main+0xb3>
jmp    11d8 <main+0xb8>
jmp    11dd <main+0xbd>
jmp    11e2 <main+0xc2>
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     1268 <main+0x148>
mov    -0x18(%rbp),%rax
lea    0xe02(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    1268 <main+0x148>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
jmp    1268 <main+0x148>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
jmp    1268 <main+0x148>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
jmp    1268 <main+0x148>
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
jmp    1268 <main+0x148>
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    115c <main+0x3c>
cmp    $0x4,%eax
jae    1165 <main+0x45>
lea    0xedb(%rip),%rdi
jmp    1196 <main+0x76>
lea    0xedc(%rip),%rdi
jmp    1196 <main+0x76>
cmp    $0x1c,%eax
jae    1173 <main+0x53>
lea    0xebd(%rip),%rdi
jmp    1196 <main+0x76>
cmp    $0x30,%eax
jae    1181 <main+0x61>
lea    0xeaa(%rip),%rdi
jmp    1196 <main+0x76>
cmp    $0x40,%eax
lea    0xe98(%rip),%rax
lea    0xe87(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [22 x i8] c"enter the wind speed:\00"
@str.8 = [10 x i8] c"Hurricane\00"
@str.9 = [6 x i8] c"Storm\00"
@str.10 = [5 x i8] c"Gale\00"
@str.11 = [7 x i8] c"Breeze\00"
@str.12 = [10 x i8] c"Light air\00"
@str.13 = [5 x i8] c"Calm\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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 = icmp slt i32 %5, 1
br i1 %6, label %16, label %7
7: ; preds = %0
%8 = icmp ult i32 %5, 4
br i1 %8, label %16, label %9
9: ; preds = %7
%10 = icmp ult i32 %5, 28
br i1 %10, label %16, label %11
11: ; preds = %9
%12 = icmp ult i32 %5, 48
br i1 %12, label %16, label %13
13: ; preds = %11
%14 = icmp ult i32 %5, 64
%15 = select i1 %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0)
br label %16
16: ; preds = %11, %9, %7, %0, %13
%17 = phi i8* [ %15, %13 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.13, i64 0, i64 0), %0 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.12, i64 0, i64 0), %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.11, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0), %11 ]
%18 = call i32 @puts(i8* dereferenceable(1) %17)
ret i32 0
}