int _poids_caractere(char c) {
  int poids;
  switch (c) {
  case 'a':
  case 'e':
  case 'i':
  case 'l':
  case 'n':
  case 'o':
  case 'r':
  case 's':
  case 't':
  case 'u':
    poids = 1;
    break;
  case 'd':
  case 'g':
  case 'm':
    poids = 2;
    break;
  case 'b':
  case 'c':
  case 'p':
    poids = 3;
    break;
  case 'f':
  case 'h':
  case 'v':
    poids = 4;
    break;
  case 'j':
  case 'q':
    poids = 8;
    break;
  case 'k':
  case 'w':
  case 'x':
  case 'y':
  case 'z':
    poids = 10;
    break;
  default:
    poids = 0;
  }
  return poids;
}


x86 assembly (clang, -O0):
<_poids_caractere>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x19,%eax
ja     117c <_poids_caractere+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1183 <_poids_caractere+0x83>
movl   $0x2,-0x8(%rbp)
jmp    1183 <_poids_caractere+0x83>
movl   $0x3,-0x8(%rbp)
jmp    1183 <_poids_caractere+0x83>
movl   $0x4,-0x8(%rbp)
jmp    1183 <_poids_caractere+0x83>
movl   $0x8,-0x8(%rbp)
jmp    1183 <_poids_caractere+0x83>
movl   $0xa,-0x8(%rbp)
jmp    1183 <_poids_caractere+0x83>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_poids_caractere>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x19,%edi
ja     1117 <_poids_caractere+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @_poids_caractere(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 97, label %6
i32 101, label %6
i32 105, label %6
i32 108, label %6
i32 110, label %6
i32 111, label %6
i32 114, label %6
i32 115, label %6
i32 116, label %6
i32 117, label %6
i32 100, label %7
i32 103, label %7
i32 109, label %7
i32 98, label %8
i32 99, label %8
i32 112, label %8
i32 102, label %9
i32 104, label %9
i32 118, label %9
i32 106, label %10
i32 113, label %10
i32 107, label %11
i32 119, label %11
i32 120, label %11
i32 121, label %11
i32 122, label %11
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %3
br label %13
7: ; preds = %1, %1, %1
store i32 2, i32* %3
br label %13
8: ; preds = %1, %1, %1
store i32 3, i32* %3
br label %13
9: ; preds = %1, %1, %1
store i32 4, i32* %3
br label %13
10: ; preds = %1, %1
store i32 8, i32* %3
br label %13
11: ; preds = %1, %1, %1, %1, %1
store i32 10, i32* %3
br label %13
12: ; preds = %1
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@switch.table._poids_caractere = [26 x i32] [i32 1, i32 3, i32 3, i32 2, i32 1, i32 4, i32 2, i32 4, i32 1, i32 8, i32 10, i32 1, i32 2, i32 1, i32 1, i32 3, i32 8, i32 1, i32 1, i32 1, i32 1, i32 4, i32 10, i32 10, i32 10, i32 10]
define i32 @_poids_caractere(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
%4 = icmp ult i32 %3, 26
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [26 x i32], [26 x i32]* @switch.table._poids_caractere, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}