int main() {
  const char cmd[24] = {"ENDOFINPUT\0"};
  char input_cmd[24];
  char data[4096];
  char cipher;
  int data_tail = 0;
  while (scanf("%s", input_cmd), strcmp(input_cmd, cmd)) {
    getchar();
    while ((cipher = getchar()) != '\n') {
      if (isupper(cipher)) {
        if (cipher > 'E')
          data[data_tail] = cipher - 5;
        else
          data[data_tail] = cipher + 21;
      } else
        data[data_tail] = cipher;
      ++data_tail;
    }
    data[data_tail] = cipher;
    ++data_tail;
    scanf("END");
    getchar();
  }
  int i;
  for (i = 0; i < data_tail; ++i)
    printf("%c", data[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe97(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe94(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe91(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1048(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     129d <main+0x14d>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x1041(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1260 <main+0x110>
movsbl -0x1041(%rbp),%edi
call   1060 <isupper@plt>
cmp    $0x0,%eax
je     1238 <main+0xe8>
movsbl -0x1041(%rbp),%eax
cmp    $0x45,%eax
jle    1219 <main+0xc9>
movsbl -0x1041(%rbp),%eax
sub    $0x5,%eax
mov    %al,%cl
movslq -0x1048(%rbp),%rax
mov    %cl,-0x1040(%rbp,%rax,1)
jmp    1233 <main+0xe3>
movsbl -0x1041(%rbp),%eax
add    $0x15,%eax
mov    %al,%cl
movslq -0x1048(%rbp),%rax
mov    %cl,-0x1040(%rbp,%rax,1)
jmp    124c <main+0xfc>
mov    -0x1041(%rbp),%cl
movslq -0x1048(%rbp),%rax
mov    %cl,-0x1040(%rbp,%rax,1)
mov    -0x1048(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1048(%rbp)
jmp    11bc <main+0x6c>
mov    -0x1041(%rbp),%cl
movslq -0x1048(%rbp),%rax
mov    %cl,-0x1040(%rbp,%rax,1)
mov    -0x1048(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1048(%rbp)
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
jmp    118d <main+0x3d>
movl   $0x0,-0x104c(%rbp)
mov    -0x104c(%rbp),%eax
cmp    -0x1048(%rbp),%eax
jge    12ea <main+0x19a>
movslq -0x104c(%rbp),%rax
movsbl -0x1040(%rbp,%rax,1),%esi
ff
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x104c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104c(%rbp)
jmp    12a7 <main+0x157>
xor    %eax,%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1028,%rsp
movabs $0x504e49464f444e45,%rbx
49 4e 50
movabs $0x5455504e49464f,%rbp
lea    0xeac(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%rax
xor    %rbx,%rax
mov    0x3(%rsp),%rcx
xor    %rbp,%rcx
or     %rax,%rcx
je     1293 <main+0x153>
mov    %rsp,%rbx
xor    %r13d,%r13d
jmp    11fd <main+0xbd>
cs nopw 0x0(%rax,%rax,1)
mov    %r13d,%r12d
movslq %r12d,%r13
mov    %r15b,0x20(%rsp,%r13,1)
add    $0x1,%r13d
lea    0xe65(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xe4d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    (%rsp),%rax
movabs $0x504e49464f444e45,%rcx
49 4e 50
xor    %rcx,%rax
mov    0x3(%rsp),%rcx
movabs $0x5455504e49464f,%rdx
xor    %rdx,%rcx
or     %rax,%rcx
je     1276 <main+0x136>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
mov    %eax,%ebp
shl    $0x18,%ebp
cmp    $0xa000000,%ebp
je     11a0 <main+0x60>
movslq %r13d,%rax
lea    (%rsp,%rax,1),%r14
add    $0x20,%r14
mov    %r13d,%r12d
jmp    125a <main+0x11a>
nopl   0x0(%rax,%rax,1)
add    $0x15,%r15b
mov    %r15b,(%r14)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
mov    %eax,%ebp
shl    $0x18,%ebp
add    $0x1,%r14
add    $0x1,%r12d
cmp    $0xa000000,%ebp
je     11a3 <main+0x63>
mov    %ebp,%edi
sar    $0x18,%edi
call   1050 <isupper@plt>
test   %eax,%eax
je     1234 <main+0xf4>
cmp    $0x45000001,%ebp
jl     1230 <main+0xf0>
add    $0xfb,%r15b
jmp    1234 <main+0xf4>
test   %r12d,%r12d
js     1293 <main+0x153>
mov    %r13d,%ebx
xor    %ebp,%ebp
movsbl 0x20(%rsp,%rbp,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1280 <main+0x140>
xor    %eax,%eax
add    $0x1028,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.cmd = [24 x i8] c"ENDOFINPUT\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"END\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i8]
%3 = alloca [24 x i8]
%4 = alloca [4096 x i8]
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [24 x i8]* %2 to i8*
store i32 0, i32* %6
br label %9
9: ; preds = %57, %0
%10 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%14 = call i32 @strcmp(i8* %12, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %66
16: ; preds = %9
%17 = call i32 (...) @getchar()
br label %18
18: ; preds = %54, %16
%19 = call i32 (...) @getchar()
%20 = trunc i32 %19 to i8
store i8 %20, i8* %5
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 10
br i1 %22, label %23, label %57
23: ; preds = %18
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
%26 = call i32 @isupper(i32 %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %49
28: ; preds = %23
%29 = load i8, i8* %5
%30 = sext i8 %29 to i32
%31 = icmp sgt i32 %30, 69
br i1 %31, label %32, label %40
32: ; preds = %28
%33 = load i8, i8* %5
%34 = sext i8 %33 to i32
%35 = sub nsw i32 %34, 5
%36 = trunc i32 %35 to i8
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %38
store i8 %36, i8* %39
br label %48
40: ; preds = %28
%41 = load i8, i8* %5
%42 = sext i8 %41 to i32
%43 = add nsw i32 %42, 21
%44 = trunc i32 %43 to i8
%45 = load i32, i32* %6
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %46
store i8 %44, i8* %47
br label %48
48: ; preds = %40, %32
br label %54
49: ; preds = %23
%50 = load i8, i8* %5
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %52
store i8 %50, i8* %53
br label %54
54: ; preds = %49, %48
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %18
57: ; preds = %18
%58 = load i8, i8* %5
%59 = load i32, i32* %6
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %60
store i8 %58, i8* %61
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%65 = call i32 (...) @getchar()
br label %9
66: ; preds = %9
store i32 0, i32* %7
br label %67
67: ; preds = %78, %66
%68 = load i32, i32* %7
%69 = load i32, i32* %6
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %81
71: ; preds = %67
%72 = load i32, i32* %7
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %71
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
store i32 %80, i32* %7
br label %67
81: ; preds = %67
ret i32 0
}

LLVM IR (-O2):
@__const.main.cmd = [24 x i8] c"ENDOFINPUT\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"END\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @bcmp(i8* dereferenceable(11) %3, i8* dereferenceable(11) getelementptr inbounds ([24 x i8], [24 x i8]* @__const.main.cmd, i64 0, i64 0), i64 11)
%7 = icmp eq i32 %6, 0
br i1 %7, label %63, label %12
8: ; preds = %43
%9 = icmp sgt i32 %45, -1
br i1 %9, label %10, label %63
10: ; preds = %8
%11 = zext i32 %49 to i64
br label %55
12: ; preds = %0, %43
%13 = phi i32 [ %49, %43 ], [ 0, %0 ]
%14 = call i32 (...) @getchar()
%15 = call i32 (...) @getchar()
%16 = shl i32 %15, 24
%17 = icmp eq i32 %16, 167772160
br i1 %17, label %43, label %18
18: ; preds = %12
%19 = sext i32 %13 to i64
br label %20
20: ; preds = %18, %34
%21 = phi i64 [ %19, %18 ], [ %37, %34 ]
%22 = phi i32 [ %16, %18 ], [ %39, %34 ]
%23 = phi i32 [ %15, %18 ], [ %38, %34 ]
%24 = trunc i32 %23 to i8
%25 = ashr exact i32 %22, 24
%26 = call i32 @isupper(i32 %25)
%27 = icmp eq i32 %26, 0
br i1 %27, label %34, label %28
28: ; preds = %20
%29 = icmp sgt i32 %22, 1157627904
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = add i8 %24, -5
br label %34
32: ; preds = %28
%33 = add i8 %24, 21
br label %34
34: ; preds = %20, %30, %32
%35 = phi i8 [ %31, %30 ], [ %33, %32 ], [ %24, %20 ]
%36 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %21
store i8 %35, i8* %36
%37 = add i64 %21, 1
%38 = call i32 (...) @getchar()
%39 = shl i32 %38, 24
%40 = icmp eq i32 %39, 167772160
br i1 %40, label %41, label %20
41: ; preds = %34
%42 = trunc i64 %37 to i32
br label %43
43: ; preds = %41, %12
%44 = phi i32 [ %15, %12 ], [ %38, %41 ]
%45 = phi i32 [ %13, %12 ], [ %42, %41 ]
%46 = trunc i32 %44 to i8
%47 = sext i32 %45 to i64
%48 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %47
store i8 %46, i8* %48
%49 = add nsw i32 %45, 1
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%51 = call i32 (...) @getchar()
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%53 = call i32 @bcmp(i8* dereferenceable(11) %3, i8* dereferenceable(11) getelementptr inbounds ([24 x i8], [24 x i8]* @__const.main.cmd, i64 0, i64 0), i64 11)
%54 = icmp eq i32 %53, 0
br i1 %54, label %8, label %12
55: ; preds = %10, %55
%56 = phi i64 [ 0, %10 ], [ %61, %55 ]
%57 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = call i32 @putchar(i32 %59)
%61 = add nuw nsw i64 %56, 1
%62 = icmp eq i64 %61, %11
br i1 %62, label %63, label %55
63: ; preds = %55, %0, %8
ret i32 0
}