#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 EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char getchar();
scalar_t__ islower(char);
scalar_t__ isupper(char);
int /*<<< orphan*/ putchar(char);
int main(void) {
  char a, b;
  while ((a = getchar()) != EOF) {
    if (isupper(a))
      b = 'A' + (a - 'A' + 13) % 26;
    else if (islower(a))
      b = 'a' + (a - 'a' + 13) % 26;
    else
      b = a;
    putchar(b);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e75(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11fb <main+0xab>
movsbl -0x5(%rbp),%edi
call   1060 <isupper@plt>
cmp    $0x0,%rax
je     11b0 <main+0x60>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xd,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x41,%edx
mov    %dl,%al
mov    %al,-0x6(%rbp)
jmp    11ed <main+0x9d>
movsbl -0x5(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     11e2 <main+0x92>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xd,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
mov    %al,-0x6(%rbp)
jmp    11e8 <main+0x98>
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
jmp    11ed <main+0x9d>
movsbl -0x6(%rbp),%edi
call   1030 <putchar@plt>
jmp    115f <main+0xf>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e86(%rip),%r14
cmp    (%r14),%al
jne    116e <main+0x1e>
xor    %edi,%edi
call   1070 <exit@plt>
mov    %eax,%ebx
jmp    11b9 <main+0x69>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movswl %bp,%ebx
add    $0xffffffcc,%ebx
imul   $0x4ec5,%ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x13,%eax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%ebx
add    $0x41,%bl
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%al
je     1167 <main+0x17>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1060 <isupper@plt>
test   %rax,%rax
jne    1180 <main+0x30>
mov    %ebp,%edi
call   1040 <islower@plt>
test   %rax,%rax
je     11a3 <main+0x53>
movswl %bp,%ebx
add    $0xffffffac,%ebx
imul   $0x4ec5,%ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x13,%eax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%ebx
add    $0x61,%bl
jmp    11a3 <main+0x53>

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %37, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %40
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call i64 @isupper(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 65
%18 = add nsw i32 %17, 13
%19 = srem i32 %18, 26
%20 = add nsw i32 65, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
br label %37
22: ; preds = %10
%23 = load i8, i8* %2
%24 = call i64 @islower(i8 signext %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = sub nsw i32 %28, 97
%30 = add nsw i32 %29, 13
%31 = srem i32 %30, 26
%32 = add nsw i32 97, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %3
br label %36
34: ; preds = %22
%35 = load i8, i8* %2
store i8 %35, i8* %3
br label %36
36: ; preds = %34, %26
br label %37
37: ; preds = %36, %14
%38 = load i8, i8* %3
%39 = call i32 @putchar(i8 signext %38)
br label %4
40: ; preds = %4
%41 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %28, label %4
4: ; preds = %0, %22
%5 = phi i8 [ %25, %22 ], [ %1, %0 ]
%6 = sext i8 %5 to i16
%7 = tail call i64 @isupper(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = add nsw i16 %6, -52
%11 = srem i16 %10, 26
%12 = trunc i16 %11 to i8
%13 = add nsw i8 %12, 65
br label %22
14: ; preds = %4
%15 = tail call i64 @islower(i8 signext %5)
%16 = icmp eq i64 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %14
%18 = add nsw i16 %6, -84
%19 = srem i16 %18, 26
%20 = trunc i16 %19 to i8
%21 = add nsw i8 %20, 97
br label %22
22: ; preds = %14, %17, %9
%23 = phi i8 [ %13, %9 ], [ %21, %17 ], [ %5, %14 ]
%24 = tail call i32 @putchar(i8 signext %23)
%25 = tail call signext i8 (...) @getchar()
%26 = load i8, i8* @EOF
%27 = icmp eq i8 %25, %26
br i1 %27, label %28, label %4
28: ; preds = %22, %0
%29 = tail call i32 @exit(i32 0)
unreachable
}