#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, char *);
int main() {
  char c;
  while (scanf("%c", &c) != EOF) {
    if (65 <= c && c <= 67)
      printf("%d", 2);
    else if (68 <= c && c <= 70)
      printf("%d", 3);
    else if (71 <= c && c <= 73)
      printf("%d", 4);
    else if (74 <= c && c <= 76)
      printf("%d", 5);
    else if (77 <= c && c <= 79)
      printf("%d", 6);
    else if (80 <= c && c <= 83)
      printf("%d", 7);
    else if (84 <= c && c <= 86)
      printf("%d", 8);
    else if (87 <= c && c <= 90)
      printf("%d", 9);
    else
      printf("%c", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1327 <main+0x207>
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1183 <main+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x43,%eax
jg     1183 <main+0x63>
lea    0xe8f(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
jmp    1322 <main+0x202>
movsbl -0x5(%rbp),%ecx
mov    $0x44,%eax
cmp    %ecx,%eax
jg     11b7 <main+0x97>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     11b7 <main+0x97>
lea    0xe5b(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
jmp    131d <main+0x1fd>
movsbl -0x5(%rbp),%ecx
mov    $0x47,%eax
cmp    %ecx,%eax
jg     11eb <main+0xcb>
movsbl -0x5(%rbp),%eax
cmp    $0x49,%eax
jg     11eb <main+0xcb>
lea    0xe27(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
jmp    1318 <main+0x1f8>
movsbl -0x5(%rbp),%ecx
mov    $0x4a,%eax
cmp    %ecx,%eax
jg     121f <main+0xff>
movsbl -0x5(%rbp),%eax
cmp    $0x4c,%eax
jg     121f <main+0xff>
lea    0xdf3(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
jmp    1313 <main+0x1f3>
movsbl -0x5(%rbp),%ecx
mov    $0x4d,%eax
cmp    %ecx,%eax
jg     1253 <main+0x133>
movsbl -0x5(%rbp),%eax
cmp    $0x4f,%eax
jg     1253 <main+0x133>
lea    0xdbf(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
jmp    130e <main+0x1ee>
movsbl -0x5(%rbp),%ecx
mov    $0x50,%eax
cmp    %ecx,%eax
jg     1287 <main+0x167>
movsbl -0x5(%rbp),%eax
cmp    $0x53,%eax
jg     1287 <main+0x167>
lea    0xd8b(%rip),%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
jmp    1309 <main+0x1e9>
movsbl -0x5(%rbp),%ecx
mov    $0x54,%eax
cmp    %ecx,%eax
jg     12bb <main+0x19b>
movsbl -0x5(%rbp),%eax
cmp    $0x56,%eax
jg     12bb <main+0x19b>
lea    0xd57(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
jmp    1304 <main+0x1e4>
movsbl -0x5(%rbp),%ecx
mov    $0x57,%eax
cmp    %ecx,%eax
jg     12ef <main+0x1cf>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     12ef <main+0x1cf>
lea    0xd23(%rip),%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
jmp    12ff <main+0x1df>
lea    0xd0a(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    1304 <main+0x1e4>
jmp    1309 <main+0x1e9>
jmp    130e <main+0x1ee>
jmp    1313 <main+0x1f3>
jmp    1318 <main+0x1f8>
jmp    131d <main+0x1fd>
jmp    1322 <main+0x202>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%rbx
cmp    (%rbx),%rax
jne    1153 <main+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xea9(%rip),%r14
lea    0xe9f(%rip),%r15
lea    0x7(%rsp),%r12
jmp    118d <main+0x6d>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    (%rbx),%rax
je     1145 <main+0x25>
movzbl 0x7(%rsp),%eax
lea    -0x41(%rax),%ecx
cmp    $0x2,%cl
jbe    1170 <main+0x50>
lea    -0x44(%rax),%ecx
cmp    $0x2,%cl
ja     11b0 <main+0x90>
mov    %r14,%rdi
mov    $0x3,%esi
jmp    1178 <main+0x58>
nopl   0x0(%rax)
lea    -0x47(%rax),%ecx
cmp    $0x2,%cl
ja     11c2 <main+0xa2>
mov    %r14,%rdi
mov    $0x4,%esi
jmp    1178 <main+0x58>
lea    -0x4a(%rax),%ecx
cmp    $0x2,%cl
ja     11d4 <main+0xb4>
mov    %r14,%rdi
mov    $0x5,%esi
jmp    1178 <main+0x58>
lea    -0x4d(%rax),%ecx
cmp    $0x2,%cl
ja     11e6 <main+0xc6>
mov    %r14,%rdi
mov    $0x6,%esi
jmp    1178 <main+0x58>
mov    %eax,%ecx
and    $0xfc,%cl
cmp    $0x50,%cl
jne    11fd <main+0xdd>
mov    %r14,%rdi
mov    $0x7,%esi
jmp    1178 <main+0x58>
lea    -0x54(%rax),%ecx
cmp    $0x2,%cl
ja     1212 <main+0xf2>
mov    %r14,%rdi
mov    $0x8,%esi
jmp    1178 <main+0x58>
lea    -0x57(%rax),%ecx
cmp    $0x3,%cl
ja     1227 <main+0x107>
mov    %r14,%rdi
mov    $0x9,%esi
jmp    1178 <main+0x58>
movsbl %al,%esi
mov    %r15,%rdi
jmp    1178 <main+0x58>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %52, label %5
5: ; preds = %0, %48
%6 = load i8, i8* %1
%7 = add i8 %6, -65
%8 = icmp ult i8 %7, 3
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 2)
br label %48
11: ; preds = %5
%12 = add i8 %6, -68
%13 = icmp ult i8 %12, 3
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 3)
br label %48
16: ; preds = %11
%17 = add i8 %6, -71
%18 = icmp ult i8 %17, 3
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 4)
br label %48
21: ; preds = %16
%22 = add i8 %6, -74
%23 = icmp ult i8 %22, 3
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 5)
br label %48
26: ; preds = %21
%27 = add i8 %6, -77
%28 = icmp ult i8 %27, 3
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 6)
br label %48
31: ; preds = %26
%32 = and i8 %6, -4
%33 = icmp eq i8 %32, 80
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 7)
br label %48
36: ; preds = %31
%37 = add i8 %6, -84
%38 = icmp ult i8 %37, 3
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 8)
br label %48
41: ; preds = %36
%42 = add i8 %6, -87
%43 = icmp ult i8 %42, 4
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext 9)
br label %48
46: ; preds = %41
%47 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
br label %48
48: ; preds = %14, %24, %34, %44, %46, %39, %29, %19, %9
%49 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%50 = load i64, i64* @EOF
%51 = icmp eq i64 %49, %50
br i1 %51, label %52, label %5
52: ; preds = %48, %0
ret i32 0
}