unsigned char seven_seg_com_cath(unsigned char number,
                                 unsigned char decimal_select) {
  if (decimal_select == 1) {
    switch (number) {
    case 0:
      return 0xBF;
    case 1:
      return 0x86;
    case 2:
      return 0xDB;
    case 3:
      return 0xCF;
    case 4:
      return 0xE6;
    case 5:
      return 0xED;
    case 6:
      return 0xFD;
    case 7:
      return 0xA7;
    case 8:
      return 0xFF;
    case 9:
      return 0xEF;
    }
  } else if (decimal_select == 0) {
    switch (number) {
    case 0:
      return 0x3F;
    case 1:
      return 0x06;
    case 2:
      return 0x5B;
    case 3:
      return 0x4F;
    case 4:
      return 0x66;
    case 5:
      return 0x6D;
    case 6:
      return 0x7D;
    case 7:
      return 0x27;
    case 8:
      return 0x7F;
    case 9:
      return 0x6F;
    }
  }
}


x86 assembly (clang, -O0):
<seven_seg_com_cath>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x1,%eax
jne    11a2 <seven_seg_com_cath+0xa2>
movzbl -0x2(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x9,%rax
ja     119d <seven_seg_com_cath+0x9d>
mov    -0x10(%rbp),%rax
lea    0xeee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0xbf,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x86,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xdb,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xcf,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xe6,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xed,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xfd,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xa7,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xff,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0xef,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
jmp    1239 <seven_seg_com_cath+0x139>
movzbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jne    1234 <seven_seg_com_cath+0x134>
movzbl -0x2(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x9,%rax
ja     122f <seven_seg_com_cath+0x12f>
mov    -0x18(%rbp),%rax
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x3f,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x6,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x5b,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x4f,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x66,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x6d,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x7d,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x27,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x7f,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
movb   $0x6f,-0x1(%rbp)
jmp    1239 <seven_seg_com_cath+0x139>
jmp    1234 <seven_seg_com_cath+0x134>
jmp    1239 <seven_seg_com_cath+0x139>
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seven_seg_com_cath>:
test   %esi,%esi
je     1123 <seven_seg_com_cath+0x23>
cmp    $0x1,%sil
jne    113f <seven_seg_com_cath+0x3f>
add    $0xff,%dil
mov    $0xbf,%al
cmp    $0x9,%dil
jae    113f <seven_seg_com_cath+0x3f>
movsbq %dil,%rcx
lea    0xedf(%rip),%rax
jmp    113a <seven_seg_com_cath+0x3a>
add    $0xff,%dil
mov    $0x3f,%al
cmp    $0x9,%dil
jae    113f <seven_seg_com_cath+0x3f>
movsbq %dil,%rcx
lea    0xecf(%rip),%rax
add    %rcx,%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
define zeroext i8 @seven_seg_com_cath(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
switch i32 %11, label %22 [
i32 0, label %12
i32 1, label %13
i32 2, label %14
i32 3, label %15
i32 4, label %16
i32 5, label %17
i32 6, label %18
i32 7, label %19
i32 8, label %20
i32 9, label %21
]
12: ; preds = %9
store i8 -65, i8* %3
br label %42
13: ; preds = %9
store i8 -122, i8* %3
br label %42
14: ; preds = %9
store i8 -37, i8* %3
br label %42
15: ; preds = %9
store i8 -49, i8* %3
br label %42
16: ; preds = %9
store i8 -26, i8* %3
br label %42
17: ; preds = %9
store i8 -19, i8* %3
br label %42
18: ; preds = %9
store i8 -3, i8* %3
br label %42
19: ; preds = %9
store i8 -89, i8* %3
br label %42
20: ; preds = %9
store i8 -1, i8* %3
br label %42
21: ; preds = %9
store i8 -17, i8* %3
br label %42
22: ; preds = %9
br label %42
23: ; preds = %2
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %41
27: ; preds = %23
%28 = load i8, i8* %4
%29 = zext i8 %28 to i32
switch i32 %29, label %40 [
i32 0, label %30
i32 1, label %31
i32 2, label %32
i32 3, label %33
i32 4, label %34
i32 5, label %35
i32 6, label %36
i32 7, label %37
i32 8, label %38
i32 9, label %39
]
30: ; preds = %27
store i8 63, i8* %3
br label %42
31: ; preds = %27
store i8 6, i8* %3
br label %42
32: ; preds = %27
store i8 91, i8* %3
br label %42
33: ; preds = %27
store i8 79, i8* %3
br label %42
34: ; preds = %27
store i8 102, i8* %3
br label %42
35: ; preds = %27
store i8 109, i8* %3
br label %42
36: ; preds = %27
store i8 125, i8* %3
br label %42
37: ; preds = %27
store i8 39, i8* %3
br label %42
38: ; preds = %27
store i8 127, i8* %3
br label %42
39: ; preds = %27
store i8 111, i8* %3
br label %42
40: ; preds = %27
br label %41
41: ; preds = %40, %23
br label %42
42: ; preds = %12, %13, %14, %15, %16, %17, %18, %19, %20, %21, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %41, %22
%43 = load i8, i8* %3
ret i8 %43
}

LLVM IR (-O2):
@switch.table.seven_seg_com_cath = [9 x i8] c"\86\DB\CF\E6\ED\FD\A7\FF\EF"
@switch.table.seven_seg_com_cath.1 = [9 x i8] c"\06[Ofm}'\7Fo"
define zeroext i8 @seven_seg_com_cath(i8 zeroext %0, i8 zeroext %1) {
switch i8 %1, label %18 [
i8 1, label %3
i8 0, label %6
]
3: ; preds = %2
%4 = add i8 %0, -1
%5 = icmp ult i8 %4, 9
br i1 %5, label %9, label %18
6: ; preds = %2
%7 = add i8 %0, -1
%8 = icmp ult i8 %7, 9
br i1 %8, label %12, label %18
9: ; preds = %3
%10 = sext i8 %4 to i64
%11 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.seven_seg_com_cath, i64 0, i64 %10
br label %15
12: ; preds = %6
%13 = sext i8 %7 to i64
%14 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.seven_seg_com_cath.1, i64 0, i64 %13
br label %15
15: ; preds = %9, %12
%16 = phi i8* [ %14, %12 ], [ %11, %9 ]
%17 = load i8, i8* %16
br label %18
18: ; preds = %15, %6, %3, %2
%19 = phi i8 [ -65, %3 ], [ undef, %2 ], [ 63, %6 ], [ %17, %15 ]
ret i8 %19
}