#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 option;
  while (option != 'q') {
    printf("Enter option: ");
    scanf("%c", &option);
    if (option == 'c' || option == 'd') {
      rot13();
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
je     118e <main+0x5e>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
je     1182 <main+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    1189 <main+0x59>
mov    $0x0,%al
call   1030 <rot13@plt>
jmp    113f <main+0xf>
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),%r14
lea    0xec8(%rip),%r15
lea    0xf(%rsp),%rbx
jmp    1154 <main+0x24>
xchg   %ax,%ax
cmp    $0x71,%al
je     1182 <main+0x52>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movzbl 0xf(%rsp),%eax
lea    -0x63(%rax),%ecx
cmp    $0x1,%cl
ja     1150 <main+0x20>
xor    %eax,%eax
call   1030 <rot13@plt>
movzbl 0xf(%rsp),%eax
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Enter option: \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %0, %11
%3 = call i32 @printf(i8* dereferenceable(1) 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* %1)
%5 = load i8, i8* %1
%6 = add i8 %5, -99
%7 = icmp ult i8 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 (...) @rot13()
%10 = load i8, i8* %1
br label %11
11: ; preds = %2, %8
%12 = phi i8 [ %5, %2 ], [ %10, %8 ]
%13 = icmp eq i8 %12, 113
br i1 %13, label %14, label %2
14: ; preds = %11
ret i32 0
}