#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int decode(char DecodedText[100]) {
  int decode_length = 0, counter_2;
  getchar();
  printf("Please input the text you want to decode:\n");
  do {
    scanf("%c", &DecodedText[decode_length]);
    decode_length++;
  } while (DecodedText[decode_length - 1] != 10);
  for (counter_2 = 0; counter_2 < decode_length; counter_2++) {
    if ((DecodedText[counter_2] >= 'a' && DecodedText[counter_2] <= 'm') ||
        (DecodedText[counter_2] >= 'A' && DecodedText[counter_2] <= 'M')) {
      DecodedText[counter_2] += 13;
    } else if ((DecodedText[counter_2] > 'm' &&
                DecodedText[counter_2] <= 'z') ||
               (DecodedText[counter_2] > 'M' &&
                DecodedText[counter_2] <= 'Z')) {
      DecodedText[counter_2] -= 13;
    }
    printf("%c", DecodedText[counter_2]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1158 <decode+0x28>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12a3 <decode+0x173>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     11cf <decode+0x9f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6d,%eax
jle    11f9 <decode+0xc9>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jl     1210 <decode+0xe0>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4d,%eax
jg     1210 <decode+0xe0>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0xd,%edx
mov    %dl,(%rax,%rcx,1)
jmp    127b <decode+0x14b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6d,%eax
jle    123a <decode+0x10a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jle    1264 <decode+0x134>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4d,%eax
jle    1276 <decode+0x146>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5a,%eax
jg     1276 <decode+0x146>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
sub    $0xd,%edx
mov    %dl,(%rax,%rcx,1)
jmp    127b <decode+0x14b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1199 <decode+0x69>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
xor    %r12d,%r12d
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
lea    0xe98(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r12,%rbx
lea    (%r15,%r12,1),%rsi
mov    %r14,%rdi
call   1060 <scanf@plt>
add    $0x1,%r12
cmpb   $0xa,(%r15,%rbx,1)
jne    1170 <decode+0x30>
mov    %r12d,%r14d
xor    %ebx,%ebx
jmp    11b7 <decode+0x77>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %dl,%al
mov    %al,(%r15,%rbx,1)
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
je     11d8 <decode+0x98>
movzbl (%r15,%rbx,1),%eax
mov    %eax,%ecx
and    $0xdf,%cl
lea    -0x41(%rcx),%esi
mov    $0xd,%dl
cmp    $0xd,%sil
jb     11a0 <decode+0x60>
add    $0xb2,%cl
mov    $0xf3,%dl
cmp    $0xc,%cl
jbe    11a0 <decode+0x60>
jmp    11a6 <decode+0x66>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Please input the text you want to decode:\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @decode(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = call i32 (...) @getchar()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %15, %1
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %7
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %16, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 10
br i1 %23, label %7, label %24
24: ; preds = %15
store i32 0, i32* %4
br label %25
25: ; preds = %120, %24
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %123
29: ; preds = %25
%30 = load i8*, i8** %2
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp sge i32 %35, 97
br i1 %36, label %37, label %45
37: ; preds = %29
%38 = load i8*, i8** %2
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %38, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp sle i32 %43, 109
br i1 %44, label %61, label %45
45: ; preds = %37, %29
%46 = load i8*, i8** %2
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %46, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp sge i32 %51, 65
br i1 %52, label %53, label %70
53: ; preds = %45
%54 = load i8*, i8** %2
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp sle i32 %59, 77
br i1 %60, label %61, label %70
61: ; preds = %53, %37
%62 = load i8*, i8** %2
%63 = load i32, i32* %4
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = add nsw i32 %67, 13
%69 = trunc i32 %68 to i8
store i8 %69, i8* %65
br label %112
70: ; preds = %53, %45
%71 = load i8*, i8** %2
%72 = load i32, i32* %4
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp sgt i32 %76, 109
br i1 %77, label %78, label %86
78: ; preds = %70
%79 = load i8*, i8** %2
%80 = load i32, i32* %4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp sle i32 %84, 122
br i1 %85, label %102, label %86
86: ; preds = %78, %70
%87 = load i8*, i8** %2
%88 = load i32, i32* %4
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %87, i64 %89
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp sgt i32 %92, 77
br i1 %93, label %94, label %111
94: ; preds = %86
%95 = load i8*, i8** %2
%96 = load i32, i32* %4
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %95, i64 %97
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp sle i32 %100, 90
br i1 %101, label %102, label %111
102: ; preds = %94, %78
%103 = load i8*, i8** %2
%104 = load i32, i32* %4
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = sub nsw i32 %108, 13
%110 = trunc i32 %109 to i8
store i8 %110, i8* %106
br label %111
111: ; preds = %102, %94, %86
br label %112
112: ; preds = %111, %61
%113 = load i8*, i8** %2
%114 = load i32, i32* %4
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %113, i64 %115
%117 = load i8, i8* %116
%118 = sext i8 %117 to i32
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %118)
br label %120
120: ; preds = %112
%121 = load i32, i32* %4
%122 = add nsw i32 %121, 1
store i32 %122, i32* %4
br label %25
123: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@str = [42 x i8] c"Please input the text you want to decode:\00"
define i32 @decode(i8* %0) {
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = add nuw i64 %5, 1
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = add i64 %5, 1
%13 = and i64 %12, 4294967295
br label %14
14: ; preds = %11, %27
%15 = phi i64 [ 0, %11 ], [ %31, %27 ]
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = and i8 %17, -33
%19 = add i8 %18, -65
%20 = icmp ult i8 %19, 13
br i1 %20, label %24, label %21
21: ; preds = %14
%22 = add i8 %18, -78
%23 = icmp ult i8 %22, 13
br i1 %23, label %24, label %27
24: ; preds = %21, %14
%25 = phi i8 [ 13, %14 ], [ -13, %21 ]
%26 = add nsw i8 %17, %25
store i8 %26, i8* %16
br label %27
27: ; preds = %24, %21
%28 = phi i8 [ %17, %21 ], [ %26, %24 ]
%29 = sext i8 %28 to i32
%30 = tail call i32 @putchar(i32 %29)
%31 = add nuw nsw i64 %15, 1
%32 = icmp eq i64 %31, %13
br i1 %32, label %33, label %14
33: ; preds = %27
ret i32 0
}