#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*/ *gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int hash_table[128];
  char line[32];
  hash_table['A'] = '2';
  hash_table['B'] = '2';
  hash_table['C'] = '2';
  hash_table['D'] = '3';
  hash_table['E'] = '3';
  hash_table['F'] = '3';
  hash_table['G'] = '4';
  hash_table['H'] = '4';
  hash_table['I'] = '4';
  hash_table['J'] = '5';
  hash_table['K'] = '5';
  hash_table['L'] = '5';
  hash_table['M'] = '6';
  hash_table['N'] = '6';
  hash_table['O'] = '6';
  hash_table['P'] = '7';
  hash_table['Q'] = '7';
  hash_table['R'] = '7';
  hash_table['S'] = '7';
  hash_table['T'] = '8';
  hash_table['U'] = '8';
  hash_table['V'] = '8';
  hash_table['W'] = '9';
  hash_table['X'] = '9';
  hash_table['Y'] = '9';
  hash_table['Z'] = '9';
  while (gets(line) != NULL) {
    char *ptr;
    for (ptr = &line[0]; *ptr != '\0'; ptr++) {
      if (*ptr >= 'A' && *ptr <= 'Z') {
        printf("%c", hash_table[*ptr]);
      } else {
        printf("%c", *ptr);
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x10c(%rbp)
movl   $0x32,-0x108(%rbp)
movl   $0x32,-0x104(%rbp)
movl   $0x33,-0x100(%rbp)
movl   $0x33,-0xfc(%rbp)
movl   $0x33,-0xf8(%rbp)
movl   $0x34,-0xf4(%rbp)
movl   $0x34,-0xf0(%rbp)
movl   $0x34,-0xec(%rbp)
movl   $0x35,-0xe8(%rbp)
movl   $0x35,-0xe4(%rbp)
movl   $0x35,-0xe0(%rbp)
movl   $0x36,-0xdc(%rbp)
movl   $0x36,-0xd8(%rbp)
movl   $0x36,-0xd4(%rbp)
movl   $0x37,-0xd0(%rbp)
movl   $0x37,-0xcc(%rbp)
movl   $0x37,-0xc8(%rbp)
movl   $0x37,-0xc4(%rbp)
movl   $0x38,-0xc0(%rbp)
movl   $0x38,-0xbc(%rbp)
movl   $0x38,-0xb8(%rbp)
movl   $0x39,-0xb4(%rbp)
movl   $0x39,-0xb0(%rbp)
movl   $0x39,-0xac(%rbp)
movl   $0x39,-0xa8(%rbp)
lea    -0x230(%rbp),%rdi
call   1040 <gets@plt>
cmp    $0x0,%rax
je     12ff <main+0x1df>
lea    -0x230(%rbp),%rax
mov    %rax,-0x238(%rbp)
mov    -0x238(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     12ec <main+0x1cc>
mov    -0x238(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     12b8 <main+0x198>
mov    -0x238(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     12b8 <main+0x198>
mov    -0x238(%rbp),%rax
movsbq (%rax),%rax
mov    -0x210(%rbp,%rax,4),%esi
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <main+0x1b0>
mov    -0x238(%rbp),%rax
movsbl (%rax),%esi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d5 <main+0x1b5>
mov    -0x238(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x238(%rbp)
jmp    125a <main+0x13a>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1236 <main+0x116>
xor    %eax,%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x220,%rsp
movaps 0xecd(%rip),%xmm0
movups %xmm0,0x124(%rsp)
movaps 0xece(%rip),%xmm0
movups %xmm0,0x134(%rsp)
movaps 0xecf(%rip),%xmm0
movups %xmm0,0x144(%rsp)
movaps 0xed0(%rip),%xmm0
movups %xmm0,0x154(%rsp)
movaps 0xed1(%rip),%xmm0
movups %xmm0,0x164(%rsp)
movaps 0xed2(%rip),%xmm0
movups %xmm0,0x174(%rsp)
movabs $0x3900000039,%rax
mov    %rax,0x184(%rsp)
mov    %rsp,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     1204 <main+0xe4>
lea    0x1(%rsp),%r14
mov    %rsp,%r15
jmp    11c7 <main+0xa7>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     1204 <main+0xe4>
mov    (%rsp),%al
test   %al,%al
je     11b0 <main+0x90>
mov    %r14,%rbx
jmp    11f3 <main+0xd3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11b0 <main+0x90>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     11e0 <main+0xc0>
movzbl %al,%eax
mov    0x20(%rsp,%rax,4),%edi
jmp    11e3 <main+0xc3>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i32]
%3 = alloca [32 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 65
store i32 50, i32* %5
%6 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 66
store i32 50, i32* %6
%7 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 67
store i32 50, i32* %7
%8 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 68
store i32 51, i32* %8
%9 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 69
store i32 51, i32* %9
%10 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 70
store i32 51, i32* %10
%11 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 71
store i32 52, i32* %11
%12 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 72
store i32 52, i32* %12
%13 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 73
store i32 52, i32* %13
%14 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 74
store i32 53, i32* %14
%15 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 75
store i32 53, i32* %15
%16 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 76
store i32 53, i32* %16
%17 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 77
store i32 54, i32* %17
%18 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 78
store i32 54, i32* %18
%19 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 79
store i32 54, i32* %19
%20 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 80
store i32 55, i32* %20
%21 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 81
store i32 55, i32* %21
%22 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 82
store i32 55, i32* %22
%23 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 83
store i32 55, i32* %23
%24 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 84
store i32 56, i32* %24
%25 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 85
store i32 56, i32* %25
%26 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 86
store i32 56, i32* %26
%27 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 87
store i32 57, i32* %27
%28 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 88
store i32 57, i32* %28
%29 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 89
store i32 57, i32* %29
%30 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 90
store i32 57, i32* %30
br label %31
31: ; preds = %68, %0
%32 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%33 = call i32* @gets(i8* %32)
%34 = icmp ne i32* %33, null
br i1 %34, label %35, label %70
35: ; preds = %31
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
store i8* %36, i8** %4
br label %37
37: ; preds = %65, %35
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %68
42: ; preds = %37
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp sge i32 %45, 65
br i1 %46, label %47, label %59
47: ; preds = %42
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp sle i32 %50, 90
br i1 %51, label %52, label %59
52: ; preds = %47
%53 = load i8*, i8** %4
%54 = load i8, i8* %53
%55 = sext i8 %54 to i64
%56 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %57)
br label %64
59: ; preds = %47, %42
%60 = load i8*, i8** %4
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %59, %52
br label %65
65: ; preds = %64
%66 = load i8*, i8** %4
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %4
br label %37
68: ; preds = %37
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
70: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [128 x i32]
%2 = alloca [32 x i8]
%3 = bitcast [128 x i32]* %1 to i8*
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 65
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 50, i32 50, i32 50, i32 51>, <4 x i32>* %6
%7 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 69
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 51, i32 51, i32 52, i32 52>, <4 x i32>* %8
%9 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 73
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 52, i32 53, i32 53, i32 53>, <4 x i32>* %10
%11 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 77
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 54, i32 54, i32 54, i32 55>, <4 x i32>* %12
%13 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 81
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 55, i32 55, i32 55, i32 56>, <4 x i32>* %14
%15 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 85
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 56, i32 56, i32 57, i32 57>, <4 x i32>* %16
%17 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 89
store i32 57, i32* %17
%18 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 90
store i32 57, i32* %18
%19 = call i32* @gets(i8* %4)
%20 = icmp eq i32* %19, null
br i1 %20, label %45, label %21
21: ; preds = %0, %41
%22 = load i8, i8* %4
%23 = icmp eq i8 %22, 0
br i1 %23, label %41, label %24
24: ; preds = %21, %35
%25 = phi i8 [ %39, %35 ], [ %22, %21 ]
%26 = phi i8* [ %38, %35 ], [ %4, %21 ]
%27 = add i8 %25, -65
%28 = icmp ult i8 %27, 26
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = zext i8 %25 to i64
%31 = getelementptr inbounds [128 x i32], [128 x i32]* %1, i64 0, i64 %30
%32 = load i32, i32* %31
br label %35
33: ; preds = %24
%34 = sext i8 %25 to i32
br label %35
35: ; preds = %29, %33
%36 = phi i32 [ %32, %29 ], [ %34, %33 ]
%37 = call i32 @putchar(i32 %36)
%38 = getelementptr inbounds i8, i8* %26, i64 1
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 0
br i1 %40, label %41, label %24
41: ; preds = %35, %21
%42 = call i32 @putchar(i32 10)
%43 = call i32* @gets(i8* %4)
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %21
45: ; preds = %41, %0
ret i32 0
}