#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);
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int choice, item;
  char ans;
  initialize();
  do {
    puts("1. Insert\n2. Delete\n3. Display\n4. Exit");
    scanf(" %d%*c", &choice);
    switch (choice) {
    case 1:
      puts("Item?");
      scanf(" %d%*c", &item);
      enqueue(item);
      break;
    case 2:
      dequeue();
      break;
    case 3:
      display();
      break;
    }
    puts("Continue?");
    scanf(" %c%*c", &ans);
  } while (ans == 'Y' || ans == 'y');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <initialize@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11ca <main+0x6a>
jmp    11a8 <main+0x48>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11f5 <main+0x95>
jmp    11b9 <main+0x59>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     1201 <main+0xa1>
jmp    1208 <main+0xa8>
lea    0xe5d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4a(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1080 <enqueue@plt>
jmp    1208 <main+0xa8>
mov    $0x0,%al
call   1060 <dequeue@plt>
jmp    1208 <main+0xa8>
mov    $0x0,%al
call   1040 <display@plt>
lea    0xe25(%rip),%rdi
call   1030 <puts@plt>
lea    0xe23(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movsbl -0xd(%rbp),%ecx
mov    $0x1,%al
cmp    $0x59,%ecx
mov    %al,-0x15(%rbp)
je     1245 <main+0xe5>
movsbl -0xd(%rbp),%eax
cmp    $0x79,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1176 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1050 <initialize@plt>
lea    0xe84(%rip),%r14
lea    0xea4(%rip),%rbx
lea    0x14(%rsp),%r15
lea    0xea5(%rip),%r12
lea    0xea8(%rip),%r13
lea    0xf(%rsp),%rbp
jmp    11c7 <main+0x67>
nopl   (%rax)
xor    %eax,%eax
call   1060 <dequeue@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movzbl 0xf(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
jne    122c <main+0xcc>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x3,%eax
je     1220 <main+0xc0>
cmp    $0x2,%eax
je     11a0 <main+0x40>
cmp    $0x1,%eax
jne    11a7 <main+0x47>
lea    0xe38(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x10(%rsp),%edi
call   1080 <enqueue@plt>
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <display@plt>
jmp    11a7 <main+0x47>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"1. Insert\0A2. Delete\0A3. Display\0A4. Exit\00"
@.str.1 = [7 x i8] c" %d%*c\00"
@.str.2 = [6 x i8] c"Item?\00"
@.str.3 = [10 x i8] c"Continue?\00"
@.str.4 = [7 x i8] c" %c%*c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 (...) @initialize()
br label %6
6: ; preds = %30, %0
%7 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
switch i32 %9, label %19 [
i32 1, label %10
i32 2, label %15
i32 3, label %17
]
10: ; preds = %6
%11 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
%14 = call i32 @enqueue(i32 %13)
br label %19
15: ; preds = %6
%16 = call i32 (...) @dequeue()
br label %19
17: ; preds = %6
%18 = call i32 (...) @display()
br label %19
19: ; preds = %6, %17, %15, %10
%20 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %4)
br label %22
22: ; preds = %19
%23 = load i8, i8* %4
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 89
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 121
br label %30
30: ; preds = %26, %22
%31 = phi i1 [ true, %22 ], [ %29, %26 ]
br i1 %31, label %6, label %32
32: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"1. Insert\0A2. Delete\0A3. Display\0A4. Exit\00"
@.str.1 = [7 x i8] c" %d%*c\00"
@.str.2 = [6 x i8] c"Item?\00"
@.str.3 = [10 x i8] c"Continue?\00"
@.str.4 = [7 x i8] c" %c%*c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (...) @initialize()
br label %7
7: ; preds = %20, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
switch i32 %10, label %20 [
i32 1, label %11
i32 2, label %16
i32 3, label %18
]
11: ; preds = %7
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = load i32, i32* %2
%15 = call i32 @enqueue(i32 %14)
br label %20
16: ; preds = %7
%17 = call i32 (...) @dequeue()
br label %20
18: ; preds = %7
%19 = call i32 (...) @display()
br label %20
20: ; preds = %7, %18, %16, %11
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%23 = load i8, i8* %3
%24 = and i8 %23, -33
%25 = icmp eq i8 %24, 89
br i1 %25, label %7, label %26
26: ; preds = %20
ret i32 0
}