#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 */
char *strchr(char *, char);
char toupper(char);
int vrna_nucleotide_IUPAC_identity(char nt, char mask) {
  char n1, n2, *p;
  p = NULL;
  n1 = toupper(nt);
  n2 = toupper(mask);
  switch (n1) {
  case 'A':
    p = strchr("ARMWDHVN", n2);
    break;
  case 'C':
    p = strchr("CYMSBHVN", n2);
    break;
  case 'G':
    p = strchr("GRKSBDVN", n2);
    break;
  case 'T':
    p = strchr("TYKWBDHN", n2);
    break;
  case 'U':
    p = strchr("UYKWBDHN", n2);
    break;
  case 'I':
    p = strchr("IN", n2);
    break;
  case 'R':
    p = strchr("AGR", n2);
    break;
  case 'Y':
    p = strchr("CTUY", n2);
    break;
  case 'K':
    p = strchr("GTUK", n2);
    break;
  case 'M':
    p = strchr("ACM", n2);
    break;
  case 'S':
    p = strchr("GCS", n2);
    break;
  case 'W':
    p = strchr("ATUW", n2);
    break;
  case 'B':
    p = strchr("GCTBU", n2);
    break;
  case 'D':
    p = strchr("AGTUD", n2);
    break;
  case 'H':
    p = strchr("ACTUH", n2);
    break;
  case 'V':
    p = strchr("ACGV", n2);
    break;
  case 'N':
    p = strchr("ACGTUN", n2);
    break;
  }
  return (p) ? 1 : 0;
}


