#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*/ *fgets(char *, int, int /*<<< orphan*/);
char interval_subtract(unsigned int, int, char, char);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdin;
int main() {
  char signal_table[256];
  for (unsigned i = 0; i < 256; i++) {
    if (i >= 'a' && i <= 'z')
      signal_table[i] = interval_subtract(i, 3, 'a', 'z');
    else if (i >= 'A' && i <= 'Z')
      signal_table[i] = interval_subtract(i, 3, 'A', 'Z');
    else
      signal_table[i] = (char)i;
  }
  char buffer[8192];
  while (fgets(buffer, 8192, stdin) != NULL) {
    for (char *p = buffer; *p != 0; p++)
      putchar(signal_table[*p]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2130,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x114(%rbp)
cmpl   $0x100,-0x114(%rbp)
jae    121f <main+0xef>
cmpl   $0x61,-0x114(%rbp)
jb     11a4 <main+0x74>
cmpl   $0x7a,-0x114(%rbp)
ja     11a4 <main+0x74>
mov    -0x114(%rbp),%edi
mov    $0x3,%esi
mov    $0x61,%edx
mov    $0x7a,%ecx
call   1050 <interval_subtract@plt>
mov    %al,%cl
mov    -0x114(%rbp),%eax
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1206 <main+0xd6>
cmpl   $0x41,-0x114(%rbp)
jb     11ec <main+0xbc>
cmpl   $0x5a,-0x114(%rbp)
ja     11ec <main+0xbc>
mov    -0x114(%rbp),%edi
mov    $0x3,%esi
mov    $0x41,%edx
mov    $0x5a,%ecx
call   1050 <interval_subtract@plt>
mov    %al,%cl
mov    -0x114(%rbp),%eax
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1201 <main+0xd1>
mov    -0x114(%rbp),%eax
mov    %al,%cl
mov    -0x114(%rbp),%eax
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1206 <main+0xd6>
jmp    120b <main+0xdb>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    114c <main+0x1c>
jmp    1224 <main+0xf4>
lea    -0x2120(%rbp),%rdi
mov    0x2db6(%rip),%rax
mov    (%rax),%edx
mov    $0x2000,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     129d <main+0x16d>
lea    -0x2120(%rbp),%rax
mov    %rax,-0x2128(%rbp)
mov    -0x2128(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1298 <main+0x168>
mov    -0x2128(%rbp),%rax
movsbq (%rax),%rax
movsbl -0x110(%rbp,%rax,1),%edi
ff
call   1030 <putchar@plt>
mov    -0x2128(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2128(%rbp)
jmp    1256 <main+0x126>
jmp    1224 <main+0xf4>
xor    %eax,%eax
add    $0x2130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2108,%rsp
xor    %ebx,%ebx
jmp    1176 <main+0x46>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x61,%edx
mov    $0x7a,%ecx
call   1050 <interval_subtract@plt>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x100,%rbx
je     11a4 <main+0x74>
lea    -0x61(%rbx),%eax
cmp    $0x19,%eax
jbe    1150 <main+0x20>
lea    -0x41(%rbx),%eax
cmp    $0x19,%eax
ja     11a0 <main+0x70>
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x41,%edx
mov    $0x5a,%ecx
jmp    1161 <main+0x31>
nopl   0x0(%rax)
mov    %ebx,%eax
jmp    1166 <main+0x36>
mov    0x2e3d(%rip),%r14
mov    (%r14),%edx
lea    0x100(%rsp),%rdi
mov    $0x2000,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     122a <main+0xfa>
lea    0x101(%rsp),%r15
lea    0x100(%rsp),%r12
jmp    11f5 <main+0xc5>
nopw   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %r12,%rdi
mov    $0x2000,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     122a <main+0xfa>
mov    0x100(%rsp),%al
test   %al,%al
je     11e0 <main+0xb0>
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbq %al,%rax
movsbl (%rsp,%rax,1),%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1210 <main+0xe0>
jmp    11e0 <main+0xb0>
xor    %eax,%eax
add    $0x2108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = alloca [8192 x i8]
%5 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %3
br label %6
6: ; preds = %41, %0
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 256
br i1 %8, label %9, label %44
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp uge i32 %10, 97
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ule i32 %13, 122
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = call signext i8 @interval_subtract(i32 %16, i32 3, i8 signext 97, i8 signext 122)
%18 = load i32, i32* %3
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %19
store i8 %17, i8* %20
br label %40
21: ; preds = %12, %9
%22 = load i32, i32* %3
%23 = icmp uge i32 %22, 65
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp ule i32 %25, 90
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %3
%29 = call signext i8 @interval_subtract(i32 %28, i32 3, i8 signext 65, i8 signext 90)
%30 = load i32, i32* %3
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %31
store i8 %29, i8* %32
br label %39
33: ; preds = %24, %21
%34 = load i32, i32* %3
%35 = trunc i32 %34 to i8
%36 = load i32, i32* %3
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %37
store i8 %35, i8* %38
br label %39
39: ; preds = %33, %27
br label %40
40: ; preds = %39, %15
br label %41
41: ; preds = %40
%42 = load i32, i32* %3
%43 = add i32 %42, 1
store i32 %43, i32* %3
br label %6
44: ; preds = %6
br label %45
45: ; preds = %67, %44
%46 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%47 = load i32, i32* @stdin
%48 = call i32* @fgets(i8* %46, i32 8192, i32 %47)
%49 = icmp ne i32* %48, null
br i1 %49, label %50, label %68
50: ; preds = %45
%51 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
store i8* %51, i8** %5
br label %52
52: ; preds = %64, %50
%53 = load i8*, i8** %5
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %67
57: ; preds = %52
%58 = load i8*, i8** %5
%59 = load i8, i8* %58
%60 = sext i8 %59 to i64
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = call i32 @putchar(i8 signext %62)
br label %64
64: ; preds = %57
%65 = load i8*, i8** %5
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %5
br label %52
67: ; preds = %52
br label %45
68: ; preds = %45
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [8192 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
br label %9
4: ; preds = %25
%5 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32* @fgets(i8* %5, i32 8192, i32 %6)
%8 = icmp eq i32* %7, null
br i1 %8, label %47, label %34
9: ; preds = %0, %25
%10 = phi i64 [ 0, %0 ], [ %28, %25 ]
%11 = trunc i64 %10 to i32
%12 = trunc i64 %10 to i32
%13 = add i32 %12, -97
%14 = icmp ult i32 %13, 26
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = tail call signext i8 @interval_subtract(i32 %11, i32 3, i8 signext 97, i8 signext 122)
br label %25
17: ; preds = %9
%18 = trunc i64 %10 to i32
%19 = add i32 %18, -65
%20 = icmp ult i32 %19, 26
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call signext i8 @interval_subtract(i32 %11, i32 3, i8 signext 65, i8 signext 90)
br label %25
23: ; preds = %17
%24 = trunc i64 %10 to i8
br label %25
25: ; preds = %15, %23, %21
%26 = phi i8 [ %16, %15 ], [ %24, %23 ], [ %22, %21 ]
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %10
store i8 %26, i8* %27
%28 = add nuw nsw i64 %10, 1
%29 = icmp eq i64 %28, 256
br i1 %29, label %4, label %9
30: ; preds = %37, %34
%31 = load i32, i32* @stdin
%32 = call i32* @fgets(i8* %5, i32 8192, i32 %31)
%33 = icmp eq i32* %32, null
br i1 %33, label %47, label %34
34: ; preds = %4, %30
%35 = load i8, i8* %5
%36 = icmp eq i8 %35, 0
br i1 %36, label %30, label %37
37: ; preds = %34, %37
%38 = phi i8 [ %45, %37 ], [ %35, %34 ]
%39 = phi i8* [ %44, %37 ], [ %5, %34 ]
%40 = sext i8 %38 to i64
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = call i32 @putchar(i8 signext %42)
%44 = getelementptr inbounds i8, i8* %39, i64 1
%45 = load i8, i8* %44
%46 = icmp eq i8 %45, 0
br i1 %46, label %30, label %37
47: ; preds = %30, %4
ret i32 0
}