#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  const int c[30] = {2, 1, 1, 1, 1, 0, 0, 4, 4, 0, 1, 0, 2,
                     3, 4, 0, 0, 0, 3, 2, 2, 2, 2, 4, 2, 3};
  char cc;
  scanf("%c", &cc);
  switch (c[cc - 'A']) {
  case 0:
    printf("common\n");
    break;
  case 1:
    printf("up-down\n");
    break;
  case 2:
    printf("left-right\n");
    break;
  case 3:
    printf("center\n");
    break;
  case 4:
    printf("up-down\nleft-right\ncenter\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xf57(%rip),%rax
mov    %rax,-0x10(%rbp)
movaps 0xf3c(%rip),%xmm0
movaps %xmm0,-0x20(%rbp)
movaps 0xf21(%rip),%xmm0
movaps %xmm0,-0x30(%rbp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,-0x40(%rbp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,-0x50(%rbp)
movaps 0xed0(%rip),%xmm0
movaps %xmm0,-0x60(%rbp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,-0x80(%rbp)
lea    0xf07(%rip),%rdi
lea    -0x81(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x81(%rbp),%eax
add    $0xffffffbf,%eax
cltq
mov    -0x80(%rbp,%rax,4),%eax
mov    %rax,-0x90(%rbp)
sub    $0x4,%rax
ja     1225 <main+0x105>
mov    -0x90(%rbp),%rax
lea    0xe34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf64(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
movsbq 0x7(%rsp),%rax
lea    0xec1(%rip),%rcx
movslq -0x104(%rcx,%rax,4),%rax
ff
lea    0xf2a(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.c = [30 x i32] [i32 2, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 4, i32 4, i32 0, i32 1, i32 0, i32 2, i32 3, i32 4, i32 0, i32 0, i32 0, i32 3, i32 2, i32 2, i32 2, i32 2, i32 4, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0]
@.str = [3 x i8] c"%c\00"
@.str.1 = [8 x i8] c"common\0A\00"
@.str.2 = [9 x i8] c"up-down\0A\00"
@.str.3 = [12 x i8] c"left-right\0A\00"
@.str.4 = [8 x i8] c"center\0A\00"
@.str.5 = [27 x i8] c"up-down\0Aleft-right\0Acenter\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i32]
%3 = alloca i8
store i32 0, i32* %1
%4 = bitcast [30 x i32]* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 65
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [30 x i32], [30 x i32]* %2, i64 0, i64 %9
%11 = load i32, i32* %10
switch i32 %11, label %22 [
i32 0, label %12
i32 1, label %14
i32 2, label %16
i32 3, label %18
i32 4, label %20
]
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %22
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %22
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %22
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %22
22: ; preds = %0, %20, %18, %16, %14, %12
ret i32 0
}

LLVM IR (-O2):
@__const.main.c = [30 x i32] [i32 2, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 4, i32 4, i32 0, i32 1, i32 0, i32 2, i32 3, i32 4, i32 0, i32 0, i32 0, i32 3, i32 2, i32 2, i32 2, i32 2, i32 4, i32 2, i32 3, i32 0, i32 0, i32 0, i32 0]
@.str = [3 x i8] c"%c\00"
@str = [26 x i8] c"up-down\0Aleft-right\0Acenter\00"
@str.6 = [7 x i8] c"center\00"
@str.7 = [11 x i8] c"left-right\00"
@str.8 = [8 x i8] c"up-down\00"
@str.9 = [7 x i8] c"common\00"
@reltable.main = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.9 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.8 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.7 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.6 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @str to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i64
%5 = add nsw i64 %4, -65
%6 = getelementptr inbounds [30 x i32], [30 x i32]* @__const.main.c, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = shl i64 %8, 2
%10 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.main to i8*), i64 %9)
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}