#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i = 1;
  switch (i) {
  case 1:
    printf("1\n");
    break;
  case 2:
    printf("2\n");
    break;
  default:
    printf("Don't match\n");
  }
  i = 10;
  switch (i) {
  case 1:
    printf("1\n");
    break;
  case 2:
    printf("2\n");
    break;
  default:
    printf("Don't match\n");
  }
  return (EXIT_SUCCESS);
}


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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1152 <main+0x42>
jmp    1141 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     1163 <main+0x53>
jmp    1174 <main+0x64>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     11ac <main+0x9c>
jmp    119b <main+0x8b>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     11bd <main+0xad>
jmp    11ce <main+0xbe>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0xca>
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
jmp    11da <main+0xca>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dff(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [13 x i8] c"Don't match\0A\00"
@EXIT_SUCCESS = global i32 0
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
store i32 1, i32* %6
%7 = load i32, i32* %6
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %10
]
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %14
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8
store i32 10, i32* %6
%15 = load i32, i32* %6
switch i32 %15, label %20 [
i32 1, label %16
i32 2, label %18
]
16: ; preds = %14
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %22
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %18, %16
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [2 x i8] c"1\00"
@str.3 = [12 x i8] c"Don't match\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}