#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 /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  int beg, end, p = 0;
  do {
    scanf("%c", &c);
  } while (c < 'a' || c > 'z');
  beg = 97;
  end = 122;
  p = c - beg;
  printf("%c\n", end - p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x61,%ecx
mov    %al,-0x15(%rbp)
jl     1165 <main+0x45>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1136 <main+0x16>
movl   $0x61,-0xc(%rbp)
movl   $0x7a,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%esi
sub    -0x14(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movzbl 0x7(%rsp),%eax
lea    -0x7b(%rax),%ecx
cmp    $0xe6,%cl
jb     1130 <main+0x10>
mov    $0xdb,%esi
sub    %eax,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %6
6: ; preds = %16, %0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 97
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 122
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
br i1 %17, label %6, label %18
18: ; preds = %16
store i32 97, i32* %3
store i32 122, i32* %4
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = load i32, i32* %3
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %5
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = sub nsw i32 %23, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -123
%6 = icmp ult i8 %5, -26
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = zext i8 %4 to i32
%9 = sub nuw nsw i32 219, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}