char convert_number(number)
char number;
{
  char return_value;
  switch (number) {
  case '0': {
    return_value = 0x01;
    break;
  }
  case '1': {
    return_value = 0x10;
    break;
  }
  case '2': {
    return_value = 0x08;
    break;
  }
  case '3': {
    return_value = 0x19;
    break;
  }
  case '4': {
    return_value = 0x04;
    break;
  }
  case '5': {
    return_value = 0x15;
    break;
  }
  case '6': {
    return_value = 0x0d;
    break;
  }
  case '7': {
    return_value = 0x1c;
    break;
  }
  case '8': {
    return_value = 0x02;
    break;
  }
  case '9': {
    return_value = 0x13;
    break;
  }
  default:
    return_value = 0x01;
  }
  return (return_value);
}


x86 assembly (clang, -O0):
<convert_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     118e <convert_number+0x8e>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x1,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x10,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x8,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x19,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x4,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x15,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0xd,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x1c,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x2,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x13,-0x2(%rbp)
jmp    1192 <convert_number+0x92>
movb   $0x1,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_number>:
movsbl %dil,%eax
movslq %eax,%rcx
add    $0xffffffffffffffcf,%rcx
mov    $0x1,%al
cmp    $0x8,%ecx
ja     111c <convert_number+0x1c>
lea    0xee7(%rip),%rax
mov    (%rcx,%rax,1),%al
ret

LLVM IR (-O0):
define signext i8 @convert_number(i32 %0) {
%2 = alloca i8
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
switch i32 %6, label %17 [
i32 48, label %7
i32 49, label %8
i32 50, label %9
i32 51, label %10
i32 52, label %11
i32 53, label %12
i32 54, label %13
i32 55, label %14
i32 56, label %15
i32 57, label %16
]
7: ; preds = %1
store i8 1, i8* %3
br label %18
8: ; preds = %1
store i8 16, i8* %3
br label %18
9: ; preds = %1
store i8 8, i8* %3
br label %18
10: ; preds = %1
store i8 25, i8* %3
br label %18
11: ; preds = %1
store i8 4, i8* %3
br label %18
12: ; preds = %1
store i8 21, i8* %3
br label %18
13: ; preds = %1
store i8 13, i8* %3
br label %18
14: ; preds = %1
store i8 28, i8* %3
br label %18
15: ; preds = %1
store i8 2, i8* %3
br label %18
16: ; preds = %1
store i8 19, i8* %3
br label %18
17: ; preds = %1
store i8 1, i8* %3
br label %18
18: ; preds = %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
@switch.table.convert_number = [9 x i8] c"\10\08\19\04\15\0D\1C\02\13"
define signext i8 @convert_number(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = add nsw i32 %3, -49
%5 = icmp ult i32 %4, 9
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.convert_number, i64 0, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %6, %1
%11 = phi i8 [ 1, %1 ], [ %9, %6 ]
ret i8 %11
}