#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, char);
int /*<<< orphan*/ stderr;
char char_to_num(char c) {
  if (c == 'A')
    return 0;
  if (c == 'C')
    return 1;
  if (c == 'G')
    return 2;
  if (c == 'T')
    return 3;
  if (c == 'a')
    return 0;
  if (c == 'c')
    return 1;
  if (c == 'g')
    return 2;
  if (c == 't')
    return 3;
  if (c == 'N')
    return 99;
  if (c == 'R' || c == 'r' || c == 'Y' || c == 'y' || c == 'M' || c == 'm' ||
      c == 'K' || c == 'k' || c == 'W' || c == 'w' || c == 'S' || c == 's' ||
      c == 'B' || c == 'b' || c == 'D' || c == 'd' || c == 'H' || c == 'h' ||
      c == 'V' || c == 'v')
    return 99;
  if (c == 'n')
    return 99;
  if (c == 'x')
    return 99;
  fprintf(stderr, "ERROR3: c=%d->%c\n", c, c);
  exit(1);
}


x86 assembly (clang, -O0):
<char_to_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jne    1144 <char_to_num+0x24>
movb   $0x0,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x43,%eax
jne    115a <char_to_num+0x3a>
movb   $0x1,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x47,%eax
jne    1170 <char_to_num+0x50>
movb   $0x2,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x54,%eax
jne    1186 <char_to_num+0x66>
movb   $0x3,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jne    119c <char_to_num+0x7c>
movb   $0x0,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x63,%eax
jne    11b2 <char_to_num+0x92>
movb   $0x1,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x67,%eax
jne    11c8 <char_to_num+0xa8>
movb   $0x2,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x74,%eax
jne    11de <char_to_num+0xbe>
movb   $0x3,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x4e,%eax
jne    11f4 <char_to_num+0xd4>
movb   $0x63,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x52,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x72,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x59,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x79,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x4d,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x6d,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x4b,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x6b,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x57,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x77,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x53,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x73,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x42,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x62,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x44,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x64,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x48,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x68,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x56,%eax
je     12f8 <char_to_num+0x1d8>
movsbl -0x2(%rbp),%eax
cmp    $0x76,%eax
jne    1301 <char_to_num+0x1e1>
movb   $0x63,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x6e,%eax
jne    1317 <char_to_num+0x1f7>
movb   $0x63,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
movsbl -0x2(%rbp),%eax
cmp    $0x78,%eax
jne    132d <char_to_num+0x20d>
movb   $0x63,-0x1(%rbp)
jmp    1356 <char_to_num+0x236>
mov    0x2cac(%rip),%rax
mov    (%rax),%edi
mov    -0x2(%rbp),%al
lea    0xcc0(%rip),%rsi
movsbl %al,%edx
movsbl -0x2(%rbp),%ecx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_num>:
push   %rax
lea    -0x41(%rdi),%eax
cmp    $0x39,%al
jae    114b <char_to_num+0x2b>
movzbl %al,%ecx
movabs $0x1ee34cf016e34cf,%rdx
34 ee 01
bt     %rcx,%rdx
jae    114b <char_to_num+0x2b>
movsbq %al,%rax
lea    0xecc(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
movsbl %dil,%ecx
lea    0xea1(%rip),%rsi
mov    %eax,%edi
mov    %ecx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"ERROR3: c=%d->%c\0A\00"
define signext i8 @char_to_num(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 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %2
br label %145
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 67
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 1, i8* %2
br label %145
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 71
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 2, i8* %2
br label %145
18: ; preds = %13
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 84
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 3, i8* %2
br label %145
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 97
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 0, i8* %2
br label %145
28: ; preds = %23
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 99
br i1 %31, label %32, label %33
32: ; preds = %28
store i8 1, i8* %2
br label %145
33: ; preds = %28
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 103
br i1 %36, label %37, label %38
37: ; preds = %33
store i8 2, i8* %2
br label %145
38: ; preds = %33
%39 = load i8, i8* %3
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 116
br i1 %41, label %42, label %43
42: ; preds = %38
store i8 3, i8* %2
br label %145
43: ; preds = %38
%44 = load i8, i8* %3
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 78
br i1 %46, label %47, label %48
47: ; preds = %43
store i8 99, i8* %2
br label %145
48: ; preds = %43
%49 = load i8, i8* %3
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 82
br i1 %51, label %128, label %52
52: ; preds = %48
%53 = load i8, i8* %3
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 114
br i1 %55, label %128, label %56
56: ; preds = %52
%57 = load i8, i8* %3
%58 = sext i8 %57 to i32
%59 = icmp eq i32 %58, 89
br i1 %59, label %128, label %60
60: ; preds = %56
%61 = load i8, i8* %3
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 121
br i1 %63, label %128, label %64
64: ; preds = %60
%65 = load i8, i8* %3
%66 = sext i8 %65 to i32
%67 = icmp eq i32 %66, 77
br i1 %67, label %128, label %68
68: ; preds = %64
%69 = load i8, i8* %3
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 109
br i1 %71, label %128, label %72
72: ; preds = %68
%73 = load i8, i8* %3
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 75
br i1 %75, label %128, label %76
76: ; preds = %72
%77 = load i8, i8* %3
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 107
br i1 %79, label %128, label %80
80: ; preds = %76
%81 = load i8, i8* %3
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 87
br i1 %83, label %128, label %84
84: ; preds = %80
%85 = load i8, i8* %3
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 119
br i1 %87, label %128, label %88
88: ; preds = %84
%89 = load i8, i8* %3
%90 = sext i8 %89 to i32
%91 = icmp eq i32 %90, 83
br i1 %91, label %128, label %92
92: ; preds = %88
%93 = load i8, i8* %3
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 115
br i1 %95, label %128, label %96
96: ; preds = %92
%97 = load i8, i8* %3
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 66
br i1 %99, label %128, label %100
100: ; preds = %96
%101 = load i8, i8* %3
%102 = sext i8 %101 to i32
%103 = icmp eq i32 %102, 98
br i1 %103, label %128, label %104
104: ; preds = %100
%105 = load i8, i8* %3
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 68
br i1 %107, label %128, label %108
108: ; preds = %104
%109 = load i8, i8* %3
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 100
br i1 %111, label %128, label %112
112: ; preds = %108
%113 = load i8, i8* %3
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 72
br i1 %115, label %128, label %116
116: ; preds = %112
%117 = load i8, i8* %3
%118 = sext i8 %117 to i32
%119 = icmp eq i32 %118, 104
br i1 %119, label %128, label %120
120: ; preds = %116
%121 = load i8, i8* %3
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 86
br i1 %123, label %128, label %124
124: ; preds = %120
%125 = load i8, i8* %3
%126 = sext i8 %125 to i32
%127 = icmp eq i32 %126, 118
br i1 %127, label %128, label %129
128: ; preds = %124, %120, %116, %112, %108, %104, %100, %96, %92, %88, %84, %80, %76, %72, %68, %64, %60, %56, %52, %48
store i8 99, i8* %2
br label %145
129: ; preds = %124
%130 = load i8, i8* %3
%131 = sext i8 %130 to i32
%132 = icmp eq i32 %131, 110
br i1 %132, label %133, label %134
133: ; preds = %129
store i8 99, i8* %2
br label %145
134: ; preds = %129
%135 = load i8, i8* %3
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 120
br i1 %137, label %138, label %139
138: ; preds = %134
store i8 99, i8* %2
br label %145
139: ; preds = %134
%140 = load i32, i32* @stderr
%141 = load i8, i8* %3
%142 = load i8, i8* %3
%143 = call i32 @fprintf(i32 %140, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %141, i8 signext %142)
%144 = call i32 @exit(i32 1)
unreachable
145: ; preds = %138, %133, %128, %47, %42, %37, %32, %27, %22, %17, %12, %7
%146 = load i8, i8* %2
ret i8 %146
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"ERROR3: c=%d->%c\0A\00"
@switch.table.char_to_num = [57 x i8] c"\00c\01c\00\00\02c\00\00c\00cc\00\00\00cc\03\00cc\00c\00\00\00\00\00\00\00\00c\01c\00\00\02c\00\00c\00cc\00\00\00cc\03\00cccc"
define signext i8 @char_to_num(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 57
br i1 %3, label %8, label %4
4: ; preds = %8, %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = zext i8 %2 to i64
%10 = lshr i64 139106702181938383, %9
%11 = and i64 %10, 1
%12 = icmp eq i64 %11, 0
br i1 %12, label %4, label %13
13: ; preds = %8
%14 = sext i8 %2 to i64
%15 = getelementptr inbounds [57 x i8], [57 x i8]* @switch.table.char_to_num, i64 0, i64 %14
%16 = load i8, i8* %15
ret i8 %16
}