#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*/ feof(int /*<<< orphan*/);
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ predict(int *);
int /*<<< orphan*/ stdin;
char *strchr(char *, int);
char *strdup(char *);
int main(int ARGC, char *ARGV[]) {
  char *alphabet = strdup("FIVWMLCHYAGNRTPDEQSK");
  char *p;
  int c, i, j, s[41];
  for (i = 0; i < 41; ++i) {
    s[i] = 21 - 1;
  }
  while (!feof(stdin)) {
    c = fgetc(stdin);
    p = strchr(alphabet, c);
    if (p != NULL) {
      for (i = 1; i < 41; ++i) {
        s[41 - i] = s[41 - i - 1];
      }
      s[0] = p - alphabet;
      predict(s);
    } else if ((char)c == '\n') {
      for (i = 0; i < (41 - 1) / 2; i++) {
        for (j = 1; j < 41; ++j) {
          s[41 - j] = s[41 - j - 1];
        }
        s[0] = 21 - 1;
        predict(s);
      }
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe90(%rip),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x29,-0x28(%rbp)
jge    11a7 <main+0x57>
movslq -0x28(%rbp),%rax
movl   $0x14,-0xd0(%rbp,%rax,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1180 <main+0x30>
jmp    11ac <main+0x5c>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11cf <main+0x7f>
jmp    12f8 <main+0x1a8>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1261 <main+0x111>
movl   $0x1,-0x28(%rbp)
cmpl   $0x29,-0x28(%rbp)
jge    123f <main+0xef>
mov    $0x29,%eax
sub    -0x28(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,4),%ecx
mov    $0x29,%eax
sub    -0x28(%rbp),%eax
cltq
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1202 <main+0xb2>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xd0(%rbp)
lea    -0xd0(%rbp),%rdi
call   1060 <predict@plt>
jmp    12f3 <main+0x1a3>
mov    -0x24(%rbp),%eax
movsbl %al,%eax
cmp    $0xa,%eax
jne    12ee <main+0x19e>
movl   $0x0,-0x28(%rbp)
cmpl   $0x14,-0x28(%rbp)
jge    12e9 <main+0x199>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x29,-0x2c(%rbp)
jge    12c5 <main+0x175>
mov    $0x29,%eax
sub    -0x2c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xd0(%rbp,%rax,4),%ecx
mov    $0x29,%eax
sub    -0x2c(%rbp),%eax
cltq
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1288 <main+0x138>
movl   $0x14,-0xd0(%rbp)
lea    -0xd0(%rbp),%rdi
call   1060 <predict@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1277 <main+0x127>
jmp    12ee <main+0x19e>
jmp    12f3 <main+0x1a3>
jmp    11ac <main+0x5c>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
lea    0xe98(%rip),%rdi
call   1080 <strdup@plt>
mov    %rax,%r14
movaps 0xe79(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movl   $0x14,0xa0(%rsp)
mov    0x2e18(%rip),%r13
mov    0x0(%r13),%edi
call   1050 <feof@plt>
test   %eax,%eax
je     11f1 <main+0x91>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x4(%rsp),%r15
mov    %rsp,%r12
jmp    122e <main+0xce>
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbx
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
sub    %r14d,%ebx
mov    %ebx,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    0x0(%r13),%edi
call   1050 <feof@plt>
test   %eax,%eax
jne    11dd <main+0x7d>
mov    0x0(%r13),%edi
call   1040 <fgetc@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1200 <main+0xa0>
cmp    $0xa,%bpl
jne    1221 <main+0xc1>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
movl   $0x14,(%rsp)
mov    %r12,%rdi
call   1060 <predict@plt>
mov    $0xa0,%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <memmove@plt>
mov    $0x14,%ebx
jmp    1216 <main+0xb6>

LLVM IR (-O0):
@.str = [21 x i8] c"FIVWMLCHYAGNRTPDEQSK\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [41 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i8* @strdup(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %6
store i32 0, i32* %9
br label %13
13: ; preds = %20, %2
%14 = load i32, i32* %9
%15 = icmp slt i32 %14, 41
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 %18
store i32 20, i32* %19
br label %20
20: ; preds = %16
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 1
store i32 %22, i32* %9
br label %13
23: ; preds = %13
br label %24
24: ; preds = %101, %23
%25 = load i32, i32* @stdin
%26 = call i32 @feof(i32 %25)
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
br i1 %28, label %29, label %102
29: ; preds = %24
%30 = load i32, i32* @stdin
%31 = call i32 @fgetc(i32 %30)
store i32 %31, i32* %8
%32 = load i8*, i8** %6
%33 = load i32, i32* %8
%34 = call i8* @strchr(i8* %32, i32 %33)
store i8* %34, i8** %7
%35 = load i8*, i8** %7
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %65
37: ; preds = %29
store i32 1, i32* %9
br label %38
38: ; preds = %52, %37
%39 = load i32, i32* %9
%40 = icmp slt i32 %39, 41
br i1 %40, label %41, label %55
41: ; preds = %38
%42 = load i32, i32* %9
%43 = sub nsw i32 41, %42
%44 = sub nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = load i32, i32* %9
%49 = sub nsw i32 41, %48
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 %50
store i32 %47, i32* %51
br label %52
52: ; preds = %41
%53 = load i32, i32* %9
%54 = add nsw i32 %53, 1
store i32 %54, i32* %9
br label %38
55: ; preds = %38
%56 = load i8*, i8** %7
%57 = load i8*, i8** %6
%58 = ptrtoint i8* %56 to i64
%59 = ptrtoint i8* %57 to i64
%60 = sub i64 %58, %59
%61 = trunc i64 %60 to i32
%62 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 0
store i32 %61, i32* %62
%63 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 0
%64 = call i32 @predict(i32* %63)
br label %101
65: ; preds = %29
%66 = load i32, i32* %8
%67 = trunc i32 %66 to i8
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 10
br i1 %69, label %70, label %100
70: ; preds = %65
store i32 0, i32* %9
br label %71
71: ; preds = %96, %70
%72 = load i32, i32* %9
%73 = icmp slt i32 %72, 20
br i1 %73, label %74, label %99
74: ; preds = %71
store i32 1, i32* %10
br label %75
75: ; preds = %89, %74
%76 = load i32, i32* %10
%77 = icmp slt i32 %76, 41
br i1 %77, label %78, label %92
78: ; preds = %75
%79 = load i32, i32* %10
%80 = sub nsw i32 41, %79
%81 = sub nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 %82
%84 = load i32, i32* %83
%85 = load i32, i32* %10
%86 = sub nsw i32 41, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 %87
store i32 %84, i32* %88
br label %89
89: ; preds = %78
%90 = load i32, i32* %10
%91 = add nsw i32 %90, 1
store i32 %91, i32* %10
br label %75
92: ; preds = %75
%93 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 0
store i32 20, i32* %93
%94 = getelementptr inbounds [41 x i32], [41 x i32]* %11, i64 0, i64 0
%95 = call i32 @predict(i32* %94)
br label %96
96: ; preds = %92
%97 = load i32, i32* %9
%98 = add nsw i32 %97, 1
store i32 %98, i32* %9
br label %71
99: ; preds = %71
br label %100
100: ; preds = %99, %65
br label %101
101: ; preds = %100, %55
br label %24
102: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"FIVWMLCHYAGNRTPDEQSK\00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [41 x i32]
%4 = bitcast [41 x i32]* %3 to i8*
%5 = tail call dereferenceable_or_null(21) i8* @strdup(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 0
%7 = bitcast [41 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %7
%8 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 4
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %9
%10 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 8
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %11
%12 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 12
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %13
%14 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 16
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %15
%16 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 20
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %17
%18 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 24
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %19
%20 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 28
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %21
%22 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 32
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %23
%24 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 36
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 20, i32 20, i32 20, i32 20>, <4 x i32>* %25
%26 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 40
store i32 20, i32* %26
%27 = load i32, i32* @stdin
%28 = call i32 @feof(i32 %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %73
30: ; preds = %2
%31 = getelementptr inbounds [41 x i32], [41 x i32]* %3, i64 0, i64 1
%32 = ptrtoint i8* %5 to i64
%33 = bitcast i32* %31 to i8*
br label %34
34: ; preds = %30, %69
%35 = load i32, i32* @stdin
%36 = call i32 @fgetc(i32 %35)
%37 = call i8* @strchr(i8* dereferenceable(1) %5, i32 %36)
%38 = icmp eq i8* %37, null
br i1 %38, label %43, label %39
39: ; preds = %34
%40 = ptrtoint i8* %37 to i64
%41 = sub i64 %40, %32
%42 = trunc i64 %41 to i32
br label %66
43: ; preds = %34
%44 = and i32 %36, 255
%45 = icmp eq i32 %44, 10
br i1 %45, label %46, label %69
46: ; preds = %43
store i32 20, i32* %6
%47 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%48 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%49 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%50 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%51 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%52 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%53 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%54 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%55 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%56 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%57 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%58 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%59 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%60 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%61 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%62 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%63 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%64 = call i32 @predict(i32* %6)
store i32 20, i32* %6
%65 = call i32 @predict(i32* %6)
br label %66
66: ; preds = %39, %46
%67 = phi i32 [ %42, %39 ], [ 20, %46 ]
store i32 %67, i32* %6
%68 = call i32 @predict(i32* %6)
br label %69
69: ; preds = %66, %43
%70 = load i32, i32* @stdin
%71 = call i32 @feof(i32 %70)
%72 = icmp eq i32 %71, 0
br i1 %72, label %34, label %73
73: ; preds = %69, %2
ret i32 0
}