int nt2int_rc(char nt) {
  int result;
  if (nt == 'A' || nt == 'a') {
    result = 3;
  } else if (nt == 'C' || nt == 'c') {
    result = 2;
  } else if (nt == 'G' || nt == 'g') {
    result = 1;
  } else if (nt == 'T' || nt == 't') {
    result = 0;
  } else {
    result = 4;
  }
  return result;
}


x86 assembly (clang, -O0):
<nt2int_rc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
je     1124 <nt2int_rc+0x24>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jne    1130 <nt2int_rc+0x30>
movl   $0x3,-0x8(%rbp)
jmp    11b8 <nt2int_rc+0xb8>
movsbl -0x1(%rbp),%eax
cmp    $0x43,%eax
je     114a <nt2int_rc+0x4a>
movsbl -0x1(%rbp),%eax
cmp    $0x63,%eax
jne    1156 <nt2int_rc+0x56>
movl   $0x2,-0x8(%rbp)
jmp    11b3 <nt2int_rc+0xb3>
movsbl -0x1(%rbp),%eax
cmp    $0x47,%eax
je     1170 <nt2int_rc+0x70>
movsbl -0x1(%rbp),%eax
cmp    $0x67,%eax
jne    117c <nt2int_rc+0x7c>
movl   $0x1,-0x8(%rbp)
jmp    11ae <nt2int_rc+0xae>
movsbl -0x1(%rbp),%eax
cmp    $0x54,%eax
je     1196 <nt2int_rc+0x96>
movsbl -0x1(%rbp),%eax
cmp    $0x74,%eax
jne    11a2 <nt2int_rc+0xa2>
movl   $0x0,-0x8(%rbp)
jmp    11a9 <nt2int_rc+0xa9>
movl   $0x4,-0x8(%rbp)
jmp    11ae <nt2int_rc+0xae>
jmp    11b3 <nt2int_rc+0xb3>
jmp    11b8 <nt2int_rc+0xb8>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nt2int_rc>:
and    $0xdf,%dil
cmp    $0x41,%dil
je     111c <nt2int_rc+0x1c>
cmp    $0x43,%dil
je     1122 <nt2int_rc+0x22>
cmp    $0x47,%dil
jne    1128 <nt2int_rc+0x28>
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
xor    %eax,%eax
cmp    $0x54,%dil
setne  %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @nt2int_rc(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, 65
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, 97
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 3, i32* %3
br label %43
12: ; preds = %7
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 67
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, 99
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 2, i32* %3
br label %42
21: ; preds = %16
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 71
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, 103
br i1 %28, label %29, label %30
29: ; preds = %25, %21
store i32 1, i32* %3
br label %41
30: ; preds = %25
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 84
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, 116
br i1 %37, label %38, label %39
38: ; preds = %34, %30
store i32 0, i32* %3
br label %40
39: ; preds = %34
store i32 4, 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 @nt2int_rc(i8 signext %0) {
%2 = and i8 %0, -33
switch i8 %2, label %3 [
i8 65, label %8
i8 67, label %6
i8 71, label %7
]
3: ; preds = %1
%4 = icmp eq i8 %2, 84
%5 = select i1 %4, i32 0, i32 4
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %3
%9 = phi i32 [ 3, %1 ], [ %5, %3 ], [ 2, %6 ], [ 1, %7 ]
ret i32 %9
}