char afficherLettre(int lettre) {
  char c;
  switch (lettre) {
  case 0:
    c = 'A';
    break;
  case 1:
    c = 'B';
    break;
  case 2:
    c = 'C';
    break;
  case 3:
    c = 'D';
    break;
  case 4:
    c = 'E';
    break;
  case 5:
    c = 'F';
    break;
  case 6:
    c = 'G';
    break;
  case 7:
    c = 'H';
    break;
  case 8:
    c = 'I';
    break;
  case 9:
    c = 'J';
    break;
  case 10:
    c = 'K';
    break;
  case 11:
    c = 'L';
    break;
  case 12:
    c = 'M';
    break;
  case 13:
    c = 'N';
    break;
  case 14:
    c = 'O';
    break;
  case 15:
    c = 'P';
    break;
  case 16:
    c = 'Q';
    break;
  default:
    c = 'Z';
    break;
  }
  return c;
}


x86 assembly (clang, -O0):
<afficherLettre>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x10,%rax
ja     11c5 <afficherLettre+0xc5>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x42,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x43,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x44,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x45,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x46,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x47,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x48,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x49,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x4a,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x4b,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x4c,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x4d,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x4e,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x4f,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x50,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x51,-0x5(%rbp)
jmp    11c9 <afficherLettre+0xc9>
movb   $0x5a,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherLettre>:
lea    0x41(%rdi),%eax
cmp    $0x11,%edi
movzbl %al,%ecx
mov    $0x5a,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @afficherLettre(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %22 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
i32 9, label %14
i32 10, label %15
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %19
i32 15, label %20
i32 16, label %21
]
5: ; preds = %1
store i8 65, i8* %3
br label %23
6: ; preds = %1
store i8 66, i8* %3
br label %23
7: ; preds = %1
store i8 67, i8* %3
br label %23
8: ; preds = %1
store i8 68, i8* %3
br label %23
9: ; preds = %1
store i8 69, i8* %3
br label %23
10: ; preds = %1
store i8 70, i8* %3
br label %23
11: ; preds = %1
store i8 71, i8* %3
br label %23
12: ; preds = %1
store i8 72, i8* %3
br label %23
13: ; preds = %1
store i8 73, i8* %3
br label %23
14: ; preds = %1
store i8 74, i8* %3
br label %23
15: ; preds = %1
store i8 75, i8* %3
br label %23
16: ; preds = %1
store i8 76, i8* %3
br label %23
17: ; preds = %1
store i8 77, i8* %3
br label %23
18: ; preds = %1
store i8 78, i8* %3
br label %23
19: ; preds = %1
store i8 79, i8* %3
br label %23
20: ; preds = %1
store i8 80, i8* %3
br label %23
21: ; preds = %1
store i8 81, i8* %3
br label %23
22: ; preds = %1
store i8 90, i8* %3
br label %23
23: ; preds = %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%24 = load i8, i8* %3
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @afficherLettre(i32 %0) {
%2 = icmp ult i32 %0, 17
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 65
%5 = select i1 %2, i8 %4, i8 90
ret i8 %5
}