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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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    $0x63,%eax
je     1175 <main+0x45>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    117c <main+0x4c>
mov    $0x0,%al
call   1030 <rot13@plt>
jmp    1181 <main+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    115b <main+0x2b>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
jmp    1164 <main+0x34>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x71,%al
je     117a <main+0x4a>
lea    -0x63(%rax),%ecx
cmp    $0x1,%cl
ja     1160 <main+0x30>
xor    %eax,%eax
call   1030 <rot13@plt>
movzbl 0x7(%rsp),%eax
jmp    1160 <main+0x30>
xor    %eax,%eax
pop    %rcx
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
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %6
6: ; preds = %17, %0
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 99
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 100
br i1 %13, label %14, label %16
14: ; preds = %10, %6
%15 = call i32 (...) @rot13()
br label %16
16: ; preds = %14, %10
br label %17
17: ; preds = %16
%18 = load i8, i8* %2
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 113
br i1 %20, label %6, label %21
21: ; preds = %17
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
%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
br label %5
5: ; preds = %12, %0
%6 = phi i8 [ %13, %12 ], [ %4, %0 ]
%7 = add i8 %6, -99
%8 = icmp ult i8 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = call i32 (...) @rot13()
%11 = load i8, i8* %1
br label %12
12: ; preds = %9, %5
%13 = phi i8 [ %11, %9 ], [ %6, %5 ]
%14 = icmp eq i8 %13, 113
br i1 %14, label %15, label %5
15: ; preds = %12
ret i32 0
}