#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 */
char getchar();
int /*<<< orphan*/ print_rot13(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char buf[64 + 2];
  while (buf[0] != 'q') {
    printf("Enter option: ");
    int i = 0;
    while ((buf[i++] = getchar()) != '\n' && i < 64 + 2)
      ;
    buf[i] = '\0';
    char word[i];
    for (i = 0; buf[i] != '\0'; i++) {
      word[i] = buf[i + 2];
    }
    word[i] = '\0';
    switch (buf[0]) {
    case 'c':
      print_rot13(word);
      printf("\n");
      break;
    case 'd':
      print_rot13(word);
      printf("\n");
      break;
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movsbl -0x50(%rbp),%eax
cmp    $0x71,%eax
je     1290 <main+0x160>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x54(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x54(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x54(%rbp)
movslq %ecx,%rcx
mov    %al,-0x50(%rbp,%rcx,1)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x69(%rbp)
je     1196 <main+0x66>
cmpl   $0x42,-0x54(%rbp)
setl   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    11a6 <main+0x76>
jmp    11ab <main+0x7b>
jmp    1162 <main+0x32>
movslq -0x54(%rbp),%rax
movb   $0x0,-0x50(%rbp,%rax,1)
mov    -0x54(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1219 <main+0xe9>
mov    -0x78(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    -0x50(%rbp,%rcx,1),%dl
movslq -0x54(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11e1 <main+0xb1>
mov    -0x78(%rbp),%rax
movslq -0x54(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movsbl -0x50(%rbp),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x63,%eax
je     124b <main+0x11b>
jmp    123a <main+0x10a>
mov    -0x7c(%rbp),%eax
sub    $0x64,%eax
je     1265 <main+0x135>
jmp    127f <main+0x14f>
mov    -0x78(%rbp),%rdi
call   1050 <print_rot13@plt>
lea    0xdb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1284 <main+0x154>
mov    -0x78(%rbp),%rdi
call   1050 <print_rot13@plt>
lea    0xd9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1284 <main+0x154>
jmp    1284 <main+0x154>
mov    -0x60(%rbp),%rax
mov    %rax,%rsp
jmp    1142 <main+0x12>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xeac(%rip),%r14
jmp    117b <main+0x3b>
cs nopw 0x0(%rax,%rax,1)
call   1060 <print_rot13@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rsp
cmp    $0x71,%bl
je     1218 <main+0xd8>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0x1(%rbx),%rcx
mov    %al,-0x60(%rbp,%rbx,1)
cmp    $0xa,%al
je     11ac <main+0x6c>
cmp    $0x41,%rbx
mov    %rcx,%rbx
jb     1190 <main+0x50>
mov    %rsp,%r15
movb   $0x0,-0x60(%rbp,%rcx,1)
mov    %rsp,%rdi
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rdi
mov    %rdi,%rsp
movsbl -0x60(%rbp),%ebx
test   %ebx,%ebx
je     1210 <main+0xd0>
mov    -0x5f(%rbp),%cl
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x5e(%rbp,%rax,1),%edx
mov    %dl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
mov    %edx,%ecx
jne    11e0 <main+0xa0>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
cmp    $0x64,%ebx
je     1160 <main+0x20>
cmp    $0x63,%ebx
je     1160 <main+0x20>
jmp    116f <main+0x2f>
nop
movb   $0x0,(%rdi)
jmp    116f <main+0x2f>
xor    %eax,%eax
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter option: \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [66 x i8]
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 0, i32* %1
br label %6
6: ; preds = %68, %0
%7 = getelementptr inbounds [66 x i8], [66 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 113
br i1 %10, label %11, label %70
11: ; preds = %6
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %13
13: ; preds = %26, %11
%14 = call signext i8 (...) @getchar()
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds [66 x i8], [66 x i8]* %2, i64 0, i64 %17
store i8 %14, i8* %18
%19 = sext i8 %14 to i32
%20 = icmp ne i32 %19, 10
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 66
br label %24
24: ; preds = %21, %13
%25 = phi i1 [ false, %13 ], [ %23, %21 ]
br i1 %25, label %26, label %27
26: ; preds = %24
br label %13
27: ; preds = %24
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [66 x i8], [66 x i8]* %2, i64 0, i64 %29
store i8 0, i8* %30
%31 = load i32, i32* %3
%32 = zext i32 %31 to i64
%33 = call i8* @llvm.stacksave()
store i8* %33, i8** %4
%34 = alloca i8, i64 %32
store i64 %32, i64* %5
store i32 0, i32* %3
br label %35
35: ; preds = %51, %27
%36 = load i32, i32* %3
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [66 x i8], [66 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %54
42: ; preds = %35
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 2
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [66 x i8], [66 x i8]* %2, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %34, i64 %49
store i8 %47, i8* %50
br label %51
51: ; preds = %42
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %35
54: ; preds = %35
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %34, i64 %56
store i8 0, i8* %57
%58 = getelementptr inbounds [66 x i8], [66 x i8]* %2, i64 0, i64 0
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
switch i32 %60, label %67 [
i32 99, label %61
i32 100, label %64
]
61: ; preds = %54
%62 = call i32 @print_rot13(i8* %34)
%63 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %68
64: ; preds = %54
%65 = call i32 @print_rot13(i8* %34)
%66 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %68
67: ; preds = %54
br label %68
68: ; preds = %67, %64, %61
%69 = load i8*, i8** %4
br label %6
70: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter option: \00"
define i32 @main() {
%1 = alloca [66 x i8]
%2 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 1
br label %4
4: ; preds = %0, %42
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %6, %4
%7 = phi i64 [ %9, %6 ], [ 0, %4 ]
%8 = call signext i8 (...) @getchar()
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 %7
store i8 %8, i8* %10
%11 = icmp ne i8 %8, 10
%12 = icmp ult i64 %7, 65
%13 = select i1 %11, i1 %12, i1 false
br i1 %13, label %6, label %14
14: ; preds = %6
%15 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 %9
store i8 0, i8* %15
%16 = call i8* @llvm.stacksave()
%17 = alloca i8, i64 %9
%18 = load i8, i8* %2
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
store i8 0, i8* %17
br label %42
21: ; preds = %14
%22 = load i8, i8* %3
br label %23
23: ; preds = %21, %23
%24 = phi i8 [ %22, %21 ], [ %28, %23 ]
%25 = phi i64 [ 0, %21 ], [ %30, %23 ]
%26 = add nuw nsw i64 %25, 2
%27 = getelementptr inbounds [66 x i8], [66 x i8]* %1, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = getelementptr inbounds i8, i8* %17, i64 %25
store i8 %28, i8* %29
%30 = add nuw nsw i64 %25, 1
%31 = icmp eq i8 %24, 0
br i1 %31, label %32, label %23
32: ; preds = %23
%33 = and i64 %30, 4294967295
%34 = getelementptr inbounds i8, i8* %17, i64 %33
store i8 0, i8* %34
%35 = sext i8 %18 to i32
switch i32 %35, label %42 [
i32 99, label %36
i32 100, label %39
]
36: ; preds = %32
%37 = call i32 @print_rot13(i8* %17)
%38 = call i32 @putchar(i32 10)
br label %42
39: ; preds = %32
%40 = call i32 @print_rot13(i8* %17)
%41 = call i32 @putchar(i32 10)
br label %42
42: ; preds = %20, %32, %39, %36
%43 = icmp eq i8 %18, 113
br i1 %43, label %44, label %4
44: ; preds = %42
ret i32 0
}