#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 number;
  scanf("%d", &number);
  switch (number) {
  case 10:
    printf("Number is 10\n");
  case 9:
    printf("Number is 9\n");
    break;
  case 8:
    printf("Number is 8\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     1192 <main+0x72>
jmp    1153 <main+0x33>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
je     1181 <main+0x61>
jmp    1164 <main+0x44>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
jne    119e <main+0x7e>
jmp    1175 <main+0x55>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    119e <main+0x7e>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x8,%eax
je     115e <main+0x3e>
lea    0xec9(%rip),%rbx
cmp    $0x9,%eax
je     1165 <main+0x45>
cmp    $0xa,%eax
jne    116d <main+0x4d>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
jmp    1165 <main+0x45>
lea    0xe9e(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"Number is 10\0A\00"
@.str.2 = [13 x i8] c"Number is 9\0A\00"
@.str.3 = [13 x i8] c"Number is 8\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
switch i32 %4, label %11 [
i32 10, label %5
i32 9, label %7
i32 8, label %9
]
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %0, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [12 x i8] c"Number is 8\00"
@str.4 = [12 x i8] c"Number is 9\00"
@str.5 = [13 x i8] c"Number is 10\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %11 [
i32 10, label %5
i32 9, label %8
i32 8, label %7
]
5: ; preds = %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
br label %8
7: ; preds = %0
br label %8
8: ; preds = %5, %0, %7
%9 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %5 ]
%10 = call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %8, %0
ret i32 0
}