#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*/ qdelete();
int /*<<< orphan*/ qdisplay();
int /*<<< orphan*/ qinsert();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ch;
  while (1) {
    printf("\n Queue Implementation using array \n\t1. Queue Insert\n\t2. "
           "Queue Delete\n\t3. Queue Display\n\t4. Exit system\n\t::");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      qinsert();
      break;
    case 2:
      qdelete();
      break;
    case 3:
      qdisplay();
      break;
    case 4:
      printf("\n Thank You\n");
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11dc <main+0x8c>
mov    -0x10(%rbp),%rax
lea    0xe65(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1070 <qinsert@plt>
jmp    11dc <main+0x8c>
mov    $0x0,%al
call   1040 <qdelete@plt>
jmp    11dc <main+0x8c>
mov    $0x0,%al
call   1050 <qdisplay@plt>
jmp    11dc <main+0x8c>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    115f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xea1(%rip),%r14
lea    0xf06(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xe7e(%rip),%rbx
jmp    1197 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <qdisplay@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1197 <main+0x37>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <qinsert@plt>
jmp    1197 <main+0x37>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <qdelete@plt>
jmp    1197 <main+0x37>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [108 x i8] c"\0A Queue Implementation using array \0A\091. Queue Insert\0A\092. Queue Delete\0A\093. Queue Display\0A\094. Exit system\0A\09::\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"\0A Thank You\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %15
%4 = call i32 @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %3
%8 = call i32 (...) @qinsert()
br label %15
9: ; preds = %3
%10 = call i32 (...) @qdelete()
br label %15
11: ; preds = %3
%12 = call i32 (...) @qdisplay()
br label %15
13: ; preds = %3
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
15: ; preds = %3, %11, %9, %7
br label %3
}

LLVM IR (-O2):
@.str = [108 x i8] c"\0A Queue Implementation using array \0A\091. Queue Insert\0A\092. Queue Delete\0A\093. Queue Display\0A\094. Exit system\0A\09::\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [12 x i8] c"\0A Thank You\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %7, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %7 [
i32 1, label %8
i32 2, label %10
i32 3, label %12
i32 4, label %14
]
7: ; preds = %3, %12, %10, %8
br label %3
8: ; preds = %3
%9 = call i32 (...) @qinsert()
br label %7
10: ; preds = %3
%11 = call i32 (...) @qdelete()
br label %7
12: ; preds = %3
%13 = call i32 (...) @qdisplay()
br label %7
14: ; preds = %3
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}