#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*/ create();
int /*<<< orphan*/ deq();
int /*<<< orphan*/ display();
int /*<<< orphan*/ empty();
int /*<<< orphan*/ enq(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int frontelement();
int /*<<< orphan*/ initial_queue();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ queuesize();
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int no, ch, e;
  printf("\n 1 - Enque");
  printf("\n 2 - Deque");
  printf("\n 3 - Front element");
  printf("\n 4 - Empty");
  printf("\n 5 - Exit");
  printf("\n 6 - Display");
  printf("\n 7 - Queue size");
  create();
  initial_queue();
  initial_queue();
  while (1) {
    printf("\n Enter choice : ");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      no = 9;
      enq(no);
      break;
    case 2:
      deq();
      break;
    case 3:
      e = frontelement();
      if (e != 0)
        printf("Front element : %d", e);
      else
        printf("\n No front element in Queue as queue is empty");
      break;
    case 4:
      empty();
      break;
    case 5:
      exit(0);
    case 6:
      display();
      break;
    case 7:
      queuesize();
      break;
    default:
      printf("Wrong choice, Please enter correct choice  ");
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <create@plt>
mov    $0x0,%al
call   1070 <initial_queue@plt>
mov    $0x0,%al
call   1070 <initial_queue@plt>
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     12fe <main+0x14e>
mov    -0x18(%rbp),%rax
lea    0xd93(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   10d0 <enq@plt>
jmp    130c <main+0x15c>
mov    $0x0,%al
call   1060 <deq@plt>
jmp    130c <main+0x15c>
mov    $0x0,%al
call   10b0 <frontelement@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     12c0 <main+0x110>
mov    -0xc(%rbp),%esi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12ce <main+0x11e>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    130c <main+0x15c>
mov    $0x0,%al
call   1080 <empty@plt>
jmp    130c <main+0x15c>
xor    %edi,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1040 <display@plt>
jmp    130c <main+0x15c>
mov    $0x0,%al
call   1030 <queuesize@plt>
jmp    130c <main+0x15c>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    122f <main+0x7f>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe58(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe57(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe57(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1090 <create@plt>
xor    %eax,%eax
call   1070 <initial_queue@plt>
xor    %eax,%eax
call   1070 <initial_queue@plt>
lea    0xe45(%rip),%r14
lea    0xe60(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe85(%rip),%r12
lea    0xdad(%rip),%r13
lea    0xe36(%rip),%rbp
jmp    1270 <main+0xc0>
xor    %eax,%eax
call   1030 <queuesize@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10a0 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     12a7 <main+0xf7>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    $0x9,%edi
call   10d0 <enq@plt>
jmp    1270 <main+0xc0>
mov    %r12,%rdi
jmp    12e7 <main+0x137>
xor    %eax,%eax
call   1060 <deq@plt>
jmp    1270 <main+0xc0>
xor    %eax,%eax
call   10b0 <frontelement@plt>
test   %eax,%eax
je     12e0 <main+0x130>
mov    %rbp,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1270 <main+0xc0>
xor    %eax,%eax
call   1080 <empty@plt>
jmp    1270 <main+0xc0>
xor    %eax,%eax
call   1040 <display@plt>
jmp    1270 <main+0xc0>
lea    0xdbc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1270 <main+0xc0>
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\0A 1 - Enque\00"
@.str.1 = [12 x i8] c"\0A 2 - Deque\00"
@.str.2 = [20 x i8] c"\0A 3 - Front element\00"
@.str.3 = [12 x i8] c"\0A 4 - Empty\00"
@.str.4 = [11 x i8] c"\0A 5 - Exit\00"
@.str.5 = [14 x i8] c"\0A 6 - Display\00"
@.str.6 = [17 x i8] c"\0A 7 - Queue size\00"
@.str.7 = [18 x i8] c"\0A Enter choice : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [19 x i8] c"Front element : %d\00"
@.str.10 = [46 x i8] c"\0A No front element in Queue as queue is empty\00"
@.str.11 = [44 x i8] c"Wrong choice, Please enter correct choice \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (...) @create()
%12 = call i32 (...) @initial_queue()
%13 = call i32 (...) @initial_queue()
br label %14
14: ; preds = %0, %43
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %2
switch i32 %17, label %41 [
i32 1, label %18
i32 2, label %21
i32 3, label %23
i32 4, label %33
i32 5, label %35
i32 6, label %37
i32 7, label %39
]
18: ; preds = %14
store i32 9, i32* %1
%19 = load i32, i32* %1
%20 = call i32 @enq(i32 %19)
br label %43
21: ; preds = %14
%22 = call i32 (...) @deq()
br label %43
23: ; preds = %14
%24 = call i32 (...) @frontelement()
store i32 %24, i32* %3
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i32, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %28)
br label %32
30: ; preds = %23
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
br label %43
33: ; preds = %14
%34 = call i32 (...) @empty()
br label %43
35: ; preds = %14
%36 = call i32 @exit(i32 0)
unreachable
37: ; preds = %14
%38 = call i32 (...) @display()
br label %43
39: ; preds = %14
%40 = call i32 (...) @queuesize()
br label %43
41: ; preds = %14
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0))
br label %43
43: ; preds = %41, %39, %37, %33, %32, %21, %18
br label %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0A 1 - Enque\00"
@.str.1 = [12 x i8] c"\0A 2 - Deque\00"
@.str.2 = [20 x i8] c"\0A 3 - Front element\00"
@.str.3 = [12 x i8] c"\0A 4 - Empty\00"
@.str.4 = [11 x i8] c"\0A 5 - Exit\00"
@.str.5 = [14 x i8] c"\0A 6 - Display\00"
@.str.6 = [17 x i8] c"\0A 7 - Queue size\00"
@.str.7 = [18 x i8] c"\0A Enter choice : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [19 x i8] c"Front element : %d\00"
@.str.10 = [46 x i8] c"\0A No front element in Queue as queue is empty\00"
@.str.11 = [44 x i8] c"Wrong choice, Please enter correct choice \00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%10 = tail call i32 (...) @create()
%11 = tail call i32 (...) @initial_queue()
%12 = tail call i32 (...) @initial_queue()
br label %13
13: ; preds = %26, %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
switch i32 %16, label %37 [
i32 1, label %17
i32 2, label %19
i32 3, label %21
i32 4, label %29
i32 5, label %31
i32 6, label %33
i32 7, label %35
]
17: ; preds = %13
%18 = call i32 @enq(i32 9)
br label %26
19: ; preds = %13
%20 = call i32 (...) @deq()
br label %26
21: ; preds = %13
%22 = call i32 (...) @frontelement()
%23 = icmp eq i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32 %22)
br label %26
26: ; preds = %24, %27, %37, %35, %33, %29, %19, %17
br label %13
27: ; preds = %21
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
br label %26
29: ; preds = %13
%30 = call i32 (...) @empty()
br label %26
31: ; preds = %13
%32 = call i32 @exit(i32 0)
unreachable
33: ; preds = %13
%34 = call i32 (...) @display()
br label %26
35: ; preds = %13
%36 = call i32 (...) @queuesize()
br label %26
37: ; preds = %13
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0))
br label %26
}