#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*/ 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: ");
    }
    scanf("%c", &key);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
je     11aa <main+0x7a>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
je     1182 <main+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    1195 <main+0x65>
mov    $0x0,%al
call   1030 <rot13@plt>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
jmp    115b <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    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xf(%rsp),%al
cmp    $0x71,%al
jne    116a <main+0x3a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xea1(%rip),%r14
lea    0xe97(%rip),%r15
lea    0xf(%rsp),%rbx
jmp    1194 <main+0x64>
nop
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x71,%al
je     115e <main+0x2e>
add    $0x9d,%al
cmp    $0x1,%al
ja     1180 <main+0x50>
xor    %eax,%eax
call   1030 <rot13@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
jmp    1180 <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 = %20, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 113
br i1 %8, label %9, label %22
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 %20
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))
br label %20
20: ; preds = %17, %13
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %5
22: ; 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 %17, label %6
6: ; preds = %0, %13
%7 = phi i8 [ %15, %13 ], [ %4, %0 ]
%8 = add i8 %7, -99
%9 = icmp ult i8 %8, 2
br i1 %9, label %10, label %13
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))
br label %13
13: ; preds = %6, %10
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%15 = load i8, i8* %1
%16 = icmp eq i8 %15, 113
br i1 %16, label %17, label %6
17: ; preds = %13, %0
ret i32 0
}