#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 argc, char *argv[]) {
  int a;
  scanf("%d", &a);
  switch (a) {
  case 1:
    printf("1 \n");
  case 3:
    printf("3 \n");
    break;
  case 2:
    printf("2 \n");
    break;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     117c <main+0x5c>
jmp    115a <main+0x3a>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1199 <main+0x79>
jmp    116b <main+0x4b>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     1188 <main+0x68>
jmp    11a5 <main+0x85>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
jmp    11a5 <main+0x85>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%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>
lea    0xec9(%rip),%rbx
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
je     1165 <main+0x45>
cmp    $0x2,%eax
je     115e <main+0x3e>
cmp    $0x1,%eax
jne    116d <main+0x4d>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
jmp    1165 <main+0x45>
lea    0xe9e(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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