#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);
char comp(char c) {
  switch (c) {
  case 'a':
  case 'A':
    return 'T';
  case 't':
  case 'T':
    return 'A';
  case 'c':
  case 'C':
    return 'G';
  case 'g':
  case 'G':
    return 'C';
  case 'n':
  case 'N':
    return 'N';
  default:
    printf("ERROR, Bad letter to RC: %c\n", c);
    return -1;
  }
}


x86 assembly (clang, -O0):
<comp>:
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     1175 <comp+0x65>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    1189 <comp+0x79>
movb   $0x41,-0x1(%rbp)
jmp    1189 <comp+0x79>
movb   $0x47,-0x1(%rbp)
jmp    1189 <comp+0x79>
movb   $0x43,-0x1(%rbp)
jmp    1189 <comp+0x79>
movb   $0x4e,-0x1(%rbp)
jmp    1189 <comp+0x79>
lea    0xf54(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
push   %rax
lea    -0x41(%rdi),%ecx
cmp    $0x33,%ecx
ja     113b <comp+0x2b>
mov    $0x54,%al
lea    0xede(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x47,%al
pop    %rcx
ret
mov    $0x43,%al
pop    %rcx
ret
mov    $0x4e,%al
pop    %rcx
ret
mov    $0x41,%al
pop    %rcx
ret
movsbl %dil,%esi
lea    0xf8a(%rip),%rdi
call   1030 <printf@plt>
mov    $0xff,%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"ERROR, Bad letter to RC: %c\0A\00"
define signext i8 @comp(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 %11 [
i32 97, label %6
i32 65, label %6
i32 116, label %7
i32 84, label %7
i32 99, label %8
i32 67, label %8
i32 103, label %9
i32 71, label %9
i32 110, label %10
i32 78, label %10
]
6: ; preds = %1, %1
store i8 84, i8* %2
br label %14
7: ; preds = %1, %1
store i8 65, i8* %2
br label %14
8: ; preds = %1, %1
store i8 71, i8* %2
br label %14
9: ; preds = %1, %1
store i8 67, i8* %2
br label %14
10: ; preds = %1, %1
store i8 78, i8* %2
br label %14
11: ; preds = %1
%12 = load i8, i8* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %12)
store i8 -1, i8* %2
br label %14
14: ; preds = %11, %10, %9, %8, %7, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"ERROR, Bad letter to RC: %c\0A\00"
define signext i8 @comp(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 97, label %9
i32 65, label %9
i32 116, label %3
i32 84, label %3
i32 99, label %4
i32 67, label %4
i32 103, label %5
i32 71, label %5
i32 110, label %6
i32 78, label %6
]
3: ; preds = %1, %1
br label %9
4: ; preds = %1, %1
br label %9
5: ; preds = %1, %1
br label %9
6: ; preds = %1, %1
br label %9
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %9
9: ; preds = %1, %1, %7, %6, %5, %4, %3
%10 = phi i8 [ -1, %7 ], [ 78, %6 ], [ 67, %5 ], [ 71, %4 ], [ 65, %3 ], [ 84, %1 ], [ 84, %1 ]
ret i8 %10
}