#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*/ deletef();
int /*<<< orphan*/ display();
int /*<<< orphan*/ insrear();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int ch, flag = 0;
  while (flag == 0) {
    printf("\n**MENU**\t1-Enqueue\t2-Dequeue\t3-Display\n4-EXIT\n");
    printf("Enter Choice\t: ");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      insrear();
      break;
    case 2:
      deletef();
      break;
    case 3:
      display();
      break;
    case 4:
      flag = 1;
      break;
    default:
      printf("Invalid choice\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1202 <main+0xb2>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     11f1 <main+0xa1>
mov    -0x18(%rbp),%rax
lea    0xe48(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <insrear@plt>
jmp    11fd <main+0xad>
mov    $0x0,%al
call   1030 <deletef@plt>
jmp    11fd <main+0xad>
mov    $0x0,%al
call   1040 <display@plt>
jmp    11fd <main+0xad>
movl   $0x1,-0xc(%rbp)
jmp    11fd <main+0xad>
lea    0xe5b(%rip),%rdi
call   1050 <printf@plt>
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    0xeb1(%rip),%r14
lea    0xe97(%rip),%r15
lea    0xea0(%rip),%r12
lea    0x4(%rsp),%rbx
lea    0xec6(%rip),%r13
lea    0xe6d(%rip),%rbp
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <display@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11f0 <main+0x90>
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
xor    %eax,%eax
call   1070 <insrear@plt>
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1040 <puts@plt>
jmp    11a7 <main+0x47>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <deletef@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 = [48 x i8] c"\0A**MENU**\091-Enqueue\092-Dequeue\093-Display\0A4-EXIT\0A\00"
@.str.1 = [16 x i8] c"Enter Choice\09: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [16 x i8] c"Invalid 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 = %21, %0
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
switch i32 %11, label %19 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
i32 4, label %18
]
12: ; preds = %7
%13 = call i32 (...) @insrear()
br label %21
14: ; preds = %7
%15 = call i32 (...) @deletef()
br label %21
16: ; preds = %7
%17 = call i32 (...) @display()
br label %21
18: ; preds = %7
store i32 1, i32* %3
br label %21
19: ; preds = %7
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
br label %21
21: ; preds = %19, %18, %16, %14, %12
br label %4
22: ; preds = %4
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Enter Choice\09: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [47 x i8] c"\0A**MENU**\091-Enqueue\092-Dequeue\093-Display\0A4-EXIT\00"
@str.4 = [15 x i8] c"Invalid choice\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %16, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %14 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %17
]
8: ; preds = %3
%9 = call i32 (...) @insrear()
br label %16
10: ; preds = %3
%11 = call i32 (...) @deletef()
br label %16
12: ; preds = %3
%13 = call i32 (...) @display()
br label %16
14: ; preds = %3
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
br label %16
16: ; preds = %14, %12, %10, %8
br label %3
17: ; preds = %3
ret i32 0
}