#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*/ cypher(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *);
int main() {
  char option;
  char buf[100];
  printf("enter option:");
  scanf("%s", &option);
  while (option == 'c' || option == 'd') {
    while (scanf("%s", buf)) {
      cypher(buf);
    }
  }
  if (option == 'q') {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x63,%ecx
mov    %al,-0x71(%rbp)
je     118d <main+0x4d>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
sete   %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    119d <main+0x5d>
jmp    11cf <main+0x8f>
jmp    11a2 <main+0x62>
lea    -0x70(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x0,%rax
je     11ca <main+0x8a>
lea    -0x70(%rbp),%rdi
call   1040 <cypher@plt>
jmp    11a2 <main+0x62>
jmp    116e <main+0x2e>
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
jne    11e3 <main+0xa3>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xf(%rsp),%al
lea    -0x63(%rax),%ecx
cmp    $0x1,%cl
ja     11a5 <main+0x65>
lea    0xe97(%rip),%r14
lea    0x10(%rsp),%rbx
jmp    1188 <main+0x48>
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <cypher@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jne    1180 <main+0x40>
movzbl 0xf(%rsp),%eax
lea    -0x63(%rax),%ecx
cmp    $0x1,%cl
jbe    1188 <main+0x48>
cmp    $0x71,%al
je     11b3 <main+0x73>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"enter option:\00"
@.str.1 = [3 x i8] c"%s\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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %6
6: ; preds = %24, %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 label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br i1 %15, label %16, label %25
16: ; preds = %14
br label %17
17: ; preds = %21, %16
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%23 = call i32 @cypher(i8* %22)
br label %17
24: ; preds = %17
br label %6
25: ; preds = %14
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 113
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %25
ret i32 0
}

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