unsigned int get_Eclass(const unsigned int type) {
  if (type == 15 || type == 1 || type == 3 || type == 5)
    return 0;
  else if (type == 2 || type == 4)
    return 1;
  else if (type == 7)
    return 2;
  else if (type == 6)
    return 3;
  printf("Error: There is not yet an element class associated with the type "
         "provided.\n"),
      exit(1);
}


x86 assembly (clang, -O0):
<get_Eclass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
je     1153 <get_Eclass+0x33>
cmpl   $0x1,-0x8(%rbp)
je     1153 <get_Eclass+0x33>
cmpl   $0x3,-0x8(%rbp)
je     1153 <get_Eclass+0x33>
cmpl   $0x5,-0x8(%rbp)
jne    115f <get_Eclass+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    11d2 <get_Eclass+0xb2>
cmpl   $0x2,-0x8(%rbp)
je     1173 <get_Eclass+0x53>
cmpl   $0x4,-0x8(%rbp)
jne    117f <get_Eclass+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    11d2 <get_Eclass+0xb2>
cmpl   $0x7,-0x8(%rbp)
jne    1195 <get_Eclass+0x75>
movl   $0x2,-0x4(%rbp)
jmp    11d2 <get_Eclass+0xb2>
cmpl   $0x6,-0x8(%rbp)
jne    11ab <get_Eclass+0x8b>
movl   $0x3,-0x4(%rbp)
jmp    11d2 <get_Eclass+0xb2>
jmp    11b0 <get_Eclass+0x90>
jmp    11b5 <get_Eclass+0x95>
jmp    11ba <get_Eclass+0x9a>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_Eclass>:
push   %rax
lea    -0x1(%rdi),%ecx
ror    %ecx
cmp    $0x8,%ecx
jae    1137 <get_Eclass+0x17>
xor    %eax,%eax
mov    $0x87,%edx
bt     %ecx,%edx
jb     1156 <get_Eclass+0x36>
add    $0xfffffffe,%edi
cmp    $0x6,%edi
jae    1158 <get_Eclass+0x38>
mov    $0x35,%eax
bt     %edi,%eax
jae    1158 <get_Eclass+0x38>
movslq %edi,%rax
lea    0xef9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Error: There is not yet an element class associated with the type provided.\0A\00"
define i32 @get_Eclass(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 15
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 1
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 3
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %6, %1
store i32 0, i32* %2
br label %36
16: ; preds = %12
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 2
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 4
br i1 %21, label %22, label %23
22: ; preds = %19, %16
store i32 1, i32* %2
br label %36
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 7
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 2, i32* %2
br label %36
27: ; preds = %23
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 6
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 3, i32* %2
br label %36
31: ; preds = %27
br label %32
32: ; preds = %31
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
unreachable
36: ; preds = %30, %26, %22, %15
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
@str = [76 x i8] c"Error: There is not yet an element class associated with the type provided.\00"
@switch.table.get_Eclass = [6 x i32] [i32 1, i32 1, i32 1, i32 1, i32 3, i32 2]
define i32 @get_Eclass(i32 %0) {
%2 = add i32 %0, -1
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 31)
%4 = icmp ult i32 %3, 8
br i1 %4, label %10, label %5
5: ; preds = %10, %1
%6 = add i32 %0, -2
%7 = icmp ult i32 %6, 6
br i1 %7, label %15, label %8
8: ; preds = %15, %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
10: ; preds = %1
%11 = trunc i32 %3 to i8
%12 = lshr i8 -121, %11
%13 = and i8 %12, 1
%14 = icmp eq i8 %13, 0
br i1 %14, label %5, label %24
15: ; preds = %5
%16 = trunc i32 %6 to i8
%17 = lshr i8 53, %16
%18 = and i8 %17, 1
%19 = icmp eq i8 %18, 0
br i1 %19, label %8, label %20
20: ; preds = %15
%21 = sext i32 %6 to i64
%22 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.get_Eclass, i64 0, i64 %21
%23 = load i32, i32* %22
br label %24
24: ; preds = %10, %20
%25 = phi i32 [ %23, %20 ], [ 0, %10 ]
ret i32 %25
}