#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
unsigned int nucleotideAlphaToNumeric(char nucleotide) {
  if (nucleotide == 'A')
    return 0x0;
  if (nucleotide == 'G')
    return 0x1;
  if (nucleotide == 'C')
    return 0x2;
  if (nucleotide == 'T')
    return 0x3;
  printf("error: could not match nucleotide %c\n", nucleotide);
  return 0x0;
}


x86 assembly (clang, -O0):
<nucleotideAlphaToNumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    1137 <nucleotideAlphaToNumeric+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1199 <nucleotideAlphaToNumeric+0x89>
movsbl -0x5(%rbp),%eax
cmp    $0x47,%eax
jne    1150 <nucleotideAlphaToNumeric+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1199 <nucleotideAlphaToNumeric+0x89>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
jne    1169 <nucleotideAlphaToNumeric+0x59>
movl   $0x2,-0x4(%rbp)
jmp    1199 <nucleotideAlphaToNumeric+0x89>
movsbl -0x5(%rbp),%eax
cmp    $0x54,%eax
jne    1182 <nucleotideAlphaToNumeric+0x72>
movl   $0x3,-0x4(%rbp)
jmp    1199 <nucleotideAlphaToNumeric+0x89>
lea    0xe77(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nucleotideAlphaToNumeric>:
push   %rbx
xor    %ebx,%ebx
lea    -0x41(%rdi),%eax
cmp    $0x13,%al
ja     1134 <nucleotideAlphaToNumeric+0x24>
movzbl %al,%eax
lea    0xedc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%ebx
jmp    1152 <nucleotideAlphaToNumeric+0x42>
movsbl %dil,%esi
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <nucleotideAlphaToNumeric+0x42>
mov    $0x1,%ebx
jmp    1152 <nucleotideAlphaToNumeric+0x42>
mov    $0x3,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"error: could not match nucleotide %c\0A\00"
define i32 @nucleotideAlphaToNumeric(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %26
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 71
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %26
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 67
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2, i32* %2
br label %26
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 84
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 3, i32* %2
br label %26
23: ; preds = %18
%24 = load i8, i8* %3
%25 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8 signext %24)
store i32 0, i32* %2
br label %26
26: ; preds = %23, %22, %17, %12, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [38 x i8] c"error: could not match nucleotide %c\0A\00"
define i32 @nucleotideAlphaToNumeric(i8 signext %0) {
switch i8 %0, label %5 [
i8 65, label %7
i8 71, label %2
i8 67, label %3
i8 84, label %4
]
2: ; preds = %1
br label %7
3: ; preds = %1
br label %7
4: ; preds = %1
br label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %7
7: ; preds = %1, %5, %4, %3, %2
%8 = phi i32 [ 1, %2 ], [ 2, %3 ], [ 3, %4 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %8
}