#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*/ die(char *, char);
char reverse_char_nucleotide(char c) {
  switch (c) {
  case 'A':
    return 'T';
  case 'C':
    return 'G';
  case 'G':
    return 'C';
  case 'T':
    return 'A';
  case 'a':
    return 't';
  case 'c':
    return 'g';
  case 'g':
    return 'c';
  case 't':
    return 'a';
  default:
    die("Non-existent nucleotide %c\n", c);
  }
}


x86 assembly (clang, -O0):
<reverse_char_nucleotide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x33,%eax
ja     1190 <reverse_char_nucleotide+0x80>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x47,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x43,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x41,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x74,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x67,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x63,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
movb   $0x61,-0x1(%rbp)
jmp    11a0 <reverse_char_nucleotide+0x90>
lea    0xf39(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <die@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_char_nucleotide>:
push   %rax
lea    -0x41(%rdi),%ecx
cmp    $0x33,%ecx
ja     112f <reverse_char_nucleotide+0x1f>
mov    $0x54,%al
lea    0xede(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x47,%al
pop    %rcx
ret
movsbl %dil,%esi
lea    0xf96(%rip),%rdi
call   1030 <die@plt>
pop    %rcx
ret
mov    $0x43,%al
pop    %rcx
ret
mov    $0x41,%al
pop    %rcx
ret
mov    $0x74,%al
pop    %rcx
ret
mov    $0x67,%al
pop    %rcx
ret
mov    $0x63,%al
pop    %rcx
ret
mov    $0x61,%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Non-existent nucleotide %c\0A\00"
define signext i8 @reverse_char_nucleotide(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %14 [
i32 65, label %6
i32 67, label %7
i32 71, label %8
i32 84, label %9
i32 97, label %10
i32 99, label %11
i32 103, label %12
i32 116, label %13
]
6: ; preds = %1
store i8 84, i8* %2
br label %17
7: ; preds = %1
store i8 71, i8* %2
br label %17
8: ; preds = %1
store i8 67, i8* %2
br label %17
9: ; preds = %1
store i8 65, i8* %2
br label %17
10: ; preds = %1
store i8 116, i8* %2
br label %17
11: ; preds = %1
store i8 103, i8* %2
br label %17
12: ; preds = %1
store i8 99, i8* %2
br label %17
13: ; preds = %1
store i8 97, i8* %2
br label %17
14: ; preds = %1
%15 = load i8, i8* %3
%16 = call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %15)
br label %17
17: ; preds = %6, %7, %8, %9, %10, %11, %12, %13, %14
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
@.str = [28 x i8] c"Non-existent nucleotide %c\0A\00"
define signext i8 @reverse_char_nucleotide(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %10 [
i32 65, label %12
i32 67, label %3
i32 71, label %4
i32 84, label %5
i32 97, label %6
i32 99, label %7
i32 103, label %8
i32 116, label %9
]
3: ; preds = %1
br label %12
4: ; preds = %1
br label %12
5: ; preds = %1
br label %12
6: ; preds = %1
br label %12
7: ; preds = %1
br label %12
8: ; preds = %1
br label %12
9: ; preds = %1
br label %12
10: ; preds = %1
%11 = tail call i32 @die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %12
12: ; preds = %1, %3, %4, %5, %6, %7, %8, %9, %10
%13 = phi i8 [ undef, %10 ], [ 97, %9 ], [ 99, %8 ], [ 103, %7 ], [ 116, %6 ], [ 65, %5 ], [ 67, %4 ], [ 71, %3 ], [ 84, %1 ]
ret i8 %13
}