#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*/ dec(char *);
int /*<<< orphan*/ enc(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char b, chr[600];
  b = '*';
  while (b != 'q') {
    printf("Enter option : ");
    scanf("%c", &b);
    switch (b) {
    case 'c':
      enc(chr);
      break;
    case 'd':
      dec(chr);
      break;
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2a,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x71,%eax
je     11d7 <main+0x97>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0x264(%rbp)
sub    $0x63,%eax
je     11ab <main+0x6b>
jmp    1197 <main+0x57>
mov    -0x264(%rbp),%eax
sub    $0x64,%eax
je     11bc <main+0x7c>
jmp    11cd <main+0x8d>
lea    -0x260(%rbp),%rdi
call   1030 <enc@plt>
jmp    11d2 <main+0x92>
lea    -0x260(%rbp),%rdi
call   1040 <dec@plt>
jmp    11d2 <main+0x92>
jmp    11d2 <main+0x92>
jmp    1156 <main+0x16>
xor    %eax,%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x268,%rsp
movb   $0x2a,0xf(%rsp)
lea    0xea6(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0xf(%rsp),%rbx
lea    0x10(%rsp),%r12
jmp    1181 <main+0x41>
nopl   (%rax)
mov    %r12,%rdi
call   1040 <dec@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x71,%al
je     11b0 <main+0x70>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
movzbl 0xf(%rsp),%eax
movsbl %al,%ecx
cmp    $0x64,%ecx
je     1170 <main+0x30>
cmp    $0x63,%ecx
jne    117d <main+0x3d>
mov    %r12,%rdi
call   1030 <enc@plt>
jmp    1178 <main+0x38>
xor    %eax,%eax
add    $0x268,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 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 [600 x i8]
store i32 0, i32* %1
store i8 42, i8* %2
br label %4
4: ; preds = %20, %0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 113
br i1 %7, label %8, label %21
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
switch i32 %12, label %19 [
i32 99, label %13
i32 100, label %16
]
13: ; preds = %8
%14 = getelementptr inbounds [600 x i8], [600 x i8]* %3, i64 0, i64 0
%15 = call i32 @enc(i8* %14)
br label %20
16: ; preds = %8
%17 = getelementptr inbounds [600 x i8], [600 x i8]* %3, i64 0, i64 0
%18 = call i32 @dec(i8* %17)
br label %20
19: ; preds = %8
br label %20
20: ; preds = %19, %16, %13
br label %4
21: ; preds = %4
ret i32 0
}

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