#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*/ rot13();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char key;
  printf("Enter option: ");
  scanf("%c", &key);
  while (key != 'q') {
    if (key == 'c' || key == 'd') {
      rot13();
      printf("Enter Option: ");
      getchar();
    }
    scanf("%c", &key);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
je     11c1 <main+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
je     1192 <main+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    11ac <main+0x6c>
mov    $0x0,%al
call   1030 <rot13@plt>
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    0xe5c(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
jmp    116b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xf(%rsp),%al
cmp    $0x71,%al
jne    117a <main+0x3a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe91(%rip),%r14
lea    0xe87(%rip),%r15
lea    0xf(%rsp),%rbx
jmp    11a4 <main+0x64>
nop
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x71,%al
je     116e <main+0x2e>
add    $0x9d,%al
cmp    $0x1,%al
ja     1190 <main+0x50>
xor    %eax,%eax
call   1030 <rot13@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
jmp    1190 <main+0x50>

LLVM IR (-O0):
@.str = [15 x i8] c"Enter option: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [15 x i8] c"Enter Option: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %5
5: ; preds = %21, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 113
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 99
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 100
br i1 %16, label %17, label %21
17: ; preds = %13, %9
%18 = call i32 (...) @rot13()
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (...) @getchar()
br label %21
21: ; preds = %17, %13
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %5
23: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter option: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [15 x i8] c"Enter Option: \00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 113
br i1 %5, label %18, label %6
6: ; preds = %0, %14
%7 = phi i8 [ %16, %14 ], [ %4, %0 ]
%8 = add i8 %7, -99
%9 = icmp ult i8 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = call i32 (...) @rot13()
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (...) @getchar()
br label %14
14: ; preds = %6, %10
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%16 = load i8, i8* %1
%17 = icmp eq i8 %16, 113
br i1 %17, label %18, label %6
18: ; preds = %14, %0
ret i32 0
}