#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*/ decrypt();
int /*<<< orphan*/ encrypt();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ch;
  printf("Menu :\n1. Encrypt\n2. Decrypt\nChoose : ");
  scanf("%d", &ch);
  switch (ch) {
  case 1:
    encrypt();
    break;
  case 2:
    decrypt();
    break;
  default:
    printf("\nWrong choice\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1190 <main+0x50>
jmp    117f <main+0x3f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     119c <main+0x5c>
jmp    11a8 <main+0x68>
mov    $0x0,%al
call   1050 <encrypt@plt>
jmp    11b4 <main+0x74>
mov    $0x0,%al
call   1030 <decrypt@plt>
jmp    11b4 <main+0x74>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1185 <main+0x35>
cmp    $0x1,%eax
jne    118e <main+0x3e>
xor    %eax,%eax
call   1060 <encrypt@plt>
jmp    119a <main+0x4a>
xor    %eax,%eax
call   1030 <decrypt@plt>
jmp    119a <main+0x4a>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Menu :\0A1. Encrypt\0A2. Decrypt\0AChoose : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"\0AWrong choice\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 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), i32* %2)
%5 = load i32, i32* %2
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 (...) @encrypt()
br label %12
8: ; preds = %0
%9 = call i32 (...) @decrypt()
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Menu :\0A1. Encrypt\0A2. Decrypt\0AChoose : \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [14 x i8] c"\0AWrong choice\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 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), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %10 [
i32 1, label %6
i32 2, label %8
]
6: ; preds = %0
%7 = call i32 (...) @encrypt()
br label %12
8: ; preds = %0
%9 = call i32 (...) @decrypt()
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6
ret i32 0
}