#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 */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(int);
int main(void) {
  int c, l;
  printf("Enter option: c");
  while ((c = getchar()) != EOF) {
    if (c >= 'A' && c <= 'Z') {
      if ((l = c + 13) <= 'Z')
        putchar(l);
      else {
        l = c - 13;
        putchar(l);
      }
    } else if (c >= 'a' && c <= 'z') {
      if ((l = c + 13) <= 'z')
        putchar(l);
      else {
        l = c - 13;
        putchar(l);
      }
    } else
      putchar(c);
  }
  printf("Enter option: d");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
je     1208 <main+0xd8>
cmpl   $0x41,-0x8(%rbp)
jl     11ad <main+0x7d>
cmpl   $0x5a,-0x8(%rbp)
jg     11ad <main+0x7d>
mov    -0x8(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x5a,%eax
jg     1197 <main+0x67>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    11a8 <main+0x78>
mov    -0x8(%rbp),%eax
sub    $0xd,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    1203 <main+0xd3>
cmpl   $0x61,-0x8(%rbp)
jl     11f6 <main+0xc6>
cmpl   $0x7a,-0x8(%rbp)
jg     11f6 <main+0xc6>
mov    -0x8(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x7a,%eax
jg     11e0 <main+0xb0>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    11f1 <main+0xc1>
mov    -0x8(%rbp),%eax
sub    $0xd,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    11fe <main+0xce>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1203 <main+0xd3>
jmp    114b <main+0x1b>
lea    0xe01(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9d(%rip),%rbx
jmp    1161 <main+0x31>
nopl   (%rax)
add    $0xfffffff3,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
je     1192 <main+0x62>
lea    -0x41(%rax),%ecx
cmp    $0x19,%ecx
ja     1180 <main+0x50>
cmp    $0x4d,%eax
ja     1150 <main+0x20>
jmp    118d <main+0x5d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x61(%rax),%ecx
cmp    $0x19,%ecx
ja     1153 <main+0x23>
cmp    $0x6d,%eax
ja     1150 <main+0x20>
add    $0xd,%eax
jmp    1153 <main+0x23>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Enter option: c\00"
@EOF = global i32 0
@.str.1 = [16 x i8] c"Enter option: d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %30, label %5
5: ; preds = %0, %24
%6 = phi i32 [ %27, %24 ], [ %2, %0 ]
%7 = add i32 %6, -65
%8 = icmp ult i32 %7, 26
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = icmp ult i32 %6, 78
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = add nuw nsw i32 %6, 13
br label %24
13: ; preds = %9
%14 = add nsw i32 %6, -13
br label %24
15: ; preds = %5
%16 = add i32 %6, -97
%17 = icmp ult i32 %16, 26
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = icmp ult i32 %6, 110
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = add nuw nsw i32 %6, 13
br label %24
22: ; preds = %18
%23 = add nsw i32 %6, -13
br label %24
24: ; preds = %15, %22, %20, %11, %13
%25 = phi i32 [ %23, %22 ], [ %21, %20 ], [ %12, %11 ], [ %14, %13 ], [ %6, %15 ]
%26 = tail call i32 @putchar(i32 %25)
%27 = tail call i32 (...) @getchar()
%28 = load i32, i32* @EOF
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %5
30: ; preds = %24, %0
%31 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}