#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*/ scanf(char *, int *);
main() {
  int x;
  x = 0;
  printf("Enter Choice (1 - 3) : ");
  scanf("%d", &x);
  if (x == 1)
    printf("\nChoice is 1");
  else if (x == 2)
    printf("\nChoice is 2");
  else if (x == 3)
    printf("\nChoice is 3");
  else
    printf("\nInvalid Choice ");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    116d <main+0x4d>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
cmpl   $0x2,-0x8(%rbp)
jne    1188 <main+0x68>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    11b4 <main+0x94>
cmpl   $0x3,-0x8(%rbp)
jne    11a3 <main+0x83>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x8f>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    11b4 <main+0x94>
jmp    11b9 <main+0x99>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x2,%eax
ja     1164 <main+0x44>
cltq
lea    0xef9(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    116b <main+0x4b>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter Choice (1 - 3) : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\0AChoice is 1\00"
@.str.3 = [13 x i8] c"\0AChoice is 2\00"
@.str.4 = [13 x i8] c"\0AChoice is 3\00"
@.str.5 = [17 x i8] c"\0AInvalid Choice \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 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
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %23
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %22
14: ; preds = %9
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
br label %22
22: ; preds = %21, %12
br label %23
23: ; preds = %22, %7
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter Choice (1 - 3) : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\0AChoice is 1\00"
@.str.3 = [13 x i8] c"\0AChoice is 2\00"
@.str.4 = [13 x i8] c"\0AChoice is 3\00"
@.str.5 = [17 x i8] c"\0AInvalid Choice \00"
@reltable.main = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 3
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = sext i32 %6 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.main to i8*), i64 %10)
br label %12
12: ; preds = %0, %8
%13 = phi i8* [ %11, %8 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), %0 ]
%14 = call i32 @printf(i8* dereferenceable(1) %13)
ret i32 0
}