#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 */
const unsigned char *xlate_ambiguity_code(char c) {
  if ('N' == c)
    return (unsigned char *)"ACGT";
  else if ('B' == c)
    return (unsigned char *)"CGT";
  else if ('D' == c)
    return (unsigned char *)"AGT";
  else if ('H' == c)
    return (unsigned char *)"ACT";
  else if ('V' == c)
    return (unsigned char *)"ACG";
  else if ('R' == c)
    return (unsigned char *)"AG";
  else if ('Y' == c)
    return (unsigned char *)"CT";
  else if ('K' == c)
    return (unsigned char *)"GT";
  else if ('M' == c)
    return (unsigned char *)"AC";
  else if ('S' == c)
    return (unsigned char *)"CG";
  else if ('W' == c)
    return (unsigned char *)"AT";
  else
    return NULL;
}


x86 assembly (clang, -O0):
<xlate_ambiguity_code>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x4e,%eax
cmp    %ecx,%eax
jne    112b <xlate_ambiguity_code+0x2b>
lea    0xede(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x42,%eax
cmp    %ecx,%eax
jne    114c <xlate_ambiguity_code+0x4c>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x44,%eax
cmp    %ecx,%eax
jne    116d <xlate_ambiguity_code+0x6d>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x48,%eax
cmp    %ecx,%eax
jne    118e <xlate_ambiguity_code+0x8e>
lea    0xe84(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x56,%eax
cmp    %ecx,%eax
jne    11af <xlate_ambiguity_code+0xaf>
lea    0xe67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x52,%eax
cmp    %ecx,%eax
jne    11d0 <xlate_ambiguity_code+0xd0>
lea    0xe4a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x59,%eax
cmp    %ecx,%eax
jne    11f1 <xlate_ambiguity_code+0xf1>
lea    0xe22(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x4b,%eax
cmp    %ecx,%eax
jne    1212 <xlate_ambiguity_code+0x112>
lea    0xdfd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x4d,%eax
cmp    %ecx,%eax
jne    1233 <xlate_ambiguity_code+0x133>
lea    0xdea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x53,%eax
cmp    %ecx,%eax
jne    1254 <xlate_ambiguity_code+0x154>
lea    0xdc3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movsbl -0x9(%rbp),%ecx
mov    $0x57,%eax
cmp    %ecx,%eax
jne    1275 <xlate_ambiguity_code+0x175>
lea    0xdab(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <xlate_ambiguity_code+0x17d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlate_ambiguity_code>:
add    $0xbe,%dil
cmp    $0x17,%dil
ja     111a <xlate_ambiguity_code+0x1a>
movsbq %dil,%rax
lea    0x2c7b(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ACGT\00"
@.str.1 = [4 x i8] c"CGT\00"
@.str.2 = [4 x i8] c"AGT\00"
@.str.3 = [4 x i8] c"ACT\00"
@.str.4 = [4 x i8] c"ACG\00"
@.str.5 = [3 x i8] c"AG\00"
@.str.6 = [3 x i8] c"CT\00"
@.str.7 = [3 x i8] c"GT\00"
@.str.8 = [3 x i8] c"AC\00"
@.str.9 = [3 x i8] c"CG\00"
@.str.10 = [3 x i8] c"AT\00"
define i8* @xlate_ambiguity_code(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
%6 = icmp eq i32 78, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %59
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 66, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %59
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 68, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %59
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 72, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %59
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 86, %25
br i1 %26, label %27, label %28
27: ; preds = %23
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %59
28: ; preds = %23
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp eq i32 82, %30
br i1 %31, label %32, label %33
32: ; preds = %28
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %59
33: ; preds = %28
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 89, %35
br i1 %36, label %37, label %38
37: ; preds = %33
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %59
38: ; preds = %33
%39 = load i8, i8* %3
%40 = sext i8 %39 to i32
%41 = icmp eq i32 75, %40
br i1 %41, label %42, label %43
42: ; preds = %38
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %59
43: ; preds = %38
%44 = load i8, i8* %3
%45 = sext i8 %44 to i32
%46 = icmp eq i32 77, %45
br i1 %46, label %47, label %48
47: ; preds = %43
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %59
48: ; preds = %43
%49 = load i8, i8* %3
%50 = sext i8 %49 to i32
%51 = icmp eq i32 83, %50
br i1 %51, label %52, label %53
52: ; preds = %48
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %59
53: ; preds = %48
%54 = load i8, i8* %3
%55 = sext i8 %54 to i32
%56 = icmp eq i32 87, %55
br i1 %56, label %57, label %58
57: ; preds = %53
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %59
58: ; preds = %53
store i8* null, i8** %2
br label %59
59: ; preds = %58, %57, %52, %47, %42, %37, %32, %27, %22, %17, %12, %7
%60 = load i8*, i8** %2
ret i8* %60
}

LLVM IR (-O2):
@.str = [5 x i8] c"ACGT\00"
@.str.1 = [4 x i8] c"CGT\00"
@.str.2 = [4 x i8] c"AGT\00"
@.str.3 = [4 x i8] c"ACT\00"
@.str.4 = [4 x i8] c"ACG\00"
@.str.5 = [3 x i8] c"AG\00"
@.str.6 = [3 x i8] c"CT\00"
@.str.7 = [3 x i8] c"GT\00"
@.str.8 = [3 x i8] c"AC\00"
@.str.9 = [3 x i8] c"CG\00"
@.str.10 = [3 x i8] c"AT\00"
@switch.table.xlate_ambiguity_code = [24 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* null, i8* null, i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* null, i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* null, i8* null, i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* null, i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)]
define i8* @xlate_ambiguity_code(i8 signext %0) {
%2 = add i8 %0, -66
%3 = icmp ult i8 %2, 24
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [24 x i8*], [24 x i8*]* @switch.table.xlate_ambiguity_code, i64 0, i64 %5
%7 = load i8*, i8** %6
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ null, %1 ]
ret i8* %9
}