int extract_suit(char c) {
  int suit;
  if (c == 'c' || c == 'C')
    suit = 0x8000;
  else if (c == 'd' || c == 'D')
    suit = 0x4000;
  else if (c == 'h' || c == 'H')
    suit = 0x2000;
  else if (c == 's' || c == 'S')
    suit = 0x1000;
  else
    suit = 99;
  return suit;
}


x86 assembly (clang, -O0):
<extract_suit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x63,%eax
je     1124 <extract_suit+0x24>
movsbl -0x1(%rbp),%eax
cmp    $0x43,%eax
jne    1130 <extract_suit+0x30>
movl   $0x8000,-0x8(%rbp)
jmp    11b8 <extract_suit+0xb8>
movsbl -0x1(%rbp),%eax
cmp    $0x64,%eax
je     114a <extract_suit+0x4a>
movsbl -0x1(%rbp),%eax
cmp    $0x44,%eax
jne    1156 <extract_suit+0x56>
movl   $0x4000,-0x8(%rbp)
jmp    11b3 <extract_suit+0xb3>
movsbl -0x1(%rbp),%eax
cmp    $0x68,%eax
je     1170 <extract_suit+0x70>
movsbl -0x1(%rbp),%eax
cmp    $0x48,%eax
jne    117c <extract_suit+0x7c>
movl   $0x2000,-0x8(%rbp)
jmp    11ae <extract_suit+0xae>
movsbl -0x1(%rbp),%eax
cmp    $0x73,%eax
je     1196 <extract_suit+0x96>
movsbl -0x1(%rbp),%eax
cmp    $0x53,%eax
jne    11a2 <extract_suit+0xa2>
movl   $0x1000,-0x8(%rbp)
jmp    11a9 <extract_suit+0xa9>
movl   $0x63,-0x8(%rbp)
jmp    11ae <extract_suit+0xae>
jmp    11b3 <extract_suit+0xb3>
jmp    11b8 <extract_suit+0xb8>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_suit>:
and    $0xdf,%dil
cmp    $0x43,%dil
je     111c <extract_suit+0x1c>
cmp    $0x44,%dil
je     1122 <extract_suit+0x22>
cmp    $0x48,%dil
jne    1128 <extract_suit+0x28>
mov    $0x2000,%eax
ret
mov    $0x8000,%eax
ret
mov    $0x4000,%eax
ret
cmp    $0x53,%dil
mov    $0x1000,%ecx
mov    $0x63,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @extract_suit(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
%6 = icmp eq i32 %5, 99
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 67
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 32768, i32* %3
br label %43
12: ; preds = %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 100
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 68
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 16384, i32* %3
br label %42
21: ; preds = %16
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 104
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 72
br i1 %28, label %29, label %30
29: ; preds = %25, %21
store i32 8192, i32* %3
br label %41
30: ; preds = %25
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 115
br i1 %33, label %38, label %34
34: ; preds = %30
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 83
br i1 %37, label %38, label %39
38: ; preds = %34, %30
store i32 4096, i32* %3
br label %40
39: ; preds = %34
store i32 99, i32* %3
br label %40
40: ; preds = %39, %38
br label %41
41: ; preds = %40, %29
br label %42
42: ; preds = %41, %20
br label %43
43: ; preds = %42, %11
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
define i32 @extract_suit(i8 signext %0) {
%2 = and i8 %0, -33
switch i8 %2, label %3 [
i8 67, label %8
i8 68, label %6
i8 72, label %7
]
3: ; preds = %1
%4 = icmp eq i8 %2, 83
%5 = select i1 %4, i32 4096, i32 99
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %3
%9 = phi i32 [ 32768, %1 ], [ %5, %3 ], [ 16384, %6 ], [ 8192, %7 ]
ret i32 %9
}