#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 *, ...);
int main() {
  char letter;
  letter = getchar();
  if (letter >= 'a' || letter <= 'z') {
    if (letter < 110) {
      letter = letter + (25 - 2 * (letter - 97));
      printf("%c\n", letter);
    } else {
      letter = letter + (25 - 2 * (letter - 97));
      printf("%c\n", letter);
    }
  } else {
    printf("\nTry again! OR Press esc! ");
  }
  return 0;
}


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 -0x5(%rbp),%eax
cmp    $0x61,%eax
jge    1153 <main+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     11c2 <main+0xa2>
movsbl -0x5(%rbp),%eax
cmp    $0x6e,%eax
jge    1191 <main+0x71>
movsbl -0x5(%rbp),%eax
movsbl -0x5(%rbp),%edx
sub    $0x61,%edx
shl    $0x1,%edx
mov    $0x19,%ecx
sub    %edx,%ecx
add    %ecx,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bd <main+0x9d>
movsbl -0x5(%rbp),%eax
movsbl -0x5(%rbp),%edx
sub    $0x61,%edx
shl    $0x1,%edx
mov    $0x19,%ecx
sub    %edx,%ecx
add    %ecx,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d0 <main+0xb0>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    (%rax,%rax,1),%ecx
mov    %eax,%edx
sub    %cl,%dl
add    $0xdb,%dl
cmp    $0x6e,%al
movsbl %dl,%eax
movzbl %al,%esi
cmovl  %eax,%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp slt i8 %1, 110
%3 = mul i8 %1, -2
%4 = add i8 %1, -37
%5 = add i8 %4, %3
%6 = sext i8 %5 to i32
%7 = zext i8 %5 to i32
%8 = select i1 %2, i32 %6, i32 %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}