#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*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(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:
    printf("Non-existent nucleotide %c\n", c);
    assert(0);
    return 'N';
  }
}


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     11a0 <reverse_char_nucleotide+0x80>
mov    -0x10(%rbp),%rax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x47,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x43,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x41,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x74,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x67,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x63,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
movb   $0x61,-0x1(%rbp)
jmp    11bb <reverse_char_nucleotide+0x9b>
lea    0xf29(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
movb   $0x4e,-0x1(%rbp)
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     113f <reverse_char_nucleotide+0x1f>
mov    $0x54,%al
lea    0xece(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x47,%al
pop    %rcx
ret
movsbl %dil,%esi
lea    0xf86(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    $0x4e,%al
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 %18
7: ; preds = %1
store i8 71, i8* %2
br label %18
8: ; preds = %1
store i8 67, i8* %2
br label %18
9: ; preds = %1
store i8 65, i8* %2
br label %18
10: ; preds = %1
store i8 116, i8* %2
br label %18
11: ; preds = %1
store i8 103, i8* %2
br label %18
12: ; preds = %1
store i8 99, i8* %2
br label %18
13: ; preds = %1
store i8 97, i8* %2
br label %18
14: ; preds = %1
%15 = load i8, i8* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %15)
%17 = call i32 @assert(i32 0)
store i8 78, i8* %2
br label %18
18: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6
%19 = load i8, i8* %2
ret i8 %19
}

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 %13
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 %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%12 = tail call i32 @assert(i32 0)
br label %13
13: ; preds = %1, %10, %9, %8, %7, %6, %5, %4, %3
%14 = phi i8 [ 78, %10 ], [ 97, %9 ], [ 99, %8 ], [ 103, %7 ], [ 116, %6 ], [ 65, %5 ], [ 67, %4 ], [ 71, %3 ], [ 84, %1 ]
ret i8 %14
}