#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 /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c, f, p;
  scanf("%c", &c);
  if (c >= 'a' && c <= 'z') {
    f = c - 'a';
    p = 'z' - f;
    printf("%c", p);
  } else {
    printf("error");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1188 <main+0x68>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1188 <main+0x68>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x7(%rbp)
movsbl -0x7(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1196 <main+0x76>
lea    0xe74(%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
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movzbl 0x7(%rsp),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     115d <main+0x2d>
mov    $0xdb,%edi
sub    %eax,%edi
call   1030 <putchar@plt>
jmp    116b <main+0x3b>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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