x86 assembly (clang, -O0):
<vrna_nucleotide_IUPAC_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movq   $0x0,-0x10(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x4(%rbp)
movsbl -0x3(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x18,%eax
ja     1322 <vrna_nucleotide_IUPAC_identity+0x202>
mov    -0x18(%rbp),%rax
lea    0xe8b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xedf(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xecf(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xebf(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xeaf(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe9f(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe8f(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe79(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe64(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe50(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe3c(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe27(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xe12(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xdfe(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xdeb(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xdd8(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xdc5(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1322 <vrna_nucleotide_IUPAC_identity+0x202>
lea    0xdb1(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrna_nucleotide_IUPAC_identity>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <toupper@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
movsbl %bl,%edx
xor    %eax,%eax
add    $0xffffffbf,%edx
cmp    $0x18,%edx
ja     1237 <vrna_nucleotide_IUPAC_identity+0x117>
lea    0xeb3(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
movsbl %cl,%esi
lea    0xf04(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xf40(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xeef(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xf28(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xeda(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xf10(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xed7(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xed7(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xed0(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xee8(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xeaa(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xeb0(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xe7d(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xe7a(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xea7(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xe84(%rip),%rdi
jmp    1232 <vrna_nucleotide_IUPAC_identity+0x112>
movsbl %cl,%esi
lea    0xe66(%rip),%rdi
call   1040 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"ARMWDHVN\00"
@.str.1 = [9 x i8] c"CYMSBHVN\00"
@.str.2 = [9 x i8] c"GRKSBDVN\00"
@.str.3 = [9 x i8] c"TYKWBDHN\00"
@.str.4 = [9 x i8] c"UYKWBDHN\00"
@.str.5 = [3 x i8] c"IN\00"
@.str.6 = [4 x i8] c"AGR\00"
@.str.7 = [5 x i8] c"CTUY\00"
@.str.8 = [5 x i8] c"GTUK\00"
@.str.9 = [4 x i8] c"ACM\00"
@.str.10 = [4 x i8] c"GCS\00"
@.str.11 = [5 x i8] c"ATUW\00"
@.str.12 = [6 x i8] c"GCTBU\00"
@.str.13 = [6 x i8] c"AGTUD\00"
@.str.14 = [6 x i8] c"ACTUH\00"
@.str.15 = [5 x i8] c"ACGV\00"
@.str.16 = [7 x i8] c"ACGTUN\00"
define i32 @vrna_nucleotide_IUPAC_identity(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8*
store i8 %0, i8* %3
store i8 %1, i8* %4
store i8* null, i8** %7
%8 = load i8, i8* %3
%9 = call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %5
%10 = load i8, i8* %4
%11 = call signext i8 @toupper(i8 signext %10)
store i8 %11, i8* %6
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
switch i32 %13, label %65 [
i32 65, label %14
i32 67, label %17
i32 71, label %20
i32 84, label %23
i32 85, label %26
i32 73, label %29
i32 82, label %32
i32 89, label %35
i32 75, label %38
i32 77, label %41
i32 83, label %44
i32 87, label %47
i32 66, label %50
i32 68, label %53
i32 72, label %56
i32 86, label %59
i32 78, label %62
]
14: ; preds = %2
%15 = load i8, i8* %6
%16 = call i8* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %15)
store i8* %16, i8** %7
br label %65
17: ; preds = %2
%18 = load i8, i8* %6
%19 = call i8* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %18)
store i8* %19, i8** %7
br label %65
20: ; preds = %2
%21 = load i8, i8* %6
%22 = call i8* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8 signext %21)
store i8* %22, i8** %7
br label %65
23: ; preds = %2
%24 = load i8, i8* %6
%25 = call i8* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8 signext %24)
store i8* %25, i8** %7
br label %65
26: ; preds = %2
%27 = load i8, i8* %6
%28 = call i8* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8 signext %27)
store i8* %28, i8** %7
br label %65
29: ; preds = %2
%30 = load i8, i8* %6
%31 = call i8* @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8 signext %30)
store i8* %31, i8** %7
br label %65
32: ; preds = %2
%33 = load i8, i8* %6
%34 = call i8* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8 signext %33)
store i8* %34, i8** %7
br label %65
35: ; preds = %2
%36 = load i8, i8* %6
%37 = call i8* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8 signext %36)
store i8* %37, i8** %7
br label %65
38: ; preds = %2
%39 = load i8, i8* %6
%40 = call i8* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8 signext %39)
store i8* %40, i8** %7
br label %65
41: ; preds = %2
%42 = load i8, i8* %6
%43 = call i8* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8 signext %42)
store i8* %43, i8** %7
br label %65
44: ; preds = %2
%45 = load i8, i8* %6
%46 = call i8* @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8 signext %45)
store i8* %46, i8** %7
br label %65
47: ; preds = %2
%48 = load i8, i8* %6
%49 = call i8* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8 signext %48)
store i8* %49, i8** %7
br label %65
50: ; preds = %2
%51 = load i8, i8* %6
%52 = call i8* @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8 signext %51)
store i8* %52, i8** %7
br label %65
53: ; preds = %2
%54 = load i8, i8* %6
%55 = call i8* @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8 signext %54)
store i8* %55, i8** %7
br label %65
56: ; preds = %2
%57 = load i8, i8* %6
%58 = call i8* @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8 signext %57)
store i8* %58, i8** %7
br label %65
59: ; preds = %2
%60 = load i8, i8* %6
%61 = call i8* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8 signext %60)
store i8* %61, i8** %7
br label %65
62: ; preds = %2
%63 = load i8, i8* %6
%64 = call i8* @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8 signext %63)
store i8* %64, i8** %7
br label %65
65: ; preds = %2, %62, %59, %56, %53, %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14
%66 = load i8*, i8** %7
%67 = icmp ne i8* %66, null
%68 = zext i1 %67 to i64
%69 = select i1 %67, i32 1, i32 0
ret i32 %69
}

LLVM IR (-O2):
@.str = [9 x i8] c"ARMWDHVN\00"
@.str.1 = [9 x i8] c"CYMSBHVN\00"
@.str.2 = [9 x i8] c"GRKSBDVN\00"
@.str.3 = [9 x i8] c"TYKWBDHN\00"
@.str.4 = [9 x i8] c"UYKWBDHN\00"
@.str.5 = [3 x i8] c"IN\00"
@.str.6 = [4 x i8] c"AGR\00"
@.str.7 = [5 x i8] c"CTUY\00"
@.str.8 = [5 x i8] c"GTUK\00"
@.str.9 = [4 x i8] c"ACM\00"
@.str.10 = [4 x i8] c"GCS\00"
@.str.11 = [5 x i8] c"ATUW\00"
@.str.12 = [6 x i8] c"GCTBU\00"
@.str.13 = [6 x i8] c"AGTUD\00"
@.str.14 = [6 x i8] c"ACTUH\00"
@.str.15 = [5 x i8] c"ACGV\00"
@.str.16 = [7 x i8] c"ACGTUN\00"
define i32 @vrna_nucleotide_IUPAC_identity(i8 signext %0, i8 signext %1) {
%3 = tail call signext i8 @toupper(i8 signext %0)
%4 = tail call signext i8 @toupper(i8 signext %1)
%5 = sext i8 %3 to i32
switch i32 %5, label %40 [
i32 65, label %6
i32 67, label %8
i32 71, label %10
i32 84, label %12
i32 85, label %14
i32 73, label %16
i32 82, label %18
i32 89, label %20
i32 75, label %22
i32 77, label %24
i32 83, label %26
i32 87, label %28
i32 66, label %30
i32 68, label %32
i32 72, label %34
i32 86, label %36
i32 78, label %38
]
6: ; preds = %2
%7 = tail call i8* @strchr(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %4)
br label %40
8: ; preds = %2
%9 = tail call i8* @strchr(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
br label %40
10: ; preds = %2
%11 = tail call i8* @strchr(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8 signext %4)
br label %40
12: ; preds = %2
%13 = tail call i8* @strchr(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8 signext %4)
br label %40
14: ; preds = %2
%15 = tail call i8* @strchr(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8 signext %4)
br label %40
16: ; preds = %2
%17 = tail call i8* @strchr(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8 signext %4)
br label %40
18: ; preds = %2
%19 = tail call i8* @strchr(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8 signext %4)
br label %40
20: ; preds = %2
%21 = tail call i8* @strchr(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8 signext %4)
br label %40
22: ; preds = %2
%23 = tail call i8* @strchr(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8 signext %4)
br label %40
24: ; preds = %2
%25 = tail call i8* @strchr(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8 signext %4)
br label %40
26: ; preds = %2
%27 = tail call i8* @strchr(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8 signext %4)
br label %40
28: ; preds = %2
%29 = tail call i8* @strchr(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8 signext %4)
br label %40
30: ; preds = %2
%31 = tail call i8* @strchr(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8 signext %4)
br label %40
32: ; preds = %2
%33 = tail call i8* @strchr(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8 signext %4)
br label %40
34: ; preds = %2
%35 = tail call i8* @strchr(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), i8 signext %4)
br label %40
36: ; preds = %2
%37 = tail call i8* @strchr(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8 signext %4)
br label %40
38: ; preds = %2
%39 = tail call i8* @strchr(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i8 signext %4)
br label %40
40: ; preds = %2, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6
%41 = phi i8* [ null, %2 ], [ %39, %38 ], [ %37, %36 ], [ %35, %34 ], [ %33, %32 ], [ %31, %30 ], [ %29, %28 ], [ %27, %26 ], [ %25, %24 ], [ %23, %22 ], [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ]
%42 = icmp ne i8* %41, null
%43 = zext i1 %42 to i32
ret i32 %43
}