#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*/ puts(char *);
int func_1(int a, int b) {
  puts("func_1");
  switch (a) {
  case 2:
    puts("2");
    break;
  case 10:
    puts("LOL");
    break;
  case 12:
    puts("Bad!");
    break;
  case 14:
    puts("14");
    break;
  case 15:
    puts("15");
    break;
  case 16:
    puts("!6");
    break;
  case 22:
    puts("22");
    break;
  case 24:
    puts("24");
    break;
  case 28:
    puts("28");
    break;
  case 38:
    puts("38");
    switch (b) {
    case 1:
      puts("b = 1\n");
      break;
    case 2:
      puts("b = 2\n");
      break;
    case 3:
      puts("b = 3\n");
      break;
    case 4:
      puts("b = 4\n");
      break;
    case 5:
      puts("b = 5\n");
      break;
    default:
      puts("b = something\n");
      break;
    }
    break;
  default:
    puts("Umm...");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xf83(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x24,%eax
ja     1287 <func_1+0x177>
mov    -0x10(%rbp),%rax
lea    0xeb6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf68(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xf44(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x4,%eax
ja     1276 <func_1+0x166>
mov    -0x18(%rbp),%rax
lea    0xe7c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
jmp    1282 <func_1+0x172>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
jmp    1282 <func_1+0x172>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
jmp    1282 <func_1+0x172>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
jmp    1282 <func_1+0x172>
lea    0xe7d(%rip),%rdi
call   1030 <puts@plt>
jmp    1282 <func_1+0x172>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
jmp    1293 <func_1+0x183>
lea    0xe71(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xf8a(%rip),%rdi
call   1030 <puts@plt>
add    $0xfffffffe,%ebx
cmp    $0x24,%ebx
ja     114b <func_1+0x3b>
lea    0xf90(%rip),%rdi
lea    0xec7(%rip),%rax
movslq (%rax,%rbx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf66(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xfad(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf58(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf54(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf4e(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf48(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf42(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf3c(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
cmp    $0x5,%ebp
jae    11ba <func_1+0xaa>
movslq %ebp,%rax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf0f(%rip),%rdi
jmp    11c1 <func_1+0xb1>
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"func_1\00"
@.str.1 = [2 x i8] c"2\00"
@.str.2 = [4 x i8] c"LOL\00"
@.str.3 = [5 x i8] c"Bad!\00"
@.str.4 = [3 x i8] c"14\00"
@.str.5 = [3 x i8] c"15\00"
@.str.6 = [3 x i8] c"!6\00"
@.str.7 = [3 x i8] c"22\00"
@.str.8 = [3 x i8] c"24\00"
@.str.9 = [3 x i8] c"28\00"
@.str.10 = [3 x i8] c"38\00"
@.str.11 = [7 x i8] c"b = 1\0A\00"
@.str.12 = [7 x i8] c"b = 2\0A\00"
@.str.13 = [7 x i8] c"b = 3\0A\00"
@.str.14 = [7 x i8] c"b = 4\0A\00"
@.str.15 = [7 x i8] c"b = 5\0A\00"
@.str.16 = [15 x i8] c"b = something\0A\00"
@.str.17 = [7 x i8] c"Umm...\00"
define i32 @func_1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
switch i32 %6, label %41 [
i32 2, label %7
i32 10, label %9
i32 12, label %11
i32 14, label %13
i32 15, label %15
i32 16, label %17
i32 22, label %19
i32 24, label %21
i32 28, label %23
i32 38, label %25
]
7: ; preds = %2
%8 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
9: ; preds = %2
%10 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %43
11: ; preds = %2
%12 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %43
13: ; preds = %2
%14 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %43
15: ; preds = %2
%16 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %43
17: ; preds = %2
%18 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %43
19: ; preds = %2
%20 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %43
21: ; preds = %2
%22 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %43
23: ; preds = %2
%24 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %43
25: ; preds = %2
%26 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%27 = load i32, i32* %4
switch i32 %27, label %38 [
i32 1, label %28
i32 2, label %30
i32 3, label %32
i32 4, label %34
i32 5, label %36
]
28: ; preds = %25
%29 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %40
30: ; preds = %25
%31 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
br label %40
32: ; preds = %25
%33 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
br label %40
34: ; preds = %25
%35 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
br label %40
36: ; preds = %25
%37 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %40
38: ; preds = %25
%39 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0))
br label %40
40: ; preds = %38, %36, %34, %32, %30, %28
br label %43
41: ; preds = %2
%42 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0))
br label %43
43: ; preds = %41, %40, %23, %21, %19, %17, %15, %13, %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"func_1\00"
@.str.1 = [2 x i8] c"2\00"
@.str.2 = [4 x i8] c"LOL\00"
@.str.3 = [5 x i8] c"Bad!\00"
@.str.4 = [3 x i8] c"14\00"
@.str.5 = [3 x i8] c"15\00"
@.str.6 = [3 x i8] c"!6\00"
@.str.7 = [3 x i8] c"22\00"
@.str.8 = [3 x i8] c"24\00"
@.str.9 = [3 x i8] c"28\00"
@.str.10 = [3 x i8] c"38\00"
@.str.11 = [7 x i8] c"b = 1\0A\00"
@.str.12 = [7 x i8] c"b = 2\0A\00"
@.str.13 = [7 x i8] c"b = 3\0A\00"
@.str.14 = [7 x i8] c"b = 4\0A\00"
@.str.15 = [7 x i8] c"b = 5\0A\00"
@.str.16 = [15 x i8] c"b = something\0A\00"
@.str.17 = [7 x i8] c"Umm...\00"
@reltable.func_1 = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.11 to i64), i64 ptrtoint ([5 x i32]* @reltable.func_1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.12 to i64), i64 ptrtoint ([5 x i32]* @reltable.func_1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.13 to i64), i64 ptrtoint ([5 x i32]* @reltable.func_1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.14 to i64), i64 ptrtoint ([5 x i32]* @reltable.func_1 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.15 to i64), i64 ptrtoint ([5 x i32]* @reltable.func_1 to i64)) to i32)]
define i32 @func_1(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %16 [
i32 2, label %21
i32 10, label %4
i32 12, label %5
i32 14, label %6
i32 15, label %7
i32 16, label %8
i32 22, label %9
i32 24, label %10
i32 28, label %11
i32 38, label %12
]
4: ; preds = %2
br label %21
5: ; preds = %2
br label %21
6: ; preds = %2
br label %21
7: ; preds = %2
br label %21
8: ; preds = %2
br label %21
9: ; preds = %2
br label %21
10: ; preds = %2
br label %21
11: ; preds = %2
br label %21
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%14 = add i32 %1, -1
%15 = icmp ult i32 %14, 5
br i1 %15, label %17, label %21
16: ; preds = %2
br label %21
17: ; preds = %12
%18 = sext i32 %14 to i64
%19 = shl i64 %18, 2
%20 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.func_1 to i8*), i64 %19)
br label %21
21: ; preds = %12, %17, %2, %16, %11, %10, %9, %8, %7, %6, %5, %4
%22 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), %16 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), %11 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), %10 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), %9 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %20, %17 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), %12 ]
%23 = tail call i32 @puts(i8* dereferenceable(1) %22)
ret i32 0
}