#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 getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 10;
  char c;
  while (i--) {
    int p = 1;
    while ((c = getchar()) > '@') {
      p *= (c == 'T' | c == 'D' | c == 'L' | c == 'F') ? 2 : 1;
    }
    printf("%d\n", p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11d9 <main+0xb9>
movl   $0x1,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x40,%eax
jle    11c5 <main+0xa5>
movsbl -0x9(%rbp),%eax
cmp    $0x54,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edx
movsbl -0x9(%rbp),%eax
cmp    $0x44,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     %eax,%edx
movsbl -0x9(%rbp),%eax
cmp    $0x4c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     %eax,%edx
movsbl -0x9(%rbp),%eax
cmp    $0x46,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
or     %eax,%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <main+0x31>
mov    -0x10(%rbp),%esi
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x9,%ebx
lea    0xed0(%rip),%r14
jmp    114f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
sub    $0x1,%ebx
jb     119f <main+0x7f>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x1,%ebp
cmp    $0x41,%al
jl     1140 <main+0x20>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%ecx
and    $0xef,%cl
cmp    $0x44,%cl
sete   %cl
cmp    $0x4c,%al
sete   %dl
cmp    $0x46,%al
sete   %al
or     %dl,%al
or     %cl,%al
movzbl %al,%eax
add    $0x1,%eax
imul   %eax,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x40,%al
jg     1170 <main+0x50>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %5
5: ; preds = %39, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %42
9: ; preds = %5
store i32 1, i32* %4
br label %10
10: ; preds = %14, %9
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 64
br i1 %13, label %14, label %39
14: ; preds = %10
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 84
%18 = zext i1 %17 to i32
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 68
%22 = zext i1 %21 to i32
%23 = or i32 %18, %22
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 76
%27 = zext i1 %26 to i32
%28 = or i32 %23, %27
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 70
%32 = zext i1 %31 to i32
%33 = or i32 %28, %32
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 2, i32 1
%37 = load i32, i32* %4
%38 = mul nsw i32 %37, %36
store i32 %38, i32* %4
br label %10
39: ; preds = %10
%40 = load i32, i32* %4
%41 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %40)
br label %5
42: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %18
%2 = phi i32 [ 9, %0 ], [ %21, %18 ]
%3 = tail call signext i8 (...) @getchar()
%4 = icmp sgt i8 %3, 64
br i1 %4, label %5, label %18
5: ; preds = %1, %5
%6 = phi i8 [ %16, %5 ], [ %3, %1 ]
%7 = phi i32 [ %15, %5 ], [ 1, %1 ]
%8 = and i8 %6, -17
%9 = icmp eq i8 %8, 68
%10 = icmp eq i8 %6, 76
%11 = or i1 %10, %9
%12 = icmp eq i8 %6, 70
%13 = or i1 %12, %11
%14 = select i1 %13, i32 2, i32 1
%15 = mul nsw i32 %14, %7
%16 = tail call signext i8 (...) @getchar()
%17 = icmp sgt i8 %16, 64
br i1 %17, label %5, label %18
18: ; preds = %5, %1
%19 = phi i32 [ 1, %1 ], [ %15, %5 ]
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = add nsw i32 %2, -1
%22 = icmp eq i32 %2, 0
br i1 %22, label %23, label %1
23: ; preds = %18
ret i32 0
}