#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*/ dequeue();
int /*<<< orphan*/ display();
int /*<<< orphan*/ enqueue();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int choice, flag = 0;
start:
  printf("\n*******************MENU***********************\n");
  printf("1.)enqueue\n");
  printf("2.)dequeue\n");
  printf("3.)display\n");
  printf("4.)exit\n");
  printf("enter your choice=");
  scanf("%d", &choice);
  switch (choice) {
  case 1:
    enqueue();
    break;
  case 2:
    dequeue();
    break;
  case 3:
    display();
    break;
  case 4:
    flag = 1;
    break;
  default:
    printf("\nplease enter a correct choice\n");
  }
  if (flag == 0) {
    goto start;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     1217 <main+0xc7>
mov    -0x18(%rbp),%rax
lea    0xe22(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <enqueue@plt>
jmp    1223 <main+0xd3>
mov    $0x0,%al
call   1050 <dequeue@plt>
jmp    1223 <main+0xd3>
mov    $0x0,%al
call   1030 <display@plt>
jmp    1223 <main+0xd3>
movl   $0x1,-0xc(%rbp)
jmp    1223 <main+0xd3>
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1232 <main+0xe2>
jmp    1166 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xefa(%rip),%r13
lea    0xefe(%rip),%rbx
lea    0xe90(%rip),%rbp
lea    0xe9c(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe6d(%rip),%r12
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <display@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1210 <main+0xb0>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <enqueue@plt>
jmp    11a7 <main+0x47>
nopl   0x0(%rax)
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
jmp    11a7 <main+0x47>
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <dequeue@plt>
jmp    11a7 <main+0x47>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0A*******************MENU***********************\0A\00"
@.str.1 = [12 x i8] c"1.)enqueue\0A\00"
@.str.2 = [12 x i8] c"2.)dequeue\0A\00"
@.str.3 = [12 x i8] c"3.)display\0A\00"
@.str.4 = [9 x i8] c"4.)exit\0A\00"
@.str.5 = [19 x i8] c"enter your choice=\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [32 x i8] c"\0Aplease enter a correct choice\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %25, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
switch i32 %12, label %20 [
i32 1, label %13
i32 2, label %15
i32 3, label %17
i32 4, label %19
]
13: ; preds = %4
%14 = call i32 (...) @enqueue()
br label %22
15: ; preds = %4
%16 = call i32 (...) @dequeue()
br label %22
17: ; preds = %4
%18 = call i32 (...) @display()
br label %22
19: ; preds = %4
store i32 1, i32* %3
br label %22
20: ; preds = %4
%21 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
br label %22
22: ; preds = %20, %19, %17, %15, %13
%23 = load i32, i32* %3
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
br label %4
26: ; preds = %22
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str.5 = [19 x i8] c"enter your choice=\00"
@.str.6 = [3 x i8] c"%d\00"
@str = [48 x i8] c"\0A*******************MENU***********************\00"
@str.8 = [11 x i8] c"1.)enqueue\00"
@str.9 = [11 x i8] c"2.)dequeue\00"
@str.10 = [11 x i8] c"3.)display\00"
@str.11 = [8 x i8] c"4.)exit\00"
@str.12 = [31 x i8] c"\0Aplease enter a correct choice\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %20, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.8, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.9, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.10, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.11, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
switch i32 %11, label %18 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %21
]
12: ; preds = %3
%13 = call i32 (...) @enqueue()
br label %20
14: ; preds = %3
%15 = call i32 (...) @dequeue()
br label %20
16: ; preds = %3
%17 = call i32 (...) @display()
br label %20
18: ; preds = %3
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.12, i64 0, i64 0))
br label %20
20: ; preds = %18, %16, %14, %12
br label %3
21: ; preds = %3
ret i32 0
}