unsigned char Tetris_DecToSevenSeg(unsigned char score) {
  unsigned char controlSig = 0x00;
  if (score == 9) {
    controlSig = 0x0B;
  } else if (score == 8) {
    controlSig = 0x08;
  } else if (score == 7) {
    controlSig = 0xCB;
  } else if (score == 6) {
    controlSig = 0x18;
  } else if (score == 5) {
    controlSig = 0x19;
  } else if (score == 4) {
    controlSig = 0x2B;
  } else if (score == 3) {
    controlSig = 0x49;
  } else if (score == 2) {
    controlSig = 0x4C;
  } else if (score == 1) {
    controlSig = 0xEB;
  } else if (score == 0) {
    controlSig = 0x88;
  }
  return controlSig;
}


x86 assembly (clang, -O0):
<Tetris_DecToSevenSeg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jne    1124 <Tetris_DecToSevenSeg+0x24>
movb   $0xb,-0x2(%rbp)
jmp    1212 <Tetris_DecToSevenSeg+0x112>
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jne    113a <Tetris_DecToSevenSeg+0x3a>
movb   $0x8,-0x2(%rbp)
jmp    120d <Tetris_DecToSevenSeg+0x10d>
movzbl -0x1(%rbp),%eax
cmp    $0x7,%eax
jne    1150 <Tetris_DecToSevenSeg+0x50>
movb   $0xcb,-0x2(%rbp)
jmp    1208 <Tetris_DecToSevenSeg+0x108>
movzbl -0x1(%rbp),%eax
cmp    $0x6,%eax
jne    1166 <Tetris_DecToSevenSeg+0x66>
movb   $0x18,-0x2(%rbp)
jmp    1203 <Tetris_DecToSevenSeg+0x103>
movzbl -0x1(%rbp),%eax
cmp    $0x5,%eax
jne    117c <Tetris_DecToSevenSeg+0x7c>
movb   $0x19,-0x2(%rbp)
jmp    11fe <Tetris_DecToSevenSeg+0xfe>
movzbl -0x1(%rbp),%eax
cmp    $0x4,%eax
jne    1192 <Tetris_DecToSevenSeg+0x92>
movb   $0x2b,-0x2(%rbp)
jmp    11f9 <Tetris_DecToSevenSeg+0xf9>
movzbl -0x1(%rbp),%eax
cmp    $0x3,%eax
jne    11a8 <Tetris_DecToSevenSeg+0xa8>
movb   $0x49,-0x2(%rbp)
jmp    11f4 <Tetris_DecToSevenSeg+0xf4>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    11be <Tetris_DecToSevenSeg+0xbe>
movb   $0x4c,-0x2(%rbp)
jmp    11ef <Tetris_DecToSevenSeg+0xef>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    11d4 <Tetris_DecToSevenSeg+0xd4>
movb   $0xeb,-0x2(%rbp)
jmp    11ea <Tetris_DecToSevenSeg+0xea>
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    11e5 <Tetris_DecToSevenSeg+0xe5>
movb   $0x88,-0x2(%rbp)
jmp    11ea <Tetris_DecToSevenSeg+0xea>
jmp    11ef <Tetris_DecToSevenSeg+0xef>
jmp    11f4 <Tetris_DecToSevenSeg+0xf4>
jmp    11f9 <Tetris_DecToSevenSeg+0xf9>
jmp    11fe <Tetris_DecToSevenSeg+0xfe>
jmp    1203 <Tetris_DecToSevenSeg+0x103>
jmp    1208 <Tetris_DecToSevenSeg+0x108>
jmp    120d <Tetris_DecToSevenSeg+0x10d>
jmp    1212 <Tetris_DecToSevenSeg+0x112>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tetris_DecToSevenSeg>:
cmp    $0x9,%dil
ja     1115 <Tetris_DecToSevenSeg+0x15>
movsbq %dil,%rax
lea    0xeef(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @Tetris_DecToSevenSeg(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 9
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 11, i8* %3
br label %62
8: ; preds = %1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 8
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 8, i8* %3
br label %61
13: ; preds = %8
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 7
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 -53, i8* %3
br label %60
18: ; preds = %13
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 6
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 24, i8* %3
br label %59
23: ; preds = %18
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 5
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 25, i8* %3
br label %58
28: ; preds = %23
%29 = load i8, i8* %2
%30 = zext i8 %29 to i32
%31 = icmp eq i32 %30, 4
br i1 %31, label %32, label %33
32: ; preds = %28
store i8 43, i8* %3
br label %57
33: ; preds = %28
%34 = load i8, i8* %2
%35 = zext i8 %34 to i32
%36 = icmp eq i32 %35, 3
br i1 %36, label %37, label %38
37: ; preds = %33
store i8 73, i8* %3
br label %56
38: ; preds = %33
%39 = load i8, i8* %2
%40 = zext i8 %39 to i32
%41 = icmp eq i32 %40, 2
br i1 %41, label %42, label %43
42: ; preds = %38
store i8 76, i8* %3
br label %55
43: ; preds = %38
%44 = load i8, i8* %2
%45 = zext i8 %44 to i32
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %48
47: ; preds = %43
store i8 -21, i8* %3
br label %54
48: ; preds = %43
%49 = load i8, i8* %2
%50 = zext i8 %49 to i32
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %48
store i8 -120, i8* %3
br label %53
53: ; preds = %52, %48
br label %54
54: ; preds = %53, %47
br label %55
55: ; preds = %54, %42
br label %56
56: ; preds = %55, %37
br label %57
57: ; preds = %56, %32
br label %58
58: ; preds = %57, %27
br label %59
59: ; preds = %58, %22
br label %60
60: ; preds = %59, %17
br label %61
61: ; preds = %60, %12
br label %62
62: ; preds = %61, %7
%63 = load i8, i8* %3
ret i8 %63
}

LLVM IR (-O2):
@switch.table.Tetris_DecToSevenSeg = [10 x i8] c"\88\EBLI+\19\18\CB\08\0B"
define zeroext i8 @Tetris_DecToSevenSeg(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [10 x i8], [10 x i8]* @switch.table.Tetris_DecToSevenSeg, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 0, %1 ]
ret i8 %8
}