#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 sse_level();
int main(int argc, char **argv) {
  switch (sse_level()) {
  case 1:
    printf("sse\n");
    break;
  case 2:
    printf("sse2\n");
    break;
  case 3:
    printf("sse3\n");
    break;
  }
}


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)
xor    %eax,%eax
call   1040 <sse_level@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x1,%eax
je     1172 <main+0x52>
jmp    1150 <main+0x30>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1183 <main+0x63>
jmp    1161 <main+0x41>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     1194 <main+0x74>
jmp    11a0 <main+0x80>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sse_level@plt>
add    $0xffffffff,%eax
cmp    $0x2,%eax
ja     1145 <main+0x25>
cltq
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"sse3\00"
@str.3 = [5 x i8] c"sse2\00"
@str.4 = [4 x i8] c"sse\00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @str to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sse_level()
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 3
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = sext i32 %4 to i64
%8 = shl i64 %7, 2
%9 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %2, %6
ret i32 0
}