#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*/ fprintf(int /*<<< orphan*/, char *, char const);
int /*<<< orphan*/ stderr;
char revcom_char(const char base) {
  static bool warned = false;
  switch (base) {
  case 'A':
    return 'T';
  case 'a':
    return 't';
  case 'C':
    return 'G';
  case 'c':
    return 'g';
  case 'G':
    return 'C';
  case 'g':
    return 'c';
  case 'T':
    return 'A';
  case 't':
    return 'a';
  case '-':
    return '-';
  case '.':
    return '.';
  case 'N':
    return 'N';
  case 'n':
    return 'n';
  case 'X':
    return 'X';
  case 'x':
    return 'x';
  default:
    if (!warned) {
      warned = true;
      fprintf(stderr,
              "WARNING: Non standard DNA character in sequence: \"%c\"\n",
              base);
    }
    return base;
  }
}


x86 assembly (clang, -O0):
<revcom_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffd3,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4b,%eax
ja     11c6 <revcom_char+0xb6>
mov    -0x10(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x74,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x47,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x67,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x43,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x63,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x41,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x61,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x2d,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x2e,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x4e,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x6e,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x58,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
movb   $0x78,-0x1(%rbp)
jmp    11fc <revcom_char+0xec>
cmpl   $0x0,0x2e5f(%rip)
jne    11f6 <revcom_char+0xe6>
movl   $0x1,0x2e4f(%rip)
mov    0x2dfc(%rip),%rax
mov    (%rax),%edi
lea    0xf43(%rip),%rsi
movsbl -0x2(%rbp),%edx
call   1030 <fprintf@plt>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revcom_char>:
push   %rbx
mov    %edi,%ebx
lea    -0x2d(%rbx),%ecx
cmp    $0x4b,%ecx
ja     1161 <revcom_char+0x51>
mov    $0x54,%al
lea    0xedc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x2d,%al
pop    %rbx
ret
mov    $0x2e,%al
pop    %rbx
ret
mov    $0x47,%al
pop    %rbx
ret
mov    $0x43,%al
pop    %rbx
ret
mov    $0x4e,%al
pop    %rbx
ret
mov    $0x41,%al
pop    %rbx
ret
mov    $0x58,%al
pop    %rbx
ret
mov    $0x74,%al
pop    %rbx
ret
mov    $0x67,%al
pop    %rbx
ret
mov    $0x63,%al
pop    %rbx
ret
mov    $0x6e,%al
pop    %rbx
ret
mov    $0x61,%al
pop    %rbx
ret
mov    $0x78,%al
pop    %rbx
ret
cmpb   $0x0,0x2ec4(%rip)
jne    1189 <revcom_char+0x79>
movb   $0x1,0x2ebb(%rip)
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
movsbl %bl,%edx
lea    0xfac(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@revcom_char.warned = internal global i32 0
@stderr = global i32 0
@.str = [55 x i8] c"WARNING: Non standard DNA character in sequence: \22%c\22\0A\00"
define signext i8 @revcom_char(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 %20 [
i32 65, label %6
i32 97, label %7
i32 67, label %8
i32 99, label %9
i32 71, label %10
i32 103, label %11
i32 84, label %12
i32 116, label %13
i32 45, label %14
i32 46, label %15
i32 78, label %16
i32 110, label %17
i32 88, label %18
i32 120, label %19
]
6: ; preds = %1
store i8 84, i8* %2
br label %29
7: ; preds = %1
store i8 116, i8* %2
br label %29
8: ; preds = %1
store i8 71, i8* %2
br label %29
9: ; preds = %1
store i8 103, i8* %2
br label %29
10: ; preds = %1
store i8 67, i8* %2
br label %29
11: ; preds = %1
store i8 99, i8* %2
br label %29
12: ; preds = %1
store i8 65, i8* %2
br label %29
13: ; preds = %1
store i8 97, i8* %2
br label %29
14: ; preds = %1
store i8 45, i8* %2
br label %29
15: ; preds = %1
store i8 46, i8* %2
br label %29
16: ; preds = %1
store i8 78, i8* %2
br label %29
17: ; preds = %1
store i8 110, i8* %2
br label %29
18: ; preds = %1
store i8 88, i8* %2
br label %29
19: ; preds = %1
store i8 120, i8* %2
br label %29
20: ; preds = %1
%21 = load i32, i32* @revcom_char.warned
%22 = icmp ne i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %20
store i32 1, i32* @revcom_char.warned
%24 = load i32, i32* @stderr
%25 = load i8, i8* %3
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8 signext %25)
br label %27
27: ; preds = %23, %20
%28 = load i8, i8* %3
store i8 %28, i8* %2
br label %29
29: ; preds = %27, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%30 = load i8, i8* %2
ret i8 %30
}

LLVM IR (-O2):
@revcom_char.warned = internal unnamed_addr global i1 false
@stderr = global i32 0
@.str = [55 x i8] c"WARNING: Non standard DNA character in sequence: \22%c\22\0A\00"
define signext i8 @revcom_char(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %16 [
i32 65, label %21
i32 97, label %3
i32 67, label %4
i32 99, label %5
i32 71, label %6
i32 103, label %7
i32 84, label %8
i32 116, label %9
i32 45, label %10
i32 46, label %11
i32 78, label %12
i32 110, label %13
i32 88, label %14
i32 120, label %15
]
3: ; preds = %1
br label %21
4: ; preds = %1
br label %21
5: ; preds = %1
br label %21
6: ; preds = %1
br label %21
7: ; preds = %1
br label %21
8: ; preds = %1
br label %21
9: ; preds = %1
br label %21
10: ; preds = %1
br label %21
11: ; preds = %1
br label %21
12: ; preds = %1
br label %21
13: ; preds = %1
br label %21
14: ; preds = %1
br label %21
15: ; preds = %1
br label %21
16: ; preds = %1
%17 = load i1, i1* @revcom_char.warned
br i1 %17, label %21, label %18
18: ; preds = %16
store i1 true, i1* @revcom_char.warned
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %21
21: ; preds = %16, %18, %1, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%22 = phi i8 [ 120, %15 ], [ 88, %14 ], [ 110, %13 ], [ 78, %12 ], [ 46, %11 ], [ 45, %10 ], [ 97, %9 ], [ 65, %8 ], [ 99, %7 ], [ 67, %6 ], [ 103, %5 ], [ 71, %4 ], [ 116, %3 ], [ 84, %1 ], [ %0, %18 ], [ %0, %16 ]
ret i8 %22
}