#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 */
char getchar();
int /*<<< orphan*/ printf(char *, char);
main() {
  char ch;
  while ((ch = getchar()) != '\n') {
    if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) {
      ch += 4;
      if ((ch > 'Z' && ch < 'a') || (ch > 'z'))
        ch -= 26;
    }
    printf("%c", ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     11ce <main+0xae>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     115f <main+0x3f>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1179 <main+0x59>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     11b9 <main+0x99>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11b9 <main+0x99>
movsbl -0x5(%rbp),%eax
add    $0x4,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    119d <main+0x7d>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     11aa <main+0x8a>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    11b4 <main+0x94>
movsbl -0x5(%rbp),%eax
sub    $0x1a,%eax
mov    %al,-0x5(%rbp)
jmp    11b9 <main+0x99>
lea    0xe40(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     117b <main+0x5b>
movabs $0xf0000003f,%r14
lea    0xec0(%rip),%rbx
mov    %eax,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x19,%cl
ja     1163 <main+0x43>
lea    0x4(%rax),%ecx
lea    -0x57(%rax),%edx
cmp    $0x23,%dl
ja     1165 <main+0x45>
movzbl %dl,%edx
bt     %rdx,%r14
jae    1165 <main+0x45>
add    $0xea,%al
mov    %eax,%ecx
movsbl %cl,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %45, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %48
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 122
br i1 %14, label %23, label %15
15: ; preds = %11, %7
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %45
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 90
br i1 %22, label %23, label %45
23: ; preds = %19, %11
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = add nsw i32 %25, 4
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp sgt i32 %29, 90
br i1 %30, label %31, label %35
31: ; preds = %23
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp slt i32 %33, 97
br i1 %34, label %39, label %35
35: ; preds = %31, %23
%36 = load i8, i8* %2
%37 = sext i8 %36 to i32
%38 = icmp sgt i32 %37, 122
br i1 %38, label %39, label %44
39: ; preds = %35, %31
%40 = load i8, i8* %2
%41 = sext i8 %40 to i32
%42 = sub nsw i32 %41, 26
%43 = trunc i32 %42 to i8
store i8 %43, i8* %2
br label %44
44: ; preds = %39, %35
br label %45
45: ; preds = %44, %19, %15
%46 = load i8, i8* %2
%47 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %46)
br label %3
48: ; preds = %3
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %17, label %3
3: ; preds = %0, %12
%4 = phi i8 [ %15, %12 ], [ %1, %0 ]
%5 = and i8 %4, -33
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 26
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = add nuw nsw i8 %4, 4
switch i8 %4, label %12 [
i8 87, label %10
i8 122, label %10
i8 121, label %10
i8 120, label %10
i8 119, label %10
i8 92, label %10
i8 91, label %10
i8 90, label %10
i8 89, label %10
i8 88, label %10
]
10: ; preds = %8, %8, %8, %8, %8, %8, %8, %8, %8, %8
%11 = add nsw i8 %4, -22
br label %12
12: ; preds = %8, %3, %10
%13 = phi i8 [ %11, %10 ], [ %9, %8 ], [ %4, %3 ]
%14 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = tail call signext i8 (...) @getchar()
%16 = icmp eq i8 %15, 10
br i1 %16, label %17, label %3
17: ; preds = %12, %0
ret i32 0
}