#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 palavra[255];
  printf("Digite a palavra que deseja criptografar: ");
  scanf(" %s", palavra);
  for (int i = 0; palavra[i] != '\0'; i++) {
    if (palavra[i] >= 'a' && palavra[i] < 'n')
      palavra[i] += 13;
    else if (palavra[i] >= 'n' && palavra[i] <= 'z')
      palavra[i] -= 13;
  }
  printf("\n%s\n", palavra);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xedd(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x114(%rbp)
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     122a <main+0x10a>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     11c3 <main+0xa3>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x6e,%eax
jge    11c3 <main+0xa3>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%ecx
ff
add    $0xd,%ecx
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1211 <main+0xf1>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x6e,%eax
jl     120c <main+0xec>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     120c <main+0xec>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%ecx
ff
sub    $0xd,%ecx
mov    %cl,-0x110(%rbp,%rax,1)
jmp    1211 <main+0xf1>
jmp    1216 <main+0xf6>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    115d <main+0x3d>
lea    -0x110(%rbp),%rsi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%al
test   %al,%al
je     1188 <main+0x68>
lea    0x1(%rsp),%rcx
jmp    1170 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %dl,%al
mov    %al,-0x1(%rcx)
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
je     1188 <main+0x68>
lea    -0x61(%rax),%esi
mov    $0xd,%dl
cmp    $0xd,%sil
jb     1160 <main+0x40>
lea    -0x6e(%rax),%esi
mov    $0xf3,%dl
cmp    $0xc,%sil
jbe    1160 <main+0x40>
jmp    1165 <main+0x45>
lea    0xea0(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Digite a palavra que deseja criptografar: \00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [5 x i8] c"\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [255 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
store i32 0, i32* %3
br label %7
7: ; preds = %60, %0
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %63
14: ; preds = %7
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 97
br i1 %20, label %21, label %36
21: ; preds = %14
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp slt i32 %26, 110
br i1 %27, label %28, label %36
28: ; preds = %21
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = add nsw i32 %33, 13
%35 = trunc i32 %34 to i8
store i8 %35, i8* %31
br label %59
36: ; preds = %21, %14
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp sge i32 %41, 110
br i1 %42, label %43, label %58
43: ; preds = %36
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp sle i32 %48, 122
br i1 %49, label %50, label %58
50: ; preds = %43
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = sub nsw i32 %55, 13
%57 = trunc i32 %56 to i8
store i8 %57, i8* %53
br label %58
58: ; preds = %50, %43, %36
br label %59
59: ; preds = %58, %28
br label %60
60: ; preds = %59
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %7
63: ; preds = %7
%64 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %64)
%66 = load i32, i32* %1
ret i32 %66
}

LLVM IR (-O2):
@.str = [43 x i8] c"Digite a palavra que deseja criptografar: \00"
@.str.1 = [4 x i8] c" %s\00"
@.str.2 = [5 x i8] c"\0A%s\0A\00"
define i32 @main() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %21, %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
9: ; preds = %0, %21
%10 = phi i64 [ %22, %21 ], [ 0, %0 ]
%11 = phi i8 [ %24, %21 ], [ %5, %0 ]
%12 = phi i8* [ %23, %21 ], [ %2, %0 ]
%13 = add i8 %11, -97
%14 = icmp ult i8 %13, 13
br i1 %14, label %18, label %15
15: ; preds = %9
%16 = add i8 %11, -110
%17 = icmp ult i8 %16, 13
br i1 %17, label %18, label %21
18: ; preds = %15, %9
%19 = phi i8 [ 13, %9 ], [ -13, %15 ]
%20 = add nsw i8 %11, %19
store i8 %20, i8* %12
br label %21
21: ; preds = %18, %15
%22 = add nuw i64 %10, 1
%23 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 0
br i1 %25, label %7, label %9
}