#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stdout;
char encrypt(char c) {
  const char first = 33;
  const char last = 126;
  if (c == ' ' || c == '\n' || c == '\r' || c == '\t')
    return c;
  if (c < first || c > last) {
    fprintf(stdout,
            "non-printable "
            "character %hhd found. check "
            "your input.\n",
            c);
    exit(EXIT_FAILURE);
  }
  int i = c;
  i += 5;
  if (i > last) {
    i = first + (i - last);
  }
  return (char)i;
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movb   $0x21,-0x3(%rbp)
movb   $0x7e,-0x4(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
je     116a <encrypt+0x4a>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
je     116a <encrypt+0x4a>
movsbl -0x2(%rbp),%eax
cmp    $0xd,%eax
je     116a <encrypt+0x4a>
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jne    1175 <encrypt+0x55>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    11e2 <encrypt+0xc2>
movsbl -0x2(%rbp),%eax
cmp    $0x21,%eax
jl     118f <encrypt+0x6f>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jle    11b6 <encrypt+0x96>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
lea    0xe61(%rip),%rsi
movsbl -0x2(%rbp),%edx
call   1030 <fprintf@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jle    11dc <encrypt+0xbc>
mov    -0x8(%rbp),%eax
sub    $0x7e,%eax
add    $0x21,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
cmp    $0x20,%dil
ja     113d <encrypt+0x1d>
movzbl %dil,%eax
movabs $0x100002600,%rcx
bt     %rax,%rcx
jae    113d <encrypt+0x1d>
mov    %edi,%eax
ret
lea    -0x7f(%rdi),%eax
cmp    $0xa1,%al
jbe    115d <encrypt+0x3d>
cmp    $0x7a,%dil
mov    $0xa8,%eax
mov    $0x5,%ecx
cmovae %eax,%ecx
add    %dil,%cl
mov    %ecx,%edi
mov    %edi,%eax
ret
push   %rax
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
movsbl %dil,%edx
lea    0xe8e(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [55 x i8] c"non-printable character %hhd found. check your input.\0A\00"
@EXIT_FAILURE = global i32 0
define signext i8 @encrypt(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i8 %0, i8* %3
store i8 33, i8* %4
store i8 126, i8* %5
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %22, label %10
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 9
br i1 %21, label %22, label %24
22: ; preds = %18, %14, %10, %1
%23 = load i8, i8* %3
store i8 %23, i8* %2
br label %52
24: ; preds = %18
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp slt i32 %26, 33
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp sgt i32 %30, 126
br i1 %31, label %32, label %38
32: ; preds = %28, %24
%33 = load i32, i32* @stdout
%34 = load i8, i8* %3
%35 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8 signext %34)
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %28
%39 = load i8, i8* %3
%40 = sext i8 %39 to i32
store i32 %40, i32* %6
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 5
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = icmp sgt i32 %43, 126
br i1 %44, label %45, label %49
45: ; preds = %38
%46 = load i32, i32* %6
%47 = sub nsw i32 %46, 126
%48 = add nsw i32 33, %47
store i32 %48, i32* %6
br label %49
49: ; preds = %45, %38
%50 = load i32, i32* %6
%51 = trunc i32 %50 to i8
store i8 %51, i8* %2
br label %52
52: ; preds = %49, %22
%53 = load i8, i8* %2
ret i8 %53
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [55 x i8] c"non-printable character %hhd found. check your input.\0A\00"
@EXIT_FAILURE = global i32 0
define signext i8 @encrypt(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %14
i8 13, label %14
i8 10, label %14
i8 9, label %14
]
2: ; preds = %1
%3 = add i8 %0, -127
%4 = icmp ult i8 %3, -94
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stdout
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = icmp ugt i8 %0, 121
%12 = select i1 %11, i8 -88, i8 5
%13 = add i8 %12, %0
br label %14
14: ; preds = %1, %1, %1, %1, %10
%15 = phi i8 [ %13, %10 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ], [ %0, %1 ]
ret i8 %15
}