#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 n;
  scanf("%d", &n);
  printf("%d is ", n);
  switch (n) {
  case 2:
    printf("two.\n");
    break;
  case 3:
    printf("two plus ");
  case 1:
    printf("one.\n");
    break;
  default:
    printf("otherwise.\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),%esi
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11a7 <main+0x87>
jmp    1164 <main+0x44>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1186 <main+0x66>
jmp    1175 <main+0x55>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1199 <main+0x79>
jmp    11ba <main+0x9a>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c8 <main+0xa8>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1175 <main+0x45>
cmp    $0x2,%eax
je     117e <main+0x4e>
cmp    $0x3,%eax
jne    1187 <main+0x57>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
jmp    118e <main+0x5e>
lea    0xe94(%rip),%rdi
jmp    118e <main+0x5e>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d is \00"
@.str.2 = [6 x i8] c"two.\0A\00"
@.str.3 = [10 x i8] c"two plus \00"
@.str.4 = [6 x i8] c"one.\0A\00"
@.str.5 = [12 x i8] c"otherwise.\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
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
switch i32 %6, label %13 [
i32 2, label %7
i32 3, label %9
i32 1, label %11
]
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %15
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %0, %9
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %13, %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d is \00"
@.str.3 = [10 x i8] c"two plus \00"
@str = [5 x i8] c"one.\00"
@str.6 = [5 x i8] c"two.\00"
@str.7 = [11 x i8] c"otherwise.\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
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
switch i32 %6, label %10 [
i32 2, label %11
i32 3, label %7
i32 1, label %9
]
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
br label %11
10: ; preds = %0
br label %11
11: ; preds = %0, %10, %9
%12 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.6, i64 0, i64 0), %0 ]
%13 = call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}