#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*/ printf(char *, char);
int gen_to_int(char c) {
  if (c == 'A')
    return 0;
  if (c == 'C')
    return 1;
  if (c == 'G')
    return 2;
  if (c == 'T')
    return 3;
  if (c == 'D')
    return 4;
  if (c == 'I')
    return 5;
  if (c == 'M')
    return 6;
  if (c == 'R')
    return 7;
  if (c == 'W')
    return 8;
  if (c == 'S')
    return 9;
  if (c == 'Y')
    return 10;
  if (c == 'K')
    return 11;
  if (c == 'E')
    return 12;
  if (c == 'H')
    return 13;
  if (c == 'N')
    return 14;
  printf("\n This is impossible\n Illegal character in gen_to_int %c\n\n", c);
  exit(1);
  return -1;
}


x86 assembly (clang, -O0):
<gen_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    1147 <gen_to_int+0x27>
movl   $0x0,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
jne    1160 <gen_to_int+0x40>
movl   $0x1,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x47,%eax
jne    1179 <gen_to_int+0x59>
movl   $0x2,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x54,%eax
jne    1192 <gen_to_int+0x72>
movl   $0x3,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x44,%eax
jne    11ab <gen_to_int+0x8b>
movl   $0x4,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x49,%eax
jne    11c4 <gen_to_int+0xa4>
movl   $0x5,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x4d,%eax
jne    11dd <gen_to_int+0xbd>
movl   $0x6,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x52,%eax
jne    11f6 <gen_to_int+0xd6>
movl   $0x7,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x57,%eax
jne    120f <gen_to_int+0xef>
movl   $0x8,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x53,%eax
jne    1228 <gen_to_int+0x108>
movl   $0x9,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    1241 <gen_to_int+0x121>
movl   $0xa,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x4b,%eax
jne    125a <gen_to_int+0x13a>
movl   $0xb,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x45,%eax
jne    1273 <gen_to_int+0x153>
movl   $0xc,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x48,%eax
jne    128c <gen_to_int+0x16c>
movl   $0xd,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x4e,%eax
jne    12a5 <gen_to_int+0x185>
movl   $0xe,-0x4(%rbp)
jmp    12bf <gen_to_int+0x19f>
lea    0xd54(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_to_int>:
push   %rax
lea    -0x41(%rdi),%eax
cmp    $0x19,%al
jae    1145 <gen_to_int+0x25>
movzbl %al,%ecx
mov    $0x14e35dd,%edx
bt     %ecx,%edx
jae    1145 <gen_to_int+0x25>
movsbq %al,%rax
lea    0xefc(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret
movsbl %dil,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"\0A This is impossible\0A Illegal character in gen_to_int %c\0A\0A\00"
define i32 @gen_to_int(i8 signext %0) {
%2 = alloca i32
%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 i32 0, i32* %2
br label %82
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 i32 1, i32* %2
br label %82
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 i32 2, i32* %2
br label %82
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 i32 3, i32* %2
br label %82
23: ; preds = %18
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 68
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 4, i32* %2
br label %82
28: ; preds = %23
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 73
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 5, i32* %2
br label %82
33: ; preds = %28
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 77
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 6, i32* %2
br label %82
38: ; preds = %33
%39 = load i8, i8* %3
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 82
br i1 %41, label %42, label %43
42: ; preds = %38
store i32 7, i32* %2
br label %82
43: ; preds = %38
%44 = load i8, i8* %3
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 87
br i1 %46, label %47, label %48
47: ; preds = %43
store i32 8, i32* %2
br label %82
48: ; preds = %43
%49 = load i8, i8* %3
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 83
br i1 %51, label %52, label %53
52: ; preds = %48
store i32 9, i32* %2
br label %82
53: ; preds = %48
%54 = load i8, i8* %3
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 89
br i1 %56, label %57, label %58
57: ; preds = %53
store i32 10, i32* %2
br label %82
58: ; preds = %53
%59 = load i8, i8* %3
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 75
br i1 %61, label %62, label %63
62: ; preds = %58
store i32 11, i32* %2
br label %82
63: ; preds = %58
%64 = load i8, i8* %3
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 69
br i1 %66, label %67, label %68
67: ; preds = %63
store i32 12, i32* %2
br label %82
68: ; preds = %63
%69 = load i8, i8* %3
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 72
br i1 %71, label %72, label %73
72: ; preds = %68
store i32 13, i32* %2
br label %82
73: ; preds = %68
%74 = load i8, i8* %3
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 78
br i1 %76, label %77, label %78
77: ; preds = %73
store i32 14, i32* %2
br label %82
78: ; preds = %73
%79 = load i8, i8* %3
%80 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8 signext %79)
%81 = call i32 @exit(i32 1)
unreachable
82: ; preds = %77, %72, %67, %62, %57, %52, %47, %42, %37, %32, %27, %22, %17, %12, %7
%83 = load i32, i32* %2
ret i32 %83
}

LLVM IR (-O2):
@.str = [59 x i8] c"\0A This is impossible\0A Illegal character in gen_to_int %c\0A\0A\00"
@switch.table.gen_to_int = [25 x i32] [i32 0, i32 0, i32 1, i32 4, i32 12, i32 0, i32 2, i32 13, i32 5, i32 0, i32 11, i32 0, i32 6, i32 14, i32 0, i32 0, i32 0, i32 7, i32 9, i32 3, i32 0, i32 0, i32 8, i32 0, i32 10]
define i32 @gen_to_int(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 25
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = zext i8 %2 to i32
%9 = lshr i32 21902813, %8
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %7
%13 = sext i8 %2 to i64
%14 = getelementptr inbounds [25 x i32], [25 x i32]* @switch.table.gen_to_int, i64 0, i64 %13
%15 = load i32, i32* %14
ret i32 %15
}