#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 == 'M')
    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    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x43,%eax
jne    115a <char_to_num+0x3a>
movb   $0x1,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x47,%eax
jne    1170 <char_to_num+0x50>
movb   $0x2,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x54,%eax
jne    1186 <char_to_num+0x66>
movb   $0x3,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jne    119c <char_to_num+0x7c>
movb   $0x0,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x63,%eax
jne    11b2 <char_to_num+0x92>
movb   $0x1,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x67,%eax
jne    11c8 <char_to_num+0xa8>
movb   $0x2,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x74,%eax
jne    11de <char_to_num+0xbe>
movb   $0x3,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x4e,%eax
jne    11f4 <char_to_num+0xd4>
movb   $0x63,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x4d,%eax
jne    120a <char_to_num+0xea>
movb   $0x63,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x52,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x72,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x59,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x79,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x4d,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x6d,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x4b,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x6b,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x57,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x77,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x53,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x73,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x42,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x62,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x44,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x64,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x48,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x68,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x56,%eax
je     130e <char_to_num+0x1ee>
movsbl -0x2(%rbp),%eax
cmp    $0x76,%eax
jne    1317 <char_to_num+0x1f7>
movb   $0x63,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x6e,%eax
jne    132d <char_to_num+0x20d>
movb   $0x63,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
movsbl -0x2(%rbp),%eax
cmp    $0x78,%eax
jne    1343 <char_to_num+0x223>
movb   $0x63,-0x1(%rbp)
jmp    136c <char_to_num+0x24c>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
mov    -0x2(%rbp),%al
lea    0xcaa(%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 %150
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 %150
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 %150
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 %150
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 %150
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 %150
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 %150
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 %150
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 %150
48: ; preds = %43
%49 = load i8, i8* %3
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 77
br i1 %51, label %52, label %53
52: ; preds = %48
store i8 99, i8* %2
br label %150
53: ; preds = %48
%54 = load i8, i8* %3
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 82
br i1 %56, label %133, label %57
57: ; preds = %53
%58 = load i8, i8* %3
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 114
br i1 %60, label %133, label %61
61: ; preds = %57
%62 = load i8, i8* %3
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 89
br i1 %64, label %133, label %65
65: ; preds = %61
%66 = load i8, i8* %3
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 121
br i1 %68, label %133, label %69
69: ; preds = %65
%70 = load i8, i8* %3
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 77
br i1 %72, label %133, label %73
73: ; preds = %69
%74 = load i8, i8* %3
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 109
br i1 %76, label %133, label %77
77: ; preds = %73
%78 = load i8, i8* %3
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 75
br i1 %80, label %133, label %81
81: ; preds = %77
%82 = load i8, i8* %3
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 107
br i1 %84, label %133, label %85
85: ; preds = %81
%86 = load i8, i8* %3
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 87
br i1 %88, label %133, label %89
89: ; preds = %85
%90 = load i8, i8* %3
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 119
br i1 %92, label %133, label %93
93: ; preds = %89
%94 = load i8, i8* %3
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 83
br i1 %96, label %133, label %97
97: ; preds = %93
%98 = load i8, i8* %3
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 115
br i1 %100, label %133, label %101
101: ; preds = %97
%102 = load i8, i8* %3
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 66
br i1 %104, label %133, label %105
105: ; preds = %101
%106 = load i8, i8* %3
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 98
br i1 %108, label %133, label %109
109: ; preds = %105
%110 = load i8, i8* %3
%111 = sext i8 %110 to i32
%112 = icmp eq i32 %111, 68
br i1 %112, label %133, label %113
113: ; preds = %109
%114 = load i8, i8* %3
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 100
br i1 %116, label %133, label %117
117: ; preds = %113
%118 = load i8, i8* %3
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 72
br i1 %120, label %133, label %121
121: ; preds = %117
%122 = load i8, i8* %3
%123 = sext i8 %122 to i32
%124 = icmp eq i32 %123, 104
br i1 %124, label %133, label %125
125: ; preds = %121
%126 = load i8, i8* %3
%127 = sext i8 %126 to i32
%128 = icmp eq i32 %127, 86
br i1 %128, label %133, label %129
129: ; preds = %125
%130 = load i8, i8* %3
%131 = sext i8 %130 to i32
%132 = icmp eq i32 %131, 118
br i1 %132, label %133, label %134
133: ; preds = %129, %125, %121, %117, %113, %109, %105, %101, %97, %93, %89, %85, %81, %77, %73, %69, %65, %61, %57, %53
store i8 99, i8* %2
br label %150
134: ; preds = %129
%135 = load i8, i8* %3
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 110
br i1 %137, label %138, label %139
138: ; preds = %134
store i8 99, i8* %2
br label %150
139: ; preds = %134
%140 = load i8, i8* %3
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 120
br i1 %142, label %143, label %144
143: ; preds = %139
store i8 99, i8* %2
br label %150
144: ; preds = %139
%145 = load i32, i32* @stderr
%146 = load i8, i8* %3
%147 = load i8, i8* %3
%148 = call i32 @fprintf(i32 %145, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %146, i8 signext %147)
%149 = call i32 @exit(i32 1)
unreachable
150: ; preds = %143, %138, %133, %52, %47, %42, %37, %32, %27, %22, %17, %12, %7
%151 = load i8, i8* %2
ret i8 %151
}

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
}