#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__ getline(char **, size_t *, int /*<<< orphan*/);
scalar_t__ isupper(char);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main() {
  char *line = NULL;
  size_t num = 0;
  char *endInput = "ENDOFINPUT\n\0";
  char *start = "START\n\0";
  char *end = "END\n\0";
  int i;
  while (getline(&line, &num, stdin), strcmp(line, endInput)) {
    if (strcmp(line, start) && strcmp(line, end)) {
      for (i = 0; i < strlen(line); ++i) {
        if (isupper(line[i])) {
          if (line[i] > 'E')
            printf("%c", line[i] - 5);
          else
            printf("%c", line[i] + 21);
        } else
          printf("%c", line[i]);
      }
    } else
      continue;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe92(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe81(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2e51(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <getline@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     12be <main+0x16e>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     12b4 <main+0x164>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     12b4 <main+0x164>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
cmp    %ecx,%eax
jge    12af <main+0x15f>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <isupper@plt>
cmp    $0x0,%rax
je     1284 <main+0x134>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x45,%eax
jle    1261 <main+0x111>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x5,%eax
lea    0xdc7(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    127f <main+0x12f>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x15,%eax
lea    0xda4(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    129c <main+0x14c>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
lea    0xd88(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
jmp    12a1 <main+0x151>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11f2 <main+0xa2>
jmp    12b9 <main+0x169>
jmp    1190 <main+0x40>
jmp    1190 <main+0x40>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2e71(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1070 <getline@plt>
mov    0x8(%rsp),%rdi
lea    0xe6c(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     128f <main+0x13f>
lea    0xe6a(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xe46(%rip),%rbx
lea    0xe5a(%rip),%rbp
jmp    11fa <main+0xaa>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x2e11(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <getline@plt>
mov    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     128f <main+0x13f>
mov    0x8(%rsp),%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11d0 <main+0x80>
mov    0x8(%rsp),%rdi
lea    0xdf5(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11d0 <main+0x80>
mov    0x8(%rsp),%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11d0 <main+0x80>
xor    %r13d,%r13d
jmp    1267 <main+0x117>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x15,%cl
movsbl %cl,%esi
mov    %rbp,%rdi
call   1040 <printf@plt>
add    $0x1,%r13
mov    0x8(%rsp),%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%r13
jge    11d0 <main+0x80>
mov    0x8(%rsp),%rax
movsbl (%rax,%r13,1),%edi
call   1060 <isupper@plt>
mov    0x8(%rsp),%rcx
movzbl (%rcx,%r13,1),%ecx
test   %rax,%rax
je     1243 <main+0xf3>
cmp    $0x46,%cl
jl     1240 <main+0xf0>
add    $0xfb,%cl
jmp    1243 <main+0xf3>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"ENDOFINPUT\0A\00\00"
@.str.1 = [8 x i8] c"START\0A\00\00"
@.str.2 = [6 x i8] c"END\0A\00\00"
@stdin = global i32 0
@.str.3 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = call i64 @getline(i8** %1, i64* %2, i32 %5)
%7 = load i8*, i8** %1
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %52, label %10
10: ; preds = %0, %46
%11 = load i8*, i8** %1
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %46, label %14
14: ; preds = %10
%15 = load i8*, i8** %1
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %46, label %18
18: ; preds = %14
%19 = load i8*, i8** %1
%20 = call i32 @strlen(i8* %19)
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %46
22: ; preds = %18, %38
%23 = phi i64 [ %41, %38 ], [ 0, %18 ]
%24 = load i8*, i8** %1
%25 = getelementptr inbounds i8, i8* %24, i64 %23
%26 = load i8, i8* %25
%27 = call i64 @isupper(i8 signext %26)
%28 = icmp eq i64 %27, 0
%29 = load i8*, i8** %1
%30 = getelementptr inbounds i8, i8* %29, i64 %23
%31 = load i8, i8* %30
br i1 %28, label %38, label %32
32: ; preds = %22
%33 = icmp sgt i8 %31, 69
br i1 %33, label %34, label %36
34: ; preds = %32
%35 = add nsw i8 %31, -5
br label %38
36: ; preds = %32
%37 = add nsw i8 %31, 21
br label %38
38: ; preds = %22, %36, %34
%39 = phi i8 [ %37, %36 ], [ %35, %34 ], [ %31, %22 ]
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8 signext %39)
%41 = add nuw nsw i64 %23, 1
%42 = load i8*, i8** %1
%43 = call i32 @strlen(i8* %42)
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %41, %44
br i1 %45, label %22, label %46
46: ; preds = %38, %10, %14, %18
%47 = load i32, i32* @stdin
%48 = call i64 @getline(i8** %1, i64* %2, i32 %47)
%49 = load i8*, i8** %1
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %10
52: ; preds = %46, %0
ret i32 0
}