void _pr_reverse_complement(const char *seq, char *s) {
  const char *p = seq;
  char *q = s;
  while (*p != '\0')
    p++;
  p--;
  while (p >= seq) {
    switch (*p) {
    case 'A':
      *q = 'T';
      break;
    case 'C':
      *q = 'G';
      break;
    case 'G':
      *q = 'C';
      break;
    case 'T':
      *q = 'A';
      break;
    case 'U':
      *q = 'A';
      break;
    case 'B':
      *q = 'V';
      break;
    case 'D':
      *q = 'H';
      break;
    case 'H':
      *q = 'D';
      break;
    case 'V':
      *q = 'B';
      break;
    case 'R':
      *q = 'Y';
      break;
    case 'Y':
      *q = 'R';
      break;
    case 'K':
      *q = 'M';
      break;
    case 'M':
      *q = 'K';
      break;
    case 'S':
      *q = 'S';
      break;
    case 'W':
      *q = 'W';
      break;
    case 'N':
      *q = 'N';
      break;
    case 'a':
      *q = 't';
      break;
    case 'c':
      *q = 'g';
      break;
    case 'g':
      *q = 'c';
      break;
    case 't':
      *q = 'a';
      break;
    case 'u':
      *q = 'a';
      break;
    case 'b':
      *q = 'v';
      break;
    case 'd':
      *q = 'h';
      break;
    case 'h':
      *q = 'd';
      break;
    case 'v':
      *q = 'b';
      break;
    case 'r':
      *q = 'y';
      break;
    case 'y':
      *q = 'r';
      break;
    case 'k':
      *q = 'm';
      break;
    case 'm':
      *q = 'k';
      break;
    case 's':
      *q = 's';
      break;
    case 'w':
      *q = 'w';
      break;
    case 'n':
      *q = 'n';
      break;
    }
    p--;
    q++;
  }
  *q = '\0';
}


x86 assembly (clang, -O0):
<_pr_reverse_complement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <_pr_reverse_complement+0x3d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <_pr_reverse_complement+0x1c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jb     131c <_pr_reverse_complement+0x21c>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x38,%eax
ja     12ff <_pr_reverse_complement+0x1ff>
mov    -0x28(%rbp),%rax
lea    0xe85(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rax
movb   $0x54,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x47,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x43,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x41,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x41,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x56,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x48,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x44,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x42,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x59,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x52,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x4d,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x4b,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x53,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x57,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x4e,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x74,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x67,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x63,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x61,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x61,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x76,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x68,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x64,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x62,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x79,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x72,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x6d,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x6b,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x73,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x77,(%rax)
jmp    12ff <_pr_reverse_complement+0x1ff>
mov    -0x20(%rbp),%rax
movb   $0x6e,(%rax)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1149 <_pr_reverse_complement+0x49>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pr_reverse_complement>:
lea    -0x2(%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1110 <_pr_reverse_complement+0x10>
cmp    %rdi,%rax
jae    1123 <_pr_reverse_complement+0x23>
movb   $0x0,(%rsi)
ret
movabs $0x17e34cf017e34cf,%rcx
34 7e 01
lea    0xecc(%rip),%r8
jmp    114d <_pr_reverse_complement+0x4d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rsi
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jb     111f <_pr_reverse_complement+0x1f>
movsbq (%rax),%rdx
add    $0xffffffffffffffbf,%rdx
cmp    $0x38,%edx
ja     1140 <_pr_reverse_complement+0x40>
bt     %rdx,%rcx
jae    1140 <_pr_reverse_complement+0x40>
movzbl (%rdx,%r8,1),%edx
mov    %dl,(%rsi)
jmp    1140 <_pr_reverse_complement+0x40>

LLVM IR (-O0):
define void @_pr_reverse_complement(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
br label %9
9: ; preds = %14, %2
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
br label %9
17: ; preds = %9
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %5
br label %20
20: ; preds = %92, %17
%21 = load i8*, i8** %5
%22 = load i8*, i8** %3
%23 = icmp uge i8* %21, %22
br i1 %23, label %24, label %97
24: ; preds = %20
%25 = load i8*, i8** %5
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
switch i32 %27, label %92 [
i32 65, label %28
i32 67, label %30
i32 71, label %32
i32 84, label %34
i32 85, label %36
i32 66, label %38
i32 68, label %40
i32 72, label %42
i32 86, label %44
i32 82, label %46
i32 89, label %48
i32 75, label %50
i32 77, label %52
i32 83, label %54
i32 87, label %56
i32 78, label %58
i32 97, label %60
i32 99, label %62
i32 103, label %64
i32 116, label %66
i32 117, label %68
i32 98, label %70
i32 100, label %72
i32 104, label %74
i32 118, label %76
i32 114, label %78
i32 121, label %80
i32 107, label %82
i32 109, label %84
i32 115, label %86
i32 119, label %88
i32 110, label %90
]
28: ; preds = %24
%29 = load i8*, i8** %6
store i8 84, i8* %29
br label %92
30: ; preds = %24
%31 = load i8*, i8** %6
store i8 71, i8* %31
br label %92
32: ; preds = %24
%33 = load i8*, i8** %6
store i8 67, i8* %33
br label %92
34: ; preds = %24
%35 = load i8*, i8** %6
store i8 65, i8* %35
br label %92
36: ; preds = %24
%37 = load i8*, i8** %6
store i8 65, i8* %37
br label %92
38: ; preds = %24
%39 = load i8*, i8** %6
store i8 86, i8* %39
br label %92
40: ; preds = %24
%41 = load i8*, i8** %6
store i8 72, i8* %41
br label %92
42: ; preds = %24
%43 = load i8*, i8** %6
store i8 68, i8* %43
br label %92
44: ; preds = %24
%45 = load i8*, i8** %6
store i8 66, i8* %45
br label %92
46: ; preds = %24
%47 = load i8*, i8** %6
store i8 89, i8* %47
br label %92
48: ; preds = %24
%49 = load i8*, i8** %6
store i8 82, i8* %49
br label %92
50: ; preds = %24
%51 = load i8*, i8** %6
store i8 77, i8* %51
br label %92
52: ; preds = %24
%53 = load i8*, i8** %6
store i8 75, i8* %53
br label %92
54: ; preds = %24
%55 = load i8*, i8** %6
store i8 83, i8* %55
br label %92
56: ; preds = %24
%57 = load i8*, i8** %6
store i8 87, i8* %57
br label %92
58: ; preds = %24
%59 = load i8*, i8** %6
store i8 78, i8* %59
br label %92
60: ; preds = %24
%61 = load i8*, i8** %6
store i8 116, i8* %61
br label %92
62: ; preds = %24
%63 = load i8*, i8** %6
store i8 103, i8* %63
br label %92
64: ; preds = %24
%65 = load i8*, i8** %6
store i8 99, i8* %65
br label %92
66: ; preds = %24
%67 = load i8*, i8** %6
store i8 97, i8* %67
br label %92
68: ; preds = %24
%69 = load i8*, i8** %6
store i8 97, i8* %69
br label %92
70: ; preds = %24
%71 = load i8*, i8** %6
store i8 118, i8* %71
br label %92
72: ; preds = %24
%73 = load i8*, i8** %6
store i8 104, i8* %73
br label %92
74: ; preds = %24
%75 = load i8*, i8** %6
store i8 100, i8* %75
br label %92
76: ; preds = %24
%77 = load i8*, i8** %6
store i8 98, i8* %77
br label %92
78: ; preds = %24
%79 = load i8*, i8** %6
store i8 121, i8* %79
br label %92
80: ; preds = %24
%81 = load i8*, i8** %6
store i8 114, i8* %81
br label %92
82: ; preds = %24
%83 = load i8*, i8** %6
store i8 109, i8* %83
br label %92
84: ; preds = %24
%85 = load i8*, i8** %6
store i8 107, i8* %85
br label %92
86: ; preds = %24
%87 = load i8*, i8** %6
store i8 115, i8* %87
br label %92
88: ; preds = %24
%89 = load i8*, i8** %6
store i8 119, i8* %89
br label %92
90: ; preds = %24
%91 = load i8*, i8** %6
store i8 110, i8* %91
br label %92
92: ; preds = %24, %90, %88, %86, %84, %82, %80, %78, %76, %74, %72, %70, %68, %66, %64, %62, %60, %58, %56, %54, %52, %50, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28
%93 = load i8*, i8** %5
%94 = getelementptr inbounds i8, i8* %93, i32 -1
store i8* %94, i8** %5
%95 = load i8*, i8** %6
%96 = getelementptr inbounds i8, i8* %95, i32 1
store i8* %96, i8** %6
br label %20
97: ; preds = %20
%98 = load i8*, i8** %6
store i8 0, i8* %98
ret void
}

LLVM IR (-O2):
@switch.table._pr_reverse_complement = [57 x i8] c"TVGHTTCDTTMTKNTTTYSAABWTRTTTTTTTtvghTTcdTTmTknTTTysaabwTr"
define void @_pr_reverse_complement(i8* %0, i8* writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 -1
%10 = icmp ult i8* %9, %0
br i1 %10, label %31, label %11
11: ; preds = %8, %27
%12 = phi i8* [ %29, %27 ], [ %9, %8 ]
%13 = phi i8* [ %28, %27 ], [ %1, %8 ]
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, -65
%17 = icmp ult i32 %16, 57
br i1 %17, label %18, label %27
18: ; preds = %11
%19 = zext i32 %16 to i64
%20 = lshr i64 107581504791393487, %19
%21 = and i64 %20, 1
%22 = icmp eq i64 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %18
%24 = sext i32 %16 to i64
%25 = getelementptr inbounds [57 x i8], [57 x i8]* @switch.table._pr_reverse_complement, i64 0, i64 %24
%26 = load i8, i8* %25
store i8 %26, i8* %13
br label %27
27: ; preds = %18, %11, %23
%28 = getelementptr inbounds i8, i8* %13, i64 1
%29 = getelementptr inbounds i8, i8* %12, i64 -1
%30 = icmp ult i8* %29, %0
br i1 %30, label %31, label %11
31: ; preds = %27, %8
%32 = phi i8* [ %1, %8 ], [ %28, %27 ]
store i8 0, i8* %32
ret void
}